Initial project structure and core files
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.
This commit is contained in:
9
schemas/admin/ban/[uuid]/actions.js
Normal file
9
schemas/admin/ban/[uuid]/actions.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const z = require("zod")
|
||||
|
||||
module.exports = {
|
||||
GET: {
|
||||
query: z.object({
|
||||
uuid: z.string().uuid()
|
||||
})
|
||||
}
|
||||
}
|
||||
9
schemas/admin/ban/[uuid]/history.js
Normal file
9
schemas/admin/ban/[uuid]/history.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const z = require("zod")
|
||||
|
||||
module.exports = {
|
||||
GET: {
|
||||
query: z.object({
|
||||
uuid: z.string().uuid()
|
||||
})
|
||||
}
|
||||
}
|
||||
26
schemas/admin/ban/[uuid]/index.js
Normal file
26
schemas/admin/ban/[uuid]/index.js
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user