diff --git a/Tun/Protobuf/SDLMessage.pb.swift b/Tun/Protobuf/SDLMessage.pb.swift index d277daa..c1e2621 100644 --- a/Tun/Protobuf/SDLMessage.pb.swift +++ b/Tun/Protobuf/SDLMessage.pb.swift @@ -308,6 +308,34 @@ struct SDLPolicyResponse: @unchecked Sendable { init() {} } +struct SDLExposedServiceRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var version: UInt32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct SDLExposedServiceResponse: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var version: UInt32 = 0 + + var tcpPorts: [UInt32] = [] + + var udpPorts: [UInt32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + struct SDLEvent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1260,6 +1288,82 @@ extension SDLPolicyResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem } } +extension SDLExposedServiceRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = "SDLExposedServiceRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "version"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self.version) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.version != 0 { + try visitor.visitSingularUInt32Field(value: self.version, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: SDLExposedServiceRequest, rhs: SDLExposedServiceRequest) -> Bool { + if lhs.version != rhs.version {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension SDLExposedServiceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = "SDLExposedServiceResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "version"), + 2: .standard(proto: "tcp_ports"), + 3: .standard(proto: "udp_ports"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self.version) }() + case 2: try { try decoder.decodeRepeatedUInt32Field(value: &self.tcpPorts) }() + case 3: try { try decoder.decodeRepeatedUInt32Field(value: &self.udpPorts) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.version != 0 { + try visitor.visitSingularUInt32Field(value: self.version, fieldNumber: 1) + } + if !self.tcpPorts.isEmpty { + try visitor.visitPackedUInt32Field(value: self.tcpPorts, fieldNumber: 2) + } + if !self.udpPorts.isEmpty { + try visitor.visitPackedUInt32Field(value: self.udpPorts, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: SDLExposedServiceResponse, rhs: SDLExposedServiceResponse) -> Bool { + if lhs.version != rhs.version {return false} + if lhs.tcpPorts != rhs.tcpPorts {return false} + if lhs.udpPorts != rhs.udpPorts {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension SDLEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = "SDLEvent" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ diff --git a/punchnet/Features/Auth/AuthService.swift b/punchnet/Features/Auth/AuthService.swift index cb404d6..9d95631 100644 --- a/punchnet/Features/Auth/AuthService.swift +++ b/punchnet/Features/Auth/AuthService.swift @@ -40,7 +40,6 @@ struct AuthService { ] params.merge(baseParams) {$1} - return try await SDLAPIClient.doPost(path: "/auth/login", params: params, as: NetworkSession.self) }