@devmoods/express-extras 0.61.0 → 0.62.0

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.
package/dist/logger.js CHANGED
@@ -42,21 +42,32 @@ export function createLogger({ name, getContext, level = config.value.LOG_LEVEL,
42
42
  ...context,
43
43
  };
44
44
  }
45
+ const sentryMapping = {
46
+ [LEVELS.TRACE]: 'trace',
47
+ [LEVELS.DEBUG]: 'debug',
48
+ [LEVELS.INFO]: 'info',
49
+ [LEVELS.WARN]: 'warn',
50
+ [LEVELS.ERROR]: 'error',
51
+ [LEVELS.FATAL]: 'fatal',
52
+ };
45
53
  // eslint-disable-next-line @typescript-eslint/no-shadow
46
54
  function log(level, message, context) {
47
- const payload = JSON.stringify({
55
+ const attributes = {
48
56
  level: LEVELS_TO_NAME[level],
49
57
  env,
50
58
  hostname,
51
59
  pid,
52
60
  name,
53
- message,
54
61
  ...context,
55
62
  time: new Date().toISOString(),
56
63
  v: 1,
57
- });
64
+ };
58
65
  if (level >= logLevel) {
59
- output.write(`${payload}\n`);
66
+ output.write(`${JSON.stringify({ message, ...attributes })}\n`);
67
+ if (Sentry.isInitialized()) {
68
+ const fn = sentryMapping[level];
69
+ Sentry.logger[fn](message, attributes);
70
+ }
60
71
  }
61
72
  }
62
73
  const api = {
@@ -17,18 +17,17 @@ function pgTypeToTsType(pgType, isNullable) {
17
17
  return `string${nullableSuffix}`;
18
18
  case 'integer':
19
19
  case 'int':
20
+ case 'int2':
20
21
  case 'int4':
21
- return `number${nullableSuffix}`;
22
- case 'bigint':
23
22
  case 'int8':
24
- case 'bigserial':
25
23
  case 'serial':
26
- return `number${nullableSuffix}`;
27
24
  case 'smallint':
28
- case 'int2':
29
25
  return `number${nullableSuffix}`;
26
+ case 'bigint':
27
+ case 'bigserial':
30
28
  case 'decimal':
31
29
  case 'numeric':
30
+ return `string${nullableSuffix}`;
32
31
  case 'real':
33
32
  case 'double precision':
34
33
  case 'float':
package/dist/sentry.js CHANGED
@@ -6,6 +6,7 @@ export function sentryOptions(options = {}) {
6
6
  tracesSampleRate: 1.0,
7
7
  profilesSampleRate: 1.0,
8
8
  integrations: [nodeProfilingIntegration()],
9
+ enableLogs: true,
9
10
  ...options,
10
11
  };
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devmoods/express-extras",
3
- "version": "0.61.0",
3
+ "version": "0.62.0",
4
4
  "description": "Kubernetes-ready utilities for rapid Node.js application development",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -46,28 +46,28 @@
46
46
  "devDependencies": {
47
47
  "@devmoods/eslint-config": "^2.12.0",
48
48
  "@types/koa-compose": "^3.2.8",
49
- "@types/node": "24.3.0",
49
+ "@types/node": "24.3.1",
50
50
  "@types/supertest": "^6.0.3",
51
51
  "@vitejs/plugin-react": "^5.0.2",
52
52
  "@vitest/coverage-v8": "^3.2.4",
53
- "arktype": "^2.1.20",
53
+ "arktype": "^2.1.22",
54
54
  "cookiejar": "^2.1.4",
55
- "eslint": "^9.34.0",
55
+ "eslint": "^9.35.0",
56
56
  "faktory-worker": "^4.7.1",
57
57
  "prettier": "3.6.2",
58
58
  "supertest": "7.1.4",
59
59
  "ts-node": "10.9.2",
60
60
  "tsx": "^4.20.5",
61
61
  "typescript": "5.9.2",
62
- "vite": "^7.1.3",
62
+ "vite": "^7.1.4",
63
63
  "vitest": "^3.2.4",
64
- "vitest-fail-on-console": "^0.9.0"
64
+ "vitest-fail-on-console": "^0.10.1"
65
65
  },
66
66
  "dependencies": {
67
- "@devmoods/fetch": "^4.1.0",
68
- "@hey-api/openapi-ts": "^0.82.1",
69
- "@sentry/node": "^10.8.0",
70
- "@sentry/profiling-node": "^10.8.0",
67
+ "@devmoods/fetch": "^4.2.0",
68
+ "@hey-api/openapi-ts": "^0.82.4",
69
+ "@sentry/node": "^10.10.0",
70
+ "@sentry/profiling-node": "^10.10.0",
71
71
  "@standard-schema/spec": "^1.0.0",
72
72
  "@types/bcrypt": "^6.0.0",
73
73
  "@types/cookie-parser": "^1.4.9",
@@ -85,7 +85,7 @@
85
85
  "commander": "^14.0.0",
86
86
  "compose-middleware": "^5.0.1",
87
87
  "cookie-parser": "^1.4.7",
88
- "dotenv": "^17.2.1",
88
+ "dotenv": "^17.2.2",
89
89
  "express": "^4.21.2",
90
90
  "google-auth-library": "^10.3.0",
91
91
  "helmet": "^8.1.0",
@@ -95,8 +95,8 @@
95
95
  "pg-structure": "^7.15.3",
96
96
  "redis": "^5.8.2",
97
97
  "sonda": "^0.9.0",
98
- "sql-formatter": "^15.6.6",
99
- "uuid": "^11.1.0"
98
+ "sql-formatter": "^15.6.8",
99
+ "uuid": "^12.0.0"
100
100
  },
101
101
  "prettier": {
102
102
  "singleQuote": true