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

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,6 +41,52 @@ 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;
45
+ /**
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
+ equals(other: Uuid): boolean;
57
+ hashCode(): bigint;
58
+ uniffiDestroy(): void;
59
+ static instanceOf(obj_: any): obj_ is Uuid;
60
+ }
61
+ type DeviceIdLike = DeviceId;
62
+ /**
63
+ * A Device ID.
64
+ */
65
+ export declare class DeviceId extends UniffiAbstractObject {
66
+ readonly [uniffiTypeNameSymbol] = "DeviceId";
67
+ readonly [destructorGuardSymbol]: UniffiGcObject;
68
+ readonly [pointerLiteralSymbol]: UniffiHandle;
69
+ /**
70
+ * New device id from an unsigned 64-bit integer.
71
+ */
72
+ constructor(id: bigint);
73
+ /**
74
+ * Construct a `DeviceId` from 8 bytes encoded as a hex string.
75
+ */
76
+ static fromHexString(hexString: string): DeviceIdLike;
77
+ /**
78
+ * Encode the `DeviceId` as a 16-character lowercase hex string, with leading 0s.
79
+ */
80
+ toHexString(): string;
81
+ /**
82
+ * Get the number corresponding to this `DeviceId`.
83
+ */
84
+ toU64(): bigint;
85
+ equals(other: DeviceId): boolean;
86
+ hashCode(): bigint;
87
+ uniffiDestroy(): void;
88
+ static instanceOf(obj_: any): obj_ is DeviceId;
89
+ }
44
90
  /**
45
91
  * This directly represents a `ClientId` of the `<userid>-<device-id>@<domain>` format.
46
92
  * Instantiate via [ClientId::deserialize].
@@ -51,13 +97,13 @@ export type DeserializedClientId = {
51
97
  */
52
98
  clientId: ClientIdLike;
53
99
  /**
54
- * The string representation of a UUID
100
+ * The user id component
55
101
  */
56
- userId: string;
102
+ userId: UuidLike;
57
103
  /**
58
- * A hex-encoded unsigned 64-bit integer
104
+ * The device id component
59
105
  */
60
- deviceId: string;
106
+ deviceId: DeviceIdLike;
61
107
  /**
62
108
  * The domain
63
109
  */
