@sebspark/health-check 3.0.10 → 3.0.12
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/CHANGELOG.md +436 -0
- package/dist/index.d.mts +28 -29
- package/dist/index.d.mts.map +1 -1
- package/package.json +15 -10
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
# @sebspark/health-check
|
|
2
|
+
|
|
3
|
+
## 3.0.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9f44fbd: Updated dependencies
|
|
8
|
+
- Updated dependencies [9f44fbd]
|
|
9
|
+
- @sebspark/hyper-media@0.1.6
|
|
10
|
+
- @sebspark/promise-cache@8.1.7
|
|
11
|
+
|
|
12
|
+
## 3.0.11
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 66ac832: * Upgraded to TypeScript 7
|
|
17
|
+
- Replaced tsup with tsdown for package builds
|
|
18
|
+
- Fixed cli-tester stdout parsing, resolving flaky e2e tests across the repo
|
|
19
|
+
- Patched vulnerable transitive dependencies (uuid, socket.io-parser, and others)
|
|
20
|
+
- Updated dependencies [66ac832]
|
|
21
|
+
- @sebspark/hyper-media@0.1.5
|
|
22
|
+
- @sebspark/promise-cache@8.1.6
|
|
23
|
+
|
|
24
|
+
## 3.0.10
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- eefb531: Updated dependencies
|
|
29
|
+
- Updated dependencies [eefb531]
|
|
30
|
+
- @sebspark/promise-cache@8.1.5
|
|
31
|
+
|
|
32
|
+
## 3.0.9
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- 5e9fc45: Bump dependencies. Security fixes:
|
|
37
|
+
|
|
38
|
+
- **form-data** 2.5.6 / 4.0.6 — CRLF injection via unescaped multipart field names and filenames (High)
|
|
39
|
+
- **vite** 8.1.2 — `server.fs.deny` bypass on Windows alternate paths; NTLMv2 hash disclosure via launch-editor (High/Moderate)
|
|
40
|
+
- **ws** 8.21.0 — Memory exhaustion DoS from tiny fragments; uninitialized memory disclosure (High/Moderate)
|
|
41
|
+
- **undici** 8.5.0 — Multiple DoS and information disclosure CVEs (High/Moderate/Low)
|
|
42
|
+
- **tar** 7.5.19 — PAX size override causes tar parser differential / file smuggling (Moderate)
|
|
43
|
+
- **qs** 6.15.3 — DoS via `qs.stringify` crash on null/undefined entries (Moderate)
|
|
44
|
+
- **@opentelemetry/core** 2.8.0 — Unbounded memory allocation in W3C Baggage propagation (Moderate)
|
|
45
|
+
- **@babel/core** 7.29.7 — Arbitrary file read via sourceMappingURL comment (Low)
|
|
46
|
+
- **protobufjs** 8.6.5
|
|
47
|
+
|
|
48
|
+
Other dependency updates:
|
|
49
|
+
|
|
50
|
+
- `@google-cloud/spanner` 8.8.0
|
|
51
|
+
- `@testcontainers/*` 12.0.4
|
|
52
|
+
- `google-auth-library` 10.9.0
|
|
53
|
+
- `mockserver-client` 7.3.0
|
|
54
|
+
- `nock` 14.0.16
|
|
55
|
+
- `prettier` 3.9.4
|
|
56
|
+
- `redis` 6.1.0
|
|
57
|
+
- `webpack` 5.108.3 / `webpack-cli` 7.1.0
|
|
58
|
+
|
|
59
|
+
- Updated dependencies [5e9fc45]
|
|
60
|
+
- @sebspark/promise-cache@8.1.4
|
|
61
|
+
|
|
62
|
+
## 3.0.8
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- e0eda57: Updated dependencies
|
|
67
|
+
- Updated dependencies [e0eda57]
|
|
68
|
+
- @sebspark/promise-cache@8.1.3
|
|
69
|
+
|
|
70
|
+
## 3.0.7
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- 26d55f0: Fix `@sebspark/memredis` so Redis clients are assignable to `IPersistor` by widening the pub/sub subscription return types to accept both MemRedis and node-redis implementations.
|
|
75
|
+
|
|
76
|
+
Also update supporting dependencies across the affected packages.
|
|
77
|
+
|
|
78
|
+
- Updated dependencies [26d55f0]
|
|
79
|
+
- @sebspark/promise-cache@8.1.2
|
|
80
|
+
|
|
81
|
+
## 3.0.6
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- a6c27f3: Updated dependencies
|
|
86
|
+
- Updated dependencies [a6c27f3]
|
|
87
|
+
- @sebspark/promise-cache@8.1.1
|
|
88
|
+
|
|
89
|
+
## 3.0.5
|
|
90
|
+
|
|
91
|
+
### Patch Changes
|
|
92
|
+
|
|
93
|
+
- Updated dependencies [0fad123]
|
|
94
|
+
- @sebspark/promise-cache@8.1.0
|
|
95
|
+
|
|
96
|
+
## 3.0.4
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- 97fe7da: Updated dependencies
|
|
101
|
+
- @sebspark/promise-cache@8.0.2
|
|
102
|
+
|
|
103
|
+
## 3.0.3
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- Updated dependencies [494f9b3]
|
|
108
|
+
- @sebspark/promise-cache@8.0.1
|
|
109
|
+
|
|
110
|
+
## 3.0.2
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- 264e665: Upgrade `redis` to v6 in `@sebspark/promise-cache` and bump minor dependencies across the workspace.
|
|
115
|
+
|
|
116
|
+
**Breaking change (`@sebspark/promise-cache`):**
|
|
117
|
+
`redis` upgraded from `5.12.1` → `6.0.0`. Redis v6 contains breaking changes in its API — see the [redis v6 migration guide](https://github.com/redis/node-redis/blob/master/docs/v4-to-v6.md) if your code uses the client directly.
|
|
118
|
+
|
|
119
|
+
**Dependency updates across packages:**
|
|
120
|
+
- `testcontainers` / `@testcontainers/*`: `12.0.0` → `12.0.1` (health-check, opensearch, opentelemetry-instrumentation-opensearch, otel, promise-cache, socket.io-gcp-pubsub-emitter, spanner-migrate, test-iap)
|
|
121
|
+
- `redis`: `5.12.1` → `6.0.0` (otel, promise-cache)
|
|
122
|
+
- `tsdown`: `0.22.0` → `0.22.1` (tsconfig)
|
|
123
|
+
- `turbo` / `@turbo/gen`: `2.9.15` → `2.9.16`
|
|
124
|
+
- `webpack-cli`: `7.0.2` → `7.0.3` (avsc-isometric)
|
|
125
|
+
|
|
126
|
+
**Test fix (`@sebspark/promise-cache`):**
|
|
127
|
+
Pinned Redis container image tag to `redis:8.8-alpine` (was `redis:8-alpine`) to prevent floating-tag drift in e2e tests.
|
|
128
|
+
|
|
129
|
+
- Updated dependencies [264e665]
|
|
130
|
+
- @sebspark/promise-cache@8.0.0
|
|
131
|
+
|
|
132
|
+
## 3.0.1
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- 242eb33: This release primarily updates dependencies across the listed packages, including:
|
|
137
|
+
- Testcontainers v12 upgrades in packages that run integration/e2e tests.
|
|
138
|
+
- Vitest/Biome/Turbo and related tooling updates.
|
|
139
|
+
- Runtime dependency updates such as `date-fns`, `@inquirer/*`, `socket.io-adapter`, and `ws`.
|
|
140
|
+
|
|
141
|
+
It also includes two targeted fixes:
|
|
142
|
+
- `@sebspark/opensearch`: fixed TypeScript compatibility so strict `SearchRequest<T>` / `SearchRequestBody<T>` can be assigned to OpenSearch API request types, and added a compile-time compatibility test.
|
|
143
|
+
- `@sebspark/health-check`: updated the e2e readiness payload assertions and type-only import usage to match current runtime output and TypeScript expectations.
|
|
144
|
+
|
|
145
|
+
- Updated dependencies [242eb33]
|
|
146
|
+
- @sebspark/promise-cache@7.0.4
|
|
147
|
+
|
|
148
|
+
## 3.0.0
|
|
149
|
+
|
|
150
|
+
### Major Changes
|
|
151
|
+
|
|
152
|
+
- 48ffa3b: **Breaking:** The `System` and `Process` types returned by the `/health/live` endpoint no longer include fingerprinting fields that could be exploited by an attacker.
|
|
153
|
+
|
|
154
|
+
Removed from `system`: `hostname`, `platform`, `release`, `arch`, `cpus.model`, `cpus.speedMHz`.
|
|
155
|
+
|
|
156
|
+
Removed from `process`: `pid`, `node`.
|
|
157
|
+
|
|
158
|
+
These fields were accessible without authentication and disclosed OS version, kernel release, CPU model, Node.js version, and process ID — all useful for targeted exploitation. The endpoint now only exposes load metrics: `uptime`, `loadavg`, `totalmem`, `freemem`, `memUsedRatio`, `cpus.count`, `process.uptime`, and `process.memory`.
|
|
159
|
+
|
|
160
|
+
## 2.3.12
|
|
161
|
+
|
|
162
|
+
### Patch Changes
|
|
163
|
+
|
|
164
|
+
- c5e9c99: Resolve protobufjs CVE by pinning to `8.3.0` across all affected packages via root resolutions. Upgraded OpenTelemetry packages to `0.218.0` (which also eliminates the previous hardpin on `protobufjs@8.0.1`), `axios` to `1.16.1`, `ws` to `8.20.1`, `qs` to `6.15.2`, and `@opentelemetry/semantic-conventions` to `1.41.1`.
|
|
165
|
+
- Updated dependencies [c5e9c99]
|
|
166
|
+
- @sebspark/promise-cache@7.0.3
|
|
167
|
+
|
|
168
|
+
## 2.3.11
|
|
169
|
+
|
|
170
|
+
### Patch Changes
|
|
171
|
+
|
|
172
|
+
- @sebspark/promise-cache@7.0.2
|
|
173
|
+
|
|
174
|
+
## 2.3.10
|
|
175
|
+
|
|
176
|
+
### Patch Changes
|
|
177
|
+
|
|
178
|
+
- @sebspark/promise-cache@7.0.1
|
|
179
|
+
|
|
180
|
+
## 2.3.9
|
|
181
|
+
|
|
182
|
+
### Patch Changes
|
|
183
|
+
|
|
184
|
+
- Updated dependencies [55e3708]
|
|
185
|
+
- @sebspark/promise-cache@7.0.0
|
|
186
|
+
|
|
187
|
+
## 2.3.8
|
|
188
|
+
|
|
189
|
+
### Patch Changes
|
|
190
|
+
|
|
191
|
+
- Updated dependencies [5ed6ece]
|
|
192
|
+
- @sebspark/promise-cache@6.6.0
|
|
193
|
+
|
|
194
|
+
## 2.3.7
|
|
195
|
+
|
|
196
|
+
### Patch Changes
|
|
197
|
+
|
|
198
|
+
- Updated dependencies [2cff3d4]
|
|
199
|
+
- @sebspark/promise-cache@6.5.0
|
|
200
|
+
|
|
201
|
+
## 2.3.6
|
|
202
|
+
|
|
203
|
+
### Patch Changes
|
|
204
|
+
|
|
205
|
+
- @sebspark/promise-cache@6.4.29
|
|
206
|
+
|
|
207
|
+
## 2.3.5
|
|
208
|
+
|
|
209
|
+
### Patch Changes
|
|
210
|
+
|
|
211
|
+
- 7d8cc98: Dependabot dependency updates
|
|
212
|
+
- Updated dependencies [7d8cc98]
|
|
213
|
+
- @sebspark/hyper-media@0.1.4
|
|
214
|
+
- @sebspark/promise-cache@6.4.28
|
|
215
|
+
|
|
216
|
+
## 2.3.4
|
|
217
|
+
|
|
218
|
+
### Patch Changes
|
|
219
|
+
|
|
220
|
+
- @sebspark/promise-cache@6.4.27
|
|
221
|
+
|
|
222
|
+
## 2.3.3
|
|
223
|
+
|
|
224
|
+
### Patch Changes
|
|
225
|
+
|
|
226
|
+
- Updated dependencies [764bac9]
|
|
227
|
+
- @sebspark/promise-cache@6.4.26
|
|
228
|
+
|
|
229
|
+
## 2.3.2
|
|
230
|
+
|
|
231
|
+
### Patch Changes
|
|
232
|
+
|
|
233
|
+
- e9a7a28: Updated dependencies
|
|
234
|
+
- @sebspark/promise-cache@6.4.25
|
|
235
|
+
|
|
236
|
+
## 2.3.1
|
|
237
|
+
|
|
238
|
+
### Patch Changes
|
|
239
|
+
|
|
240
|
+
- @sebspark/promise-cache@6.4.24
|
|
241
|
+
|
|
242
|
+
## 2.3.0
|
|
243
|
+
|
|
244
|
+
### Minor Changes
|
|
245
|
+
|
|
246
|
+
- 6399280: Health check now has ddos protection. Type fix in promise-cache.
|
|
247
|
+
|
|
248
|
+
### Patch Changes
|
|
249
|
+
|
|
250
|
+
- Updated dependencies [6399280]
|
|
251
|
+
- @sebspark/promise-cache@6.4.23
|
|
252
|
+
|
|
253
|
+
## 2.2.4
|
|
254
|
+
|
|
255
|
+
### Patch Changes
|
|
256
|
+
|
|
257
|
+
- 4e12590: Updated dependencies
|
|
258
|
+
|
|
259
|
+
## 2.2.3
|
|
260
|
+
|
|
261
|
+
### Patch Changes
|
|
262
|
+
|
|
263
|
+
- 6db0b94: fix: do not count degraded as failing for critical dependencies
|
|
264
|
+
|
|
265
|
+
## 2.2.2
|
|
266
|
+
|
|
267
|
+
### Patch Changes
|
|
268
|
+
|
|
269
|
+
- 574264d: Updated dependencies
|
|
270
|
+
|
|
271
|
+
## 2.2.1
|
|
272
|
+
|
|
273
|
+
### Patch Changes
|
|
274
|
+
|
|
275
|
+
- acb0290: Changed import to type
|
|
276
|
+
|
|
277
|
+
## 2.2.0
|
|
278
|
+
|
|
279
|
+
### Minor Changes
|
|
280
|
+
|
|
281
|
+
- 6d72f97: Dependency monitors can now report status details
|
|
282
|
+
|
|
283
|
+
## 2.1.1
|
|
284
|
+
|
|
285
|
+
### Patch Changes
|
|
286
|
+
|
|
287
|
+
- 736a0b3: No bundling of packages in packages
|
|
288
|
+
- Updated dependencies [736a0b3]
|
|
289
|
+
- @sebspark/hyper-media@0.1.3
|
|
290
|
+
|
|
291
|
+
## 2.1.0
|
|
292
|
+
|
|
293
|
+
### Minor Changes
|
|
294
|
+
|
|
295
|
+
- 903a0fb: chore: /ready should not return 200 if not ready
|
|
296
|
+
|
|
297
|
+
## 2.0.3
|
|
298
|
+
|
|
299
|
+
### Patch Changes
|
|
300
|
+
|
|
301
|
+
- 112a381: Updated dependencies
|
|
302
|
+
|
|
303
|
+
## 2.0.2
|
|
304
|
+
|
|
305
|
+
### Patch Changes
|
|
306
|
+
|
|
307
|
+
- Updated dependencies [695837c]
|
|
308
|
+
- @sebspark/hyper-media@0.1.2
|
|
309
|
+
|
|
310
|
+
## 2.0.1
|
|
311
|
+
|
|
312
|
+
### Patch Changes
|
|
313
|
+
|
|
314
|
+
- aaa50ea: Healthcheck now uses Hypermedia. Hypermedia got better jsdocs.
|
|
315
|
+
- Updated dependencies [aaa50ea]
|
|
316
|
+
- @sebspark/hyper-media@0.1.1
|
|
317
|
+
|
|
318
|
+
## 2.0.0
|
|
319
|
+
|
|
320
|
+
### Major Changes
|
|
321
|
+
|
|
322
|
+
- 6037a11: Links changed to entities with hypermedia links
|
|
323
|
+
|
|
324
|
+
## 1.0.14
|
|
325
|
+
|
|
326
|
+
### Patch Changes
|
|
327
|
+
|
|
328
|
+
- 35ec1a0: Updated dependencies
|
|
329
|
+
|
|
330
|
+
## 1.0.13
|
|
331
|
+
|
|
332
|
+
### Patch Changes
|
|
333
|
+
|
|
334
|
+
- c8dcadb: Updated dependencies
|
|
335
|
+
|
|
336
|
+
## 1.0.12
|
|
337
|
+
|
|
338
|
+
### Patch Changes
|
|
339
|
+
|
|
340
|
+
- 11a11ce: Updated dependencies
|
|
341
|
+
|
|
342
|
+
## 1.0.10
|
|
343
|
+
|
|
344
|
+
### Patch Changes
|
|
345
|
+
|
|
346
|
+
- 48ab717: Updated dependencies
|
|
347
|
+
|
|
348
|
+
## 1.0.9
|
|
349
|
+
|
|
350
|
+
### Patch Changes
|
|
351
|
+
|
|
352
|
+
- 87c769d: Updated dependencies
|
|
353
|
+
|
|
354
|
+
## 1.0.8
|
|
355
|
+
|
|
356
|
+
### Patch Changes
|
|
357
|
+
|
|
358
|
+
- e0cb5ee: Updated build from tsup to tsdown
|
|
359
|
+
|
|
360
|
+
## 1.0.7
|
|
361
|
+
|
|
362
|
+
### Patch Changes
|
|
363
|
+
|
|
364
|
+
- 8626deb: Updated vulnerable, transitive jws dependency
|
|
365
|
+
|
|
366
|
+
## 1.0.6
|
|
367
|
+
|
|
368
|
+
### Patch Changes
|
|
369
|
+
|
|
370
|
+
- 7df8217: Updated dependencies
|
|
371
|
+
|
|
372
|
+
## 1.0.5
|
|
373
|
+
|
|
374
|
+
### Patch Changes
|
|
375
|
+
|
|
376
|
+
- ef9ccdc: Updated to latest express version
|
|
377
|
+
|
|
378
|
+
## 1.0.4
|
|
379
|
+
|
|
380
|
+
### Patch Changes
|
|
381
|
+
|
|
382
|
+
- 5bf3ac7: chore: update dependencies for express-serve-static-core
|
|
383
|
+
|
|
384
|
+
## 1.0.3
|
|
385
|
+
|
|
386
|
+
### Patch Changes
|
|
387
|
+
|
|
388
|
+
- 4b210c2: Standardized on a common build script
|
|
389
|
+
|
|
390
|
+
## 1.0.2
|
|
391
|
+
|
|
392
|
+
### Patch Changes
|
|
393
|
+
|
|
394
|
+
- 7e5c2e9: Switched to new tsconfig with moduleResolution=bundler
|
|
395
|
+
|
|
396
|
+
## 1.0.1
|
|
397
|
+
|
|
398
|
+
### Patch Changes
|
|
399
|
+
|
|
400
|
+
- 512cdc5: DependencyMonitor is now exposed
|
|
401
|
+
|
|
402
|
+
## 1.0.0
|
|
403
|
+
|
|
404
|
+
### Major Changes
|
|
405
|
+
|
|
406
|
+
- 0864ec2: Minimum node version 22
|
|
407
|
+
|
|
408
|
+
## 0.1.4
|
|
409
|
+
|
|
410
|
+
### Patch Changes
|
|
411
|
+
|
|
412
|
+
- 3a40e49: Cleaned up dependencies
|
|
413
|
+
|
|
414
|
+
## 0.1.3
|
|
415
|
+
|
|
416
|
+
### Patch Changes
|
|
417
|
+
|
|
418
|
+
- 604c94a: Updated dependencies
|
|
419
|
+
|
|
420
|
+
## 0.1.2
|
|
421
|
+
|
|
422
|
+
### Patch Changes
|
|
423
|
+
|
|
424
|
+
- 29b9b20: Updated dependencies
|
|
425
|
+
|
|
426
|
+
## 0.1.1
|
|
427
|
+
|
|
428
|
+
### Patch Changes
|
|
429
|
+
|
|
430
|
+
- 5c6e183: Updated dependencies
|
|
431
|
+
|
|
432
|
+
## 0.1.0
|
|
433
|
+
|
|
434
|
+
### Minor Changes
|
|
435
|
+
|
|
436
|
+
- d6970ac: A health check handler for your API
|
package/dist/index.d.mts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { Router } from "express";
|
|
2
2
|
//#region src/types.d.ts
|
|
3
|
-
type DependencyStatusValue = 'ok' | 'degraded' | 'error';
|
|
4
|
-
type DependencyStatus = {
|
|
3
|
+
export type DependencyStatusValue = 'ok' | 'degraded' | 'error';
|
|
4
|
+
export type DependencyStatus = {
|
|
5
5
|
status: DependencyStatusValue;
|
|
6
6
|
details?: Record<string, unknown> | undefined;
|
|
7
7
|
};
|
|
8
|
-
type StatusValue = DependencyStatusValue | 'unknown' | 'draining';
|
|
9
|
-
type Impact = 'critical' | 'non_critical';
|
|
10
|
-
type Mode = 'inline' | 'polled' | 'async';
|
|
11
|
-
type Verb = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
12
|
-
type Link = {
|
|
8
|
+
export type StatusValue = DependencyStatusValue | 'unknown' | 'draining';
|
|
9
|
+
export type Impact = 'critical' | 'non_critical';
|
|
10
|
+
export type Mode = 'inline' | 'polled' | 'async';
|
|
11
|
+
export type Verb = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
12
|
+
export type Link = {
|
|
13
13
|
method: Verb;
|
|
14
14
|
href: string;
|
|
15
15
|
};
|
|
16
|
-
interface Entity<T> {
|
|
16
|
+
export interface Entity<T> {
|
|
17
17
|
data: T;
|
|
18
18
|
links: Record<string, Link>;
|
|
19
19
|
}
|
|
20
|
-
type Status = {
|
|
20
|
+
export type Status = {
|
|
21
21
|
status: StatusValue;
|
|
22
22
|
};
|
|
23
|
-
type System = {
|
|
23
|
+
export type System = {
|
|
24
24
|
uptime: number;
|
|
25
25
|
loadavg: [number, number, number];
|
|
26
26
|
totalmem: number;
|
|
@@ -30,28 +30,28 @@ type System = {
|
|
|
30
30
|
count: number;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
type Process = {
|
|
33
|
+
export type Process = {
|
|
34
34
|
uptime: number;
|
|
35
35
|
memory: NodeJS.MemoryUsage;
|
|
36
36
|
};
|
|
37
|
-
type Liveness = Status & {
|
|
37
|
+
export type Liveness = Status & {
|
|
38
38
|
timestamp: string;
|
|
39
39
|
system: System;
|
|
40
40
|
process: Process;
|
|
41
41
|
};
|
|
42
|
-
type Freshness = {
|
|
42
|
+
export type Freshness = {
|
|
43
43
|
lastChecked: string;
|
|
44
44
|
lastSuccess: string | null;
|
|
45
45
|
};
|
|
46
|
-
type Observed = {
|
|
46
|
+
export type Observed = {
|
|
47
47
|
latencyMs: number | null;
|
|
48
48
|
[k: string]: unknown;
|
|
49
49
|
};
|
|
50
|
-
type CheckError = {
|
|
50
|
+
export type CheckError = {
|
|
51
51
|
code: string;
|
|
52
52
|
message: string;
|
|
53
53
|
};
|
|
54
|
-
type DependencyCheck = Status & {
|
|
54
|
+
export type DependencyCheck = Status & {
|
|
55
55
|
impact: Impact;
|
|
56
56
|
mode: Mode;
|
|
57
57
|
freshness: Freshness;
|
|
@@ -60,7 +60,7 @@ type DependencyCheck = Status & {
|
|
|
60
60
|
error?: CheckError | null;
|
|
61
61
|
since?: string | null;
|
|
62
62
|
};
|
|
63
|
-
type ReadinessSummary = {
|
|
63
|
+
export type ReadinessSummary = {
|
|
64
64
|
critical: {
|
|
65
65
|
ok: number;
|
|
66
66
|
degraded: number;
|
|
@@ -73,7 +73,7 @@ type ReadinessSummary = {
|
|
|
73
73
|
};
|
|
74
74
|
degradedReasons: string[];
|
|
75
75
|
};
|
|
76
|
-
type ReadinessPayload = Status & {
|
|
76
|
+
export type ReadinessPayload = Status & {
|
|
77
77
|
timestamp: string;
|
|
78
78
|
service?: {
|
|
79
79
|
name?: string;
|
|
@@ -83,13 +83,13 @@ type ReadinessPayload = Status & {
|
|
|
83
83
|
summary: ReadinessSummary;
|
|
84
84
|
checks: Record<string, DependencyCheck>;
|
|
85
85
|
};
|
|
86
|
-
type HealthSummary = Status & Pick<ReadinessPayload, 'summary' | 'checks'> & Pick<Liveness, 'system' | 'process'> & {
|
|
86
|
+
export type HealthSummary = Status & Pick<ReadinessPayload, 'summary' | 'checks'> & Pick<Liveness, 'system' | 'process'> & {
|
|
87
87
|
timestamp: string;
|
|
88
88
|
};
|
|
89
|
-
declare class TimeoutError extends Error {
|
|
89
|
+
export declare class TimeoutError extends Error {
|
|
90
90
|
constructor();
|
|
91
91
|
}
|
|
92
|
-
declare class UnknownError extends Error {
|
|
92
|
+
export declare class UnknownError extends Error {
|
|
93
93
|
constructor();
|
|
94
94
|
}
|
|
95
95
|
//#endregion
|
|
@@ -134,7 +134,7 @@ type BaseConfig = {
|
|
|
134
134
|
* Inline mode configuration (no polling).
|
|
135
135
|
* `syncCall` runs **only** when {@link DependencyMonitor.check} is invoked.
|
|
136
136
|
*/
|
|
137
|
-
type SyncInlineConfig = BaseConfig & {
|
|
137
|
+
export type SyncInlineConfig = BaseConfig & {
|
|
138
138
|
/** Performs the check immediately when {@link DependencyMonitor.check} is called. */
|
|
139
139
|
syncCall: () => Promise<DependencyStatus | DependencyStatusValue | Error>;
|
|
140
140
|
asyncCall?: never;
|
|
@@ -145,7 +145,7 @@ type SyncInlineConfig = BaseConfig & {
|
|
|
145
145
|
* Polled mode configuration.
|
|
146
146
|
* `syncCall` runs on an interval (`pollRate`) and results are cached.
|
|
147
147
|
*/
|
|
148
|
-
type SyncPolledConfig = BaseConfig & {
|
|
148
|
+
export type SyncPolledConfig = BaseConfig & {
|
|
149
149
|
/** Performs the check at each poll interval. */
|
|
150
150
|
syncCall: () => Promise<DependencyStatus | DependencyStatusValue | Error>;
|
|
151
151
|
/** Polling interval in milliseconds. */
|
|
@@ -156,7 +156,7 @@ type SyncPolledConfig = BaseConfig & {
|
|
|
156
156
|
* Async mode configuration.
|
|
157
157
|
* `asyncCall` starts a check and must report via the provided callback.
|
|
158
158
|
*/
|
|
159
|
-
type AsyncConfig = BaseConfig & {
|
|
159
|
+
export type AsyncConfig = BaseConfig & {
|
|
160
160
|
/**
|
|
161
161
|
* Starts an asynchronous check. Must call `reportResponse` once a result is available.
|
|
162
162
|
* The callback may be invoked with a `DependencyStatus | DependencyStatusValue` or an `Error`.
|
|
@@ -172,7 +172,7 @@ type AsyncConfig = BaseConfig & {
|
|
|
172
172
|
* - {@link SyncPolledConfig} → synchronous checks on a fixed interval
|
|
173
173
|
* - {@link AsyncConfig} → asynchronous checks that report back via callback
|
|
174
174
|
*/
|
|
175
|
-
type DependencyMonitorConfig = SyncInlineConfig | SyncPolledConfig | AsyncConfig;
|
|
175
|
+
export type DependencyMonitorConfig = SyncInlineConfig | SyncPolledConfig | AsyncConfig;
|
|
176
176
|
/**
|
|
177
177
|
* Tracks the health of a single dependency in one of three modes:
|
|
178
178
|
*
|
|
@@ -191,7 +191,7 @@ type DependencyMonitorConfig = SyncInlineConfig | SyncPolledConfig | AsyncConfig
|
|
|
191
191
|
* - `"error"` if returned `"error"`, an `Error`, or exceeded `timeoutLimitMs`
|
|
192
192
|
* - `"unknown"` is the initial state before first successful/failed result (polled/async)
|
|
193
193
|
*/
|
|
194
|
-
declare class DependencyMonitor {
|
|
194
|
+
export declare class DependencyMonitor {
|
|
195
195
|
/** Immutable configuration for this monitor. */
|
|
196
196
|
private readonly config;
|
|
197
197
|
/** Operational mode determined from the configuration. */
|
|
@@ -267,7 +267,7 @@ declare class DependencyMonitor {
|
|
|
267
267
|
}
|
|
268
268
|
//#endregion
|
|
269
269
|
//#region src/health-monitor.d.ts
|
|
270
|
-
interface HealthMonitorConfig {
|
|
270
|
+
export interface HealthMonitorConfig {
|
|
271
271
|
throttle: number;
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
@@ -302,7 +302,7 @@ interface HealthMonitorConfig {
|
|
|
302
302
|
* app.listen(3000)
|
|
303
303
|
* ```
|
|
304
304
|
*/
|
|
305
|
-
declare class HealthMonitor {
|
|
305
|
+
export declare class HealthMonitor {
|
|
306
306
|
private readonly _router;
|
|
307
307
|
private readonly dependencies;
|
|
308
308
|
private isDisposed;
|
|
@@ -386,5 +386,4 @@ declare class HealthMonitor {
|
|
|
386
386
|
dispose(): void;
|
|
387
387
|
}
|
|
388
388
|
//#endregion
|
|
389
|
-
export { AsyncConfig, CheckError, DependencyCheck, DependencyMonitor, DependencyMonitorConfig, DependencyStatus, DependencyStatusValue, Entity, Freshness, HealthMonitor, HealthMonitorConfig, HealthSummary, Impact, Link, Liveness, Mode, Observed, Process, ReadinessPayload, ReadinessSummary, Status, StatusValue, SyncInlineConfig, SyncPolledConfig, System, TimeoutError, UnknownError, Verb };
|
|
390
389
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/dependency-monitor.ts","../src/health-monitor.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/dependency-monitor.ts","../src/health-monitor.ts"],"mappings":";;YAAY;YACA;EACV,QAAQ;EACR,UAAU;;YAEA,cAAc;YACd;YACA;YAEA;YAEA;EACV,QAAQ;EACR;;iBAGe,OAAO;EACtB,MAAM;EACN,OAAO,eAAe;;YAGZ;EACV,QAAQ;;YAGE;EACV;EACA;EACA;EACA;EACA;EACA;IACE;;;YAIQ;EACV;EACA,QAAQ,OAAO;;YAGL,WAAW;EACrB;EACA,QAAQ;EACR,SAAS;;YAGC;EACV;EACA;;YAGU;EACV;GACC;;YAGS;EACV;EACA;;YAGU,kBAAkB;EAC5B,QAAQ;EACR,MAAM;EACN,WAAW;EACX,WAAW;EACX,UAAU;EACV,QAAQ;EACR;;YAGU;EACV;IAAY;IAAY;IAAkB;;EAC1C;IAAe;IAAY;IAAkB;;EAC7C;;YAGU,mBAAmB;EAC7B;EACA;IAAY;IAAe;IAAkB;;EAC7C,SAAS;EACT,QAAQ,eAAe;;YAGb,gBAAgB,SAC1B,KAAK,0CACL,KAAK;EAAoC;;qBAE9B,qBAAqB;EAChC;;qBAMW,qBAAqB;EAChC;;;;;;;KC9EG;;;;;;EAMH,QAAQ;;;;;;EAOR;;;;;;EAOA;;;;;;EAOA;;;;;;;EAQA;;;;;;YAOU,mBAAmB;;EAE7B,gBAAgB,QAAQ,mBAAmB,wBAAwB;EACnE;EACA;EACA;;;;;;YAOU,mBAAmB;;EAE7B,gBAAgB,QAAQ,mBAAmB,wBAAwB;;EAEnE;EACA;;;;;;YAOU,cAAc;;;;;EAKxB,YACE,iBACE,QAAQ,mBAAmB,wBAAwB,iBACzC,yBACF;;EAEZ;EACA;;;;;;;;YASU,0BACR,mBACA,mBACA;;;;;;;;;;;;;;;;;;;qBAoBS;;mBAEM;;mBAEA;;UAGT;;UAEA;;UAEA;;UAEA;;UAEA;;UAGA;;UAEA;;;;;EAMR,YAAY,QAAQ;;MAuBT,UAAM;;;;;;UASH;;;;;;;;UAsBA;;;;;;;UAqBA;;;;;;UAsCN;;;;;UAyCA;;;;;;;EA4BK,SAAS,QAAQ;;GAuBtB,OAAO;;;;;;EASR;;;;iBC/VQ;EACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmCW;mBACM;mBACA;UACT;;;;EAKR,YAAY,SAAS;;;;;;;;;;;;;;;;;EA0Bd,cAAc,cAAc,YAAY;;;;UAQvC;;;;EAmGD,QA3GwC;;;;EAkHxC,QAPI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCE,SAAS,QAAQ;EAkHjB,UAAM,QAAA;;;;MAiBR,UAAM;;;;GAOT,OAAO;;;;;;EASR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebspark/health-check",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.12",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -19,27 +19,32 @@
|
|
|
19
19
|
"dev": "tsc --watch --noEmit",
|
|
20
20
|
"lint": "biome check .",
|
|
21
21
|
"test": "vitest run --passWithNoTests --coverage",
|
|
22
|
-
"test:e2e": "vitest run --config ../../vitest.e2e.config.
|
|
23
|
-
"typecheck": "vitest --typecheck.only --passWithNoTests"
|
|
22
|
+
"test:e2e": "vitest run --config ../../vitest.e2e.config.mts",
|
|
23
|
+
"typecheck": "vitest --typecheck.only --passWithNoTests --run"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@sebspark/hyper-media": "0.1.
|
|
27
|
-
"@sebspark/promise-cache": "8.1.
|
|
26
|
+
"@sebspark/hyper-media": "0.1.6",
|
|
27
|
+
"@sebspark/promise-cache": "8.1.7",
|
|
28
28
|
"express": "5.2.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@
|
|
31
|
+
"@biomejs/biome": "2.5.14",
|
|
32
|
+
"@google-cloud/pubsub": "6.1.0",
|
|
33
|
+
"@sebspark/tsconfig": "*",
|
|
32
34
|
"@testcontainers/gcloud": "12.1.0",
|
|
33
35
|
"@testcontainers/mockserver": "12.1.0",
|
|
34
36
|
"@testcontainers/redis": "12.1.0",
|
|
35
|
-
"mockserver-client": "
|
|
36
|
-
"supertest": "7.2.2"
|
|
37
|
+
"mockserver-client": "8.0.0",
|
|
38
|
+
"supertest": "7.2.2",
|
|
39
|
+
"typescript": "7.0.2",
|
|
40
|
+
"vite": "8.3.0",
|
|
41
|
+
"vitest": "5.0.1"
|
|
37
42
|
},
|
|
38
43
|
"resolutions": {
|
|
39
|
-
"protobufjs": "8.
|
|
44
|
+
"protobufjs": "8.8.0"
|
|
40
45
|
},
|
|
41
46
|
"repository": {
|
|
42
47
|
"type": "git",
|
|
43
48
|
"url": "https://github.com/seb-oss/Spark-packages.git"
|
|
44
49
|
}
|
|
45
|
-
}
|
|
50
|
+
}
|