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

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.
@@ -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>;
@@ -869,6 +869,14 @@ function wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg
869
869
  wasm.wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1);
870
870
  }
871
871
 
872
+ function wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5(arg0, arg1, arg2) {
873
+ wasm.wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5(
874
+ arg0,
875
+ arg1,
876
+ addHeapObject(arg2),
877
+ );
878
+ }
879
+
872
880
  function wasm_bindgen__convert__closures_____invoke__he84e41ce162f03b8(arg0, arg1, arg2) {
873
881
  try {
874
882
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
@@ -888,14 +896,6 @@ function wasm_bindgen__convert__closures_____invoke__he84e41ce162f03b8(arg0, arg
888
896
  }
889
897
  }
890
898
 
891
- function wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5(arg0, arg1, arg2) {
892
- wasm.wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5(
893
- arg0,
894
- arg1,
895
- addHeapObject(arg2),
896
- );
897
- }
898
-
899
899
  function wasm_bindgen__convert__closures_____invoke__h4096c3b930b983e7(arg0, arg1, arg2, arg3) {
900
900
  wasm.wasm_bindgen__convert__closures_____invoke__h4096c3b930b983e7(
901
901
  arg0,
@@ -2853,6 +2853,14 @@ const IpcClientFinalization =
2853
2853
  * [IpcClient] documentation.
2854
2854
  */
2855
2855
  class IpcClient {
2856
+ static __wrap(ptr) {
2857
+ ptr = ptr >>> 0;
2858
+ const obj = Object.create(IpcClient.prototype);
2859
+ obj.__wbg_ptr = ptr;
2860
+ IpcClientFinalization.register(obj, obj.__wbg_ptr, obj);
2861
+ return obj;
2862
+ }
2863
+
2856
2864
  __destroy_into_raw() {
2857
2865
  const ptr = this.__wbg_ptr;
2858
2866
  this.__wbg_ptr = 0;
@@ -2865,14 +2873,30 @@ class IpcClient {
2865
2873
  wasm.__wbg_ipcclient_free(ptr, 0);
2866
2874
  }
2867
2875
  /**
2876
+ * Create a new `IpcClient` instance with an in-memory session repository for saving
2877
+ * sessions within the SDK.
2868
2878
  * @param {IpcCommunicationBackend} communication_provider
2879
+ * @returns {IpcClient}
2869
2880
  */
2870
- constructor(communication_provider) {
2881
+ static newWithSdkInMemorySessions(communication_provider) {
2871
2882
  _assertClass(communication_provider, IpcCommunicationBackend);
2872
- const ret = wasm.ipcclient_new(communication_provider.__wbg_ptr);
2873
- this.__wbg_ptr = ret >>> 0;
2874
- IpcClientFinalization.register(this, this.__wbg_ptr, this);
2875
- return this;
2883
+ const ret = wasm.ipcclient_newWithSdkInMemorySessions(communication_provider.__wbg_ptr);
2884
+ return IpcClient.__wrap(ret);
2885
+ }
2886
+ /**
2887
+ * Create a new `IpcClient` instance with a client-managed session repository for saving
2888
+ * sessions using State Provider.
2889
+ * @param {IpcCommunicationBackend} communication_provider
2890
+ * @param {IpcSessionRepository} session_repository
2891
+ * @returns {IpcClient}
2892
+ */
2893
+ static newWithClientManagedSessions(communication_provider, session_repository) {
2894
+ _assertClass(communication_provider, IpcCommunicationBackend);
2895
+ const ret = wasm.ipcclient_newWithClientManagedSessions(
2896
+ communication_provider.__wbg_ptr,
2897
+ addHeapObject(session_repository),
2898
+ );
2899
+ return IpcClient.__wrap(ret);
2876
2900
  }
2877
2901
  /**
2878
2902
  * @returns {Promise<void>}
@@ -4448,7 +4472,7 @@ exports.__wbg_call_e762c39fa8ea36bf = function () {
4448
4472
  }, arguments);
4449
4473
  };
4450
4474
 
4451
- exports.__wbg_cipher_90da44fade4d7231 = function (arg0) {
4475
+ exports.__wbg_cipher_eb520ade5d02e2c8 = function (arg0) {
4452
4476
  const ret = getObject(arg0).cipher;
4453
4477
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4454
4478
  };
@@ -4528,7 +4552,7 @@ exports.__wbg_fetch_f8ba0e29a9d6de0d = function (arg0, arg1) {
4528
4552
  return addHeapObject(ret);
4529
4553
  };
4530
4554
 
4531
- exports.__wbg_folder_1f9f19453de069bd = function (arg0) {
4555
+ exports.__wbg_folder_a9c369db22013424 = function (arg0) {
4532
4556
  const ret = getObject(arg0).folder;
4533
4557
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4534
4558
  };
@@ -4560,7 +4584,12 @@ exports.__wbg_get_7bed016f185add81 = function (arg0, arg1) {
4560
4584
  return addHeapObject(ret);
4561
4585
  };
4562
4586
 
4563
- exports.__wbg_get_905bbb36d78e816c = function () {
4587
+ exports.__wbg_get_access_token_2a6f3a7572a71513 = function (arg0) {
4588
+ const ret = getObject(arg0).get_access_token();
4589
+ return addHeapObject(ret);
4590
+ };
4591
+
4592
+ exports.__wbg_get_e964441f5ccb3c80 = function () {
4564
4593
  return handleError(function (arg0, arg1, arg2) {
4565
4594
  let deferred0_0;
4566
4595
  let deferred0_1;
@@ -4575,12 +4604,7 @@ exports.__wbg_get_905bbb36d78e816c = function () {
4575
4604
  }, arguments);
4576
4605
  };
4577
4606
 
4578
- exports.__wbg_get_access_token_fb7908159e830dff = function (arg0) {
4579
- const ret = getObject(arg0).get_access_token();
4580
- return addHeapObject(ret);
4581
- };
4582
-
4583
- exports.__wbg_get_eb8ca7ea2e1397a3 = function () {
4607
+ exports.__wbg_get_ec74c278e7438da5 = function () {
4584
4608
  return handleError(function (arg0, arg1, arg2) {
4585
4609
  let deferred0_0;
4586
4610
  let deferred0_1;
@@ -4782,14 +4806,14 @@ exports.__wbg_length_cdd215e10d9dd507 = function (arg0) {
4782
4806
  return ret;
4783
4807
  };
4784
4808
 
4785
- exports.__wbg_list_3ff9e942e0036bfb = function () {
4809
+ exports.__wbg_list_b8dfecdd2b65e61e = function () {
4786
4810
  return handleError(function (arg0) {
4787
4811
  const ret = getObject(arg0).list();
4788
4812
  return addHeapObject(ret);
4789
4813
  }, arguments);
4790
4814
  };
4791
4815
 
4792
- exports.__wbg_list_bdb6eec69b7ea3d2 = function () {
4816
+ exports.__wbg_list_daa32c63b02d85cb = function () {
4793
4817
  return handleError(function (arg0) {
4794
4818
  const ret = getObject(arg0).list();
4795
4819
  return addHeapObject(ret);
@@ -5004,7 +5028,7 @@ exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
5004
5028
  }, arguments);
5005
5029
  };
5006
5030
 
5007
- exports.__wbg_remove_33695adbdbc52a3e = function () {
5031
+ exports.__wbg_remove_3bf97e854da9e7c3 = function () {
5008
5032
  return handleError(function (arg0, arg1, arg2) {
5009
5033
  let deferred0_0;
5010
5034
  let deferred0_1;
@@ -5019,7 +5043,7 @@ exports.__wbg_remove_33695adbdbc52a3e = function () {
5019
5043
  }, arguments);
5020
5044
  };
5021
5045
 
5022
- exports.__wbg_remove_dc431ea3d4bc3b57 = function () {
5046
+ exports.__wbg_remove_be4a47406b9a0def = function () {
5023
5047
  return handleError(function (arg0, arg1, arg2) {
5024
5048
  let deferred0_0;
5025
5049
  let deferred0_1;
@@ -5065,7 +5089,7 @@ exports.__wbg_setTimeout_ca12ead8b48245e2 = function (arg0, arg1) {
5065
5089
  return addHeapObject(ret);
5066
5090
  };
5067
5091
 
5068
- exports.__wbg_set_33fa6c07f568d210 = function () {
5092
+ exports.__wbg_set_10039b2e1149cb0c = function () {
5069
5093
  return handleError(function (arg0, arg1, arg2, arg3) {
5070
5094
  let deferred0_0;
5071
5095
  let deferred0_1;
@@ -5084,21 +5108,6 @@ exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
5084
5108
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
5085
5109
  };
5086
5110
 
5087
- exports.__wbg_set_9006732dd4d65e3c = function () {
5088
- return handleError(function (arg0, arg1, arg2, arg3) {
5089
- let deferred0_0;
5090
- let deferred0_1;
5091
- try {
5092
- deferred0_0 = arg1;
5093
- deferred0_1 = arg2;
5094
- const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
5095
- return addHeapObject(ret);
5096
- } finally {
5097
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5098
- }
5099
- }, arguments);
5100
- };
5101
-
5102
5111
  exports.__wbg_set_907fb406c34a251d = function (arg0, arg1, arg2) {
5103
5112
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
5104
5113
  return addHeapObject(ret);
@@ -5116,6 +5125,21 @@ exports.__wbg_set_credentials_f621cd2d85c0c228 = function (arg0, arg1) {
5116
5125
  getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
5117
5126
  };
5118
5127
 
5128
+ exports.__wbg_set_f2f0abdffceab618 = function () {
5129
+ return handleError(function (arg0, arg1, arg2, arg3) {
5130
+ let deferred0_0;
5131
+ let deferred0_1;
5132
+ try {
5133
+ deferred0_0 = arg1;
5134
+ deferred0_1 = arg2;
5135
+ const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
5136
+ return addHeapObject(ret);
5137
+ } finally {
5138
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5139
+ }
5140
+ }, arguments);
5141
+ };
5142
+
5119
5143
  exports.__wbg_set_headers_6926da238cd32ee4 = function (arg0, arg1) {
5120
5144
  getObject(arg0).headers = getObject(arg1);
5121
5145
  };
@@ -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;
@@ -435,20 +436,20 @@ export const wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01: (
435
436
  a: number,
436
437
  b: number,
437
438
  ) => void;
438
- export const wasm_bindgen__closure__destroy__h1cce7ce4a094839d: (a: number, b: number) => void;
439
439
  export const wasm_bindgen__closure__destroy__h04ff7fddf688fec6: (a: number, b: number) => void;
440
- export const wasm_bindgen__convert__closures_____invoke__he84e41ce162f03b8: (
440
+ export const wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5: (
441
441
  a: number,
442
442
  b: number,
443
443
  c: number,
444
- d: number,
445
444
  ) => void;
446
445
  export const wasm_bindgen__closure__destroy__h7a400a8c6869e00b: (a: number, b: number) => void;
447
- export const wasm_bindgen__convert__closures_____invoke__h142f80da75ccedf5: (
446
+ export const wasm_bindgen__convert__closures_____invoke__he84e41ce162f03b8: (
448
447
  a: number,
449
448
  b: number,
450
449
  c: number,
450
+ d: number,
451
451
  ) => void;
452
+ export const wasm_bindgen__closure__destroy__h1cce7ce4a094839d: (a: number, b: number) => void;
452
453
  export const wasm_bindgen__convert__closures_____invoke__h4096c3b930b983e7: (
453
454
  a: number,
454
455
  b: number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/sdk-internal",
3
- "version": "0.2.0-main.374",
3
+ "version": "0.2.0-main.375",
4
4
  "license": "GPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",