@fluojs/terminus 1.0.5 → 2.0.0
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 +115 -9
- package/README.md +115 -9
- package/dist/health-check.d.ts +13 -1
- package/dist/health-check.d.ts.map +1 -1
- package/dist/health-check.js +56 -22
- package/dist/indicators/disk.d.ts +3 -0
- package/dist/indicators/disk.d.ts.map +1 -1
- package/dist/indicators/disk.js +2 -0
- package/dist/indicators/drizzle.d.ts +5 -0
- package/dist/indicators/drizzle.d.ts.map +1 -1
- package/dist/indicators/drizzle.js +12 -4
- package/dist/indicators/http.d.ts +3 -0
- package/dist/indicators/http.d.ts.map +1 -1
- package/dist/indicators/http.js +41 -26
- package/dist/indicators/memory.d.ts +3 -0
- package/dist/indicators/memory.d.ts.map +1 -1
- package/dist/indicators/memory.js +2 -0
- package/dist/indicators/prisma.d.ts +45 -7
- package/dist/indicators/prisma.d.ts.map +1 -1
- package/dist/indicators/prisma.js +105 -15
- package/dist/indicators/redis.d.ts +9 -0
- package/dist/indicators/redis.d.ts.map +1 -1
- package/dist/indicators/redis.js +15 -3
- package/dist/indicators/utils.d.ts +17 -0
- package/dist/indicators/utils.d.ts.map +1 -1
- package/dist/indicators/utils.js +38 -2
- package/dist/module.d.ts +18 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +26 -4
- package/dist/node-runtime.d.ts +5 -1
- package/dist/node-runtime.d.ts.map +1 -1
- package/dist/node-runtime.js +5 -1
- package/dist/types.d.ts +17 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { optional } from '@fluojs/di';
|
|
2
|
+
import { createDownResult, createUpResult, resolveIndicatorKey, resolveIndicatorTimeoutMs, throwHealthCheckError, waitForIndicatorProbeSettlement, withIndicatorTimeout } from './utils.js';
|
|
2
3
|
const PRISMA_CLIENT = Symbol.for('fluo.prisma.client');
|
|
4
|
+
const PRISMA_SERVICE = Symbol.for('fluo.prisma.service');
|
|
3
5
|
|
|
4
6
|
/** Options for probing Prisma-backed database connectivity. */
|
|
5
7
|
|
|
@@ -9,7 +11,7 @@ async function runPrismaPing(options) {
|
|
|
9
11
|
await options.ping();
|
|
10
12
|
return;
|
|
11
13
|
}
|
|
12
|
-
const client = options.client;
|
|
14
|
+
const client = resolveCurrentPrismaClient(options.service) ?? options.client;
|
|
13
15
|
if (!client) {
|
|
14
16
|
throw new Error('Prisma indicator requires either a client or ping callback.');
|
|
15
17
|
}
|
|
@@ -31,50 +33,138 @@ async function runPrismaPing(options) {
|
|
|
31
33
|
}
|
|
32
34
|
throw new Error('Prisma indicator requires a client with query/execute capabilities or a ping callback.');
|
|
33
35
|
}
|
|
36
|
+
function normalizePrismaRegistrationName(name) {
|
|
37
|
+
if (name === undefined) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const normalizedName = name.trim();
|
|
41
|
+
if (normalizedName.length === 0) {
|
|
42
|
+
throw new Error('Prisma health indicator registration name must be a non-empty string when provided.');
|
|
43
|
+
}
|
|
44
|
+
return normalizedName;
|
|
45
|
+
}
|
|
46
|
+
function getPrismaClientToken(name) {
|
|
47
|
+
const normalizedName = normalizePrismaRegistrationName(name);
|
|
48
|
+
return normalizedName === undefined ? PRISMA_CLIENT : Symbol.for(`fluo.prisma.client:${normalizedName}`);
|
|
49
|
+
}
|
|
50
|
+
function getPrismaServiceToken(name) {
|
|
51
|
+
const normalizedName = normalizePrismaRegistrationName(name);
|
|
52
|
+
return normalizedName === undefined ? PRISMA_SERVICE : Symbol.for(`fluo.prisma.service:${normalizedName}`);
|
|
53
|
+
}
|
|
54
|
+
function resolveCurrentPrismaClient(service) {
|
|
55
|
+
if (!service || typeof service.current !== 'function') {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
return service.current();
|
|
59
|
+
}
|
|
60
|
+
function createPrismaLifecycleSnapshot(service) {
|
|
61
|
+
if (!service || typeof service.createPlatformStatusSnapshot !== 'function') {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
return service.createPlatformStatusSnapshot();
|
|
65
|
+
}
|
|
66
|
+
function createPrismaLifecycleDownResult(indicatorKey, snapshot) {
|
|
67
|
+
const healthStatus = snapshot.health.status;
|
|
68
|
+
const readinessStatus = snapshot.readiness.status;
|
|
69
|
+
if (healthStatus === 'healthy' && readinessStatus === 'ready') {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
const message = snapshot.readiness.reason ?? snapshot.health.reason ?? `Prisma lifecycle reported health=${healthStatus} readiness=${readinessStatus}.`;
|
|
73
|
+
return createDownResult(indicatorKey, message, {
|
|
74
|
+
details: snapshot.details,
|
|
75
|
+
healthStatus,
|
|
76
|
+
readinessStatus
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function createPrismaLifecycleUpDetails(snapshot) {
|
|
80
|
+
if (!snapshot) {
|
|
81
|
+
return {};
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
details: snapshot.details,
|
|
85
|
+
healthStatus: snapshot.health.status,
|
|
86
|
+
readinessStatus: snapshot.readiness.status
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function toPrismaService(value) {
|
|
90
|
+
return typeof value === 'object' && value !== null ? value : undefined;
|
|
91
|
+
}
|
|
34
92
|
|
|
35
93
|
/**
|
|
36
94
|
* Create a Prisma health indicator.
|
|
37
95
|
*
|
|
38
|
-
* @param options Optional Prisma client, ping callback, timeout, and key override.
|
|
39
|
-
* @returns A health indicator that
|
|
96
|
+
* @param options Optional lifecycle-aware service facade, Prisma client, ping callback, timeout, and key override.
|
|
97
|
+
* @returns A health indicator that checks Prisma lifecycle state before executing a lightweight round trip.
|
|
40
98
|
*/
|
|
41
99
|
export function createPrismaHealthIndicator(options = {}) {
|
|
42
100
|
return new PrismaHealthIndicator(options);
|
|
43
101
|
}
|
|
44
102
|
|
|
45
103
|
/**
|
|
46
|
-
* Create a Terminus indicator provider collection entry that resolves
|
|
104
|
+
* Create a Terminus indicator provider collection entry that resolves Prisma from DI.
|
|
105
|
+
*
|
|
106
|
+
* The provider prefers `getPrismaServiceToken(options.name)` so `@fluojs/prisma`
|
|
107
|
+
* lifecycle snapshots participate in health/readiness diagnostics. It falls back
|
|
108
|
+
* to the matching raw client token for compatibility with manual provider graphs.
|
|
109
|
+
* Explicit `serviceToken` and `clientToken` values override the name-derived tokens.
|
|
47
110
|
*
|
|
48
|
-
* @param options Optional timeout, key override, or custom ping callback.
|
|
111
|
+
* @param options Optional name hint, explicit tokens, timeout, key override, or custom ping callback.
|
|
49
112
|
* @returns A factory provider with a unique internal DI token for `TerminusModule` indicatorProviders.
|
|
50
113
|
*/
|
|
51
114
|
export function createPrismaHealthIndicatorProvider(options = {}) {
|
|
52
115
|
const indicatorProviderToken = Symbol('fluo.terminus.prisma-health-indicator');
|
|
116
|
+
const hasExplicitServiceToken = options.serviceToken !== undefined;
|
|
117
|
+
const hasExplicitClientToken = options.clientToken !== undefined;
|
|
118
|
+
const serviceToken = hasExplicitServiceToken || !hasExplicitClientToken ? options.serviceToken ?? getPrismaServiceToken(options.name) : undefined;
|
|
119
|
+
const clientToken = hasExplicitClientToken || !hasExplicitServiceToken ? options.clientToken ?? getPrismaClientToken(options.name) : undefined;
|
|
120
|
+
const inject = [...(serviceToken === undefined ? [] : [optional(serviceToken)]), ...(clientToken === undefined ? [] : [optional(clientToken)])];
|
|
53
121
|
return {
|
|
54
|
-
inject
|
|
122
|
+
inject,
|
|
55
123
|
provide: indicatorProviderToken,
|
|
56
|
-
useFactory:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
124
|
+
useFactory: (...resolvedDependencies) => {
|
|
125
|
+
const resolvedService = serviceToken === undefined ? undefined : resolvedDependencies[0];
|
|
126
|
+
const resolvedClientIndex = serviceToken === undefined ? 0 : 1;
|
|
127
|
+
const resolvedClient = clientToken === undefined ? undefined : resolvedDependencies[resolvedClientIndex];
|
|
128
|
+
return new PrismaHealthIndicator({
|
|
129
|
+
...options,
|
|
130
|
+
client: resolvedClient,
|
|
131
|
+
service: toPrismaService(resolvedService)
|
|
132
|
+
});
|
|
133
|
+
}
|
|
60
134
|
};
|
|
61
135
|
}
|
|
62
136
|
|
|
63
|
-
/** Health indicator that
|
|
137
|
+
/** Health indicator that maps Prisma lifecycle status and probes connectivity with a trivial query. */
|
|
64
138
|
export class PrismaHealthIndicator {
|
|
65
139
|
key;
|
|
140
|
+
readiness;
|
|
141
|
+
pendingProbeSettlement;
|
|
66
142
|
constructor(options = {}) {
|
|
67
143
|
this.options = options;
|
|
68
144
|
this.key = options.key;
|
|
145
|
+
this.readiness = options.readiness;
|
|
69
146
|
}
|
|
70
147
|
async check(key) {
|
|
71
148
|
const indicatorKey = resolveIndicatorKey('prisma', this.options.key ?? key);
|
|
72
|
-
const timeoutMs = this.options.timeoutMs ?? DEFAULT_PRISMA_TIMEOUT_MS;
|
|
73
149
|
try {
|
|
74
|
-
|
|
75
|
-
|
|
150
|
+
const timeoutMs = resolveIndicatorTimeoutMs(this.options.timeoutMs, DEFAULT_PRISMA_TIMEOUT_MS, indicatorKey);
|
|
151
|
+
const snapshot = createPrismaLifecycleSnapshot(this.options.service);
|
|
152
|
+
const lifecycleDownResult = snapshot ? createPrismaLifecycleDownResult(indicatorKey, snapshot) : undefined;
|
|
153
|
+
if (lifecycleDownResult) {
|
|
154
|
+
throwHealthCheckError('Prisma health check failed.', lifecycleDownResult);
|
|
155
|
+
}
|
|
156
|
+
const probe = runPrismaPing(this.options);
|
|
157
|
+
this.pendingProbeSettlement = waitForIndicatorProbeSettlement(probe);
|
|
158
|
+
await withIndicatorTimeout(probe, timeoutMs, indicatorKey);
|
|
159
|
+
return createUpResult(indicatorKey, createPrismaLifecycleUpDetails(snapshot));
|
|
76
160
|
} catch (error) {
|
|
161
|
+
if (error instanceof Error && error.name === 'HealthCheckError') {
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
77
164
|
throwHealthCheckError('Prisma health check failed.', createDownResult(indicatorKey, error instanceof Error ? error.message : 'Prisma health check failed.'));
|
|
78
165
|
}
|
|
79
166
|
}
|
|
167
|
+
getPendingHealthCheckSettlement() {
|
|
168
|
+
return this.pendingProbeSettlement;
|
|
169
|
+
}
|
|
80
170
|
}
|
|
@@ -22,6 +22,8 @@ export interface RedisHealthIndicatorOptions {
|
|
|
22
22
|
key?: string;
|
|
23
23
|
/** Custom ping callback for manual probes or tests. Lifecycle state is only mapped when `client.status` is available. */
|
|
24
24
|
ping?: () => Promise<unknown> | unknown;
|
|
25
|
+
/** Whether this indicator participates in `/ready`. Defaults to `true`. */
|
|
26
|
+
readiness?: boolean;
|
|
25
27
|
/** Maximum time to wait for the ping operation. Defaults to `2_000` ms. */
|
|
26
28
|
timeoutMs?: number;
|
|
27
29
|
}
|
|
@@ -39,6 +41,10 @@ export declare function createRedisHealthIndicator(options?: RedisHealthIndicato
|
|
|
39
41
|
* default-vs-named client lifecycle boundary from `@fluojs/redis` while keeping the
|
|
40
42
|
* Redis-specific peer dependency isolated to `@fluojs/terminus/redis`.
|
|
41
43
|
*
|
|
44
|
+
* The Redis client token is a required dependency of the indicator, so it must be visible in
|
|
45
|
+
* the Terminus module scope. Pass the owning module through `TerminusModule.forRoot({ imports })`;
|
|
46
|
+
* a missing registration fails at bootstrap rather than degrading `/health` and `/ready` afterwards.
|
|
47
|
+
*
|
|
42
48
|
* @param options Optional named-client hint, timeout, key override, or custom ping callback.
|
|
43
49
|
* @returns A factory provider that exposes `RedisHealthIndicator` from the DI container.
|
|
44
50
|
*/
|
|
@@ -47,8 +53,11 @@ export declare function createRedisHealthIndicatorProvider(options?: Omit<RedisH
|
|
|
47
53
|
export declare class RedisHealthIndicator implements HealthIndicator {
|
|
48
54
|
private readonly options;
|
|
49
55
|
readonly key: string | undefined;
|
|
56
|
+
readonly readiness: boolean | undefined;
|
|
57
|
+
private pendingProbeSettlement;
|
|
50
58
|
constructor(options?: RedisHealthIndicatorOptions);
|
|
51
59
|
check(key: string): Promise<HealthIndicatorResult>;
|
|
60
|
+
getPendingHealthCheckSettlement(): Promise<void> | undefined;
|
|
52
61
|
}
|
|
53
62
|
export {};
|
|
54
63
|
//# sourceMappingURL=redis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/indicators/redis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAA+E,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/indicators/redis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAA+E,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE1I,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAG1E,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAC;CAC5C;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;IAC1C,oGAAoG;IACpG,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yHAAyH;IACzH,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACxC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,2BAAgC,GAAG,eAAe,CAErG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAAC,OAAO,GAAE,IAAI,CAAC,2BAA2B,EAAE,QAAQ,CAAM,GAAG,QAAQ,CAQtH;AAED,4GAA4G;AAC5G,qBAAa,oBAAqB,YAAW,eAAe;IAK9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,OAAO,CAAC,sBAAsB,CAA4B;gBAE7B,OAAO,GAAE,2BAAgC;IAKhE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA2BxD,+BAA+B,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS;CAG7D"}
|
package/dist/indicators/redis.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRedisPlatformStatusSnapshot, getRedisClientToken, getRedisComponentId } from '@fluojs/redis';
|
|
2
|
-
import { createDownResult, createUpResult, resolveIndicatorKey, throwHealthCheckError, withIndicatorTimeout } from './utils.js';
|
|
2
|
+
import { createDownResult, createUpResult, resolveIndicatorKey, resolveIndicatorTimeoutMs, throwHealthCheckError, waitForIndicatorProbeSettlement, withIndicatorTimeout } from './utils.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Options for probing Redis connectivity.
|
|
@@ -74,6 +74,10 @@ export function createRedisHealthIndicator(options = {}) {
|
|
|
74
74
|
* default-vs-named client lifecycle boundary from `@fluojs/redis` while keeping the
|
|
75
75
|
* Redis-specific peer dependency isolated to `@fluojs/terminus/redis`.
|
|
76
76
|
*
|
|
77
|
+
* The Redis client token is a required dependency of the indicator, so it must be visible in
|
|
78
|
+
* the Terminus module scope. Pass the owning module through `TerminusModule.forRoot({ imports })`;
|
|
79
|
+
* a missing registration fails at bootstrap rather than degrading `/health` and `/ready` afterwards.
|
|
80
|
+
*
|
|
77
81
|
* @param options Optional named-client hint, timeout, key override, or custom ping callback.
|
|
78
82
|
* @returns A factory provider that exposes `RedisHealthIndicator` from the DI container.
|
|
79
83
|
*/
|
|
@@ -92,19 +96,24 @@ export function createRedisHealthIndicatorProvider(options = {}) {
|
|
|
92
96
|
/** Health indicator that maps Redis lifecycle status and checks reachability with a ping-like operation. */
|
|
93
97
|
export class RedisHealthIndicator {
|
|
94
98
|
key;
|
|
99
|
+
readiness;
|
|
100
|
+
pendingProbeSettlement;
|
|
95
101
|
constructor(options = {}) {
|
|
96
102
|
this.options = options;
|
|
97
103
|
this.key = options.key;
|
|
104
|
+
this.readiness = options.readiness;
|
|
98
105
|
}
|
|
99
106
|
async check(key) {
|
|
100
107
|
const indicatorKey = resolveIndicatorKey('redis', this.options.key ?? key);
|
|
101
|
-
const timeoutMs = this.options.timeoutMs ?? DEFAULT_REDIS_TIMEOUT_MS;
|
|
102
108
|
try {
|
|
109
|
+
const timeoutMs = resolveIndicatorTimeoutMs(this.options.timeoutMs, DEFAULT_REDIS_TIMEOUT_MS, indicatorKey);
|
|
103
110
|
const lifecycleDownResult = createRedisLifecycleDownResult(indicatorKey, this.options);
|
|
104
111
|
if (lifecycleDownResult) {
|
|
105
112
|
throwHealthCheckError('Redis health check failed.', lifecycleDownResult);
|
|
106
113
|
}
|
|
107
|
-
|
|
114
|
+
const probe = runRedisPing(this.options);
|
|
115
|
+
this.pendingProbeSettlement = waitForIndicatorProbeSettlement(probe);
|
|
116
|
+
await withIndicatorTimeout(probe, timeoutMs, indicatorKey);
|
|
108
117
|
return createUpResult(indicatorKey, createRedisLifecycleUpDetails(this.options));
|
|
109
118
|
} catch (error) {
|
|
110
119
|
if (error instanceof Error && error.name === 'HealthCheckError') {
|
|
@@ -113,4 +122,7 @@ export class RedisHealthIndicator {
|
|
|
113
122
|
throwHealthCheckError('Redis health check failed.', createDownResult(indicatorKey, error instanceof Error ? error.message : 'Redis health check failed.'));
|
|
114
123
|
}
|
|
115
124
|
}
|
|
125
|
+
getPendingHealthCheckSettlement() {
|
|
126
|
+
return this.pendingProbeSettlement;
|
|
127
|
+
}
|
|
116
128
|
}
|
|
@@ -3,6 +3,16 @@ import type { HealthIndicatorResult } from '../types.js';
|
|
|
3
3
|
export interface IndicatorTimeoutOptions {
|
|
4
4
|
timeoutMs?: number;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Resolve an indicator timeout budget before it reaches timeout scheduling.
|
|
8
|
+
*
|
|
9
|
+
* @param timeoutMs Caller-provided timeout budget in milliseconds.
|
|
10
|
+
* @param defaultTimeoutMs Default timeout budget used when `timeoutMs` is omitted.
|
|
11
|
+
* @param indicatorName Indicator name used in timeout validation errors.
|
|
12
|
+
* @returns A positive integer timeout budget in milliseconds.
|
|
13
|
+
* @throws {Error} When the resolved timeout is zero, negative, `NaN`, or infinite.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveIndicatorTimeoutMs(timeoutMs: number | undefined, defaultTimeoutMs: number, indicatorName: string): number;
|
|
6
16
|
/**
|
|
7
17
|
* Create an `up` indicator result payload.
|
|
8
18
|
*
|
|
@@ -29,6 +39,13 @@ export declare function createDownResult(key: string, message: string, details?:
|
|
|
29
39
|
* @returns The original promise result when it finishes in time.
|
|
30
40
|
*/
|
|
31
41
|
export declare function withIndicatorTimeout<T>(promise: Promise<T>, timeoutMs: number, indicatorName: string): Promise<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Convert a probe promise into a settlement signal that never rejects.
|
|
44
|
+
*
|
|
45
|
+
* @param promise Probe promise whose completion releases its execution ownership.
|
|
46
|
+
* @returns A promise that resolves after the probe either fulfills or rejects.
|
|
47
|
+
*/
|
|
48
|
+
export declare function waitForIndicatorProbeSettlement(promise: Promise<unknown>): Promise<void>;
|
|
32
49
|
/**
|
|
33
50
|
* Resolve the effective key used in reports for one indicator execution.
|
|
34
51
|
*
|
|
@@ -1 +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,
|
|
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;AAUD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,MAAM,GACpB,MAAM,CAER;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,CAyBZ;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxF;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"}
|
package/dist/indicators/utils.js
CHANGED
|
@@ -2,6 +2,26 @@ import { HealthCheckError } from '../errors.js';
|
|
|
2
2
|
|
|
3
3
|
/** Timeout settings shared by indicators that call external dependencies. */
|
|
4
4
|
|
|
5
|
+
function normalizePositiveFiniteTimeoutMs(timeoutMs, indicatorName) {
|
|
6
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
7
|
+
throw new Error(`${indicatorName} health indicator timeoutMs must be a positive finite number.`);
|
|
8
|
+
}
|
|
9
|
+
return Math.max(1, Math.floor(timeoutMs));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Resolve an indicator timeout budget before it reaches timeout scheduling.
|
|
14
|
+
*
|
|
15
|
+
* @param timeoutMs Caller-provided timeout budget in milliseconds.
|
|
16
|
+
* @param defaultTimeoutMs Default timeout budget used when `timeoutMs` is omitted.
|
|
17
|
+
* @param indicatorName Indicator name used in timeout validation errors.
|
|
18
|
+
* @returns A positive integer timeout budget in milliseconds.
|
|
19
|
+
* @throws {Error} When the resolved timeout is zero, negative, `NaN`, or infinite.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveIndicatorTimeoutMs(timeoutMs, defaultTimeoutMs, indicatorName) {
|
|
22
|
+
return normalizePositiveFiniteTimeoutMs(timeoutMs ?? defaultTimeoutMs, indicatorName);
|
|
23
|
+
}
|
|
24
|
+
|
|
5
25
|
/**
|
|
6
26
|
* Create an `up` indicator result payload.
|
|
7
27
|
*
|
|
@@ -45,10 +65,16 @@ export function createDownResult(key, message, details = {}) {
|
|
|
45
65
|
* @returns The original promise result when it finishes in time.
|
|
46
66
|
*/
|
|
47
67
|
export function withIndicatorTimeout(promise, timeoutMs, indicatorName) {
|
|
68
|
+
let normalizedTimeoutMs;
|
|
69
|
+
try {
|
|
70
|
+
normalizedTimeoutMs = normalizePositiveFiniteTimeoutMs(timeoutMs, indicatorName);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
return Promise.reject(error);
|
|
73
|
+
}
|
|
48
74
|
return new Promise((resolve, reject) => {
|
|
49
75
|
const timer = setTimeout(() => {
|
|
50
|
-
reject(new Error(`${indicatorName} health indicator timed out after ${String(
|
|
51
|
-
},
|
|
76
|
+
reject(new Error(`${indicatorName} health indicator timed out after ${String(normalizedTimeoutMs)}ms.`));
|
|
77
|
+
}, normalizedTimeoutMs);
|
|
52
78
|
promise.then(value => {
|
|
53
79
|
clearTimeout(timer);
|
|
54
80
|
resolve(value);
|
|
@@ -59,6 +85,16 @@ export function withIndicatorTimeout(promise, timeoutMs, indicatorName) {
|
|
|
59
85
|
});
|
|
60
86
|
}
|
|
61
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Convert a probe promise into a settlement signal that never rejects.
|
|
90
|
+
*
|
|
91
|
+
* @param promise Probe promise whose completion releases its execution ownership.
|
|
92
|
+
* @returns A promise that resolves after the probe either fulfills or rejects.
|
|
93
|
+
*/
|
|
94
|
+
export function waitForIndicatorProbeSettlement(promise) {
|
|
95
|
+
return promise.then(() => undefined, () => undefined);
|
|
96
|
+
}
|
|
97
|
+
|
|
62
98
|
/**
|
|
63
99
|
* Resolve the effective key used in reports for one indicator execution.
|
|
64
100
|
*
|
package/dist/module.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ export declare class TerminusModule {
|
|
|
5
5
|
/**
|
|
6
6
|
* Register Terminus health indicators and readiness hooks.
|
|
7
7
|
*
|
|
8
|
+
* DI-backed indicator providers resolve inside the Terminus module scope. A named Redis token
|
|
9
|
+
* is required, so its owner module must be listed in `imports`; otherwise bootstrap fails with
|
|
10
|
+
* `MODULE_VISIBILITY_ERROR`. Prisma and Drizzle owner tokens are optional only when absent from
|
|
11
|
+
* the bootstrap graph: omitting their modules then lets the application bootstrap and their
|
|
12
|
+
* indicators report `down` on health checks. Existing sibling owner tokens still require
|
|
13
|
+
* `imports`; optional injection never bypasses module visibility.
|
|
14
|
+
*
|
|
8
15
|
* @example
|
|
9
16
|
* ```ts
|
|
10
17
|
* import { MemoryHealthIndicator } from '@fluojs/terminus/node';
|
|
@@ -14,7 +21,17 @@ export declare class TerminusModule {
|
|
|
14
21
|
* });
|
|
15
22
|
* ```
|
|
16
23
|
*
|
|
17
|
-
* @
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const prismaModule = PrismaModule.forRoot({ client });
|
|
27
|
+
*
|
|
28
|
+
* TerminusModule.forRoot({
|
|
29
|
+
* imports: [prismaModule],
|
|
30
|
+
* indicatorProviders: [createPrismaHealthIndicatorProvider({ key: 'prisma' })],
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param options Terminus health indicator, dependency import, and readiness configuration.
|
|
18
35
|
* @returns A runtime module exposing health endpoints and `TerminusHealthService`.
|
|
19
36
|
*/
|
|
20
37
|
static forRoot(options?: TerminusModuleOptions): ModuleType;
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,UAAU,EAKhB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAA4D,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAkSlH,uFAAuF;AACvF,qBAAa,cAAc;IACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,qBAA0B,GAAG,UAAU;CAGhE"}
|
package/dist/module.js
CHANGED
|
@@ -23,6 +23,7 @@ function createTerminusProviders(options = {}) {
|
|
|
23
23
|
execution: {
|
|
24
24
|
...(options.execution ?? {})
|
|
25
25
|
},
|
|
26
|
+
imports: [...(options.imports ?? [])],
|
|
26
27
|
indicators: copyIndicators(options.indicators),
|
|
27
28
|
indicatorProviders: copyProviders(options.indicatorProviders),
|
|
28
29
|
readinessChecks: [...(options.readinessChecks ?? [])]
|
|
@@ -149,7 +150,9 @@ function withPlatformDiagnostics(report, health, readiness) {
|
|
|
149
150
|
}
|
|
150
151
|
function createTerminusRuntimeModule(options = {}) {
|
|
151
152
|
const readinessChecks = [...(options.readinessChecks ?? [])];
|
|
153
|
+
const terminusImports = [...(options.imports ?? [])];
|
|
152
154
|
const healthModule = HealthModule.forRoot({
|
|
155
|
+
endpointMiddleware: options.endpointMiddleware,
|
|
153
156
|
healthCheck: async ctx => {
|
|
154
157
|
const healthService = await ctx.container.resolve(TerminusHealthService);
|
|
155
158
|
const platformShell = await ctx.container.resolve(PLATFORM_SHELL);
|
|
@@ -168,10 +171,12 @@ function createTerminusRuntimeModule(options = {}) {
|
|
|
168
171
|
const TERMINUS_READINESS_REGISTRAR = Symbol('fluo.terminus.readiness-registrar');
|
|
169
172
|
class TerminusRuntimeModule {}
|
|
170
173
|
return defineModule(TerminusRuntimeModule, {
|
|
171
|
-
exports: [TERMINUS_HEALTH_INDICATORS, TerminusHealthService],
|
|
172
|
-
imports: [healthModule],
|
|
174
|
+
exports: [TERMINUS_HEALTH_INDICATORS, TERMINUS_INDICATOR_PROVIDER_TOKENS, TerminusHealthService],
|
|
175
|
+
imports: [healthModule, ...terminusImports],
|
|
173
176
|
providers: [...createTerminusProviders({
|
|
174
177
|
execution: options.execution,
|
|
178
|
+
endpointMiddleware: options.endpointMiddleware,
|
|
179
|
+
imports: terminusImports,
|
|
175
180
|
indicatorProviders: options.indicatorProviders,
|
|
176
181
|
indicators: options.indicators,
|
|
177
182
|
path: options.path,
|
|
@@ -185,7 +190,7 @@ function createTerminusRuntimeModule(options = {}) {
|
|
|
185
190
|
onApplicationBootstrap() {
|
|
186
191
|
healthModule.addReadinessCheck(async ctx => {
|
|
187
192
|
const platformShell = await ctx.container.resolve(PLATFORM_SHELL);
|
|
188
|
-
const [indicatorHealthy, readiness] = await Promise.all([healthService.
|
|
193
|
+
const [indicatorHealthy, readiness] = await Promise.all([healthService.isReady(), platformShell.ready()]);
|
|
189
194
|
return indicatorHealthy && readiness.status === 'ready';
|
|
190
195
|
});
|
|
191
196
|
}
|
|
@@ -200,6 +205,13 @@ export class TerminusModule {
|
|
|
200
205
|
/**
|
|
201
206
|
* Register Terminus health indicators and readiness hooks.
|
|
202
207
|
*
|
|
208
|
+
* DI-backed indicator providers resolve inside the Terminus module scope. A named Redis token
|
|
209
|
+
* is required, so its owner module must be listed in `imports`; otherwise bootstrap fails with
|
|
210
|
+
* `MODULE_VISIBILITY_ERROR`. Prisma and Drizzle owner tokens are optional only when absent from
|
|
211
|
+
* the bootstrap graph: omitting their modules then lets the application bootstrap and their
|
|
212
|
+
* indicators report `down` on health checks. Existing sibling owner tokens still require
|
|
213
|
+
* `imports`; optional injection never bypasses module visibility.
|
|
214
|
+
*
|
|
203
215
|
* @example
|
|
204
216
|
* ```ts
|
|
205
217
|
* import { MemoryHealthIndicator } from '@fluojs/terminus/node';
|
|
@@ -209,7 +221,17 @@ export class TerminusModule {
|
|
|
209
221
|
* });
|
|
210
222
|
* ```
|
|
211
223
|
*
|
|
212
|
-
* @
|
|
224
|
+
* @example
|
|
225
|
+
* ```ts
|
|
226
|
+
* const prismaModule = PrismaModule.forRoot({ client });
|
|
227
|
+
*
|
|
228
|
+
* TerminusModule.forRoot({
|
|
229
|
+
* imports: [prismaModule],
|
|
230
|
+
* indicatorProviders: [createPrismaHealthIndicatorProvider({ key: 'prisma' })],
|
|
231
|
+
* });
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* @param options Terminus health indicator, dependency import, and readiness configuration.
|
|
213
235
|
* @returns A runtime module exposing health endpoints and `TerminusHealthService`.
|
|
214
236
|
*/
|
|
215
237
|
static forRoot(options = {}) {
|
package/dist/node-runtime.d.ts
CHANGED
|
@@ -5,7 +5,11 @@ interface NodeMemoryUsageSnapshot {
|
|
|
5
5
|
heapUsed: number;
|
|
6
6
|
rss: number;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Read Node.js process memory usage through the Terminus Node runtime seam.
|
|
10
|
+
*
|
|
11
|
+
* @returns A snapshot of the current Node.js process memory usage.
|
|
12
|
+
*/
|
|
9
13
|
export declare function readNodeMemoryUsage(): NodeMemoryUsageSnapshot;
|
|
10
14
|
export {};
|
|
11
15
|
//# sourceMappingURL=node-runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-runtime.d.ts","sourceRoot":"","sources":["../src/node-runtime.ts"],"names":[],"mappings":"AAAA,UAAU,uBAAuB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAkBD
|
|
1
|
+
{"version":3,"file":"node-runtime.d.ts","sourceRoot":"","sources":["../src/node-runtime.ts"],"names":[],"mappings":"AAAA,UAAU,uBAAuB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAkBD;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,uBAAuB,CAQ7D"}
|
package/dist/node-runtime.js
CHANGED
|
@@ -3,7 +3,11 @@ function resolveNodeProcess() {
|
|
|
3
3
|
return runtimeGlobal.process;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Read Node.js process memory usage through the Terminus Node runtime seam.
|
|
8
|
+
*
|
|
9
|
+
* @returns A snapshot of the current Node.js process memory usage.
|
|
10
|
+
*/
|
|
7
11
|
export function readNodeMemoryUsage() {
|
|
8
12
|
const memoryUsage = resolveNodeProcess()?.memoryUsage;
|
|
9
13
|
if (typeof memoryUsage !== 'function') {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { Constructor } from '@fluojs/core';
|
|
1
2
|
import type { Provider } from '@fluojs/di';
|
|
2
|
-
import type {
|
|
3
|
+
import type { Middleware } from '@fluojs/http';
|
|
4
|
+
import type { ModuleType, PlatformHealthReport, PlatformReadinessReport, ReadinessCheck } from '@fluojs/runtime';
|
|
3
5
|
/** Status values returned by one health indicator execution. */
|
|
4
6
|
export type HealthIndicatorStatus = 'up' | 'down';
|
|
5
7
|
/** One indicator state payload stored under its resolved key. */
|
|
@@ -14,6 +16,8 @@ export type HealthIndicatorResult = {
|
|
|
14
16
|
export interface HealthIndicator {
|
|
15
17
|
check(key: string): Promise<HealthIndicatorResult>;
|
|
16
18
|
key?: string;
|
|
19
|
+
/** Whether this indicator participates in `/ready`. Defaults to `true`. */
|
|
20
|
+
readiness?: boolean;
|
|
17
21
|
}
|
|
18
22
|
/** Structured health report returned by Terminus aggregation helpers. */
|
|
19
23
|
export interface HealthCheckReport {
|
|
@@ -44,6 +48,18 @@ export interface HealthCheckExecutionOptions {
|
|
|
44
48
|
*/
|
|
45
49
|
export interface TerminusModuleOptions {
|
|
46
50
|
execution?: HealthCheckExecutionOptions;
|
|
51
|
+
/** Class-based middleware applied only to the generated `/health` and `/ready` endpoints. */
|
|
52
|
+
endpointMiddleware?: readonly Constructor<Middleware>[];
|
|
53
|
+
/**
|
|
54
|
+
* Modules whose exported tokens must be visible to `indicatorProviders`.
|
|
55
|
+
*
|
|
56
|
+
* Terminus registers `indicatorProviders` inside its own module scope, so a
|
|
57
|
+
* dependency-owning module such as `PrismaModule`, `DrizzleModule`, or a named
|
|
58
|
+
* `RedisModule` registration must be imported here for its exported tokens to
|
|
59
|
+
* resolve. Importing the module into the parent application module alone does
|
|
60
|
+
* not make its exports visible to Terminus.
|
|
61
|
+
*/
|
|
62
|
+
imports?: readonly ModuleType[];
|
|
47
63
|
indicators?: readonly HealthIndicator[];
|
|
48
64
|
indicatorProviders?: readonly Provider[];
|
|
49
65
|
path?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjH,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;IACb,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;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,6FAA6F;IAC7F,kBAAkB,CAAC,EAAE,SAAS,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;IACxD;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAChC,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/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"liveness",
|
|
10
10
|
"health-check"
|
|
11
11
|
],
|
|
12
|
-
"version": "
|
|
12
|
+
"version": "2.0.0",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"directory": "packages/terminus"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
21
|
+
"node": ">=24.0.0 <27"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"dist"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@fluojs/core": "^
|
|
48
|
-
"@fluojs/di": "^
|
|
49
|
-
"@fluojs/http": "^
|
|
50
|
-
"@fluojs/runtime": "^
|
|
47
|
+
"@fluojs/core": "^2.0.0",
|
|
48
|
+
"@fluojs/di": "^3.0.0",
|
|
49
|
+
"@fluojs/http": "^3.0.0",
|
|
50
|
+
"@fluojs/runtime": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@fluojs/drizzle": "^
|
|
54
|
-
"@fluojs/prisma": "^
|
|
55
|
-
"@fluojs/redis": "^
|
|
53
|
+
"@fluojs/drizzle": "^2.0.0",
|
|
54
|
+
"@fluojs/prisma": "^2.0.0",
|
|
55
|
+
"@fluojs/redis": "^2.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"@fluojs/drizzle": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"vitest": "^
|
|
70
|
-
"@fluojs/testing": "^
|
|
69
|
+
"vitest": "^4.1.11",
|
|
70
|
+
"@fluojs/testing": "^3.0.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"prebuild": "node ../../tooling/scripts/clean-dist.mjs",
|