feat(android): add structured entry editor and encrypted draft recovery (#103)
This commit is contained in:
1 parent
d22d71eb5e
commit
06575363a2
23 files changed
+2330
-21
No files matched your search
@@ -1408,6 +1408,10 @@ public protocol MobileAuthenticationProtocol: AnyObject, Sendable {
|
||||
|
||||
func cancel() throws
|
||||
|
||||
func checkpointEntryEditor(editor: UInt64, version: UInt64) throws
|
||||
|
||||
func checkpointEntryEditorInputs(editor: UInt64, version: UInt64, fields: [MobileEntryEditorInput]) throws
|
||||
|
||||
func copyEntryField(path: String, field: UInt64) throws -> MobileEntryCopy
|
||||
|
||||
func copyPresentedEntryField(path: String, fieldId: UInt64, revision: String) throws -> MobileEntryCopy
|
||||
@@ -1462,6 +1466,8 @@ public protocol MobileAuthenticationProtocol: AnyObject, Sendable {
|
||||
|
||||
func restoreBiometricLease() throws -> MobileAuthenticationState
|
||||
|
||||
func resumeEntryEditor(editor: UInt64, passphrase: String?) throws -> MobileEntryEditorRecovery
|
||||
|
||||
func revealEntryField(path: String, field: UInt64) throws -> String
|
||||
|
||||
func revealPresentedEntryField(path: String, fieldId: UInt64, revision: String) throws -> String
|
||||
@@ -1627,6 +1633,27 @@ open func cancel()throws {try rustCallWithError(FfiConverterTypeMobileAuthenti
|
||||
}
|
||||
}
|
||||
|
||||
open func checkpointEntryEditor(editor: UInt64, version: UInt64)throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
|
||||
uniffiCallStatus in
|
||||
uniffi_ironstorage_mobile_fn_method_mobileauthentication_checkpoint_entry_editor(
|
||||
self.uniffiCloneHandle(),
|
||||
FfiConverterUInt64.lower(editor),
|
||||
FfiConverterUInt64.lower(version),uniffiCallStatus
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
open func checkpointEntryEditorInputs(editor: UInt64, version: UInt64, fields: [MobileEntryEditorInput])throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
|
||||
uniffiCallStatus in
|
||||
uniffi_ironstorage_mobile_fn_method_mobileauthentication_checkpoint_entry_editor_inputs(
|
||||
self.uniffiCloneHandle(),
|
||||
FfiConverterUInt64.lower(editor),
|
||||
FfiConverterUInt64.lower(version),
|
||||
FfiConverterSequenceTypeMobileEntryEditorInput.lower(fields),uniffiCallStatus
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
open func copyEntryField(path: String, field: UInt64)throws -> MobileEntryCopy {
|
||||
return try FfiConverterTypeMobileEntryCopy_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
|
||||
uniffiCallStatus in
|
||||
@@ -1918,6 +1945,17 @@ open func restoreBiometricLease()throws -> MobileAuthenticationState {
|
||||
})
|
||||
}
|
||||
|
||||
open func resumeEntryEditor(editor: UInt64, passphrase: String?)throws -> MobileEntryEditorRecovery {
|
||||
return try FfiConverterTypeMobileEntryEditorRecovery_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
|
||||
uniffiCallStatus in
|
||||
uniffi_ironstorage_mobile_fn_method_mobileauthentication_resume_entry_editor(
|
||||
self.uniffiCloneHandle(),
|
||||
FfiConverterUInt64.lower(editor),
|
||||
FfiConverterOptionString.lower(passphrase),uniffiCallStatus
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
open func revealEntryField(path: String, field: UInt64)throws -> String {
|
||||
return try FfiConverterString.lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
|
||||
uniffiCallStatus in
|
||||
@@ -5032,6 +5070,60 @@ public func FfiConverterTypeMobileEntryEditorPage_lower(_ value: MobileEntryEdit
|
||||
}
|
||||
|
||||
|
||||
public struct MobileEntryEditorRecovery: Equatable, Hashable {
|
||||
public var session: MobileEntryEditorSession
|
||||
public var inputs: [MobileEntryEditorInput]?
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(session: MobileEntryEditorSession, inputs: [MobileEntryEditorInput]?) {
|
||||
self.session = session
|
||||
self.inputs = inputs
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if compiler(>=6)
|
||||
extension MobileEntryEditorRecovery: Sendable {}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public struct FfiConverterTypeMobileEntryEditorRecovery: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileEntryEditorRecovery {
|
||||
return
|
||||
try MobileEntryEditorRecovery(
|
||||
session: FfiConverterTypeMobileEntryEditorSession.read(from: &buf),
|
||||
inputs: FfiConverterOptionSequenceTypeMobileEntryEditorInput.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: MobileEntryEditorRecovery, into buf: inout [UInt8]) {
|
||||
FfiConverterTypeMobileEntryEditorSession.write(value.session, into: &buf)
|
||||
FfiConverterOptionSequenceTypeMobileEntryEditorInput.write(value.inputs, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileEntryEditorRecovery_lift(_ buf: RustBuffer) throws -> MobileEntryEditorRecovery {
|
||||
return try FfiConverterTypeMobileEntryEditorRecovery.lift(buf)
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileEntryEditorRecovery_lower(_ value: MobileEntryEditorRecovery) -> RustBuffer {
|
||||
return FfiConverterTypeMobileEntryEditorRecovery.lower(value)
|
||||
}
|
||||
|
||||
|
||||
public struct MobileEntryEditorSession: Equatable, Hashable {
|
||||
public var id: UInt64
|
||||
public var page: MobileEntryEditorPage
|
||||
@@ -11889,6 +11981,30 @@ fileprivate struct FfiConverterOptionTypeMobilePrivateStorageErrorKind: FfiConve
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
fileprivate struct FfiConverterOptionSequenceTypeMobileEntryEditorInput: FfiConverterRustBuffer {
|
||||
typealias SwiftType = [MobileEntryEditorInput]?
|
||||
|
||||
public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
|
||||
guard let value = value else {
|
||||
writeInt(&buf, Int8(0))
|
||||
return
|
||||
}
|
||||
writeInt(&buf, Int8(1))
|
||||
FfiConverterSequenceTypeMobileEntryEditorInput.write(value, into: &buf)
|
||||
}
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
|
||||
switch try readInt(&buf) as Int8 {
|
||||
case 0: return nil
|
||||
case 1: return try FfiConverterSequenceTypeMobileEntryEditorInput.read(from: &buf)
|
||||
default: throw UniffiInternalError.unexpectedOptionalTag
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
@@ -12320,6 +12436,13 @@ public func mobileAuthentication()throws -> MobileAuthentication {
|
||||
)
|
||||
})
|
||||
}
|
||||
public func mobileEditorProcessRecreatedNotice() -> String {
|
||||
return try! FfiConverterString.lift(try! rustCall() {
|
||||
uniffiCallStatus in
|
||||
uniffi_ironstorage_mobile_fn_func_mobile_editor_process_recreated_notice(uniffiCallStatus
|
||||
)
|
||||
})
|
||||
}
|
||||
public func mobileHomeOperation(authentication: MobileAuthentication?) -> MobileHomeOperation {
|
||||
return try! FfiConverterTypeMobileHomeOperation_lift(try! rustCall() {
|
||||
uniffiCallStatus in
|
||||
@@ -12521,6 +12644,9 @@ private let initializationResult: InitializationResult = {
|
||||
if (uniffi_ironstorage_mobile_checksum_func_mobile_authentication() != 54684) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_mobile_checksum_func_mobile_editor_process_recreated_notice() != 20887) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_mobile_checksum_func_mobile_home_operation() != 10726) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
@@ -12608,6 +12734,12 @@ private let initializationResult: InitializationResult = {
|
||||
if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_cancel() != 40449) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_checkpoint_entry_editor() != 51032) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_checkpoint_entry_editor_inputs() != 62194) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_copy_entry_field() != 46283) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
@@ -12689,6 +12821,9 @@ private let initializationResult: InitializationResult = {
|
||||
if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_restore_biometric_lease() != 7408) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_resume_entry_editor() != 56859) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_mobile_checksum_method_mobileauthentication_reveal_entry_field() != 13272) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
@@ -13036,6 +13171,10 @@ extension MobileEntryEditorPage: CustomStringConvertible, CustomDebugStringConve
|
||||
public var description: String { "MobileEntryEditorPage([REDACTED])" }
|
||||
public var debugDescription: String { description }
|
||||
}
|
||||
extension MobileEntryEditorRecovery: CustomStringConvertible, CustomDebugStringConvertible {
|
||||
public var description: String { "MobileEntryEditorRecovery([REDACTED])" }
|
||||
public var debugDescription: String { description }
|
||||
}
|
||||
extension MobileEntryEditorSession: CustomStringConvertible, CustomDebugStringConvertible {
|
||||
public var description: String { "MobileEntryEditorSession([REDACTED])" }
|
||||
public var debugDescription: String { description }
|
||||
|
||||
Reference in new issue
Block a user