@promster/express 14.0.0 → 15.0.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 suǝʞǝǝpʇ
3
+ Copyright (c) 2025 suǝʞǝǝpʇ
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- import { type TPromsterOptions, createMiddleware, getRequestRecorder, signalIsUp, signalIsNotUp } from "./middleware/index.js";
2
- import { getSummary, getContentType, Prometheus, defaultRegister, defaultNormalizers, timing } from '@promster/metrics';
1
+ import { Prometheus, defaultNormalizers, defaultRegister, getContentType, getSummary, timing } from '@promster/metrics';
2
+ import { type TPromsterOptions, createMiddleware, getRequestRecorder, signalIsNotUp, signalIsUp } from "./middleware/index.js";
3
3
  export { type TPromsterOptions, createMiddleware, getRequestRecorder, signalIsUp, signalIsNotUp, getSummary, getContentType, Prometheus, defaultRegister, defaultNormalizers, timing, };
4
4
  export * from '@promster/types';
@@ -1,2 +1,2 @@
1
- import { type TPromsterOptions, createMiddleware, getRequestRecorder, signalIsUp, signalIsNotUp } from "./middleware.js";
1
+ import { type TPromsterOptions, createMiddleware, getRequestRecorder, signalIsNotUp, signalIsUp } from "./middleware.js";
2
2
  export { type TPromsterOptions, createMiddleware, signalIsUp, signalIsNotUp, getRequestRecorder, };
@@ -1,6 +1,6 @@
1
- import { type TOptionalPromsterOptions, type TLabelValues } from '@promster/types';
2
- import { type TRequestRecorder } from '@promster/metrics';
3
- import { type Application, type Request, type Response, type NextFunction } from 'express';
1
+ import type { TRequestRecorder } from '@promster/metrics';
2
+ import type { TLabelValues, TOptionalPromsterOptions } from '@promster/types';
3
+ import type { Application, NextFunction, Request, Response } from 'express';
4
4
  import { Prometheus } from '@promster/metrics';
5
5
  interface TApp extends Application {
6
6
  locals: Record<string, unknown>;
@@ -1,2 +1,2 @@
1
- export * from "./declarations/src/index";
1
+ export * from "./declarations/src/index.js";
2
2
  //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvbXN0ZXItZXhwcmVzcy5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
@@ -2,22 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var merge = require('merge-options');
6
5
  var metrics = require('@promster/metrics');
6
+ var merge = require('merge-options');
7
7
  var types = require('@promster/types');
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
10
10
 
11
11
  var merge__default = /*#__PURE__*/_interopDefault(merge);
12
12
 
13
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
14
-
15
13
  const exposeOnLocals = ({
16
14
  app,
17
15
  key,
18
16
  value
19
17
  }) => {
20
- if (app !== null && app !== void 0 && app.locals) app.locals[key] = value;
18
+ if (app !== null && app !== void 0 && app.locals) {
19
+ app.locals[key] = value;
20
+ }
21
21
  };
22
22
  const extractPath = req => req.originalUrl || req.url;
23
23
  let recordRequest;
@@ -27,17 +27,17 @@ const signalIsUp = () => {
27
27
  if (!upMetric) {
28
28
  return;
29
29
  }
30
- upMetric.forEach(upMetricType => {
30
+ for (const upMetricType of upMetric) {
31
31
  upMetricType.set(1);
32
- });
32
+ }
33
33
  };
34
34
  const signalIsNotUp = () => {
35
35
  if (!upMetric) {
36
36
  return;
37
37
  }
38
- upMetric.forEach(upMetricType => {
38
+ for (const upMetricType of upMetric) {
39
39
  upMetricType.set(0);
40
- });
40
+ }
41
41
  };
42
42
  const createMiddleware = ({
43
43
  app,
@@ -77,7 +77,6 @@ const createMiddleware = ({
77
77
  req: request,
78
78
  res: response
79
79
  }),
80
- // eslint-disable-next-line camelcase
81
80
  status_code: allDefaultedOptions.normalizeStatusCode(response.statusCode, {
82
81
  req: request,
83
82
  res: response
@@ -2,22 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var merge = require('merge-options');
6
5
  var metrics = require('@promster/metrics');
6
+ var merge = require('merge-options');
7
7
  var types = require('@promster/types');
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
10
10
 
11
11
  var merge__default = /*#__PURE__*/_interopDefault(merge);
12
12
 
13
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
14
-
15
13
  const exposeOnLocals = ({
16
14
  app,
17
15
  key,
18
16
  value
19
17
  }) => {
20
- if (app !== null && app !== void 0 && app.locals) app.locals[key] = value;
18
+ if (app !== null && app !== void 0 && app.locals) {
19
+ app.locals[key] = value;
20
+ }
21
21
  };
22
22
  const extractPath = req => req.originalUrl || req.url;
23
23
  let recordRequest;
@@ -27,17 +27,17 @@ const signalIsUp = () => {
27
27
  if (!upMetric) {
28
28
  return;
29
29
  }
30
- upMetric.forEach(upMetricType => {
30
+ for (const upMetricType of upMetric) {
31
31
  upMetricType.set(1);
32
- });
32
+ }
33
33
  };
34
34
  const signalIsNotUp = () => {
35
35
  if (!upMetric) {
36
36
  return;
37
37
  }
38
- upMetric.forEach(upMetricType => {
38
+ for (const upMetricType of upMetric) {
39
39
  upMetricType.set(0);
40
- });
40
+ }
41
41
  };
42
42
  const createMiddleware = ({
43
43
  app,
@@ -77,7 +77,6 @@ const createMiddleware = ({
77
77
  req: request,
78
78
  res: response
79
79
  }),
80
- // eslint-disable-next-line camelcase
81
80
  status_code: allDefaultedOptions.normalizeStatusCode(response.statusCode, {
82
81
  req: request,
83
82
  res: response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promster/express",
3
- "version": "14.0.0",
3
+ "version": "15.0.1",
4
4
  "description": "Express server integrations of promster",
5
5
  "main": "dist/promster-express.cjs.js",
6
6
  "typings": "dist/promster-express.cjs.d.ts",
@@ -36,15 +36,15 @@
36
36
  "prometheus"
37
37
  ],
38
38
  "dependencies": {
39
- "@promster/metrics": "^14.0.0",
40
- "@promster/types": "^14.0.0",
41
39
  "merge-options": "3.0.4",
42
- "tslib": "2.6.2"
40
+ "tslib": "2.8.1",
41
+ "@promster/metrics": "15.0.1",
42
+ "@promster/types": "15.0.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/express": "4.17.21",
46
- "express": "4.19.2",
46
+ "express": "4.21.2",
47
47
  "parse-prometheus-text-format": "1.1.1",
48
- "@promster/server": "14.0.0"
48
+ "@promster/server": "15.0.1"
49
49
  }
50
50
  }