@wireapp/core-crypto 10.0.0-pre.10 → 10.0.0-pre.12

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.
@@ -41,8 +41,55 @@ export declare function setMaxLogLevel(level: CoreCryptoLogLevel): void;
41
41
  * The version of `core-crypto`.
42
42
  */
43
43
  export declare function version(): string;
44
+ type UuidLike = Uuid;
44
45
  /**
45
- * This directly represents a `ClientId` of the `<userid>-<device-id>@<domain>` format.
46
+ * A Uuid.
47
+ */
48
+ export declare class Uuid extends UniffiAbstractObject {
49
+ readonly [uniffiTypeNameSymbol] = "Uuid";
50
+ readonly [destructorGuardSymbol]: UniffiGcObject;
51
+ readonly [pointerLiteralSymbol]: UniffiHandle;
52
+ /**
53
+ * Parse a `Uuid` from a string.
54
+ */
55
+ constructor(uuid: string);
56
+ toString(): string;
57
+ equals(other: Uuid): boolean;
58
+ hashCode(): bigint;
59
+ uniffiDestroy(): void;
60
+ static instanceOf(obj_: any): obj_ is Uuid;
61
+ }
62
+ type DeviceIdLike = DeviceId;
63
+ /**
64
+ * A Device ID.
65
+ */
66
+ export declare class DeviceId extends UniffiAbstractObject {
67
+ readonly [uniffiTypeNameSymbol] = "DeviceId";
68
+ readonly [destructorGuardSymbol]: UniffiGcObject;
69
+ readonly [pointerLiteralSymbol]: UniffiHandle;
70
+ /**
71
+ * New device id from an unsigned 64-bit integer.
72
+ */
73
+ constructor(id: bigint);
74
+ /**
75
+ * Construct a `DeviceId` from 8 bytes encoded as a hex string.
76
+ */
77
+ static fromHexString(hexString: string): DeviceIdLike;
78
+ /**
79
+ * Encode the `DeviceId` as a 16-character lowercase hex string, with leading 0s.
80
+ */
81
+ toHexString(): string;
82
+ /**
83
+ * Get the number corresponding to this `DeviceId`.
84
+ */
85
+ toU64(): bigint;
86
+ equals(other: DeviceId): boolean;
87
+ hashCode(): bigint;
88
+ uniffiDestroy(): void;
89
+ static instanceOf(obj_: any): obj_ is DeviceId;
90
+ }
91
+ /**
92
+ * This directly represents a `ClientId` of the `<userid>:<device-id>@<domain>` format.
46
93
  * Instantiate via [ClientId::deserialize].
47
94
  */
