@promster/types 2.0.0 → 3.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.
@@ -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": "2.0.0",
3
+ "version": "3.1.1",
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": "12.0.0"
38
+ "prom-client": "13.2.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "prom-client": "12.x.x"
41
+ "prom-client": "13.x.x"
42
42
  }
43
43
  }
package/CHANGELOG.md DELETED
@@ -1,50 +0,0 @@
1
- # @promster/types
2
-
3
- ## 2.0.0
4
-
5
- ### Major Changes
6
-
7
- - [`0eb64ca`](https://github.com/tdeekens/promster/commit/0eb64cac9a4a51dab1a556f46c97a2a5542bcc88) [#529](https://github.com/tdeekens/promster/pull/529) Thanks [@tdeekens](https://github.com/tdeekens)! - # Introduction
8
-
9
- refactor: to use preconstruct for building
10
-
11
- 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.
12
-
13
- # Breaking Change
14
-
15
- This release can _potentially_ be breaking for you. We want to respect semantic versioning and follow it strictly.
16
-
17
- 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.
18
-
19
- ```diff
20
- - const { version } = require('@promster/server');
21
- + const { version } = require('@promster/server/package.json');
22
- ```
23
-
24
- ### Patch Changes
25
-
26
- - [`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
27
-
28
- ## 1.0.8
29
-
30
- ### Patch Changes
31
-
32
- - [`158e7b9`](https://github.com/tdeekens/promster/commit/158e7b9af01133db54376bb96dbdccdd96bfa7a3) Thanks [@tdeekens](https://github.com/tdeekens)! - Dependency updates across all packages
33
-
34
- ## 1.0.7
35
-
36
- ### Patch Changes
37
-
38
- - [`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
39
-
40
- ## 1.0.6
41
-
42
- ### Patch Changes
43
-
44
- - [`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
45
-
46
- ## 1.0.5
47
-
48
- ### Patch Changes
49
-
50
- - [`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