@fluojs/terminus 1.0.0-beta.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.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.ko.md +148 -0
  3. package/README.md +148 -0
  4. package/dist/errors.d.ts +6 -0
  5. package/dist/errors.d.ts.map +1 -0
  6. package/dist/errors.js +8 -0
  7. package/dist/health-check.d.ts +37 -0
  8. package/dist/health-check.d.ts.map +1 -0
  9. package/dist/health-check.js +191 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +6 -0
  13. package/dist/indicators/disk.d.ts +31 -0
  14. package/dist/indicators/disk.d.ts.map +1 -0
  15. package/dist/indicators/disk.js +73 -0
  16. package/dist/indicators/drizzle.d.ts +36 -0
  17. package/dist/indicators/drizzle.d.ts.map +1 -0
  18. package/dist/indicators/drizzle.js +64 -0
  19. package/dist/indicators/http.d.ts +33 -0
  20. package/dist/indicators/http.d.ts.map +1 -0
  21. package/dist/indicators/http.js +87 -0
  22. package/dist/indicators/index.d.ts +6 -0
  23. package/dist/indicators/index.d.ts.map +1 -0
  24. package/dist/indicators/index.js +5 -0
  25. package/dist/indicators/memory.d.ts +31 -0
  26. package/dist/indicators/memory.d.ts.map +1 -0
  27. package/dist/indicators/memory.js +68 -0
  28. package/dist/indicators/prisma.d.ts +38 -0
  29. package/dist/indicators/prisma.d.ts.map +1 -0
  30. package/dist/indicators/prisma.js +79 -0
  31. package/dist/indicators/redis.d.ts +36 -0
  32. package/dist/indicators/redis.d.ts.map +1 -0
  33. package/dist/indicators/redis.js +64 -0
  34. package/dist/indicators/utils.d.ts +48 -0
  35. package/dist/indicators/utils.d.ts.map +1 -0
  36. package/dist/indicators/utils.js +82 -0
  37. package/dist/module.d.ts +20 -0
  38. package/dist/module.d.ts.map +1 -0
  39. package/dist/module.js +138 -0
  40. package/dist/redis.d.ts +2 -0
  41. package/dist/redis.d.ts.map +1 -0
  42. package/dist/redis.js +1 -0
  43. package/dist/tokens.d.ts +9 -0
  44. package/dist/tokens.d.ts.map +1 -0
  45. package/dist/tokens.js +9 -0
  46. package/dist/types.d.ts +52 -0
  47. package/dist/types.d.ts.map +1 -0
  48. package/dist/types.js +1 -0
  49. package/package.json +74 -0
