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