Skip to content

Commit 652036b

Browse files
authored
Merge pull request #50 from appwrite/dev
feat: Swift SDK update for version 14.0.0
2 parents be01492 + 8361827 commit 652036b

20 files changed

+42
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 14.1.0
4+
5+
* Added ability to create columns and indexes synchronously while creating a table
6+
37
## 14.0.0
48

59
* Rename `VCSDeploymentType` enum to `VCSReferenceType`

README.md

Lines changed: 1 addition & 1 deletion
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: "14.0.0"),
36+
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "14.1.0"),
3737
],
3838
```
3939

Sources/Appwrite/Client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ open class Client {
2222
"x-sdk-name": "Swift",
2323
"x-sdk-platform": "server",
2424
"x-sdk-language": "swift",
25-
"x-sdk-version": "14.0.0",
25+
"x-sdk-version": "14.1.0",
2626
"x-appwrite-response-format": "1.8.0"
2727
]
2828

Sources/Appwrite/Services/Account.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,8 @@ open class Account: Service {
19531953
"success": success,
19541954
"failure": failure,
19551955
"scopes": scopes,
1956-
"project": client.config["project"]
1956+
"project": client.config["project"],
1957+
"session": client.config["session"]
19571958
]
19581959

19591960
let apiHeaders: [String: String] = [:]

Sources/Appwrite/Services/Databases.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ open class Databases: Service {
450450
/// - permissions: [String] (optional)
451451
/// - documentSecurity: Bool (optional)
452452
/// - enabled: Bool (optional)
453+
/// - attributes: [Any] (optional)
454+
/// - indexes: [Any] (optional)
453455
/// - Throws: Exception if the request fails
454456
/// - Returns: AppwriteModels.Collection
455457
///
@@ -460,7 +462,9 @@ open class Databases: Service {
460462
name: String,
461463
permissions: [String]? = nil,
462464
documentSecurity: Bool? = nil,
463-
enabled: Bool? = nil
465+
enabled: Bool? = nil,
466+
attributes: [Any]? = nil,
467+
indexes: [Any]? = nil
464468
) async throws -> AppwriteModels.Collection {
465469
let apiPath: String = "/databases/{databaseId}/collections"
466470
.replacingOccurrences(of: "{databaseId}", with: databaseId)
@@ -470,7 +474,9 @@ open class Databases: Service {
470474
"name": name,
471475
"permissions": permissions,
472476
"documentSecurity": documentSecurity,
473-
"enabled": enabled
477+
"enabled": enabled,
478+
"attributes": attributes,
479+
"indexes": indexes
474480
]
475481

476482
let apiHeaders: [String: String] = [

Sources/Appwrite/Services/TablesDB.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ open class TablesDB: Service {
444444
/// - permissions: [String] (optional)
445445
/// - rowSecurity: Bool (optional)
446446
/// - enabled: Bool (optional)
447+
/// - columns: [Any] (optional)
448+
/// - indexes: [Any] (optional)
447449
/// - Throws: Exception if the request fails
448450
/// - Returns: AppwriteModels.Table
449451
///
@@ -453,7 +455,9 @@ open class TablesDB: Service {
453455
name: String,
454456
permissions: [String]? = nil,
455457
rowSecurity: Bool? = nil,
456-
enabled: Bool? = nil
458+
enabled: Bool? = nil,
459+
columns: [Any]? = nil,
460+
indexes: [Any]? = nil
457461
) async throws -> AppwriteModels.Table {
458462
let apiPath: String = "/tablesdb/{databaseId}/tables"
459463
.replacingOccurrences(of: "{databaseId}", with: databaseId)
@@ -463,7 +467,9 @@ open class TablesDB: Service {
463467
"name": name,
464468
"permissions": permissions,
465469
"rowSecurity": rowSecurity,
466-
"enabled": enabled
470+
"enabled": enabled,
471+
"columns": columns,
472+
"indexes": indexes
467473
]
468474

469475
let apiHeaders: [String: String] = [

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

docs/examples/account/create-email-token.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

docs/examples/account/create-jwt.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Appwrite
33
let client = Client()
44
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
55
.setProject("<YOUR_PROJECT_ID>") // Your project ID
6+
.setSession("") // The user session to authenticate with
67

78
let account = Account(client)
89

0 commit comments

Comments
 (0)