@promster/types 3.0.1 → 3.1.3

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,29 +1,33 @@
1
- import { Gauge, Counter, Summary, Histogram } from 'prom-client';
2
- export declare type TLabelValues = Record<string, string | number>;
3
- export declare type TPromsterOptions = {
4
- labels?: string[];
5
- accuracies?: Array<'ms' | 's'>;
6
- metricPrefix?: string;
7
- metricTypes?: string[];
8
- metricNames?: Record<string, string | string[]>;
9
- normalizePath?: (path: string) => string;
10
- normalizeStatusCode?: (code: number) => number;
11
- normalizeMethod?: (method: string) => string;
12
- getLabelValues?: <Q, S>(request: Q, response: S) => TLabelValues;
13
- detectKubernetes?: boolean;
14
- buckets?: [number];
15
- percentiles?: [number];
16
- skip?: <Q, S>(request: Q, response: S, labels: TLabelValues) => boolean;
17
- };
18
- export declare type TMetricTypes = {
19
- up: Array<Gauge<string>>;
20
- countOfGcs: Array<Counter<string>>;
21
- durationOfGc: Array<Counter<string>>;
22
- reclaimedInGc: Array<Counter<string>>;
23
- httpRequestDurationPerPercentileInMilliseconds: Array<Summary<string>>;
24
- httpRequestDurationInMilliseconds: Array<Histogram<string>>;
25
- httpRequestDurationPerPercentileInSeconds: Array<Summary<string>>;
26
- httpRequestDurationInSeconds: Array<Histogram<string>>;
27
- httpRequestsTotal: Array<Counter<string>>;
28
- };
29
- export declare type TValueOf<T> = T[keyof T];
1
+ import type { DeepRequired } from 'ts-essentials';
2
+ import { Gauge, Counter, Summary, Histogram } from 'prom-client';
3
+ export declare type TLabelValues = Record<string, string | number>;
4
+ export declare type TPromsterOptions = {
5
+ labels?: string[];
6
+ accuracies?: Array<'ms' | 's'>;
7
+ metricPrefix?: string;
8
+ metricTypes?: string[];
9
+ metricNames?: Record<string, string | string[]>;
10
+ normalizePath?: (path: string) => string;
11
+ normalizeStatusCode?: (code: number) => number;
12
+ normalizeMethod?: (method: string) => string;
13
+ getLabelValues?: <Q, S>(request: Q, response: S) => TLabelValues;
14
+ detectKubernetes?: boolean;
15
+ buckets?: [number];
16
+ percentiles?: [number];
17
+ skip?: <Q, S>(request: Q, response: S, labels: TLabelValues) => boolean;
18
+ };
19
+ export declare type TDefaultedPromsterOptions = DeepRequired<TPromsterOptions>;
20
+ export declare type TMetricTypes = {
21
+ up: Array<Gauge<string>>;
22
+ countOfGcs: Array<Counter<string>>;
23
+ durationOfGc: Array<Counter<string>>;
24
+ reclaimedInGc: Array<Counter<string>>;
25
+ httpRequestDurationPerPercentileInMilliseconds: Array<Summary<string>>;
26
+ httpRequestDurationInMilliseconds: Array<Histogram<string>>;
27
+ httpRequestDurationPerPercentileInSeconds: Array<Summary<string>>;
28
+ httpRequestDurationInSeconds: Array<Histogram<string>>;
29
+ httpRequestsTotal: Array<Counter<string>>;
30
+ httpRequestContentLengthInBytes: Array<Histogram<string>>;
31
+ httpResponseContentLengthInBytes: Array<Histogram<string>>;
32
+ };
33
+ export declare type TValueOf<T> = T[keyof T];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promster/types",
3
- "version": "3.0.1",
3
+ "version": "3.1.3",
4
4
  "description": "Shared types of promster",
5
5
  "main": "dist/promster-types.cjs.js",
6
6
  "typings": "dist/promster-types.cjs.d.ts",
@@ -35,9 +35,9 @@
35
35
  "prometheus"
36
36
  ],
37
37
  "devDependencies": {
38
- "prom-client": "13.1.0"
38
+ "prom-client": "14.0.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "prom-client": "13.x.x"
41
+ "prom-client": "13.x.x || 14.x"
42
42
  }
43
43
  }
