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

This commit is contained in:
Denozordec
2026-09-04 11:48:19 +07:00
commit cb8a79260e
300 changed files with 42404 additions and 0 deletions
+77
View File
@@ -0,0 +1,77 @@
import { z } from 'zod';
declare const appSwitcherIconSchema: z.ZodEnum<{
server: "server";
cloud: "cloud";
globe: "globe";
dashboard: "dashboard";
chart: "chart";
}>;
declare const appSwitcherEntrySchema: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
subtitle: z.ZodOptional<z.ZodString>;
url: z.ZodString;
icon: z.ZodDefault<z.ZodEnum<{
server: "server";
cloud: "cloud";
globe: "globe";
dashboard: "dashboard";
chart: "chart";
}>>;
enabled: z.ZodOptional<z.ZodBoolean>;
sort: z.ZodOptional<z.ZodNumber>;
shortcut: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
declare const appSwitcherConfigSchema: z.ZodObject<{
menuLabel: z.ZodDefault<z.ZodString>;
apps: z.ZodArray<z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
subtitle: z.ZodOptional<z.ZodString>;
url: z.ZodString;
icon: z.ZodDefault<z.ZodEnum<{
server: "server";
cloud: "cloud";
globe: "globe";
dashboard: "dashboard";
chart: "chart";
}>>;
enabled: z.ZodOptional<z.ZodBoolean>;
sort: z.ZodOptional<z.ZodNumber>;
shortcut: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
type AppSwitcherEntry = z.infer<typeof appSwitcherEntrySchema>;
type AppSwitcherConfig = z.infer<typeof appSwitcherConfigSchema>;
declare const loginSchema: z.ZodObject<{
username: z.ZodString;
password: z.ZodString;
}, z.core.$strip>;
type LoginInput = z.infer<typeof loginSchema>;
type LoginRequest = LoginInput;
type JwtClaims = {
sub: string;
exp: number;
email?: string;
name?: string;
apps?: string[];
permissions?: string[];
is_admin?: boolean;
};
type LoginResponse = {
token: string;
expires_at: string;
};
declare const appSettingsPatchSchema: z.ZodObject<{
showQuickActions: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
type AppSettingsPatch = z.infer<typeof appSettingsPatchSchema>;
declare const appSettingsSchema: z.ZodObject<{
id: z.ZodString;
showQuickActions: z.ZodBoolean;
}, z.core.$strip>;
type AppSettings = z.infer<typeof appSettingsSchema>;
export { type AppSettings, type AppSettingsPatch, type AppSwitcherConfig, type AppSwitcherEntry, type JwtClaims, type LoginInput, type LoginRequest, type LoginResponse, appSettingsPatchSchema, appSettingsSchema, appSwitcherConfigSchema, appSwitcherEntrySchema, appSwitcherIconSchema, loginSchema };
+45
View File
@@ -0,0 +1,45 @@
// src/app-switcher.ts
import { z } from "zod";
var appSwitcherIconSchema = z.enum([
"server",
"cloud",
"globe",
"dashboard",
"chart"
]);
var 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()
});
var appSwitcherConfigSchema = z.object({
menuLabel: z.string().default("\u041F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F"),
apps: z.array(appSwitcherEntrySchema).min(1)
});
// src/settings.ts
import { z as z2 } from "zod";
var loginSchema = z2.object({
username: z2.string().min(1),
password: z2.string().min(1)
});
var appSettingsPatchSchema = z2.object({
showQuickActions: z2.boolean().optional()
});
var appSettingsSchema = z2.object({
id: z2.string(),
showQuickActions: z2.boolean()
});
export {
appSettingsPatchSchema,
appSettingsSchema,
appSwitcherConfigSchema,
appSwitcherEntrySchema,
appSwitcherIconSchema,
loginSchema
};
+30
View File
@@ -0,0 +1,30 @@
{
"name": "@cdnmanager/shared",
"version": "0.0.0",
"private": true,
"type": "module",
"files": [
"dist",
"package.json"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"development": "./src/index.ts",
"import": "./dist/index.js"
}
},
"scripts": {
"build": "tsup src/index.ts --format esm --dts",
"dev": "tsup src/index.ts --format esm --dts --watch",
"test": "vitest run --passWithNoTests"
},
"dependencies": {
"zod": "^4.4.3"
},
"devDependencies": {
"tsup": "^8.5.0",
"typescript": "^5.8.3",
"vitest": "^3.2.4"
}
}
+28
View File
@@ -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>;
+2
View File
@@ -0,0 +1,2 @@
export * from "./app-switcher.js";
export * from "./settings.js";
+37
View File
@@ -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>;
+13
View File
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"skipLibCheck": true,
"declaration": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
}