@@ -0,0 +1,48 @@
1
+ import type { HealthIndicatorResult } from '../types.js';
2
+ /** Timeout settings shared by indicators that call external dependencies. */
3
+ export interface IndicatorTimeoutOptions {
4
+ timeoutMs?: number;
5
+ }
6
+ /**
7
+ * Create an `up` indicator result payload.
8
+ *
9
+ * @param key Indicator key used in the aggregated report.
10
+ * @param details Optional structured details to merge into the success state.
11
+ * @returns A one-entry health indicator result marked as `up`.
12
+ */
13
+ export declare function createUpResult(key: string, details?: Record<string, unknown>): HealthIndicatorResult;
14
+ /**
15
+ * Create a `down` indicator result payload.
16
+ *
17
+ * @param key Indicator key used in the aggregated report.
18
+ * @param message Human-readable failure message.
19
+ * @param details Optional structured details to merge into the failure state.
20
+ * @returns A one-entry health indicator result marked as `down`.
21
+ */
22
+ export declare function createDownResult(key: string, message: string, details?: Record<string, unknown>): HealthIndicatorResult;
23
+ /**
24
+ * Race an indicator promise against a timeout.
25
+ *
26
+ * @param promise Indicator promise that should finish within the timeout budget.
27
+ * @param timeoutMs Timeout budget in milliseconds.
28
+ * @param indicatorName Indicator name used in the timeout error message.
29
+ * @returns The original promise result when it finishes in time.
30
+ */
31
+ export declare function withIndicatorTimeout<T>(promise: Promise<T>, timeoutMs: number, indicatorName: string): Promise<T>;
32
+ /**
33
+ * Resolve the effective key used in reports for one indicator execution.
34
+ *
35
+ * @param fallbackKey Built-in fallback key for the indicator type.
36
+ * @param key Optional caller-supplied override.
37
+ * @returns The trimmed override key when present, otherwise the fallback key.
38
+ */
39
+ export declare function resolveIndicatorKey(fallbackKey: string, key: string | undefined): string;
40
+ /**
41
+ * Throw a `HealthCheckError` with a structured cause payload.
42
+ *
43
+ * @param message Human-readable error message.
44
+ * @param causes Structured indicator result payload to preserve in the exception.
45
+ * @throws {HealthCheckError} Always throws with the provided message and causes.
46
+ */
47
+ export declare function throwHealthCheckError(message: string, causes: HealthIndicatorResult): never;
48
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/indicators/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,qBAAqB,CAOxG;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACpC,qBAAqB,CAQvB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,GAAG,KAAK,CAE3F"}
@@ -0,0 +1,82 @@
1
+ import { HealthCheckError } from '../errors.js';
2
+
3
+ /** Timeout settings shared by indicators that call external dependencies. */
4
+
5
+ /**
6
+ * Create an `up` indicator result payload.
7
+ *
8
+ * @param key Indicator key used in the aggregated report.
9
+ * @param details Optional structured details to merge into the success state.
10
+ * @returns A one-entry health indicator result marked as `up`.
11
+ */
12
+ export function createUpResult(key, details = {}) {
13
+ return {
14
+ [key]: {
15
+ ...details,
16
+ status: 'up'
17
+ }
18
+ };
19
+ }
20
+
21
+ /**
22
+ * Create a `down` indicator result payload.
23
+ *
24
+ * @param key Indicator key used in the aggregated report.
25
+ * @param message Human-readable failure message.
26
+ * @param details Optional structured details to merge into the failure state.
27
+ * @returns A one-entry health indicator result marked as `down`.
28
+ */
29
+ export function createDownResult(key, message, details = {}) {
30
+ return {
31
+ [key]: {
32
+ ...details,
33
+ message,
34
+ status: 'down'
35
+ }
36
+ };
37
+ }
38
+
39
+ /**
40
+ * Race an indicator promise against a timeout.
41
+ *
42
+ * @param promise Indicator promise that should finish within the timeout budget.
43
+ * @param timeoutMs Timeout budget in milliseconds.
44
+ * @param indicatorName Indicator name used in the timeout error message.
45
+ * @returns The original promise result when it finishes in time.
46
+ */
47
+ export function withIndicatorTimeout(promise, timeoutMs, indicatorName) {
48
+ return new Promise((resolve, reject) => {
49
+ const timer = setTimeout(() => {
50
+ reject(new Error(`${indicatorName} health indicator timed out after ${String(timeoutMs)}ms.`));
51
+ }, timeoutMs);
52
+ promise.then(value => {
53
+ clearTimeout(timer);
54
+ resolve(value);
55
+ }, error => {
56
+ clearTimeout(timer);
57
+ reject(error);
58
+ });
59
+ });
60
+ }
61
+
62
+ /**
63
+ * Resolve the effective key used in reports for one indicator execution.
64
+ *
65
+ * @param fallbackKey Built-in fallback key for the indicator type.
66
+ * @param key Optional caller-supplied override.
67
+ * @returns The trimmed override key when present, otherwise the fallback key.
68
+ */
69
+ export function resolveIndicatorKey(fallbackKey, key) {
70
+ return key && key.trim().length > 0 ? key : fallbackKey;
71
+ }
72
+
73
+ /**
74
+ * Throw a `HealthCheckError` with a structured cause payload.
75
+ *
76
+ * @param message Human-readable error message.
77
+ * @param causes Structured indicator result payload to preserve in the exception.
78
+ * @throws {HealthCheckError} Always throws with the provided message and causes.
79
+ */
80
+ export function throwHealthCheckError(message, causes) {
81
+ throw new HealthCheckError(message, causes);
82
+ }
@@ -0,0 +1,20 @@
1
+ import { type ModuleType } from '@fluojs/runtime';
2
+ import type { TerminusModuleOptions } from './types.js';
3
+ /** Module entry point that wires Terminus indicators into runtime health endpoints. */
4
+ export declare class TerminusModule {
5
+ /**
6
+ * Register Terminus health indicators and readiness hooks.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * TerminusModule.forRoot({
11
+ * indicators: [new MemoryHealthIndicator({ key: 'memory' })],
12
+ * });
13
+ * ```
14
+ *
15
+ * @param options Terminus health indicator and readiness configuration.
16
+ * @returns A runtime module exposing health endpoints and `TerminusHealthService`.
17
+ */
18
+ static forRoot(options?: TerminusModuleOptions): ModuleType;
19
+ }
20
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,UAAU,EAGhB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAgLzE,uFAAuF;AACvF,qBAAa,cAAc;IACzB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,qBAA0B,GAAG,UAAU;CAGhE"}
package/dist/module.js ADDED
@@ -0,0 +1,138 @@
1
+ import { createHealthModule, defineModule } from '@fluojs/runtime';
2
+ import { PLATFORM_SHELL, RUNTIME_CONTAINER } from '@fluojs/runtime/internal';
3
+ import { TerminusHealthService } from './health-check.js';
4
+ import { TERMINUS_HEALTH_INDICATORS, TERMINUS_INDICATOR_PROVIDER_TOKENS } from './tokens.js';
5
+ const TERMINUS_OPTIONS = Symbol.for('fluo.terminus.options');
6
+ function copyIndicators(indicators) {
7
+ return [...(indicators ?? [])];
8
+ }
9
+ function copyProviders(providers) {
10
+ return [...(providers ?? [])];
11
+ }
12
+ function providerToken(provider) {
13
+ if (typeof provider === 'function') {
14
+ return provider;
15
+ }
16
+ if ('provide' in provider) {
17
+ return provider.provide;
18
+ }
19
+ return undefined;
20
+ }
21
+ function createTerminusProviders(options = {}) {
22
+ const normalizedOptions = {
23
+ ...options,
24
+ execution: {
25
+ ...(options.execution ?? {})
26
+ },
27
+ indicators: copyIndicators(options.indicators),
28
+ indicatorProviders: copyProviders(options.indicatorProviders),
29
+ readinessChecks: [...(options.readinessChecks ?? [])]
30
+ };
31
+ const indicatorProviders = copyProviders(normalizedOptions.indicatorProviders);
32
+ const indicatorProviderTokens = indicatorProviders.map(provider => providerToken(provider)).filter(token => token !== undefined);
33
+ return [{
34
+ provide: TERMINUS_OPTIONS,
35
+ useValue: normalizedOptions
36
+ }, {
37
+ provide: TERMINUS_INDICATOR_PROVIDER_TOKENS,
38
+ useValue: indicatorProviderTokens
39
+ }, {
40
+ inject: [TERMINUS_OPTIONS, TERMINUS_INDICATOR_PROVIDER_TOKENS, RUNTIME_CONTAINER],
41
+ provide: TERMINUS_HEALTH_INDICATORS,
42
+ useFactory: async (resolvedOptions, registeredTokens, runtimeContainer) => {
43
+ const resolvedIndicators = [];
44
+ if (typeof resolvedOptions === 'object' && resolvedOptions !== null && 'indicators' in resolvedOptions) {
45
+ const indicators = resolvedOptions.indicators;
46
+ resolvedIndicators.push(...copyIndicators(indicators));
47
+ }
48
+ if (runtimeContainer && typeof runtimeContainer === 'object' && runtimeContainer !== null && 'resolve' in runtimeContainer && typeof runtimeContainer.resolve === 'function' && Array.isArray(registeredTokens)) {
49
+ for (const token of registeredTokens) {
50
+ resolvedIndicators.push(await runtimeContainer.resolve(token));
51
+ }
52
+ }
53
+ return resolvedIndicators;
54
+ }
55
+ }, ...indicatorProviders, {
56
+ inject: [TERMINUS_HEALTH_INDICATORS, TERMINUS_OPTIONS],
57
+ provide: TerminusHealthService,
58
+ useFactory: (resolvedIndicators, resolvedOptions) => {
59
+ const indicators = Array.isArray(resolvedIndicators) ? resolvedIndicators : [];
60
+ const execution = typeof resolvedOptions === 'object' && resolvedOptions !== null && 'execution' in resolvedOptions && typeof resolvedOptions.execution === 'object' && resolvedOptions.execution !== null ? resolvedOptions.execution ?? {} : {};
61
+ return new TerminusHealthService(indicators, execution);
62
+ }
63
+ }];
64
+ }
65
+ function createTerminusRuntimeModule(options = {}) {
66
+ const readinessChecks = [...(options.readinessChecks ?? [])];
67
+ const healthModule = createHealthModule({
68
+ healthCheck: async ctx => {
69
+ const healthService = await ctx.container.resolve(TerminusHealthService);
70
+ const platformShell = await ctx.container.resolve(PLATFORM_SHELL);
71
+ const [report, readiness, health] = await Promise.all([healthService.check(), platformShell.ready(), platformShell.health()]);
72
+ const status = report.status === 'ok' && health.status === 'healthy' && readiness.status === 'ready' ? 'ok' : 'error';
73
+ return {
74
+ body: {
75
+ ...report,
76
+ platform: {
77
+ health,
78
+ readiness
79
+ },
80
+ status
81
+ },
82
+ statusCode: status === 'ok' ? 200 : 503
83
+ };
84
+ },
85
+ path: options.path
86
+ });
87
+ for (const check of readinessChecks) {
88
+ healthModule.addReadinessCheck(check);
89
+ }
90
+ const TERMINUS_READINESS_REGISTRAR = Symbol('fluo.terminus.readiness-registrar');
91
+ class TerminusRuntimeModule {}
92
+ return defineModule(TerminusRuntimeModule, {
93
+ exports: [TERMINUS_HEALTH_INDICATORS, TerminusHealthService],
94
+ imports: [healthModule],
95
+ providers: [...createTerminusProviders({
96
+ execution: options.execution,
97
+ indicatorProviders: options.indicatorProviders,
98
+ indicators: options.indicators,
99
+ path: options.path,
100
+ readinessChecks
101
+ }), {
102
+ inject: [TerminusHealthService, RUNTIME_CONTAINER],
103
+ provide: TERMINUS_READINESS_REGISTRAR,
104
+ useFactory: (...deps) => {
105
+ const [healthService, runtimeContainer] = deps;
106
+ return {
107
+ onApplicationBootstrap() {
108
+ healthModule.addReadinessCheck(async () => {
109
+ const platformShell = await runtimeContainer.resolve(PLATFORM_SHELL);
110
+ const [indicatorHealthy, readiness] = await Promise.all([healthService.isHealthy(), platformShell.ready()]);
111
+ return indicatorHealthy && readiness.status === 'ready';
112
+ });
113
+ }
114
+ };
115
+ }
116
+ }]
117
+ });
118
+ }
119
+
120
+ /** Module entry point that wires Terminus indicators into runtime health endpoints. */
121
+ export class TerminusModule {
122
+ /**
123
+ * Register Terminus health indicators and readiness hooks.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * TerminusModule.forRoot({
128
+ * indicators: [new MemoryHealthIndicator({ key: 'memory' })],
129
+ * });
130
+ * ```
131
+ *
132
+ * @param options Terminus health indicator and readiness configuration.
133
+ * @returns A runtime module exposing health endpoints and `TerminusHealthService`.
134
+ */
135
+ static forRoot(options = {}) {
136
+ return createTerminusRuntimeModule(options);
137
+ }
138
+ }
@@ -0,0 +1,2 @@
1
+ export * from './indicators/redis.js';
2
+ //# sourceMappingURL=redis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../src/redis.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
package/dist/redis.js ADDED
@@ -0,0 +1 @@
1
+ export * from './indicators/redis.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Injection token for the list of health indicators registered in Terminus.
3
+ */
4
+ export declare const TERMINUS_HEALTH_INDICATORS: unique symbol;
5
+ /**
6
+ * Injection token for the provider tokens of indicators to be resolved from the DI container.
7
+ */
8
+ export declare const TERMINUS_INDICATOR_PROVIDER_TOKENS: unique symbol;
9
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,0BAA0B,eAAgD,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,kCAAkC,eAAwD,CAAC"}
package/dist/tokens.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Injection token for the list of health indicators registered in Terminus.
3
+ */
4
+ export const TERMINUS_HEALTH_INDICATORS = Symbol.for('fluo.terminus.health-indicators');
5
+
6
+ /**
7
+ * Injection token for the provider tokens of indicators to be resolved from the DI container.
8
+ */
9
+ export const TERMINUS_INDICATOR_PROVIDER_TOKENS = Symbol.for('fluo.terminus.indicator-provider-tokens');
@@ -0,0 +1,52 @@
1
+ import type { Provider } from '@fluojs/di';
2
+ import type { PlatformHealthReport, PlatformReadinessReport, ReadinessCheck } from '@fluojs/runtime';
3
+ /** Status values returned by one health indicator execution. */
4
+ export type HealthIndicatorStatus = 'up' | 'down';
5
+ /** One indicator state payload stored under its resolved key. */
6
+ export type HealthIndicatorState = {
7
+ status: HealthIndicatorStatus;
8
+ } & Record<string, unknown>;
9
+ /** Map of indicator keys to their state payloads. */
10
+ export type HealthIndicatorResult = {
11
+ [key: string]: HealthIndicatorState;
12
+ };
13
+ /** Contract implemented by dependency health probes registered with Terminus. */
14
+ export interface HealthIndicator {
15
+ check(key: string): Promise<HealthIndicatorResult>;
16
+ key?: string;
17
+ }
18
+ /** Structured health report returned by Terminus aggregation helpers. */
19
+ export interface HealthCheckReport {
20
+ checkedAt: string;
21
+ contributors: {
22
+ down: string[];
23
+ up: string[];
24
+ };
25
+ details: Record<string, HealthIndicatorState>;
26
+ error: Record<string, HealthIndicatorState>;
27
+ info: Record<string, HealthIndicatorState>;
28
+ platform?: {
29
+ health: PlatformHealthReport;
30
+ readiness: PlatformReadinessReport;
31
+ };
32
+ status: 'ok' | 'error';
33
+ }
34
+ /** Optional execution guardrails applied while Terminus runs health indicators. */
35
+ export interface HealthCheckExecutionOptions {
36
+ /**
37
+ * Maximum time in milliseconds allowed for a single indicator execution before
38
+ * Terminus marks it as `down`.
39
+ */
40
+ indicatorTimeoutMs?: number;
41
+ }
42
+ /**
43
+ * Module options for registering health indicators, providers, and readiness hooks.
44
+ */
45
+ export interface TerminusModuleOptions {
46
+ execution?: HealthCheckExecutionOptions;
47
+ indicators?: readonly HealthIndicator[];
48
+ indicatorProviders?: readonly Provider[];
49
+ path?: string;
50
+ readinessChecks?: readonly ReadinessCheck[];
51
+ }
52
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAErG,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,IAAI,GAAG,MAAM,CAAC;AAElD,iEAAiE;AACjE,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,qBAAqB,CAAC;CAC/B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,qDAAqD;AACrD,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAC;CACrC,CAAC;AAEF,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,EAAE,EAAE,MAAM,EAAE,CAAC;KACd,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC9C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,oBAAoB,CAAC;QAC7B,SAAS,EAAE,uBAAuB,CAAC;KACpC,CAAC;IACF,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC;CACxB;AAED,mFAAmF;AACnF,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,2BAA2B,CAAC;IACxC,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACxC,kBAAkB,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;CAC7C"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@fluojs/terminus",
3
+ "description": "Health indicator composition and enriched runtime health aggregation for Fluo applications.",
4
+ "keywords": [
5
+ "fluo",
6
+ "terminus",
7
+ "health",
8
+ "readiness",
9
+ "liveness",
10
+ "health-check"
11
+ ],
12
+ "version": "1.0.0-beta.1",
13
+ "private": false,
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/fluojs/fluo.git",
18
+ "directory": "packages/terminus"
19
+ },
20
+ "engines": {
21
+ "node": ">=20.0.0"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "type": "module",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js"
31
+ },
32
+ "./redis": {
33
+ "types": "./dist/redis.d.ts",
34
+ "import": "./dist/redis.js"
35
+ }
36
+ },
37
+ "main": "./dist/index.js",
38
+ "types": "./dist/index.d.ts",
39
+ "files": [
40
+ "dist"
41
+ ],
42
+ "dependencies": {
43
+ "@fluojs/core": "^1.0.0-beta.1",
44
+ "@fluojs/runtime": "^1.0.0-beta.1",
45
+ "@fluojs/di": "^1.0.0-beta.1",
46
+ "@fluojs/http": "^1.0.0-beta.1"
47
+ },
48
+ "peerDependencies": {
49
+ "@fluojs/redis": "^1.0.0-beta.1",
50
+ "@fluojs/drizzle": "^1.0.0-beta.1",
51
+ "@fluojs/prisma": "^1.0.0-beta.1"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "@fluojs/drizzle": {
55
+ "optional": true
56
+ },
57
+ "@fluojs/prisma": {
58
+ "optional": true
59
+ },
60
+ "@fluojs/redis": {
61
+ "optional": true
62
+ }
63
+ },
64
+ "devDependencies": {
65
+ "vitest": "^3.2.4"
66
+ },
67
+ "scripts": {
68
+ "prebuild": "node ../../tooling/scripts/clean-dist.mjs",
69
+ "build": "pnpm exec babel src --extensions .ts --ignore 'src/**/*.test.ts' --out-dir dist --config-file ../../tooling/babel/babel.config.cjs && pnpm exec tsc -p tsconfig.build.json",
70
+ "typecheck": "pnpm exec tsc -p tsconfig.json --noEmit",
71
+ "test": "pnpm exec vitest run -c vitest.config.ts",
72
+ "test:watch": "pnpm exec vitest -c vitest.config.ts"
73
+ }
74
+ }