Add base project files including environment example, license, README, .gitignore, error classes, ESLint config, database modules, texture assets, repositories, routes, schemas, services, and server entry point. This establishes the foundational structure for a Yggdrasil-compatible REST API with modular error handling, database setup, and route organization.
26 lines
545 B
JavaScript
26 lines
545 B
JavaScript
const z = require("zod")
|
|
|
|
const uuidSchema = z.object({
|
|
uuid: z.string().uuid()
|
|
})
|
|
|
|
module.exports = {
|
|
GET: {
|
|
query: uuidSchema
|
|
},
|
|
PUT: {
|
|
body: z.object({
|
|
reasonKey: z.string().min(1),
|
|
reasonMessage: z.string().optional(),
|
|
expires: z.number().int().positive().optional()
|
|
}),
|
|
error: {
|
|
code: 400,
|
|
error: "CONSTRAINT_VIOLATION",
|
|
errorMessage: "Invalid ban format"
|
|
}
|
|
},
|
|
DELETE: {
|
|
query: uuidSchema
|
|
}
|
|
} |