feat: add admin user initialization endpoint with request handling

This commit is contained in:
GW_MC
2025-12-18 22:10:50 +08:00
parent 8f2193bed2
commit 08b1a055a4
5 changed files with 218 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
export namespace Schemas {
// <Schemas>
export type AdminInitRequest = { password: string; setup_secret: string; username: string };
export type HealthInfo = {
errors?: (Array<string> | null) | undefined;
status: string;
@@ -14,6 +15,15 @@ export namespace Schemas {
export namespace Endpoints {
// <Endpoints>
export type post_Init_admin = {
method: "POST";
path: "/api/auth/init_admin";
requestFormat: "json";
parameters: {
body: Schemas.AdminInitRequest;
};
responses: { 200: unknown; 400: unknown; 401: unknown; 500: unknown };
};
export type post_Login = {
method: "POST";
path: "/api/auth/login";
@@ -37,6 +47,7 @@ export namespace Endpoints {
// <EndpointByMethod>
export type EndpointByMethod = {
post: {
"/api/auth/init_admin": Endpoints.post_Init_admin;
"/api/auth/login": Endpoints.post_Login;
};
get: {