@bitwarden/sdk-internal 0.2.0-main.134 → 0.2.0-main.136

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.
@@ -266,6 +266,23 @@ module.exports.isCryptoError = function (error) {
266
266
  }
267
267
  };
268
268
 
269
+ function getArrayU8FromWasm0(ptr, len) {
270
+ ptr = ptr >>> 0;
271
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
272
+ }
273
+
274
+ function passArray8ToWasm0(arg, malloc) {
275
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
276
+ getUint8ArrayMemory0().set(arg, ptr / 1);
277
+ WASM_VECTOR_LEN = arg.length;
278
+ return ptr;
279
+ }
280
+
281
+ function _assertClass(instance, klass) {
282
+ if (!(instance instanceof klass)) {
283
+ throw new Error(`expected instance of ${klass.name}`);
284
+ }
285
+ }
269
286
  /**
270
287
  * @param {any} error
271
288
  * @returns {boolean}
@@ -397,17 +414,6 @@ module.exports.init_sdk = function (log_level) {
397
414
  wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
398
415
  };
399
416
 
400
- function passArray8ToWasm0(arg, malloc) {
401
- const ptr = malloc(arg.length * 1, 1) >>> 0;
402
- getUint8ArrayMemory0().set(arg, ptr / 1);
403
- WASM_VECTOR_LEN = arg.length;
404
- return ptr;
405
- }
406
-
407
- function getArrayU8FromWasm0(ptr, len) {
408
- ptr = ptr >>> 0;
409
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
410
- }
411
417
  /**
412
418
  * Generate a new SSH key pair
413
419
  *
@@ -476,6 +482,25 @@ module.exports.import_ssh_key = function (imported_key, password) {
476
482
  }
477
483
  };
478
484
 
485
+ function passArrayJsValueToWasm0(array, malloc) {
486
+ const ptr = malloc(array.length * 4, 4) >>> 0;
487
+ const mem = getDataViewMemory0();
488
+ for (let i = 0; i < array.length; i++) {
489
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
490
+ }
491
+ WASM_VECTOR_LEN = array.length;
492
+ return ptr;
493
+ }
494
+
495
+ function getArrayJsValueFromWasm0(ptr, len) {
496
+ ptr = ptr >>> 0;
497
+ const mem = getDataViewMemory0();
498
+ const result = [];
499
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
500
+ result.push(takeObject(mem.getUint32(i, true)));
501
+ }
502
+ return result;
503
+ }
479
504
  /**
480
505
  * @param {any} error
481
506
  * @returns {boolean}
@@ -489,7 +514,7 @@ module.exports.isTestError = function (error) {
489
514
  }
490
515
  };
491
516
 
492
- function __wbg_adapter_40(arg0, arg1, arg2) {
517
+ function __wbg_adapter_50(arg0, arg1, arg2) {
493
518
  wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8ef26cc0e999965d(
494
519
  arg0,
495
520
  arg1,
@@ -497,7 +522,7 @@ function __wbg_adapter_40(arg0, arg1, arg2) {
497
522
  );
498
523
  }
499
524
 
500
- function __wbg_adapter_174(arg0, arg1, arg2, arg3) {
525
+ function __wbg_adapter_215(arg0, arg1, arg2, arg3) {
501
526
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h33defb2ea0fdb769(
502
527
  arg0,
503
528
  arg1,
@@ -506,6 +531,103 @@ function __wbg_adapter_174(arg0, arg1, arg2, arg3) {
506
531
  );
507
532
  }
508
533
 
534
+ /**
535
+ * @enum {300 | 301 | 302 | 303 | 304 | 305}
536
+ */
537
+ module.exports.CardLinkedIdType = Object.freeze({
538
+ CardholderName: 300,
539
+ 300: "CardholderName",
540
+ ExpMonth: 301,
541
+ 301: "ExpMonth",
542
+ ExpYear: 302,
543
+ 302: "ExpYear",
544
+ Code: 303,
545
+ 303: "Code",
546
+ Brand: 304,
547
+ 304: "Brand",
548
+ Number: 305,
549
+ 305: "Number",
550
+ });
551
+ /**
552
+ * @enum {0 | 1}
553
+ */
554
+ module.exports.CipherRepromptType = Object.freeze({
555
+ None: 0,
556
+ 0: "None",
557
+ Password: 1,
558
+ 1: "Password",
559
+ });
560
+ /**
561
+ * @enum {1 | 2 | 3 | 4 | 5}
562
+ */
563
+ module.exports.CipherType = Object.freeze({
564
+ Login: 1,
565
+ 1: "Login",
566
+ SecureNote: 2,
567
+ 2: "SecureNote",
568
+ Card: 3,
569
+ 3: "Card",
570
+ Identity: 4,
571
+ 4: "Identity",
572
+ SshKey: 5,
573
+ 5: "SshKey",
574
+ });
575
+ /**
576
+ * @enum {0 | 1 | 2 | 3}
577
+ */
578
+ module.exports.FieldType = Object.freeze({
579
+ Text: 0,
580
+ 0: "Text",
581
+ Hidden: 1,
582
+ 1: "Hidden",
583
+ Boolean: 2,
584
+ 2: "Boolean",
585
+ Linked: 3,
586
+ 3: "Linked",
587
+ });
588
+ /**
589
+ * @enum {400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418}
590
+ */
591
+ module.exports.IdentityLinkedIdType = Object.freeze({
592
+ Title: 400,
593
+ 400: "Title",
594
+ MiddleName: 401,
595
+ 401: "MiddleName",
596
+ Address1: 402,
597
+ 402: "Address1",
598
+ Address2: 403,
599
+ 403: "Address2",
600
+ Address3: 404,
601
+ 404: "Address3",
602
+ City: 405,
603
+ 405: "City",
604
+ State: 406,
605
+ 406: "State",
606
+ PostalCode: 407,
607
+ 407: "PostalCode",
608
+ Country: 408,
609
+ 408: "Country",
610
+ Company: 409,
611
+ 409: "Company",
612
+ Email: 410,
613
+ 410: "Email",
614
+ Phone: 411,
615
+ 411: "Phone",
616
+ Ssn: 412,
617
+ 412: "Ssn",
618
+ Username: 413,
619
+ 413: "Username",
620
+ PassportNumber: 414,
621
+ 414: "PassportNumber",
622
+ LicenseNumber: 415,
623
+ 415: "LicenseNumber",
624
+ FirstName: 416,
625
+ 416: "FirstName",
626
+ LastName: 417,
627
+ 417: "LastName",
628
+ FullName: 418,
629
+ 418: "FullName",
630
+ });
509
631
  /**
510
632
  * @enum {0 | 1 | 2 | 3 | 4}
511
633
  */