@@ -86,13 +132,13 @@ export declare class ClientId extends UniffiAbstractObject {
86
132
  /**
87
133
  * Create a new client id.
88
134
  */
89
- constructor(userId: string, deviceId: string, domain: string);
135
+ constructor(userId: UuidLike, deviceId: DeviceIdLike, domain: string);
90
136
  /**
91
137
  * Copy the wrapped data into a new byte array.
92
138
  */
93
139
  copyBytes(): Uint8Array;
94
140
  /**
95
- * Copy the wrapped data into a direct representation of the `<userid>-<device-id>@<domain>` format.
141
+ * Copy the wrapped data into a direct representation of the `<user-id>:<device-id>@<domain>` format.
96
142
  */
97
143
  deserialize(): DeserializedClientId;
98
144
  equals(other: ClientId): boolean;
@@ -3091,9 +3137,9 @@ declare class CoreCryptoContext extends UniffiAbstractObject {
3091
3137
  /**
3092
3138
  * Returns the E2EI identity claims for the specified users in the given conversation, grouped by user ID.
3093
3139
  */
3094
- getUserIdentities(conversationId: ConversationIdLike, userIds: Array<string>, asyncOpts_?: {
3140
+ getUserIdentities(conversationId: ConversationIdLike, userIds: Array<UuidLike>, asyncOpts_?: {
3095
3141
  signal: AbortSignal;
3096
- }): Promise<Map<string, Array<WireIdentity>>>;
3142
+ }): Promise<Map<UuidLike, Array<WireIdentity>>>;
3097
3143
  /**
3098
3144
  * Joins an existing conversation by constructing an external commit from the given group info.
3099
3145
  */
@@ -3480,9 +3526,9 @@ declare class CoreCryptoFfi extends UniffiAbstractObject {
3480
3526
  /**
3481
3527
  * Returns the E2EI identity claims for the specified users in the given conversation, grouped by user ID.
3482
3528
  */
3483
- getUserIdentities(conversationId: ConversationIdLike, userIds: Array<string>, asyncOpts_?: {
3529
+ getUserIdentities(conversationId: ConversationIdLike, userIds: Array<UuidLike>, asyncOpts_?: {
3484
3530
  signal: AbortSignal;
3485
- }): Promise<Map<string, Array<WireIdentity>>>;
3531
+ }): Promise<Map<UuidLike, Array<WireIdentity>>>;
3486
3532
  /**
3487
3533
  * Returns true if history sharing is currently enabled for the given conversation.
3488
3534
  */
@@ -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,
@@ -614,7 +634,7 @@ var DEFINITIONS = {
614
634
  hasRustCallStatus: true
615
635
  },
616
636
  uniffi_core_crypto_ffi_fn_constructor_clientid_new: {
617
- args: [FfiType.RustBuffer, FfiType.RustBuffer, FfiType.RustBuffer],
637
+ args: [FfiType.Handle, FfiType.Handle, FfiType.RustBuffer],
618
638
  ret: FfiType.Handle,
619
639
  hasRustCallStatus: true
620
640
  },
@@ -1195,6 +1215,41 @@ var DEFINITIONS = {
1195
1215
  ret: FfiType.Int8,
1196
1216
  hasRustCallStatus: true
1197
1217
  },
1218
+ uniffi_core_crypto_ffi_fn_constructor_deviceid_from_hex_string: {
1219
+ args: [FfiType.RustBuffer],
1220
+ ret: FfiType.Handle,
1221
+ hasRustCallStatus: true
1222
+ },
1223
+ uniffi_core_crypto_ffi_fn_constructor_deviceid_new: {
1224
+ args: [FfiType.UInt64],
1225
+ ret: FfiType.Handle,
1226
+ hasRustCallStatus: true
1227
+ },
1228
+ uniffi_core_crypto_ffi_fn_method_deviceid_to_hex_string: {
1229
+ args: [FfiType.Handle],
1230
+ ret: FfiType.RustBuffer,
1231
+ hasRustCallStatus: true
1232
+ },
1233
+ uniffi_core_crypto_ffi_fn_method_deviceid_to_u64: {
1234
+ args: [FfiType.Handle],
1235
+ ret: FfiType.UInt64,
1236
+ hasRustCallStatus: true
1237
+ },
1238
+ uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_eq_eq: {
1239
+ args: [FfiType.Handle, FfiType.Handle],
1240
+ ret: FfiType.Int8,
1241
+ hasRustCallStatus: true
1242
+ },
1243
+ uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_eq_ne: {
1244
+ args: [FfiType.Handle, FfiType.Handle],
1245
+ ret: FfiType.Int8,
1246
+ hasRustCallStatus: true
1247
+ },
1248
+ uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_hash: {
1249
+ args: [FfiType.Handle],
1250
+ ret: FfiType.UInt64,
1251
+ hasRustCallStatus: true
1252
+ },
1198
1253
  uniffi_core_crypto_ffi_fn_method_epochobserver_epoch_changed: {
1199
1254
  args: [FfiType.Handle, FfiType.Handle, FfiType.UInt64],
1200
1255
  ret: FfiType.Handle,
@@ -1367,6 +1422,26 @@ var DEFINITIONS = {
1367
1422
  ret: FfiType.UInt64,
1368
1423
  hasRustCallStatus: true
1369
1424
  },
1425
+ uniffi_core_crypto_ffi_fn_constructor_uuid_new: {
1426
+ args: [FfiType.RustBuffer],
1427
+ ret: FfiType.Handle,
1428
+ hasRustCallStatus: true
1429
+ },
1430
+ uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_eq_eq: {
1431
+ args: [FfiType.Handle, FfiType.Handle],
1432
+ ret: FfiType.Int8,
1433
+ hasRustCallStatus: true
1434
+ },
1435
+ uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_eq_ne: {
1436
+ args: [FfiType.Handle, FfiType.Handle],
1437
+ ret: FfiType.Int8,
1438
+ hasRustCallStatus: true
1439
+ },
1440
+ uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_hash: {
1441
+ args: [FfiType.Handle],
1442
+ ret: FfiType.UInt64,
1443
+ hasRustCallStatus: true
1444
+ },
1370
1445
  uniffi_core_crypto_ffi_fn_constructor_welcome_new: {
1371
1446
  args: [FfiType.RustBuffer],
1372
1447
  ret: FfiType.Handle,
@@ -1967,6 +2042,26 @@ var DEFINITIONS = {
1967
2042
  ret: FfiType.UInt16,
1968
2043
  hasRustCallStatus: false
1969
2044
  },
2045
+ uniffi_core_crypto_ffi_checksum_constructor_deviceid_from_hex_string: {
2046
+ args: [],
2047
+ ret: FfiType.UInt16,
2048
+ hasRustCallStatus: false
2049
+ },
2050
+ uniffi_core_crypto_ffi_checksum_constructor_deviceid_new: {
2051
+ args: [],
2052
+ ret: FfiType.UInt16,
2053
+ hasRustCallStatus: false
2054
+ },
2055
+ uniffi_core_crypto_ffi_checksum_method_deviceid_to_hex_string: {
2056
+ args: [],
2057
+ ret: FfiType.UInt16,
2058
+ hasRustCallStatus: false
2059
+ },
2060
+ uniffi_core_crypto_ffi_checksum_method_deviceid_to_u64: {
2061
+ args: [],
2062
+ ret: FfiType.UInt16,
2063
+ hasRustCallStatus: false
2064
+ },
1970
2065
  uniffi_core_crypto_ffi_checksum_method_epochobserver_epoch_changed: {
1971
2066
  args: [],
1972
2067
  ret: FfiType.UInt16,
@@ -2097,6 +2192,11 @@ var DEFINITIONS = {
2097
2192
  ret: FfiType.UInt16,
2098
2193
  hasRustCallStatus: false
2099
2194
  },
2195
+ uniffi_core_crypto_ffi_checksum_constructor_uuid_new: {
2196
+ args: [],
2197
+ ret: FfiType.UInt16,
2198
+ hasRustCallStatus: false
2199
+ },
2100
2200
  uniffi_core_crypto_ffi_checksum_constructor_welcome_new: {
2101
2201
  args: [],
2102
2202
  ret: FfiType.UInt16,
@@ -2585,6 +2685,90 @@ function version() {
2585
2685
  return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_func_version(callStatus);
2586
2686
  }, FfiConverterString.lift.bind(FfiConverterString)));
2587
2687
  }
2688
+
2689
+ class Uuid extends UniffiAbstractObject {
2690
+ [uniffiTypeNameSymbol] = "Uuid";
2691
+ [destructorGuardSymbol];
2692
+ [pointerLiteralSymbol];
2693
+ constructor(uuid) {
2694
+ super();
2695
+ const pointer = uniffiCaller.rustCallWithError(FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError), (callStatus) => {
2696
+ 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);
2697
+ }, FfiConverterString.lift.bind(FfiConverterString));
2698
+ this[pointerLiteralSymbol] = pointer;
2699
+ this[destructorGuardSymbol] = uniffiTypeUuidObjectFactory.bless(pointer);
2700
+ }
2701
+ equals(other) {
2702
+ return FfiConverterBool.lift(uniffiCaller.rustCall((callStatus) => {
2703
+ 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);
2704
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2705
+ }
2706
+ hashCode() {
2707
+ return FfiConverterUInt64.lift(uniffiCaller.rustCall((callStatus) => {
2708
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_uuid_uniffi_trait_hash(uniffiTypeUuidObjectFactory.clonePointer(this), callStatus);
2709
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2710
+ }
2711
+ uniffiDestroy() {
2712
+ const ptr = this[destructorGuardSymbol];
2713
+ if (ptr !== undefined) {
2714
+ const pointer = uniffiTypeUuidObjectFactory.pointer(this);
2715
+ uniffiTypeUuidObjectFactory.freePointer(pointer);
2716
+ uniffiTypeUuidObjectFactory.unbless(ptr);
2717
+ delete this[destructorGuardSymbol];
2718
+ }
2719
+ }
2720
+ static instanceOf(obj_) {
2721
+ return uniffiTypeUuidObjectFactory.isConcreteType(obj_);
2722
+ }
2723
+ }
2724
+ var uniffiTypeUuidObjectFactory = (() => {
2725
+ const registry = typeof FinalizationRegistry !== "undefined" ? new FinalizationRegistry((heldValue) => {
2726
+ uniffiTypeUuidObjectFactory.freePointer(heldValue);
2727
+ }) : null;
2728
+ return {
2729
+ create(pointer) {
2730
+ const instance = Object.create(Uuid.prototype);
2731
+ instance[pointerLiteralSymbol] = pointer;
2732
+ instance[destructorGuardSymbol] = this.bless(pointer);
2733
+ instance[uniffiTypeNameSymbol] = "Uuid";
2734
+ return instance;
2735
+ },
2736
+ bless(p) {
2737
+ const ptr = {
2738
+ p,
2739
+ markDestroyed: () => {
2740
+ return;
2741
+ }
2742
+ };
2743
+ if (registry) {
2744
+ registry.register(ptr, p, ptr);
2745
+ }
2746
+ return ptr;
2747
+ },
2748
+ unbless(ptr_) {
2749
+ if (registry) {
2750
+ registry.unregister(ptr_);
2751
+ }
2752
+ },
2753
+ pointer(obj_) {
2754
+ if (obj_[destructorGuardSymbol] === undefined) {
2755
+ throw new UniffiInternalError.UnexpectedNullPointer;
2756
+ }
2757
+ return obj_[pointerLiteralSymbol];
2758
+ },
2759
+ clonePointer(obj_) {
2760
+ const pointer = this.pointer(obj_);
2761
+ return uniffiCaller.rustCall((callStatus) => core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_clone_uuid(pointer, callStatus), FfiConverterString.lift);
2762
+ },
2763
+ freePointer(pointer) {
2764
+ uniffiCaller.rustCall((callStatus) => core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_free_uuid(pointer, callStatus), FfiConverterString.lift);
2765
+ },
2766
+ isConcreteType(obj_) {
2767
+ return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "Uuid";
2768
+ }
2769
+ };
2770
+ })();
2771
+ var FfiConverterTypeUuid = new FfiConverterObject(uniffiTypeUuidObjectFactory);
2588
2772
  var stringConverter = (() => {
2589
2773
  const encoder = new TextEncoder;
2590
2774
  const decoder = new TextDecoder;
@@ -2600,6 +2784,111 @@ var stringConverter = (() => {
2600
2784
  };
2601
2785
  })();
2602
2786
  var FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
2787
+
2788
+ class DeviceId extends UniffiAbstractObject {
2789
+ [uniffiTypeNameSymbol] = "DeviceId";
2790
+ [destructorGuardSymbol];
2791
+ [pointerLiteralSymbol];
2792
+ constructor(id) {
2793
+ super();
2794
+ const pointer = uniffiCaller.rustCall((callStatus) => {
2795
+ 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);
2796
+ }, FfiConverterString.lift.bind(FfiConverterString));
2797
+ this[pointerLiteralSymbol] = pointer;
2798
+ this[destructorGuardSymbol] = uniffiTypeDeviceIdObjectFactory.bless(pointer);
2799
+ }
2800
+ static fromHexString(hexString) {
2801
+ return FfiConverterTypeDeviceId.lift(uniffiCaller.rustCallWithError(FfiConverterTypeCoreCryptoError.lift.bind(FfiConverterTypeCoreCryptoError), (callStatus) => {
2802
+ 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);
2803
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2804
+ }
2805
+ toHexString() {
2806
+ return ((__rb) => {
2807
+ try {
2808
+ return FfiConverterString.lift(__rb);
2809
+ } finally {
2810
+ core_crypto_ffi_ffi_default().rustbuffer_free(__rb);
2811
+ }
2812
+ })(uniffiCaller.rustCall((callStatus) => {
2813
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_deviceid_to_hex_string(uniffiTypeDeviceIdObjectFactory.clonePointer(this), callStatus);
2814
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2815
+ }
2816
+ toU64() {
2817
+ return FfiConverterUInt64.lift(uniffiCaller.rustCall((callStatus) => {
2818
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_deviceid_to_u64(uniffiTypeDeviceIdObjectFactory.clonePointer(this), callStatus);
2819
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2820
+ }
2821
+ equals(other) {
2822
+ return FfiConverterBool.lift(uniffiCaller.rustCall((callStatus) => {
2823
+ 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);
2824
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2825
+ }
2826
+ hashCode() {
2827
+ return FfiConverterUInt64.lift(uniffiCaller.rustCall((callStatus) => {
2828
+ return core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_method_deviceid_uniffi_trait_hash(uniffiTypeDeviceIdObjectFactory.clonePointer(this), callStatus);
2829
+ }, FfiConverterString.lift.bind(FfiConverterString)));
2830
+ }
2831
+ uniffiDestroy() {
2832
+ const ptr = this[destructorGuardSymbol];
2833
+ if (ptr !== undefined) {
2834
+ const pointer = uniffiTypeDeviceIdObjectFactory.pointer(this);
2835
+ uniffiTypeDeviceIdObjectFactory.freePointer(pointer);
2836
+ uniffiTypeDeviceIdObjectFactory.unbless(ptr);
2837
+ delete this[destructorGuardSymbol];
2838
+ }
2839
+ }
2840
+ static instanceOf(obj_) {
2841
+ return uniffiTypeDeviceIdObjectFactory.isConcreteType(obj_);
2842
+ }
2843
+ }
2844
+ var uniffiTypeDeviceIdObjectFactory = (() => {
2845
+ const registry = typeof FinalizationRegistry !== "undefined" ? new FinalizationRegistry((heldValue) => {
2846
+ uniffiTypeDeviceIdObjectFactory.freePointer(heldValue);
2847
+ }) : null;
2848
+ return {
2849
+ create(pointer) {
2850
+ const instance = Object.create(DeviceId.prototype);
2851
+ instance[pointerLiteralSymbol] = pointer;
2852
+ instance[destructorGuardSymbol] = this.bless(pointer);
2853
+ instance[uniffiTypeNameSymbol] = "DeviceId";
2854
+ return instance;
2855
+ },
2856
+ bless(p) {
2857
+ const ptr = {
2858
+ p,
2859
+ markDestroyed: () => {
2860
+ return;
2861
+ }
2862
+ };
2863
+ if (registry) {
2864
+ registry.register(ptr, p, ptr);
2865
+ }
2866
+ return ptr;
2867
+ },
2868
+ unbless(ptr_) {
2869
+ if (registry) {
2870
+ registry.unregister(ptr_);
2871
+ }
2872
+ },
2873
+ pointer(obj_) {
2874
+ if (obj_[destructorGuardSymbol] === undefined) {
2875
+ throw new UniffiInternalError.UnexpectedNullPointer;
2876
+ }
2877
+ return obj_[pointerLiteralSymbol];
2878
+ },
2879
+ clonePointer(obj_) {
2880
+ const pointer = this.pointer(obj_);
2881
+ return uniffiCaller.rustCall((callStatus) => core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_clone_deviceid(pointer, callStatus), FfiConverterString.lift);
2882
+ },
2883
+ freePointer(pointer) {
2884
+ uniffiCaller.rustCall((callStatus) => core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_fn_free_deviceid(pointer, callStatus), FfiConverterString.lift);
2885
+ },
2886
+ isConcreteType(obj_) {
2887
+ return obj_[destructorGuardSymbol] && obj_[uniffiTypeNameSymbol] === "DeviceId";
2888
+ }
2889
+ };
2890
+ })();
2891
+ var FfiConverterTypeDeviceId = new FfiConverterObject(uniffiTypeDeviceIdObjectFactory);
2603
2892
  var DeserializedClientId = (() => {
2604
2893
  const defaults = () => ({});
2605
2894
  const create = (() => {
@@ -2617,19 +2906,19 @@ var FfiConverterTypeDeserializedClientId = (() => {
2617
2906
  read(from) {
2618
2907
  return {
2619
2908
  clientId: FfiConverterTypeClientId.read(from),
2620
- userId: FfiConverterString.read(from),
2621
- deviceId: FfiConverterString.read(from),
2909
+ userId: FfiConverterTypeUuid.read(from),
2910
+ deviceId: FfiConverterTypeDeviceId.read(from),
2622
2911
  domain: FfiConverterString.read(from)
2623
2912
  };
2624
2913
  }
2625
2914
  write(value, into) {
2626
2915
  FfiConverterTypeClientId.write(value.clientId, into);
2627
- FfiConverterString.write(value.userId, into);
2628
- FfiConverterString.write(value.deviceId, into);
2916
+ FfiConverterTypeUuid.write(value.userId, into);
2917
+ FfiConverterTypeDeviceId.write(value.deviceId, into);
2629
2918
  FfiConverterString.write(value.domain, into);
2630
2919
  }
2631
2920
  allocationSize(value) {
2632
- return FfiConverterTypeClientId.allocationSize(value.clientId) + FfiConverterString.allocationSize(value.userId) + FfiConverterString.allocationSize(value.deviceId) + FfiConverterString.allocationSize(value.domain);
2921
+ return FfiConverterTypeClientId.allocationSize(value.clientId) + FfiConverterTypeUuid.allocationSize(value.userId) + FfiConverterTypeDeviceId.allocationSize(value.deviceId) + FfiConverterString.allocationSize(value.domain);
2633
2922
  }
2634
2923
  }
2635
2924
  return new FFIConverter;
@@ -2641,8 +2930,8 @@ class ClientId extends UniffiAbstractObject {
2641
2930
  [pointerLiteralSymbol];
2642
2931
  constructor(userId, deviceId, domain) {
2643
2932
  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);
2933
+ const pointer = uniffiCaller.rustCall((callStatus) => {
2934
+ 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
2935
  }, FfiConverterString.lift.bind(FfiConverterString));
2647
2936
  this[pointerLiteralSymbol] = pointer;
2648
2937
  this[destructorGuardSymbol] = uniffiTypeClientIdObjectFactory.bless(pointer);
@@ -6069,8 +6358,8 @@ class CoreCryptoContext extends UniffiAbstractObject {
6069
6358
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
6070
6359
  try {
6071
6360
  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));
6361
+ 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));
6362
+ }, 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
6363
  } catch (__error) {
6075
6364
  if (uniffiIsDebug && __error instanceof Error) {
6076
6365
  __error.stack = __stack;
@@ -7157,8 +7446,8 @@ class CoreCryptoFfi extends UniffiAbstractObject {
7157
7446
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
7158
7447
  try {
7159
7448
  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));
7449
+ 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));
7450
+ }, 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
7451
  } catch (__error) {
7163
7452
  if (uniffiIsDebug && __error instanceof Error) {
7164
7453
  __error.stack = __stack;
@@ -8011,8 +8300,9 @@ var FfiConverterOptionalDuration = new FfiConverterOptional(FfiConverterDuration
8011
8300
  var FfiConverterSequenceTypeClientId = new FfiConverterArray(FfiConverterTypeClientId);
8012
8301
  var FfiConverterSequenceTypeWireIdentity = new FfiConverterArray(FfiConverterTypeWireIdentity);
8013
8302
  var FfiConverterSequenceTypeKeyPackageRef = new FfiConverterArray(FfiConverterTypeKeyPackageRef);
8303
+ var FfiConverterSequenceTypeUuid = new FfiConverterArray(FfiConverterTypeUuid);
8304
+ var FfiConverterMapTypeUuidSequenceTypeWireIdentity = new FfiConverterMap(FfiConverterTypeUuid, FfiConverterSequenceTypeWireIdentity);
8014
8305
  var FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
8015
- var FfiConverterMapStringSequenceTypeWireIdentity = new FfiConverterMap(FfiConverterString, FfiConverterSequenceTypeWireIdentity);
8016
8306
  var FfiConverterMapStringBytes = new FfiConverterMap(FfiConverterString, FfiConverterUint8Array);
8017
8307
  var FfiConverterOptionalTypeCipherSuite = new FfiConverterOptional(FfiConverterTypeCipherSuite);
8018
8308
  var FfiConverterOptionalTypeCredentialType = new FfiConverterOptional(FfiConverterTypeCredentialType);
@@ -8058,13 +8348,13 @@ function uniffiEnsureInitialized() {
8058
8348
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_func_version() !== 8474) {
8059
8349
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_func_version");
8060
8350
  }
8061
- if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_clientid_new() !== 24154) {
8351
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_clientid_new() !== 44879) {
8062
8352
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_clientid_new");
8063
8353
  }
8064
8354
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_clientid_copy_bytes() !== 10155) {
8065
8355
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_clientid_copy_bytes");
8066
8356
  }
8067
- if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_clientid_deserialize() !== 28989) {
8357
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_clientid_deserialize() !== 19701) {
8068
8358
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_clientid_deserialize");
8069
8359
  }
8070
8360
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_conversationid_new() !== 12558) {
@@ -8145,7 +8435,7 @@ function uniffiEnsureInitialized() {
8145
8435
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_key_packages() !== 64486) {
8146
8436
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_key_packages");
8147
8437
  }
8148
- if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_user_identities() !== 55318) {
8438
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_user_identities() !== 21557) {
8149
8439
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_corecryptocontext_get_user_identities");
8150
8440
  }
8151
8441
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptocontext_join_by_external_commit() !== 38654) {
@@ -8277,7 +8567,7 @@ function uniffiEnsureInitialized() {
8277
8567
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_pki_environment() !== 28140) {
8278
8568
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_pki_environment");
8279
8569
  }
8280
- if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_user_identities() !== 64461) {
8570
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_user_identities() !== 33184) {
8281
8571
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_corecryptoffi_get_user_identities");
8282
8572
  }
8283
8573
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_corecryptoffi_is_history_sharing_enabled() !== 59378) {
@@ -8361,6 +8651,18 @@ function uniffiEnsureInitialized() {
8361
8651
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_databasekey_new() !== 36198) {
8362
8652
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_databasekey_new");
8363
8653
  }
8654
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_deviceid_from_hex_string() !== 44184) {
8655
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_deviceid_from_hex_string");
8656
+ }
8657
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_deviceid_new() !== 62163) {
8658
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_deviceid_new");
8659
+ }
8660
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_deviceid_to_hex_string() !== 17498) {
8661
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_deviceid_to_hex_string");
8662
+ }
8663
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_deviceid_to_u64() !== 14542) {
8664
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_deviceid_to_u64");
8665
+ }
8364
8666
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_epochobserver_epoch_changed() !== 64106) {
8365
8667
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_epochobserver_epoch_changed");
8366
8668
  }
@@ -8439,6 +8741,9 @@ function uniffiEnsureInitialized() {
8439
8741
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_method_secretkey_copy_bytes() !== 18148) {
8440
8742
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_method_secretkey_copy_bytes");
8441
8743
  }
8744
+ if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_uuid_new() !== 40259) {
8745
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_uuid_new");
8746
+ }
8442
8747
  if (core_crypto_ffi_ffi_default().uniffi_core_crypto_ffi_checksum_constructor_welcome_new() !== 20256) {
8443
8748
  throw new UniffiInternalError.ApiChecksumMismatch("uniffi_core_crypto_ffi_checksum_constructor_welcome_new");
8444
8749
  }
@@ -8486,6 +8791,7 @@ var core_crypto_ffi_default = Object.freeze({
8486
8791
  FfiConverterTypeDatabaseKey,
8487
8792
  FfiConverterTypeDecryptedMessage,
8488
8793
  FfiConverterTypeDeserializedClientId,
8794
+ FfiConverterTypeDeviceId,
8489
8795
  FfiConverterTypeDeviceStatus,
8490
8796
  FfiConverterTypeE2eiConversationState,
8491
8797
  FfiConverterTypeEpochChangedReportingError,
@@ -8516,6 +8822,7 @@ var core_crypto_ffi_default = Object.freeze({
8516
8822
  FfiConverterTypeSecretKey,
8517
8823
  FfiConverterTypeSignatureScheme,
8518
8824
  FfiConverterTypeTimestamp,
8825
+ FfiConverterTypeUuid,
8519
8826
  FfiConverterTypeWelcome,
8520
8827
  FfiConverterTypeWireIdentity,
8521
8828
  FfiConverterTypeX509CredentialAcquisition,
@@ -8616,6 +8923,7 @@ export {
8616
8923
  X509CredentialAcquisition2 as X509CredentialAcquisition,
8617
8924
  WireIdentity,
8618
8925
  Welcome,
8926
+ Uuid,
8619
8927
  SignatureScheme,
8620
8928
  SecretKey,
8621
8929
  MlsRatchetTreeType as RatchetTreeType,
@@ -8642,6 +8950,7 @@ export {
8642
8950
  EpochChangedReportingError,
8643
8951
  E2eiConversationState,
8644
8952
  DeviceStatus,
8953
+ DeviceId,
8645
8954
  DeserializedClientId,
8646
8955
  DatabaseKey,
8647
8956
  Database,
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireapp/core-crypto",
3
- "version": "10.0.0-pre.10",
3
+ "version": "10.0.0-pre.11",
4
4
  "author": "Wire CoreCrypto team <team.corecrypto@wire.com>",
5
5
  "repository": {
6
6
  "type": "git",