@axiumine/koa-utils 7.1.0 → 7.1.1

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.
Files changed (84) hide show
  1. package/LICENSE +0 -5
  2. package/README.md +54 -2
  3. package/dist/dataSources/MariaDB.mjs +8 -6
  4. package/dist/dataSources/MongoDB.mjs +1 -1
  5. package/dist/dataSources/PostgreSQL.mjs +12 -12
  6. package/dist/dataSources/Redis.mjs +8 -7
  7. package/dist/email/SocketLabsLib.d.mts +0 -13
  8. package/dist/email/SocketLabsLib.mjs +48 -208
  9. package/dist/files/moveFileStaticDomain.mjs +1 -1
  10. package/dist/files/storeUploadAsTemp.mjs +5 -1
  11. package/dist/files/uploadTempImage.mjs +2 -1
  12. package/dist/files/uploadTempPdf.mjs +2 -1
  13. package/dist/graphQL/models/MongoDB/UserBase.d.mts +3 -1
  14. package/dist/graphQL/models/MongoDB/log/DevStatsGraphQLCalls.d.mts +3 -1
  15. package/dist/graphQL/models/MongoDB/log/LogGlobalError.d.mts +3 -1
  16. package/dist/graphQL/models/MongoDB/log/LogStatsGraphql.d.mts +3 -1
  17. package/dist/graphQL/models/MongoDB/log/LogThrow.d.mts +3 -1
  18. package/dist/graphQL/schema/mutations/emailChangeHashVerify.mjs +8 -76
  19. package/dist/graphQL/schema/mutations/login4Ever.mjs +1 -0
  20. package/dist/graphQL/schema/mutations/loginAdmin.mjs +1 -0
  21. package/dist/graphQL/schema/mutations/loginRememberme.mjs +1 -0
  22. package/dist/graphQL/schema/mutations/logout.mjs +2 -2
  23. package/dist/graphQL/schema/mutations/refresh.mjs +7 -5
  24. package/dist/graphQL/schema/mutations/resetPwd.d.mts +1 -1
  25. package/dist/graphQL/schema/mutations/signUp.mjs +1 -0
  26. package/dist/graphQL/schema/mutations/updatePassword.mjs +1 -48
  27. package/dist/koa/middleware/authenticatedAuthorizationHandler/index.mjs +2 -2
  28. package/dist/koa/middleware/authenticatedAuthorizationHandler/verifySignedRefreshToken.mjs +2 -0
  29. package/dist/koa/middleware/authenticatedLogoutHandler/index.mjs +2 -2
  30. package/dist/koa/middleware/authenticatedResourceHandler/index.mjs +2 -2
  31. package/dist/koa/tdwKoaErrorHandler.mjs +1 -1
  32. package/dist/lib/ArrayLib.mjs +4 -3
  33. package/dist/lib/DateLib.mjs +1 -0
  34. package/dist/lib/StringLib.mjs +56 -4
  35. package/dist/lib/db/log/hitStat.mjs +1 -0
  36. package/dist/lib/isIntrospectionBypassAllowed.mjs +1 -1
  37. package/dist/lib/isSessionBlocked.mjs +1 -1
  38. package/dist/lib/tokens.mjs +2 -1
  39. package/dist/lib/tryCatchRethrow.mjs +1 -1
  40. package/dist/private/dataSources/isRedisTlsRequired.mjs +1 -1
  41. package/dist/private/email/IEmailContent.d.mts +9 -0
  42. package/dist/private/email/IEmailContent.mjs +2 -0
  43. package/dist/private/email/accountMessages.d.mts +11 -0
  44. package/dist/private/email/accountMessages.mjs +55 -0
  45. package/dist/private/email/escapeHtml.d.mts +9 -0
  46. package/dist/private/email/escapeHtml.mjs +17 -0
  47. package/dist/private/email/htmlFrame.d.mts +10 -0
  48. package/dist/private/email/htmlFrame.mjs +25 -0
  49. package/dist/private/email/messageParts.d.mts +12 -0
  50. package/dist/private/email/messageParts.mjs +31 -0
  51. package/dist/private/email/noticeMessages.d.mts +14 -0
  52. package/dist/private/email/noticeMessages.mjs +51 -0
  53. package/dist/private/email/orFalse.d.mts +2 -0
  54. package/dist/private/email/orFalse.mjs +12 -0
  55. package/dist/private/email/resetMessages.d.mts +17 -0
  56. package/dist/private/email/resetMessages.mjs +44 -0
  57. package/dist/private/graphQL/models/MongoDB/private/UserAdminKoaUtils.d.mts +4 -2
  58. package/dist/private/graphQL/schema/mutations/_buildLoginStatsUpdate.mjs +4 -4
  59. package/dist/private/graphQL/schema/mutations/infoUserForLoginSQL.mjs +5 -4
  60. package/dist/private/graphQL/schema/mutations/setRedisLoginSession.mjs +2 -2
  61. package/dist/private/graphQL/schema/mutations/updateLoginStats4ever.mjs +2 -2
  62. package/dist/private/lib/access/applyPasswordReset.d.mts +22 -0
  63. package/dist/private/lib/access/applyPasswordReset.mjs +22 -0
  64. package/dist/private/lib/access/assertResetAllowed.d.mts +14 -0
  65. package/dist/private/lib/access/assertResetAllowed.mjs +51 -0
  66. package/dist/private/lib/access/assertVerifyEmailAllowed.d.mts +6 -1
  67. package/dist/private/lib/access/db/abandonUser.mjs +3 -0
  68. package/dist/private/lib/access/db/confirmNewEmail.mjs +2 -0
  69. package/dist/private/lib/access/db/deleteUserByEmail.mjs +2 -0
  70. package/dist/private/lib/access/db/enableEmailAccess.mjs +2 -0
  71. package/dist/private/lib/access/db/getResetPwd.mjs +2 -0
  72. package/dist/private/lib/access/db/removeResetReq.mjs +2 -0
  73. package/dist/private/lib/access/db/saveResetReq.mjs +2 -0
  74. package/dist/private/lib/access/db/setEmailHash.mjs +2 -0
  75. package/dist/private/lib/access/db/updatePasswordDb.mjs +2 -0
  76. package/dist/private/lib/access/db/userData4VerifyEmail.mjs +2 -0
  77. package/dist/private/lib/access/emailChangeHandlers.d.mts +35 -0
  78. package/dist/private/lib/access/emailChangeHandlers.mjs +87 -0
  79. package/dist/private/lib/access/handleIfHashBad.d.mts +4 -2
  80. package/dist/private/lib/access/handleIfHashBad.mjs +4 -1
  81. package/dist/private/lib/access/safeEqualSecret.d.mts +13 -0
  82. package/dist/private/lib/access/safeEqualSecret.mjs +26 -0
  83. package/dist/private/lib/verifyIntrospectionCode.mjs +1 -1
  84. package/package.json +59 -25
