@minecraft-docker/mcctl-api 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -0
- package/dist/app.d.ts +7 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +83 -0
- package/dist/app.js.map +1 -0
- package/dist/config/index.d.ts +32 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +124 -0
- package/dist/config/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/rcon.d.ts +35 -0
- package/dist/lib/rcon.d.ts.map +1 -0
- package/dist/lib/rcon.js +90 -0
- package/dist/lib/rcon.js.map +1 -0
- package/dist/plugins/auth.d.ts +32 -0
- package/dist/plugins/auth.d.ts.map +1 -0
- package/dist/plugins/auth.js +194 -0
- package/dist/plugins/auth.js.map +1 -0
- package/dist/plugins/swagger.d.ts +170 -0
- package/dist/plugins/swagger.d.ts.map +1 -0
- package/dist/plugins/swagger.js +211 -0
- package/dist/plugins/swagger.js.map +1 -0
- package/dist/routes/auth.d.ts +12 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/auth.js +144 -0
- package/dist/routes/auth.js.map +1 -0
- package/dist/routes/backup.d.ts +9 -0
- package/dist/routes/backup.d.ts.map +1 -0
- package/dist/routes/backup.js +271 -0
- package/dist/routes/backup.js.map +1 -0
- package/dist/routes/console.d.ts +6 -0
- package/dist/routes/console.d.ts.map +1 -0
- package/dist/routes/console.js +90 -0
- package/dist/routes/console.js.map +1 -0
- package/dist/routes/players.d.ts +9 -0
- package/dist/routes/players.d.ts.map +1 -0
- package/dist/routes/players.js +353 -0
- package/dist/routes/players.js.map +1 -0
- package/dist/routes/router.d.ts +10 -0
- package/dist/routes/router.d.ts.map +1 -0
- package/dist/routes/router.js +55 -0
- package/dist/routes/router.js.map +1 -0
- package/dist/routes/servers/actions.d.ts +6 -0
- package/dist/routes/servers/actions.d.ts.map +1 -0
- package/dist/routes/servers/actions.js +65 -0
- package/dist/routes/servers/actions.js.map +1 -0
- package/dist/routes/servers.d.ts +10 -0
- package/dist/routes/servers.d.ts.map +1 -0
- package/dist/routes/servers.js +403 -0
- package/dist/routes/servers.js.map +1 -0
- package/dist/routes/worlds.d.ts +10 -0
- package/dist/routes/worlds.d.ts.map +1 -0
- package/dist/routes/worlds.js +341 -0
- package/dist/routes/worlds.js.map +1 -0
- package/dist/schemas/backup.d.ts +47 -0
- package/dist/schemas/backup.d.ts.map +1 -0
- package/dist/schemas/backup.js +43 -0
- package/dist/schemas/backup.js.map +1 -0
- package/dist/schemas/player.d.ts +46 -0
- package/dist/schemas/player.d.ts.map +1 -0
- package/dist/schemas/player.js +46 -0
- package/dist/schemas/player.js.map +1 -0
- package/dist/schemas/router.d.ts +42 -0
- package/dist/schemas/router.d.ts.map +1 -0
- package/dist/schemas/router.js +26 -0
- package/dist/schemas/router.js.map +1 -0
- package/dist/schemas/server.d.ts +139 -0
- package/dist/schemas/server.d.ts.map +1 -0
- package/dist/schemas/server.js +124 -0
- package/dist/schemas/server.js.map +1 -0
- package/dist/schemas/world.d.ts +142 -0
- package/dist/schemas/world.d.ts.map +1 -0
- package/dist/schemas/world.js +124 -0
- package/dist/schemas/world.js.map +1 -0
- package/dist/utils/docker-compose.d.ts +23 -0
- package/dist/utils/docker-compose.d.ts.map +1 -0
- package/dist/utils/docker-compose.js +100 -0
- package/dist/utils/docker-compose.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import fp from 'fastify-plugin';
|
|
2
|
+
import { WorldManagementUseCase, ApiPromptAdapter, ShellAdapter, WorldRepository, ServerRepository, Paths, } from '@minecraft-docker/shared';
|
|
3
|
+
import { WorldListResponseSchema, WorldDetailResponseSchema, CreateWorldResponseSchema, AssignWorldResponseSchema, ReleaseWorldResponseSchema, DeleteWorldResponseSchema, WorldErrorResponseSchema, WorldNameParamsSchema, CreateWorldRequestSchema, AssignWorldRequestSchema, DeleteWorldQuerySchema, ReleaseWorldQuerySchema, } from '../schemas/world.js';
|
|
4
|
+
/**
|
|
5
|
+
* Create WorldManagementUseCase instance with API adapters
|
|
6
|
+
*/
|
|
7
|
+
function createWorldUseCase(options) {
|
|
8
|
+
const paths = new Paths();
|
|
9
|
+
const prompt = new ApiPromptAdapter({
|
|
10
|
+
serverName: options?.serverName,
|
|
11
|
+
worldName: options?.worldName,
|
|
12
|
+
worldSeed: options?.worldSeed,
|
|
13
|
+
confirmValue: options?.confirmValue ?? true,
|
|
14
|
+
});
|
|
15
|
+
const shell = new ShellAdapter({ paths });
|
|
16
|
+
const worldRepo = new WorldRepository(paths);
|
|
17
|
+
const serverRepo = new ServerRepository(paths);
|
|
18
|
+
return new WorldManagementUseCase(prompt, shell, worldRepo, serverRepo);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Worlds routes plugin
|
|
22
|
+
* Provides REST API for Minecraft world management
|
|
23
|
+
*/
|
|
24
|
+
const worldsPlugin = async (fastify) => {
|
|
25
|
+
/**
|
|
26
|
+
* GET /api/worlds
|
|
27
|
+
* List all worlds with lock status
|
|
28
|
+
*/
|
|
29
|
+
fastify.get('/api/worlds', {
|
|
30
|
+
schema: {
|
|
31
|
+
tags: ['worlds'],
|
|
32
|
+
summary: 'List all worlds',
|
|
33
|
+
description: 'Returns a list of all available worlds with their lock status',
|
|
34
|
+
response: {
|
|
35
|
+
200: WorldListResponseSchema,
|
|
36
|
+
500: WorldErrorResponseSchema,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
}, async (_request, reply) => {
|
|
40
|
+
try {
|
|
41
|
+
const useCase = createWorldUseCase();
|
|
42
|
+
const worlds = await useCase.listWorlds();
|
|
43
|
+
return reply.send({
|
|
44
|
+
worlds: worlds.map((world) => ({
|
|
45
|
+
name: world.name,
|
|
46
|
+
path: world.path,
|
|
47
|
+
isLocked: world.isLocked,
|
|
48
|
+
lockedBy: world.lockedBy,
|
|
49
|
+
size: world.size,
|
|
50
|
+
lastModified: world.lastModified?.toISOString(),
|
|
51
|
+
})),
|
|
52
|
+
total: worlds.length,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
fastify.log.error(error, 'Failed to list worlds');
|
|
57
|
+
return reply.code(500).send({
|
|
58
|
+
error: 'InternalServerError',
|
|
59
|
+
message: 'Failed to list worlds',
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* GET /api/worlds/:name
|
|
65
|
+
* Get world details
|
|
66
|
+
*/
|
|
67
|
+
fastify.get('/api/worlds/:name', {
|
|
68
|
+
schema: {
|
|
69
|
+
tags: ['worlds'],
|
|
70
|
+
summary: 'Get world details',
|
|
71
|
+
description: 'Returns detailed information about a specific world',
|
|
72
|
+
params: WorldNameParamsSchema,
|
|
73
|
+
response: {
|
|
74
|
+
200: WorldDetailResponseSchema,
|
|
75
|
+
404: WorldErrorResponseSchema,
|
|
76
|
+
500: WorldErrorResponseSchema,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
}, async (request, reply) => {
|
|
80
|
+
const { name } = request.params;
|
|
81
|
+
try {
|
|
82
|
+
const useCase = createWorldUseCase();
|
|
83
|
+
const worlds = await useCase.listWorlds();
|
|
84
|
+
const world = worlds.find((w) => w.name === name);
|
|
85
|
+
if (!world) {
|
|
86
|
+
return reply.code(404).send({
|
|
87
|
+
error: 'NotFound',
|
|
88
|
+
message: `World '${name}' not found`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return reply.send({
|
|
92
|
+
world: {
|
|
93
|
+
name: world.name,
|
|
94
|
+
path: world.path,
|
|
95
|
+
isLocked: world.isLocked,
|
|
96
|
+
lockedBy: world.lockedBy,
|
|
97
|
+
size: world.size,
|
|
98
|
+
lastModified: world.lastModified?.toISOString(),
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
fastify.log.error(error, 'Failed to get world details');
|
|
104
|
+
return reply.code(500).send({
|
|
105
|
+
error: 'InternalServerError',
|
|
106
|
+
message: 'Failed to get world details',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* POST /api/worlds
|
|
112
|
+
* Create a new world
|
|
113
|
+
*/
|
|
114
|
+
fastify.post('/api/worlds', {
|
|
115
|
+
schema: {
|
|
116
|
+
tags: ['worlds'],
|
|
117
|
+
summary: 'Create a new world',
|
|
118
|
+
description: 'Creates a new world with optional seed and server assignment',
|
|
119
|
+
body: CreateWorldRequestSchema,
|
|
120
|
+
response: {
|
|
121
|
+
201: CreateWorldResponseSchema,
|
|
122
|
+
400: WorldErrorResponseSchema,
|
|
123
|
+
500: WorldErrorResponseSchema,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
}, async (request, reply) => {
|
|
127
|
+
const { name, seed, serverName, autoStart } = request.body;
|
|
128
|
+
try {
|
|
129
|
+
const useCase = createWorldUseCase({
|
|
130
|
+
serverName,
|
|
131
|
+
worldName: name,
|
|
132
|
+
worldSeed: seed,
|
|
133
|
+
});
|
|
134
|
+
const result = await useCase.createWorld({
|
|
135
|
+
name,
|
|
136
|
+
seed,
|
|
137
|
+
serverName,
|
|
138
|
+
autoStart: autoStart ?? false,
|
|
139
|
+
});
|
|
140
|
+
if (!result.success) {
|
|
141
|
+
return reply.code(400).send({
|
|
142
|
+
error: 'BadRequest',
|
|
143
|
+
message: result.error || 'Failed to create world',
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return reply.code(201).send({
|
|
147
|
+
success: true,
|
|
148
|
+
worldName: result.worldName,
|
|
149
|
+
seed: result.seed,
|
|
150
|
+
serverName: result.serverName,
|
|
151
|
+
started: result.started,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
fastify.log.error(error, 'Failed to create world');
|
|
156
|
+
return reply.code(500).send({
|
|
157
|
+
error: 'InternalServerError',
|
|
158
|
+
message: 'Failed to create world',
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
/**
|
|
163
|
+
* POST /api/worlds/:name/assign
|
|
164
|
+
* Assign world to a server
|
|
165
|
+
*/
|
|
166
|
+
fastify.post('/api/worlds/:name/assign', {
|
|
167
|
+
schema: {
|
|
168
|
+
tags: ['worlds'],
|
|
169
|
+
summary: 'Assign world to server',
|
|
170
|
+
description: 'Assigns a world to a specific server. The world must not be already locked.',
|
|
171
|
+
params: WorldNameParamsSchema,
|
|
172
|
+
body: AssignWorldRequestSchema,
|
|
173
|
+
response: {
|
|
174
|
+
200: AssignWorldResponseSchema,
|
|
175
|
+
400: WorldErrorResponseSchema,
|
|
176
|
+
404: WorldErrorResponseSchema,
|
|
177
|
+
409: WorldErrorResponseSchema,
|
|
178
|
+
500: WorldErrorResponseSchema,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
}, async (request, reply) => {
|
|
182
|
+
const { name } = request.params;
|
|
183
|
+
const { serverName } = request.body;
|
|
184
|
+
try {
|
|
185
|
+
const useCase = createWorldUseCase({
|
|
186
|
+
serverName,
|
|
187
|
+
worldName: name,
|
|
188
|
+
});
|
|
189
|
+
const result = await useCase.assignWorldByName(name, serverName);
|
|
190
|
+
if (!result.success) {
|
|
191
|
+
// Determine appropriate error code
|
|
192
|
+
if (result.error?.includes('not found')) {
|
|
193
|
+
return reply.code(404).send({
|
|
194
|
+
error: 'NotFound',
|
|
195
|
+
message: result.error,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (result.error?.includes('locked')) {
|
|
199
|
+
return reply.code(409).send({
|
|
200
|
+
error: 'Conflict',
|
|
201
|
+
message: result.error,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return reply.code(400).send({
|
|
205
|
+
error: 'BadRequest',
|
|
206
|
+
message: result.error || 'Failed to assign world',
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return reply.send({
|
|
210
|
+
success: true,
|
|
211
|
+
worldName: result.worldName,
|
|
212
|
+
serverName: result.serverName,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
fastify.log.error(error, 'Failed to assign world');
|
|
217
|
+
return reply.code(500).send({
|
|
218
|
+
error: 'InternalServerError',
|
|
219
|
+
message: 'Failed to assign world',
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
/**
|
|
224
|
+
* POST /api/worlds/:name/release
|
|
225
|
+
* Release world lock
|
|
226
|
+
*/
|
|
227
|
+
fastify.post('/api/worlds/:name/release', {
|
|
228
|
+
schema: {
|
|
229
|
+
tags: ['worlds'],
|
|
230
|
+
summary: 'Release world lock',
|
|
231
|
+
description: 'Releases the lock on a world. The world must be currently locked.',
|
|
232
|
+
params: WorldNameParamsSchema,
|
|
233
|
+
querystring: ReleaseWorldQuerySchema,
|
|
234
|
+
response: {
|
|
235
|
+
200: ReleaseWorldResponseSchema,
|
|
236
|
+
400: WorldErrorResponseSchema,
|
|
237
|
+
404: WorldErrorResponseSchema,
|
|
238
|
+
500: WorldErrorResponseSchema,
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
}, async (request, reply) => {
|
|
242
|
+
const { name } = request.params;
|
|
243
|
+
const { force } = request.query;
|
|
244
|
+
try {
|
|
245
|
+
const useCase = createWorldUseCase({
|
|
246
|
+
worldName: name,
|
|
247
|
+
});
|
|
248
|
+
const result = await useCase.releaseWorldByName(name, force);
|
|
249
|
+
if (!result.success) {
|
|
250
|
+
if (result.error?.includes('not found')) {
|
|
251
|
+
return reply.code(404).send({
|
|
252
|
+
error: 'NotFound',
|
|
253
|
+
message: result.error,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return reply.code(400).send({
|
|
257
|
+
error: 'BadRequest',
|
|
258
|
+
message: result.error || 'Failed to release world',
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
return reply.send({
|
|
262
|
+
success: true,
|
|
263
|
+
worldName: result.worldName,
|
|
264
|
+
previousServer: result.previousServer,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
fastify.log.error(error, 'Failed to release world');
|
|
269
|
+
return reply.code(500).send({
|
|
270
|
+
error: 'InternalServerError',
|
|
271
|
+
message: 'Failed to release world',
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
/**
|
|
276
|
+
* DELETE /api/worlds/:name
|
|
277
|
+
* Delete a world
|
|
278
|
+
*/
|
|
279
|
+
fastify.delete('/api/worlds/:name', {
|
|
280
|
+
schema: {
|
|
281
|
+
tags: ['worlds'],
|
|
282
|
+
summary: 'Delete a world',
|
|
283
|
+
description: 'Deletes a world. Locked worlds cannot be deleted unless force=true.',
|
|
284
|
+
params: WorldNameParamsSchema,
|
|
285
|
+
querystring: DeleteWorldQuerySchema,
|
|
286
|
+
response: {
|
|
287
|
+
200: DeleteWorldResponseSchema,
|
|
288
|
+
400: WorldErrorResponseSchema,
|
|
289
|
+
404: WorldErrorResponseSchema,
|
|
290
|
+
409: WorldErrorResponseSchema,
|
|
291
|
+
500: WorldErrorResponseSchema,
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
}, async (request, reply) => {
|
|
295
|
+
const { name } = request.params;
|
|
296
|
+
const { force } = request.query;
|
|
297
|
+
try {
|
|
298
|
+
const useCase = createWorldUseCase({
|
|
299
|
+
worldName: name,
|
|
300
|
+
confirmValue: true, // Auto-confirm in API mode
|
|
301
|
+
});
|
|
302
|
+
const result = await useCase.deleteWorldByName(name, force);
|
|
303
|
+
if (!result.success) {
|
|
304
|
+
if (result.error?.includes('not found')) {
|
|
305
|
+
return reply.code(404).send({
|
|
306
|
+
error: 'NotFound',
|
|
307
|
+
message: result.error,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
if (result.error?.includes('locked')) {
|
|
311
|
+
return reply.code(409).send({
|
|
312
|
+
error: 'Conflict',
|
|
313
|
+
message: result.error,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
return reply.code(400).send({
|
|
317
|
+
error: 'BadRequest',
|
|
318
|
+
message: result.error || 'Failed to delete world',
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
return reply.send({
|
|
322
|
+
success: true,
|
|
323
|
+
worldName: result.worldName,
|
|
324
|
+
size: result.size,
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
catch (error) {
|
|
328
|
+
fastify.log.error(error, 'Failed to delete world');
|
|
329
|
+
return reply.code(500).send({
|
|
330
|
+
error: 'InternalServerError',
|
|
331
|
+
message: 'Failed to delete world',
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
export default fp(worldsPlugin, {
|
|
337
|
+
name: 'worlds-routes',
|
|
338
|
+
fastify: '5.x',
|
|
339
|
+
});
|
|
340
|
+
export { worldsPlugin };
|
|
341
|
+
//# sourceMappingURL=worlds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worlds.js","sourceRoot":"","sources":["../../src/routes/worlds.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,KAAK,GACN,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,GAMxB,MAAM,qBAAqB,CAAC;AA0B7B;;GAEG;AACH,SAAS,kBAAkB,CAAC,OAK3B;IACC,MAAM,KAA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CAAC,IAAI,CAAC;gBAChB,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;YACnD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBAC1B,KAAK,EAAE,qBAAqB;gBAC5B,OAAO,EAAE,wBAAwB;aAClC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,EAAE,CAAC,YAAY,EAAE;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,KAAK;CACf,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
import { ErrorResponseSchema } from './server.js';
|
|
3
|
+
export declare const BackupStatusResponseSchema: import("@sinclair/typebox").TObject<{
|
|
4
|
+
configured: import("@sinclair/typebox").TBoolean;
|
|
5
|
+
repository: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
|
+
branch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
+
lastBackup: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const BackupPushRequestSchema: import("@sinclair/typebox").TObject<{
|
|
10
|
+
message: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const BackupPushResponseSchema: import("@sinclair/typebox").TObject<{
|
|
13
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
14
|
+
commitHash: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
15
|
+
message: import("@sinclair/typebox").TString;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const BackupCommitSchema: import("@sinclair/typebox").TObject<{
|
|
18
|
+
hash: import("@sinclair/typebox").TString;
|
|
19
|
+
message: import("@sinclair/typebox").TString;
|
|
20
|
+
date: import("@sinclair/typebox").TString;
|
|
21
|
+
author: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const BackupHistoryResponseSchema: import("@sinclair/typebox").TObject<{
|
|
24
|
+
commits: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
25
|
+
hash: import("@sinclair/typebox").TString;
|
|
26
|
+
message: import("@sinclair/typebox").TString;
|
|
27
|
+
date: import("@sinclair/typebox").TString;
|
|
28
|
+
author: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
29
|
+
}>>;
|
|
30
|
+
total: import("@sinclair/typebox").TNumber;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const BackupRestoreRequestSchema: import("@sinclair/typebox").TObject<{
|
|
33
|
+
commitHash: import("@sinclair/typebox").TString;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const BackupRestoreResponseSchema: import("@sinclair/typebox").TObject<{
|
|
36
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
37
|
+
message: import("@sinclair/typebox").TString;
|
|
38
|
+
}>;
|
|
39
|
+
export { ErrorResponseSchema };
|
|
40
|
+
export type BackupStatusResponse = Static<typeof BackupStatusResponseSchema>;
|
|
41
|
+
export type BackupPushRequest = Static<typeof BackupPushRequestSchema>;
|
|
42
|
+
export type BackupPushResponse = Static<typeof BackupPushResponseSchema>;
|
|
43
|
+
export type BackupCommit = Static<typeof BackupCommitSchema>;
|
|
44
|
+
export type BackupHistoryResponse = Static<typeof BackupHistoryResponseSchema>;
|
|
45
|
+
export type BackupRestoreRequest = Static<typeof BackupRestoreRequestSchema>;
|
|
46
|
+
export type BackupRestoreResponse = Static<typeof BackupRestoreResponseSchema>;
|
|
47
|
+
//# sourceMappingURL=backup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/schemas/backup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,0BAA0B;;;;;EAKrC,CAAC;AAGH,eAAO,MAAM,uBAAuB;;EAElC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;EAInC,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;EAK7B,CAAC;AAGH,eAAO,MAAM,2BAA2B;;;;;;;;EAGtC,CAAC;AAGH,eAAO,MAAM,0BAA0B;;EAErC,CAAC;AAGH,eAAO,MAAM,2BAA2B;;;EAGtC,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAG/B,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC7E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC7E,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { ErrorResponseSchema } from './server.js';
|
|
3
|
+
// Backup status response
|
|
4
|
+
export const BackupStatusResponseSchema = Type.Object({
|
|
5
|
+
configured: Type.Boolean(),
|
|
6
|
+
repository: Type.Optional(Type.String()),
|
|
7
|
+
branch: Type.Optional(Type.String()),
|
|
8
|
+
lastBackup: Type.Optional(Type.String()),
|
|
9
|
+
});
|
|
10
|
+
// Backup push request
|
|
11
|
+
export const BackupPushRequestSchema = Type.Object({
|
|
12
|
+
message: Type.Optional(Type.String()),
|
|
13
|
+
});
|
|
14
|
+
// Backup push response
|
|
15
|
+
export const BackupPushResponseSchema = Type.Object({
|
|
16
|
+
success: Type.Boolean(),
|
|
17
|
+
commitHash: Type.Optional(Type.String()),
|
|
18
|
+
message: Type.String(),
|
|
19
|
+
});
|
|
20
|
+
// Backup commit info
|
|
21
|
+
export const BackupCommitSchema = Type.Object({
|
|
22
|
+
hash: Type.String(),
|
|
23
|
+
message: Type.String(),
|
|
24
|
+
date: Type.String(),
|
|
25
|
+
author: Type.Optional(Type.String()),
|
|
26
|
+
});
|
|
27
|
+
// Backup history response
|
|
28
|
+
export const BackupHistoryResponseSchema = Type.Object({
|
|
29
|
+
commits: Type.Array(BackupCommitSchema),
|
|
30
|
+
total: Type.Number(),
|
|
31
|
+
});
|
|
32
|
+
// Backup restore request
|
|
33
|
+
export const BackupRestoreRequestSchema = Type.Object({
|
|
34
|
+
commitHash: Type.String({ minLength: 7 }),
|
|
35
|
+
});
|
|
36
|
+
// Backup restore response
|
|
37
|
+
export const BackupRestoreResponseSchema = Type.Object({
|
|
38
|
+
success: Type.Boolean(),
|
|
39
|
+
message: Type.String(),
|
|
40
|
+
});
|
|
41
|
+
// Re-export
|
|
42
|
+
export { ErrorResponseSchema };
|
|
43
|
+
//# sourceMappingURL=backup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backup.js","sourceRoot":"","sources":["../../src/schemas/backup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,mBAAmB,CAAC;AACjD,OAAO,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C,kBAAkB,CAAC;IACvC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,yBAAyB;AACzB,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IACpD,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;CAC1C,CAAC,CAAC;AAEH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CAAC;IACrD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;IACvB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH,YAAY;AACZ,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
import { ErrorResponseSchema } from './server.js';
|
|
3
|
+
export declare const PlayerInfoSchema: import("@sinclair/typebox").TObject<{
|
|
4
|
+
username: import("@sinclair/typebox").TString;
|
|
5
|
+
uuid: import("@sinclair/typebox").TString;
|
|
6
|
+
offlineUuid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
+
skinUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const OnlinePlayersResponseSchema: import("@sinclair/typebox").TObject<{
|
|
10
|
+
online: import("@sinclair/typebox").TNumber;
|
|
11
|
+
max: import("@sinclair/typebox").TNumber;
|
|
12
|
+
players: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const PlayerListResponseSchema: import("@sinclair/typebox").TObject<{
|
|
15
|
+
players: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
16
|
+
total: import("@sinclair/typebox").TNumber;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const AddPlayerRequestSchema: import("@sinclair/typebox").TObject<{
|
|
19
|
+
player: import("@sinclair/typebox").TString;
|
|
20
|
+
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const KickPlayerRequestSchema: import("@sinclair/typebox").TObject<{
|
|
23
|
+
player: import("@sinclair/typebox").TString;
|
|
24
|
+
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const PlayerActionResponseSchema: import("@sinclair/typebox").TObject<{
|
|
27
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
28
|
+
message: import("@sinclair/typebox").TString;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const PlayerParamsSchema: import("@sinclair/typebox").TObject<{
|
|
31
|
+
name: import("@sinclair/typebox").TString;
|
|
32
|
+
player: import("@sinclair/typebox").TString;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const UsernameParamsSchema: import("@sinclair/typebox").TObject<{
|
|
35
|
+
username: import("@sinclair/typebox").TString;
|
|
36
|
+
}>;
|
|
37
|
+
export { ErrorResponseSchema };
|
|
38
|
+
export type PlayerInfo = Static<typeof PlayerInfoSchema>;
|
|
39
|
+
export type OnlinePlayersResponse = Static<typeof OnlinePlayersResponseSchema>;
|
|
40
|
+
export type PlayerListResponse = Static<typeof PlayerListResponseSchema>;
|
|
41
|
+
export type AddPlayerRequest = Static<typeof AddPlayerRequestSchema>;
|
|
42
|
+
export type KickPlayerRequest = Static<typeof KickPlayerRequestSchema>;
|
|
43
|
+
export type PlayerActionResponse = Static<typeof PlayerActionResponseSchema>;
|
|
44
|
+
export type PlayerParams = Static<typeof PlayerParamsSchema>;
|
|
45
|
+
export type UsernameParams = Static<typeof UsernameParamsSchema>;
|
|
46
|
+
//# sourceMappingURL=player.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.d.ts","sourceRoot":"","sources":["../../src/schemas/player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,gBAAgB;;;;;EAK3B,CAAC;AAGH,eAAO,MAAM,2BAA2B;;;;EAItC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;EAGnC,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;EAGjC,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;EAGlC,CAAC;AAGH,eAAO,MAAM,0BAA0B;;;EAGrC,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;EAG7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;EAE/B,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAG/B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACzD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACzE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC7E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { ErrorResponseSchema } from './server.js';
|
|
3
|
+
// Player info schema
|
|
4
|
+
export const PlayerInfoSchema = Type.Object({
|
|
5
|
+
username: Type.String(),
|
|
6
|
+
uuid: Type.String(),
|
|
7
|
+
offlineUuid: Type.Optional(Type.String()),
|
|
8
|
+
skinUrl: Type.Optional(Type.String()),
|
|
9
|
+
});
|
|
10
|
+
// Online players response
|
|
11
|
+
export const OnlinePlayersResponseSchema = Type.Object({
|
|
12
|
+
online: Type.Number(),
|
|
13
|
+
max: Type.Number(),
|
|
14
|
+
players: Type.Array(Type.String()),
|
|
15
|
+
});
|
|
16
|
+
// Player list (whitelist, bans, ops)
|
|
17
|
+
export const PlayerListResponseSchema = Type.Object({
|
|
18
|
+
players: Type.Array(Type.String()),
|
|
19
|
+
total: Type.Number(),
|
|
20
|
+
});
|
|
21
|
+
// Add player request
|
|
22
|
+
export const AddPlayerRequestSchema = Type.Object({
|
|
23
|
+
player: Type.String({ minLength: 1, maxLength: 16 }),
|
|
24
|
+
reason: Type.Optional(Type.String()),
|
|
25
|
+
});
|
|
26
|
+
// Kick player request
|
|
27
|
+
export const KickPlayerRequestSchema = Type.Object({
|
|
28
|
+
player: Type.String({ minLength: 1, maxLength: 16 }),
|
|
29
|
+
reason: Type.Optional(Type.String()),
|
|
30
|
+
});
|
|
31
|
+
// Success response
|
|
32
|
+
export const PlayerActionResponseSchema = Type.Object({
|
|
33
|
+
success: Type.Boolean(),
|
|
34
|
+
message: Type.String(),
|
|
35
|
+
});
|
|
36
|
+
// Player params
|
|
37
|
+
export const PlayerParamsSchema = Type.Object({
|
|
38
|
+
name: Type.String(),
|
|
39
|
+
player: Type.String(),
|
|
40
|
+
});
|
|
41
|
+
export const UsernameParamsSchema = Type.Object({
|
|
42
|
+
username: Type.String(),
|
|
43
|
+
});
|
|
44
|
+
// Re-export
|
|
45
|
+
export { ErrorResponseSchema };
|
|
46
|
+
//# sourceMappingURL=player.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.js","sourceRoot":"","sources":["../../src/schemas/player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,mBAAmB,C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AC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IACpD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;CACrC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IACpD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;IACvB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAEH,YAAY;AACZ,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
import { ErrorResponseSchema } from './server.js';
|
|
3
|
+
export declare const RouteInfoSchema: import("@sinclair/typebox").TObject<{
|
|
4
|
+
hostname: import("@sinclair/typebox").TString;
|
|
5
|
+
target: import("@sinclair/typebox").TString;
|
|
6
|
+
serverStatus: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"exited">, import("@sinclair/typebox").TLiteral<"paused">, import("@sinclair/typebox").TLiteral<"restarting">, import("@sinclair/typebox").TLiteral<"dead">, import("@sinclair/typebox").TLiteral<"created">, import("@sinclair/typebox").TLiteral<"not_found">, import("@sinclair/typebox").TLiteral<"not_created">]>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const RouterDetailSchema: import("@sinclair/typebox").TObject<{
|
|
9
|
+
name: import("@sinclair/typebox").TString;
|
|
10
|
+
status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"exited">, import("@sinclair/typebox").TLiteral<"paused">, import("@sinclair/typebox").TLiteral<"restarting">, import("@sinclair/typebox").TLiteral<"dead">, import("@sinclair/typebox").TLiteral<"created">, import("@sinclair/typebox").TLiteral<"not_found">, import("@sinclair/typebox").TLiteral<"not_created">]>;
|
|
11
|
+
health: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"healthy">, import("@sinclair/typebox").TLiteral<"unhealthy">, import("@sinclair/typebox").TLiteral<"starting">, import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
12
|
+
port: import("@sinclair/typebox").TNumber;
|
|
13
|
+
uptime: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
14
|
+
uptimeSeconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
15
|
+
mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16
|
+
routes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
17
|
+
hostname: import("@sinclair/typebox").TString;
|
|
18
|
+
target: import("@sinclair/typebox").TString;
|
|
19
|
+
serverStatus: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"exited">, import("@sinclair/typebox").TLiteral<"paused">, import("@sinclair/typebox").TLiteral<"restarting">, import("@sinclair/typebox").TLiteral<"dead">, import("@sinclair/typebox").TLiteral<"created">, import("@sinclair/typebox").TLiteral<"not_found">, import("@sinclair/typebox").TLiteral<"not_created">]>;
|
|
20
|
+
}>>;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const RouterStatusResponseSchema: import("@sinclair/typebox").TObject<{
|
|
23
|
+
router: import("@sinclair/typebox").TObject<{
|
|
24
|
+
name: import("@sinclair/typebox").TString;
|
|
25
|
+
status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"exited">, import("@sinclair/typebox").TLiteral<"paused">, import("@sinclair/typebox").TLiteral<"restarting">, import("@sinclair/typebox").TLiteral<"dead">, import("@sinclair/typebox").TLiteral<"created">, import("@sinclair/typebox").TLiteral<"not_found">, import("@sinclair/typebox").TLiteral<"not_created">]>;
|
|
26
|
+
health: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"healthy">, import("@sinclair/typebox").TLiteral<"unhealthy">, import("@sinclair/typebox").TLiteral<"starting">, import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TLiteral<"unknown">]>;
|
|
27
|
+
port: import("@sinclair/typebox").TNumber;
|
|
28
|
+
uptime: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
29
|
+
uptimeSeconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
30
|
+
mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
31
|
+
routes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
32
|
+
hostname: import("@sinclair/typebox").TString;
|
|
33
|
+
target: import("@sinclair/typebox").TString;
|
|
34
|
+
serverStatus: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"exited">, import("@sinclair/typebox").TLiteral<"paused">, import("@sinclair/typebox").TLiteral<"restarting">, import("@sinclair/typebox").TLiteral<"dead">, import("@sinclair/typebox").TLiteral<"created">, import("@sinclair/typebox").TLiteral<"not_found">, import("@sinclair/typebox").TLiteral<"not_created">]>;
|
|
35
|
+
}>>;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
export { ErrorResponseSchema };
|
|
39
|
+
export type RouteInfo = Static<typeof RouteInfoSchema>;
|
|
40
|
+
export type RouterDetail = Static<typeof RouterDetailSchema>;
|
|
41
|
+
export type RouterStatusResponse = Static<typeof RouterStatusResponseSchema>;
|
|
42
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/schemas/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAA6C,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAG7F,eAAO,MAAM,eAAe;;;;EAI1B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;EAS7B,CAAC;AAGH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAErC,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAG/B,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC7D,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { ContainerStatusSchema, HealthStatusSchema, ErrorResponseSchema } from './server.js';
|
|
3
|
+
// Route info schema
|
|
4
|
+
export const RouteInfoSchema = Type.Object({
|
|
5
|
+
hostname: Type.String(),
|
|
6
|
+
target: Type.String(),
|
|
7
|
+
serverStatus: ContainerStatusSchema,
|
|
8
|
+
});
|
|
9
|
+
// Router detail schema
|
|
10
|
+
export const RouterDetailSchema = Type.Object({
|
|
11
|
+
name: Type.String(),
|
|
12
|
+
status: ContainerStatusSchema,
|
|
13
|
+
health: HealthStatusSchema,
|
|
14
|
+
port: Type.Number(),
|
|
15
|
+
uptime: Type.Optional(Type.String()),
|
|
16
|
+
uptimeSeconds: Type.Optional(Type.Number()),
|
|
17
|
+
mode: Type.Optional(Type.String()),
|
|
18
|
+
routes: Type.Array(RouteInfoSchema),
|
|
19
|
+
});
|
|
20
|
+
// Response schema
|
|
21
|
+
export const RouterStatusResponseSchema = Type.Object({
|
|
22
|
+
router: RouterDetailSchema,
|
|
23
|
+
});
|
|
24
|
+
// Re-export error schema
|
|
25
|
+
export { ErrorResponseSchema };
|
|
26
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/schemas/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE7F,oBAAoB;AACpB,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;IACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,qBAAqB;CACpC,CAAC,CAAC;AAEH,uBAAuB;AACvB,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,qBAAqB;IAC7B,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACpC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC3C,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAClC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;CACpC,CAAC,CAAC;AAEH,kBAAkB;AAClB,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IACpD,MAAM,EAAE,kBAAkB;CAC3B,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|