@unchainedshop/core-users 4.8.20 → 4.8.22

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,7 +1,6 @@
1
1
  import { generateDbObjectId } from '@unchainedshop/mongodb';
2
2
  import { createLogger } from '@unchainedshop/logger';
3
- import pMemoize from 'p-memoize';
4
- import ExpiryMap from 'expiry-map';
3
+ import { memoizeWithTTL } from '@unchainedshop/utils';
5
4
  import { server as webauthnServer } from '@passwordless-id/webauthn';
6
5
  import { WebAuthnCredentialsCreationRequestsCollection } from "../db/WebAuthnCredentialsCreationRequestsCollection.js";
7
6
  const logger = createLogger('unchained:core-users');
@@ -37,8 +36,7 @@ async function fetchMDSEntriesImpl() {
37
36
  }
38
37
  return cache;
39
38
  }
40
- const mdsCache = new ExpiryMap(ONE_DAY_MS);
41
- const fetchMDSEntries = pMemoize(fetchMDSEntriesImpl, { cache: mdsCache });
39
+ const fetchMDSEntries = memoizeWithTTL(fetchMDSEntriesImpl, { ttl: ONE_DAY_MS });
42
40
  export function toArrayBuffer(buffer) {
43
41
  return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
44
42
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unchainedshop/core-users",
3
3
  "description": "User management module for the Unchained Engine with authentication support",
4
- "version": "4.8.20",
4
+ "version": "4.8.22",
5
5
  "main": "lib/users-index.js",
6
6
  "types": "lib/users-index.d.ts",
7
7
  "type": "module",
@@ -37,14 +37,10 @@
37
37
  "dependencies": {
38
38
  "@passwordless-id/webauthn": "^2.3.1",
39
39
  "@unchainedshop/events": "^4.8.12",
40
- "@unchainedshop/file-upload": "^4.8.12",
41
40
  "@unchainedshop/logger": "^4.8.12",
42
41
  "@unchainedshop/mongodb": "^4.8.12",
43
- "@unchainedshop/roles": "^4.8.12",
44
42
  "@unchainedshop/utils": "^4.8.12",
45
- "bcryptjs": "^3.0.2",
46
- "expiry-map": "^2.0.0",
47
- "p-memoize": "^8.0.0"
43
+ "bcryptjs": "^3.0.2"
48
44
  },
49
45
  "peerDependencies": {
50
46
  "@noble/curves": "^2.0.0",