Skip to content

Commit 2180ca6

Browse files
authored
feat: Add retrieve Parse Server version and information (#97)
* feat: Add retrieve Parse Server version and information * add test cases * nit
1 parent 0e40929 commit 2180ca6

File tree

20 files changed

+556
-266
lines changed

20 files changed

+556
-266
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
# Parse-Swift Changelog
33

44
### main
5-
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.4.3...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
5+
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.5.0...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
66
* _Contributing to this repo? Add info about your change here to be included in the next release_
77

8+
### 5.5.0
9+
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.4.3...5.5.0), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.5.0/documentation/parseswift)
10+
11+
__New features__
12+
* Add ParseServer.information() to retrieve version and info from a Parse Server. Depracates ParseHealth and check() in favor of ParseServer and health() respectively ([#97](https://github.com/netreconlab/Parse-Swift/pull/97)), thanks to [Corey Baker](https://github.com/cbaker6).
13+
814
### 5.4.3
915
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.4.2...5.4.3), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.4.3/documentation/parseswift)
1016

ParseSwift.playground/Pages/1 - Your first Object.xcplaygroundpage/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Task {
2727

2828
//: Check the health of your Parse Server.
2929
do {
30-
print("Server health is: \(try await ParseHealth.check())")
30+
print("Server health is: \(try await ParseServer.health())")
3131
} catch {
3232
assertionFailure("Error checking the server health: \(error)")
3333
}

ParseSwift.playground/Pages/20 - Cloud Schemas.xcplaygroundpage/Contents.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ Task {
2020
}
2121
}
2222

23+
Task {
24+
//: Retrieve Parse Server information.
25+
do {
26+
guard let version = try await ParseServer.information().version else {
27+
print("Could not retrieve any information from the Server")
28+
return
29+
}
30+
print("Server version is: \(version)")
31+
} catch {
32+
assertionFailure("Error retrieving server information: \(error)")
33+
}
34+
}
35+
2336
//: Youe specific _User value type.
2437
struct User: ParseUser {
2538
//: These are required by `ParseObject`.

ParseSwift.xcodeproj/project.pbxproj

Lines changed: 54 additions & 54 deletions
Large diffs are not rendered by default.

Sources/ParseSwift/API/API.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public struct API {
5353
case hookFunction(request: FunctionRequest)
5454
case hookTriggers
5555
case hookTrigger(request: TriggerRequest)
56+
case serverInfo
5657
case any(String)
5758

5859
public var urlComponent: String {
@@ -121,6 +122,8 @@ public struct API {
121122
return "/hooks/triggers/"
122123
case .hookTrigger(let request):
123124
return "/hooks/triggers/\(request.className)/\(request.triggerName)"
125+
case .serverInfo:
126+
return "/serverInfo"
124127
case .any(let path):
125128
return path
126129
}

Sources/ParseSwift/API/Responses.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ struct BooleanResponse: Codable {
174174

175175
// MARK: HealthResponse
176176
struct HealthResponse: Codable {
177-
let status: ParseHealth.Status
177+
let status: ParseServer.Status
178178
}
179179

180180
// MARK: PushResponse

Sources/ParseSwift/ParseConstants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
enum ParseConstants {
1212
static let sdk = "swift"
13-
static let version = "5.4.3"
13+
static let version = "5.5.0"
1414
static let fileManagementDirectory = "parse/"
1515
static let fileManagementPrivateDocumentsDirectory = "Private Documents/"
1616
static let fileManagementLibraryDirectory = "Library/"

Sources/ParseSwift/Types/ParseHealth+async.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

Sources/ParseSwift/Types/ParseHealth+combine.swift

Lines changed: 0 additions & 39 deletions
This file was deleted.

Sources/ParseSwift/Types/ParseHealth.swift

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)