Files
zerobyte/app/server/modules/system/system.dto.ts
Nico b23317354c refactor: allow to run without the SYS_ADMIN cap for simple setups (#138)
* refactor: allow to run without the SYS_ADMIN cap for simple setups

* fix: pr feedback
2025-12-14 20:30:33 +01:00

50 lines
1.1 KiB
TypeScript

import { type } from "arktype";
import { describeRoute, resolver } from "hono-openapi";
export const capabilitiesSchema = type({
rclone: "boolean",
sysAdmin: "boolean",
});
export const systemInfoResponse = type({
capabilities: capabilitiesSchema,
});
export type SystemInfoDto = typeof systemInfoResponse.infer;
export const systemInfoDto = describeRoute({
description: "Get system information including available capabilities",
tags: ["System"],
operationId: "getSystemInfo",
responses: {
200: {
description: "System information with enabled capabilities",
content: {
"application/json": {
schema: resolver(systemInfoResponse),
},
},
},
},
});
export const downloadResticPasswordBodySchema = type({
password: "string",
});
export const downloadResticPasswordDto = describeRoute({
description: "Download the Restic password file for backup recovery. Requires password re-authentication.",
tags: ["System"],
operationId: "downloadResticPassword",
responses: {
200: {
description: "Restic password file content",
content: {
"text/plain": {
schema: { type: "string" },
},
},
},
},
});