mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 18:36:39 +00:00
4dd6c9bac3
## Description: This PR implements the permission check logic. Other related parts will be handled in a separate UI update. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import { z } from "zod/v4";
|
|
import cosmetics_json from "../../resources/cosmetics/cosmetics.json" with { type: "json" };
|
|
import { RequiredPatternSchema } from "./Schemas";
|
|
|
|
// Schema for resources/cosmetics/cosmetics.json
|
|
export const CosmeticsSchema = z.object({
|
|
role_groups: z.record(z.string(), z.string().array().min(1)),
|
|
patterns: z.record(
|
|
RequiredPatternSchema,
|
|
z.object({
|
|
name: z.string(),
|
|
role_group: z.string().optional(),
|
|
}),
|
|
),
|
|
flag: z.object({
|
|
layers: z.record(
|
|
z.string(),
|
|
z.object({
|
|
name: z.string(),
|
|
role_group: z.string().optional(),
|
|
flares: z.array(z.string()).optional(),
|
|
}),
|
|
),
|
|
color: z.record(
|
|
z.string(),
|
|
z.object({
|
|
color: z.string(),
|
|
name: z.string(),
|
|
role_group: z.string().optional(),
|
|
flares: z.array(z.string()).optional(),
|
|
}),
|
|
),
|
|
}),
|
|
});
|
|
export type Cosmetics = z.infer<typeof CosmeticsSchema>;
|
|
export const COSMETICS: Cosmetics = CosmeticsSchema.parse(cosmetics_json);
|