@bitwarden/sdk-internal 0.2.0-main.212 → 0.2.0-main.213

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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- a3d748a6c1e0828313849c7e540a8d2e477de3da
1
+ 025f81899ebb73fd6a24af32e449e38cdb856c71
@@ -1,5 +1,20 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Registers a DiscoverHandler so that the client can respond to DiscoverRequests.
5
+ */
6
+ export function ipcRegisterDiscoverHandler(
7
+ ipc_client: IpcClient,
8
+ response: DiscoverResponse,
9
+ ): Promise<void>;
10
+ /**
11
+ * Sends a DiscoverRequest to the specified destination and returns the response.
12
+ */
13
+ export function ipcRequestDiscover(
14
+ ipc_client: IpcClient,
15
+ destination: Endpoint,
16
+ abort_signal?: AbortSignal | null,
17
+ ): Promise<DiscoverResponse>;
3
18
  export function set_log_level(level: LogLevel): void;
4
19
  export function init_sdk(log_level?: LogLevel | null): void;
5
20
  /**
@@ -575,6 +590,10 @@ export interface PassphraseError extends Error {
575
590
 
576
591
  export function isPassphraseError(error: any): error is PassphraseError;
577
592
 
593
+ export interface DiscoverResponse {
594
+ version: string;
595
+ }
596
+
578
597
  export type Endpoint =
579
598
  | { Web: { id: number } }
580
599
  | "BrowserForeground"
@@ -598,6 +617,13 @@ export interface DeserializeError extends Error {
598
617
 
599
618
  export function isDeserializeError(error: any): error is DeserializeError;
600
619
 
620
+ export interface RequestError extends Error {
621
+ name: "RequestError";
622
+ variant: "Subscribe" | "Receive" | "Timeout" | "Send" | "RpcError";
623
+ }
624
+
625
+ export function isRequestError(error: any): error is RequestError;
626
+
601
627
  export interface TypedReceiveError extends Error {
602
628
  name: "TypedReceiveError";
603
629
  variant: "Channel" | "Timeout" | "Cancelled" | "Typing";
@@ -1364,7 +1390,7 @@ export class IpcClient {
1364
1390
  export class IpcClientSubscription {
1365
1391
  private constructor();
1366
1392
  free(): void;
1367
- receive(abort_signal?: any | null): Promise<IncomingMessage>;
1393
+ receive(abort_signal?: AbortSignal | null): Promise<IncomingMessage>;
1368
1394
  }
1369
1395
  /**
1370
1396
  * JavaScript implementation of the `CommunicationBackend` trait for IPC communication.
@@ -399,6 +399,35 @@ function _assertClass(instance, klass) {
399
399
  throw new Error(`expected instance of ${klass.name}`);
400
400
  }
401
401
  }
402
+ /**
403
+ * Registers a DiscoverHandler so that the client can respond to DiscoverRequests.
404
+ * @param {IpcClient} ipc_client
405
+ * @param {DiscoverResponse} response
406
+ * @returns {Promise<void>}
407
+ */
408
+ export function ipcRegisterDiscoverHandler(ipc_client, response) {
409
+ _assertClass(ipc_client, IpcClient);
410
+ const ret = wasm.ipcRegisterDiscoverHandler(ipc_client.__wbg_ptr, addHeapObject(response));
411
+ return takeObject(ret);
412
+ }
413
+
414
+ /**
415
+ * Sends a DiscoverRequest to the specified destination and returns the response.
416
+ * @param {IpcClient} ipc_client
417
+ * @param {Endpoint} destination
418
+ * @param {AbortSignal | null} [abort_signal]
419
+ * @returns {Promise<DiscoverResponse>}
420
+ */
421
+ export function ipcRequestDiscover(ipc_client, destination, abort_signal) {
422
+ _assertClass(ipc_client, IpcClient);
423
+ const ret = wasm.ipcRequestDiscover(
424
+ ipc_client.__wbg_ptr,
425
+ addHeapObject(destination),
426
+ isLikeNone(abort_signal) ? 0 : addHeapObject(abort_signal),
427
+ );
428
+ return takeObject(ret);
429
+ }
430
+
402
431
  /**
403
432
  * @param {any} error
404
433
  * @returns {boolean}
@@ -425,6 +454,19 @@ export function isDeserializeError(error) {
425
454
  }
426
455
  }
427
456
 
457
+ /**
458
+ * @param {any} error
459
+ * @returns {boolean}
460
+ */
461
+ export function isRequestError(error) {
462
+ try {
463
+ const ret = wasm.isRequestError(addBorrowedObject(error));
464
+ return ret !== 0;
465
+ } finally {
466
+ heap[stack_pointer++] = undefined;
467
+ }
468
+ }
469
+
428
470
  /**
429
471
  * @param {any} error
430
472
  * @returns {boolean}
@@ -711,7 +753,7 @@ function __wbg_adapter_56(arg0, arg1, arg2) {
711
753
  );
712
754
  }
713
755
 
714
- function __wbg_adapter_271(arg0, arg1, arg2, arg3) {
756
+ function __wbg_adapter_274(arg0, arg1, arg2, arg3) {
715
757
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h8776500d04a3e634(
716
758
  arg0,
717
759
  arg1,
@@ -1984,7 +2026,7 @@ export class IpcClientSubscription {
1984
2026
  wasm.__wbg_ipcclientsubscription_free(ptr, 0);
1985
2027
  }
1986
2028
  /**
1987
- * @param {any | null} [abort_signal]
2029
+ * @param {AbortSignal | null} [abort_signal]
1988
2030
  * @returns {Promise<IncomingMessage>}
1989
2031
  */
