@bitwarden/sdk-internal 0.2.0-main.277 → 0.2.0-main.278

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.
@@ -449,6 +449,13 @@ export type OrganizationId = Tagged<Uuid, "OrganizationId">;
449
449
  */
450
450
  export type PasswordProtectedKeyEnvelope = Tagged<string, "PasswordProtectedKeyEnvelope">;
451
451
 
452
+ export interface MasterPasswordError extends Error {
453
+ name: "MasterPasswordError";
454
+ variant: "EncryptionKeyMalformed" | "KdfMalformed" | "MissingField";
455
+ }
456
+
457
+ export function isMasterPasswordError(error: any): error is MasterPasswordError;
458
+
452
459
  export interface DeriveKeyConnectorError extends Error {
453
460
  name: "DeriveKeyConnectorError";
454
461
  variant: "WrongPassword" | "Crypto";
@@ -358,6 +358,19 @@ module.exports.isCollectionDecryptError = function (error) {
358
358
  }
359
359
  };
360
360
 
361
+ /**
362
+ * @param {any} error
363
+ * @returns {boolean}
364
+ */
365
+ module.exports.isMasterPasswordError = function (error) {
366
+ try {
367
+ const ret = wasm.isMasterPasswordError(addBorrowedObject(error));
368
+ return ret !== 0;
369
+ } finally {
370
+ heap[stack_pointer++] = undefined;
371
+ }
372
+ };
373
+
361
374
  /**
362
375
  * @param {any} error
363
376
  * @returns {boolean}
@@ -803,7 +816,7 @@ function __wbg_adapter_59(arg0, arg1, arg2) {
803
816
  );
804
817
  }
805
818
 
806
- function __wbg_adapter_326(arg0, arg1, arg2, arg3) {
819
+ function __wbg_adapter_327(arg0, arg1, arg2, arg3) {
807
820
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h54a8613170fef18e(
808
821
  arg0,
809
822
  arg1,
@@ -3990,7 +4003,7 @@ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
3990
4003
  return ret;
3991
4004
  };
3992
4005
 
3993
- module.exports.__wbg_get_14cdc39c31ffe1da = function () {
4006
+ module.exports.__wbg_get_5ba7fe45e71ba65c = function () {
3994
4007
  return handleError(function (arg0, arg1, arg2) {
3995
4008
  let deferred0_0;
3996
4009
  let deferred0_1;
@@ -4012,7 +4025,12 @@ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
4012
4025
  }, arguments);
4013
4026
  };
4014
4027
 
4015
- module.exports.__wbg_get_96e6d3bbee08db28 = function () {
4028
+ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
4029
+ const ret = getObject(arg0)[arg1 >>> 0];
4030
+ return addHeapObject(ret);
4031
+ };
4032
+
4033
+ module.exports.__wbg_get_df7e5d864ed1c406 = function () {
4016
4034
  return handleError(function (arg0, arg1, arg2) {
4017
4035
  let deferred0_0;
4018
4036
  let deferred0_1;
@@ -4027,12 +4045,7 @@ module.exports.__wbg_get_96e6d3bbee08db28 = function () {
4027
4045
  }, arguments);
4028
4046
  };
4029
4047
 
4030
- module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
4031
- const ret = getObject(arg0)[arg1 >>> 0];
4032
- return addHeapObject(ret);
4033
- };
4034
-
4035
- module.exports.__wbg_getaccesstoken_2e3ceda8e23b2f45 = function (arg0) {
4048
+ module.exports.__wbg_getaccesstoken_079c6825c84e2ed9 = function (arg0) {
4036
4049
  const ret = getObject(arg0).get_access_token();
4037
4050
  return addHeapObject(ret);
4038
4051
  };
@@ -4137,14 +4150,14 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
4137
4150
  return ret;
4138
4151
  };
4139
4152
 
4140
- module.exports.__wbg_list_25000042a6bea514 = function () {
4153
+ module.exports.__wbg_list_20cbeecca69c3b14 = function () {
4141
4154
  return handleError(function (arg0) {
4142
4155
  const ret = getObject(arg0).list();
4143
4156
  return addHeapObject(ret);
4144
4157
  }, arguments);
4145
4158
  };
4146
4159
 
4147
- module.exports.__wbg_list_6605456966a5ab2f = function () {
4160
+ module.exports.__wbg_list_53faab1c4aa1b122 = function () {
4148
4161
  return handleError(function (arg0) {
4149
4162
  const ret = getObject(arg0).list();
4150
4163
  return addHeapObject(ret);
@@ -4179,7 +4192,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
4179
4192
  const a = state0.a;
4180
4193
  state0.a = 0;
4181
4194
  try {
4182
- return __wbg_adapter_326(a, state0.b, arg0, arg1);
4195
+ return __wbg_adapter_327(a, state0.b, arg0, arg1);
4183
4196
  } finally {
4184
4197
  state0.a = a;
4185
4198
  }
@@ -4326,7 +4339,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
4326
4339
  }, arguments);
4327
4340
  };
4328
4341
 
4329
- module.exports.__wbg_remove_c186bc3d34ae82cb = function () {
4342
+ module.exports.__wbg_remove_295d65307335485a = function () {
4330
4343
  return handleError(function (arg0, arg1, arg2) {
4331
4344
  let deferred0_0;
4332
4345
  let deferred0_1;
@@ -4341,7 +4354,7 @@ module.exports.__wbg_remove_c186bc3d34ae82cb = function () {
4341
4354
  }, arguments);
4342
4355
  };
4343
4356
 
4344
- module.exports.__wbg_remove_ce852f919130cb27 = function () {
4357
+ module.exports.__wbg_remove_73171861626d963c = function () {
4345
4358
  return handleError(function (arg0, arg1, arg2) {
4346
4359
  let deferred0_0;
4347
4360
  let deferred0_1;
@@ -4380,6 +4393,21 @@ module.exports.__wbg_setTimeout_ca12ead8b48245e2 = function (arg0, arg1) {
4380
4393
  return addHeapObject(ret);
4381
4394
  };
4382
4395
 
4396
+ module.exports.__wbg_set_2d113a1bd16aab72 = function () {
4397
+ return handleError(function (arg0, arg1, arg2, arg3) {
4398
+ let deferred0_0;
4399
+ let deferred0_1;
4400
+ try {
4401
+ deferred0_0 = arg1;
4402
+ deferred0_1 = arg2;
4403
+ const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
4404
+ return addHeapObject(ret);
4405
+ } finally {
4406
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
4407
+ }
4408
+ }, arguments);
4409
+ };
4410
+
4383
4411
  module.exports.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
4384
4412
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4385
4413
  };
@@ -4392,7 +4420,7 @@ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
4392
4420
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4393
4421
  };
4394
4422
 
4395
- module.exports.__wbg_set_86472e59f03f0218 = function () {
4423
+ module.exports.__wbg_set_7b858e538c6e10eb = function () {
4396
4424
  return handleError(function (arg0, arg1, arg2, arg3) {
4397
4425
  let deferred0_0;
4398
4426
  let deferred0_1;
@@ -4412,21 +4440,6 @@ module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
4412
4440
  return addHeapObject(ret);
4413
4441
  };
4414
4442
 
4415
- module.exports.__wbg_set_e1981082a2111fd6 = function () {
4416
- return handleError(function (arg0, arg1, arg2, arg3) {
4417
- let deferred0_0;
4418
- let deferred0_1;
4419
- try {
4420
- deferred0_0 = arg1;
4421
- deferred0_1 = arg2;
4422
- const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
4423
- return addHeapObject(ret);
4424
- } finally {
4425
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
4426
- }
4427
- }, arguments);
4428
- };
4429
-
4430
4443
  module.exports.__wbg_setbody_5923b78a95eedf29 = function (arg0, arg1) {
4431
4444
  getObject(arg0).body = getObject(arg1);
4432
4445
  };
@@ -4615,17 +4628,17 @@ module.exports.__wbindgen_cb_drop = function (arg0) {
4615
4628
  return ret;
4616
4629
  };
4617
4630
 
4618
- module.exports.__wbindgen_closure_wrapper3454 = function (arg0, arg1, arg2) {
4631
+ module.exports.__wbindgen_closure_wrapper3472 = function (arg0, arg1, arg2) {
4619
4632
  const ret = makeMutClosure(arg0, arg1, 278, __wbg_adapter_54);
4620
4633
  return addHeapObject(ret);
4621
4634
  };
4622
4635
 
4623
- module.exports.__wbindgen_closure_wrapper5820 = function (arg0, arg1, arg2) {
4636
+ module.exports.__wbindgen_closure_wrapper5838 = function (arg0, arg1, arg2) {
4624
4637
  const ret = makeMutClosure(arg0, arg1, 303, __wbg_adapter_54);
4625
4638
  return addHeapObject(ret);
4626
4639
  };
4627
4640
 
4628
- module.exports.__wbindgen_closure_wrapper6196 = function (arg0, arg1, arg2) {
4641
+ module.exports.__wbindgen_closure_wrapper6214 = function (arg0, arg1, arg2) {
4629
4642
  const ret = makeMutClosure(arg0, arg1, 328, __wbg_adapter_59);
4630
4643
  return addHeapObject(ret);
4631
4644
  };
@@ -200,6 +200,7 @@ export const cryptoclient_unseal_password_protected_key_envelope: (
200
200
  d: number,
201
201
  e: number,
202
202
  ) => void;
203
+ export const isMasterPasswordError: (a: number) => number;
203
204
  export const isDeriveKeyConnectorError: (a: number) => number;
204
205
  export const isEnrollAdminPasswordResetError: (a: number) => number;
205
206
  export const isCryptoClientError: (a: number) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/sdk-internal",
3
- "version": "0.2.0-main.277",
3
+ "version": "0.2.0-main.278",
4
4
  "license": "GPL-3.0",
5
5
  "files": [
6
6
  "bitwarden_wasm_internal_bg.js",