ping-openmls-sdk-react-native-macos 0.7.6 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -2953,6 +2953,160 @@ public func FfiConverterTypeMessageEnvelope_lower(_ value: MessageEnvelope) -> R
2953
2953
  return FfiConverterTypeMessageEnvelope.lower(value)
2954
2954
  }
2955
2955
 
2956
+ public struct RecoveryBackupView {
2957
+ public var v: UInt8
2958
+ public var accountId: Data
2959
+ public var identityExport: Data
2960
+ public var deviceGroupSnapshot: Data
2961
+ public var conversationSnapshots: [RecoveryConversationSnapshot]
2962
+ public var createdAtMs: UInt64
2963
+
2964
+ /// Default memberwise initializers are never public by default, so we
2965
+ /// declare one manually.
2966
+ public init(v: UInt8, accountId: Data, identityExport: Data, deviceGroupSnapshot: Data, conversationSnapshots: [RecoveryConversationSnapshot], createdAtMs: UInt64) {
2967
+ self.v = v
2968
+ self.accountId = accountId
2969
+ self.identityExport = identityExport
2970
+ self.deviceGroupSnapshot = deviceGroupSnapshot
2971
+ self.conversationSnapshots = conversationSnapshots
2972
+ self.createdAtMs = createdAtMs
2973
+ }
2974
+ }
2975
+
2976
+ extension RecoveryBackupView: Equatable, Hashable {
2977
+ public static func == (lhs: RecoveryBackupView, rhs: RecoveryBackupView) -> Bool {
2978
+ if lhs.v != rhs.v {
2979
+ return false
2980
+ }
2981
+ if lhs.accountId != rhs.accountId {
2982
+ return false
2983
+ }
2984
+ if lhs.identityExport != rhs.identityExport {
2985
+ return false
2986
+ }
2987
+ if lhs.deviceGroupSnapshot != rhs.deviceGroupSnapshot {
2988
+ return false
2989
+ }
2990
+ if lhs.conversationSnapshots != rhs.conversationSnapshots {
2991
+ return false
2992
+ }
2993
+ if lhs.createdAtMs != rhs.createdAtMs {
2994
+ return false
2995
+ }
2996
+ return true
2997
+ }
2998
+
2999
+ public func hash(into hasher: inout Hasher) {
3000
+ hasher.combine(v)
3001
+ hasher.combine(accountId)
3002
+ hasher.combine(identityExport)
3003
+ hasher.combine(deviceGroupSnapshot)
3004
+ hasher.combine(conversationSnapshots)
3005
+ hasher.combine(createdAtMs)
3006
+ }
3007
+ }
3008
+
3009
+ #if swift(>=5.8)
3010
+ @_documentation(visibility: private)
3011
+ #endif
3012
+ public struct FfiConverterTypeRecoveryBackupView: FfiConverterRustBuffer {
3013
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RecoveryBackupView {
3014
+ return
3015
+ try RecoveryBackupView(
3016
+ v: FfiConverterUInt8.read(from: &buf),
3017
+ accountId: FfiConverterData.read(from: &buf),
3018
+ identityExport: FfiConverterData.read(from: &buf),
3019
+ deviceGroupSnapshot: FfiConverterData.read(from: &buf),
3020
+ conversationSnapshots: FfiConverterSequenceTypeRecoveryConversationSnapshot.read(from: &buf),
3021
+ createdAtMs: FfiConverterUInt64.read(from: &buf)
3022
+ )
3023
+ }
3024
+
3025
+ public static func write(_ value: RecoveryBackupView, into buf: inout [UInt8]) {
3026
+ FfiConverterUInt8.write(value.v, into: &buf)
3027
+ FfiConverterData.write(value.accountId, into: &buf)
3028
+ FfiConverterData.write(value.identityExport, into: &buf)
3029
+ FfiConverterData.write(value.deviceGroupSnapshot, into: &buf)
3030
+ FfiConverterSequenceTypeRecoveryConversationSnapshot.write(value.conversationSnapshots, into: &buf)
3031
+ FfiConverterUInt64.write(value.createdAtMs, into: &buf)
3032
+ }
3033
+ }
3034
+
3035
+ #if swift(>=5.8)
3036
+ @_documentation(visibility: private)
3037
+ #endif
3038
+ public func FfiConverterTypeRecoveryBackupView_lift(_ buf: RustBuffer) throws -> RecoveryBackupView {
3039
+ return try FfiConverterTypeRecoveryBackupView.lift(buf)
3040
+ }
3041
+
3042
+ #if swift(>=5.8)
3043
+ @_documentation(visibility: private)
3044
+ #endif
3045
+ public func FfiConverterTypeRecoveryBackupView_lower(_ value: RecoveryBackupView) -> RustBuffer {
3046
+ return FfiConverterTypeRecoveryBackupView.lower(value)
3047
+ }
3048
+
3049
+ public struct RecoveryConversationSnapshot {
3050
+ public var conversationId: Data
3051
+ public var groupStateBytes: Data
3052
+
3053
+ /// Default memberwise initializers are never public by default, so we
3054
+ /// declare one manually.
3055
+ public init(conversationId: Data, groupStateBytes: Data) {
3056
+ self.conversationId = conversationId
3057
+ self.groupStateBytes = groupStateBytes
3058
+ }
3059
+ }
3060
+
3061
+ extension RecoveryConversationSnapshot: Equatable, Hashable {
3062
+ public static func == (lhs: RecoveryConversationSnapshot, rhs: RecoveryConversationSnapshot) -> Bool {
3063
+ if lhs.conversationId != rhs.conversationId {
3064
+ return false
3065
+ }
3066
+ if lhs.groupStateBytes != rhs.groupStateBytes {
3067
+ return false
3068
+ }
3069
+ return true
3070
+ }
3071
+
3072
+ public func hash(into hasher: inout Hasher) {
3073
+ hasher.combine(conversationId)
3074
+ hasher.combine(groupStateBytes)
3075
+ }
3076
+ }
3077
+
3078
+ #if swift(>=5.8)
3079
+ @_documentation(visibility: private)
3080
+ #endif
3081
+ public struct FfiConverterTypeRecoveryConversationSnapshot: FfiConverterRustBuffer {
3082
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> RecoveryConversationSnapshot {
3083
+ return
3084
+ try RecoveryConversationSnapshot(
3085
+ conversationId: FfiConverterData.read(from: &buf),
3086
+ groupStateBytes: FfiConverterData.read(from: &buf)
3087
+ )
3088
+ }
3089
+
3090
+ public static func write(_ value: RecoveryConversationSnapshot, into buf: inout [UInt8]) {
3091
+ FfiConverterData.write(value.conversationId, into: &buf)
3092
+ FfiConverterData.write(value.groupStateBytes, into: &buf)
3093
+ }
3094
+ }
3095
+
3096
+ #if swift(>=5.8)
3097
+ @_documentation(visibility: private)
3098
+ #endif
3099
+ public func FfiConverterTypeRecoveryConversationSnapshot_lift(_ buf: RustBuffer) throws -> RecoveryConversationSnapshot {
3100
+ return try FfiConverterTypeRecoveryConversationSnapshot.lift(buf)
3101
+ }
3102
+
3103
+ #if swift(>=5.8)
3104
+ @_documentation(visibility: private)
3105
+ #endif
3106
+ public func FfiConverterTypeRecoveryConversationSnapshot_lower(_ value: RecoveryConversationSnapshot) -> RustBuffer {
3107
+ return FfiConverterTypeRecoveryConversationSnapshot.lower(value)
3108
+ }
3109
+
2956
3110
  public struct UserId {
2957
3111
  public var value: Data
2958
3112
 
@@ -3615,6 +3769,31 @@ private struct FfiConverterSequenceTypeMessageEnvelope: FfiConverterRustBuffer {
3615
3769
  }
3616
3770
  }
