🚧 wip: healthStatus

This commit is contained in:
Fred KISSIE
2026-02-04 04:10:08 +01:00
parent 1fc40b3017
commit 67949b4968

View File

@@ -61,6 +61,10 @@ const listResourcesSchema = z.object({
authState: z
.enum(["protected", "not_protected", "none"])
.optional()
.catch(undefined),
healthStatus: z
.enum(["online", "degraded", "offline", "unknown"])
.optional()
.catch(undefined)
});
@@ -206,7 +210,8 @@ export async function listResources(
)
);
}
const { page, pageSize, authState, enabled, query } = parsedQuery.data;
const { page, pageSize, authState, enabled, query, healthStatus } =
parsedQuery.data;
const parsedParams = listResourcesParamsSchema.safeParse(req.params);
if (!parsedParams.success) {
@@ -318,6 +323,15 @@ export async function listResources(
}
}
if (typeof healthStatus !== "undefined") {
switch (healthStatus) {
case "online":
break;
default:
break;
}
}
const countQuery: any = db
.select({ count: count() })
.from(resources)