merge: integrate WP6-05 baseline for TASK-WP6-04
# Conflicts: # apps/api/src/app.ts # apps/api/src/main.ts # apps/web/src/generated/api/sdk.gen.ts # apps/web/src/generated/api/types.gen.ts # apps/web/src/main.tsx # openapi/openapi.json # package.json
This commit is contained in:
@@ -158,3 +158,72 @@ export const AdminOverviewResponseSchema = Type.Object(
|
||||
);
|
||||
|
||||
export type AdminOverviewResponse = Static<typeof AdminOverviewResponseSchema>;
|
||||
|
||||
const adminServiceStatusSchema = Type.Union([
|
||||
Type.Literal("active"),
|
||||
Type.Literal("paused_quota"),
|
||||
Type.Literal("paused_provider"),
|
||||
Type.Literal("disabled"),
|
||||
Type.Literal("degraded"),
|
||||
Type.Literal("unavailable"),
|
||||
]);
|
||||
|
||||
const adminServiceIdSchema = Type.Union([
|
||||
Type.Literal("resend"),
|
||||
Type.Literal("amap"),
|
||||
Type.Literal("ai_gateway"),
|
||||
Type.Literal("worker"),
|
||||
Type.Literal("api"),
|
||||
Type.Literal("asset_root"),
|
||||
]);
|
||||
|
||||
export const AdminServicesStorageResponseSchema = Type.Object({
|
||||
generated_at: Type.String({ pattern: isoTimestampPattern }),
|
||||
services: Type.Array(Type.Object({
|
||||
checked_at: Type.Union([Type.String({ pattern: isoTimestampPattern }), Type.Null()]),
|
||||
configured: Type.Boolean(),
|
||||
impact_scope: Type.Union([
|
||||
Type.Literal("none"),
|
||||
Type.Literal("authentication"),
|
||||
Type.Literal("location"),
|
||||
Type.Literal("generation"),
|
||||
Type.Literal("storage"),
|
||||
Type.Literal("api"),
|
||||
Type.Literal("model"),
|
||||
Type.Literal("account"),
|
||||
Type.Literal("unknown"),
|
||||
]),
|
||||
pause_reason: Type.Union([Type.String({ maxLength: 80, pattern: "^[a-z][a-z0-9_]*$" }), Type.Null()]),
|
||||
service_id: adminServiceIdSchema,
|
||||
status: adminServiceStatusSchema,
|
||||
}, { additionalProperties: false }), { minItems: 6, maxItems: 6 }),
|
||||
storage: Type.Object({
|
||||
capacity_notice_level: Type.Union([Type.Literal("normal"), Type.Literal("warning"), Type.Literal("critical")]),
|
||||
cleanup_pending_count: Type.Integer({ minimum: 0 }),
|
||||
data_root_ref: Type.Literal("configured_local_data_root"),
|
||||
hard_limit_bytes: Type.Integer({ minimum: 1 }),
|
||||
last_measured_at: Type.Union([Type.String({ pattern: isoTimestampPattern }), Type.Null()]),
|
||||
managed_content_bytes: Type.Integer({ minimum: 0 }),
|
||||
remeasurement_required: Type.Boolean(),
|
||||
status: Type.Union([Type.Literal("active"), Type.Literal("full"), Type.Literal("unavailable")]),
|
||||
storage_backend: Type.Literal("local_filesystem"),
|
||||
}, { additionalProperties: false }),
|
||||
}, { additionalProperties: false, $id: "AdminServicesStorageResponse" });
|
||||
|
||||
export const AdminDiagnosticsResponseSchema = Type.Object({
|
||||
generated_at: Type.String({ pattern: isoTimestampPattern }),
|
||||
diagnostic_text: Type.String({ minLength: 1, maxLength: 12_000 }),
|
||||
services: Type.Ref(AdminServicesStorageResponseSchema),
|
||||
system: Type.Object({
|
||||
api_status: Type.Union([Type.Literal("ready"), Type.Literal("degraded"), Type.Literal("unavailable")]),
|
||||
app_version: Type.String({ maxLength: 80, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]*$" }),
|
||||
browser_support: Type.Array(Type.Object({
|
||||
brand: Type.Union([Type.Literal("Google Chrome"), Type.Literal("Microsoft Edge")]),
|
||||
major: Type.Integer({ minimum: 1 }),
|
||||
}, { additionalProperties: false }), { maxItems: 2 }),
|
||||
worker_status: Type.Union([Type.Literal("ready"), Type.Literal("degraded"), Type.Literal("unavailable")]),
|
||||
}, { additionalProperties: false }),
|
||||
}, { additionalProperties: false, $id: "AdminDiagnosticsResponse" });
|
||||
|
||||
export type AdminServicesStorageResponse = Static<typeof AdminServicesStorageResponseSchema>;
|
||||
export type AdminDiagnosticsResponse = Static<typeof AdminDiagnosticsResponseSchema>;
|
||||
|
||||
Reference in New Issue
Block a user