@@ -11,6 +11,8 @@ export const createRemoveResetReq = (model, paths) => async function removeReset
11
11
  // The unset list comes from paths.resetClear, NOT from the fields saveResetReq writes. A layout
12
12
  // holding the request in one required subdocument can only be cleared by unsetting the container;
13
13
  // unsetting its members leaves a document that fails validation and the write is rejected.
14
+ // Field name comes from the factory `paths` argument the consuming developer supplies at startup, never from request data.
15
+ // nosemgrep: koa-utils.nosql-injection.dynamic-filter-key
14
16
  return model
15
17
  .updateOne({ [paths.email]: email }, { $unset: buildUnset(paths.resetClear) })
16
18
  .session(session)
@@ -3,6 +3,8 @@ import { throwMongoDBErrors } from "../../../../lib/MongoDB/throwMongoErrors.mjs
3
3
  import { UserBase } from "../../../../graphQL/models/MongoDB/UserBase.mjs";
4
4
  export const createSaveResetReq = (model, paths) => async function saveResetReq(session, _id, now, hash) {
5
5
  try {
6
+ // Field names come from the `paths` map fixed when the flow is built, never from request data; only the values do.
7
+ // nosemgrep: koa-utils.nosql-injection.mass-assignment-update-doc
6
8
  await model.updateOne({ _id }, {
7
9
  $set: {
8
10
  [paths.resetDateReq]: now,
@@ -5,6 +5,8 @@ export const createSetEmailHash = (model, paths) => async function setEmailHash(
5
5
  const hash = emailHash();
6
6
  //calculate password hash
7
7
  const dtNow = new Date();
8
+ // Field names come from the `paths` map fixed when the flow is built, never from request data; only the values do.
9
+ // nosemgrep: koa-utils.nosql-injection.mass-assignment-update-doc
8
10
  await model.updateOne({ _id: userId }, {
9
11
  $set: {
10
12
  [paths.hash]: hash,
@@ -4,6 +4,8 @@ import { hash } from '@node-rs/bcrypt';
4
4
  import { SALT_ROUNDS } from "../Constants.mjs";
5
5
  export const createUpdatePasswordDb = (model, paths) => async function updatePassword(session, _id, password) {
6
6
  const hashVal = await hash(password, SALT_ROUNDS);
7
+ // Field names come from the `paths` map fixed when the flow is built, never from request data; only the values do.
8
+ // nosemgrep: koa-utils.nosql-injection.mass-assignment-update-doc
7
9
  return model.updateOne({ _id }, { $set: { [paths.password]: hashVal } }, { session, runValidators: true });
8
10
  };
9
11
  /** `UserBase`-bound default — the behaviour every existing consumer already imports. */
@@ -7,6 +7,8 @@ export const createUserData4VerifyEmail = (model, paths) => async function userD
7
7
  // Every field the guard chain reads must be listed. This is a .lean() read, so a field left out
8
8
  // of the projection is simply absent on the returned object, with no error — which is how a
9
9
  // missing requestTimes turned every wrong-hash attempt into a 500 under a green coverage gate.
10
+ // Field name comes from the factory `paths` argument the consuming developer supplies at startup, never from request data.
11
+ // nosemgrep: koa-utils.nosql-injection.dynamic-filter-key
10
12
  const user = await model
11
13
  .findOne({ [paths.email]: uEmail })
12
14
  .select(buildProjection([paths.hash, paths.valid, paths.dateLastReq, paths.requestTimes, paths.deleted, paths.disabled]))
@@ -0,0 +1,35 @@
1
+ import { IVerifyEmailMailer } from "../../../lib/access/verifyEmailMailer.mjs";
2
+ import { Types } from 'mongoose';
3
+ import type { IEmailChangeHashVerifyDeps } from '../../../graphQL/schema/mutations/emailChangeHashVerify.mjs';
4
+ /**
5
+ * Everything the `emailChangeHashVerify` branch handlers need, bundled so each stays within the max-params
6
+ * budget: the bound deps, the lean document just read with its `_id`, the lowercased email and the resolved
7
+ * mailer. The `deps` type is imported as a type only, so there is no runtime cycle with the mutation.
8
+ */
9
+ export interface IVerifyContext {
10
+ deps: IEmailChangeHashVerifyDeps;
11
+ user: unknown;
12
+ uId: Types.ObjectId;
13
+ uEmail: string;
14
+ mailer: IVerifyEmailMailer;
15
+ }
16
+ /**
17
+ * Read the pending email-change row addressed by `uEmail` and bundle it into the context the handlers take,
18
+ * or resolve `null` when no account holds that address.
19
+ *
20
+ * Every field the handlers read must be listed in the projection. account.email.requestTimes was missing, and
21
+ * because this is a .lean() read the absent key made handleHashMismatch throw 500 on *every* wrong hash: the
22
+ * strike counter never advanced and the owner never got the wrongHash warning.
23
+ */
24
+ export declare function loadVerifyContext(deps: IEmailChangeHashVerifyDeps, mailer: IVerifyEmailMailer, uEmail: string): Promise<IVerifyContext | null>;
25
+ /**
26
+ * The submitted hash does not match the stored one: count the attempt and warn the account owner.
27
+ * Moved out of `emailChangeHashVerify.mts` to keep that file inside the FTA score target — behaviour unchanged.
28
+ */
29
+ export declare function handleHashMismatch(ctx: IVerifyContext): Promise<boolean>;
30
+ /**
31
+ * The submitted hash matches: enforce the freshness/account guards and, if the target email is still
32
+ * free, accept it. Moved out of `emailChangeHashVerify.mts` to keep that file inside the FTA score target
33
+ * — behaviour unchanged.
34
+ */
35
+ export declare function handleValidHash(ctx: IVerifyContext): Promise<boolean>;
@@ -0,0 +1,87 @@
1
+ import { StringLib } from "../../../lib/StringLib.mjs";
2
+ import { throwInternalError } from "../../../graphQL/throw/throwInternalError.mjs";
3
+ import { buildProjection, readPath } from './pathTools.mjs';
4
+ /**
5
+ * Read the pending email-change row addressed by `uEmail` and bundle it into the context the handlers take,
6
+ * or resolve `null` when no account holds that address.
7
+ *
8
+ * Every field the handlers read must be listed in the projection. account.email.requestTimes was missing, and
9
+ * because this is a .lean() read the absent key made handleHashMismatch throw 500 on *every* wrong hash: the
10
+ * strike counter never advanced and the owner never got the wrongHash warning.
11
+ */
12
+ export async function loadVerifyContext(deps, mailer, uEmail) {
13
+ const { paths } = deps;
14
+ // Field name comes from the factory `paths` argument the consuming developer supplies at startup, never from request data.
15
+ // nosemgrep: koa-utils.nosql-injection.dynamic-filter-key
16
+ const user = await deps.model
17
+ .findOne({ [paths.newEmailTmp]: uEmail })
18
+ .select(buildProjection([paths.hash, paths.dateLastReq, paths.requestTimes, paths.deleted, paths.disabled]))
19
+ .lean();
20
+ if (user === null) {
21
+ return null;
22
+ }
23
+ return { deps, user, uId: readPath(user, '_id'), uEmail, mailer };
24
+ }
25
+ /**
26
+ * The submitted hash does not match the stored one: count the attempt and warn the account owner.
27
+ * Moved out of `emailChangeHashVerify.mts` to keep that file inside the FTA score target — behaviour unchanged.
28
+ */
29
+ export async function handleHashMismatch(ctx) {
30
+ // hash failed
31
+ const requestTimes = readPath(ctx.user, ctx.deps.paths.requestTimes);
32
+ if (typeof requestTimes === 'undefined') {
33
+ throw throwInternalError();
34
+ }
35
+ await ctx.deps.incReqTimes(ctx.uId);
36
+ // noinspection ES6MissingAwait
37
+ void ctx.mailer.wrongHash(ctx.uEmail, requestTimes);
38
+ return false;
39
+ }
40
+ /**
41
+ * The submitted hash matches: enforce the freshness/account guards and, if the target email is still
42
+ * free, accept it. Moved out of `emailChangeHashVerify.mts` to keep that file inside the FTA score target
43
+ * — behaviour unchanged.
44
+ */
45
+ export async function handleValidHash(ctx) {
46
+ const { deps, user, uId, uEmail, mailer } = ctx;
47
+ const { paths } = deps;
48
+ const dateLastReq = readPath(user, paths.dateLastReq);
49
+ if (typeof dateLastReq === 'undefined') {
50
+ // Planned: report 'dateLastReq is undefined' to Sentry before throwing. Not wired up yet.
51
+ throw throwInternalError();
52
+ }
53
+ // if dateLastReq is older than 3 days, warn and stop
54
+ const StrLibObj = new StringLib();
55
+ const now = new Date();
56
+ const day3ago = new Date(now.setDate(now.getDate() - 3));
57
+ if (StrLibObj.isoToTimestamp(day3ago) > StrLibObj.isoToTimestamp(dateLastReq)) {
58
+ // dateLastReq too old then 3 days
59
+ // noinspection ES6MissingAwait
60
+ void mailer.hashReqTooOld(uEmail);
61
+ return false;
62
+ }
63
+ // account is deleted -> maybe by admin for any reason
64
+ // Read raw: this is a .lean() query, so Mongoose casting never runs and these are real booleans
65
+ // only on data that scripts/migrate-account-disabled-to-boolean.mjs has been through. A legacy
66
+ // string 'false' is truthy and blocks here — migrate, don't coerce.
67
+ if (readPath(user, paths.deleted)) {
68
+ return false;
69
+ }
70
+ // if account is disabled, for any reason
71
+ if (readPath(user, paths.disabled)) {
72
+ // noinspection ES6MissingAwait
73
+ void mailer.accountDisabled(uEmail);
74
+ return false;
75
+ }
76
+ // valid request. meanwhile, has some user registered with this email address ??
77
+ // Field name comes from the factory `paths` argument the consuming developer supplies at startup, never from request data.
78
+ // nosemgrep: koa-utils.nosql-injection.dynamic-filter-key
79
+ const qty = await deps.model.countDocuments({ [paths.email]: uEmail });
80
+ if (qty > 0) {
81
+ return false;
82
+ }
83
+ // accept new email
84
+ await deps.confirmNewEmail(uId, uEmail);
85
+ return true;
86
+ }
87
+ //# sourceMappingURL=emailChangeHandlers.mjs.map
@@ -5,12 +5,14 @@ interface IHandleIfHashBadArgs {
5
5
  uId: mongoose.Types.ObjectId;
6
6
  uEmail: string;
7
7
  hash: string;
8
- requestTimes?: number;
9
- dbHash?: string;
8
+ requestTimes?: number | undefined;
9
+ dbHash?: string | undefined;
10
10
  }
11
11
  /**
12
12
  * The hash in the activation url is wrong.
13
13
  *
14
+ * The hash is compared in constant time through `safeEqualSecret`; an unset `dbHash` never matches.
15
+ *
14
16
  * The strike counter is bumped through an injected writer so the guard can serve a model other than
15
17
  * `UserBase`: the counter path itself lives in the verify-email `paths` map the writer was built with.
16
18
  *
@@ -1,9 +1,12 @@
1
1
  import { defaultVerifyEmailMailer } from "../../../lib/access/verifyEmailMailer.mjs";
2
2
  import { EMAIL_CHECK_LINK } from './Constants.mjs';
3
3
  import { incReqTimes } from './db/incReqTimes.mjs';
4
+ import { safeEqualSecret } from './safeEqualSecret.mjs';
4
5
  /**
5
6
  * The hash in the activation url is wrong.
6
7
  *
8
+ * The hash is compared in constant time through `safeEqualSecret`; an unset `dbHash` never matches.
9
+ *
7
10
  * The strike counter is bumped through an injected writer so the guard can serve a model other than
8
11
  * `UserBase`: the counter path itself lives in the verify-email `paths` map the writer was built with.
9
12
  *
@@ -11,7 +14,7 @@ import { incReqTimes } from './db/incReqTimes.mjs';
11
14
  * SocketLabs client made this branch unreachable from an integration suite without sending for real.
12
15
  */
13
16
  export const createHandleIfHashBad = (incReqTimesFn, mailer) => async function handleIfHashBad({ uId, uEmail, hash, requestTimes = 0, dbHash }) {
14
- if (hash !== dbHash) {
17
+ if (!safeEqualSecret(hash, dbHash)) {
15
18
  // hash failed
16
19
  await incReqTimesFn(uId);
17
20
  await mailer.wrongHash(uEmail, requestTimes + 1);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Constant-time equality of two secret strings (a mail hash, a reset hash).
3
+ *
4
+ * `===` returns at the first differing character, so response time leaks how long a guessed prefix is
5
+ * correct. Here both sides are hashed to 32 bytes first, which makes the compared buffers equal in length
6
+ * whatever the inputs are (`timingSafeEqual` throws on unequal lengths and a length check would leak the
7
+ * secret's length), and then `timingSafeEqual` compares the digests.
8
+ *
9
+ * Fails closed: anything that is not a string on either side (an unset stored hash, a field read off a
10
+ * lean document) is `false`, including `undefined` against `undefined`. For two strings the result is
11
+ * exactly `a === b`.
12
+ */
13
+ export declare const safeEqualSecret: (a: unknown, b: unknown) => boolean;
@@ -0,0 +1,26 @@
1
+ import { createHash, timingSafeEqual } from 'node:crypto';
2
+ /**
3
+ * SHA-256 of the string's UTF-16 code units. `utf16le` rather than the default `utf8` on purpose: UTF-8
4
+ * replaces every lone surrogate with U+FFFD, so two different strings could share a digest and compare
5
+ * equal. UTF-16 keeps each code unit, which makes digest equality exactly the same relation as `===`.
6
+ */
7
+ const digest = (value) => createHash('sha256').update(value, 'utf16le').digest();
8
+ /**
9
+ * Constant-time equality of two secret strings (a mail hash, a reset hash).
10
+ *
11
+ * `===` returns at the first differing character, so response time leaks how long a guessed prefix is
12
+ * correct. Here both sides are hashed to 32 bytes first, which makes the compared buffers equal in length
13
+ * whatever the inputs are (`timingSafeEqual` throws on unequal lengths and a length check would leak the
14
+ * secret's length), and then `timingSafeEqual` compares the digests.
15
+ *
16
+ * Fails closed: anything that is not a string on either side (an unset stored hash, a field read off a
17
+ * lean document) is `false`, including `undefined` against `undefined`. For two strings the result is
18
+ * exactly `a === b`.
19
+ */
20
+ export const safeEqualSecret = (a, b) => {
21
+ if (typeof a !== 'string' || typeof b !== 'string') {
22
+ return false;
23
+ }
24
+ return timingSafeEqual(digest(a), digest(b));
25
+ };
26
+ //# sourceMappingURL=safeEqualSecret.mjs.map
@@ -22,7 +22,7 @@ export const verifyIntrospectionCode = (headerValue) => {
22
22
  if (!isIntrospectionBypassAllowed()) {
23
23
  return false;
24
24
  }
25
- const code = process.env.INTROSPECTION_CODE;
25
+ const code = process.env['INTROSPECTION_CODE'];
26
26
  if (typeof code !== 'string' || code.length === 0) {
27
27
  return false;
28
28
  }
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@axiumine/koa-utils",
3
- "version": "7.1.0",
3
+ "version": "7.1.1",
4
4
  "description": "Koa Utils",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/Axiumine/koa-utils"
9
9
  },
10
+ "bugs": {
11
+ "url": "https://github.com/Axiumine/koa-utils/issues"
12
+ },
13
+ "homepage": "https://github.com/Axiumine/koa-utils/tree/main/docs/code",
10
14
  "license": "GPL-3.0-or-later",
11
15
  "author": "Giovanni Manzoni <dev@giovannimanzoni.com> (https://www.giovannimanzoni.com)",
12
16
  "private": false,
@@ -21,7 +25,22 @@
21
25
  "build:all": "yarn run build:cjs && yarn run build:esm",
22
26
  "build:cjs": "yarn run tsc -p tsconfig.cjs.json && find dist/cjs -type f -name \"*.js\" -exec bash -c 'mv \"$0\" \"${0%.js}.cjs\"' {} \\; && cp -R dist/cjs/* dist/ && rm -rf dist/cjs",
23
27
  "build:esm": "yarn run tspc -p tsconfig.json && find dist/esm -type f -name \"*.js\" -exec bash -c 'mv \"$0\" \"${0%.js}.mjs\"' {} \\; && cp -R dist/esm/* dist/ && find dist -name \"*.mjs.map\" -exec sed -i -E 's#(\"sources\":\\[\")\\.\\./#\\1#' {} + && rm -rf dist/esm",
24
- "lint": "eslint --fix && prettier --write 'src/**/*.mts'",
28
+ "lint": "eslint --fix && prettier --write 'src/**/*.mts' 'scripts/**/*.mts'",
29
+ "lint:check": "eslint --max-warnings 0 --cache && prettier --check 'src/**/*.mts' 'scripts/**/*.mts'",
30
+ "typecheck": "tsc -p tsconfig.check.json --noEmit",
31
+ "typecheck:scripts": "tsc -p tsconfig.scripts.json",
32
+ "typecheck:tests": "tsc -p tsconfig.tests.json",
33
+ "caps": "node scripts/check-code-caps.mts",
34
+ "caps:update": "node scripts/check-code-caps.mts --update",
35
+ "caps:report": "node scripts/check-code-caps.mts --report",
36
+ "ratchet:against": "node scripts/check-code-caps.mts --against",
37
+ "type-coverage": "type-coverage -p tsconfig.json --at-least 99.5 && type-coverage -p tsconfig.json --strict --at-least 96.7",
38
+ "knip": "knip",
39
+ "fta": "node node_modules/fta-cli/index.js src -c fta.json",
40
+ "mutation": "patch-package && stryker run",
41
+ "mutation:changed": "./scripts/mutation-changed.sh",
42
+ "leak:check": "node --expose-gc scripts/leak-check.mts",
43
+ "check:static": "yarn caps && yarn lint:check && yarn typecheck && yarn typecheck:scripts && yarn typecheck:tests && yarn knip && yarn type-coverage && yarn fta",
25
44
  "clean": "rm -rf ./dist",
26
45
  "build:tests": "rm -rf dist-test && yarn run tspc -p tsconfig.build-tests.json && find dist-test -type f -name \"*.js\" -exec bash -c 'mv \"$0\" \"${0%.js}.mjs\"' {} \\;",
27
46
  "test": "yarn build && yarn build:tests && mocha",
@@ -720,42 +739,52 @@
720
739
  },
721
740
  "devDependencies": {
722
741
  "@axiumine/eslint-config-be": "^2.0.2",
723
- "@eslint/eslintrc": "^3.3.6",
742
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.8.1",
743
+ "@eslint/eslintrc": "^3.3.7",
724
744
  "@eslint/js": "^10.0.1",
725
- "@node-rs/bcrypt": "^1.10.7",
726
- "@sentry/node": "^10.69.0",
745
+ "@node-rs/bcrypt": "^1.10.9",
746
+ "@sentry/node": "^10.76.2",
727
747
  "@socketlabs/email": "^1.4.4",
748
+ "@stryker-mutator/core": "10.1.1",
749
+ "@stryker-mutator/mocha-runner": "10.1.1",
750
+ "@stryker-mutator/typescript-checker": "10.1.1",
728
751
  "@types/chai": "^5.2.3",
729
752
  "@types/clamscan": "^2.4.1",
730
753
  "@types/fs-extra": "^11.0.4",
731
754
  "@types/koa": "^3.0.3",
732
755
  "@types/mocha": "^10.0.10",
733
- "@types/node": "^26.1.2",
734
- "@types/pg": "^8.20.3",
735
- "@types/sinon": "^21.0.1",
736
- "@typescript-eslint/eslint-plugin": "^8.65.0",
737
- "@typescript-eslint/parser": "^8.65.0",
738
- "c8": "^11.0.0",
739
- "chai": "^6.2.2",
756
+ "@types/node": "^26.6.5",
757
+ "@types/pg": "^8.23.1",
758
+ "@types/sinon": "^22.0.2",
759
+ "@typescript-eslint/eslint-plugin": "^8.72.0",
760
+ "@typescript-eslint/parser": "^8.72.0",
761
+ "c8": "^12.0.0",
762
+ "chai": "^6.3.0",
740
763
  "clamscan": "^2.4.0",
741
764
  "dotenv": "^17.4.2",
742
- "eslint": "^10.8.0",
765
+ "eslint": "^10.13.0",
743
766
  "eslint-config-prettier": "^10.1.8",
744
767
  "eslint-import-resolver-typescript": "^4.4.5",
745
- "eslint-plugin-n": "^18.2.2",
768
+ "eslint-plugin-n": "^18.5.0",
746
769
  "eslint-plugin-promise": "^7.3.0",
747
- "eslint-plugin-simple-import-sort": "^13.0.0",
748
- "file-type": "^22.0.1",
749
- "fs-extra": "^11.4.0",
770
+ "eslint-plugin-security": "^4.2.1",
771
+ "eslint-plugin-simple-import-sort": "^14.0.0",
772
+ "eslint-plugin-sonarjs": "^4.2.2",
773
+ "fast-check": "^4.10.2",
774
+ "file-type": "^22.2.0",
775
+ "fs-extra": "^11.4.1",
776
+ "fta-cli": "^3.1.0",
750
777
  "graphql": "^16.14.2",
778
+ "knip": "^6.44.0",
751
779
  "koa": "^3.2.1",
752
780
  "mariadb": "^3.5.3",
753
- "mocha": "^11.7.6",
754
- "mongodb-memory-server": "^11.2.0",
755
- "mongoose": "^9.9.1",
756
- "pg": "^8.22.0",
757
- "prettier": "^3.9.6",
758
- "redis": "^6.2.0",
781
+ "mocha": "^12.0.3",
782
+ "mongodb-memory-server": "^11.3.0",
783
+ "mongoose": "^9.11.3",
784
+ "patch-package": "8.0.1",
785
+ "pg": "^8.23.1",
786
+ "prettier": "^3.9.10",
787
+ "redis": "^6.3.0",
759
788
  "reflect-metadata": "^0.2.2",
760
789
  "sequelize": "^6.37.8",
761
790
  "sequelize-typescript": "^2.1.6",
@@ -763,9 +792,14 @@
763
792
  "sinon": "^22.1.0",
764
793
  "ts-node": "^10.9.2",
765
794
  "ts-patch": "^4.0.1",
766
- "tsx": "^4.23.1",
795
+ "type-coverage": "^2.30.4",
767
796
  "typescript": "^6.0.3",
797
+ "typescript-eslint": "8.72.0",
768
798
  "typescript-transform-paths": "^4.0.0",
769
- "uuid": "^14.0.1"
799
+ "uuid": "^14.0.3"
800
+ },
801
+ "resolutions": {
802
+ "@socketlabs/email/axios": "^1.21.0",
803
+ "sequelize/uuid": "^11.1.1"
770
804
  }
771
805
  }