48
95
  export type DeserializedClientId = {
@@ -51,13 +98,13 @@ export type DeserializedClientId = {
51
98
  */
52
99
  clientId: ClientIdLike;
53
100
  /**
54
- * The string representation of a UUID
101
+ * The user id component
55
102
  */
56
- userId: string;
103
+ userId: UuidLike;
57
104
  /**
58
- * A hex-encoded unsigned 64-bit integer
105
+ * The device id component
59
106
  */
60
- deviceId: string;
107
+ deviceId: DeviceIdLike;
61
108
  /**
62
109
  * The domain
63
110
  */
@@ -70,6 +117,7 @@ export declare const DeserializedClientId: Readonly<{
70
117
  create: (partial: Partial<DeserializedClientId> & Required<Omit<DeserializedClientId, never>>) => DeserializedClientId;
71
118
  new: (partial: Partial<DeserializedClientId> & Required<Omit<DeserializedClientId, never>>) => DeserializedClientId;
72
119
  defaults: () => Partial<DeserializedClientId>;
120
+ toString(self_: DeserializedClientId): string;
73
121
  }>;
74
122
  type ClientIdLike = ClientId;
75
123
  /**
@@ -86,13 +134,13 @@ export declare class ClientId extends UniffiAbstractObject {
86
134
  /**
87
135
  * Create a new client id.
88
136
  */
89
- constructor(userId: string, deviceId: string, domain: string);
137
+ constructor(userId: UuidLike, deviceId: DeviceIdLike, domain: string);
90
138
  /**
91
139
  * Copy the wrapped data into a new byte array.
92
140
  */
93
141
  copyBytes(): Uint8Array;
94
142
  /**
95
- * Copy the wrapped data into a direct representation of the `<userid>-<device-id>@<domain>` format.
143
+ * Copy the wrapped data into a direct representation of the `<user-id>:<device-id>@<domain>` format.
96
144
  */
97
145
  deserialize(): DeserializedClientId;
98
146
  equals(other: ClientId): boolean;
@@ -3091,9 +3139,9 @@ declare class CoreCryptoContext extends UniffiAbstractObject {
3091
3139
  /**
3092
3140
  * Returns the E2EI identity claims for the specified users in the given conversation, grouped by user ID.
3093
3141
  */
3094
- getUserIdentities(conversationId: ConversationIdLike, userIds: Array<string>, asyncOpts_?: {
3142
+ getUserIdentities(conversationId: ConversationIdLike, userIds: Array<UuidLike>, asyncOpts_?: {
3095
3143
  signal: AbortSignal;
3096
- }): Promise<Map<string, Array<WireIdentity>>>;
3144
+ }): Promise<Map<UuidLike, Array<WireIdentity>>>;
3097
3145
  /**
3098
3146
  * Joins an existing conversation by constructing an external commit from the given group info.
3099
3147
  */
@@ -3480,9 +3528,9 @@ declare class CoreCryptoFfi extends UniffiAbstractObject {
3480
3528
  /**
3481
3529
  * Returns the E2EI identity claims for the specified users in the given conversation, grouped by user ID.
3482
3530
  */
3483
- getUserIdentities(conversationId: ConversationIdLike, userIds: Array<string>, asyncOpts_?: {
3531
+ getUserIdentities(conversationId: ConversationIdLike, userIds: Array<UuidLike>, asyncOpts_?: {
3484
3532
  signal: AbortSignal;
3485
- }): Promise<Map<string, Array<WireIdentity>>>;
3533
+ }): Promise<Map<UuidLike, Array<WireIdentity>>>;
3486
3534
  /**
3487
3535
  * Returns true if history sharing is currently enabled for the given conversation.
3488
3536
  */
@@ -396,6 +396,16 @@ var DEFINITIONS = {
396
396
  ret: FfiType.Void,
397
397
  hasRustCallStatus: true
398
398
  },
399
+ uniffi_core_crypto_ffi_fn_clone_deviceid: {
400
+ args: [FfiType.Handle],
401
+ ret: FfiType.Handle,
402
+ hasRustCallStatus: true
403
+ },
404
+ uniffi_core_crypto_ffi_fn_free_deviceid: {
405
+ args: [FfiType.Handle],
406
+ ret: FfiType.Void,
407
+ hasRustCallStatus: true
408
+ },
399
409
  uniffi_core_crypto_ffi_fn_clone_epochobserver: {
400
410
  args: [FfiType.Handle],
401
411
  ret: FfiType.Handle,
@@ -496,6 +506,16 @@ var DEFINITIONS = {
496
506
  ret: FfiType.Void,
497
507
  hasRustCallStatus: true
498
508
  },
509
+ uniffi_core_crypto_ffi_fn_clone_uuid: {
510
+ args: [FfiType.Handle],
511
+ ret: FfiType.Handle,
512
+ hasRustCallStatus: true
513
+ },
514
+ uniffi_core_crypto_ffi_fn_free_uuid: {
515
+ args: [FfiType.Handle],
516
+ ret: FfiType.Void,
517
+ hasRustCallStatus: true
518
+ },
499
519
  uniffi_core_crypto_ffi_fn_clone_welcome: {
500
520
  args: [FfiType.Handle],
501
521
  ret: FfiType.Handle,
@@ -613,8 +633,13 @@ var DEFINITIONS = {
613
633
  ret: FfiType.RustBuffer,
614
634
  hasRustCallStatus: true
615
635
  },
636
+ uniffi_core_crypto_ffi_fn_method_deserializedclientid_uniffi_trait_display: {
637
+ args: [FfiType.RustBuffer],
638
+ ret: FfiType.RustBuffer,
639
+ hasRustCallStatus: true
640
+ },
616
641
  uniffi_core_crypto_ffi_fn_constructor_clientid_new: {
617
- args: [FfiType.RustBuffer, FfiType.RustBuffer, FfiType.RustBuffer],
642
+ args: [FfiType.Handle, FfiType.Handle, FfiType.RustBuffer],
618
643
  ret: FfiType.Handle,
619
644
  hasRustCallStatus: true
620
645
  },
@@ -1195,6 +1220,41 @@ var DEFINITIONS = {
1195
1220
  ret: FfiType.Int8,
1196
1221
  hasRustCallStatus: true
1197
1222
  },
1223
+ uniffi_core_crypto_ffi_fn_constructor_deviceid_from_hex_string: {
1224
+ args: [FfiType.RustBuffer],
1225
+ ret: FfiType.Handle,
1226
+ hasRustCallStatus: true
1227
+ },
1228
+ uniffi_core_crypto_ffi_fn_constructor_deviceid_new: {
1229
+ args: [FfiType.UInt64],
1230
+ ret: FfiType.Handle,
1231
+ hasRustCallStatus: true
1232
+ },
1233
+ uniffi_core_crypto_ffi_fn_method_deviceid_to_hex_string: {
1234
+ args: [FfiType.Handle],
1235
+ ret: FfiType.RustBuffer,
1236
+ hasRustCallStatus: true
1237
+ },
1238
+ uniffi_core_crypto_ffi_fn_method_deviceid_to_u64: {
1239
+ args: [FfiType.Handle],
1240
+ ret: FfiType.UInt64,
1241
+ hasRustCallStatus: true
1242
+ },
1243
+ uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_eq_eq: {
1244
+ args: [FfiType.Handle, FfiType.Handle],
1245
+ ret: FfiType.Int8,
1246
+ hasRustCallStatus: true
1247
+ },
1248
+ uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_eq_ne: {
1249
+ args: [FfiType.Handle, FfiType.Handle],
1250
+ ret: FfiType.Int8,
1251
+ hasRustCallStatus: true
1252
+ },
1253
+ uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_hash: {
1254
+ args: [FfiType.Handle],
1255
+ ret: FfiType.UInt64,
1256
+ hasRustCallStatus: true
1257
+ },
1198
1258
  uniffi_core_crypto_ffi_fn_method_epochobserver_epoch_changed: {
1199
1259
  args: [FfiType.Handle, FfiType.Handle, FfiType.UInt64],
1200
1260
  ret: FfiType.Handle,
@@ -1367,6 +1427,31 @@ var DEFINITIONS = {
1367
1427
  ret: FfiType.UInt64,
1368
1428
  hasRustCallStatus: true
1369
1429
  },
1430
+ uniffi_core_crypto_ffi_fn_constructor_uuid_new: {
1431
+ args: [FfiType.RustBuffer],
1432
+ ret: FfiType.Handle,
1433
+ hasRustCallStatus: true
1434
+ },
1435
+ uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_display: {
1436
+ args: [FfiType.Handle],
1437
+ ret: FfiType.RustBuffer,
1438
+ hasRustCallStatus: true
1439
+ },
1440
+ uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_eq_eq: {
1441
+ args: [FfiType.Handle, FfiType.Handle],
1442
+ ret: FfiType.Int8,
1443
+ hasRustCallStatus: true
1444
+ },
1445
+ uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_eq_ne: {
1446
+ args: [FfiType.Handle, FfiType.Handle],
1447
+ ret: FfiType.Int8,
1448
+ hasRustCallStatus: true
1449
+ },
1450
+ uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_hash: {
1451
+ args: [FfiType.Handle],
1452
+ ret: FfiType.UInt64,
1453
+ hasRustCallStatus: true
1454
+ },
1370
1455
  uniffi_core_crypto_ffi_fn_constructor_welcome_new: {
1371
1456
  args: [FfiType.RustBuffer],
1372
1457
  ret: FfiType.Handle,
@@ -1967,6 +2052,26 @@ var DEFINITIONS = {
1967
2052
  ret: FfiType.UInt16,
1968
2053
  hasRustCallStatus: false
1969
2054
  },
2055
+ uniffi_core_crypto_ffi_checksum_constructor_deviceid_from_hex_string: {
2056
+ args: [],
2057
+ ret: FfiType.UInt16,
2058
+ hasRustCallStatus: false
2059
+ },
2060
+ uniffi_core_crypto_ffi_checksum_constructor_deviceid_new: {
2061
+ args: [],
2062
+ ret: FfiType.UInt16,
2063
+ hasRustCallStatus: false
2064
+ },
2065
+ uniffi_core_crypto_ffi_checksum_method_deviceid_to_hex_string: {
2066
+ args: [],
2067
+ ret: FfiType.UInt16,
2068
+ hasRustCallStatus: false
2069
+ },
2070
+ uniffi_core_crypto_ffi_checksum_method_deviceid_to_u64: {
2071
+ args: [],
2072
+ ret: FfiType.UInt16,
2073
+ hasRustCallStatus: false
2074
+ },
1970
2075
  uniffi_core_crypto_ffi_checksum_method_epochobserver_epoch_changed: {
1971
2076
  args: [],
1972
2077
  ret: FfiType.UInt16,
@@ -2097,6 +2202,11 @@ var DEFINITIONS = {
2097
2202
  ret: FfiType.UInt16,
2098
2203
  hasRustCallStatus: false
2099
2204
  },
2205
+ uniffi_core_crypto_ffi_checksum_constructor_uuid_new: {
2206
+ args: [],
2207
+ ret: FfiType.UInt16,
2208
+ hasRustCallStatus: false
2209
+ },
2100
2210
  uniffi_core_crypto_ffi_checksum_constructor_welcome_new: {
2101
2211
  args: [],
2102
2212
  ret: FfiType.UInt16,
@@ -2585,6 +2695,101 @@ function version() {
2585
2695
  return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_func_version(callStatus);
2586
2696
  }, FfiConverterString.lift.bind(FfiConverterString)));
2587
2697
  }
2698
+
2699
+ class Uuid extends UniffiAbstractObject {
2700
+ [uniffiTypeNameSymbol] = "Uuid";
2701
+ [destructorGuardSymbol];
2702
+ [pointerLiteralSymbol];
2703
+ constructor(uuid) {
2704
+ super();
2705
+ const pointer = uniffiCaller.rustCallWithError(FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError), (callStatus) => {
2706
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_constructor_uuid_new(FfiConverterString.lower(uuid, core_crypto_ffi_ffi_default().rustbuffer_alloc), callStatus);
2707
+ }, FfiConverterString.lift.bind(FfiConverterString));
2708
+ this[pointerLiteralSymbol] = pointer;
2709
+ this[destructorGuardSymbol] = uniffiTypeUuidObjectFactory.bless(pointer);
2710
+ }
2711
+ toString() {
2712
+ return ((__rb) => {
2713
+ try {
2714
+ return FfiConverterString.lift(__rb);
2715
+ } finally {
2716
+ core_crypto_ffi_ffi_default().rustbuffer_free(__rb);
2717
+ }
2718
+ })(uniffiCaller.rustCall((callStatus) => {
2719
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_display(uniffiTypeUuidObjectFactory.clonePointer(this), callStatus);
2720
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2721
+ }
2722
+ equals(other) {
2723
+ return FfiConverterBool.lift(uniffiCaller.rustCall((callStatus) => {
2724
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_eq_eq(uniffiTypeUuidObjectFactory.clonePointer(this), FfiConverterTypeUuid.lower(other, core_crypto_ffi_ffi_default().rustbuffer_alloc), callStatus);
2725
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2726
+ }
2727
+ hashCode() {
2728
+ return FfiConverterUInt64.lift(uniffiCaller.rustCall((callStatus) => {
2729
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_hash(uniffiTypeUuidObjectFactory.clonePointer(this), callStatus);
2730
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2731
+ }
2732
+ uniffiDestroy() {
2733
+ const ptr = this[destructorGuardSymbol];
2734
+ if (ptr !== undefined) {
2735
+ const pointer = uniffiTypeUuidObjectFactory.pointer(this);
2736
+ uniffiTypeUuidObjectFactory.freePointer(pointer);
2737
+ uniffiTypeUuidObjectFactory.unbless(ptr);
2738
+ delete this[destructorGuardSymbol];
2739
+ }
2740
+ }
2741
+ static instanceOf(obj_) {
2742
+ return uniffiTypeUuidObjectFactory.isConcreteType(obj_);
2743
+ }
2744
+ }
2745
+ var uniffiTypeUuidObjectFactory = (() => {
2746
+ const registry = typeof FinalizationRegistry !== "undefined" ? new FinalizationRegistry((heldValue) => {
2747
+ uniffiTypeUuidObjectFactory.freePointer(heldValue);
2748
+ }) : null;
2749
+ return {
2750
+ create(pointer) {
2751
+ const instance = Object.create(Uuid.prototype);
2752
+ instance[pointerLiteralSymbol] = pointer;
2753
+ instance[destructorGuardSymbol] = this.bless(pointer);
2754
+ instance[uniffiTypeNameSymbol] = "Uuid";
2755
+ return instance;
2756
+ },
2757
+ bless(p) {
2758
+ const ptr = {
2759
+ p,
2760
+ markDestroyed: () => {
2761
+ return;
2762
+ }
2763
+ };
2764
+ if (registry) {
2765
+ registry.register(ptr, p, ptr);
2766
+ }
2767
+ return ptr;
2768
+ },
2769
+ unbless(ptr_) {
2770
+ if (registry) {
2771
+ registry.unregister(ptr_);
2772
+ }
2773
+ },
2774
+ pointer(obj_) {
2775
+ if (obj_[destructorGuardSymbol] === undefined) {
2776
+ throw new UniffiInternalError.UnexpectedNullPointer;
2777
+ }
2778
+ return obj_[pointerLiteralSymbol];
2779
+ },
2780
+ clonePointer(obj_) {
2781
+ const pointer = this.pointer(obj_);
2782
+ return uniffiCaller.rustCall((callStatus) => core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_clone_uuid(pointer, callStatus), FfiConverterString.lift);
2783
+ },
2784
+ freePointer(pointer) {
2785
+ uniffiCaller.rustCall((callStatus) => core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_free_uuid(pointer, callStatus), FfiConverterString.lift);
2786
+ },
2787
+ isConcreteType(obj_) {
2788
+ return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "Uuid";
2789
+ }
2790
+ };
2791
+ })();
2792
+ var FfiConverterTypeUuid = new FfiConverterObject(uniffiTypeUuidObjectFactory);
2588
2793
  var stringConverter = (() => {
2589
2794
  const encoder = new TextEncoder;
2590
2795
  const decoder = new TextDecoder;
@@ -2600,6 +2805,111 @@ var stringConverter = (() => {
2600
2805
  };
2601
2806
  })();
2602
2807
  var FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
2808
+
2809
+ class DeviceId extends UniffiAbstractObject {
2810
+ [uniffiTypeNameSymbol] = "DeviceId";
2811
+ [destructorGuardSymbol];
2812
+ [pointerLiteralSymbol];
2813
+ constructor(id) {
2814
+ super();
2815
+ const pointer = uniffiCaller.rustCall((callStatus) => {
2816
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_constructor_deviceid_new(FfiConverterUInt64.lower(id, core_crypto_ffi_ffi_default().rustbuffer_alloc), callStatus);
2817
+ }, FfiConverterString.lift.bind(FfiConverterString));
2818
+ this[pointerLiteralSymbol] = pointer;
2819
+ this[destructorGuardSymbol] = uniffiTypeDeviceIdObjectFactory.bless(pointer);
2820
+ }
2821
+ static fromHexString(hexString) {
2822
+ return FfiConverterTypeDeviceId.lift(uniffiCaller.rustCallWithError(FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError), (callStatus) => {
2823
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_constructor_deviceid_from_hex_string(FfiConverterString.lower(hexString, core_crypto_ffi_ffi_default().rustbuffer_alloc), callStatus);
2824
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2825
+ }
2826
+ toHexString() {
2827
+ return ((__rb) => {
2828
+ try {
2829
+ return FfiConverterString.lift(__rb);
2830
+ } finally {
2831
+ core_crypto_ffi_ffi_default().rustbuffer_free(__rb);
2832
+ }
2833
+ })(uniffiCaller.rustCall((callStatus) => {
2834
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_deviceid_to_hex_string(uniffiTypeDeviceIdObjectFactory.clonePointer(this), callStatus);
2835
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2836
+ }
2837
+ toU64() {
2838
+ return FfiConverterUInt64.lift(uniffiCaller.rustCall((callStatus) => {
2839
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_deviceid_to_u64(uniffiTypeDeviceIdObjectFactory.clonePointer(this), callStatus);
2840
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2841
+ }
2842
+ equals(other) {
2843
+ return FfiConverterBool.lift(uniffiCaller.rustCall((callStatus) => {
2844
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_eq_eq(uniffiTypeDeviceIdObjectFactory.clonePointer(this), FfiConverterTypeDeviceId.lower(other, core_crypto_ffi_ffi_default().rustbuffer_alloc), callStatus);
2845
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2846
+ }
2847
+ hashCode() {
2848
+ return FfiConverterUInt64.lift(uniffiCaller.rustCall((callStatus) => {
2849
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_hash(uniffiTypeDeviceIdObjectFactory.clonePointer(this), callStatus);
2850
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2851
+ }
2852
+ uniffiDestroy() {
2853
+ const ptr = this[destructorGuardSymbol];
2854
+ if (ptr !== undefined) {
2855
+ const pointer = uniffiTypeDeviceIdObjectFactory.pointer(this);
2856
+ uniffiTypeDeviceIdObjectFactory.freePointer(pointer);
2857
+ uniffiTypeDeviceIdObjectFactory.unbless(ptr);
2858
+ delete this[destructorGuardSymbol];
2859
+ }
2860
+ }
2861
+ static instanceOf(obj_) {
2862
+ return uniffiTypeDeviceIdObjectFactory.isConcreteType(obj_);
2863
+ }
2864
+ }
2865
+ var uniffiTypeDeviceIdObjectFactory = (() => {
2866
+ const registry = typeof FinalizationRegistry !== "undefined" ? new FinalizationRegistry((heldValue) => {
2867
+ uniffiTypeDeviceIdObjectFactory.freePointer(heldValue);
2868
+ }) : null;
2869
+ return {
2870
+ create(pointer) {
2871
+ const instance = Object.create(DeviceId.prototype);
2872
+ instance[pointerLiteralSymbol] = pointer;
2873
+ instance[destructorGuardSymbol] = this.bless(pointer);
2874
+ instance[uniffiTypeNameSymbol] = "DeviceId";
2875
+ return instance;
2876
+ },
2877
+ bless(p) {
2878
+ const ptr = {
2879
+ p,
2880
+ markDestroyed: () => {
2881
+ return;
2882
+ }
2883
+ };
2884
+ if (registry) {
2885
+ registry.register(ptr, p, ptr);
2886
+ }
2887
+ return ptr;
2888
+ },
2889
+ unbless(ptr_) {
2890
+ if (registry) {
2891
+ registry.unregister(ptr_);
2892
+ }
2893
+ },
2894
+ pointer(obj_) {
2895
+ if (obj_[destructorGuardSymbol] === undefined) {
2896
+ throw new UniffiInternalError.UnexpectedNullPointer;
2897
+ }
2898
+ return obj_[pointerLiteralSymbol];
2899
+ },
2900
+ clonePointer(obj_) {
2901
+ const pointer = this.pointer(obj_);
2902
+ return uniffiCaller.rustCall((callStatus) => core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_clone_deviceid(pointer, callStatus), FfiConverterString.lift);
2903
+ },
2904
+ freePointer(pointer) {
2905
+ uniffiCaller.rustCall((callStatus) => core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_free_deviceid(pointer, callStatus), FfiConverterString.lift);
2906
+ },
2907
+ isConcreteType(obj_) {
2908
+ return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "DeviceId";
2909
+ }
2910
+ };
2911
+ })();
2912
+ var FfiConverterTypeDeviceId = new FfiConverterObject(uniffiTypeDeviceIdObjectFactory);
2603
2913
  var DeserializedClientId = (() => {
2604
2914
  const defaults = () => ({});
2605
2915
  const create = (() => {
@@ -2608,7 +2918,18 @@ var DeserializedClientId = (() => {
2608
2918
  return Object.freeze({
2609
2919
  create,
2610
2920
  new: create,
2611
- defaults: () => Object.freeze(defaults())
2921
+ defaults: () => Object.freeze(defaults()),
2922
+ toString(self_) {
2923
+ return ((__rb) => {
2924
+ try {
2925
+ return FfiConverterString.lift(__rb);
2926
+ } finally {
2927
+ core_crypto_ffi_ffi_default().rustbuffer_free(__rb);
2928
+ }
2929
+ })(uniffiCaller.rustCall((callStatus) => {
2930
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_deserializedclientid_uniffi_trait_display(FfiConverterTypeDeserializedClientId.lower(self_, core_crypto_ffi_ffi_default().rustbuffer_alloc), callStatus);
2931
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2932
+ }
2612
2933
  });
2613
2934
  })();
2614
2935
  var FfiConverterTypeDeserializedClientId = (() => {
@@ -2617,19 +2938,19 @@ var FfiConverterTypeDeserializedClientId = (() => {
2617
2938
  read(from) {
2618
2939
  return {
2619
2940
  clientId: FfiConverterTypeClientId.read(from),
2620
- userId: FfiConverterString.read(from),
2621
- deviceId: FfiConverterString.read(from),
2941
+ userId: FfiConverterTypeUuid.read(from),
2942
+ deviceId: FfiConverterTypeDeviceId.read(from),
2622
2943
  domain: FfiConverterString.read(from)
2623
2944
  };
2624
2945
  }
2625
2946
  write(value, into) {
2626
2947
  FfiConverterTypeClientId.write(value.clientId, into);
2627
- FfiConverterString.write(value.userId, into);
2628
- FfiConverterString.write(value.deviceId, into);
2948
+ FfiConverterTypeUuid.write(value.userId, into);
2949
+ FfiConverterTypeDeviceId.write(value.deviceId, into);
2629
2950
  FfiConverterString.write(value.domain, into);
2630
2951
  }
2631
2952
  allocationSize(value) {
2632
- return FfiConverterTypeClientId.allocationSize(value.clientId) + FfiConverterString.allocationSize(value.userId) + FfiConverterString.allocationSize(value.deviceId) + FfiConverterString.allocationSize(value.domain);
2953
+ return FfiConverterTypeClientId.allocationSize(value.clientId) + FfiConverterTypeUuid.allocationSize(value.userId) + FfiConverterTypeDeviceId.allocationSize(value.deviceId) + FfiConverterString.allocationSize(value.domain);
2633
2954
  }
2634
2955
  }
2635
2956
  return new FFIConverter;
@@ -2641,8 +2962,8 @@ class ClientId extends UniffiAbstractObject {
2641
2962
  [pointerLiteralSymbol];
2642
2963
  constructor(userId, deviceId, domain) {
2643
2964
  super();
2644
- const pointer = uniffiCaller.rustCallWithError(FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError), (callStatus) => {
2645
- return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_constructor_clientid_new(FfiConverterString.lower(userId, core_crypto_ffi_ffi_default().rustbuffer_alloc), FfiConverterString.lower(deviceId, core_crypto_ffi_ffi_default().rustbuffer_alloc), FfiConverterString.lower(domain, core_crypto_ffi_ffi_default().rustbuffer_alloc), callStatus);
2965
+ const pointer = uniffiCaller.rustCall((callStatus) => {
2966
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_constructor_clientid_new(FfiConverterTypeUuid.lower(userId, core_crypto_ffi_ffi_default().rustbuffer_alloc), FfiConverterTypeDeviceId.lower(deviceId, core_crypto_ffi_ffi_default().rustbuffer_alloc), FfiConverterString.lower(domain, core_crypto_ffi_ffi_default().rustbuffer_alloc), callStatus);
2646
2967
  }, FfiConverterString.lift.bind(FfiConverterString));
2647
2968
  this[pointerLiteralSymbol] = pointer;
2648
2969
  this[destructorGuardSymbol] = uniffiTypeClientIdObjectFactory.bless(pointer);
@@ -6069,8 +6390,8 @@ class CoreCryptoContext extends UniffiAbstractObject {
6069
6390
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
6070
6391
  try {
6071
6392
  return await uniffiRustCallAsync(uniffiCaller, () => {
6072
- return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_corecryptocontext_get_user_identities(uniffiTypeCoreCryptoContextObjectFactory.clonePointer(this), FfiConverterTypeConversationId.lower(conversationId, core_crypto_ffi_ffi_default().rustbuffer_alloc), FfiConverterSequenceString.lower(userIds, core_crypto_ffi_ffi_default().rustbuffer_alloc));
6073
- }, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_poll_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_cancel_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_complete_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_free_rust_buffer, FfiConverterMapStringSequenceTypeWireIdentity.lift.bind(FfiConverterMapStringSequenceTypeWireIdentity), FfiConverterString.lift.bind(FfiConverterString), asyncOpts_, FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError));
6393
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_corecryptocontext_get_user_identities(uniffiTypeCoreCryptoContextObjectFactory.clonePointer(this), FfiConverterTypeConversationId.lower(conversationId, core_crypto_ffi_ffi_default().rustbuffer_alloc), FfiConverterSequenceTypeUuid.lower(userIds, core_crypto_ffi_ffi_default().rustbuffer_alloc));
6394
+ }, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_poll_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_cancel_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_complete_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_free_rust_buffer, FfiConverterMapTypeUuidSequenceTypeWireIdentity.lift.bind(FfiConverterMapTypeUuidSequenceTypeWireIdentity), FfiConverterString.lift.bind(FfiConverterString), asyncOpts_, FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError));
6074
6395
  } catch (__error) {
6075
6396
  if (uniffiIsDebug && __error instanceof Error) {
6076
6397
  __error.stack = __stack;
@@ -7157,8 +7478,8 @@ class CoreCryptoFfi extends UniffiAbstractObject {
7157
7478
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
7158
7479
  try {
7159
7480
  return await uniffiRustCallAsync(uniffiCaller, () => {
7160
- return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_corecryptoffi_get_user_identities(uniffiTypeCoreCryptoFfiObjectFactory.clonePointer(this), FfiConverterTypeConversationId.lower(conversationId, core_crypto_ffi_ffi_default().rustbuffer_alloc), FfiConverterSequenceString.lower(userIds, core_crypto_ffi_ffi_default().rustbuffer_alloc));
7161
- }, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_poll_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_cancel_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_complete_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_free_rust_buffer, FfiConverterMapStringSequenceTypeWireIdentity.lift.bind(FfiConverterMapStringSequenceTypeWireIdentity), FfiConverterString.lift.bind(FfiConverterString), asyncOpts_, FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError));
7481
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_corecryptoffi_get_user_identities(uniffiTypeCoreCryptoFfiObjectFactory.clonePointer(this), FfiConverterTypeConversationId.lower(conversationId, core_crypto_ffi_ffi_default().rustbuffer_alloc), FfiConverterSequenceTypeUuid.lower(userIds, core_crypto_ffi_ffi_default().rustbuffer_alloc));
7482
+ }, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_poll_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_cancel_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_complete_rust_buffer, core_crypto_ffi_ffi_default().ffi_core_crypto_ffi_rust_future_free_rust_buffer, FfiConverterMapTypeUuidSequenceTypeWireIdentity.lift.bind(FfiConverterMapTypeUuidSequenceTypeWireIdentity), FfiConverterString.lift.bind(FfiConverterString), asyncOpts_, FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError));
7162
7483
  } catch (__error) {
7163
7484
  if (uniffiIsDebug && __error instanceof Error) {
7164
7485
  __error.stack = __stack;
@@ -8011,8 +8332,9 @@ var FfiConverterOptionalDuration = new FfiConverterOptional(FfiConverterDuration
8011
8332
  var FfiConverterSequenceTypeClientId = new FfiConverterArray(FfiConverterTypeClientId);
8012
8333
  var FfiConverterSequenceTypeWireIdentity = new FfiConverterArray(FfiConverterTypeWireIdentity);
8013
8334
  var FfiConverterSequenceTypeKeyPackageRef = new FfiConverterArray(FfiConverterTypeKeyPackageRef);
8335
+ var FfiConverterSequenceTypeUuid = new FfiConverterArray(FfiConverterTypeUuid);
8336
+ var FfiConverterMapTypeUuidSequenceTypeWireIdentity = new FfiConverterMap(FfiConverterTypeUuid, FfiConverterSequenceTypeWireIdentity);
8014
8337
  var FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
8015
- var FfiConverterMapStringSequenceTypeWireIdentity = new FfiConverterMap(FfiConverterString, FfiConverterSequenceTypeWireIdentity);
8016
8338
  var FfiConverterMapStringBytes = new FfiConverterMap(FfiConverterString, FfiConverterUint8Array);
8017
8339
  var FfiConverterOptionalTypeCipherSuite = new FfiConverterOptional(FfiConverterTypeCipherSuite);
8018
8340
  var FfiConverterOptionalTypeCredentialType = new FfiConverterOptional(FfiConverterTypeCredentialType);
@@ -8058,13 +8380,13 @@ function uniffiEnsureInitialized() {
8058
8380
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_func_version() !== 8474) {
8059
8381
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_func_version");
8060
8382
  }
8061
- if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_clientid_new() !== 24154) {
8383
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_clientid_new() !== 44879) {
8062
8384
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_clientid_new");
8063
8385
  }
8064
8386
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_clientid_copy_bytes() !== 10155) {
8065
8387
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_clientid_copy_bytes");
8066
8388
  }
8067
- if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_clientid_deserialize() !== 28989) {
8389
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_clientid_deserialize() !== 19701) {
8068
8390
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_clientid_deserialize");
8069
8391
  }
8070
8392
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_conversationid_new() !== 12558) {
@@ -8145,7 +8467,7 @@ function uniffiEnsureInitialized() {
8145
8467
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_key_packages() !== 64486) {
8146
8468
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_key_packages");
8147
8469
  }
8148
- if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_user_identities() !== 55318) {
8470
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_user_identities() !== 21557) {
8149
8471
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_user_identities");
8150
8472
  }
8151
8473
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptocontext_join_by_external_commit() !== 38654) {
@@ -8277,7 +8599,7 @@ function uniffiEnsureInitialized() {
8277
8599
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_pki_environment() !== 28140) {
8278
8600
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_pki_environment");
8279
8601
  }
8280
- if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_user_identities() !== 64461) {
8602
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_user_identities() !== 33184) {
8281
8603
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_user_identities");
8282
8604
  }
8283
8605
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptoffi_is_history_sharing_enabled() !== 59378) {
@@ -8361,6 +8683,18 @@ function uniffiEnsureInitialized() {
8361
8683
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_databasekey_new() !== 36198) {
8362
8684
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_databasekey_new");
8363
8685
  }
8686
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_deviceid_from_hex_string() !== 44184) {
8687
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_deviceid_from_hex_string");
8688
+ }
8689
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_deviceid_new() !== 62163) {
8690
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_deviceid_new");
8691
+ }
8692
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_deviceid_to_hex_string() !== 17498) {
8693
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_deviceid_to_hex_string");
8694
+ }
8695
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_deviceid_to_u64() !== 14542) {
8696
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_deviceid_to_u64");
8697
+ }
8364
8698
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_epochobserver_epoch_changed() !== 64106) {
8365
8699
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_epochobserver_epoch_changed");
8366
8700
  }
@@ -8439,6 +8773,9 @@ function uniffiEnsureInitialized() {
8439
8773
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_secretkey_copy_bytes() !== 18148) {
8440
8774
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_secretkey_copy_bytes");
8441
8775
  }
8776
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_uuid_new() !== 40259) {
8777
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_uuid_new");
8778
+ }
8442
8779
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_welcome_new() !== 20256) {
8443
8780
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_welcome_new");
8444
8781
  }
@@ -8486,6 +8823,7 @@ var core_crypto_ffi_default = Object.freeze({
8486
8823
  FfiConverterTypeDatabaseKey,
8487
8824
  FfiConverterTypeDecryptedMessage,
8488
8825
  FfiConverterTypeDeserializedClientId,
8826
+ FfiConverterTypeDeviceId,
8489
8827
  FfiConverterTypeDeviceStatus,
8490
8828
  FfiConverterTypeE2eiConversationState,
8491
8829
  FfiConverterTypeEpochChangedReportingError,
@@ -8516,6 +8854,7 @@ var core_crypto_ffi_default = Object.freeze({
8516
8854
  FfiConverterTypeSecretKey,
8517
8855
  FfiConverterTypeSignatureScheme,
8518
8856
  FfiConverterTypeTimestamp,
8857
+ FfiConverterTypeUuid,
8519
8858
  FfiConverterTypeWelcome,
8520
8859
  FfiConverterTypeWireIdentity,
8521
8860
  FfiConverterTypeX509CredentialAcquisition,
@@ -8616,6 +8955,7 @@ export {
8616
8955
  X509CredentialAcquisition2 as X509CredentialAcquisition,
8617
8956
  WireIdentity,
8618
8957
  Welcome,
8958
+ Uuid,
8619
8959
  SignatureScheme,
8620
8960
  SecretKey,
8621
8961
  MlsRatchetTreeType as RatchetTreeType,
@@ -8642,6 +8982,7 @@ export {
8642
8982
  EpochChangedReportingError,
8643
8983
  E2eiConversationState,
8644
8984
  DeviceStatus,
8985
+ DeviceId,
8645
8986
  DeserializedClientId,
8646
8987
  DatabaseKey,
8647
8988
  Database,
Binary file