diff --git a/Libraryfile b/Libraryfile index 5cc9982fe9..4be6391804 100644 --- a/Libraryfile +++ b/Libraryfile @@ -1 +1 @@ -MIDDLE_VERSION=v0.44.0-nightly.20251126.1 +MIDDLE_VERSION=v0.44.0-nightly.20251202.1 diff --git a/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.Create.swift b/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.Create.swift index b84e455420..34da01a0df 100644 --- a/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.Create.swift +++ b/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.Create.swift @@ -56,6 +56,8 @@ extension Anytype_Rpc.Wallet { /// Mnemonic of a new account (sequence of words, divided by spaces) public var mnemonic: String = String() + public var accountKey: String = String() + public var unknownFields = SwiftProtobuf.UnknownStorage() public struct Error: Sendable { @@ -187,7 +189,7 @@ extension Anytype_Rpc.Wallet.Create.Request: SwiftProtobuf.Message, SwiftProtobu extension Anytype_Rpc.Wallet.Create.Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = Anytype_Rpc.Wallet.Create.protoMessageName + ".Response" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}error\0\u{1}mnemonic\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}error\0\u{1}mnemonic\0\u{1}accountKey\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -197,6 +199,7 @@ extension Anytype_Rpc.Wallet.Create.Response: SwiftProtobuf.Message, SwiftProtob switch fieldNumber { case 1: try { try decoder.decodeSingularMessageField(value: &self._error) }() case 2: try { try decoder.decodeSingularStringField(value: &self.mnemonic) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.accountKey) }() default: break } } @@ -213,12 +216,16 @@ extension Anytype_Rpc.Wallet.Create.Response: SwiftProtobuf.Message, SwiftProtob if !self.mnemonic.isEmpty { try visitor.visitSingularStringField(value: self.mnemonic, fieldNumber: 2) } + if !self.accountKey.isEmpty { + try visitor.visitSingularStringField(value: self.accountKey, fieldNumber: 3) + } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Anytype_Rpc.Wallet.Create.Response, rhs: Anytype_Rpc.Wallet.Create.Response) -> Bool { if lhs._error != rhs._error {return false} if lhs.mnemonic != rhs.mnemonic {return false} + if lhs.accountKey != rhs.accountKey {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.CreateSession.swift b/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.CreateSession.swift index 98fea091f8..1946cda39f 100644 --- a/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.CreateSession.swift +++ b/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.CreateSession.swift @@ -35,7 +35,7 @@ extension Anytype_Rpc.Wallet { set {auth = .mnemonic(newValue)} } - /// persistent app key, that can be used to restore session + /// persistent app key, that can be used to restore session. Used for Local JSON API public var appKey: String { get { if case .appKey(let v)? = auth {return v} @@ -53,15 +53,26 @@ extension Anytype_Rpc.Wallet { set {auth = .token(newValue)} } + /// private key of specific account + public var accountKey: String { + get { + if case .accountKey(let v)? = auth {return v} + return String() + } + set {auth = .accountKey(newValue)} + } + public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_Auth: Equatable, Sendable { /// cold auth case mnemonic(String) - /// persistent app key, that can be used to restore session + /// persistent app key, that can be used to restore session. Used for Local JSON API case appKey(String) /// token from the previous session case token(String) + /// private key of specific account + case accountKey(String) } @@ -180,7 +191,7 @@ extension Anytype_Rpc.Wallet.CreateSession: SwiftProtobuf.Message, SwiftProtobuf extension Anytype_Rpc.Wallet.CreateSession.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = Anytype_Rpc.Wallet.CreateSession.protoMessageName + ".Request" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}mnemonic\0\u{1}appKey\0\u{1}token\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}mnemonic\0\u{1}appKey\0\u{1}token\0\u{1}accountKey\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -212,6 +223,14 @@ extension Anytype_Rpc.Wallet.CreateSession.Request: SwiftProtobuf.Message, Swift self.auth = .token(v) } }() + case 4: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.auth != nil {try decoder.handleConflictingOneOf()} + self.auth = .accountKey(v) + } + }() default: break } } @@ -235,6 +254,10 @@ extension Anytype_Rpc.Wallet.CreateSession.Request: SwiftProtobuf.Message, Swift guard case .token(let v)? = self.auth else { preconditionFailure() } try visitor.visitSingularStringField(value: v, fieldNumber: 3) }() + case .accountKey?: try { + guard case .accountKey(let v)? = self.auth else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 4) + }() case nil: break } try unknownFields.traverse(visitor: &visitor) diff --git a/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.Recover.swift b/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.Recover.swift index 99dcd57422..15aeb6a77c 100644 --- a/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.Recover.swift +++ b/Modules/ProtobufMessages/Sources/Protocol/Commands/Anytype_Rpc.Wallet.Recover.swift @@ -29,12 +29,15 @@ extension Anytype_Rpc.Wallet { /// Path to a wallet directory public var rootPath: String = String() - /// Mnemonic of a wallet to recover + /// Mnemonic of a wallet to recover (mutually exclusive with accountKey) public var mnemonic: String = String() /// optional, default fts language public var fulltextPrimaryLanguage: String = String() + /// optional: serialized account master node (base64 encoded), used to auth account instead of mnemonic + public var accountKey: String = String() + public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} @@ -151,7 +154,7 @@ extension Anytype_Rpc.Wallet.Recover: SwiftProtobuf.Message, SwiftProtobuf._Mess extension Anytype_Rpc.Wallet.Recover.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = Anytype_Rpc.Wallet.Recover.protoMessageName + ".Request" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}rootPath\0\u{1}mnemonic\0\u{1}fulltextPrimaryLanguage\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}rootPath\0\u{1}mnemonic\0\u{1}fulltextPrimaryLanguage\0\u{1}accountKey\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -162,6 +165,7 @@ extension Anytype_Rpc.Wallet.Recover.Request: SwiftProtobuf.Message, SwiftProtob case 1: try { try decoder.decodeSingularStringField(value: &self.rootPath) }() case 2: try { try decoder.decodeSingularStringField(value: &self.mnemonic) }() case 3: try { try decoder.decodeSingularStringField(value: &self.fulltextPrimaryLanguage) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.accountKey) }() default: break } } @@ -177,6 +181,9 @@ extension Anytype_Rpc.Wallet.Recover.Request: SwiftProtobuf.Message, SwiftProtob if !self.fulltextPrimaryLanguage.isEmpty { try visitor.visitSingularStringField(value: self.fulltextPrimaryLanguage, fieldNumber: 3) } + if !self.accountKey.isEmpty { + try visitor.visitSingularStringField(value: self.accountKey, fieldNumber: 4) + } try unknownFields.traverse(visitor: &visitor) } @@ -184,6 +191,7 @@ extension Anytype_Rpc.Wallet.Recover.Request: SwiftProtobuf.Message, SwiftProtob if lhs.rootPath != rhs.rootPath {return false} if lhs.mnemonic != rhs.mnemonic {return false} if lhs.fulltextPrimaryLanguage != rhs.fulltextPrimaryLanguage {return false} + if lhs.accountKey != rhs.accountKey {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/Modules/Services/Sources/Generated/BundledPropertiesValueProvider.swift b/Modules/Services/Sources/Generated/BundledPropertiesValueProvider.swift index b29970ecf1..95932bfb1a 100644 --- a/Modules/Services/Sources/Generated/BundledPropertiesValueProvider.swift +++ b/Modules/Services/Sources/Generated/BundledPropertiesValueProvider.swift @@ -184,6 +184,7 @@ public protocol BundledPropertiesValueProvider { var isMainChat: Bool { get } var lastMessageDate: Date? { get } var fileAvailableOffline: Bool { get } + var analyticsChatId: String { get } } public extension BundledPropertiesValueProvider where Self: PropertyValueProvider { @@ -859,4 +860,8 @@ public extension BundledPropertiesValueProvider where Self: PropertyValueProvide var fileAvailableOffline: Bool { return value(for: BundledPropertyKey.fileAvailableOffline.rawValue) } + /// Anonymous chat analytics id + var analyticsChatId: String { + return value(for: BundledPropertyKey.analyticsChatId.rawValue) + } } diff --git a/Modules/Services/Sources/Generated/BundledPropertyKey.swift b/Modules/Services/Sources/Generated/BundledPropertyKey.swift index 22829eb868..ae74d3f058 100644 --- a/Modules/Services/Sources/Generated/BundledPropertyKey.swift +++ b/Modules/Services/Sources/Generated/BundledPropertyKey.swift @@ -501,4 +501,7 @@ public enum BundledPropertyKey: String, Sendable { /// Is file available offline case fileAvailableOffline = "fileAvailableOffline" + + /// Anonymous chat analytics id + case analyticsChatId = "analyticsChatId" }