@@ -521,6 +643,39 @@ module.exports.LogLevel = Object.freeze({
521
643
  Error: 4,
522
644
  4: "Error",
523
645
  });
646
+ /**
647
+ * @enum {100 | 101}
648
+ */
649
+ module.exports.LoginLinkedIdType = Object.freeze({
650
+ Username: 100,
651
+ 100: "Username",
652
+ Password: 101,
653
+ 101: "Password",
654
+ });
655
+ /**
656
+ * @enum {0}
657
+ */
658
+ module.exports.SecureNoteType = Object.freeze({
659
+ Generic: 0,
660
+ 0: "Generic",
661
+ });
662
+ /**
663
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
664
+ */
665
+ module.exports.UriMatchType = Object.freeze({
666
+ Domain: 0,
667
+ 0: "Domain",
668
+ Host: 1,
669
+ 1: "Host",
670
+ StartsWith: 2,
671
+ 2: "StartsWith",
672
+ Exact: 3,
673
+ 3: "Exact",
674
+ RegularExpression: 4,
675
+ 4: "RegularExpression",
676
+ Never: 5,
677
+ 5: "Never",
678
+ });
524
679
 
525
680
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
526
681
 
@@ -640,6 +795,154 @@ class BitwardenClient {
640
795
  }
641
796
  module.exports.BitwardenClient = BitwardenClient;
642
797
 