1990
2032
  receive(abort_signal) {
@@ -3278,7 +3320,7 @@ export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
3278
3320
  return addHeapObject(ret);
3279
3321
  }
3280
3322
 
3281
- export function __wbg_get_f7bd93223b71a83e() {
3323
+ export function __wbg_get_d80c1589d30c292a() {
3282
3324
  return handleError(function (arg0, arg1, arg2) {
3283
3325
  let deferred0_0;
3284
3326
  let deferred0_1;
@@ -3393,7 +3435,7 @@ export function __wbg_length_e2d2a49132c1b256(arg0) {
3393
3435
  return ret;
3394
3436
  }
3395
3437
 
3396
- export function __wbg_list_a632257712ef903a() {
3438
+ export function __wbg_list_d11c20983c361f70() {
3397
3439
  return handleError(function (arg0) {
3398
3440
  const ret = getObject(arg0).list();
3399
3441
  return addHeapObject(ret);
@@ -3428,7 +3470,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
3428
3470
  const a = state0.a;
3429
3471
  state0.a = 0;
3430
3472
  try {
3431
- return __wbg_adapter_271(a, state0.b, arg0, arg1);
3473
+ return __wbg_adapter_274(a, state0.b, arg0, arg1);
3432
3474
  } finally {
3433
3475
  state0.a = a;
3434
3476
  }
@@ -3570,7 +3612,7 @@ export function __wbg_randomFillSync_ac0988aba3254290() {
3570
3612
  }, arguments);
3571
3613
  }
3572
3614
 
3573
- export function __wbg_remove_bb1b975ea93b448a() {
3615
+ export function __wbg_remove_212f779b207179b5() {
3574
3616
  return handleError(function (arg0, arg1, arg2) {
3575
3617
  let deferred0_0;
3576
3618
  let deferred0_1;
@@ -3617,7 +3659,11 @@ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
3617
3659
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3618
3660
  }
3619
3661
 
3620
- export function __wbg_set_581efd75a64cfdb7() {
3662
+ export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
3663
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3664
+ }
3665
+
3666
+ export function __wbg_set_7f4f0ad9ebd5a35e() {
3621
3667
  return handleError(function (arg0, arg1, arg2, arg3) {
3622
3668
  let deferred0_0;
3623
3669
  let deferred0_1;
@@ -3632,10 +3678,6 @@ export function __wbg_set_581efd75a64cfdb7() {
3632
3678
  }, arguments);
3633
3679
  }
3634
3680
 
3635
- export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
3636
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3637
- }
3638
-
3639
3681
  export function __wbg_setbody_5923b78a95eedf29(arg0, arg1) {
3640
3682
  getObject(arg0).body = getObject(arg1);
3641
3683
  }
@@ -3815,18 +3857,18 @@ export function __wbindgen_cb_drop(arg0) {
3815
3857
  return ret;
3816
3858
  }
3817
3859
 
3818
- export function __wbindgen_closure_wrapper2654(arg0, arg1, arg2) {
3819
- const ret = makeMutClosure(arg0, arg1, 795, __wbg_adapter_50);
3860
+ export function __wbindgen_closure_wrapper2827(arg0, arg1, arg2) {
3861
+ const ret = makeMutClosure(arg0, arg1, 904, __wbg_adapter_50);
3820
3862
  return addHeapObject(ret);
3821
3863
  }
3822
3864
 
3823
- export function __wbindgen_closure_wrapper3494(arg0, arg1, arg2) {
3824
- const ret = makeMutClosure(arg0, arg1, 879, __wbg_adapter_53);
3865
+ export function __wbindgen_closure_wrapper3667(arg0, arg1, arg2) {
3866
+ const ret = makeMutClosure(arg0, arg1, 988, __wbg_adapter_53);
3825
3867
  return addHeapObject(ret);
3826
3868
  }
3827
3869
 
3828
- export function __wbindgen_closure_wrapper3907(arg0, arg1, arg2) {
3829
- const ret = makeMutClosure(arg0, arg1, 1002, __wbg_adapter_56);
3870
+ export function __wbindgen_closure_wrapper4085(arg0, arg1, arg2) {
3871
+ const ret = makeMutClosure(arg0, arg1, 1111, __wbg_adapter_56);
3830
3872
  return addHeapObject(ret);
3831
3873
  }
3832
3874
 
Binary file
@@ -63,6 +63,8 @@ export const __wbg_set_incomingmessage_topic: (a: number, b: number, c: number)
63
63
  export const __wbg_ipccommunicationbackend_free: (a: number, b: number) => void;
64
64
  export const ipccommunicationbackend_new: (a: number) => number;
65
65
  export const ipccommunicationbackend_receive: (a: number, b: number, c: number) => void;
66
+ export const ipcRegisterDiscoverHandler: (a: number, b: number) => number;
67
+ export const ipcRequestDiscover: (a: number, b: number, c: number) => number;
66
68
  export const __wbg_ipcclient_free: (a: number, b: number) => void;
67
69
  export const __wbg_ipcclientsubscription_free: (a: number, b: number) => void;
68
70
  export const ipcclientsubscription_receive: (a: number, b: number) => number;
@@ -90,6 +92,7 @@ export const incomingmessage_new: (
90
92
  export const incomingmessage_parse_payload_as_json: (a: number) => number;
91
93
  export const isChannelError: (a: number) => number;
92
94
  export const isDeserializeError: (a: number) => number;
95
+ export const isRequestError: (a: number) => number;
93
96
  export const isTypedReceiveError: (a: number) => number;
94
97
  export const isReceiveError: (a: number) => number;
95
98
  export const isSubscribeError: (a: number) => number;