3617
3771
 
3772
+ #if swift(>=5.8)
3773
+ @_documentation(visibility: private)
3774
+ #endif
3775
+ private struct FfiConverterSequenceTypeRecoveryConversationSnapshot: FfiConverterRustBuffer {
3776
+ typealias SwiftType = [RecoveryConversationSnapshot]
3777
+
3778
+ static func write(_ value: [RecoveryConversationSnapshot], into buf: inout [UInt8]) {
3779
+ let len = Int32(value.count)
3780
+ writeInt(&buf, len)
3781
+ for item in value {
3782
+ FfiConverterTypeRecoveryConversationSnapshot.write(item, into: &buf)
3783
+ }
3784
+ }
3785
+
3786
+ static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [RecoveryConversationSnapshot] {
3787
+ let len: Int32 = try readInt(&buf)
3788
+ var seq = [RecoveryConversationSnapshot]()
3789
+ seq.reserveCapacity(Int(len))
3790
+ for _ in 0 ..< len {
3791
+ try seq.append(FfiConverterTypeRecoveryConversationSnapshot.read(from: &buf))
3792
+ }
3793
+ return seq
3794
+ }
3795
+ }
3796
+
3618
3797
  private let UNIFFI_RUST_FUTURE_POLL_READY: Int8 = 0