798
+ const ClientCiphersFinalization =
799
+ typeof FinalizationRegistry === "undefined"
800
+ ? { register: () => {}, unregister: () => {} }
801
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clientciphers_free(ptr >>> 0, 1));
802
+
803
+ class ClientCiphers {
804
+ static __wrap(ptr) {
805
+ ptr = ptr >>> 0;
806
+ const obj = Object.create(ClientCiphers.prototype);
807
+ obj.__wbg_ptr = ptr;
808
+ ClientCiphersFinalization.register(obj, obj.__wbg_ptr, obj);
809
+ return obj;
810
+ }
811
+
812
+ __destroy_into_raw() {
813
+ const ptr = this.__wbg_ptr;
814
+ this.__wbg_ptr = 0;
815
+ ClientCiphersFinalization.unregister(this);
816
+ return ptr;
817
+ }
818
+
819
+ free() {
820
+ const ptr = this.__destroy_into_raw();
821
+ wasm.__wbg_clientciphers_free(ptr, 0);
822
+ }
823
+ /**
824
+ * Encrypt cipher
825
+ *
826
+ * # Arguments
827
+ * - `cipher_view` - The decrypted cipher to encrypt
828
+ *
829
+ * # Returns
830
+ * - `Ok(Cipher)` containing the encrypted cipher
831
+ * - `Err(EncryptError)` if encryption fails
832
+ * @param {CipherView} cipher_view
833
+ * @returns {Cipher}
834
+ */
835
+ encrypt(cipher_view) {
836
+ try {
837
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
838
+ wasm.clientciphers_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
839
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
840
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
841
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
842
+ if (r2) {
843
+ throw takeObject(r1);
844
+ }
845
+ return takeObject(r0);
846
+ } finally {
847
+ wasm.__wbindgen_add_to_stack_pointer(16);
848
+ }
849
+ }
850
+ /**
851
+ * Decrypt cipher
852
+ *
853
+ * # Arguments
854
+ * - `cipher` - The encrypted cipher to decrypt
855
+ *
856
+ * # Returns
857
+ * - `Ok(CipherView)` containing the decrypted cipher
858
+ * - `Err(DecryptError)` if decryption fails
859
+ * @param {Cipher} cipher
860
+ * @returns {CipherView}
861
+ */
862
+ decrypt(cipher) {
863
+ try {
864
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
865
+ wasm.clientciphers_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
866
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
867
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
868
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
869
+ if (r2) {
870
+ throw takeObject(r1);
871
+ }
872
+ return takeObject(r0);
873
+ } finally {
874
+ wasm.__wbindgen_add_to_stack_pointer(16);
875
+ }
876
+ }
877
+ /**
878
+ * Decrypt list of ciphers
879
+ *
880
+ * # Arguments
881
+ * - `ciphers` - The list of encrypted ciphers to decrypt
882
+ *
883
+ * # Returns
884
+ * - `Ok(Vec<CipherListView>)` containing the decrypted ciphers
885
+ * - `Err(DecryptError)` if decryption fails
886
+ * @param {Cipher[]} ciphers
887
+ * @returns {CipherListView[]}
888
+ */
889
+ decrypt_list(ciphers) {
890
+ try {
891
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
892
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
893
+ const len0 = WASM_VECTOR_LEN;
894
+ wasm.clientciphers_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
895
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
896
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
897
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
898
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
899
+ if (r3) {
900
+ throw takeObject(r2);
901
+ }
902
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
903
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
904
+ return v2;
905
+ } finally {
906
+ wasm.__wbindgen_add_to_stack_pointer(16);
907
+ }
908
+ }
909
+ /**
910
+ * Decrypt FIDO2 credentials
911
+ *
912
+ * # Arguments
913
+ * - `cipher_view` - Cipher to encrypt containing the FIDO2 credential
914
+ *
915
+ * # Returns
916
+ * - `Ok(Vec<Fido2CredentialView>)` containing the decrypted FIDO2 credentials
917
+ * - `Err(DecryptError)` if decryption fails
918
+ * @param {CipherView} cipher_view
919
+ * @returns {Fido2CredentialView[]}
920
+ */
921
+ decrypt_fido2_credentials(cipher_view) {
922
+ try {
923
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
924
+ wasm.clientciphers_decrypt_fido2_credentials(
925
+ retptr,
926
+ this.__wbg_ptr,
927
+ addHeapObject(cipher_view),
928
+ );
929
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
930
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
931
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
932
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
933
+ if (r3) {
934
+ throw takeObject(r2);
935
+ }
936
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
937
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
938
+ return v1;
939
+ } finally {
940
+ wasm.__wbindgen_add_to_stack_pointer(16);
941
+ }
942
+ }
943
+ }
944
+ module.exports.ClientCiphers = ClientCiphers;
945
+
643
946
  const ClientFoldersFinalization =
