@bitwarden/sdk-internal 0.2.0-main.276 → 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_51bb328abe39437d = 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;
@@ -4017,7 +4030,7 @@ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
4017
4030
  return addHeapObject(ret);
4018
4031
  };
4019
4032
 
4020
- module.exports.__wbg_get_cc5ec7838bb03ef3 = function () {
4033
+ module.exports.__wbg_get_df7e5d864ed1c406 = function () {
4021
4034
  return handleError(function (arg0, arg1, arg2) {
4022
4035
  let deferred0_0;
4023
4036
  let deferred0_1;
@@ -4032,7 +4045,7 @@ module.exports.__wbg_get_cc5ec7838bb03ef3 = function () {
4032
4045
  }, arguments);
4033
4046
  };
4034
4047
 
4035
- module.exports.__wbg_getaccesstoken_8fcbdd9afd464df2 = 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_24ea728590cd067b = 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_6528e894dd2fcf50 = 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_8b1f4d0f1672051e = 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_8b1f4d0f1672051e = function () {
4341
4354
  }, arguments);
4342
4355
  };
4343
4356
 
4344
- module.exports.__wbg_remove_c4b09dd2ce9331e5 = 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,24 +4393,7 @@ module.exports.__wbg_setTimeout_ca12ead8b48245e2 = function (arg0, arg1) {
4380
4393
  return addHeapObject(ret);
4381
4394
  };
4382
4395
 
4383
- module.exports.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
4384
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4385
- };
4386
-
4387
- module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
4388
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4389
- };
4390
-
4391
- module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
4392
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4393
- };
4394
-
4395
- module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
4396
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
4397
- return addHeapObject(ret);
4398
- };
4399
-
4400
- module.exports.__wbg_set_ba5bd5a6370a8e1c = function () {
4396
+ module.exports.__wbg_set_2d113a1bd16aab72 = function () {
4401
4397
  return handleError(function (arg0, arg1, arg2, arg3) {
4402
4398
  let deferred0_0;
4403
4399
  let deferred0_1;
@@ -4412,7 +4408,19 @@ module.exports.__wbg_set_ba5bd5a6370a8e1c = function () {
4412
4408
  }, arguments);
4413
4409
  };
4414
4410
 
4415
- module.exports.__wbg_set_d1cdffb3dfa76350 = function () {
4411
+ module.exports.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
4412
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4413
+ };
4414
+
4415
+ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
4416
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4417
+ };
4418
+
4419
+ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
4420
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4421
+ };
4422
+
4423
+ module.exports.__wbg_set_7b858e538c6e10eb = function () {
4416
4424
  return handleError(function (arg0, arg1, arg2, arg3) {
4417
4425
  let deferred0_0;
4418
4426
  let deferred0_1;
@@ -4427,6 +4435,11 @@ module.exports.__wbg_set_d1cdffb3dfa76350 = function () {
4427
4435
  }, arguments);
4428
4436
  };
4429
4437
 
4438
+ module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
4439
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
4440
+ return addHeapObject(ret);
4441
+ };
4442
+
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_wrapper3395 = 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_wrapper5761 = 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_wrapper6137 = 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.276",
3
+ "version": "0.2.0-main.278",
4
4
  "license": "GPL-3.0",
5
5
  "files": [
6
6
  "bitwarden_wasm_internal_bg.js",