Skip to content

Commit d090eba

Browse files
committed
feat: update for 1.0.0-RC1
1 parent 3ec6e8b commit d090eba

33 files changed

+135
-140
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Appwrite is an open-source backend as a service server that abstract and simplif
2121

2222
The Appwrite Swift SDK is available via Swift Package Manager. In order to use the Appwrite Swift SDK from Xcode, select File > **Add Packages**
2323

24-
In the dialog that appears, enter the Appwrite Swift SDK [package URL](https://github.com/appwrite/sdk-for-swift.git) in the search field. Once found, select `sdk-for-apple`.
24+
In the dialog that appears, enter the Appwrite Swift SDK [package URL](git@github.com:appwrite/sdk-for-swift.git) in the search field. Once found, select `sdk-for-apple`.
2525

2626
On the right, select your version rules and ensure your desired target is selected in the **Add to Project** field.
2727

@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:
3333

3434
```swift
3535
dependencies: [
36-
.package(url: "https://github.com/appwrite/sdk-for-swift.git", from: "0.7.0-RC1"),
36+
.package(url: "git@github.com:appwrite/sdk-for-swift.git", from: "0.7.0-RC1"),
3737
],
3838
```
3939

Sources/Appwrite/Services/Databases.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ open class Databases: Service {
237237
databaseId: String,
238238
collectionId: String,
239239
name: String,
240-
permissions: [String],
241-
documentSecurity: Bool
240+
permissions: [String]? = nil,
241+
documentSecurity: Bool? = nil
242242
) async throws -> AppwriteModels.Collection {
243243
var path: String = "/databases/{databaseId}/collections"
244244
path = path.replacingOccurrences(
@@ -313,8 +313,8 @@ open class Databases: Service {
313313
/// @param String databaseId
314314
/// @param String collectionId
315315
/// @param String name
316-
/// @param Bool documentSecurity
317316
/// @param [String] permissions
317+
/// @param Bool documentSecurity
318318
/// @param Bool enabled
319319
/// @throws Exception
320320
/// @return array
@@ -323,8 +323,8 @@ open class Databases: Service {
323323
databaseId: String,
324324
collectionId: String,
325325
name: String,
326-
documentSecurity: Bool,
327326
permissions: [String]? = nil,
327+
documentSecurity: Bool? = nil,
328328
enabled: Bool? = nil
329329
) async throws -> AppwriteModels.Collection {
330330
var path: String = "/databases/{databaseId}/collections/{collectionId}"
@@ -1569,8 +1569,8 @@ open class Databases: Service {
15691569
databaseId: String,
15701570
collectionId: String,
15711571
name: String,
1572-
permissions: [String],
1573-
documentSecurity: Bool,
1572+
permissions: [String]? = nil,
1573+
documentSecurity: Bool? = nil,
15741574
completion: ((Result<AppwriteModels.Collection, AppwriteError>) -> Void)? = nil
15751575
) {
15761576
Task {
@@ -1627,8 +1627,8 @@ open class Databases: Service {
16271627
/// @param String databaseId
16281628
/// @param String collectionId
16291629
/// @param String name
1630-
/// @param Bool documentSecurity
16311630
/// @param [String] permissions
1631+
/// @param Bool documentSecurity
16321632
/// @param Bool enabled
16331633
/// @throws Exception
16341634
/// @return array
@@ -1638,8 +1638,8 @@ open class Databases: Service {
16381638
databaseId: String,
16391639
collectionId: String,
16401640
name: String,
1641-
documentSecurity: Bool,
16421641
permissions: [String]? = nil,
1642+
documentSecurity: Bool? = nil,
16431643
enabled: Bool? = nil,
16441644
completion: ((Result<AppwriteModels.Collection, AppwriteError>) -> Void)? = nil
16451645
) {
@@ -1649,8 +1649,8 @@ open class Databases: Service {
16491649
databaseId: databaseId,
16501650
collectionId: collectionId,
16511651
name: name,
1652-
documentSecurity: documentSecurity,
16531652
permissions: permissions,
1653+
documentSecurity: documentSecurity,
16541654
enabled: enabled
16551655
)
16561656
completion?(.success(result))

Sources/Appwrite/Services/Storage.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ open class Storage: Service {
4747
///
4848
/// @param String bucketId
4949
/// @param String name
50-
/// @param Bool fileSecurity
5150
/// @param [String] permissions
51+
/// @param Bool fileSecurity
5252
/// @param Bool enabled
5353
/// @param Int maximumFileSize
5454
/// @param [String] allowedFileExtensions
@@ -61,8 +61,8 @@ open class Storage: Service {
6161
open func createBucket(
6262
bucketId: String,
6363
name: String,
64-
fileSecurity: Bool,
6564
permissions: [String]? = nil,
65+
fileSecurity: Bool? = nil,
6666
enabled: Bool? = nil,
6767
maximumFileSize: Int? = nil,
6868
allowedFileExtensions: [String]? = nil,
@@ -140,8 +140,8 @@ open class Storage: Service {
140140
///
141141
/// @param String bucketId
142142
/// @param String name
143-
/// @param Bool fileSecurity
144143
/// @param [String] permissions
144+
/// @param Bool fileSecurity
145145
/// @param Bool enabled
146146
/// @param Int maximumFileSize
147147
/// @param [String] allowedFileExtensions
@@ -154,8 +154,8 @@ open class Storage: Service {
154154
open func updateBucket(
155155
bucketId: String,
156156
name: String,
157-
fileSecurity: Bool,
158157
permissions: [String]? = nil,
158+
fileSecurity: Bool? = nil,
159159
enabled: Bool? = nil,
160160
maximumFileSize: Int? = nil,
161161
allowedFileExtensions: [String]? = nil,
@@ -623,8 +623,8 @@ open class Storage: Service {
623623
///
624624
/// @param String bucketId
625625
/// @param String name
626-
/// @param Bool fileSecurity
627626
/// @param [String] permissions
627+
/// @param Bool fileSecurity
628628
/// @param Bool enabled
629629
/// @param Int maximumFileSize
630630
/// @param [String] allowedFileExtensions
@@ -638,8 +638,8 @@ open class Storage: Service {
638638
open func createBucket(
639639
bucketId: String,
640640
name: String,
641-
fileSecurity: Bool,
642641
permissions: [String]? = nil,
642+
fileSecurity: Bool? = nil,
643643
enabled: Bool? = nil,
644644
maximumFileSize: Int? = nil,
645645
allowedFileExtensions: [String]? = nil,
@@ -653,8 +653,8 @@ open class Storage: Service {
653653
let result = try await createBucket(
654654
bucketId: bucketId,
655655
name: name,
656-
fileSecurity: fileSecurity,
657656
permissions: permissions,
657+
fileSecurity: fileSecurity,
658658
enabled: enabled,
659659
maximumFileSize: maximumFileSize,
660660
allowedFileExtensions: allowedFileExtensions,
@@ -703,8 +703,8 @@ open class Storage: Service {
703703
///
704704
/// @param String bucketId
705705
/// @param String name
706-
/// @param Bool fileSecurity
707706
/// @param [String] permissions
707+
/// @param Bool fileSecurity
708708
/// @param Bool enabled
709709
/// @param Int maximumFileSize
710710
/// @param [String] allowedFileExtensions
@@ -718,8 +718,8 @@ open class Storage: Service {
718718
open func updateBucket(
719719
bucketId: String,
720720
name: String,
721-
fileSecurity: Bool,
722721
permissions: [String]? = nil,
722+
fileSecurity: Bool? = nil,
723723
enabled: Bool? = nil,
724724
maximumFileSize: Int? = nil,
725725
allowedFileExtensions: [String]? = nil,
@@ -733,8 +733,8 @@ open class Storage: Service {
733733
let result = try await updateBucket(
734734
bucketId: bucketId,
735735
name: name,
736-
fileSecurity: fileSecurity,
737736
permissions: permissions,
737+
fileSecurity: fileSecurity,
738738
enabled: enabled,
739739
maximumFileSize: maximumFileSize,
740740
allowedFileExtensions: allowedFileExtensions,

Sources/AppwriteModels/Account.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ public class Account {
55
/// User ID.
66
public let id: String
77

8-
/// User creation date in Datetime.
8+
/// User creation date in ISO 8601 format.
99
public let createdAt: String
1010

11-
/// User update date in Datetime.
11+
/// User update date in ISO 8601 format.
1212
public let updatedAt: String
1313

1414
/// User name.
1515
public let name: String
1616

17-
/// User registration date in Datetime.
17+
/// User registration date in ISO 8601 format.
1818
public let registration: String
1919

2020
/// User status. Pass `true` for enabled and `false` for disabled.
2121
public let status: Bool
2222

23-
/// Datetime of the most recent password update
23+
/// Password update time in ISO 8601 format.
2424
public let passwordUpdate: String
2525

2626
/// User email address.

Sources/AppwriteModels/AttributeBoolean.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ public class AttributeBoolean {
1515
public let xrequired: Bool
1616

1717
/// Is attribute an array?
18-
public let array: Bool
18+
public let array: Bool?
1919

2020
/// Default value for attribute when not provided. Cannot be set when attribute is required.
21-
public let xdefault: Bool
21+
public let xdefault: Bool?
2222

2323
init(
2424
key: String,
2525
type: String,
2626
status: String,
2727
xrequired: Bool,
28-
array: Bool,
29-
xdefault: Bool
28+
array: Bool?,
29+
xdefault: Bool?
3030
) {
3131
self.key = key
3232
self.type = type
@@ -42,8 +42,8 @@ public class AttributeBoolean {
4242
type: map["type"] as! String,
4343
status: map["status"] as! String,
4444
xrequired: map["required"] as! Bool,
45-
array: map["array"] as! Bool,
46-
xdefault: map["default"] as! Bool
45+
array: map["array"] as? Bool,
46+
xdefault: map["default"] as? Bool
4747
)
4848
}
4949

Sources/AppwriteModels/AttributeDatetime.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ public class AttributeDatetime {
1515
public let xrequired: Bool
1616

1717
/// Is attribute an array?
18-
public let array: Bool
18+
public let array: Bool?
1919

20-
/// Datetime format.
20+
/// ISO 8601 format.
2121
public let format: String
2222

2323
/// Default value for attribute when not provided. Only null is optional
24-
public let xdefault: String
24+
public let xdefault: String?
2525

2626
init(
2727
key: String,
2828
type: String,
2929
status: String,
3030
xrequired: Bool,
31-
array: Bool,
31+
array: Bool?,
3232
format: String,
33-
xdefault: String
33+
xdefault: String?
3434
) {
3535
self.key = key
3636
self.type = type
@@ -47,9 +47,9 @@ public class AttributeDatetime {
4747
type: map["type"] as! String,
4848
status: map["status"] as! String,
4949
xrequired: map["required"] as! Bool,
50-
array: map["array"] as! Bool,
50+
array: map["array"] as? Bool,
5151
format: map["format"] as! String,
52-
xdefault: map["default"] as! String
52+
xdefault: map["default"] as? String
5353
)
5454
}
5555

Sources/AppwriteModels/AttributeEmail.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ public class AttributeEmail {
1515
public let xrequired: Bool
1616

1717
/// Is attribute an array?
18-
public let array: Bool
18+
public let array: Bool?
1919

2020
/// String format.
2121
public let format: String
2222

2323
/// Default value for attribute when not provided. Cannot be set when attribute is required.
24-
public let xdefault: String
24+
public let xdefault: String?
2525

2626
init(
2727
key: String,
2828
type: String,
2929
status: String,
3030
xrequired: Bool,
31-
array: Bool,
31+
array: Bool?,
3232
format: String,
33-
xdefault: String
33+
xdefault: String?
3434
) {
3535
self.key = key
3636
self.type = type
@@ -47,9 +47,9 @@ public class AttributeEmail {
4747
type: map["type"] as! String,
4848
status: map["status"] as! String,
4949
xrequired: map["required"] as! Bool,
50-
array: map["array"] as! Bool,
50+
array: map["array"] as? Bool,
5151
format: map["format"] as! String,
52-
xdefault: map["default"] as! String
52+
xdefault: map["default"] as? String
5353
)
5454
}
5555

Sources/AppwriteModels/AttributeEnum.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class AttributeEnum {
1515
public let xrequired: Bool
1616

1717
/// Is attribute an array?
18-
public let array: Bool
18+
public let array: Bool?
1919

2020
/// Array of elements in enumerated type.
2121
public let elements: [Any]
@@ -24,17 +24,17 @@ public class AttributeEnum {
2424
public let format: String
2525

2626
/// Default value for attribute when not provided. Cannot be set when attribute is required.
27-
public let xdefault: String
27+
public let xdefault: String?
2828

2929
init(
3030
key: String,
3131
type: String,
3232
status: String,
3333
xrequired: Bool,
34-
array: Bool,
34+
array: Bool?,
3535
elements: [Any],
3636
format: String,
37-
xdefault: String
37+
xdefault: String?
3838
) {
3939
self.key = key
4040
self.type = type
@@ -52,10 +52,10 @@ public class AttributeEnum {
5252
type: map["type"] as! String,
5353
status: map["status"] as! String,
5454
xrequired: map["required"] as! Bool,
55-
array: map["array"] as! Bool,
55+
array: map["array"] as? Bool,
5656
elements: map["elements"] as! [Any],
5757
format: map["format"] as! String,
58-
xdefault: map["default"] as! String
58+
xdefault: map["default"] as? String
5959
)
6060
}
6161

0 commit comments

Comments
 (0)