diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index addc44731..870017fab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,6 @@ jobs: uses: sersoft-gmbh/swift-coverage-action@v2 id: coverage-files with: - target-name-filter: '^ParseSwift$' format: lcov search-paths: ./DerivedData env: diff --git a/CHANGELOG.md b/CHANGELOG.md index f55922198..571daf25b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,15 @@ ### main -[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.2...main) +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.3...main) * _Contributing to this repo? Add info about your change here to be included in the next release_ +### 2.2.3 +[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.2...2.2.3) + +__Fixes__ +- Improve dpcumentation ([#276](https://github.com/parse-community/Parse-Swift/pull/276)), thanks to [Corey Baker](https://github.com/cbaker6). + ### 2.2.2 [Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.2.1...2.2.2) diff --git a/ParseSwift.playground/Pages/13 - Operations.xcplaygroundpage/Contents.swift b/ParseSwift.playground/Pages/13 - Operations.xcplaygroundpage/Contents.swift index 25160c870..50e071b05 100644 --- a/ParseSwift.playground/Pages/13 - Operations.xcplaygroundpage/Contents.swift +++ b/ParseSwift.playground/Pages/13 - Operations.xcplaygroundpage/Contents.swift @@ -21,7 +21,7 @@ struct GameScore: ParseObject { var ACL: ParseACL? //: Your own properties. - var score: Int = 0 + var score: Int? = 0 } //: It's recommended to place custom initializers in an extension @@ -45,7 +45,7 @@ do { savedScore = try GameScore(score: 102).save() } catch { savedScore = nil - fatalError("Error saving: \(error)") + assertionFailure("Error saving: \(error)") } //: Then we will increment the score. @@ -69,8 +69,20 @@ do { print(error) } -//: There are other operations: add/remove/delete objects from `ParseObject`s. +//: You can also remove a value for a property using unset. +let unsetOperation = savedScore + .operation.unset(("score", \.score)) +do { + let updatedScore = try unsetOperation.save() + print("Updated score: \(updatedScore). Check the new score on Parse Dashboard.") +} catch { + print(error) +} + +//: There are other operations: set/forceSet/unset/add/remove, etc. objects from `ParseObject`s. //: In fact, the `users` and `roles` relations from `ParseRoles` used the add/remove operations. +//: Multiple operations can be chained together. See: +//: https://github.com/parse-community/Parse-Swift/pull/268#issuecomment-955714414 let operations = savedScore.operation //: Example: operations.add("hello", objects: ["test"]). diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+async.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+async.swift index 7ad9193b8..38eda48f2 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+async.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+async.swift @@ -11,7 +11,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseApple { - // MARK: Login - Async/Await + // MARK: Async/Await /** Login a `ParseUser` *asynchronously* using Apple authentication. @@ -51,7 +51,6 @@ public extension ParseApple { @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseApple { - // MARK: Link - Async/Await /** Link the *current* `ParseUser` *asynchronously* using Apple authentication. diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+combine.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+combine.swift index 4c2b87f25..a6f19d340 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+combine.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseApple/ParseApple+combine.swift @@ -11,7 +11,7 @@ import Foundation import Combine public extension ParseApple { - // MARK: Login - Combine + // MARK: Combine /** Login a `ParseUser` *asynchronously* using Apple authentication. Publishes when complete. @@ -48,7 +48,6 @@ public extension ParseApple { } public extension ParseApple { - // MARK: Link - Combine /** Link the *current* `ParseUser` *asynchronously* using Apple authentication. Publishes when complete. diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+async.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+async.swift index f81a50ff1..cece2b44f 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+async.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+async.swift @@ -11,7 +11,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseFacebook { - // MARK: Login - Async/Await + // MARK: Async/Await /** Login a `ParseUser` *asynchronously* using Facebook authentication for limited login. @@ -75,7 +75,6 @@ public extension ParseFacebook { @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseFacebook { - // MARK: Link - Async/Await /** Link the *current* `ParseUser` *asynchronously* using Facebook authentication for limited login. - parameter userId: The `userId` from `FacebookSDK`. diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+combine.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+combine.swift index 53f77c71c..5eac74690 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+combine.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseFacebook/ParseFacebook+combine.swift @@ -11,7 +11,7 @@ import Foundation import Combine public extension ParseFacebook { - // MARK: Login - Combine + // MARK: Combine /** Login a `ParseUser` *asynchronously* using Facebook authentication for limited login. Publishes when complete. - parameter userId: The `userId` from `FacebookSDK`. @@ -70,7 +70,6 @@ public extension ParseFacebook { } public extension ParseFacebook { - // MARK: Link - Combine /** Link the *current* `ParseUser` *asynchronously* using Facebook authentication for limited login. Publishes when complete. diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+async.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+async.swift index a4bb4c671..565599cfa 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+async.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+async.swift @@ -11,7 +11,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseLDAP { - // MARK: Login - Async/Await + // MARK: Async/Await /** Login a `ParseUser` *asynchronously* using LDAP authentication. - parameter id: The id of the `user`. @@ -50,7 +50,6 @@ public extension ParseLDAP { @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseLDAP { - // MARK: Link - Async/Await /** Link the *current* `ParseUser` *asynchronously* using LDAP authentication. - parameter id: The id of the `user`. diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+combine.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+combine.swift index da753942c..ba0ffaca8 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+combine.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseLDAP/ParseLDAP+combine.swift @@ -11,7 +11,7 @@ import Foundation import Combine public extension ParseLDAP { - // MARK: Login - Combine + // MARK: Combine /** Login a `ParseUser` *asynchronously* using LDAP authentication. Publishes when complete. - parameter id: The id of the `user`. @@ -47,7 +47,6 @@ public extension ParseLDAP { } public extension ParseLDAP { - // MARK: Link - Combine /** Link the *current* `ParseUser` *asynchronously* using LDAP authentication. Publishes when complete. - parameter id: The id of the `user`. diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+async.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+async.swift index 984b35061..d38b9d225 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+async.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+async.swift @@ -11,7 +11,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseTwitter { - // MARK: Login - Async/Await + // MARK: Async/Await /** Login a `ParseUser` *asynchronously* using Twitter authentication. @@ -63,7 +63,6 @@ public extension ParseTwitter { @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseTwitter { - // MARK: Link - Async/Await /** Link the *current* `ParseUser` *asynchronously* using Twitter authentication. diff --git a/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+combine.swift b/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+combine.swift index de7377cf0..3f97ee59d 100644 --- a/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+combine.swift +++ b/Sources/ParseSwift/Authentication/3rd Party/ParseTwitter/ParseTwitter+combine.swift @@ -11,7 +11,7 @@ import Foundation import Combine public extension ParseTwitter { - // MARK: Login - Combine + // MARK: Combine /** Login a `ParseUser` *asynchronously* using Twitter authentication. Publishes when complete. @@ -60,7 +60,6 @@ public extension ParseTwitter { } public extension ParseTwitter { - // MARK: Link - Combine /** Link the *current* `ParseUser` *asynchronously* using Twitter authentication. Publishes when complete. diff --git a/Sources/ParseSwift/Authentication/Internal/ParseAnonymous+async.swift b/Sources/ParseSwift/Authentication/Internal/ParseAnonymous+async.swift index 3adaebcce..409341e4e 100644 --- a/Sources/ParseSwift/Authentication/Internal/ParseAnonymous+async.swift +++ b/Sources/ParseSwift/Authentication/Internal/ParseAnonymous+async.swift @@ -12,11 +12,10 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseAnonymous { - // MARK: Login - Async/Await + // MARK: Async/Await /** Login a `ParseUser` *asynchronously* using the respective authentication type. - parameter options: A set of header options sent to the server. Defaults to an empty set. - - parameter callbackQueue: The queue to return to after completion. Default value of .main. - returns: An instance of the logged in `ParseUser`. - throws: `ParseError`. */ @@ -31,7 +30,6 @@ public extension ParseAnonymous { Login a `ParseUser` *asynchronously* using the respective authentication type. - parameter authData: The authData for the respective authentication type. This will be ignored. - parameter options: A set of header options sent to the server. Defaults to an empty set. - - parameter callbackQueue: The queue to return to after completion. Default value of .main. - returns: An instance of the logged in `ParseUser`. - throws: `ParseError`. */ @@ -48,7 +46,6 @@ public extension ParseAnonymous { @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseAnonymous { - // MARK: Link - Async/Await func link(authData: [String: String], options: API.Options = []) async throws -> AuthenticatedUser { try await withCheckedThrowingContinuation { continuation in diff --git a/Sources/ParseSwift/Authentication/Internal/ParseAnonymous+combine.swift b/Sources/ParseSwift/Authentication/Internal/ParseAnonymous+combine.swift index dd4f84e99..14e76c92f 100644 --- a/Sources/ParseSwift/Authentication/Internal/ParseAnonymous+combine.swift +++ b/Sources/ParseSwift/Authentication/Internal/ParseAnonymous+combine.swift @@ -45,7 +45,6 @@ public extension ParseAnonymous { public extension ParseAnonymous { - // MARK: Link - Combine func linkPublisher(authData: [String: String], options: API.Options = []) -> Future { Future { promise in diff --git a/Sources/ParseSwift/Authentication/Internal/ParseAnonymous.swift b/Sources/ParseSwift/Authentication/Internal/ParseAnonymous.swift index 98b065d99..89929503a 100644 --- a/Sources/ParseSwift/Authentication/Internal/ParseAnonymous.swift +++ b/Sources/ParseSwift/Authentication/Internal/ParseAnonymous.swift @@ -65,7 +65,7 @@ public extension ParseAnonymous { func login(authData: [String: String], options: API.Options = []) throws -> AuthenticatedUser { try AuthenticatedUser.login(__type, - authData: AuthenticationKeys.id.makeDictionary(), + authData: authData, options: options) } @@ -96,7 +96,7 @@ public extension ParseAnonymous { callbackQueue: DispatchQueue = .main, completion: @escaping (Result) -> Void) { AuthenticatedUser.login(__type, - authData: AuthenticationKeys.id.makeDictionary(), + authData: authData, options: options, callbackQueue: callbackQueue, completion: completion) diff --git a/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication+combine.swift b/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication+combine.swift index 953b92c79..cac9c7b46 100644 --- a/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication+combine.swift +++ b/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication+combine.swift @@ -90,7 +90,6 @@ public extension ParseUser { completion: promise) } } - } #endif diff --git a/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift b/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift index 988e5fc59..3539968ac 100644 --- a/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift +++ b/Sources/ParseSwift/Authentication/Protocols/ParseAuthentication.swift @@ -96,8 +96,9 @@ public protocol ParseAuthentication: Codable { func strip(_ user: AuthenticatedUser) -> AuthenticatedUser #if canImport(Combine) + // MARK: Combine /** - Login a `ParseUser` *asynchronously* using the respective authentication type. + Login a `ParseUser` *asynchronously* using the respective authentication type. Publishes when complete. - parameter authData: The authData for the respective authentication type. - parameter options: A set of header options sent to the server. Defaults to an empty set. - parameter callbackQueue: The queue to return to after completion. Default value of .main. @@ -107,7 +108,7 @@ public protocol ParseAuthentication: Codable { options: API.Options) -> Future /** - Link the *current* `ParseUser` *asynchronously* using the respective authentication type. + Link the *current* `ParseUser` *asynchronously* using the respective authentication type. Publishes when complete. - parameter authData: The authData for the respective authentication type. - parameter options: A set of header options sent to the server. Defaults to an empty set. - parameter callbackQueue: The queue to return to after completion. Default value of .main. @@ -117,7 +118,7 @@ public protocol ParseAuthentication: Codable { options: API.Options) -> Future /** - Unlink the `ParseUser` *asynchronously* from the respective authentication type. + Unlink the `ParseUser` *asynchronously* from the respective authentication type. Publishes when complete. - parameter user: The `ParseUser` to unlink. The user must be logged in on this device. - parameter options: A set of header options sent to the server. Defaults to an empty set. - parameter callbackQueue: The queue to return to after completion. Default value of .main. @@ -127,14 +128,45 @@ public protocol ParseAuthentication: Codable { func unlinkPublisher(_ user: AuthenticatedUser, options: API.Options) -> Future + /** + Unlink the *current* `ParseUser` *asynchronously* from the respective authentication type. Publishes when complete. + - parameter options: A set of header options sent to the server. Defaults to an empty set. + - returns: A publisher that eventually produces a single value and then finishes or fails. + */ + func unlinkPublisher(options: API.Options) -> Future + #endif + + #if swift(>=5.5) && canImport(_Concurrency) + // MARK: Async/Await + + /** + Link the *current* `ParseUser` *asynchronously* using the respective authentication type. + - parameter authData: The authData for the respective authentication type. + - parameter options: A set of header options sent to the server. Defaults to an empty set. + - parameter returns: An instance of the linked `AuthenticatedUser`. + */ + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func link(authData: [String: String], + options: API.Options) async throws -> AuthenticatedUser + + /** + Unlink the `ParseUser` *asynchronously* from the respective authentication type. + - parameter user: The `ParseUser` to unlink. The user must be logged in on this device. + - parameter options: A set of header options sent to the server. Defaults to an empty set. + - parameter returns: An instance of the unlinked `AuthenticatedUser`. + */ + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func unlink(_ user: AuthenticatedUser, + options: API.Options) async throws -> AuthenticatedUser + /** Unlink the *current* `ParseUser` *asynchronously* from the respective authentication type. - parameter options: A set of header options sent to the server. Defaults to an empty set. - parameter callbackQueue: The queue to return to after completion. Default value of .main. - - parameter completion: The block to execute. - It should have the following argument signature: `(Result)`. + - parameter returns: An instance of the unlinked `AuthenticatedUser`. */ - func unlinkPublisher(options: API.Options) -> Future + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func unlink(options: API.Options) async throws -> AuthenticatedUser #endif } diff --git a/Sources/ParseSwift/Objects/ParseInstallation+async.swift b/Sources/ParseSwift/Objects/ParseInstallation+async.swift index 9f1388dcb..7dc99df74 100644 --- a/Sources/ParseSwift/Objects/ParseInstallation+async.swift +++ b/Sources/ParseSwift/Objects/ParseInstallation+async.swift @@ -12,7 +12,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseInstallation { - // MARK: Fetchable - Async/Await + // MARK: Async/Await /** Fetches the `ParseInstallation` *aynchronously* with the current data from the server and sets an error if one occurs. Publishes when complete. @@ -35,7 +35,6 @@ public extension ParseInstallation { } } - // MARK: Savable - Async/Await /** Saves the `ParseInstallation` *asynchronously*. - parameter isIgnoreCustomObjectIdConfig: Ignore checking for `objectId` @@ -55,7 +54,6 @@ public extension ParseInstallation { } } - // MARK: Deletable - Async/Await /** Deletes the `ParseInstallation` *asynchronously*. @@ -71,7 +69,6 @@ public extension ParseInstallation { } } -// MARK: Batch Support - Async/Await @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension Sequence where Element: ParseInstallation { /** diff --git a/Sources/ParseSwift/Objects/ParseInstallation+combine.swift b/Sources/ParseSwift/Objects/ParseInstallation+combine.swift index 928acb5e3..968a31b29 100644 --- a/Sources/ParseSwift/Objects/ParseInstallation+combine.swift +++ b/Sources/ParseSwift/Objects/ParseInstallation+combine.swift @@ -64,7 +64,6 @@ public extension ParseInstallation { } } -// MARK: Batch Support - Combine public extension Sequence where Element: ParseInstallation { /** Fetches a collection of installations *aynchronously* with the current data from the server and sets diff --git a/Sources/ParseSwift/Objects/ParseObject+async.swift b/Sources/ParseSwift/Objects/ParseObject+async.swift index d0db0b985..3482110d8 100644 --- a/Sources/ParseSwift/Objects/ParseObject+async.swift +++ b/Sources/ParseSwift/Objects/ParseObject+async.swift @@ -70,7 +70,6 @@ public extension ParseObject { @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension Sequence where Element: ParseObject { - // MARK: Batch Support - Async/Await /** Fetches a collection of objects *aynchronously* with the current data from the server and sets an error if one occurs. diff --git a/Sources/ParseSwift/Objects/ParseObject+combine.swift b/Sources/ParseSwift/Objects/ParseObject+combine.swift index 2e9b91ab5..cf8da99f1 100644 --- a/Sources/ParseSwift/Objects/ParseObject+combine.swift +++ b/Sources/ParseSwift/Objects/ParseObject+combine.swift @@ -64,7 +64,6 @@ public extension ParseObject { } public extension Sequence where Element: ParseObject { - // MARK: Batch Support - Combine /** Fetches a collection of objects *aynchronously* with the current data from the server and sets an error if one occurs. Publishes when complete. diff --git a/Sources/ParseSwift/Objects/ParseUser+async.swift b/Sources/ParseSwift/Objects/ParseUser+async.swift index 4613e1cf4..7a1bd1d58 100644 --- a/Sources/ParseSwift/Objects/ParseUser+async.swift +++ b/Sources/ParseSwift/Objects/ParseUser+async.swift @@ -12,7 +12,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseUser { - // MARK: Signing Up - Async/Await + // MARK: Async/Await /** Signs up the user *asynchronously* and publishes value. @@ -55,7 +55,6 @@ public extension ParseUser { } } - // MARK: Logging In - Async/Await /** Makes an *asynchronous* request to log in a user with specified credentials. Publishes an instance of the successfully logged in `ParseUser`. @@ -98,7 +97,6 @@ public extension ParseUser { } } - // MARK: Logging Out - Async/Await /** Logs out the currently logged in user *asynchronously*. @@ -115,7 +113,6 @@ public extension ParseUser { } } - // MARK: Password Reset - Async/Await /** Requests *asynchronously* a password reset email to be sent to the specified email address associated with the user account. This email allows the user to securely reset their password on the web. @@ -132,7 +129,6 @@ public extension ParseUser { } } - // MARK: Verification Email Request - Async/Await /** Requests *asynchronously* a verification email be sent to the specified email address associated with the user account. @@ -149,7 +145,6 @@ public extension ParseUser { } } - // MARK: Fetchable - Async/Await /** Fetches the `ParseUser` *aynchronously* with the current data from the server and sets an error if one occurs. - parameter includeKeys: The name(s) of the key(s) to include that are @@ -172,7 +167,6 @@ public extension ParseUser { } } - // MARK: Savable - Async/Await /** Saves the `ParseUser` *asynchronously*. - parameter isIgnoreCustomObjectIdConfig: Ignore checking for `objectId` @@ -193,7 +187,6 @@ public extension ParseUser { } } - // MARK: Deletable - Async/Await /** Deletes the `ParseUser` *asynchronously*. @@ -210,7 +203,6 @@ public extension ParseUser { } } -// MARK: Batch Support - Async/Await @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension Sequence where Element: ParseUser { /** diff --git a/Sources/ParseSwift/Objects/ParseUser+combine.swift b/Sources/ParseSwift/Objects/ParseUser+combine.swift index 35ee7c586..2d5e62b79 100644 --- a/Sources/ParseSwift/Objects/ParseUser+combine.swift +++ b/Sources/ParseSwift/Objects/ParseUser+combine.swift @@ -12,7 +12,7 @@ import Combine public extension ParseUser { - // MARK: Signing Up - Combine + // MARK: Combine /** Signs up the user *asynchronously* and publishes value. @@ -51,7 +51,6 @@ public extension ParseUser { } } - // MARK: Logging In - Combine /** Makes an *asynchronous* request to log in a user with specified credentials. Publishes an instance of the successfully logged in `ParseUser`. @@ -89,7 +88,6 @@ public extension ParseUser { } } - // MARK: Logging Out - Combine /** Logs out the currently logged in user *asynchronously*. Publishes when complete. @@ -104,7 +102,6 @@ public extension ParseUser { } } - // MARK: Password Reset - Combine /** Requests *asynchronously* a password reset email to be sent to the specified email address associated with the user account. This email allows the user to securely reset their password on the web. @@ -120,7 +117,6 @@ public extension ParseUser { } } - // MARK: Verification Email Request - Combine /** Requests *asynchronously* a verification email be sent to the specified email address associated with the user account. Publishes when complete. @@ -135,7 +131,6 @@ public extension ParseUser { } } - // MARK: Combine /** Fetches the `ParseUser` *aynchronously* with the current data from the server and sets an error if one occurs. Publishes when complete. @@ -199,7 +194,6 @@ public extension ParseUser { } } -// MARK: Batch Support - Combine public extension Sequence where Element: ParseUser { /** Fetches a collection of users *aynchronously* with the current data from the server and sets diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index dc3bb97c5..14fe87817 100644 --- a/Sources/ParseSwift/ParseConstants.swift +++ b/Sources/ParseSwift/ParseConstants.swift @@ -10,7 +10,7 @@ import Foundation enum ParseConstants { static let sdk = "swift" - static let version = "2.2.2" + static let version = "2.2.3" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/" diff --git a/Sources/ParseSwift/Types/ParseCloud+async.swift b/Sources/ParseSwift/Types/ParseCloud+async.swift index 4732147c3..e72f116ac 100644 --- a/Sources/ParseSwift/Types/ParseCloud+async.swift +++ b/Sources/ParseSwift/Types/ParseCloud+async.swift @@ -12,7 +12,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseCloud { - // MARK: Functions - Aysnc/Await + // MARK: Aysnc/Await /** Calls a Cloud Code function *asynchronously* and returns a result of it's execution. @@ -27,8 +27,6 @@ public extension ParseCloud { } } - // MARK: Jobs - Aysnc/Await - /** Starts a Cloud Code Job *asynchronously* and returns a result with the jobStatusId of the job. - parameter options: A set of header options sent to the server. Defaults to an empty set. diff --git a/Sources/ParseSwift/Types/ParseCloud+combine.swift b/Sources/ParseSwift/Types/ParseCloud+combine.swift index c5b16ef4d..64dc031fb 100644 --- a/Sources/ParseSwift/Types/ParseCloud+combine.swift +++ b/Sources/ParseSwift/Types/ParseCloud+combine.swift @@ -12,7 +12,7 @@ import Combine public extension ParseCloud { - // MARK: Functions - Combine + // MARK: Combine /** Calls a Cloud Code function *asynchronously* and returns a result of it's execution. @@ -27,8 +27,6 @@ public extension ParseCloud { } } - // MARK: Jobs - Combine - /** Starts a Cloud Code Job *asynchronously* and returns a result with the jobStatusId of the job. Publishes when complete. diff --git a/Sources/ParseSwift/Types/ParseFile+async.swift b/Sources/ParseSwift/Types/ParseFile+async.swift index 56879c87f..d44073ef9 100644 --- a/Sources/ParseSwift/Types/ParseFile+async.swift +++ b/Sources/ParseSwift/Types/ParseFile+async.swift @@ -15,7 +15,7 @@ import FoundationNetworking @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseFile { - // MARK: Fetchable - Async/Await + // MARK: Async/Await /** Fetches a file with given url *asynchronously*. - parameter options: A set of header options sent to the server. Defaults to an empty set. @@ -52,7 +52,6 @@ public extension ParseFile { } } - // MARK: Savable - Async/Await /** Creates a file with given data *asynchronously* and executes the given callback block. A name will be assigned to it by the server. If the file hasn't been downloaded, it will automatically @@ -91,7 +90,6 @@ public extension ParseFile { } } - // MARK: Deletable - Async/Await /** Deletes the file from the Parse Server. Publishes when complete. - requires: `.useMasterKey` has to be available. diff --git a/Sources/ParseSwift/Types/ParseFile+combine.swift b/Sources/ParseSwift/Types/ParseFile+combine.swift index c1f3f3802..4b6b33496 100644 --- a/Sources/ParseSwift/Types/ParseFile+combine.swift +++ b/Sources/ParseSwift/Types/ParseFile+combine.swift @@ -15,7 +15,7 @@ import Combine public extension ParseFile { - // MARK: Fechable - Combine + // MARK: Combine /** Fetches a file with given url *synchronously*. Publishes when complete. - parameter options: A set of header options sent to the server. Defaults to an empty set. @@ -50,7 +50,6 @@ public extension ParseFile { } } - // MARK: Savable - Combine /** Creates a file with given data *asynchronously* and executes the given callback block. Publishes when complete. @@ -85,7 +84,6 @@ public extension ParseFile { } } - // MARK: Deletable - Combine /** Deletes the file from the Parse Server. Publishes when complete. - requires: `.useMasterKey` has to be available. diff --git a/Sources/ParseSwift/Types/ParseOperation+async.swift b/Sources/ParseSwift/Types/ParseOperation+async.swift index e9a5195de..50022116a 100644 --- a/Sources/ParseSwift/Types/ParseOperation+async.swift +++ b/Sources/ParseSwift/Types/ParseOperation+async.swift @@ -12,7 +12,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension ParseOperation { - // MARK: Savable - Async/Await + // MARK: Async/Await /** Saves the operations on the `ParseObject` *asynchronously* and executes the given callback block. diff --git a/Sources/ParseSwift/Types/ParseOperation+combine.swift b/Sources/ParseSwift/Types/ParseOperation+combine.swift index 7ef943ff4..988b68a57 100644 --- a/Sources/ParseSwift/Types/ParseOperation+combine.swift +++ b/Sources/ParseSwift/Types/ParseOperation+combine.swift @@ -12,7 +12,7 @@ import Combine public extension ParseOperation { - // MARK: Savable - Combine + // MARK: Combine /** Saves the operations on the `ParseObject` *asynchronously* and executes the given callback block. diff --git a/Sources/ParseSwift/Types/Pointer+async.swift b/Sources/ParseSwift/Types/Pointer+async.swift index cbdd43302..cc1a4daa3 100644 --- a/Sources/ParseSwift/Types/Pointer+async.swift +++ b/Sources/ParseSwift/Types/Pointer+async.swift @@ -9,7 +9,7 @@ #if swift(>=5.5) && canImport(_Concurrency) import Foundation -// MARK: Fetchable - Async/Await +// MARK: Async/Await @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension Pointer { /** diff --git a/Sources/ParseSwift/Types/Pointer+combine.swift b/Sources/ParseSwift/Types/Pointer+combine.swift index 6b3974137..b4e5380b5 100644 --- a/Sources/ParseSwift/Types/Pointer+combine.swift +++ b/Sources/ParseSwift/Types/Pointer+combine.swift @@ -10,7 +10,7 @@ import Foundation import Combine -// MARK: Fetchable - Combine +// MARK: Combine public extension Pointer { /** Fetches the `ParseObject` *aynchronously* with the current data from the server and sets an error if one occurs. diff --git a/Sources/ParseSwift/Types/Query+async.swift b/Sources/ParseSwift/Types/Query+async.swift index fb5731145..5fa95af26 100644 --- a/Sources/ParseSwift/Types/Query+async.swift +++ b/Sources/ParseSwift/Types/Query+async.swift @@ -12,7 +12,7 @@ import Foundation @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) public extension Query { - // MARK: Queryable - Async/Await + // MARK: Async/Await /** Finds objects *asynchronously* and publishes when complete. diff --git a/Sources/ParseSwift/Types/Query+combine.swift b/Sources/ParseSwift/Types/Query+combine.swift index 234793623..fac4564b8 100644 --- a/Sources/ParseSwift/Types/Query+combine.swift +++ b/Sources/ParseSwift/Types/Query+combine.swift @@ -12,7 +12,7 @@ import Combine public extension Query { - // MARK: Queryable - Combine + // MARK: Combine /** Finds objects *asynchronously* and publishes when complete. diff --git a/TestHost/AppDelegate.swift b/TestHost/AppDelegate.swift index 75990f8c6..8ca7f554f 100644 --- a/TestHost/AppDelegate.swift +++ b/TestHost/AppDelegate.swift @@ -9,6 +9,9 @@ import UIKit @UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate {} - -class ViewController: UIViewController {} +class AppDelegate: UIResponder, UIApplicationDelegate { + func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + return true + } +} diff --git a/TestHostTV/AppDelegate.swift b/TestHostTV/AppDelegate.swift index da8111194..224f7375a 100644 --- a/TestHostTV/AppDelegate.swift +++ b/TestHostTV/AppDelegate.swift @@ -15,7 +15,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - return true } } diff --git a/Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift b/Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift index ab7ef41c5..9b73db762 100644 --- a/Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift +++ b/Tests/ParseSwiftTests/ParseAuthenticationAsyncTests.swift @@ -96,6 +96,20 @@ class ParseAuthenticationAsyncTests: XCTestCase { // swiftlint:disable:this type promise(.failure(error)) } } + + #if swift(>=5.5) && canImport(_Concurrency) + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func login(authData: [String: String], + options: API.Options) async throws -> AuthenticatedUser { + throw ParseError(code: .unknownError, message: "Not implemented") + } + + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func link(authData: [String: String], + options: API.Options) async throws -> AuthenticatedUser { + throw ParseError(code: .unknownError, message: "Not implemented") + } + #endif } override func setUpWithError() throws { diff --git a/Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift b/Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift index b19230342..59c195593 100644 --- a/Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift +++ b/Tests/ParseSwiftTests/ParseAuthenticationCombineTests.swift @@ -99,6 +99,20 @@ class ParseAuthenticationCombineTests: XCTestCase { } } #endif + + #if swift(>=5.5) && canImport(_Concurrency) + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func login(authData: [String: String], + options: API.Options) async throws -> AuthenticatedUser { + throw ParseError(code: .unknownError, message: "Not implemented") + } + + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func link(authData: [String: String], + options: API.Options) async throws -> AuthenticatedUser { + throw ParseError(code: .unknownError, message: "Not implemented") + } + #endif } override func setUpWithError() throws { diff --git a/Tests/ParseSwiftTests/ParseAuthenticationTests.swift b/Tests/ParseSwiftTests/ParseAuthenticationTests.swift index 02ddbd474..91c079846 100644 --- a/Tests/ParseSwiftTests/ParseAuthenticationTests.swift +++ b/Tests/ParseSwiftTests/ParseAuthenticationTests.swift @@ -99,6 +99,20 @@ class ParseAuthenticationTests: XCTestCase { } } #endif + + #if swift(>=5.5) && canImport(_Concurrency) + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func login(authData: [String: String], + options: API.Options) async throws -> AuthenticatedUser { + throw ParseError(code: .unknownError, message: "Not implemented") + } + + @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + func link(authData: [String: String], + options: API.Options) async throws -> AuthenticatedUser { + throw ParseError(code: .unknownError, message: "Not implemented") + } + #endif } override func setUpWithError() throws {