chore(18-03): apply 18-01 schema foundation as dependency baseline
This commit is contained in:
@@ -73,10 +73,12 @@ export const reorderCandidatesSchema = z.object({
|
||||
// Setup schemas
|
||||
export const createSetupSchema = z.object({
|
||||
name: z.string().min(1, "Setup name is required"),
|
||||
isPublic: z.boolean().optional().default(false),
|
||||
});
|
||||
|
||||
export const updateSetupSchema = z.object({
|
||||
name: z.string().min(1, "Setup name is required"),
|
||||
isPublic: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const syncSetupItemsSchema = z.object({
|
||||
@@ -89,3 +91,19 @@ export const classificationSchema = z.enum(["base", "worn", "consumable"]);
|
||||
export const updateClassificationSchema = z.object({
|
||||
classification: classificationSchema,
|
||||
});
|
||||
|
||||
// Global item schemas
|
||||
export const searchGlobalItemsSchema = z.object({
|
||||
q: z.string().optional(),
|
||||
});
|
||||
|
||||
export const linkItemSchema = z.object({
|
||||
globalItemId: z.number().int().positive(),
|
||||
});
|
||||
|
||||
// Profile schemas
|
||||
export const updateProfileSchema = z.object({
|
||||
displayName: z.string().max(100).optional(),
|
||||
avatarUrl: z.string().optional(),
|
||||
bio: z.string().max(500).optional(),
|
||||
});
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { z } from "zod";
|
||||
import type {
|
||||
categories,
|
||||
globalItems,
|
||||
itemGlobalLinks,
|
||||
items,
|
||||
setupItems,
|
||||
setups,
|
||||
@@ -13,13 +15,16 @@ import type {
|
||||
createItemSchema,
|
||||
createSetupSchema,
|
||||
createThreadSchema,
|
||||
linkItemSchema,
|
||||
reorderCandidatesSchema,
|
||||
resolveThreadSchema,
|
||||
searchGlobalItemsSchema,
|
||||
syncSetupItemsSchema,
|
||||
updateCandidateSchema,
|
||||
updateCategorySchema,
|
||||
updateClassificationSchema,
|
||||
updateItemSchema,
|
||||
updateProfileSchema,
|
||||
updateSetupSchema,
|
||||
updateThreadSchema,
|
||||
} from "./schemas.ts";
|
||||
@@ -42,6 +47,11 @@ export type UpdateSetup = z.infer<typeof updateSetupSchema>;
|
||||
export type SyncSetupItems = z.infer<typeof syncSetupItemsSchema>;
|
||||
export type UpdateClassification = z.infer<typeof updateClassificationSchema>;
|
||||
|
||||
// Global item types
|
||||
export type SearchGlobalItems = z.infer<typeof searchGlobalItemsSchema>;
|
||||
export type LinkItem = z.infer<typeof linkItemSchema>;
|
||||
export type UpdateProfile = z.infer<typeof updateProfileSchema>;
|
||||
|
||||
// Types inferred from Drizzle schema
|
||||
export type Item = typeof items.$inferSelect;
|
||||
export type Category = typeof categories.$inferSelect;
|
||||
@@ -49,3 +59,5 @@ export type Thread = typeof threads.$inferSelect;
|
||||
export type ThreadCandidate = typeof threadCandidates.$inferSelect;
|
||||
export type Setup = typeof setups.$inferSelect;
|
||||
export type SetupItem = typeof setupItems.$inferSelect;
|
||||
export type GlobalItem = typeof globalItems.$inferSelect;
|
||||
export type ItemGlobalLink = typeof itemGlobalLinks.$inferSelect;
|
||||
|
||||
Reference in New Issue
Block a user