favalib 0.0.5 → 0.0.6

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.
@@ -1,4 +1,3 @@
1
- import WebSocket from 'isomorphic-ws';
2
1
  import { base64ToUint8Array, hexToUint8Array, stringToBase64, uint8ArrayToBase64, uint8ArrayToHex, } from 'uint8array-extras';
3
2
  import { deriveSFromPassword, JPakeThreePass, } from 'jpake-ts';
4
3
  import { TwoFaLibEvent } from '../TwoFaLibEvent.mjs';
@@ -133,7 +132,7 @@ class SyncManager {
133
132
  // eslint-disable-next-line @typescript-eslint/no-this-alias
134
133
  const syncManager = this;
135
134
  ws.addEventListener('error', (event) => {
136
- syncManager.log('warning', `Error in websocket: ${event.error}`);
135
+ syncManager.log('warning', `Error in websocket: ${event}`);
137
136
  });
138
137
  ws.addEventListener('message', function message(message) {
139
138
  try {
@@ -445,7 +444,6 @@ class SyncManager {
445
444
  initiatorDeviceId: this.activeAddDeviceFlow.initiatorDeviceId,
446
445
  });
447
446
  // save the added the sync device, done via command so this is synced to all sync devices
448
- // this also re-adds the sync device to the just added sync device, which syncDevices list is now equal to our own
449
447
  const command = AddSyncDeviceCommand.create({
450
448
  deviceId: this.activeAddDeviceFlow.responderDeviceId,
451
449
  publicKey: decryptedPublicKey,
@@ -468,7 +466,6 @@ class SyncManager {
468
466
  if (vaultState.deviceId !== expectedDeviceId) {
469
467
  throw new SyncError(`DeviceId mismatch when importing, expected ${expectedDeviceId} got ${vaultState.deviceId}`);
470
468
  }
471
- this.syncDevices = vaultState.sync.devices;
472
469
  for (const device of vaultState.sync.devices) {
473
470
  await this.addSyncDevice(device, false);
474
471
  }
@@ -638,9 +635,6 @@ class SyncManager {
638
635
  const ws = this.ws;
639
636
  this.ws = undefined;
640
637
  ws.close();
641
- // force terminate the connection after 2 seconds
642
- // ws.terminate is not defined in the test enviroment, which is the reason for the &&
643
- this.terminateTimeout = setTimeout(() => ws.terminate && ws.terminate(), 2000);
644
638
  }
645
639
  }
646
640
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "favalib",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -27,31 +27,31 @@
27
27
  "@types/node-forge": "^1.3.11",
28
28
  "@types/qrcode": "^1.5.5",
29
29
  "@types/uuid": "^10.0.0",
30
- "@types/whatwg-url": "^11.0.5",
31
- "@vitest/coverage-v8": "^2.1.2",
32
- "eslint": "^9.12.0",
33
- "type-fest": "^4.26.1",
34
- "vitest": "^2.1.2"
30
+ "@types/whatwg-url": "^13.0.0",
31
+ "@vitest/coverage-v8": "^3.1.1",
32
+ "eslint": "^9.24.0",
33
+ "type-fest": "^4.39.1",
34
+ "vitest": "^3.1.1",
35
+ "vitest-websocket-mock": "^0.5.0"
35
36
  },
36
37
  "dependencies": {
37
38
  "@zxcvbn-ts/core": "^3.0.4",
38
39
  "@zxcvbn-ts/language-common": "^3.0.4",
39
40
  "@zxcvbn-ts/language-en": "^3.0.2",
40
- "canvas": "^2.11.2",
41
- "hash-wasm": "^4.11.0",
42
- "isomorphic-ws": "^5.0.0",
41
+ "canvas": "^3.1.0",
42
+ "hash-wasm": "^4.12.0",
43
43
  "jpake-ts": "^1.0.1",
44
44
  "jsqr": "^1.4.0",
45
45
  "node-forge": "^1.3.1",
46
- "openpgp": "^5.11.2",
46
+ "openpgp": "^6.1.0",
47
47
  "qrcode": "^1.5.4",
48
48
  "totp-generator": "^1.0.0",
49
49
  "typescript-event-target": "^1.1.1",
50
50
  "uint8array-extras": "^1.4.0",
51
- "uuid": "^10.0.0",
52
- "vitest-websocket-mock": "^0.4.0",
53
- "whatwg-url": "^14.0.0",
54
- "ws": "^8.18.0"
51
+ "unws": "^0.3.1",
52
+ "uuid": "^11.1.0",
53
+ "whatwg-url": "^14.2.0",
54
+ "ws": "^8.18.1"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=20"