@fluojs/terminus 1.0.0 → 1.0.2

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/README.ko.md CHANGED
@@ -12,6 +12,7 @@ fluo 애플리케이션을 위한 헬스 인디케이터(Health Indicator) 툴
12
12
  - [공통 패턴](#공통-패턴)
13
13
  - [내장 인디케이터](#내장-인디케이터)
14
14
  - [DI 기반 인디케이터](#di-기반-인디케이터)
15
+ - [실행 가드레일](#실행-가드레일)
15
16
  - [실패 시맨틱](#실패-시맨틱)
16
17
  - [공개 API 개요](#공개-api-개요)
17
18
  - [관련 패키지](#관련-패키지)
@@ -29,7 +30,7 @@ pnpm add @fluojs/terminus
29
30
 
30
31
  - 외부 의존성(데이터베이스, Redis, API 등)의 상태를 애플리케이션 헬스 체크 결과에 포함해야 할 때.
31
32
  - 표준 모니터링 패턴에 맞는 구조화된 JSON 헬스 보고서가 필요할 때.
32
- - 핵심 하위 서비스에 접속할 없는 경우 `/ready` 체크가 실패하도록 설정해야 할 때.
33
+ - 필요한 하위 readiness signal이 unavailable 상태일 `/ready` 체크가 rotation에서 빠지도록 설정해야 할 때.
33
34
 
34
35
  ## 빠른 시작
35
36
 
@@ -93,6 +94,8 @@ TerminusModule.forRoot({
93
94
 
94
95
  Drizzle의 경우 `createDrizzleHealthIndicatorProvider()`는 `@fluojs/drizzle`이 노출하는 lifecycle-aware `DrizzleDatabase` wrapper를 우선 사용합니다. Drizzle이 종료 중이거나 중지되었거나 `DrizzleDatabase.createPlatformStatusSnapshot()` 기준으로 준비되지 않은 상태이면 SQL probe를 실행하기 전에 해당 indicator를 `down`으로 보고합니다. legacy raw `DRIZZLE_DATABASE` handle만 등록된 경우에는 기존 lightweight SQL probe 동작을 유지합니다.
95
96
 
97
+ Provider factory는 반복 등록할 수 있습니다. 각 인스턴스가 서로 다른 indicator key나 dependency option을 사용한다면 같은 factory가 만든 provider 여러 개를 하나의 `indicatorProviders` 배열에 등록할 수 있으며, Terminus는 나중에 등록된 같은 타입 provider가 앞선 provider를 덮어쓰지 않도록 각 provider 인스턴스를 별도 DI token으로 보관합니다.
98
+
96
99
  ### 실행 가드레일
97
100
 
98
101
  커스텀 인디케이터가 멈추거나 느린 하위 서비스에 의존할 수 있다면 `execution.indicatorTimeoutMs`를 사용하세요. probe가 설정된 시간을 넘기면 Terminus는 무기한 대기하지 않고 해당 인디케이터를 `down`으로 표시합니다.
@@ -113,7 +116,7 @@ TerminusModule.forRoot({
113
116
  인디케이터가 실패하면 `HealthCheckError`를 던집니다. `TerminusHealthService`는 이 실패들을 모아 보고서를 작성합니다.
114
117
 
115
118
  - 하나 이상의 인디케이터가 실패하면 `/health`는 HTTP `503`을 반환합니다.
116
- - 준비 상태(readiness)와 관련된 인디케이터가 실패하면 `/ready`는 HTTP `503`을 반환합니다.
119
+ - 등록된 indicator가 실패하거나, custom readiness check가 `false`를 반환하거나, runtime shutdown이 시작되었거나, platform readiness가 `ready`가 아닌 경우 `/ready`는 HTTP `503`을 반환합니다. Platform `critical` metadata는 diagnostics에 보존되지만 HTTP readiness endpoint 자체는 binary ready/unavailable gate이며 warning severity bucket을 노출하지 않습니다.
117
120
  - 응답 본문은 `status`, `contributors`, `info`, `error`, `details`를 포함한 구조화된 JSON 객체입니다.
118
121
  - 하나의 인디케이터가 여러 keyed entry를 반환할 수도 있으며, 이 경우 `/health`는 모든 entry를 `details`와 `contributors.up` / `contributors.down` 요약에 그대로 반영합니다.
119
122
  - 지원하지 않는 status, 빈 결과, 객체가 아닌 인디케이터 결과는 조용히 버려지지 않고 `down` 진단으로 보고됩니다.
@@ -151,7 +154,7 @@ TerminusModule.forRoot({
151
154
 
152
155
  ### `@fluojs/terminus/node`
153
156
 
154
- - `MemoryHealthIndicator`, `DiskHealthIndicator`, `createMemoryHealthIndicator()`, `createDiskHealthIndicator()`
157
+ - `MemoryHealthIndicator`, `DiskHealthIndicator`, `createMemoryHealthIndicator()`, `createDiskHealthIndicator()`, `createMemoryHealthIndicatorProvider()`, `createDiskHealthIndicatorProvider()`
155
158
  - Node 전용 indicator helper는 호환성을 위해 root에서도 계속 export되며 이 전용 subpath에서도 export됩니다. Disk check의 filesystem access는 lazy-load되므로 root package import 시점에는 Node filesystem module을 load하지 않습니다.
156
159
 
157
160
 
package/README.md CHANGED
@@ -12,6 +12,7 @@ Health indicator toolkit for fluo applications. `@fluojs/terminus` layers on top
12
12
  - [Common Patterns](#common-patterns)
13
13
  - [Built-in Indicators](#built-in-indicators)
14
14
  - [DI-Backed Indicators](#di-backed-indicators)
15
+ - [Execution Guardrails](#execution-guardrails)
15
16
  - [Failure Semantics](#failure-semantics)
16
17
  - [Public API Overview](#public-api-overview)
17
18
  - [Related Packages](#related-packages)
@@ -27,7 +28,7 @@ pnpm add @fluojs/terminus
27
28
 
28
29
  - When you need to monitor external dependencies (databases, Redis, APIs) as part of your application's health status.
29
30
  - When you want a structured JSON health report that aligns with standard monitoring patterns.
30
- - When you need your `/ready` check to fail if critical downstream services are unreachable.
31
+ - When you need your `/ready` check to leave rotation while required downstream readiness signals are unavailable.
31
32
 
32
33
  ## Quick Start
33
34
 
@@ -91,6 +92,8 @@ TerminusModule.forRoot({
91
92
 
92
93
  For Drizzle, `createDrizzleHealthIndicatorProvider()` prefers the lifecycle-aware `DrizzleDatabase` wrapper exported by `@fluojs/drizzle`. The indicator reports `down` before probing SQL whenever Drizzle is shutting down, stopped, or otherwise not ready according to `DrizzleDatabase.createPlatformStatusSnapshot()`. If only the legacy raw `DRIZZLE_DATABASE` handle is registered, the provider keeps the previous lightweight SQL probe behavior.
93
94
 
95
+ Provider factories are repeatable. You may register multiple providers created by the same factory in one `indicatorProviders` array when each instance uses a distinct indicator key or dependency option; Terminus keeps every provider instance under its own DI token instead of letting later same-type providers overwrite earlier ones.
96
+
94
97
  ### Execution Guardrails
95
98
 
96
99
  Use `execution.indicatorTimeoutMs` when custom indicators might hang or depend on slow downstreams. When a probe exceeds the configured timeout, Terminus marks that indicator as `down` instead of waiting forever.
@@ -113,7 +116,7 @@ Use `path` to mount the health endpoints under a custom path, and `readinessChec
113
116
  When an indicator fails, it throws a `HealthCheckError`. The `TerminusHealthService` aggregates these failures into a report:
114
117
 
115
118
  - `/health` returns HTTP `503` if any indicator fails.
116
- - `/ready` returns HTTP `503` if any indicator associated with readiness fails.
119
+ - `/ready` returns HTTP `503` when registered indicators fail, a custom readiness check returns `false`, runtime shutdown has begun, or platform readiness is anything other than `ready`. Platform `critical` metadata is preserved in diagnostics, but the HTTP readiness endpoint itself is a binary ready/unavailable gate and does not expose warning severity buckets.
117
120
  - The response body contains a structured JSON object with `status`, `contributors`, `info`, `error`, and `details`.
118
121
  - Indicators may emit multiple keyed entries in a single check result; `/health` preserves every keyed entry in `details` and in the `contributors.up` / `contributors.down` summaries.
119
122
  - Unsupported, empty, or non-object indicator results are reported as `down` diagnostics instead of being silently discarded.
@@ -151,7 +154,7 @@ When an indicator fails, it throws a `HealthCheckError`. The `TerminusHealthServ
151
154
 
152
155
  ### `@fluojs/terminus/node`
153
156
 
154
- - `MemoryHealthIndicator`, `DiskHealthIndicator`, `createMemoryHealthIndicator()`, `createDiskHealthIndicator()`
157
+ - `MemoryHealthIndicator`, `DiskHealthIndicator`, `createMemoryHealthIndicator()`, `createDiskHealthIndicator()`, `createMemoryHealthIndicatorProvider()`, `createDiskHealthIndicatorProvider()`
155
158
  - Node-specific indicator helpers remain root-exported for compatibility and are also exported from this dedicated subpath. Filesystem access for disk checks is lazy-loaded so importing the root package does not load Node filesystem modules at module initialization time.
156
159
 
157
160
 
@@ -15,10 +15,10 @@ export interface DiskHealthIndicatorOptions {
15
15
  */
16
16
  export declare function createDiskHealthIndicator(options?: DiskHealthIndicatorOptions): HealthIndicator;
17
17
  /**
18
- * Create a provider that registers a `DiskHealthIndicator` instance.
18
+ * Create a Terminus indicator provider collection entry for a `DiskHealthIndicator` instance.
19
19
  *
20
20
  * @param options Optional filesystem path and free-space thresholds.
21
- * @returns A value provider that exposes `DiskHealthIndicator` from the DI container.
21
+ * @returns A value provider with a unique internal DI token for `TerminusModule` indicatorProviders.
22
22
  */
23
23
  export declare function createDiskHealthIndicatorProvider(options?: DiskHealthIndicatorOptions): Provider;
24
24
  /** Health indicator that inspects free space for one filesystem path. */
@@ -1 +1 @@
1
- {"version":3,"file":"disk.d.ts","sourceRoot":"","sources":["../../src/indicators/disk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE1E,sEAAsE;AACtE,MAAM,WAAW,0BAA0B;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAcD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,0BAA+B,GAAG,eAAe,CAEnG;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,GAAE,0BAA+B,GAAG,QAAQ,CAKpG;AAED,yEAAyE;AACzE,qBAAa,mBAAoB,YAAW,eAAe;IAG7C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEJ,OAAO,GAAE,0BAA+B;IAI/D,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAsCzD"}
1
+ {"version":3,"file":"disk.d.ts","sourceRoot":"","sources":["../../src/indicators/disk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE1E,sEAAsE;AACtE,MAAM,WAAW,0BAA0B;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAcD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,0BAA+B,GAAG,eAAe,CAEnG;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,GAAE,0BAA+B,GAAG,QAAQ,CAOpG;AAED,yEAAyE;AACzE,qBAAa,mBAAoB,YAAW,eAAe;IAG7C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEJ,OAAO,GAAE,0BAA+B;IAI/D,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAsCzD"}
@@ -24,14 +24,15 @@ export function createDiskHealthIndicator(options = {}) {
24
24
  }
25
25
 
26
26
  /**
27
- * Create a provider that registers a `DiskHealthIndicator` instance.
27
+ * Create a Terminus indicator provider collection entry for a `DiskHealthIndicator` instance.
28
28
  *
29
29
  * @param options Optional filesystem path and free-space thresholds.
30
- * @returns A value provider that exposes `DiskHealthIndicator` from the DI container.
30
+ * @returns A value provider with a unique internal DI token for `TerminusModule` indicatorProviders.
31
31
  */
32
32
  export function createDiskHealthIndicatorProvider(options = {}) {
33
+ const indicatorProviderToken = Symbol('fluo.terminus.disk-health-indicator');
33
34
  return {
34
- provide: DiskHealthIndicator,
35
+ provide: indicatorProviderToken,
35
36
  useValue: new DiskHealthIndicator(options)
36
37
  };
37
38
  }
@@ -35,10 +35,10 @@ export interface DrizzleHealthIndicatorOptions {
35
35
  */
36
36
  export declare function createDrizzleHealthIndicator(options?: DrizzleHealthIndicatorOptions): HealthIndicator;
37
37
  /**
38
- * Create a provider that resolves a Drizzle database handle from DI and wraps it as an indicator.
38
+ * Create a Terminus indicator provider collection entry that resolves a Drizzle database handle from DI.
39
39
  *
40
40
  * @param options Optional timeout, query override, key override, or custom ping callback.
41
- * @returns A factory provider that exposes `DrizzleHealthIndicator` from the DI container.
41
+ * @returns A factory provider with a unique internal DI token for `TerminusModule` indicatorProviders.
42
42
  */
43
43
  export declare function createDrizzleHealthIndicatorProvider(options?: Omit<DrizzleHealthIndicatorOptions, 'database' | 'handleProvider'>): Provider;
44
44
  /** Health indicator that maps Drizzle lifecycle state and probes connectivity with an execute-capable handle. */
@@ -1 +1 @@
1
- {"version":3,"file":"drizzle.d.ts","sourceRoot":"","sources":["../../src/indicators/drizzle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAK1E,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAChD;AAED,UAAU,4BAA4B;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,EAAE;QACN,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;KAC9C,CAAC;IACF,SAAS,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC;KAC/B,CAAC;CACH;AAED,UAAU,yBAAyB;IACjC,4BAA4B,CAAC,EAAE,MAAM,4BAA4B,CAAC;IAClE,OAAO,CAAC,EAAE,MAAM,kBAAkB,GAAG,OAAO,CAAC;CAC9C;AAED,gEAAgE;AAChE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IAC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C/B,CAAC;CACH;AAED,UAAU,yBAAyB;IACjC,4BAA4B,CAAC,EAAE,MAAM,4BAA4B,CAAC;IAClE,OAAO,CAAC,EAAE,MAAM,kBAAkB,GAAG,OAAO,CAAC;CAC9C;AAED,gEAAgE;AAChE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8DD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,GAAE,6BAAkC,GAAG,eAAe,CAEzG;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAAC,OAAO,GAAE,IAAI,CAAC,6BAA6B,EAAE,UAAU,GAAG,gBAAgB,CAAM,GAAG,QAAQ,CAkB/I;AAED,iHAAiH;AACjH,qBAAa,sBAAuB,YAAW,eAAe;IAGhD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEJ,OAAO,GAAE,6BAAkC;IAIlE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAiCzD"}
@@ -55,15 +55,16 @@ export function createDrizzleHealthIndicator(options = {}) {
55
55
  }
56
56
 
57
57
  /**
58
- * Create a provider that resolves a Drizzle database handle from DI and wraps it as an indicator.
58
+ * Create a Terminus indicator provider collection entry that resolves a Drizzle database handle from DI.
59
59
  *
60
60
  * @param options Optional timeout, query override, key override, or custom ping callback.
61
- * @returns A factory provider that exposes `DrizzleHealthIndicator` from the DI container.
61
+ * @returns A factory provider with a unique internal DI token for `TerminusModule` indicatorProviders.
62
62
  */
63
63
  export function createDrizzleHealthIndicatorProvider(options = {}) {
64
+ const indicatorProviderToken = Symbol('fluo.terminus.drizzle-health-indicator');
64
65
  return {
65
66
  inject: [optional(DRIZZLE_HANDLE_PROVIDER), optional(DRIZZLE_DATABASE)],
66
- provide: DrizzleHealthIndicator,
67
+ provide: indicatorProviderToken,
67
68
  useFactory: (handleProvider, database) => {
68
69
  const resolvedHandleProvider = typeof handleProvider === 'object' && handleProvider !== null ? handleProvider : undefined;
69
70
  return new DrizzleHealthIndicator({
@@ -17,10 +17,10 @@ export interface HttpHealthIndicatorOptions {
17
17
  */
18
18
  export declare function createHttpHealthIndicator(options: HttpHealthIndicatorOptions): HealthIndicator;
19
19
  /**
20
- * Create a provider that registers an `HttpHealthIndicator` instance.
20
+ * Create a Terminus indicator provider collection entry for an `HttpHealthIndicator` instance.
21
21
  *
22
22
  * @param options HTTP probe settings such as URL, method, headers, and accepted status codes.
23
- * @returns A value provider that exposes `HttpHealthIndicator` from the DI container.
23
+ * @returns A value provider with a unique internal DI token for `TerminusModule` indicatorProviders.
24
24
  */
25
25
  export declare function createHttpHealthIndicatorProvider(options: HttpHealthIndicatorOptions): Provider;
26
26
  /** Health indicator that probes an upstream HTTP endpoint with `fetch()`. */
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/indicators/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE1E,wDAAwD;AACxD,MAAM,WAAW,0BAA0B;IACzC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC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0BAA0B,GAAG,QAAQ,CAO/F;AAED,6EAA6E;AAC7E,qBAAa,mBAAoB,YAAW,eAAe;IAG7C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEJ,OAAO,EAAE,0BAA0B;IAI1D,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA6CzD"}
@@ -28,14 +28,15 @@ export function createHttpHealthIndicator(options) {
28
28
  }
29
29
 
30
30
  /**
31
- * Create a provider that registers an `HttpHealthIndicator` instance.
31
+ * Create a Terminus indicator provider collection entry for an `HttpHealthIndicator` instance.
32
32
  *
33
33
  * @param options HTTP probe settings such as URL, method, headers, and accepted status codes.
34
- * @returns A value provider that exposes `HttpHealthIndicator` from the DI container.
34
+ * @returns A value provider with a unique internal DI token for `TerminusModule` indicatorProviders.
35
35
  */
36
36
  export function createHttpHealthIndicatorProvider(options) {
37
+ const indicatorProviderToken = Symbol('fluo.terminus.http-health-indicator');
37
38
  return {
38
- provide: HttpHealthIndicator,
39
+ provide: indicatorProviderToken,
39
40
  useValue: new HttpHealthIndicator(options)
40
41
  };
41
42
  }
@@ -15,10 +15,10 @@ export interface MemoryHealthIndicatorOptions {
15
15
  */
16
16
  export declare function createMemoryHealthIndicator(options?: MemoryHealthIndicatorOptions): HealthIndicator;
17
17
  /**
18
- * Create a provider that registers a `MemoryHealthIndicator` instance.
18
+ * Create a Terminus indicator provider collection entry for a `MemoryHealthIndicator` instance.
19
19
  *
20
20
  * @param options Optional heap and RSS thresholds plus an indicator key override.
21
- * @returns A value provider that exposes `MemoryHealthIndicator` from the DI container.
21
+ * @returns A value provider with a unique internal DI token for `TerminusModule` indicatorProviders.
22
22
  */
23
23
  export declare function createMemoryHealthIndicatorProvider(options?: MemoryHealthIndicatorOptions): Provider;
24
24
  /** Health indicator that checks local process heap and RSS usage. */
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/indicators/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE1E,4DAA4D;AAC5D,MAAM,WAAW,4BAA4B;IAC3C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAYD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,4BAAiC,GAAG,eAAe,CAEvG;AAED;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAAC,OAAO,GAAE,4BAAiC,GAAG,QAAQ,CAKxG;AAED,qEAAqE;AACrE,qBAAa,qBAAsB,YAAW,eAAe;IAG/C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEJ,OAAO,GAAE,4BAAiC;IAIjE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAiCzD"}
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/indicators/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE1E,4DAA4D;AAC5D,MAAM,WAAW,4BAA4B;IAC3C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAYD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,4BAAiC,GAAG,eAAe,CAEvG;AAED;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAAC,OAAO,GAAE,4BAAiC,GAAG,QAAQ,CAOxG;AAED,qEAAqE;AACrE,qBAAa,qBAAsB,YAAW,eAAe;IAG/C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEJ,OAAO,GAAE,4BAAiC;IAIjE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAiCzD"}
@@ -21,14 +21,15 @@ export function createMemoryHealthIndicator(options = {}) {
21
21
  }
22
22
 
23
23
  /**
24
- * Create a provider that registers a `MemoryHealthIndicator` instance.
24
+ * Create a Terminus indicator provider collection entry for a `MemoryHealthIndicator` instance.
25
25
  *
26
26
  * @param options Optional heap and RSS thresholds plus an indicator key override.
27
- * @returns A value provider that exposes `MemoryHealthIndicator` from the DI container.
27
+ * @returns A value provider with a unique internal DI token for `TerminusModule` indicatorProviders.
28
28
  */
29
29
  export function createMemoryHealthIndicatorProvider(options = {}) {
30
+ const indicatorProviderToken = Symbol('fluo.terminus.memory-health-indicator');
30
31
  return {
31
- provide: MemoryHealthIndicator,
32
+ provide: indicatorProviderToken,
32
33
  useValue: new MemoryHealthIndicator(options)
33
34
  };
34
35
  }
@@ -21,10 +21,10 @@ export interface PrismaHealthIndicatorOptions {
21
21
  */
22
22
  export declare function createPrismaHealthIndicator(options?: PrismaHealthIndicatorOptions): HealthIndicator;
23
23
  /**
24
- * Create a provider that resolves a Prisma client from DI and wraps it as an indicator.
24
+ * Create a Terminus indicator provider collection entry that resolves a Prisma client from DI.
25
25
  *
26
26
  * @param options Optional timeout, key override, or custom ping callback.
27
- * @returns A factory provider that exposes `PrismaHealthIndicator` from the DI container.
27
+ * @returns A factory provider with a unique internal DI token for `TerminusModule` indicatorProviders.
28
28
  */
29
29
  export declare function createPrismaHealthIndicatorProvider(options?: Omit<PrismaHealthIndicatorOptions, 'client'>): Provider;
30
30
  /** Health indicator that probes Prisma connectivity with a trivial query. */
@@ -1 +1 @@
1
- {"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../src/indicators/prisma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAI1E,UAAU,gBAAgB;IACxB,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD;AAED,+DAA+D;AAC/D,MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuCD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,4BAAiC,GAAG,eAAe,CAEvG;AAED;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAAC,OAAO,GAAE,IAAI,CAAC,4BAA4B,EAAE,QAAQ,CAAM,GAAG,QAAQ,CAMxH;AAED,6EAA6E;AAC7E,qBAAa,qBAAsB,YAAW,eAAe;IAG/C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAA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OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEJ,OAAO,GAAE,4BAAiC;IAIjE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAczD"}
@@ -43,15 +43,16 @@ export function createPrismaHealthIndicator(options = {}) {
43
43
  }
44
44
 
45
45
  /**
46
- * Create a provider that resolves a Prisma client from DI and wraps it as an indicator.
46
+ * Create a Terminus indicator provider collection entry that resolves a Prisma client from DI.
47
47
  *
48
48
  * @param options Optional timeout, key override, or custom ping callback.
49
- * @returns A factory provider that exposes `PrismaHealthIndicator` from the DI container.
49
+ * @returns A factory provider with a unique internal DI token for `TerminusModule` indicatorProviders.
50
50
  */
51
51
  export function createPrismaHealthIndicatorProvider(options = {}) {
52
+ const indicatorProviderToken = Symbol('fluo.terminus.prisma-health-indicator');
52
53
  return {
53
54
  inject: [PRISMA_CLIENT],
54
- provide: PrismaHealthIndicator,
55
+ provide: indicatorProviderToken,
55
56
  useFactory: client => new PrismaHealthIndicator({
56
57
  ...options,
57
58
  client: client
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "liveness",
10
10
  "health-check"
11
11
  ],
12
- "version": "1.0.0",
12
+ "version": "1.0.2",
13
13
  "private": false,
14
14
  "license": "MIT",
15
15
  "repository": {
@@ -44,10 +44,10 @@
44
44
  "dist"
45
45
  ],
46
46
  "dependencies": {
47
- "@fluojs/core": "^1.0.0",
48
- "@fluojs/di": "^1.0.0",
47
+ "@fluojs/core": "^1.0.2",
48
+ "@fluojs/di": "^1.0.2",
49
49
  "@fluojs/http": "^1.0.0",
50
- "@fluojs/runtime": "^1.0.0"
50
+ "@fluojs/runtime": "^1.1.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@fluojs/drizzle": "^1.0.0",
@@ -66,7 +66,8 @@
66
66
  }
67
67
  },
68
68
  "devDependencies": {
69
- "vitest": "^3.2.4"
69
+ "vitest": "^3.2.4",
70
+ "@fluojs/testing": "^1.0.2"
70
71
  },
71
72
  "scripts": {
72
73
  "prebuild": "node ../../tooling/scripts/clean-dist.mjs",