Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 14.1.0

* Added ability to create columns and indexes synchronously while creating a table

## 14.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
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: "git@github.com:appwrite/sdk-for-swift.git", from: "14.0.0"),
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "14.1.0"),
],
```

Expand Down
2 changes: 1 addition & 1 deletion Sources/Appwrite/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ open class Client {
"x-sdk-name": "Swift",
"x-sdk-platform": "server",
"x-sdk-language": "swift",
"x-sdk-version": "14.0.0",
"x-sdk-version": "14.1.0",
"x-appwrite-response-format": "1.8.0"
]

Expand Down
3 changes: 2 additions & 1 deletion Sources/Appwrite/Services/Account.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,8 @@ open class Account: Service {
"success": success,
"failure": failure,
"scopes": scopes,
"project": client.config["project"]
"project": client.config["project"],
"session": client.config["session"]
]

let apiHeaders: [String: String] = [:]
Expand Down
10 changes: 8 additions & 2 deletions Sources/Appwrite/Services/Databases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ open class Databases: Service {
/// - permissions: [String] (optional)
/// - documentSecurity: Bool (optional)
/// - enabled: Bool (optional)
/// - attributes: [Any] (optional)
/// - indexes: [Any] (optional)
/// - Throws: Exception if the request fails
/// - Returns: AppwriteModels.Collection
///
Expand All @@ -460,7 +462,9 @@ open class Databases: Service {
name: String,
permissions: [String]? = nil,
documentSecurity: Bool? = nil,
enabled: Bool? = nil
enabled: Bool? = nil,
attributes: [Any]? = nil,
indexes: [Any]? = nil
) async throws -> AppwriteModels.Collection {
let apiPath: String = "/databases/{databaseId}/collections"
.replacingOccurrences(of: "{databaseId}", with: databaseId)
Expand All @@ -470,7 +474,9 @@ open class Databases: Service {
"name": name,
"permissions": permissions,
"documentSecurity": documentSecurity,
"enabled": enabled
"enabled": enabled,
"attributes": attributes,
"indexes": indexes
]

let apiHeaders: [String: String] = [
Expand Down
10 changes: 8 additions & 2 deletions Sources/Appwrite/Services/TablesDB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ open class TablesDB: Service {
/// - permissions: [String] (optional)
/// - rowSecurity: Bool (optional)
/// - enabled: Bool (optional)
/// - columns: [Any] (optional)
/// - indexes: [Any] (optional)
/// - Throws: Exception if the request fails
/// - Returns: AppwriteModels.Table
///
Expand All @@ -453,7 +455,9 @@ open class TablesDB: Service {
name: String,
permissions: [String]? = nil,
rowSecurity: Bool? = nil,
enabled: Bool? = nil
enabled: Bool? = nil,
columns: [Any]? = nil,
indexes: [Any]? = nil
) async throws -> AppwriteModels.Table {
let apiPath: String = "/tablesdb/{databaseId}/tables"
.replacingOccurrences(of: "{databaseId}", with: databaseId)
Expand All @@ -463,7 +467,9 @@ open class TablesDB: Service {
"name": name,
"permissions": permissions,
"rowSecurity": rowSecurity,
"enabled": enabled
"enabled": enabled,
"columns": columns,
"indexes": indexes
]

let apiHeaders: [String: String] = [
Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AppwriteEnums
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AppwriteEnums
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/update-magic-url-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/update-phone-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession("") // The user session to authenticate with

let account = Account(client)

Expand Down
4 changes: 3 additions & 1 deletion docs/examples/databases/create-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ let collection = try await databases.createCollection(
name: "<NAME>",
permissions: [Permission.read(Role.any())], // optional
documentSecurity: false, // optional
enabled: false // optional
enabled: false, // optional
attributes: [], // optional
indexes: [] // optional
)

4 changes: 3 additions & 1 deletion docs/examples/tablesdb/create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ let table = try await tablesDB.createTable(
name: "<NAME>",
permissions: [Permission.read(Role.any())], // optional
rowSecurity: false, // optional
enabled: false // optional
enabled: false, // optional
columns: [], // optional
indexes: [] // optional
)