package/CHANGELOG.md DELETED
@@ -1,70 +0,0 @@
1
- # @promster/types
2
-
3
- ## 3.0.1
4
-
5
- ### Patch Changes
6
-
7
- - [#601](https://github.com/tdeekens/promster/pull/601) [`17a24dc`](https://github.com/tdeekens/promster/commit/17a24dc0d735478001524c853b9f54f862153852) Thanks [@tdeekens](https://github.com/tdeekens)! - Update dependencies and apply eslint rule suggestions.
8
-
9
- ## 3.0.0
10
-
11
- ### Major Changes
12
-
13
- - [`daf8605`](https://github.com/tdeekens/promster/commit/daf86055e64cb420c83dbc7abbcd5024d449c53f) [#557](https://github.com/tdeekens/promster/pull/557) Thanks [@tdeekens](https://github.com/tdeekens)! - # Breaking Changes
14
-
15
- This requires your to update your peer dependency of `prom-client` to v13.
16
-
17
- The new version of `prom-client` has additional small breaking changes `promster` has to incorporate which can leak into your application.
18
-
19
- If you do not use our `@promster/server` package and have a `res.send(register.metrics())` you have to change it to `res.send(await register.metrics())`.
20
-
21
- You can find more on the `prom-client` changes [here](https://github.com/siimon/prom-client/blob/master/CHANGELOG.md).
22
-
23
- ## 2.0.0
24
-
25
- ### Major Changes
26
-
27
- - [`0eb64ca`](https://github.com/tdeekens/promster/commit/0eb64cac9a4a51dab1a556f46c97a2a5542bcc88) [#529](https://github.com/tdeekens/promster/pull/529) Thanks [@tdeekens](https://github.com/tdeekens)! - # Introduction
28
-
29
- refactor: to use preconstruct for building
30
-
31
- Prior TypeScript was used to build bundles. In all this should not affect consumers of this library. Under the hood preconstruct uses rollup and babel which is now instructed to build for Node.js v12 using the preset-env preset.
32
-
33
- # Breaking Change
34
-
35
- This release can _potentially_ be breaking for you. We want to respect semantic versioning and follow it strictly.
36
-
37
- While migrating to preconstruct the `version` exports had to be removed as preconstruct's rollup will not resolve them. If you relied on this value you should either load the `package.json` of each module yourself or drop the usage.
38
-
39
- ```diff
40
- - const { version } = require('@promster/server');
41
- + const { version } = require('@promster/server/package.json');
42
- ```
43
-
44
- ### Patch Changes
45
-
46
- - [`bdf75de`](https://github.com/tdeekens/promster/commit/bdf75dec8d0ce6be65ecccf5963f348e1a0a96b3) [#531](https://github.com/tdeekens/promster/pull/531) Thanks [@tdeekens](https://github.com/tdeekens)! - fix: update dependencies
47
-
48
- ## 1.0.8
49
-
50
- ### Patch Changes
51
-
52
- - [`158e7b9`](https://github.com/tdeekens/promster/commit/158e7b9af01133db54376bb96dbdccdd96bfa7a3) Thanks [@tdeekens](https://github.com/tdeekens)! - Dependency updates across all packages
53
-
54
- ## 1.0.7
55
-
56
- ### Patch Changes
57
-
58
- - [`3d1c10c`](https://github.com/tdeekens/promster/commit/3d1c10c4403374b7557ce4e8ab0e92235f869a21) [#460](https://github.com/tdeekens/promster/pull/460) Thanks [@kppullin](https://github.com/kppullin)! - Add `skip` to typedefs
59
-
60
- ## 1.0.6
61
-
62
- ### Patch Changes
63
-
64
- - [`c3caa55`](https://github.com/tdeekens/promster/commit/c3caa5569b59928a3ca8976ae05c66c2f51a385a) [#379](https://github.com/tdeekens/promster/pull/379) Thanks [@roikoren755](https://github.com/roikoren755)! - fix(types): update TPromsterOptions
65
-
66
- ## 1.0.5
67
-
68
- ### Patch Changes
69
-
70
- - [`6f99f64`](https://github.com/tdeekens/promster/commit/6f99f644ccd2cd0b60c172968266c3ac3f76e826) [#360](https://github.com/tdeekens/promster/pull/360) Thanks [@tdeekens](https://github.com/tdeekens)! - Update to eslint v7