@bitwarden/commercial-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
  }
@@ -2243,9 +2249,22 @@ export class IncomingMessage {
2243
2249
  * [IpcClient] documentation.
2244
2250
  */
2245
2251
  export class IpcClient {
2252
+ private constructor();
2246
2253
  free(): void;
2247
2254
  [Symbol.dispose](): void;
2248
- constructor(communication_provider: IpcCommunicationBackend);
2255
+ /**
2256
+ * Create a new `IpcClient` instance with an in-memory session repository for saving
2257
+ * sessions within the SDK.
2258
+ */
2259
+ static newWithSdkInMemorySessions(communication_provider: IpcCommunicationBackend): IpcClient;
2260
+ /**
2261
+ * Create a new `IpcClient` instance with a client-managed session repository for saving
2262
+ * sessions using State Provider.
2263
+ */
2264
+ static newWithClientManagedSessions(
2265
+ communication_provider: IpcCommunicationBackend,
2266
+ session_repository: IpcSessionRepository,
2267
+ ): IpcClient;
2249
2268
  start(): Promise<void>;
2250
2269
  isRunning(): Promise<boolean>;
2251
2270
  send(message: OutgoingMessage): Promise<void>;
@@ -865,18 +865,6 @@ exports.isEncryptFileError = function (error) {
865
865
  }
866
866
  };
867
867
 
868
- function wasm_bindgen__convert__closures_____invoke__h4f8d9ba9b5b9a009(arg0, arg1, arg2) {
869
- wasm.wasm_bindgen__convert__closures_____invoke__h4f8d9ba9b5b9a009(
870
- arg0,
871
- arg1,
872
- addHeapObject(arg2),
873
- );
874
- }
875
-
876
- function wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1) {
877
- wasm.wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1);
878
- }
879
-
880
868
  function wasm_bindgen__convert__closures_____invoke__hf869d8564f5adb52(arg0, arg1, arg2) {
881
869
  try {
882
870
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
@@ -896,6 +884,18 @@ function wasm_bindgen__convert__closures_____invoke__hf869d8564f5adb52(arg0, arg
896
884
  }
897
885
  }
898
886
 
887
+ function wasm_bindgen__convert__closures_____invoke__h4f8d9ba9b5b9a009(arg0, arg1, arg2) {
888
+ wasm.wasm_bindgen__convert__closures_____invoke__h4f8d9ba9b5b9a009(
889
+ arg0,
890
+ arg1,
891
+ addHeapObject(arg2),
892
+ );
893
+ }
894
+
895
+ function wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1) {
896
+ wasm.wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01(arg0, arg1);
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,
@@ -2936,6 +2936,14 @@ const IpcClientFinalization =
2936
2936
  * [IpcClient] documentation.
2937
2937
  */
2938
2938
  class IpcClient {
2939
+ static __wrap(ptr) {
2940
+ ptr = ptr >>> 0;
2941
+ const obj = Object.create(IpcClient.prototype);
2942
+ obj.__wbg_ptr = ptr;
2943
+ IpcClientFinalization.register(obj, obj.__wbg_ptr, obj);
2944
+ return obj;
2945
+ }
2946
+
2939
2947
  __destroy_into_raw() {
2940
2948
  const ptr = this.__wbg_ptr;
2941
2949
  this.__wbg_ptr = 0;
@@ -2948,14 +2956,30 @@ class IpcClient {
2948
2956
  wasm.__wbg_ipcclient_free(ptr, 0);
2949
2957
  }
2950
2958
  /**
2959
+ * Create a new `IpcClient` instance with an in-memory session repository for saving
2960
+ * sessions within the SDK.
2951
2961
  * @param {IpcCommunicationBackend} communication_provider
2962
+ * @returns {IpcClient}
2952
2963
  */
2953
- constructor(communication_provider) {
2964
+ static newWithSdkInMemorySessions(communication_provider) {
2954
2965
  _assertClass(communication_provider, IpcCommunicationBackend);
2955
- const ret = wasm.ipcclient_new(communication_provider.__wbg_ptr);
2956
- this.__wbg_ptr = ret >>> 0;
2957
- IpcClientFinalization.register(this, this.__wbg_ptr, this);
2958
- return this;
2966
+ const ret = wasm.ipcclient_newWithSdkInMemorySessions(communication_provider.__wbg_ptr);
2967
+ return IpcClient.__wrap(ret);
2968
+ }
2969
+ /**
2970
+ * Create a new `IpcClient` instance with a client-managed session repository for saving
2971
+ * sessions using State Provider.
2972
+ * @param {IpcCommunicationBackend} communication_provider
2973
+ * @param {IpcSessionRepository} session_repository
2974
+ * @returns {IpcClient}
2975
+ */
2976
+ static newWithClientManagedSessions(communication_provider, session_repository) {
2977
+ _assertClass(communication_provider, IpcCommunicationBackend);
2978
+ const ret = wasm.ipcclient_newWithClientManagedSessions(
2979
+ communication_provider.__wbg_ptr,
2980
+ addHeapObject(session_repository),
2981
+ );
2982
+ return IpcClient.__wrap(ret);
2959
2983
  }
2960
2984
  /**
2961
2985
  * @returns {Promise<void>}
@@ -4531,7 +4555,7 @@ exports.__wbg_call_e762c39fa8ea36bf = function () {
4531
4555
  }, arguments);
4532
4556
  };
4533
4557
 
4534
- exports.__wbg_cipher_90da44fade4d7231 = function (arg0) {
4558
+ exports.__wbg_cipher_eb520ade5d02e2c8 = function (arg0) {
4535
4559
  const ret = getObject(arg0).cipher;
4536
4560
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4537
4561
  };
@@ -4611,7 +4635,7 @@ exports.__wbg_fetch_f8ba0e29a9d6de0d = function (arg0, arg1) {
4611
4635
  return addHeapObject(ret);
4612
4636
  };
4613
4637
 
4614
- exports.__wbg_folder_1f9f19453de069bd = function (arg0) {
4638
+ exports.__wbg_folder_a9c369db22013424 = function (arg0) {
4615
4639
  const ret = getObject(arg0).folder;
4616
4640
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4617
4641
  };
@@ -4643,7 +4667,12 @@ exports.__wbg_get_7bed016f185add81 = function (arg0, arg1) {
4643
4667
  return addHeapObject(ret);
4644
4668
  };
4645
4669
 
4646
- exports.__wbg_get_905bbb36d78e816c = function () {
4670
+ exports.__wbg_get_access_token_2a6f3a7572a71513 = function (arg0) {
4671
+ const ret = getObject(arg0).get_access_token();
4672
+ return addHeapObject(ret);
4673
+ };
4674
+
4675
+ exports.__wbg_get_e964441f5ccb3c80 = function () {
4647
4676
  return handleError(function (arg0, arg1, arg2) {
4648
4677
  let deferred0_0;
4649
4678
  let deferred0_1;
@@ -4658,12 +4687,7 @@ exports.__wbg_get_905bbb36d78e816c = function () {
4658
4687
  }, arguments);
4659
4688
  };
4660
4689
 
4661
- exports.__wbg_get_access_token_fb7908159e830dff = function (arg0) {
4662
- const ret = getObject(arg0).get_access_token();
4663
- return addHeapObject(ret);
4664
- };
4665
-
4666
- exports.__wbg_get_eb8ca7ea2e1397a3 = function () {
4690
+ exports.__wbg_get_ec74c278e7438da5 = function () {
4667
4691
  return handleError(function (arg0, arg1, arg2) {
4668
4692
  let deferred0_0;
4669
4693
  let deferred0_1;
@@ -4865,14 +4889,14 @@ exports.__wbg_length_cdd215e10d9dd507 = function (arg0) {
4865
4889
  return ret;
4866
4890
  };
4867
4891
 
4868
- exports.__wbg_list_3ff9e942e0036bfb = function () {
4892
+ exports.__wbg_list_b8dfecdd2b65e61e = function () {
4869
4893
  return handleError(function (arg0) {
4870
4894
  const ret = getObject(arg0).list();
4871
4895
  return addHeapObject(ret);
4872
4896
  }, arguments);
4873
4897
  };
4874
4898
 
4875
- exports.__wbg_list_bdb6eec69b7ea3d2 = function () {
4899
+ exports.__wbg_list_daa32c63b02d85cb = function () {
4876
4900
  return handleError(function (arg0) {
4877
4901
  const ret = getObject(arg0).list();
4878
4902
  return addHeapObject(ret);
@@ -5087,7 +5111,7 @@ exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
5087
5111
  }, arguments);
5088
5112
  };
5089
5113
 
5090
- exports.__wbg_remove_33695adbdbc52a3e = function () {
5114
+ exports.__wbg_remove_3bf97e854da9e7c3 = function () {
5091
5115
  return handleError(function (arg0, arg1, arg2) {
5092
5116
  let deferred0_0;
5093
5117
  let deferred0_1;
@@ -5102,7 +5126,7 @@ exports.__wbg_remove_33695adbdbc52a3e = function () {
5102
5126
  }, arguments);
5103
5127
  };
5104
5128
 
5105
- exports.__wbg_remove_dc431ea3d4bc3b57 = function () {
5129
+ exports.__wbg_remove_be4a47406b9a0def = function () {
5106
5130
  return handleError(function (arg0, arg1, arg2) {
5107
5131
  let deferred0_0;
5108
5132
  let deferred0_1;
@@ -5148,7 +5172,7 @@ exports.__wbg_setTimeout_ca12ead8b48245e2 = function (arg0, arg1) {
5148
5172
  return addHeapObject(ret);
5149
5173
  };
5150
5174
 
5151
- exports.__wbg_set_33fa6c07f568d210 = function () {
5175
+ exports.__wbg_set_10039b2e1149cb0c = function () {
5152
5176
  return handleError(function (arg0, arg1, arg2, arg3) {
5153
5177
  let deferred0_0;
5154
5178
  let deferred0_1;
@@ -5167,21 +5191,6 @@ exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
5167
5191
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
5168
5192
  };
5169
5193
 
5170
- exports.__wbg_set_9006732dd4d65e3c = function () {
5171
- return handleError(function (arg0, arg1, arg2, arg3) {
5172
- let deferred0_0;
5173
- let deferred0_1;
5174
- try {
5175
- deferred0_0 = arg1;
5176
- deferred0_1 = arg2;
5177
- const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
5178
- return addHeapObject(ret);
5179
- } finally {
5180
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5181
- }
5182
- }, arguments);
5183
- };
5184
-
5185
5194
  exports.__wbg_set_907fb406c34a251d = function (arg0, arg1, arg2) {
5186
5195
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
5187
5196
  return addHeapObject(ret);
@@ -5199,6 +5208,21 @@ exports.__wbg_set_credentials_f621cd2d85c0c228 = function (arg0, arg1) {
5199
5208
  getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
5200
5209
  };
5201
5210
 
5211
+ exports.__wbg_set_f2f0abdffceab618 = function () {
5212
+ return handleError(function (arg0, arg1, arg2, arg3) {
5213
+ let deferred0_0;
5214
+ let deferred0_1;
5215
+ try {
5216
+ deferred0_0 = arg1;
5217
+ deferred0_1 = arg2;
5218
+ const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
5219
+ return addHeapObject(ret);
5220
+ } finally {
5221
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5222
+ }
5223
+ }, arguments);
5224
+ };
5225
+
5202
5226
  exports.__wbg_set_headers_6926da238cd32ee4 = function (arg0, arg1) {
5203
5227
  getObject(arg0).headers = getObject(arg1);
5204
5228
  };
@@ -278,7 +278,8 @@ export const ipcRequestDiscover: (a: number, b: number, c: number) => number;
278
278
  export const __wbg_ipcclient_free: (a: number, b: number) => void;
279
279
  export const __wbg_ipcclientsubscription_free: (a: number, b: number) => void;
280
280
  export const ipcclientsubscription_receive: (a: number, b: number) => number;
281
- export const ipcclient_new: (a: number) => number;
281
+ export const ipcclient_newWithSdkInMemorySessions: (a: number) => number;
282
+ export const ipcclient_newWithClientManagedSessions: (a: number, b: number) => number;
282
283
  export const ipcclient_start: (a: number) => number;
283
284
  export const ipcclient_isRunning: (a: number) => number;
284
285
  export const ipcclient_send: (a: number, b: number) => number;
@@ -435,24 +436,24 @@ export const __wbg_totpclient_free: (a: number, b: number) => void;
435
436
  export const __wbg_get_outgoingmessage_destination: (a: number) => number;
436
437
  export const __wbg_set_outgoingmessage_destination: (a: number, b: number) => void;
437
438
  export const __wbg_cryptoclient_free: (a: number, b: number) => void;
438
- export const wasm_bindgen__convert__closures_____invoke__h4f8d9ba9b5b9a009: (
439
+ export const wasm_bindgen__convert__closures_____invoke__hf869d8564f5adb52: (
439
440
  a: number,
440
441
  b: number,
441
442
  c: number,
443
+ d: number,
442
444
  ) => void;
443
445
  export const wasm_bindgen__closure__destroy__h7b7f88151484c167: (a: number, b: number) => void;
444
- export const wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01: (
446
+ export const wasm_bindgen__convert__closures_____invoke__h4f8d9ba9b5b9a009: (
445
447
  a: number,
446
448
  b: number,
449
+ c: number,
447
450
  ) => void;
448
451
  export const wasm_bindgen__closure__destroy__h04ff7fddf688fec6: (a: number, b: number) => void;
449
- export const wasm_bindgen__closure__destroy__h1cce7ce4a094839d: (a: number, b: number) => void;
450
- export const wasm_bindgen__convert__closures_____invoke__hf869d8564f5adb52: (
452
+ export const wasm_bindgen__convert__closures_____invoke__h76c71c1158b6af01: (
451
453
  a: number,
452
454
  b: number,
453
- c: number,
454
- d: number,
455
455
  ) => void;
456
+ export const wasm_bindgen__closure__destroy__h1cce7ce4a094839d: (a: number, b: number) => void;
456
457
  export const wasm_bindgen__convert__closures_____invoke__h4096c3b930b983e7: (
457
458
  a: number,
458
459
  b: number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/commercial-sdk-internal",
3
- "version": "0.2.0-main.374",
3
+ "version": "0.2.0-main.375",
4
4
  "license": "BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT",
5
5
  "repository": {
6
6
  "type": "git",