Implement iPhone password swipe actions
This commit is contained in:
@@ -625,6 +625,10 @@ public protocol MobileAuthenticationProtocol: AnyObject, Sendable {
|
||||
|
||||
func manualLock() throws
|
||||
|
||||
func performEntryMutation(request: MobileMutationRequest) throws -> MobileMutationOutcome
|
||||
|
||||
func prepareEntryMutation(path: String, action: MobileMutationAction) throws -> MobileMutationPlan
|
||||
|
||||
func removeEntryEditorField(editor: UInt64, field: UInt64) throws -> MobileEntryEditorPage
|
||||
|
||||
func reorderEntryEditorField(editor: UInt64, field: UInt64, index: UInt32) throws -> MobileEntryEditorPage
|
||||
@@ -821,6 +825,27 @@ open func manualLock()throws {try rustCallWithError(FfiConverterTypeMobileAuth
|
||||
}
|
||||
}
|
||||
|
||||
open func performEntryMutation(request: MobileMutationRequest)throws -> MobileMutationOutcome {
|
||||
return try FfiConverterTypeMobileMutationOutcome_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
|
||||
uniffiCallStatus in
|
||||
uniffi_ironstorage_apple_fn_method_mobileauthentication_perform_entry_mutation(
|
||||
self.uniffiCloneHandle(),
|
||||
FfiConverterTypeMobileMutationRequest_lower(request),uniffiCallStatus
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
open func prepareEntryMutation(path: String, action: MobileMutationAction)throws -> MobileMutationPlan {
|
||||
return try FfiConverterTypeMobileMutationPlan_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
|
||||
uniffiCallStatus in
|
||||
uniffi_ironstorage_apple_fn_method_mobileauthentication_prepare_entry_mutation(
|
||||
self.uniffiCloneHandle(),
|
||||
FfiConverterString.lower(path),
|
||||
FfiConverterTypeMobileMutationAction_lower(action),uniffiCallStatus
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
open func removeEntryEditorField(editor: UInt64, field: UInt64)throws -> MobileEntryEditorPage {
|
||||
return try FfiConverterTypeMobileEntryEditorPage_lift(try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
|
||||
uniffiCallStatus in
|
||||
@@ -2908,6 +2933,282 @@ public func FfiConverterTypeMobileKeyTransferProgress_lower(_ value: MobileKeyTr
|
||||
}
|
||||
|
||||
|
||||
public struct MobileMutationDestination: Equatable, Hashable {
|
||||
public var path: String
|
||||
public var title: String
|
||||
public var detail: String
|
||||
public var requiresOverwrite: Bool
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(path: String, title: String, detail: String, requiresOverwrite: Bool) {
|
||||
self.path = path
|
||||
self.title = title
|
||||
self.detail = detail
|
||||
self.requiresOverwrite = requiresOverwrite
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if compiler(>=6)
|
||||
extension MobileMutationDestination: Sendable {}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public struct FfiConverterTypeMobileMutationDestination: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileMutationDestination {
|
||||
return
|
||||
try MobileMutationDestination(
|
||||
path: FfiConverterString.read(from: &buf),
|
||||
title: FfiConverterString.read(from: &buf),
|
||||
detail: FfiConverterString.read(from: &buf),
|
||||
requiresOverwrite: FfiConverterBool.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: MobileMutationDestination, into buf: inout [UInt8]) {
|
||||
FfiConverterString.write(value.path, into: &buf)
|
||||
FfiConverterString.write(value.title, into: &buf)
|
||||
FfiConverterString.write(value.detail, into: &buf)
|
||||
FfiConverterBool.write(value.requiresOverwrite, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationDestination_lift(_ buf: RustBuffer) throws -> MobileMutationDestination {
|
||||
return try FfiConverterTypeMobileMutationDestination.lift(buf)
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationDestination_lower(_ value: MobileMutationDestination) -> RustBuffer {
|
||||
return FfiConverterTypeMobileMutationDestination.lower(value)
|
||||
}
|
||||
|
||||
|
||||
public struct MobileMutationOutcome: Equatable, Hashable {
|
||||
public var action: MobileMutationAction
|
||||
public var source: String
|
||||
public var destination: String?
|
||||
public var title: String
|
||||
public var detail: String
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(action: MobileMutationAction, source: String, destination: String?, title: String, detail: String) {
|
||||
self.action = action
|
||||
self.source = source
|
||||
self.destination = destination
|
||||
self.title = title
|
||||
self.detail = detail
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if compiler(>=6)
|
||||
extension MobileMutationOutcome: Sendable {}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public struct FfiConverterTypeMobileMutationOutcome: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileMutationOutcome {
|
||||
return
|
||||
try MobileMutationOutcome(
|
||||
action: FfiConverterTypeMobileMutationAction.read(from: &buf),
|
||||
source: FfiConverterString.read(from: &buf),
|
||||
destination: FfiConverterOptionString.read(from: &buf),
|
||||
title: FfiConverterString.read(from: &buf),
|
||||
detail: FfiConverterString.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: MobileMutationOutcome, into buf: inout [UInt8]) {
|
||||
FfiConverterTypeMobileMutationAction.write(value.action, into: &buf)
|
||||
FfiConverterString.write(value.source, into: &buf)
|
||||
FfiConverterOptionString.write(value.destination, into: &buf)
|
||||
FfiConverterString.write(value.title, into: &buf)
|
||||
FfiConverterString.write(value.detail, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationOutcome_lift(_ buf: RustBuffer) throws -> MobileMutationOutcome {
|
||||
return try FfiConverterTypeMobileMutationOutcome.lift(buf)
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationOutcome_lower(_ value: MobileMutationOutcome) -> RustBuffer {
|
||||
return FfiConverterTypeMobileMutationOutcome.lower(value)
|
||||
}
|
||||
|
||||
|
||||
public struct MobileMutationPlan: Equatable, Hashable {
|
||||
public var action: MobileMutationAction
|
||||
public var source: String
|
||||
public var sourceTitle: String
|
||||
public var revision: String
|
||||
public var destinations: [MobileMutationDestination]
|
||||
public var hasOpenEditor: Bool
|
||||
public var hasDirtyEditor: Bool
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(action: MobileMutationAction, source: String, sourceTitle: String, revision: String, destinations: [MobileMutationDestination], hasOpenEditor: Bool, hasDirtyEditor: Bool) {
|
||||
self.action = action
|
||||
self.source = source
|
||||
self.sourceTitle = sourceTitle
|
||||
self.revision = revision
|
||||
self.destinations = destinations
|
||||
self.hasOpenEditor = hasOpenEditor
|
||||
self.hasDirtyEditor = hasDirtyEditor
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if compiler(>=6)
|
||||
extension MobileMutationPlan: Sendable {}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public struct FfiConverterTypeMobileMutationPlan: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileMutationPlan {
|
||||
return
|
||||
try MobileMutationPlan(
|
||||
action: FfiConverterTypeMobileMutationAction.read(from: &buf),
|
||||
source: FfiConverterString.read(from: &buf),
|
||||
sourceTitle: FfiConverterString.read(from: &buf),
|
||||
revision: FfiConverterString.read(from: &buf),
|
||||
destinations: FfiConverterSequenceTypeMobileMutationDestination.read(from: &buf),
|
||||
hasOpenEditor: FfiConverterBool.read(from: &buf),
|
||||
hasDirtyEditor: FfiConverterBool.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: MobileMutationPlan, into buf: inout [UInt8]) {
|
||||
FfiConverterTypeMobileMutationAction.write(value.action, into: &buf)
|
||||
FfiConverterString.write(value.source, into: &buf)
|
||||
FfiConverterString.write(value.sourceTitle, into: &buf)
|
||||
FfiConverterString.write(value.revision, into: &buf)
|
||||
FfiConverterSequenceTypeMobileMutationDestination.write(value.destinations, into: &buf)
|
||||
FfiConverterBool.write(value.hasOpenEditor, into: &buf)
|
||||
FfiConverterBool.write(value.hasDirtyEditor, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationPlan_lift(_ buf: RustBuffer) throws -> MobileMutationPlan {
|
||||
return try FfiConverterTypeMobileMutationPlan.lift(buf)
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationPlan_lower(_ value: MobileMutationPlan) -> RustBuffer {
|
||||
return FfiConverterTypeMobileMutationPlan.lower(value)
|
||||
}
|
||||
|
||||
|
||||
public struct MobileMutationRequest: Equatable, Hashable {
|
||||
public var action: MobileMutationAction
|
||||
public var source: String
|
||||
public var revision: String
|
||||
public var destination: String?
|
||||
public var confirmed: Bool
|
||||
public var overwrite: Bool
|
||||
public var discardEditor: Bool
|
||||
|
||||
// Default memberwise initializers are never public by default, so we
|
||||
// declare one manually.
|
||||
public init(action: MobileMutationAction, source: String, revision: String, destination: String?, confirmed: Bool, overwrite: Bool, discardEditor: Bool) {
|
||||
self.action = action
|
||||
self.source = source
|
||||
self.revision = revision
|
||||
self.destination = destination
|
||||
self.confirmed = confirmed
|
||||
self.overwrite = overwrite
|
||||
self.discardEditor = discardEditor
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if compiler(>=6)
|
||||
extension MobileMutationRequest: Sendable {}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public struct FfiConverterTypeMobileMutationRequest: FfiConverterRustBuffer {
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileMutationRequest {
|
||||
return
|
||||
try MobileMutationRequest(
|
||||
action: FfiConverterTypeMobileMutationAction.read(from: &buf),
|
||||
source: FfiConverterString.read(from: &buf),
|
||||
revision: FfiConverterString.read(from: &buf),
|
||||
destination: FfiConverterOptionString.read(from: &buf),
|
||||
confirmed: FfiConverterBool.read(from: &buf),
|
||||
overwrite: FfiConverterBool.read(from: &buf),
|
||||
discardEditor: FfiConverterBool.read(from: &buf)
|
||||
)
|
||||
}
|
||||
|
||||
public static func write(_ value: MobileMutationRequest, into buf: inout [UInt8]) {
|
||||
FfiConverterTypeMobileMutationAction.write(value.action, into: &buf)
|
||||
FfiConverterString.write(value.source, into: &buf)
|
||||
FfiConverterString.write(value.revision, into: &buf)
|
||||
FfiConverterOptionString.write(value.destination, into: &buf)
|
||||
FfiConverterBool.write(value.confirmed, into: &buf)
|
||||
FfiConverterBool.write(value.overwrite, into: &buf)
|
||||
FfiConverterBool.write(value.discardEditor, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationRequest_lift(_ buf: RustBuffer) throws -> MobileMutationRequest {
|
||||
return try FfiConverterTypeMobileMutationRequest.lift(buf)
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationRequest_lower(_ value: MobileMutationRequest) -> RustBuffer {
|
||||
return FfiConverterTypeMobileMutationRequest.lower(value)
|
||||
}
|
||||
|
||||
|
||||
public struct MobileOnboardingDiscovery: Equatable, Hashable {
|
||||
public var branches: [String]
|
||||
public var selectedBranch: UInt32
|
||||
@@ -4611,6 +4912,79 @@ public func FfiConverterTypeMobileKeyTransferKind_lower(_ value: MobileKeyTransf
|
||||
|
||||
|
||||
|
||||
public enum MobileMutationAction: Equatable, Hashable {
|
||||
|
||||
case move
|
||||
case copy
|
||||
case delete
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#if compiler(>=6)
|
||||
extension MobileMutationAction: Sendable {}
|
||||
#endif
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public struct FfiConverterTypeMobileMutationAction: FfiConverterRustBuffer {
|
||||
typealias SwiftType = MobileMutationAction
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileMutationAction {
|
||||
let variant: Int32 = try readInt(&buf)
|
||||
switch variant {
|
||||
|
||||
case 1: return .move
|
||||
|
||||
case 2: return .copy
|
||||
|
||||
case 3: return .delete
|
||||
|
||||
default: throw UniffiInternalError.unexpectedEnumCase
|
||||
}
|
||||
}
|
||||
|
||||
public static func write(_ value: MobileMutationAction, into buf: inout [UInt8]) {
|
||||
switch value {
|
||||
|
||||
|
||||
case .move:
|
||||
writeInt(&buf, Int32(1))
|
||||
|
||||
|
||||
case .copy:
|
||||
writeInt(&buf, Int32(2))
|
||||
|
||||
|
||||
case .delete:
|
||||
writeInt(&buf, Int32(3))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationAction_lift(_ buf: RustBuffer) throws -> MobileMutationAction {
|
||||
return try FfiConverterTypeMobileMutationAction.lift(buf)
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
public func FfiConverterTypeMobileMutationAction_lower(_ value: MobileMutationAction) -> RustBuffer {
|
||||
return FfiConverterTypeMobileMutationAction.lower(value)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public enum MobileOnboardingErrorKind: Equatable, Hashable {
|
||||
|
||||
case invalidInput
|
||||
@@ -5807,6 +6181,31 @@ fileprivate struct FfiConverterSequenceTypeMobileKeyTransferKey: FfiConverterRus
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
fileprivate struct FfiConverterSequenceTypeMobileMutationDestination: FfiConverterRustBuffer {
|
||||
typealias SwiftType = [MobileMutationDestination]
|
||||
|
||||
public static func write(_ value: [MobileMutationDestination], into buf: inout [UInt8]) {
|
||||
let len = Int32(value.count)
|
||||
writeInt(&buf, len)
|
||||
for item in value {
|
||||
FfiConverterTypeMobileMutationDestination.write(item, into: &buf)
|
||||
}
|
||||
}
|
||||
|
||||
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [MobileMutationDestination] {
|
||||
let len: Int32 = try readInt(&buf)
|
||||
var seq = [MobileMutationDestination]()
|
||||
seq.reserveCapacity(Int(len))
|
||||
for _ in 0 ..< len {
|
||||
seq.append(try FfiConverterTypeMobileMutationDestination.read(from: &buf))
|
||||
}
|
||||
return seq
|
||||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.8)
|
||||
@_documentation(visibility: private)
|
||||
#endif
|
||||
@@ -6048,6 +6447,12 @@ private let initializationResult: InitializationResult = {
|
||||
if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_manual_lock() != 57220) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_perform_entry_mutation() != 7053) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_prepare_entry_mutation() != 6234) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_remove_entry_editor_field() != 12238) {
|
||||
return InitializationResult.apiChecksumMismatch
|
||||
}
|
||||
|
||||
@@ -308,6 +308,16 @@ RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_generate_entr
|
||||
void uniffi_ironstorage_apple_fn_method_mobileauthentication_manual_lock(uint64_t ptr, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION
|
||||
#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION
|
||||
RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_perform_entry_mutation(uint64_t ptr, RustBuffer request, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION
|
||||
#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION
|
||||
RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_prepare_entry_mutation(uint64_t ptr, RustBuffer path, RustBuffer action, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD
|
||||
#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_FN_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD
|
||||
RustBuffer uniffi_ironstorage_apple_fn_method_mobileauthentication_remove_entry_editor_field(uint64_t ptr, uint64_t editor, uint64_t field, RustCallStatus *_Nonnull out_status
|
||||
@@ -943,6 +953,18 @@ uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_generate_
|
||||
#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_MANUAL_LOCK
|
||||
uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_manual_lock(void
|
||||
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION
|
||||
#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PERFORM_ENTRY_MUTATION
|
||||
uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_perform_entry_mutation(void
|
||||
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION
|
||||
#define UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_PREPARE_ENTRY_MUTATION
|
||||
uint16_t uniffi_ironstorage_apple_checksum_method_mobileauthentication_prepare_entry_mutation(void
|
||||
|
||||
);
|
||||
#endif
|
||||
#ifndef UNIFFI_FFIDEF_UNIFFI_IRONSTORAGE_APPLE_CHECKSUM_METHOD_MOBILEAUTHENTICATION_REMOVE_ENTRY_EDITOR_FIELD
|
||||
|
||||
Reference in New Issue
Block a user