Type Parameters
- H extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> = ZodObject<{}, $loose>
Parameters
- componentName: string
- options: { auth: { config: AuthSpec; status?: AuthSpec }; healthSchema?: H }
Returns readonly [
{
auth: AuthSpec;
description: `Get ${string} service health, version, and uptime.`;
kind: "read";
method: "GET";
name: "status";
path: "/status";
response: ZodObject<
{
health: H;
name: ZodString;
status: ZodUnion<
readonly [
ZodLiteral<"healthy">,
ZodLiteral<"degraded">,
ZodLiteral<"unhealthy">,
],
>;
uptime: ZodNumber;
version: ZodString;
},
$strip,
>;
},
{
auth: AuthSpec;
description: `Query ${string} running configuration. Optional JSONPath filter.`;
kind: "read";
method: "GET";
name: "config";
path: "/config";
query: ZodObject<{ path: ZodOptional<ZodString> }, $strip>;
response: ZodUnion<
readonly [
ZodObject<{ count: ZodNumber; result: ZodArray<ZodUnknown> }, $loose>,
ZodObject<{}, $loose>,
],
>;
},
{
auth: AuthSpec;
body: ZodObject<
{
patch: ZodRecord<ZodString, ZodUnknown>;
replace: ZodOptional<ZodBoolean>;
},
$strip,
>;
description: `Apply a config patch to the running ${string} service.`;
kind: "write";
method: "POST";
name: "configApply";
path: "/config/apply";
response: ZodObject<
{
applied: ZodLiteral<true>;
config: ZodObject<{}, $loose>;
warning: ZodOptional<ZodString>;
},
$strip,
>;
},
]
The status, config and configApply entries, as a readonly
tuple with literal names.
The three standard entries for a component, used in place of its own entries for the same routes:
defineCatalog([...standardEntries(name, options), ...own]).