644
947
  typeof FinalizationRegistry === "undefined"
645
948
  ? { register: () => {}, unregister: () => {} }
@@ -850,6 +1153,146 @@ class CryptoClient {
850
1153
  }
851
1154
  module.exports.CryptoClient = CryptoClient;
852
1155
 
1156
+ const IncomingMessageFinalization =
1157
+ typeof FinalizationRegistry === "undefined"
1158
+ ? { register: () => {}, unregister: () => {} }
1159
+ : new FinalizationRegistry((ptr) => wasm.__wbg_incomingmessage_free(ptr >>> 0, 1));
1160
+
1161
+ class IncomingMessage {
1162
+ static __wrap(ptr) {
1163
+ ptr = ptr >>> 0;
1164
+ const obj = Object.create(IncomingMessage.prototype);
1165
+ obj.__wbg_ptr = ptr;
1166
+ IncomingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1167
+ return obj;
1168
+ }
1169
+
1170
+ __destroy_into_raw() {
1171
+ const ptr = this.__wbg_ptr;
1172
+ this.__wbg_ptr = 0;
1173
+ IncomingMessageFinalization.unregister(this);
1174
+ return ptr;
1175
+ }
1176
+
1177
+ free() {
1178
+ const ptr = this.__destroy_into_raw();
1179
+ wasm.__wbg_incomingmessage_free(ptr, 0);
1180
+ }
1181
+ /**
1182
+ * @returns {Uint8Array}
1183
+ */
1184
+ get payload() {
1185
+ try {
1186
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1187
+ wasm.__wbg_get_incomingmessage_payload(retptr, this.__wbg_ptr);
1188
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1189
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1190
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1191
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1192
+ return v1;
1193
+ } finally {
1194
+ wasm.__wbindgen_add_to_stack_pointer(16);
1195
+ }
1196
+ }
1197
+ /**
1198
+ * @param {Uint8Array} arg0
1199
+ */
1200
+ set payload(arg0) {
1201
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1202
+ const len0 = WASM_VECTOR_LEN;
1203
+ wasm.__wbg_set_incomingmessage_payload(this.__wbg_ptr, ptr0, len0);
1204
+ }
1205
+ /**
1206
+ * @returns {Endpoint}
1207
+ */
1208
+ get destination() {
1209
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1210
+ return takeObject(ret);
1211
+ }
1212
+ /**
1213
+ * @param {Endpoint} arg0
1214
+ */
1215
+ set destination(arg0) {
1216
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
1217
+ }
1218
+ /**
1219
+ * @returns {Endpoint}
1220
+ */
1221
+ get source() {
1222
+ const ret = wasm.__wbg_get_incomingmessage_source(this.__wbg_ptr);
1223
+ return takeObject(ret);
1224
+ }
1225
+ /**
1226
+ * @param {Endpoint} arg0
1227
+ */
1228
+ set source(arg0) {
1229
+ wasm.__wbg_set_incomingmessage_source(this.__wbg_ptr, addHeapObject(arg0));
1230
+ }
1231
+ /**
1232
+ * @returns {string | undefined}
1233
+ */
1234
+ get topic() {
1235
+ try {
1236
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1237
+ wasm.__wbg_get_incomingmessage_topic(retptr, this.__wbg_ptr);
1238
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1239
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1240
+ let v1;
1241
+ if (r0 !== 0) {
1242
+ v1 = getStringFromWasm0(r0, r1).slice();
1243
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1244
+ }
1245
+ return v1;
1246
+ } finally {
1247
+ wasm.__wbindgen_add_to_stack_pointer(16);
1248
+ }
1249
+ }
1250
+ /**
1251
+ * @param {string | null} [arg0]
1252
+ */
1253
+ set topic(arg0) {
1254
+ var ptr0 = isLikeNone(arg0)
1255
+ ? 0
1256
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1257
+ var len0 = WASM_VECTOR_LEN;
1258
+ wasm.__wbg_set_incomingmessage_topic(this.__wbg_ptr, ptr0, len0);
1259
+ }
1260
+ /**
1261
+ * @param {Uint8Array} payload
1262
+ * @param {Endpoint} destination
1263
+ * @param {Endpoint} source
1264
+ * @param {string | null} [topic]
1265
+ */
1266
+ constructor(payload, destination, source, topic) {
1267
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1268
+ const len0 = WASM_VECTOR_LEN;
1269
+ var ptr1 = isLikeNone(topic)
1270
+ ? 0
1271
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1272
+ var len1 = WASM_VECTOR_LEN;
1273
+ const ret = wasm.incomingmessage_new(
1274
+ ptr0,
1275
+ len0,
1276
+ addHeapObject(destination),
1277
+ addHeapObject(source),
1278
+ ptr1,
1279
+ len1,
1280
+ );
1281
+ this.__wbg_ptr = ret >>> 0;
1282
+ IncomingMessageFinalization.register(this, this.__wbg_ptr, this);
1283
+ return this;
1284
+ }
1285
+ /**
1286
+ * Try to parse the payload as JSON.
1287
+ * @returns {any} The parsed JSON value, or undefined if the payload is not valid JSON.
1288
+ */
1289
+ parse_payload_as_json() {
1290
+ const ret = wasm.incomingmessage_parse_payload_as_json(this.__wbg_ptr);
1291
+ return takeObject(ret);
1292
+ }
1293
+ }
1294
+ module.exports.IncomingMessage = IncomingMessage;
1295
+
853
1296
  const IpcClientFinalization =