3619
3798
  private let UNIFFI_RUST_FUTURE_POLL_MAYBE_READY: Int8 = 1
3620
3799
 
@@ -3736,12 +3915,48 @@ public func decodeCatchupSnapshot(snapshotBytes: Data) throws -> CatchupSnapshot
3736
3915
  })
3737
3916
  }
3738
3917
 
3918
+ public func decryptBackup(blob: Data, mnemonicPhrase: String) throws -> RecoveryBackupView {
3919
+ return try FfiConverterTypeRecoveryBackupView.lift(rustCallWithError(FfiConverterTypePingError.lift) {
3920
+ uniffi_ping_ffi_fn_func_decrypt_backup(
3921
+ FfiConverterData.lower(blob),
3922
+ FfiConverterString.lower(mnemonicPhrase), $0
3923
+ )
3924
+ })
3925
+ }
3926
+
3927
+ public func encryptBackup(mnemonicPhrase: String, accountId: Data, identityExport: Data, deviceGroupSnapshot: Data, conversationSnapshots: [RecoveryConversationSnapshot], createdAtMs: UInt64) throws -> Data {
3928
+ return try FfiConverterData.lift(rustCallWithError(FfiConverterTypePingError.lift) {
3929
+ uniffi_ping_ffi_fn_func_encrypt_backup(
3930
+ FfiConverterString.lower(mnemonicPhrase),
3931
+ FfiConverterData.lower(accountId),
3932
+ FfiConverterData.lower(identityExport),
3933
+ FfiConverterData.lower(deviceGroupSnapshot),
3934
+ FfiConverterSequenceTypeRecoveryConversationSnapshot.lower(conversationSnapshots),
3935
+ FfiConverterUInt64.lower(createdAtMs), $0
3936
+ )
3937
+ })
3938
+ }
3939
+
3739
3940
  public func generateIdentityExport() -> Data {
3740
3941
  return try! FfiConverterData.lift(try! rustCall {
3741
3942
  uniffi_ping_ffi_fn_func_generate_identity_export($0)
3742
3943
  })
3743
3944
  }
3744
3945
 
