Init Commit
quality / commitlint (push) Skipped
CD / update-wiki (push) Failing after 7s
quality / changes (push) Successful in 4s
quality / docker-check (push) Skipped
quality / web (push) Failing after 38s
quality / api (push) Successful in 49s
CD / quality (push) Failing after 1m36s
CD / publish (push) Skipped
quality / commitlint (push) Skipped
CD / update-wiki (push) Failing after 7s
quality / changes (push) Successful in 4s
quality / docker-check (push) Skipped
quality / web (push) Failing after 38s
quality / api (push) Successful in 49s
CD / quality (push) Failing after 1m36s
CD / publish (push) Skipped
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const appSwitcherIconSchema = z.enum([
|
||||
"server",
|
||||
"cloud",
|
||||
"globe",
|
||||
"dashboard",
|
||||
"chart",
|
||||
]);
|
||||
|
||||
export const appSwitcherEntrySchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
subtitle: z.string().optional(),
|
||||
url: z.string().url(),
|
||||
icon: appSwitcherIconSchema.default("server"),
|
||||
enabled: z.boolean().optional(),
|
||||
sort: z.number().optional(),
|
||||
shortcut: z.string().optional(),
|
||||
});
|
||||
|
||||
export const appSwitcherConfigSchema = z.object({
|
||||
menuLabel: z.string().default("Приложения"),
|
||||
apps: z.array(appSwitcherEntrySchema).min(1),
|
||||
});
|
||||
|
||||
export type AppSwitcherEntry = z.infer<typeof appSwitcherEntrySchema>;
|
||||
export type AppSwitcherConfig = z.infer<typeof appSwitcherConfigSchema>;
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from "./app-switcher.js";
|
||||
export * from "./settings.js";
|
||||
@@ -0,0 +1,37 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const loginSchema = z.object({
|
||||
username: z.string().min(1),
|
||||
password: z.string().min(1),
|
||||
});
|
||||
|
||||
export type LoginInput = z.infer<typeof loginSchema>;
|
||||
export type LoginRequest = LoginInput;
|
||||
|
||||
export type JwtClaims = {
|
||||
sub: string;
|
||||
exp: number;
|
||||
email?: string;
|
||||
name?: string;
|
||||
apps?: string[];
|
||||
permissions?: string[];
|
||||
is_admin?: boolean;
|
||||
};
|
||||
|
||||
export type LoginResponse = {
|
||||
token: string;
|
||||
expires_at: string;
|
||||
};
|
||||
|
||||
export const appSettingsPatchSchema = z.object({
|
||||
showQuickActions: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export type AppSettingsPatch = z.infer<typeof appSettingsPatchSchema>;
|
||||
|
||||
export const appSettingsSchema = z.object({
|
||||
id: z.string(),
|
||||
showQuickActions: z.boolean(),
|
||||
});
|
||||
|
||||
export type AppSettings = z.infer<typeof appSettingsSchema>;
|
||||
Reference in New Issue
Block a user