854
1297
  typeof FinalizationRegistry === "undefined"
855
1298
  ? { register: () => {}, unregister: () => {} }
@@ -881,7 +1324,9 @@ class IpcClient {
881
1324
  * @returns {Promise<void>}
882
1325
  */
883
1326
  send(message) {
884
- const ret = wasm.ipcclient_send(this.__wbg_ptr, addHeapObject(message));
1327
+ _assertClass(message, OutgoingMessage);
1328
+ var ptr0 = message.__destroy_into_raw();
1329
+ const ret = wasm.ipcclient_send(this.__wbg_ptr, ptr0);
885
1330
  return takeObject(ret);
886
1331
  }
887
1332
  /**
@@ -894,6 +1339,149 @@ class IpcClient {
894
1339
  }
895
1340
  module.exports.IpcClient = IpcClient;
896
1341
 
1342
+ const OutgoingMessageFinalization =
1343
+ typeof FinalizationRegistry === "undefined"
1344
+ ? { register: () => {}, unregister: () => {} }
1345
+ : new FinalizationRegistry((ptr) => wasm.__wbg_outgoingmessage_free(ptr >>> 0, 1));
1346
+
1347
+ class OutgoingMessage {
1348
+ static __wrap(ptr) {
1349
+ ptr = ptr >>> 0;
1350
+ const obj = Object.create(OutgoingMessage.prototype);
1351
+ obj.__wbg_ptr = ptr;
1352
+ OutgoingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1353
+ return obj;
1354
+ }
1355
+
1356
+ __destroy_into_raw() {
1357
+ const ptr = this.__wbg_ptr;
1358
+ this.__wbg_ptr = 0;
1359
+ OutgoingMessageFinalization.unregister(this);
1360
+ return ptr;
1361
+ }
1362
+
1363
+ free() {
1364
+ const ptr = this.__destroy_into_raw();
1365
+ wasm.__wbg_outgoingmessage_free(ptr, 0);
1366
+ }
1367
+ /**
1368
+ * @returns {Uint8Array}
1369
+ */
1370
+ get payload() {
1371
+ try {
1372
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1373
+ wasm.__wbg_get_outgoingmessage_payload(retptr, this.__wbg_ptr);
1374
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1375
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1376
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1377
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1378
+ return v1;
1379
+ } finally {
1380
+ wasm.__wbindgen_add_to_stack_pointer(16);
1381
+ }
1382
+ }
1383
+ /**
1384
+ * @param {Uint8Array} arg0
1385
+ */
1386
+ set payload(arg0) {
1387
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1388
+ const len0 = WASM_VECTOR_LEN;
1389
+ wasm.__wbg_set_outgoingmessage_payload(this.__wbg_ptr, ptr0, len0);
1390
+ }
1391
+ /**
1392
+ * @returns {Endpoint}
1393
+ */
1394
+ get destination() {
1395
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1396
+ return takeObject(ret);
1397
+ }
1398
+ /**
1399
+ * @param {Endpoint} arg0
1400
+ */
1401
+ set destination(arg0) {
1402
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
1403
+ }
1404
+ /**
1405
+ * @returns {string | undefined}
1406
+ */
1407
+ get topic() {
1408
+ try {
1409
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1410
+ wasm.__wbg_get_outgoingmessage_topic(retptr, this.__wbg_ptr);
1411
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1412
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1413
+ let v1;
1414
+ if (r0 !== 0) {
1415
+ v1 = getStringFromWasm0(r0, r1).slice();
1416
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1417
+ }
1418
+ return v1;
1419
+ } finally {
1420
+ wasm.__wbindgen_add_to_stack_pointer(16);
1421
+ }
1422
+ }
1423
+ /**
1424
+ * @param {string | null} [arg0]
1425
+ */
1426
+ set topic(arg0) {
1427
+ var ptr0 = isLikeNone(arg0)
1428
+ ? 0
1429
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1430
+ var len0 = WASM_VECTOR_LEN;
1431
+ wasm.__wbg_set_outgoingmessage_topic(this.__wbg_ptr, ptr0, len0);
1432
+ }
1433
+ /**
1434
+ * @param {Uint8Array} payload
1435
+ * @param {Endpoint} destination
1436
+ * @param {string | null} [topic]
1437
+ */
1438
+ constructor(payload, destination, topic) {
1439
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1440
+ const len0 = WASM_VECTOR_LEN;
1441
+ var ptr1 = isLikeNone(topic)
1442
+ ? 0
1443
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1444
+ var len1 = WASM_VECTOR_LEN;
1445
+ const ret = wasm.outgoingmessage_new(ptr0, len0, addHeapObject(destination), ptr1, len1);
1446
+ this.__wbg_ptr = ret >>> 0;
1447
+ OutgoingMessageFinalization.register(this, this.__wbg_ptr, this);
1448
+ return this;
1449
+ }
1450
+ /**
1451
+ * Create a new message and encode the payload as JSON.
1452
+ * @param {any} payload
1453
+ * @param {Endpoint} destination
1454
+ * @param {string | null} [topic]
1455
+ * @returns {OutgoingMessage}
1456
+ */
1457
+ static new_json_payload(payload, destination, topic) {
1458
+ try {
1459
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1460
+ var ptr0 = isLikeNone(topic)
1461
+ ? 0
1462
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1463
+ var len0 = WASM_VECTOR_LEN;
1464
+ wasm.outgoingmessage_new_json_payload(
1465
+ retptr,
1466
+ addHeapObject(payload),
1467
+ addHeapObject(destination),
1468
+ ptr0,
1469
+ len0,
1470
+ );
1471
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1472
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1473
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1474
+ if (r2) {
1475
+ throw takeObject(r1);
1476
+ }
1477
+ return OutgoingMessage.__wrap(r0);
1478
+ } finally {
1479
+ wasm.__wbindgen_add_to_stack_pointer(16);
1480
+ }
1481
+ }
1482
+ }
1483
+ module.exports.OutgoingMessage = OutgoingMessage;
1484
+
897
1485
  const PureCryptoFinalization =
