Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Libraryfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MIDDLE_VERSION=v0.44.0-nightly.20251126.1
MIDDLE_VERSION=v0.44.0-nightly.20251202.1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand All @@ -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
}
}
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)

}

Expand Down Expand Up @@ -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<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand Down Expand Up @@ -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
}
}
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down Expand Up @@ -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<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand All @@ -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
}
}
Expand All @@ -177,13 +181,17 @@ 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)
}

public static func ==(lhs: Anytype_Rpc.Wallet.Recover.Request, rhs: Anytype_Rpc.Wallet.Recover.Request) -> Bool {
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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
}
3 changes: 3 additions & 0 deletions Modules/Services/Sources/Generated/BundledPropertyKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -501,4 +501,7 @@ public enum BundledPropertyKey: String, Sendable {

/// Is file available offline
case fileAvailableOffline = "fileAvailableOffline"

/// Anonymous chat analytics id
case analyticsChatId = "analyticsChatId"
}