@dads-framework/http 0.2.0 → 0.3.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.md +41 -2
- package/dist/health/index.d.ts +2 -0
- package/dist/health/index.d.ts.map +1 -0
- package/dist/health/index.js +2 -0
- package/dist/health/index.js.map +1 -0
- package/dist/health/lib/health.route-handlers.d.ts +14 -0
- package/dist/health/lib/health.route-handlers.d.ts.map +1 -0
- package/dist/health/lib/health.route-handlers.js +19 -0
- package/dist/health/lib/health.route-handlers.js.map +1 -0
- package/dist/health/lib/health.routes.d.ts +6 -0
- package/dist/health/lib/health.routes.d.ts.map +1 -0
- package/dist/health/lib/health.routes.js +28 -0
- package/dist/health/lib/health.routes.js.map +1 -0
- package/dist/health/lib/health.schemas.d.ts +10 -0
- package/dist/health/lib/health.schemas.d.ts.map +1 -0
- package/dist/health/lib/health.schemas.js +10 -0
- package/dist/health/lib/health.schemas.js.map +1 -0
- package/dist/http.tsbuildinfo +1 -1
- package/dist/lib/create-http-app.d.ts +1 -1
- package/dist/lib/create-http-app.d.ts.map +1 -1
- package/dist/lib/create-http-app.js +2 -2
- package/dist/lib/create-http-app.js.map +1 -1
- package/dist/lib/openapi/build-document.js +1 -1
- package/dist/lib/openapi/build-document.js.map +1 -1
- package/dist/lib/request-log/authorization-warning-faults.d.ts +1 -1
- package/dist/lib/request-log/authorization-warning-faults.d.ts.map +1 -1
- package/dist/lib/request-log/capture-request-record.d.ts +1 -1
- package/dist/lib/request-log/capture-request-record.d.ts.map +1 -1
- package/dist/lib/request-log/capture-request-record.js +2 -2
- package/dist/lib/request-log/capture-request-record.js.map +1 -1
- package/dist/lib/request-log/request-outcome.d.ts +1 -1
- package/dist/lib/request-log/request-outcome.d.ts.map +1 -1
- package/dist/lib/request-log/request-record.d.ts +3 -3
- package/dist/lib/request-log/request-record.d.ts.map +1 -1
- package/dist/lib/request-log/request-record.js +1 -1
- package/dist/lib/request-log/request-record.js.map +1 -1
- package/dist/lib/request-pipeline/carry-audit-actor.d.ts +1 -1
- package/dist/lib/request-pipeline/carry-audit-actor.d.ts.map +1 -1
- package/dist/lib/request-pipeline/carry-audit-actor.js +1 -1
- package/dist/lib/request-pipeline/carry-audit-actor.js.map +1 -1
- package/dist/lib/request-pipeline/enforce-access.d.ts +1 -1
- package/dist/lib/request-pipeline/enforce-access.d.ts.map +1 -1
- package/dist/lib/request-pipeline/enforce-scope.d.ts +2 -1
- package/dist/lib/request-pipeline/enforce-scope.d.ts.map +1 -1
- package/dist/lib/request-pipeline/enforce-scope.js.map +1 -1
- package/dist/lib/request-pipeline/envelope.d.ts +1 -1
- package/dist/lib/request-pipeline/error-handler.d.ts +1 -1
- package/dist/lib/request-pipeline/error-handler.d.ts.map +1 -1
- package/dist/lib/request-pipeline/error-handler.js +2 -2
- package/dist/lib/request-pipeline/error-handler.js.map +1 -1
- package/dist/lib/request-pipeline/feature-state-preview.js +1 -1
- package/dist/lib/request-pipeline/feature-state-preview.js.map +1 -1
- package/dist/lib/request-pipeline/feature-state.js +1 -1
- package/dist/lib/request-pipeline/feature-state.js.map +1 -1
- package/dist/lib/request-pipeline/refuse-visible-record-list.d.ts +6 -10
- package/dist/lib/request-pipeline/refuse-visible-record-list.d.ts.map +1 -1
- package/dist/lib/request-pipeline/refuse-visible-record-list.js +9 -14
- package/dist/lib/request-pipeline/refuse-visible-record-list.js.map +1 -1
- package/dist/lib/request-pipeline/register-routes.js +2 -2
- package/dist/lib/request-pipeline/register-routes.js.map +1 -1
- package/dist/lib/request-pipeline/request-id.d.ts.map +1 -1
- package/dist/lib/request-pipeline/request-id.js +1 -1
- package/dist/lib/request-pipeline/request-id.js.map +1 -1
- package/dist/lib/request-pipeline/request-locale.d.ts +1 -1
- package/dist/lib/request-pipeline/request-locale.d.ts.map +1 -1
- package/dist/lib/request-pipeline/request-locale.js +1 -1
- package/dist/lib/request-pipeline/request-locale.js.map +1 -1
- package/dist/lib/request-pipeline/request-trace.d.ts +1 -1
- package/dist/lib/request-pipeline/request-trace.d.ts.map +1 -1
- package/dist/lib/route/list-route.d.ts +1 -1
- package/dist/lib/route/list-route.d.ts.map +1 -1
- package/dist/lib/route/list-route.js +1 -1
- package/dist/lib/route/list-route.js.map +1 -1
- package/dist/lib/route/route-definition.d.ts +2 -2
- package/dist/lib/route/route-definition.d.ts.map +1 -1
- package/dist/lib/route/route-execution.d.ts +1 -1
- package/dist/lib/route/route-execution.d.ts.map +1 -1
- package/dist/protocol-mounts/lib/mcp/mcp-endpoint.js +1 -1
- package/dist/protocol-mounts/lib/mcp/mcp-endpoint.js.map +1 -1
- package/dist/protocol-mounts/lib/mcp/mcp-methods.js +1 -1
- package/dist/protocol-mounts/lib/mcp/mcp-methods.js.map +1 -1
- package/dist/protocol-mounts/lib/protocol-mount/mount-fetch-handler.d.ts +2 -2
- package/dist/protocol-mounts/lib/protocol-mount/mount-fetch-handler.d.ts.map +1 -1
- package/dist/telemetry/core/index.d.ts +2 -0
- package/dist/telemetry/core/index.d.ts.map +1 -0
- package/dist/telemetry/core/index.js +2 -0
- package/dist/telemetry/core/index.js.map +1 -0
- package/dist/telemetry/core/request-trace-attributes.d.ts +8 -0
- package/dist/telemetry/core/request-trace-attributes.d.ts.map +1 -0
- package/dist/telemetry/core/request-trace-attributes.js +10 -0
- package/dist/telemetry/core/request-trace-attributes.js.map +1 -0
- package/dist/telemetry/core/testing/in-memory-request-trace.d.ts +7 -0
- package/dist/telemetry/core/testing/in-memory-request-trace.d.ts.map +1 -0
- package/dist/telemetry/core/testing/in-memory-request-trace.js +12 -0
- package/dist/telemetry/core/testing/in-memory-request-trace.js.map +1 -0
- package/dist/telemetry/core/testing/index.d.ts +3 -0
- package/dist/telemetry/core/testing/index.d.ts.map +1 -0
- package/dist/telemetry/core/testing/index.js +3 -0
- package/dist/telemetry/core/testing/index.js.map +1 -0
- package/dist/telemetry/core/testing/trace-attribution-conformance.d.ts +9 -0
- package/dist/telemetry/core/testing/trace-attribution-conformance.d.ts.map +1 -0
- package/dist/telemetry/core/testing/trace-attribution-conformance.js +16 -0
- package/dist/telemetry/core/testing/trace-attribution-conformance.js.map +1 -0
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +2 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/node-telemetry.d.ts +3 -0
- package/dist/telemetry/node-telemetry.d.ts.map +1 -0
- package/dist/telemetry/node-telemetry.js +36 -0
- package/dist/telemetry/node-telemetry.js.map +1 -0
- package/dist/telemetry/otlp-trace-endpoint.d.ts +3 -0
- package/dist/telemetry/otlp-trace-endpoint.d.ts.map +1 -0
- package/dist/telemetry/otlp-trace-endpoint.js +27 -0
- package/dist/telemetry/otlp-trace-endpoint.js.map +1 -0
- package/dist/telemetry/privacy-filtered-exporter.d.ts +4 -0
- package/dist/telemetry/privacy-filtered-exporter.d.ts.map +1 -0
- package/dist/telemetry/privacy-filtered-exporter.js +34 -0
- package/dist/telemetry/privacy-filtered-exporter.js.map +1 -0
- package/dist/telemetry/request-trace-conformance.test-support.d.ts +13 -0
- package/dist/telemetry/request-trace-conformance.test-support.d.ts.map +1 -0
- package/dist/telemetry/request-trace-conformance.test-support.js +48 -0
- package/dist/telemetry/request-trace-conformance.test-support.js.map +1 -0
- package/dist/telemetry/start-telemetry.d.ts +14 -0
- package/dist/telemetry/start-telemetry.d.ts.map +1 -0
- package/dist/telemetry/start-telemetry.js +11 -0
- package/dist/telemetry/start-telemetry.js.map +1 -0
- package/dist/telemetry/trace-request.d.ts +4 -0
- package/dist/telemetry/trace-request.d.ts.map +1 -0
- package/dist/telemetry/trace-request.js +12 -0
- package/dist/telemetry/trace-request.js.map +1 -0
- package/package.json +63 -7
package/README.md
CHANGED
|
@@ -170,7 +170,7 @@ handler: ({ request, reply }) => ... })` — the ONE escape hatch. Same
|
|
|
170
170
|
## Errors
|
|
171
171
|
|
|
172
172
|
Throw typed `DomainError`s from domain code (`notFound`, `conflict`,
|
|
173
|
-
`validation`, `forbidden` from `@dads-framework/errors`); the kit maps kinds to
|
|
173
|
+
`validation`, `forbidden` from `@dads-framework/core/errors`); the kit maps kinds to
|
|
174
174
|
statuses in one place. Kit-produced failures: request validation → 400,
|
|
175
175
|
response drift / wiring bugs → masked 500 (logged loud), handler past its
|
|
176
176
|
deadline → 503 `HANDLER_TIMEOUT`. Unknown errors are always masked — no
|
|
@@ -232,7 +232,7 @@ an arbitrary schema) — `res.json()` is `any` and defeats the type walls.
|
|
|
232
232
|
- `lib/route/` — authoring: one file per verb, `route-group`, `access`, `capabilities`, `define-raw-route`, `sse-route`, and `route-definition` (parse → handler → parse).
|
|
233
233
|
- `lib/create-http-app.ts` — builds the Fastify instance (logger, CORS, timeouts, request-id, trustedProxyHops).
|
|
234
234
|
- `lib/request-pipeline/` — `register-routes` (enforce → run under deadline → envelope), `enforce-access`, `with-deadline`, `error-handler`, `envelope`, `rate-limit`, `request-id`.
|
|
235
|
-
- `lib/openapi/` — the generated document. The kit knows how to convert a route table, never which domains exist: nothing here imports a domain contract lib (`@dads-framework/contract` is the kit's own vocabulary). The parity golden test that pins the generated document against the committed artifact needs real domain schemas, so it lives with the composition root that already knows them.
|
|
235
|
+
- `lib/openapi/` — the generated document. The kit knows how to convert a route table, never which domains exist: nothing here imports a domain contract lib (`@dads-framework/core/contract` is the kit's own vocabulary). The parity golden test that pins the generated document against the committed artifact needs real domain schemas, so it lives with the composition root that already knows them.
|
|
236
236
|
- `lib/request-log/` — the captured row: `request-record` (pure builder plus the header allowlist), `request-outcome` (what the pipeline learned and the response no longer shows), `capture-request-record` (the `onResponse` hook), `request-log-sink` (the seam `@dads-framework/audit` implements).
|
|
237
237
|
- `lib/http-errors.ts` — typed failures this library produces while running a route.
|
|
238
238
|
- `src/testing/` — `buildTestApp` + typed inject-response helpers.
|
|
@@ -254,6 +254,43 @@ API can clear an authorization-consistency cookie on sign-out.
|
|
|
254
254
|
await app.register(mountFetchHandler(auth), { prefix: "/api/auth" });
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
+
## Liveness and readiness
|
|
258
|
+
|
|
259
|
+
Use `createHealthRoutes(checks)` to expose separate checks for processes and
|
|
260
|
+
traffic routers. `/health` confirms the process responds. `/ready` evaluates
|
|
261
|
+
the application's readiness probes. Register the routes during API composition
|
|
262
|
+
and supply probes for dependencies required to serve traffic.
|
|
263
|
+
|
|
264
|
+
Save this as `example.mts` and run `node --experimental-strip-types example.mts`.
|
|
265
|
+
|
|
266
|
+
<!-- dads:check-example -->
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
import { createHealthRoutes } from "@dads-framework/http/health";
|
|
270
|
+
import { buildTestApp } from "@dads-framework/http/testing";
|
|
271
|
+
|
|
272
|
+
const app = await buildTestApp({
|
|
273
|
+
routes: createHealthRoutes({
|
|
274
|
+
pingDatabase: () => Promise.reject(new Error("Database unavailable")),
|
|
275
|
+
pingCriticalServices: () => Promise.resolve(),
|
|
276
|
+
}),
|
|
277
|
+
});
|
|
278
|
+
try {
|
|
279
|
+
const live = await app.inject({ method: "GET", url: "/health" });
|
|
280
|
+
const ready = await app.inject({ method: "GET", url: "/ready" });
|
|
281
|
+
console.log(live.statusCode, ready.statusCode);
|
|
282
|
+
} finally {
|
|
283
|
+
await app.close();
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
The simulated outage prints `200 503`. Liveness still succeeds. Replace
|
|
288
|
+
the example probes with your application’s dependency checks when
|
|
289
|
+
registering the routes in your HTTP app.
|
|
290
|
+
|
|
291
|
+
In the generated app, `assembly/start-app.ts` registers probes for the
|
|
292
|
+
database, job queue, and file store. [Starter health wiring](../../../apps/kit-workbench/assembly/start-app.ts)
|
|
293
|
+
|
|
257
294
|
## Compose authorization for lists
|
|
258
295
|
|
|
259
296
|
Use `requires`, `requiresVisible`, or `requiresScoped` from
|
|
@@ -278,6 +315,8 @@ the context being evaluated.
|
|
|
278
315
|
|
|
279
316
|
## What it refuses to do
|
|
280
317
|
|
|
318
|
+
Readiness reports the results of probes supplied by the application.
|
|
319
|
+
|
|
281
320
|
Application code supplies identity, access policies, and business handlers. The HTTP kit enforces the declared route boundary and owns transport.
|
|
282
321
|
|
|
283
322
|
A public POST that only appends internal telemetry can declare
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/health/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/health/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAEnB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HealthStatus, ReadyStatus } from "./health.schemas.js";
|
|
2
|
+
/** Dependency probes required before serving traffic. */
|
|
3
|
+
export type ReadinessChecks = {
|
|
4
|
+
pingDatabase(): Promise<void>;
|
|
5
|
+
pingCriticalServices(): Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
/** Named handlers for the public liveness and readiness routes. */
|
|
8
|
+
export type HealthRouteHandlers = {
|
|
9
|
+
readonly getHealth: () => HealthStatus;
|
|
10
|
+
readonly getReady: () => Promise<ReadyStatus>;
|
|
11
|
+
};
|
|
12
|
+
/** Maps dependency probes to named route handlers. */
|
|
13
|
+
export declare function createHealthRouteHandlers(checks: ReadinessChecks): HealthRouteHandlers;
|
|
14
|
+
//# sourceMappingURL=health.route-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.route-handlers.d.ts","sourceRoot":"","sources":["../../../src/health/lib/health.route-handlers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAErE,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,YAAY,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/C,CAAC;AAEF,sDAAsD;AACtD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,eAAe,GACtB,mBAAmB,CAmBrB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ServiceUnavailableError } from "../../index.js";
|
|
2
|
+
/** Maps dependency probes to named route handlers. */
|
|
3
|
+
export function createHealthRouteHandlers(checks) {
|
|
4
|
+
function getHealth() {
|
|
5
|
+
return { status: "ok" };
|
|
6
|
+
}
|
|
7
|
+
async function getReady() {
|
|
8
|
+
try {
|
|
9
|
+
await checks.pingDatabase();
|
|
10
|
+
await checks.pingCriticalServices();
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
throw new ServiceUnavailableError("NOT_READY", "A critical dependency is unreachable");
|
|
14
|
+
}
|
|
15
|
+
return { status: "ready" };
|
|
16
|
+
}
|
|
17
|
+
return { getHealth, getReady };
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=health.route-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.route-handlers.js","sourceRoot":"","sources":["../../../src/health/lib/health.route-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAgBzD,sDAAsD;AACtD,MAAM,UAAU,yBAAyB,CACvC,MAAuB;IAEvB,SAAS,SAAS;QAChB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,UAAU,QAAQ;QACrB,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;YAC5B,MAAM,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACtC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,uBAAuB,CAC/B,WAAW,EACX,sCAAsC,CACvC,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HttpRoute } from "../../index.js";
|
|
2
|
+
import { type ReadinessChecks } from "./health.route-handlers.js";
|
|
3
|
+
export type { ReadinessChecks } from "./health.route-handlers.js";
|
|
4
|
+
/** /health is liveness; /ready checks dependencies before serving traffic. */
|
|
5
|
+
export declare function createHealthRoutes(checks: ReadinessChecks): HttpRoute[];
|
|
6
|
+
//# sourceMappingURL=health.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.routes.d.ts","sourceRoot":"","sources":["../../../src/health/lib/health.routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,EAAE,CAGvE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getRoute, publicAccess, routeGroup, } from "../../index.js";
|
|
2
|
+
import { createHealthRouteHandlers, } from "./health.route-handlers.js";
|
|
3
|
+
import { healthStatusSchema, readyStatusSchema } from "./health.schemas.js";
|
|
4
|
+
/** /health is liveness; /ready checks dependencies before serving traffic. */
|
|
5
|
+
export function createHealthRoutes(checks) {
|
|
6
|
+
const handlers = createHealthRouteHandlers(checks);
|
|
7
|
+
return routeGroup("Health", healthRouteCards(handlers));
|
|
8
|
+
}
|
|
9
|
+
/** Reviewed infrastructure probes use local schemas and no client binding. */
|
|
10
|
+
function healthRouteCards(handlers) {
|
|
11
|
+
return [
|
|
12
|
+
getRoute({
|
|
13
|
+
path: "/health",
|
|
14
|
+
summary: "Liveness — answers without touching dependencies",
|
|
15
|
+
access: publicAccess(),
|
|
16
|
+
response: healthStatusSchema,
|
|
17
|
+
handler: handlers.getHealth,
|
|
18
|
+
}),
|
|
19
|
+
getRoute({
|
|
20
|
+
path: "/ready",
|
|
21
|
+
summary: "Readiness — critical services reachable",
|
|
22
|
+
access: publicAccess(),
|
|
23
|
+
response: readyStatusSchema,
|
|
24
|
+
handler: handlers.getReady,
|
|
25
|
+
}),
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=health.routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.routes.js","sourceRoot":"","sources":["../../../src/health/lib/health.routes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,UAAU,GAGX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,GAG1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI5E,8EAA8E;AAC9E,MAAM,UAAU,kBAAkB,CAAC,MAAuB;IACxD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACnD,OAAO,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,8EAA8E;AAC9E,SAAS,gBAAgB,CAAC,QAA6B;IACrD,OAAO;QACL,QAAQ,CAAC;YACP,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,kDAAkD;YAC3D,MAAM,EAAE,YAAY,EAAE;YACtB,QAAQ,EAAE,kBAAkB;YAC5B,OAAO,EAAE,QAAQ,CAAC,SAAS;SAC5B,CAAC;QACF,QAAQ,CAAC;YACP,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,yCAAyC;YAClD,MAAM,EAAE,YAAY,EAAE;YACtB,QAAQ,EAAE,iBAAiB;YAC3B,OAAO,EAAE,QAAQ,CAAC,QAAQ;SAC3B,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const healthStatusSchema: z.ZodObject<{
|
|
3
|
+
status: z.ZodLiteral<"ok">;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const readyStatusSchema: z.ZodObject<{
|
|
6
|
+
status: z.ZodLiteral<"ready">;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type HealthStatus = z.infer<typeof healthStatusSchema>;
|
|
9
|
+
export type ReadyStatus = z.infer<typeof readyStatusSchema>;
|
|
10
|
+
//# sourceMappingURL=health.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.schemas.d.ts","sourceRoot":"","sources":["../../../src/health/lib/health.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;iBAE7B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;iBAI5B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const healthStatusSchema = z.object({
|
|
3
|
+
status: z.literal("ok").meta({ description: "Process liveness" }),
|
|
4
|
+
});
|
|
5
|
+
export const readyStatusSchema = z.object({
|
|
6
|
+
status: z.literal("ready").meta({
|
|
7
|
+
description: "Service readiness — critical services reachable",
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=health.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.schemas.js","sourceRoot":"","sources":["../../../src/health/lib/health.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;CAClE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;QAC9B,WAAW,EAAE,iDAAiD;KAC/D,CAAC;CACH,CAAC,CAAC"}
|