898
1486
  typeof FinalizationRegistry === "undefined"
899
1487
  ? { register: () => {}, unregister: () => {} }
@@ -1093,31 +1681,44 @@ class ReceiveError {
1093
1681
  const ptr = this.__destroy_into_raw();
1094
1682
  wasm.__wbg_receiveerror_free(ptr, 0);
1095
1683
  }
1684
+ /**
1685
+ * @returns {boolean}
1686
+ */
1687
+ get timeout() {
1688
+ const ret = wasm.__wbg_get_receiveerror_timeout(this.__wbg_ptr);
1689
+ return ret !== 0;
1690
+ }
1691
+ /**
1692
+ * @param {boolean} arg0
1693
+ */
1694
+ set timeout(arg0) {
1695
+ wasm.__wbg_set_receiveerror_timeout(this.__wbg_ptr, arg0);
1696
+ }
1096
1697
  /**
1097
1698
  * @returns {any}
1098
1699
  */
1099
- get crypto_error() {
1100
- const ret = wasm.__wbg_get_receiveerror_crypto_error(this.__wbg_ptr);
1700
+ get crypto() {
1701
+ const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
1101
1702
  return takeObject(ret);
1102
1703
  }
1103
1704
  /**
1104
1705
  * @param {any} arg0
1105
1706
  */
1106
- set crypto_error(arg0) {
1107
- wasm.__wbg_set_receiveerror_crypto_error(this.__wbg_ptr, addHeapObject(arg0));
1707
+ set crypto(arg0) {
1708
+ wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
1108
1709
  }
1109
1710
  /**
1110
1711
  * @returns {any}
1111
1712
  */
1112
- get communication_error() {
1113
- const ret = wasm.__wbg_get_receiveerror_communication_error(this.__wbg_ptr);
1713
+ get communication() {
1714
+ const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
1114
1715
  return takeObject(ret);
1115
1716
  }
1116
1717
  /**
1117
1718
  * @param {any} arg0
1118
1719
  */
1119
- set communication_error(arg0) {
1120
- wasm.__wbg_set_receiveerror_communication_error(this.__wbg_ptr, addHeapObject(arg0));
1720
+ set communication(arg0) {
1721
+ wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
1121
1722
  }
1122
1723
  }
1123
1724
  module.exports.ReceiveError = ReceiveError;
@@ -1150,28 +1751,28 @@ class SendError {
1150
1751
  /**
1151
1752
  * @returns {any}
1152
1753
  */
1153
- get crypto_error() {
1154
- const ret = wasm.__wbg_get_receiveerror_crypto_error(this.__wbg_ptr);
1754
+ get crypto() {
1755
+ const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
1155
1756
  return takeObject(ret);
1156
1757
  }
1157
1758
  /**
1158
1759
  * @param {any} arg0
1159
1760
  */
1160
- set crypto_error(arg0) {
1161
- wasm.__wbg_set_receiveerror_crypto_error(this.__wbg_ptr, addHeapObject(arg0));
1761
+ set crypto(arg0) {
1762
+ wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
1162
1763
  }
1163
1764
  /**
1164
1765
  * @returns {any}
1165
1766
  */
1166
- get communication_error() {
1167
- const ret = wasm.__wbg_get_receiveerror_communication_error(this.__wbg_ptr);
1767
+ get communication() {
1768
+ const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
1168
1769
  return takeObject(ret);
1169
1770
  }
1170
1771
  /**
1171
1772
  * @param {any} arg0
1172
1773
  */
1173
- set communication_error(arg0) {
1174
- wasm.__wbg_set_receiveerror_communication_error(this.__wbg_ptr, addHeapObject(arg0));
1774
+ set communication(arg0) {
1775
+ wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
1175
1776
  }
1176
1777
  }
1177
1778
  module.exports.SendError = SendError;
@@ -1201,6 +1802,13 @@ class VaultClient {
1201
1802
  const ptr = this.__destroy_into_raw();
1202
1803
  wasm.__wbg_vaultclient_free(ptr, 0);
1203
1804
  }
1805
+ /**
1806
+ * @returns {ClientCiphers}
1807
+ */
1808
+ ciphers() {
1809
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
1810
+ return ClientCiphers.__wrap(ret);
1811
+ }
1204
1812
  /**
1205
1813
  * @returns {ClientFolders}
1206
1814
  */
@@ -1362,6 +1970,11 @@ module.exports.__wbg_headers_9cb51cfd2ac780a4 = function (arg0) {
1362
1970
  return addHeapObject(ret);
1363
1971
  };
1364
1972
 
1973
+ module.exports.__wbg_incomingmessage_new = function (arg0) {
1974
+ const ret = IncomingMessage.__wrap(arg0);
1975
+ return addHeapObject(ret);
1976
+ };
1977
+
1365
1978
  module.exports.__wbg_info_033d8b8a0838f1d3 = function (arg0, arg1, arg2, arg3) {
1366
1979
  console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1367
1980
  };
@@ -1377,6 +1990,17 @@ module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function (arg0) {
1377
1990
  return ret;
1378
1991
  };
1379
1992
 
1993
+ module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function (arg0) {
1994
+ let result;
1995
+ try {
1996
+ result = getObject(arg0) instanceof Map;
1997
+ } catch (_) {
1998
+ result = false;
1999
+ }
2000
+ const ret = result;
2001
+ return ret;
2002
+ };
2003
+
1380
2004
  module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function (arg0) {
1381
2005
  let result;
1382
2006
  try {
@@ -1452,7 +2076,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
1452
2076
  const a = state0.a;
1453
2077
  state0.a = 0;
1454
2078
  try {
1455
- return __wbg_adapter_174(a, state0.b, arg0, arg1);
2079
+ return __wbg_adapter_215(a, state0.b, arg0, arg1);
1456
2080
  } finally {
1457
2081
  state0.a = a;
1458
2082
  }
@@ -1562,6 +2186,13 @@ module.exports.__wbg_node_02999533c4ea02e3 = function (arg0) {
1562
2186
  return addHeapObject(ret);
1563
2187
  };
1564
2188
 
2189
+ module.exports.__wbg_parse_def2e24ef1252aff = function () {
2190
+ return handleError(function (arg0, arg1) {
2191
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
2192
+ return addHeapObject(ret);
2193
+ }, arguments);
2194
+ };
2195
+
1565
2196
  module.exports.__wbg_process_5c1d670bc53614b8 = function (arg0) {
1566
2197
  const ret = getObject(arg0).process;
1567
2198
  return addHeapObject(ret);
@@ -1613,7 +2244,7 @@ module.exports.__wbg_resolve_4851785c9c5f573d = function (arg0) {
1613
2244
 
1614
2245
  module.exports.__wbg_send_c9eacaae08065b18 = function () {
1615
2246
  return handleError(function (arg0, arg1) {
1616
- const ret = getObject(arg0).send(takeObject(arg1));
2247
+ const ret = getObject(arg0).send(OutgoingMessage.__wrap(arg1));
1617
2248
  return addHeapObject(ret);
1618
2249
  }, arguments);
1619
2250
  };
@@ -1781,6 +2412,23 @@ module.exports.__wbindgen_as_number = function (arg0) {
1781
2412
  return ret;
1782
2413
  };
1783
2414
 
2415
+ module.exports.__wbindgen_bigint_from_i64 = function (arg0) {
2416
+ const ret = arg0;
2417
+ return addHeapObject(ret);
2418
+ };
2419
+
2420
+ module.exports.__wbindgen_bigint_from_u64 = function (arg0) {
2421
+ const ret = BigInt.asUintN(64, arg0);
2422
+ return addHeapObject(ret);
2423
+ };
2424
+
2425
+ module.exports.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
2426
+ const v = getObject(arg1);
2427
+ const ret = typeof v === "bigint" ? v : undefined;
2428
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
2429
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2430
+ };
2431
+
1784
2432
  module.exports.__wbindgen_boolean_get = function (arg0) {
1785
2433
  const v = getObject(arg0);
1786
2434
  const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
@@ -1797,8 +2445,8 @@ module.exports.__wbindgen_cb_drop = function (arg0) {
1797
2445
  return ret;
1798
2446
  };
1799
2447
 
1800
- module.exports.__wbindgen_closure_wrapper2219 = function (arg0, arg1, arg2) {
1801
- const ret = makeMutClosure(arg0, arg1, 574, __wbg_adapter_40);
2448
+ module.exports.__wbindgen_closure_wrapper2552 = function (arg0, arg1, arg2) {
2449
+ const ret = makeMutClosure(arg0, arg1, 634, __wbg_adapter_50);
1802
2450
  return addHeapObject(ret);
1803
2451
  };
1804
2452
 
@@ -1820,6 +2468,11 @@ module.exports.__wbindgen_in = function (arg0, arg1) {
1820
2468
  return ret;
1821
2469
  };
1822
2470
 
2471
+ module.exports.__wbindgen_is_bigint = function (arg0) {
2472
+ const ret = typeof getObject(arg0) === "bigint";
2473
+ return ret;
2474
+ };
2475
+
1823
2476
  module.exports.__wbindgen_is_function = function (arg0) {
1824
2477
  const ret = typeof getObject(arg0) === "function";
1825
2478
  return ret;
@@ -1841,6 +2494,11 @@ module.exports.__wbindgen_is_undefined = function (arg0) {
1841
2494
  return ret;
1842
2495
  };
1843
2496
 
2497
+ module.exports.__wbindgen_jsval_eq = function (arg0, arg1) {
2498
+ const ret = getObject(arg0) === getObject(arg1);
2499
+ return ret;
2500
+ };
2501
+
1844
2502
  module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
1845
2503
  const ret = getObject(arg0) == getObject(arg1);
1846
2504
  return ret;