Prepare Apple App Store distribution (#59)

This commit is contained in:
2026-08-16 17:55:59 +02:00
parent b50e47ab73
commit f894d43eb6
46 changed files with 20694 additions and 166 deletions

View File

@@ -619,6 +619,8 @@ public protocol MobileAuthenticationProtocol: AnyObject, Sendable {
func copyTotpCode(path: String, unixSeconds: UInt64) throws -> MobileEntryCopy
func createDirectory(parent: String, name: String) throws
func discardEntryEditor(editor: UInt64) throws
func entryEditor(editor: UInt64) throws -> MobileEntryEditorPage
@@ -823,6 +825,16 @@ open func copyTotpCode(path: String, unixSeconds: UInt64)throws -> MobileEntryC
})
}
open func createDirectory(parent: String, name: String)throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
uniffiCallStatus in
uniffi_ironstorage_apple_fn_method_mobileauthentication_create_directory(
self.uniffiCloneHandle(),
FfiConverterString.lower(parent),
FfiConverterString.lower(name),uniffiCallStatus
)
}
}
open func discardEntryEditor(editor: UInt64)throws {try rustCallWithError(FfiConverterTypeMobileAuthenticationFfiError_lift) {
uniffiCallStatus in
uniffi_ironstorage_apple_fn_method_mobileauthentication_discard_entry_editor(
@@ -1551,7 +1563,7 @@ public protocol MobileKeyTransferImportProtocol: AnyObject, Sendable {
func addFrame(payload: String) throws -> MobileKeyTransferProgress
func `import`(passphrase: String?, makeDefault: Bool) throws -> MobileKeyTransferOutcome
func `import`(passphrase: String?, makeDefault: Bool, overwrite: Bool) throws -> MobileKeyTransferOutcome
}
open class MobileKeyTransferImport: MobileKeyTransferImportProtocol, @unchecked Sendable {
@@ -1617,13 +1629,14 @@ open func addFrame(payload: String)throws -> MobileKeyTransferProgress {
})
}
open func `import`(passphrase: String?, makeDefault: Bool)throws -> MobileKeyTransferOutcome {
open func `import`(passphrase: String?, makeDefault: Bool, overwrite: Bool)throws -> MobileKeyTransferOutcome {
return try FfiConverterTypeMobileKeyTransferOutcome_lift(try rustCallWithError(FfiConverterTypeMobileKeyTransferFfiError_lift) {
uniffiCallStatus in
uniffi_ironstorage_apple_fn_method_mobilekeytransferimport_import(
self.uniffiCloneHandle(),
FfiConverterOptionString.lower(passphrase),
FfiConverterBool.lower(makeDefault),uniffiCallStatus
FfiConverterBool.lower(makeDefault),
FfiConverterBool.lower(overwrite),uniffiCallStatus
)
})
}
@@ -1678,10 +1691,142 @@ public func FfiConverterTypeMobileKeyTransferImport_lower(_ value: MobileKeyTran
public protocol MobileLocalOnboardingOperationProtocol: AnyObject, Sendable {
func cancel()
func generate(userId: String, passphrase: String, replaceExistingKey: Bool) throws -> MobileOnboardingOutcome
}
open class MobileLocalOnboardingOperation: MobileLocalOnboardingOperationProtocol, @unchecked Sendable {
fileprivate let handle: UInt64
/// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct NoHandle {
public init() {}
}
// TODO: We'd like this to be `private` but for Swifty reasons,
// we can't implement `FfiConverter` without making this `required` and we can't
// make it `required` without making it `public`.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
required public init(unsafeFromHandle handle: UInt64) {
self.handle = handle
}
// This constructor can be used to instantiate a fake object.
// - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
//
// - Warning:
// Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public init(noHandle: NoHandle) {
self.handle = 0
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func uniffiCloneHandle() -> UInt64 {
return try! rustCall { uniffi_ironstorage_apple_fn_clone_mobilelocalonboardingoperation(self.handle, $0) }
}
// No primary constructor declared for this class.
deinit {
if handle == 0 {
// Mock objects have handle=0 don't try to free them
return
}
try! rustCall { uniffi_ironstorage_apple_fn_free_mobilelocalonboardingoperation(handle, $0) }
}
open func cancel() {try! rustCall() {
uniffiCallStatus in
uniffi_ironstorage_apple_fn_method_mobilelocalonboardingoperation_cancel(
self.uniffiCloneHandle(),uniffiCallStatus
)
}
}
open func generate(userId: String, passphrase: String, replaceExistingKey: Bool)throws -> MobileOnboardingOutcome {
return try FfiConverterTypeMobileOnboardingOutcome_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) {
uniffiCallStatus in
uniffi_ironstorage_apple_fn_method_mobilelocalonboardingoperation_generate(
self.uniffiCloneHandle(),
FfiConverterString.lower(userId),
FfiConverterString.lower(passphrase),
FfiConverterBool.lower(replaceExistingKey),uniffiCallStatus
)
})
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeMobileLocalOnboardingOperation: FfiConverter {
typealias FfiType = UInt64
typealias SwiftType = MobileLocalOnboardingOperation
public static func lift(_ handle: UInt64) throws -> MobileLocalOnboardingOperation {
return MobileLocalOnboardingOperation(unsafeFromHandle: handle)
}
public static func lower(_ value: MobileLocalOnboardingOperation) -> UInt64 {
return value.uniffiCloneHandle()
}
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileLocalOnboardingOperation {
let handle: UInt64 = try readInt(&buf)
return try lift(handle)
}
public static func write(_ value: MobileLocalOnboardingOperation, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeMobileLocalOnboardingOperation_lift(_ handle: UInt64) throws -> MobileLocalOnboardingOperation {
return try FfiConverterTypeMobileLocalOnboardingOperation.lift(handle)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeMobileLocalOnboardingOperation_lower(_ value: MobileLocalOnboardingOperation) -> UInt64 {
return FfiConverterTypeMobileLocalOnboardingOperation.lower(value)
}
public protocol MobileOnboardingOperationProtocol: AnyObject, Sendable {
func cancel()
func connectLocalStore() throws -> MobileOnboardingOutcome
func discover() throws -> MobileOnboardingDiscovery
func progress() -> MobileOnboardingProgress
@@ -1750,6 +1895,15 @@ open func cancel() {try! rustCall() {
}
}
open func connectLocalStore()throws -> MobileOnboardingOutcome {
return try FfiConverterTypeMobileOnboardingOutcome_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) {
uniffiCallStatus in
uniffi_ironstorage_apple_fn_method_mobileonboardingoperation_connect_local_store(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func discover()throws -> MobileOnboardingDiscovery {
return try FfiConverterTypeMobileOnboardingDiscovery_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) {
uniffiCallStatus in
@@ -2929,6 +3083,7 @@ public func FfiConverterTypeMobileHomeNotice_lower(_ value: MobileHomeNotice) ->
public struct MobileHomePage: Equatable, Hashable {
public var remoteConfigured: Bool
public var freshness: MobileHomeFreshness
public var refreshedAt: Int64?
public var summaries: [MobileHomeSummaryRow]
@@ -2940,7 +3095,8 @@ public struct MobileHomePage: Equatable, Hashable {
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(freshness: MobileHomeFreshness, refreshedAt: Int64?, summaries: [MobileHomeSummaryRow], incoming: [MobileHomeCommit], outgoing: [MobileHomeCommit], incomingTotal: UInt32, outgoingTotal: UInt32, notice: MobileHomeNotice?) {
public init(remoteConfigured: Bool, freshness: MobileHomeFreshness, refreshedAt: Int64?, summaries: [MobileHomeSummaryRow], incoming: [MobileHomeCommit], outgoing: [MobileHomeCommit], incomingTotal: UInt32, outgoingTotal: UInt32, notice: MobileHomeNotice?) {
self.remoteConfigured = remoteConfigured
self.freshness = freshness
self.refreshedAt = refreshedAt
self.summaries = summaries
@@ -2967,6 +3123,7 @@ public struct FfiConverterTypeMobileHomePage: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileHomePage {
return
try MobileHomePage(
remoteConfigured: FfiConverterBool.read(from: &buf),
freshness: FfiConverterTypeMobileHomeFreshness.read(from: &buf),
refreshedAt: FfiConverterOptionInt64.read(from: &buf),
summaries: FfiConverterSequenceTypeMobileHomeSummaryRow.read(from: &buf),
@@ -2979,6 +3136,7 @@ public struct FfiConverterTypeMobileHomePage: FfiConverterRustBuffer {
}
public static func write(_ value: MobileHomePage, into buf: inout [UInt8]) {
FfiConverterBool.write(value.remoteConfigured, into: &buf)
FfiConverterTypeMobileHomeFreshness.write(value.freshness, into: &buf)
FfiConverterOptionInt64.write(value.refreshedAt, into: &buf)
FfiConverterSequenceTypeMobileHomeSummaryRow.write(value.summaries, into: &buf)
@@ -4081,6 +4239,7 @@ public func FfiConverterTypeMobilePasswordRow_lower(_ value: MobilePasswordRow)
public struct MobilePreferences: Equatable, Hashable {
public var syncConfigured: Bool
public var repositoryTitle: String
public var repositoryUrl: String
public var serverTitle: String
@@ -4097,7 +4256,8 @@ public struct MobilePreferences: Equatable, Hashable {
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(repositoryTitle: String, repositoryUrl: String, serverTitle: String, serverIdentity: String, applicationAccount: String?, defaultKeyTitle: String, defaultKeyFingerprint: String, authenticationTimeoutSeconds: UInt64, biometricUnlockEnabled: Bool, appearance: MobileAppearance, watchState: MobileWatchPreferenceState, watchTitle: String, watchDetail: String) {
public init(syncConfigured: Bool, repositoryTitle: String, repositoryUrl: String, serverTitle: String, serverIdentity: String, applicationAccount: String?, defaultKeyTitle: String, defaultKeyFingerprint: String, authenticationTimeoutSeconds: UInt64, biometricUnlockEnabled: Bool, appearance: MobileAppearance, watchState: MobileWatchPreferenceState, watchTitle: String, watchDetail: String) {
self.syncConfigured = syncConfigured
self.repositoryTitle = repositoryTitle
self.repositoryUrl = repositoryUrl
self.serverTitle = serverTitle
@@ -4129,6 +4289,7 @@ public struct FfiConverterTypeMobilePreferences: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobilePreferences {
return
try MobilePreferences(
syncConfigured: FfiConverterBool.read(from: &buf),
repositoryTitle: FfiConverterString.read(from: &buf),
repositoryUrl: FfiConverterString.read(from: &buf),
serverTitle: FfiConverterString.read(from: &buf),
@@ -4146,6 +4307,7 @@ public struct FfiConverterTypeMobilePreferences: FfiConverterRustBuffer {
}
public static func write(_ value: MobilePreferences, into buf: inout [UInt8]) {
FfiConverterBool.write(value.syncConfigured, into: &buf)
FfiConverterString.write(value.repositoryTitle, into: &buf)
FfiConverterString.write(value.repositoryUrl, into: &buf)
FfiConverterString.write(value.serverTitle, into: &buf)
@@ -5674,12 +5836,78 @@ public func FfiConverterTypeMobileHomePhase_lower(_ value: MobileHomePhase) -> R
public enum MobileKeyTransferErrorKind: Equatable, Hashable {
case existingKey
case failed
}
#if compiler(>=6)
extension MobileKeyTransferErrorKind: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeMobileKeyTransferErrorKind: FfiConverterRustBuffer {
typealias SwiftType = MobileKeyTransferErrorKind
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MobileKeyTransferErrorKind {
let variant: Int32 = try readInt(&buf)
switch variant {
case 1: return .existingKey
case 2: return .failed
default: throw UniffiInternalError.unexpectedEnumCase
}
}
public static func write(_ value: MobileKeyTransferErrorKind, into buf: inout [UInt8]) {
switch value {
case .existingKey:
writeInt(&buf, Int32(1))
case .failed:
writeInt(&buf, Int32(2))
}
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeMobileKeyTransferErrorKind_lift(_ buf: RustBuffer) throws -> MobileKeyTransferErrorKind {
return try FfiConverterTypeMobileKeyTransferErrorKind.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeMobileKeyTransferErrorKind_lower(_ value: MobileKeyTransferErrorKind) -> RustBuffer {
return FfiConverterTypeMobileKeyTransferErrorKind.lower(value)
}
public
enum MobileKeyTransferFfiError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError {
case Failed(message: String
case Failed(kind: MobileKeyTransferErrorKind, message: String
)
@@ -5711,6 +5939,7 @@ public struct FfiConverterTypeMobileKeyTransferFfiError: FfiConverterRustBuffer
case 1: return .Failed(
kind: try FfiConverterTypeMobileKeyTransferErrorKind.read(from: &buf),
message: try FfiConverterString.read(from: &buf)
)
@@ -5725,8 +5954,9 @@ public struct FfiConverterTypeMobileKeyTransferFfiError: FfiConverterRustBuffer
case let .Failed(message):
case let .Failed(kind,message):
writeInt(&buf, Int32(1))
FfiConverterTypeMobileKeyTransferErrorKind.write(kind, into: &buf)
FfiConverterString.write(message, into: &buf)
}
@@ -5896,6 +6126,7 @@ public enum MobileOnboardingErrorKind: Equatable, Hashable {
case authentication
case repository
case existingClone
case existingKey
case interrupted
case secureStorage
case configuration
@@ -5931,13 +6162,15 @@ public struct FfiConverterTypeMobileOnboardingErrorKind: FfiConverterRustBuffer
case 5: return .existingClone
case 6: return .interrupted
case 6: return .existingKey
case 7: return .secureStorage
case 7: return .interrupted
case 8: return .configuration
case 8: return .secureStorage
case 9: return .alreadyConfigured
case 9: return .configuration
case 10: return .alreadyConfigured
default: throw UniffiInternalError.unexpectedEnumCase
}
@@ -5967,21 +6200,25 @@ public struct FfiConverterTypeMobileOnboardingErrorKind: FfiConverterRustBuffer
writeInt(&buf, Int32(5))
case .interrupted:
case .existingKey:
writeInt(&buf, Int32(6))
case .secureStorage:
case .interrupted:
writeInt(&buf, Int32(7))
case .configuration:
case .secureStorage:
writeInt(&buf, Int32(8))
case .alreadyConfigured:
case .configuration:
writeInt(&buf, Int32(9))
case .alreadyConfigured:
writeInt(&buf, Int32(10))
}
}
}
@@ -7574,6 +7811,20 @@ public func mobileKeyTransfer()throws -> MobileKeyTransfer {
)
})
}
public func mobileLocalKeyTransferImporter() -> MobileKeyTransferImport {
return try! FfiConverterTypeMobileKeyTransferImport_lift(try! rustCall() {
uniffiCallStatus in
uniffi_ironstorage_apple_fn_func_mobile_local_key_transfer_importer(uniffiCallStatus
)
})
}
public func mobileLocalOnboardingOperation() -> MobileLocalOnboardingOperation {
return try! FfiConverterTypeMobileLocalOnboardingOperation_lift(try! rustCall() {
uniffiCallStatus in
uniffi_ironstorage_apple_fn_func_mobile_local_onboarding_operation(uniffiCallStatus
)
})
}
public func mobileOnboardingOperation(serverUrl: String, account: String, repositoryPath: String, applicationToken: String)throws -> MobileOnboardingOperation {
return try FfiConverterTypeMobileOnboardingOperation_lift(try rustCallWithError(FfiConverterTypeMobileOnboardingFfiError_lift) {
uniffiCallStatus in
@@ -7670,6 +7921,12 @@ private let initializationResult: InitializationResult = {
if (uniffi_ironstorage_apple_checksum_func_mobile_key_transfer() != 57389) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_func_mobile_local_key_transfer_importer() != 50238) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_func_mobile_local_onboarding_operation() != 18004) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_func_mobile_onboarding_operation() != 8354) {
return InitializationResult.apiChecksumMismatch
}
@@ -7721,6 +7978,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_copy_totp_code() != 8344) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_create_directory() != 25476) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_method_mobileauthentication_discard_entry_editor() != 28195) {
return InitializationResult.apiChecksumMismatch
}
@@ -7856,12 +8116,21 @@ private let initializationResult: InitializationResult = {
if (uniffi_ironstorage_apple_checksum_method_mobilekeytransferimport_add_frame() != 27319) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_method_mobilekeytransferimport_import() != 37403) {
if (uniffi_ironstorage_apple_checksum_method_mobilekeytransferimport_import() != 44529) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_method_mobilelocalonboardingoperation_cancel() != 26455) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_method_mobilelocalonboardingoperation_generate() != 58931) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_cancel() != 49755) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_connect_local_store() != 57886) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_ironstorage_apple_checksum_method_mobileonboardingoperation_discover() != 2309) {
return InitializationResult.apiChecksumMismatch
}