From 47748241a247a8cf92c31c9dad601759d09dad3d Mon Sep 17 00:00:00 2001 From: Joel Carter Date: Thu, 14 Nov 2024 17:03:00 -0600 Subject: [PATCH] De-smurf naming --- Sources/XyoClient/Witness/Basic/BasicWitness.swift | 2 +- .../SystemInfoCellularProviderPayloadStruct.swift | 2 +- .../SystemInfo/SystemInfoDevicePayloadStruct.swift | 2 +- .../SystemInfoNetworkCellularPayloadStruct.swift | 4 ++-- .../SystemInfoNetworkPayloadStruct.swift | 14 +++++++------- .../SystemInfoNetworkWifiPayloadStruct.swift | 2 +- .../SystemInfoNetworkWiredPayloadStruct.swift | 2 +- .../SystemInfo/SystemInfoOsPayloadStruct.swift | 4 ++-- .../SystemInfoOsVersionPayloadStruct.swift | 2 +- .../Witness/SystemInfo/SystemInfoPayload.swift | 8 ++++---- .../Witness/SystemInfo/SystemInfoWitness.swift | 4 ++-- Tests/XyoClientTests/Panel.swift | 6 +++--- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Sources/XyoClient/Witness/Basic/BasicWitness.swift b/Sources/XyoClient/Witness/Basic/BasicWitness.swift index b39a592..2fd06c7 100644 --- a/Sources/XyoClient/Witness/Basic/BasicWitness.swift +++ b/Sources/XyoClient/Witness/Basic/BasicWitness.swift @@ -1,6 +1,6 @@ import Foundation -open class XyoBasicWitness: AbstractWitness { +open class BasicWitness: AbstractWitness { public typealias TPayloadOut = Payload diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoCellularProviderPayloadStruct.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoCellularProviderPayloadStruct.swift index fe9730b..b76cefe 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoCellularProviderPayloadStruct.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoCellularProviderPayloadStruct.swift @@ -1,7 +1,7 @@ import CoreTelephony import Foundation -struct XyoSystemInfoCellularProviderPayloadStruct: Encodable { +struct SystemInfoCellularProviderPayloadStruct: Encodable { var allowVoip: Bool? var icc: String? var name: String? diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoDevicePayloadStruct.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoDevicePayloadStruct.swift index 0acedbe..41d84d9 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoDevicePayloadStruct.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoDevicePayloadStruct.swift @@ -1,6 +1,6 @@ import Foundation -struct XyoSystemInfoDevicePayloadStruct: Encodable { +struct SystemInfoDevicePayloadStruct: Encodable { var model: String? var nodename: String? var release: String? diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkCellularPayloadStruct.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkCellularPayloadStruct.swift index cedddc8..9323382 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkCellularPayloadStruct.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkCellularPayloadStruct.swift @@ -1,9 +1,9 @@ import CoreTelephony import Foundation -struct XyoSystemInfoNetworkCellularPayloadStruct: Encodable { +struct SystemInfoNetworkCellularPayloadStruct: Encodable { var ip: String? - var provider = XyoSystemInfoCellularProviderPayloadStruct() + var provider = SystemInfoCellularProviderPayloadStruct() var radio: String? init(_ wifiInfo: WifiInformation?) { #if os(iOS) diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkPayloadStruct.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkPayloadStruct.swift index e6a06d5..310a571 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkPayloadStruct.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkPayloadStruct.swift @@ -1,13 +1,13 @@ import Foundation -struct XyoSystemInfoNetworkPayloadStruct: Encodable { - var cellular: XyoSystemInfoNetworkCellularPayloadStruct? - var wifi: XyoSystemInfoNetworkWifiPayloadStruct? - var wired: XyoSystemInfoNetworkWiredPayloadStruct? +struct SystemInfoNetworkPayloadStruct: Encodable { + var cellular: SystemInfoNetworkCellularPayloadStruct? + var wifi: SystemInfoNetworkWifiPayloadStruct? + var wired: SystemInfoNetworkWiredPayloadStruct? init(_ wifiInfo: WifiInformation) { - cellular = wifiInfo.isCellular() ? XyoSystemInfoNetworkCellularPayloadStruct(wifiInfo) : nil - wifi = wifiInfo.isWifi() ? XyoSystemInfoNetworkWifiPayloadStruct(wifiInfo) : nil - wired = wifiInfo.isWired() ? XyoSystemInfoNetworkWiredPayloadStruct(wifiInfo) : nil + cellular = wifiInfo.isCellular() ? SystemInfoNetworkCellularPayloadStruct(wifiInfo) : nil + wifi = wifiInfo.isWifi() ? SystemInfoNetworkWifiPayloadStruct(wifiInfo) : nil + wired = wifiInfo.isWired() ? SystemInfoNetworkWiredPayloadStruct(wifiInfo) : nil } } diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkWifiPayloadStruct.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkWifiPayloadStruct.swift index ad8bf3c..b848d8d 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkWifiPayloadStruct.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkWifiPayloadStruct.swift @@ -1,6 +1,6 @@ import Foundation -struct XyoSystemInfoNetworkWifiPayloadStruct: Encodable { +struct SystemInfoNetworkWifiPayloadStruct: Encodable { var ip: String? var mac: String? var rssi: Int? diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkWiredPayloadStruct.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkWiredPayloadStruct.swift index 5045e73..64b4a5a 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkWiredPayloadStruct.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoNetworkWiredPayloadStruct.swift @@ -1,6 +1,6 @@ import Foundation -struct XyoSystemInfoNetworkWiredPayloadStruct: Encodable { +struct SystemInfoNetworkWiredPayloadStruct: Encodable { var ip: String? init(_ wifiInfo: WifiInformation?) { ip = wifiInfo?.pathMonitor?.ip diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoOsPayloadStruct.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoOsPayloadStruct.swift index 7324635..82ee719 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoOsPayloadStruct.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoOsPayloadStruct.swift @@ -1,8 +1,8 @@ import Foundation -struct XyoSystemInfoOsPayloadStruct: Encodable { +struct SystemInfoOsPayloadStruct: Encodable { var name: String - var version = XyoSystemInfoOsVersionPayloadStruct() + var version = SystemInfoOsVersionPayloadStruct() init() { name = osName() } diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoOsVersionPayloadStruct.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoOsVersionPayloadStruct.swift index ef1599a..11f88df 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoOsVersionPayloadStruct.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoOsVersionPayloadStruct.swift @@ -1,6 +1,6 @@ import Foundation -struct XyoSystemInfoOsVersionPayloadStruct: Encodable { +struct SystemInfoOsVersionPayloadStruct: Encodable { var major: Int var minor: Int var patch: Int diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoPayload.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoPayload.swift index a185847..8907658 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoPayload.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoPayload.swift @@ -1,6 +1,6 @@ import Foundation -open class XyoSystemInfoPayload: Payload { +open class SystemInfoPayload: Payload { var wifiInfo: WifiInformation @@ -18,9 +18,9 @@ open class XyoSystemInfoPayload: Payload { } override open func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(XyoSystemInfoDevicePayloadStruct(), forKey: .device) - try container.encode(XyoSystemInfoNetworkPayloadStruct(wifiInfo), forKey: .network) - try container.encode(XyoSystemInfoOsPayloadStruct(), forKey: .os) + try container.encode(SystemInfoDevicePayloadStruct(), forKey: .device) + try container.encode(SystemInfoNetworkPayloadStruct(wifiInfo), forKey: .network) + try container.encode(SystemInfoOsPayloadStruct(), forKey: .os) try container.encode(self.schema, forKey: .schema) } } diff --git a/Sources/XyoClient/Witness/SystemInfo/SystemInfoWitness.swift b/Sources/XyoClient/Witness/SystemInfo/SystemInfoWitness.swift index 2ea6e47..5814dd0 100644 --- a/Sources/XyoClient/Witness/SystemInfo/SystemInfoWitness.swift +++ b/Sources/XyoClient/Witness/SystemInfo/SystemInfoWitness.swift @@ -1,6 +1,6 @@ import Foundation -open class XyoSystemInfoWitness: AbstractWitness { +open class SystemInfoWitness: AbstractWitness { var allowPathMonitor: Bool @@ -9,7 +9,7 @@ open class XyoSystemInfoWitness: AbstractWitness { } public override func observe() -> [Payload] { - let payload = XyoSystemInfoPayload(WifiInformation(allowPathMonitor)) + let payload = SystemInfoPayload(WifiInformation(allowPathMonitor)) return [payload] } } diff --git a/Tests/XyoClientTests/Panel.swift b/Tests/XyoClientTests/Panel.swift index 642db3a..fd2b018 100644 --- a/Tests/XyoClientTests/Panel.swift +++ b/Tests/XyoClientTests/Panel.swift @@ -43,7 +43,7 @@ final class PanelTests: XCTestCase { archive: archive, apiDomain: apiDomain, witnesses: [ - XyoBasicWitness(observer: { + BasicWitness(observer: { return Payload("network.xyo.basic") }) ] @@ -64,10 +64,10 @@ final class PanelTests: XCTestCase { archive: archive, apiDomain: apiDomain, witnesses: [ - XyoBasicWitness(observer: { + BasicWitness(observer: { return Payload("network.xyo.basic") }), - XyoSystemInfoWitness(), + SystemInfoWitness(), ] ) do {