Skip to content

Commit 642ae39

Browse files
authored
Merge pull request #74 from appwrite/dev
Dev
2 parents 362d8b3 + 86bb4c3 commit 642ae39

File tree

103 files changed

+143
-125
lines changed

Some content is hidden

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

103 files changed

+143
-125
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
# Change Log
1+
# Change Log
2+
3+
## 10.0.0
4+
5+
* Add `<REGION>` to doc examples due to the new multi region endpoints
6+
* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage
7+
* Remove `search` param from `listExecutions` method
8+
* Remove `Gif` from ImageFormat enum

README.md

Lines changed: 3 additions & 3 deletions
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-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.6.2-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.7.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.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-apple/releases).**
10+
**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-apple/releases).**
1111

1212
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Apple SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1313

@@ -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: "9.0.1"),
34+
.package(url: "[email protected]:appwrite/sdk-for-apple.git", from: "10.0.0"),
3535
],
3636
```
3737

Sources/Appwrite/Client.swift

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

3030
internal var config: [String: String] = [:]

Sources/Appwrite/Services/Databases.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ open class Databases: Service {
7575
/// collection resource using either a [server
7676
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
7777
/// API or directly from your database console.
78-
///
7978
///
8079
/// @param String databaseId
8180
/// @param String collectionId
@@ -125,7 +124,6 @@ open class Databases: Service {
125124
/// collection resource using either a [server
126125
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
127126
/// API or directly from your database console.
128-
///
129127
///
130128
/// @param String databaseId
131129
/// @param String collectionId

Sources/Appwrite/Services/Functions.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,18 @@ open class Functions: Service {
1414
///
1515
/// @param String functionId
1616
/// @param [String] queries
17-
/// @param String search
1817
/// @throws Exception
1918
/// @return array
2019
///
2120
open func listExecutions(
2221
functionId: String,
23-
queries: [String]? = nil,
24-
search: String? = nil
22+
queries: [String]? = nil
2523
) async throws -> AppwriteModels.ExecutionList {
2624
let apiPath: String = "/functions/{functionId}/executions"
2725
.replacingOccurrences(of: "{functionId}", with: functionId)
2826

2927
let apiParams: [String: Any?] = [
30-
"queries": queries,
31-
"search": search
28+
"queries": queries
3229
]
3330

3431
let apiHeaders: [String: String] = [:]

Sources/Appwrite/Services/Storage.swift

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,23 @@ open class Storage: Service {
224224
///
225225
/// @param String bucketId
226226
/// @param String fileId
227+
/// @param String token
227228
/// @throws Exception
228229
/// @return array
229230
///
230231
open func getFileDownload(
231232
bucketId: String,
232-
fileId: String
233+
fileId: String,
234+
token: String? = nil
233235
) async throws -> ByteBuffer {
234236
let apiPath: String = "/storage/buckets/{bucketId}/files/{fileId}/download"
235237
.replacingOccurrences(of: "{bucketId}", with: bucketId)
236238
.replacingOccurrences(of: "{fileId}", with: fileId)
237239

238-
let apiParams: [String: Any] = [:]
240+
let apiParams: [String: Any?] = [
241+
"token": token,
242+
"project": client.config["project"]
243+
]
239244

240245
return try await client.call(
241246
method: "GET",
@@ -264,6 +269,7 @@ open class Storage: Service {
264269
/// @param Int rotation
265270
/// @param String background
266271
/// @param AppwriteEnums.ImageFormat output
272+
/// @param String token
267273
/// @throws Exception
268274
/// @return array
269275
///
@@ -280,7 +286,8 @@ open class Storage: Service {
280286
opacity: Double? = nil,
281287
rotation: Int? = nil,
282288
background: String? = nil,
283-
output: AppwriteEnums.ImageFormat? = nil
289+
output: AppwriteEnums.ImageFormat? = nil,
290+
token: String? = nil
284291
) async throws -> ByteBuffer {
285292
let apiPath: String = "/storage/buckets/{bucketId}/files/{fileId}/preview"
286293
.replacingOccurrences(of: "{bucketId}", with: bucketId)
@@ -298,6 +305,7 @@ open class Storage: Service {
298305
"rotation": rotation,
299306
"background": background,
300307
"output": output,
308+
"token": token,
301309
"project": client.config["project"]
302310
]
303311

@@ -315,18 +323,23 @@ open class Storage: Service {
315323
///
316324
/// @param String bucketId
317325
/// @param String fileId
326+
/// @param String token
318327
/// @throws Exception
319328
/// @return array
320329
///
321330
open func getFileView(
322331
bucketId: String,
323-
fileId: String
332+
fileId: String,
333+
token: String? = nil
324334
) async throws -> ByteBuffer {
325335
let apiPath: String = "/storage/buckets/{bucketId}/files/{fileId}/view"
326336
.replacingOccurrences(of: "{bucketId}", with: bucketId)
327337
.replacingOccurrences(of: "{fileId}", with: fileId)
328338

329-
let apiParams: [String: Any] = [:]
339+
let apiParams: [String: Any?] = [
340+
"token": token,
341+
"project": client.config["project"]
342+
]
330343

331344
return try await client.call(
332345
method: "GET",

Sources/AppwriteEnums/ImageFormat.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Foundation
33
public enum ImageFormat: String, CustomStringConvertible {
44
case jpg = "jpg"
55
case jpeg = "jpeg"
6-
case gif = "gif"
76
case png = "png"
87
case webp = "webp"
98
case heic = "heic"

Sources/AppwriteModels/Execution.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ open class Execution: Codable {
6969
/// Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
7070
public let errors: String
7171

72-
/// Function execution duration in seconds.
72+
/// Resource(function/site) execution duration in seconds.
7373
public let duration: Double
7474

7575
/// The scheduled time for execution. If left empty, execution will be queued immediately.

docs/examples/account/create-anonymous-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Appwrite
22

33
let client = Client()
4-
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
4+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
66

77
let account = Account(client)

docs/examples/account/create-email-password-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Appwrite
22

33
let client = Client()
4-
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
4+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
66

77
let account = Account(client)

0 commit comments

Comments
 (0)