mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:10:45 +00:00
feat: add authenticated iOS background presence beacon (#73330)
* feat: add iOS background presence beacon Co-authored-by: ngutman <1540134+ngutman@users.noreply.github.com> * fix: keep iOS background reconnects ahead of beacon throttle * build: refresh gateway protocol swift models * fix: emit swift protocol string enums --------- Co-authored-by: ngutman <1540134+ngutman@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d525d6486d
commit
bdba90a20b
@@ -13,6 +13,15 @@ public enum ErrorCode: String, Codable, Sendable {
|
||||
case unavailable = "UNAVAILABLE"
|
||||
}
|
||||
|
||||
public enum NodePresenceAliveReason: String, Codable, Sendable {
|
||||
case background = "background"
|
||||
case silentPush = "silent_push"
|
||||
case bgAppRefresh = "bg_app_refresh"
|
||||
case significantLocation = "significant_location"
|
||||
case manual = "manual"
|
||||
case connect = "connect"
|
||||
}
|
||||
|
||||
public struct ConnectParams: Codable, Sendable {
|
||||
public let minprotocol: Int
|
||||
public let maxprotocol: Int
|
||||
@@ -1063,6 +1072,74 @@ public struct NodeEventParams: Codable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct NodeEventResult: Codable, Sendable {
|
||||
public let ok: Bool
|
||||
public let event: String
|
||||
public let handled: Bool
|
||||
public let reason: String?
|
||||
|
||||
public init(
|
||||
ok: Bool,
|
||||
event: String,
|
||||
handled: Bool,
|
||||
reason: String?)
|
||||
{
|
||||
self.ok = ok
|
||||
self.event = event
|
||||
self.handled = handled
|
||||
self.reason = reason
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case ok
|
||||
case event
|
||||
case handled
|
||||
case reason
|
||||
}
|
||||
}
|
||||
|
||||
public struct NodePresenceAlivePayload: Codable, Sendable {
|
||||
public let trigger: NodePresenceAliveReason
|
||||
public let sentatms: Int?
|
||||
public let displayname: String?
|
||||
public let version: String?
|
||||
public let platform: String?
|
||||
public let devicefamily: String?
|
||||
public let modelidentifier: String?
|
||||
public let pushtransport: String?
|
||||
|
||||
public init(
|
||||
trigger: NodePresenceAliveReason,
|
||||
sentatms: Int?,
|
||||
displayname: String?,
|
||||
version: String?,
|
||||
platform: String?,
|
||||
devicefamily: String?,
|
||||
modelidentifier: String?,
|
||||
pushtransport: String?)
|
||||
{
|
||||
self.trigger = trigger
|
||||
self.sentatms = sentatms
|
||||
self.displayname = displayname
|
||||
self.version = version
|
||||
self.platform = platform
|
||||
self.devicefamily = devicefamily
|
||||
self.modelidentifier = modelidentifier
|
||||
self.pushtransport = pushtransport
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case trigger
|
||||
case sentatms = "sentAtMs"
|
||||
case displayname = "displayName"
|
||||
case version
|
||||
case platform
|
||||
case devicefamily = "deviceFamily"
|
||||
case modelidentifier = "modelIdentifier"
|
||||
case pushtransport = "pushTransport"
|
||||
}
|
||||
}
|
||||
|
||||
public struct NodePendingDrainParams: Codable, Sendable {
|
||||
public let maxitems: Int?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user