3946
+ public func generateMnemonicPhrase() throws -> String {
3947
+ return try FfiConverterString.lift(rustCallWithError(FfiConverterTypePingError.lift) {
3948
+ uniffi_ping_ffi_fn_func_generate_mnemonic_phrase($0)
3949
+ })
3950
+ }
3951
+
3952
+ public func normalizeMnemonicPhrase(phrase: String) throws -> String {
3953
+ return try FfiConverterString.lift(rustCallWithError(FfiConverterTypePingError.lift) {
3954
+ uniffi_ping_ffi_fn_func_normalize_mnemonic_phrase(
3955
+ FfiConverterString.lower(phrase), $0
3956
+ )
3957
+ })
3958
+ }
3959
+
3745
3960
  public func openLinkingTicket(sealed: Data, newDevicePriv: Data) throws -> LinkingTicket {
3746
3961
  return try FfiConverterTypeLinkingTicket.lift(rustCallWithError(FfiConverterTypePingError.lift) {
3747
3962
  uniffi_ping_ffi_fn_func_open_linking_ticket(
@@ -3779,9 +3994,21 @@ private var initializationResult: InitializationResult = {
3779
3994
  if uniffi_ping_ffi_checksum_func_decode_catchup_snapshot() != 40316 {
3780
3995
  return InitializationResult.apiChecksumMismatch
3781
3996
  }
3997
+ if uniffi_ping_ffi_checksum_func_decrypt_backup() != 58907 {
3998
+ return InitializationResult.apiChecksumMismatch
3999
+ }
4000
+ if uniffi_ping_ffi_checksum_func_encrypt_backup() != 42541 {
4001
+ return InitializationResult.apiChecksumMismatch
4002
+ }
3782
4003
  if uniffi_ping_ffi_checksum_func_generate_identity_export() != 15026 {
3783
4004
  return InitializationResult.apiChecksumMismatch
3784
4005
  }
4006
+ if uniffi_ping_ffi_checksum_func_generate_mnemonic_phrase() != 9754 {
4007
+ return InitializationResult.apiChecksumMismatch
4008
+ }
4009
+ if uniffi_ping_ffi_checksum_func_normalize_mnemonic_phrase() != 55353 {
4010
+ return InitializationResult.apiChecksumMismatch
4011
+ }
3785
4012
  if uniffi_ping_ffi_checksum_func_open_linking_ticket() != 64091 {
3786
4013
  return InitializationResult.apiChecksumMismatch
3787
4014
  }
package/ios/pingFFI.h CHANGED
@@ -552,10 +552,31 @@ uint64_t uniffi_ping_ffi_fn_method_transport_send(void*_Nonnull ptr, RustBuffer
552
552
  RustBuffer uniffi_ping_ffi_fn_func_decode_catchup_snapshot(RustBuffer snapshot_bytes, RustCallStatus *_Nonnull out_status
553
553
  );
554
554
  #endif
555
+ #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_DECRYPT_BACKUP
556
+ #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_DECRYPT_BACKUP
557
+ RustBuffer uniffi_ping_ffi_fn_func_decrypt_backup(RustBuffer blob, RustBuffer mnemonic_phrase, RustCallStatus *_Nonnull out_status
558
+ );
559
+ #endif
560
+ #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_ENCRYPT_BACKUP
561
+ #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_ENCRYPT_BACKUP
562
+ RustBuffer uniffi_ping_ffi_fn_func_encrypt_backup(RustBuffer mnemonic_phrase, RustBuffer account_id, RustBuffer identity_export, RustBuffer device_group_snapshot, RustBuffer conversation_snapshots, uint64_t created_at_ms, RustCallStatus *_Nonnull out_status
563
+ );
564
+ #endif
555
565
  #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_GENERATE_IDENTITY_EXPORT
556
566
  #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_GENERATE_IDENTITY_EXPORT
557
567
  RustBuffer uniffi_ping_ffi_fn_func_generate_identity_export(RustCallStatus *_Nonnull out_status
558
568
 
569
+ );
570
+ #endif
571
+ #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_GENERATE_MNEMONIC_PHRASE
572
+ #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_GENERATE_MNEMONIC_PHRASE
573
+ RustBuffer uniffi_ping_ffi_fn_func_generate_mnemonic_phrase(RustCallStatus *_Nonnull out_status
574
+
575
+ );
576
+ #endif
577
+ #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_NORMALIZE_MNEMONIC_PHRASE
578
+ #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_NORMALIZE_MNEMONIC_PHRASE
579
+ RustBuffer uniffi_ping_ffi_fn_func_normalize_mnemonic_phrase(RustBuffer phrase, RustCallStatus *_Nonnull out_status
559
580
  );
560
581
  #endif
561
582
  #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_OPEN_LINKING_TICKET
@@ -852,12 +873,36 @@ void ffi_ping_ffi_rust_future_complete_void(uint64_t handle, RustCallStatus *_No
852
873
  #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_DECODE_CATCHUP_SNAPSHOT
853
874
  uint16_t uniffi_ping_ffi_checksum_func_decode_catchup_snapshot(void
854
875
 
876
+ );
877
+ #endif
878
+ #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_DECRYPT_BACKUP
879
+ #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_DECRYPT_BACKUP
880
+ uint16_t uniffi_ping_ffi_checksum_func_decrypt_backup(void
881
+
882
+ );
883
+ #endif
884
+ #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_ENCRYPT_BACKUP
885
+ #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_ENCRYPT_BACKUP
886
+ uint16_t uniffi_ping_ffi_checksum_func_encrypt_backup(void
887
+
855
888
  );
856
889
  #endif
857
890
  #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_GENERATE_IDENTITY_EXPORT
858
891
  #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_GENERATE_IDENTITY_EXPORT
859
892
  uint16_t uniffi_ping_ffi_checksum_func_generate_identity_export(void
860
893
 
894
+ );
895
+ #endif
896
+ #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_GENERATE_MNEMONIC_PHRASE
897
+ #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_GENERATE_MNEMONIC_PHRASE
898
+ uint16_t uniffi_ping_ffi_checksum_func_generate_mnemonic_phrase(void
899
+
900
+ );
901
+ #endif
902
+ #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_NORMALIZE_MNEMONIC_PHRASE
903
+ #define UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_NORMALIZE_MNEMONIC_PHRASE
904
+ uint16_t uniffi_ping_ffi_checksum_func_normalize_mnemonic_phrase(void
905
+
861
906
  );
862
907
  #endif
863
908
  #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_CHECKSUM_FUNC_OPEN_LINKING_TICKET
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ping-openmls-sdk-react-native-macos",
3
- "version": "0.7.6",
3
+ "version": "0.7.9",
4
4
  "description": "Real MLS for React Native macOS apps — wraps the ping-openmls-sdk Rust core via UniFFI.",
5
5
  "homepage": "https://github.com/AMP-Media-Development/ping-openmls-sdk",
6
6
  "license": "Apache-2.0",