ping-openmls-sdk-react-native-macos 0.7.7 → 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
@@ -2958,15 +2958,17 @@ public struct RecoveryBackupView {
2958
2958
  public var accountId: Data
2959
2959
  public var identityExport: Data
2960
2960
  public var deviceGroupSnapshot: Data
2961
+ public var conversationSnapshots: [RecoveryConversationSnapshot]
2961
2962
  public var createdAtMs: UInt64
2962
2963
 
2963
2964
  /// Default memberwise initializers are never public by default, so we
2964
2965
  /// declare one manually.
2965
- public init(v: UInt8, accountId: Data, identityExport: Data, deviceGroupSnapshot: Data, createdAtMs: UInt64) {
2966
+ public init(v: UInt8, accountId: Data, identityExport: Data, deviceGroupSnapshot: Data, conversationSnapshots: [RecoveryConversationSnapshot], createdAtMs: UInt64) {
2966
2967
  self.v = v
2967
2968
  self.accountId = accountId
2968
2969
  self.identityExport = identityExport
2969
2970
  self.deviceGroupSnapshot = deviceGroupSnapshot
2971
+ self.conversationSnapshots = conversationSnapshots
2970
2972
  self.createdAtMs = createdAtMs
2971
2973
  }
2972
2974
  }
@@ -2985,6 +2987,9 @@ extension RecoveryBackupView: Equatable, Hashable {
2985
2987
  if lhs.deviceGroupSnapshot != rhs.deviceGroupSnapshot {
2986
2988
  return false
2987
2989
  }
2990
+ if lhs.conversationSnapshots != rhs.conversationSnapshots {
2991
+ return false
2992
+ }
2988
2993
  if lhs.createdAtMs != rhs.createdAtMs {
2989
2994
  return false
2990
2995
  }
@@ -2996,6 +3001,7 @@ extension RecoveryBackupView: Equatable, Hashable {
2996
3001
  hasher.combine(accountId)
2997
3002
  hasher.combine(identityExport)
2998
3003
  hasher.combine(deviceGroupSnapshot)
3004
+ hasher.combine(conversationSnapshots)
2999
3005
  hasher.combine(createdAtMs)
3000
3006
  }
3001
3007
  }
@@ -3011,6 +3017,7 @@ public struct FfiConverterTypeRecoveryBackupView: FfiConverterRustBuffer {
3011
3017
  accountId: FfiConverterData.read(from: &buf),
3012
3018
  identityExport: FfiConverterData.read(from: &buf),
3013
3019
  deviceGroupSnapshot: FfiConverterData.read(from: &buf),
3020
+ conversationSnapshots: FfiConverterSequenceTypeRecoveryConversationSnapshot.read(from: &buf),
3014
3021
  createdAtMs: FfiConverterUInt64.read(from: &buf)
3015
3022
  )
3016
3023
  }
@@ -3020,6 +3027,7 @@ public struct FfiConverterTypeRecoveryBackupView: FfiConverterRustBuffer {
3020
3027
  FfiConverterData.write(value.accountId, into: &buf)
3021
3028
  FfiConverterData.write(value.identityExport, into: &buf)
3022
3029
  FfiConverterData.write(value.deviceGroupSnapshot, into: &buf)
3030
+ FfiConverterSequenceTypeRecoveryConversationSnapshot.write(value.conversationSnapshots, into: &buf)
3023
3031
  FfiConverterUInt64.write(value.createdAtMs, into: &buf)
3024
3032
  }
3025
3033
  }
@@ -3038,6 +3046,67 @@ public func FfiConverterTypeRecoveryBackupView_lower(_ value: RecoveryBackupView
3038
3046
  return FfiConverterTypeRecoveryBackupView.lower(value)
3039
3047
  }
3040
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
+
3041
3110
  public struct UserId {
3042
3111
  public var value: Data
3043
3112
 
@@ -3700,6 +3769,31 @@ private struct FfiConverterSequenceTypeMessageEnvelope: FfiConverterRustBuffer {
3700
3769
  }
3701
3770
  }
3702
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
+
3703
3797
  private let UNIFFI_RUST_FUTURE_POLL_READY: Int8 = 0
3704
3798
  private let UNIFFI_RUST_FUTURE_POLL_MAYBE_READY: Int8 = 1
3705
3799
 
@@ -3830,13 +3924,14 @@ public func decryptBackup(blob: Data, mnemonicPhrase: String) throws -> Recovery
3830
3924
  })
3831
3925
  }
3832
3926
 
3833
- public func encryptBackup(mnemonicPhrase: String, accountId: Data, identityExport: Data, deviceGroupSnapshot: Data, createdAtMs: UInt64) throws -> Data {
3927
+ public func encryptBackup(mnemonicPhrase: String, accountId: Data, identityExport: Data, deviceGroupSnapshot: Data, conversationSnapshots: [RecoveryConversationSnapshot], createdAtMs: UInt64) throws -> Data {
3834
3928
  return try FfiConverterData.lift(rustCallWithError(FfiConverterTypePingError.lift) {
3835
3929
  uniffi_ping_ffi_fn_func_encrypt_backup(
3836
3930
  FfiConverterString.lower(mnemonicPhrase),
3837
3931
  FfiConverterData.lower(accountId),
3838
3932
  FfiConverterData.lower(identityExport),
3839
3933
  FfiConverterData.lower(deviceGroupSnapshot),
3934
+ FfiConverterSequenceTypeRecoveryConversationSnapshot.lower(conversationSnapshots),
3840
3935
  FfiConverterUInt64.lower(createdAtMs), $0
3841
3936
  )
3842
3937
  })
@@ -3902,7 +3997,7 @@ private var initializationResult: InitializationResult = {
3902
3997
  if uniffi_ping_ffi_checksum_func_decrypt_backup() != 58907 {
3903
3998
  return InitializationResult.apiChecksumMismatch
3904
3999
  }
3905
- if uniffi_ping_ffi_checksum_func_encrypt_backup() != 7671 {
4000
+ if uniffi_ping_ffi_checksum_func_encrypt_backup() != 42541 {
3906
4001
  return InitializationResult.apiChecksumMismatch
3907
4002
  }
3908
4003
  if uniffi_ping_ffi_checksum_func_generate_identity_export() != 15026 {
package/ios/pingFFI.h CHANGED
@@ -559,7 +559,7 @@ RustBuffer uniffi_ping_ffi_fn_func_decrypt_backup(RustBuffer blob, RustBuffer mn
559
559
  #endif
560
560
  #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_ENCRYPT_BACKUP
561
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, uint64_t created_at_ms, RustCallStatus *_Nonnull out_status
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
563
  );
564
564
  #endif
565
565
  #ifndef UNIFFI_FFIDEF_UNIFFI_PING_FFI_FN_FUNC_GENERATE_IDENTITY_EXPORT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ping-openmls-sdk-react-native-macos",
3
- "version": "0.7.7",
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",