@bitwarden/sdk-internal 0.2.0-main.374 → 0.2.0-main.376

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
- c60a5d794732d2c0fc203feb21ce5851d5325fe1
1
+ 5052afde96ab02e275a94e7975d696715e34c843
@@ -974,6 +974,12 @@ export interface IpcCommunicationBackendSender {
974
974
  send(message: OutgoingMessage): Promise<void>;
975
975
  }
976
976
 
977
+ export interface IpcSessionRepository {
978
+ get(endpoint: Endpoint): Promise<any | undefined>;
979
+ save(endpoint: Endpoint, session: any): Promise<void>;
980
+ remove(endpoint: Endpoint): Promise<void>;
981
+ }
982
+
977
983
  export interface ChannelError extends Error {
978
984
  name: "ChannelError";
979
985
  }
@@ -2222,9 +2228,22 @@ export class IncomingMessage {
2222
2228
  * [IpcClient] documentation.
2223
2229
  */
2224
2230
  export class IpcClient {
2231
+ private constructor();
2225
2232
  free(): void;
2226
2233
  [Symbol.dispose](): void;
2227
- constructor(communication_provider: IpcCommunicationBackend);
2234
+ /**
2235
+ * Create a new `IpcClient` instance with an in-memory session repository for saving
2236
+ * sessions within the SDK.
2237
+ */
2238
+ static newWithSdkInMemorySessions(communication_provider: IpcCommunicationBackend): IpcClient;
2239
+ /**
2240
+ * Create a new `IpcClient` instance with a client-managed session repository for saving
2241
+ * sessions using State Provider.
2242
+ */
2243
+ static newWithClientManagedSessions(
2244
+ communication_provider: IpcCommunicationBackend,
2245
+ session_repository: IpcSessionRepository,
2246
+ ): IpcClient;
2228
2247
  start(): Promise<void>;
2229
2248
  isRunning(): Promise<boolean>;
2230
2249
  send(message: OutgoingMessage): Promise<void>;
@@ -875,6 +875,10 @@ export function isEncryptFileError(error) {
875
875
  }
876
876
  }
877
877
 
878
+ function wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1) {
879
+ wasm.wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1);
880
+ }
881
+
878
882
  function wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5(arg0, arg1, arg2) {
879
883
  wasm.wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5(
880
884
  arg0,
@@ -883,10 +887,6 @@ function wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5(arg0, arg
883
887
  );
884
888
  }
885
889
 
886
- function wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1) {
887
- wasm.wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1);
888
- }
889
-
890
890
  function wasm_bindgen__convert__closures_____invoke__he84e41ce162f03b8(arg0, arg1, arg2) {
891
891
  try {
892
892
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
@@ -2835,6 +2835,14 @@ const IpcClientFinalization =
2835
2835
  * [IpcClient] documentation.
2836
2836
  */
2837
2837
  export class IpcClient {
2838
+ static __wrap(ptr) {
2839
+ ptr = ptr >>> 0;
2840
+ const obj = Object.create(IpcClient.prototype);
2841
+ obj.__wbg_ptr = ptr;
2842
+ IpcClientFinalization.register(obj, obj.__wbg_ptr, obj);
2843
+ return obj;
2844
+ }
2845
+
2838
2846
  __destroy_into_raw() {
2839
2847
  const ptr = this.__wbg_ptr;
2840
2848
  this.__wbg_ptr = 0;
@@ -2847,14 +2855,30 @@ export class IpcClient {
2847
2855
  wasm.__wbg_ipcclient_free(ptr, 0);
2848
2856
  }
2849
2857
  /**
2858
+ * Create a new `IpcClient` instance with an in-memory session repository for saving
2859
+ * sessions within the SDK.
2850
2860
  * @param {IpcCommunicationBackend} communication_provider
2861
+ * @returns {IpcClient}
2851
2862
  */
2852
- constructor(communication_provider) {
2863
+ static newWithSdkInMemorySessions(communication_provider) {
2853
2864
  _assertClass(communication_provider, IpcCommunicationBackend);
2854
- const ret = wasm.ipcclient_new(communication_provider.__wbg_ptr);
2855
- this.__wbg_ptr = ret >>> 0;
2856
- IpcClientFinalization.register(this, this.__wbg_ptr, this);
2857
- return this;
2865
+ const ret = wasm.ipcclient_newWithSdkInMemorySessions(communication_provider.__wbg_ptr);
2866
+ return IpcClient.__wrap(ret);
2867
+ }
2868
+ /**
2869
+ * Create a new `IpcClient` instance with a client-managed session repository for saving
2870
+ * sessions using State Provider.
2871
+ * @param {IpcCommunicationBackend} communication_provider
2872
+ * @param {IpcSessionRepository} session_repository
2873
+ * @returns {IpcClient}
2874
+ */
2875
+ static newWithClientManagedSessions(communication_provider, session_repository) {
2876
+ _assertClass(communication_provider, IpcCommunicationBackend);
2877
+ const ret = wasm.ipcclient_newWithClientManagedSessions(
2878
+ communication_provider.__wbg_ptr,
2879
+ addHeapObject(session_repository),
2880
+ );
2881
+ return IpcClient.__wrap(ret);
2858
2882
  }
2859
2883
  /**
2860
2884
  * @returns {Promise<void>}
@@ -4410,7 +4434,7 @@ export function __wbg_call_e762c39fa8ea36bf() {
4410
4434
  }, arguments);
4411
4435
  }
4412
4436
 
4413
- export function __wbg_cipher_90da44fade4d7231(arg0) {
4437
+ export function __wbg_cipher_9701deafaff968bd(arg0) {
4414
4438
  const ret = getObject(arg0).cipher;
4415
4439
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4416
4440
  }
@@ -4490,7 +4514,7 @@ export function __wbg_fetch_f8ba0e29a9d6de0d(arg0, arg1) {
4490
4514
  return addHeapObject(ret);
4491
4515
  }
4492
4516
 
4493
- export function __wbg_folder_1f9f19453de069bd(arg0) {
4517
+ export function __wbg_folder_0ac974e0faeac5a3(arg0) {
4494
4518
  const ret = getObject(arg0).folder;
4495
4519
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4496
4520
  }
@@ -4517,12 +4541,7 @@ export function __wbg_getTime_14776bfb48a1bff9(arg0) {
4517
4541
  return ret;
4518
4542
  }
4519
4543
 
4520
- export function __wbg_get_7bed016f185add81(arg0, arg1) {
4521
- const ret = getObject(arg0)[arg1 >>> 0];
4522
- return addHeapObject(ret);
4523
- }
4524
-
4525
- export function __wbg_get_905bbb36d78e816c() {
4544
+ export function __wbg_get_18698e0d6fcbb417() {
4526
4545
  return handleError(function (arg0, arg1, arg2) {
4527
4546
  let deferred0_0;
4528
4547
  let deferred0_1;
@@ -4537,12 +4556,7 @@ export function __wbg_get_905bbb36d78e816c() {
4537
4556
  }, arguments);
4538
4557
  }
4539
4558
 
4540
- export function __wbg_get_access_token_fb7908159e830dff(arg0) {
4541
- const ret = getObject(arg0).get_access_token();
4542
- return addHeapObject(ret);
4543
- }
4544
-
4545
- export function __wbg_get_eb8ca7ea2e1397a3() {
4559
+ export function __wbg_get_30883f9918eff6a9() {
4546
4560
  return handleError(function (arg0, arg1, arg2) {
4547
4561
  let deferred0_0;
4548
4562
  let deferred0_1;
@@ -4557,6 +4571,16 @@ export function __wbg_get_eb8ca7ea2e1397a3() {
4557
4571
  }, arguments);
4558
4572
  }
4559
4573
 
4574
+ export function __wbg_get_7bed016f185add81(arg0, arg1) {
4575
+ const ret = getObject(arg0)[arg1 >>> 0];
4576
+ return addHeapObject(ret);
4577
+ }
4578
+
4579
+ export function __wbg_get_access_token_22d89957129b443b(arg0) {
4580
+ const ret = getObject(arg0).get_access_token();
4581
+ return addHeapObject(ret);
4582
+ }
4583
+
4560
4584
  export function __wbg_get_efcb449f58ec27c2() {
4561
4585
  return handleError(function (arg0, arg1) {
4562
4586
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
@@ -4744,14 +4768,14 @@ export function __wbg_length_cdd215e10d9dd507(arg0) {
4744
4768
  return ret;
4745
4769
  }
4746
4770
 
4747
- export function __wbg_list_3ff9e942e0036bfb() {
4771
+ export function __wbg_list_0eee12d125e84f59() {
4748
4772
  return handleError(function (arg0) {
4749
4773
  const ret = getObject(arg0).list();
4750
4774
  return addHeapObject(ret);
4751
4775
  }, arguments);
4752
4776
  }
4753
4777
 
4754
- export function __wbg_list_bdb6eec69b7ea3d2() {
4778
+ export function __wbg_list_7695393584d6a69b() {
4755
4779
  return handleError(function (arg0) {
4756
4780
  const ret = getObject(arg0).list();
4757
4781
  return addHeapObject(ret);
@@ -4966,7 +4990,7 @@ export function __wbg_randomFillSync_ac0988aba3254290() {
4966
4990
  }, arguments);
4967
4991
  }
4968
4992
 
4969
- export function __wbg_remove_33695adbdbc52a3e() {
4993
+ export function __wbg_remove_8b189a6fd3dcbfd4() {
4970
4994
  return handleError(function (arg0, arg1, arg2) {
4971
4995
  let deferred0_0;
4972
4996
  let deferred0_1;
@@ -4981,7 +5005,7 @@ export function __wbg_remove_33695adbdbc52a3e() {
4981
5005
  }, arguments);
4982
5006
  }
4983
5007
 
4984
- export function __wbg_remove_dc431ea3d4bc3b57() {
5008
+ export function __wbg_remove_b53fd6b594257783() {
4985
5009
  return handleError(function (arg0, arg1, arg2) {
4986
5010
  let deferred0_0;
4987
5011
  let deferred0_1;
@@ -5027,7 +5051,7 @@ export function __wbg_setTimeout_ca12ead8b48245e2(arg0, arg1) {
5027
5051
  return addHeapObject(ret);
5028
5052
  }
5029
5053
 
5030
- export function __wbg_set_33fa6c07f568d210() {
5054
+ export function __wbg_set_2b24ea7b5665d88e() {
5031
5055
  return handleError(function (arg0, arg1, arg2, arg3) {
5032
5056
  let deferred0_0;
5033
5057
  let deferred0_1;
@@ -5046,7 +5070,7 @@ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
5046
5070
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
5047
5071
  }
5048
5072
 
5049
- export function __wbg_set_9006732dd4d65e3c() {
5073
+ export function __wbg_set_685d7b8ddf2c6d23() {
5050
5074
  return handleError(function (arg0, arg1, arg2, arg3) {
5051
5075
  let deferred0_0;
5052
5076
  let deferred0_1;
Binary file
@@ -276,7 +276,8 @@ export const ipcRequestDiscover: (a: number, b: number, c: number) => number;
276
276
  export const __wbg_ipcclient_free: (a: number, b: number) => void;
277
277
  export const __wbg_ipcclientsubscription_free: (a: number, b: number) => void;
278
278
  export const ipcclientsubscription_receive: (a: number, b: number) => number;
279
- export const ipcclient_new: (a: number) => number;
279
+ export const ipcclient_newWithSdkInMemorySessions: (a: number) => number;
280
+ export const ipcclient_newWithClientManagedSessions: (a: number, b: number) => number;
280
281
  export const ipcclient_start: (a: number) => number;
281
282
  export const ipcclient_isRunning: (a: number) => number;
282
283
  export const ipcclient_send: (a: number, b: number) => number;
@@ -431,15 +432,15 @@ export const __wbg_totpclient_free: (a: number, b: number) => void;
431
432
  export const __wbg_get_outgoingmessage_destination: (a: number) => number;
432
433
  export const __wbg_set_outgoingmessage_destination: (a: number, b: number) => void;
433
434
  export const __wbg_cryptoclient_free: (a: number, b: number) => void;
434
- export const wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5: (
435
+ export const wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01: (
435
436
  a: number,
436
437
  b: number,
437
- c: number,
438
438
  ) => void;
439
439
  export const wasm_bindgen__closure__destroy__h04ff7fddf688fec6: (a: number, b: number) => void;
440
- export const wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01: (
440
+ export const wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5: (
441
441
  a: number,
442
442
  b: number,
443
+ c: number,
443
444
  ) => void;
444
445
  export const wasm_bindgen__closure__destroy__h7a400a8c6869e00b: (a: number, b: number) => void;
445
446
  export const wasm_bindgen__convert__closures_____invoke__he84e41ce162f03b8: (