@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,139 @@
|
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
export declare const ContainerStatusSchema: 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">]>;
|
|
3
|
+
export declare const HealthStatusSchema: 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">]>;
|
|
4
|
+
export declare const PlayerListSchema: import("@sinclair/typebox").TObject<{
|
|
5
|
+
online: import("@sinclair/typebox").TNumber;
|
|
6
|
+
max: import("@sinclair/typebox").TNumber;
|
|
7
|
+
players: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const ContainerStatsSchema: import("@sinclair/typebox").TObject<{
|
|
10
|
+
memoryUsage: import("@sinclair/typebox").TNumber;
|
|
11
|
+
memoryLimit: import("@sinclair/typebox").TNumber;
|
|
12
|
+
memoryPercent: import("@sinclair/typebox").TNumber;
|
|
13
|
+
cpuPercent: import("@sinclair/typebox").TNumber;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const ServerSummarySchema: import("@sinclair/typebox").TObject<{
|
|
16
|
+
name: import("@sinclair/typebox").TString;
|
|
17
|
+
container: import("@sinclair/typebox").TString;
|
|
18
|
+
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">]>;
|
|
19
|
+
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">]>;
|
|
20
|
+
hostname: import("@sinclair/typebox").TString;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const ServerDetailSchema: import("@sinclair/typebox").TObject<{
|
|
23
|
+
name: import("@sinclair/typebox").TString;
|
|
24
|
+
container: 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
|
+
hostname: import("@sinclair/typebox").TString;
|
|
28
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
29
|
+
version: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
30
|
+
memory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
31
|
+
uptime: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
32
|
+
uptimeSeconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
33
|
+
players: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
34
|
+
online: import("@sinclair/typebox").TNumber;
|
|
35
|
+
max: import("@sinclair/typebox").TNumber;
|
|
36
|
+
players: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
37
|
+
}>>;
|
|
38
|
+
stats: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
39
|
+
memoryUsage: import("@sinclair/typebox").TNumber;
|
|
40
|
+
memoryLimit: import("@sinclair/typebox").TNumber;
|
|
41
|
+
memoryPercent: import("@sinclair/typebox").TNumber;
|
|
42
|
+
cpuPercent: import("@sinclair/typebox").TNumber;
|
|
43
|
+
}>>;
|
|
44
|
+
worldName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
45
|
+
worldSize: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const ExecCommandRequestSchema: import("@sinclair/typebox").TObject<{
|
|
48
|
+
command: import("@sinclair/typebox").TString;
|
|
49
|
+
}>;
|
|
50
|
+
export declare const ServerListResponseSchema: import("@sinclair/typebox").TObject<{
|
|
51
|
+
servers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
52
|
+
name: import("@sinclair/typebox").TString;
|
|
53
|
+
container: import("@sinclair/typebox").TString;
|
|
54
|
+
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">]>;
|
|
55
|
+
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">]>;
|
|
56
|
+
hostname: import("@sinclair/typebox").TString;
|
|
57
|
+
}>>;
|
|
58
|
+
total: import("@sinclair/typebox").TNumber;
|
|
59
|
+
}>;
|
|
60
|
+
export declare const ServerDetailResponseSchema: import("@sinclair/typebox").TObject<{
|
|
61
|
+
server: import("@sinclair/typebox").TObject<{
|
|
62
|
+
name: import("@sinclair/typebox").TString;
|
|
63
|
+
container: import("@sinclair/typebox").TString;
|
|
64
|
+
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">]>;
|
|
65
|
+
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">]>;
|
|
66
|
+
hostname: import("@sinclair/typebox").TString;
|
|
67
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
68
|
+
version: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
69
|
+
memory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
70
|
+
uptime: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
71
|
+
uptimeSeconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
72
|
+
players: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
73
|
+
online: import("@sinclair/typebox").TNumber;
|
|
74
|
+
max: import("@sinclair/typebox").TNumber;
|
|
75
|
+
players: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
76
|
+
}>>;
|
|
77
|
+
stats: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
78
|
+
memoryUsage: import("@sinclair/typebox").TNumber;
|
|
79
|
+
memoryLimit: import("@sinclair/typebox").TNumber;
|
|
80
|
+
memoryPercent: import("@sinclair/typebox").TNumber;
|
|
81
|
+
cpuPercent: import("@sinclair/typebox").TNumber;
|
|
82
|
+
}>>;
|
|
83
|
+
worldName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
84
|
+
worldSize: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
85
|
+
}>;
|
|
86
|
+
}>;
|
|
87
|
+
export declare const ExecCommandResponseSchema: import("@sinclair/typebox").TObject<{
|
|
88
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
89
|
+
output: import("@sinclair/typebox").TString;
|
|
90
|
+
}>;
|
|
91
|
+
export declare const LogsResponseSchema: import("@sinclair/typebox").TObject<{
|
|
92
|
+
logs: import("@sinclair/typebox").TString;
|
|
93
|
+
lines: import("@sinclair/typebox").TNumber;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const LogsQuerySchema: import("@sinclair/typebox").TObject<{
|
|
96
|
+
lines: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
97
|
+
follow: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
98
|
+
}>;
|
|
99
|
+
export declare const ErrorResponseSchema: import("@sinclair/typebox").TObject<{
|
|
100
|
+
error: import("@sinclair/typebox").TString;
|
|
101
|
+
message: import("@sinclair/typebox").TString;
|
|
102
|
+
}>;
|
|
103
|
+
export declare const ServerNameParamsSchema: import("@sinclair/typebox").TObject<{
|
|
104
|
+
name: import("@sinclair/typebox").TString;
|
|
105
|
+
}>;
|
|
106
|
+
export declare const CreateServerRequestSchema: import("@sinclair/typebox").TObject<{
|
|
107
|
+
name: import("@sinclair/typebox").TString;
|
|
108
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"PAPER">, import("@sinclair/typebox").TLiteral<"VANILLA">, import("@sinclair/typebox").TLiteral<"FORGE">, import("@sinclair/typebox").TLiteral<"FABRIC">, import("@sinclair/typebox").TLiteral<"SPIGOT">, import("@sinclair/typebox").TLiteral<"NEOFORGE">]>>;
|
|
109
|
+
version: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
110
|
+
memory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
111
|
+
seed: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
112
|
+
worldUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
113
|
+
worldName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
114
|
+
autoStart: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
115
|
+
}>;
|
|
116
|
+
export declare const CreateServerResponseSchema: import("@sinclair/typebox").TObject<{
|
|
117
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
118
|
+
server: import("@sinclair/typebox").TObject<{
|
|
119
|
+
name: import("@sinclair/typebox").TString;
|
|
120
|
+
container: import("@sinclair/typebox").TString;
|
|
121
|
+
status: import("@sinclair/typebox").TString;
|
|
122
|
+
}>;
|
|
123
|
+
}>;
|
|
124
|
+
export declare const DeleteServerResponseSchema: import("@sinclair/typebox").TObject<{
|
|
125
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
126
|
+
server: import("@sinclair/typebox").TString;
|
|
127
|
+
message: import("@sinclair/typebox").TString;
|
|
128
|
+
}>;
|
|
129
|
+
export declare const DeleteServerQuerySchema: import("@sinclair/typebox").TObject<{
|
|
130
|
+
force: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
131
|
+
}>;
|
|
132
|
+
export type ServerSummary = Static<typeof ServerSummarySchema>;
|
|
133
|
+
export type ServerDetail = Static<typeof ServerDetailSchema>;
|
|
134
|
+
export type ServerNameParams = Static<typeof ServerNameParamsSchema>;
|
|
135
|
+
export type ExecCommandRequest = Static<typeof ExecCommandRequestSchema>;
|
|
136
|
+
export type LogsQuery = Static<typeof LogsQuerySchema>;
|
|
137
|
+
export type CreateServerRequest = Static<typeof CreateServerRequestSchema>;
|
|
138
|
+
export type DeleteServerQuery = Static<typeof DeleteServerQuerySchema>;
|
|
139
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/schemas/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGjD,eAAO,MAAM,qBAAqB,kbAShC,CAAC;AAEH,eAAO,MAAM,kBAAkB,2RAM7B,CAAC;AAGH,eAAO,MAAM,gBAAgB;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;EAK/B,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;;EAM9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;EAe7B,CAAC;AAGH,eAAO,MAAM,wBAAwB;;EAEnC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;EAErC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;EAGpC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;EAG7B,CAAC;AAEH,eAAO,MAAM,eAAe;;;EAG1B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;EAEjC,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;;;;;;;EAgBpC,CAAC;AAGH,eAAO,MAAM,0BAA0B;;;;;;;EAOrC,CAAC;AAGH,eAAO,MAAM,0BAA0B;;;;EAIrC,CAAC;AAGH,eAAO,MAAM,uBAAuB;;EAElC,CAAC;AAGH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC7D,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACzE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AACvD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
// Container and Health Status
|
|
3
|
+
export const ContainerStatusSchema = Type.Union([
|
|
4
|
+
Type.Literal('running'),
|
|
5
|
+
Type.Literal('exited'),
|
|
6
|
+
Type.Literal('paused'),
|
|
7
|
+
Type.Literal('restarting'),
|
|
8
|
+
Type.Literal('dead'),
|
|
9
|
+
Type.Literal('created'),
|
|
10
|
+
Type.Literal('not_found'),
|
|
11
|
+
Type.Literal('not_created'),
|
|
12
|
+
]);
|
|
13
|
+
export const HealthStatusSchema = Type.Union([
|
|
14
|
+
Type.Literal('healthy'),
|
|
15
|
+
Type.Literal('unhealthy'),
|
|
16
|
+
Type.Literal('starting'),
|
|
17
|
+
Type.Literal('none'),
|
|
18
|
+
Type.Literal('unknown'),
|
|
19
|
+
]);
|
|
20
|
+
// Player and Stats
|
|
21
|
+
export const PlayerListSchema = Type.Object({
|
|
22
|
+
online: Type.Number(),
|
|
23
|
+
max: Type.Number(),
|
|
24
|
+
players: Type.Array(Type.String()),
|
|
25
|
+
});
|
|
26
|
+
export const ContainerStatsSchema = Type.Object({
|
|
27
|
+
memoryUsage: Type.Number(),
|
|
28
|
+
memoryLimit: Type.Number(),
|
|
29
|
+
memoryPercent: Type.Number(),
|
|
30
|
+
cpuPercent: Type.Number(),
|
|
31
|
+
});
|
|
32
|
+
// Server Schemas
|
|
33
|
+
export const ServerSummarySchema = Type.Object({
|
|
34
|
+
name: Type.String(),
|
|
35
|
+
container: Type.String(),
|
|
36
|
+
status: ContainerStatusSchema,
|
|
37
|
+
health: HealthStatusSchema,
|
|
38
|
+
hostname: Type.String(),
|
|
39
|
+
});
|
|
40
|
+
export const ServerDetailSchema = Type.Object({
|
|
41
|
+
name: Type.String(),
|
|
42
|
+
container: Type.String(),
|
|
43
|
+
status: ContainerStatusSchema,
|
|
44
|
+
health: HealthStatusSchema,
|
|
45
|
+
hostname: Type.String(),
|
|
46
|
+
type: Type.Optional(Type.String()),
|
|
47
|
+
version: Type.Optional(Type.String()),
|
|
48
|
+
memory: Type.Optional(Type.String()),
|
|
49
|
+
uptime: Type.Optional(Type.String()),
|
|
50
|
+
uptimeSeconds: Type.Optional(Type.Number()),
|
|
51
|
+
players: Type.Optional(PlayerListSchema),
|
|
52
|
+
stats: Type.Optional(ContainerStatsSchema),
|
|
53
|
+
worldName: Type.Optional(Type.String()),
|
|
54
|
+
worldSize: Type.Optional(Type.String()),
|
|
55
|
+
});
|
|
56
|
+
// Request Schemas
|
|
57
|
+
export const ExecCommandRequestSchema = Type.Object({
|
|
58
|
+
command: Type.String({ minLength: 1, maxLength: 1024 }),
|
|
59
|
+
});
|
|
60
|
+
// Response Schemas
|
|
61
|
+
export const ServerListResponseSchema = Type.Object({
|
|
62
|
+
servers: Type.Array(ServerSummarySchema),
|
|
63
|
+
total: Type.Number(),
|
|
64
|
+
});
|
|
65
|
+
export const ServerDetailResponseSchema = Type.Object({
|
|
66
|
+
server: ServerDetailSchema,
|
|
67
|
+
});
|
|
68
|
+
export const ExecCommandResponseSchema = Type.Object({
|
|
69
|
+
success: Type.Boolean(),
|
|
70
|
+
output: Type.String(),
|
|
71
|
+
});
|
|
72
|
+
export const LogsResponseSchema = Type.Object({
|
|
73
|
+
logs: Type.String(),
|
|
74
|
+
lines: Type.Number(),
|
|
75
|
+
});
|
|
76
|
+
export const LogsQuerySchema = Type.Object({
|
|
77
|
+
lines: Type.Optional(Type.Number({ minimum: 1, maximum: 10000, default: 100 })),
|
|
78
|
+
follow: Type.Optional(Type.Boolean({ default: false, description: 'Enable SSE streaming for real-time logs' })),
|
|
79
|
+
});
|
|
80
|
+
export const ErrorResponseSchema = Type.Object({
|
|
81
|
+
error: Type.String(),
|
|
82
|
+
message: Type.String(),
|
|
83
|
+
});
|
|
84
|
+
export const ServerNameParamsSchema = Type.Object({
|
|
85
|
+
name: Type.String(),
|
|
86
|
+
});
|
|
87
|
+
// Create Server Request Schema
|
|
88
|
+
export const CreateServerRequestSchema = Type.Object({
|
|
89
|
+
name: Type.String({ minLength: 1, maxLength: 64, pattern: '^[a-z][a-z0-9-]*$' }),
|
|
90
|
+
type: Type.Optional(Type.Union([
|
|
91
|
+
Type.Literal('PAPER'),
|
|
92
|
+
Type.Literal('VANILLA'),
|
|
93
|
+
Type.Literal('FORGE'),
|
|
94
|
+
Type.Literal('FABRIC'),
|
|
95
|
+
Type.Literal('SPIGOT'),
|
|
96
|
+
Type.Literal('NEOFORGE'),
|
|
97
|
+
])),
|
|
98
|
+
version: Type.Optional(Type.String()),
|
|
99
|
+
memory: Type.Optional(Type.String({ pattern: '^\\d+[MG]$' })),
|
|
100
|
+
seed: Type.Optional(Type.String()),
|
|
101
|
+
worldUrl: Type.Optional(Type.String({ format: 'uri' })),
|
|
102
|
+
worldName: Type.Optional(Type.String()),
|
|
103
|
+
autoStart: Type.Optional(Type.Boolean({ default: true })),
|
|
104
|
+
});
|
|
105
|
+
// Create Server Response Schema
|
|
106
|
+
export const CreateServerResponseSchema = Type.Object({
|
|
107
|
+
success: Type.Boolean(),
|
|
108
|
+
server: Type.Object({
|
|
109
|
+
name: Type.String(),
|
|
110
|
+
container: Type.String(),
|
|
111
|
+
status: Type.String(),
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
// Delete Server Response Schema
|
|
115
|
+
export const DeleteServerResponseSchema = Type.Object({
|
|
116
|
+
success: Type.Boolean(),
|
|
117
|
+
server: Type.String(),
|
|
118
|
+
message: Type.String(),
|
|
119
|
+
});
|
|
120
|
+
// Delete Server Query Schema
|
|
121
|
+
export const DeleteServerQuerySchema = Type.Object({
|
|
122
|
+
force: Type.Optional(Type.Boolean({ default: false })),
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/schemas/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,mBAAmB,CAAC;AAEjD,8BAA8B;AAC9B,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC9C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACtB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACtB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;IAC1B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACpB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACpB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;CACxB,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;IACrB,GAAG,EAAE,IAAI,CA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+
import { Static } from '@sinclair/typebox';
|
|
2
|
+
/**
|
|
3
|
+
* World summary for list responses
|
|
4
|
+
*/
|
|
5
|
+
export declare const WorldSummarySchema: import("@sinclair/typebox").TObject<{
|
|
6
|
+
name: import("@sinclair/typebox").TString;
|
|
7
|
+
path: import("@sinclair/typebox").TString;
|
|
8
|
+
isLocked: import("@sinclair/typebox").TBoolean;
|
|
9
|
+
lockedBy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
10
|
+
size: import("@sinclair/typebox").TString;
|
|
11
|
+
lastModified: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* World detail response
|
|
15
|
+
*/
|
|
16
|
+
export declare const WorldDetailSchema: import("@sinclair/typebox").TObject<{
|
|
17
|
+
name: import("@sinclair/typebox").TString;
|
|
18
|
+
path: import("@sinclair/typebox").TString;
|
|
19
|
+
isLocked: import("@sinclair/typebox").TBoolean;
|
|
20
|
+
lockedBy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
21
|
+
size: import("@sinclair/typebox").TString;
|
|
22
|
+
lastModified: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* World name path parameter
|
|
26
|
+
*/
|
|
27
|
+
export declare const WorldNameParamsSchema: import("@sinclair/typebox").TObject<{
|
|
28
|
+
name: import("@sinclair/typebox").TString;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Create world request body
|
|
32
|
+
*/
|
|
33
|
+
export declare const CreateWorldRequestSchema: import("@sinclair/typebox").TObject<{
|
|
34
|
+
name: import("@sinclair/typebox").TString;
|
|
35
|
+
seed: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
36
|
+
serverName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
37
|
+
autoStart: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Assign world request body
|
|
41
|
+
*/
|
|
42
|
+
export declare const AssignWorldRequestSchema: import("@sinclair/typebox").TObject<{
|
|
43
|
+
serverName: import("@sinclair/typebox").TString;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Delete world query parameters
|
|
47
|
+
*/
|
|
48
|
+
export declare const DeleteWorldQuerySchema: import("@sinclair/typebox").TObject<{
|
|
49
|
+
force: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Release world query parameters
|
|
53
|
+
*/
|
|
54
|
+
export declare const ReleaseWorldQuerySchema: import("@sinclair/typebox").TObject<{
|
|
55
|
+
force: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* World list response
|
|
59
|
+
*/
|
|
60
|
+
export declare const WorldListResponseSchema: import("@sinclair/typebox").TObject<{
|
|
61
|
+
worlds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
62
|
+
name: import("@sinclair/typebox").TString;
|
|
63
|
+
path: import("@sinclair/typebox").TString;
|
|
64
|
+
isLocked: import("@sinclair/typebox").TBoolean;
|
|
65
|
+
lockedBy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
66
|
+
size: import("@sinclair/typebox").TString;
|
|
67
|
+
lastModified: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
68
|
+
}>>;
|
|
69
|
+
total: import("@sinclair/typebox").TNumber;
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* World detail response
|
|
73
|
+
*/
|
|
74
|
+
export declare const WorldDetailResponseSchema: import("@sinclair/typebox").TObject<{
|
|
75
|
+
world: import("@sinclair/typebox").TObject<{
|
|
76
|
+
name: import("@sinclair/typebox").TString;
|
|
77
|
+
path: import("@sinclair/typebox").TString;
|
|
78
|
+
isLocked: import("@sinclair/typebox").TBoolean;
|
|
79
|
+
lockedBy: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
80
|
+
size: import("@sinclair/typebox").TString;
|
|
81
|
+
lastModified: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
82
|
+
}>;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Create world response
|
|
86
|
+
*/
|
|
87
|
+
export declare const CreateWorldResponseSchema: import("@sinclair/typebox").TObject<{
|
|
88
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
89
|
+
worldName: import("@sinclair/typebox").TString;
|
|
90
|
+
seed: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
91
|
+
serverName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
92
|
+
started: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
93
|
+
error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* Assign world response
|
|
97
|
+
*/
|
|
98
|
+
export declare const AssignWorldResponseSchema: import("@sinclair/typebox").TObject<{
|
|
99
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
100
|
+
worldName: import("@sinclair/typebox").TString;
|
|
101
|
+
serverName: import("@sinclair/typebox").TString;
|
|
102
|
+
error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Release world response
|
|
106
|
+
*/
|
|
107
|
+
export declare const ReleaseWorldResponseSchema: import("@sinclair/typebox").TObject<{
|
|
108
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
109
|
+
worldName: import("@sinclair/typebox").TString;
|
|
110
|
+
previousServer: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
111
|
+
error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Delete world response
|
|
115
|
+
*/
|
|
116
|
+
export declare const DeleteWorldResponseSchema: import("@sinclair/typebox").TObject<{
|
|
117
|
+
success: import("@sinclair/typebox").TBoolean;
|
|
118
|
+
worldName: import("@sinclair/typebox").TString;
|
|
119
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
120
|
+
error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Error response
|
|
124
|
+
*/
|
|
125
|
+
export declare const WorldErrorResponseSchema: import("@sinclair/typebox").TObject<{
|
|
126
|
+
error: import("@sinclair/typebox").TString;
|
|
127
|
+
message: import("@sinclair/typebox").TString;
|
|
128
|
+
}>;
|
|
129
|
+
export type WorldSummary = Static<typeof WorldSummarySchema>;
|
|
130
|
+
export type WorldDetail = Static<typeof WorldDetailSchema>;
|
|
131
|
+
export type WorldNameParams = Static<typeof WorldNameParamsSchema>;
|
|
132
|
+
export type CreateWorldRequest = Static<typeof CreateWorldRequestSchema>;
|
|
133
|
+
export type AssignWorldRequest = Static<typeof AssignWorldRequestSchema>;
|
|
134
|
+
export type DeleteWorldQuery = Static<typeof DeleteWorldQuerySchema>;
|
|
135
|
+
export type ReleaseWorldQuery = Static<typeof ReleaseWorldQuerySchema>;
|
|
136
|
+
export type WorldListResponse = Static<typeof WorldListResponseSchema>;
|
|
137
|
+
export type WorldDetailResponse = Static<typeof WorldDetailResponseSchema>;
|
|
138
|
+
export type CreateWorldResponse = Static<typeof CreateWorldResponseSchema>;
|
|
139
|
+
export type AssignWorldResponse = Static<typeof AssignWorldResponseSchema>;
|
|
140
|
+
export type ReleaseWorldResponse = Static<typeof ReleaseWorldResponseSchema>;
|
|
141
|
+
export type DeleteWorldResponse = Static<typeof DeleteWorldResponseSchema>;
|
|
142
|
+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BAAwB,CAAC,CAAC;AACzE,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,iBAAiB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Type } from '@sinclair/typebox';
|
|
2
|
+
// ========================================
|
|
3
|
+
// World Schemas
|
|
4
|
+
// ========================================
|
|
5
|
+
/**
|
|
6
|
+
* World summary for list responses
|
|
7
|
+
*/
|
|
8
|
+
export const WorldSummarySchema = Type.Object({
|
|
9
|
+
name: Type.String(),
|
|
10
|
+
path: Type.String(),
|
|
11
|
+
isLocked: Type.Boolean(),
|
|
12
|
+
lockedBy: Type.Optional(Type.String()),
|
|
13
|
+
size: Type.String(),
|
|
14
|
+
lastModified: Type.Optional(Type.String({ format: 'date-time' })),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* World detail response
|
|
18
|
+
*/
|
|
19
|
+
export const WorldDetailSchema = Type.Object({
|
|
20
|
+
name: Type.String(),
|
|
21
|
+
path: Type.String(),
|
|
22
|
+
isLocked: Type.Boolean(),
|
|
23
|
+
lockedBy: Type.Optional(Type.String()),
|
|
24
|
+
size: Type.String(),
|
|
25
|
+
lastModified: Type.Optional(Type.String({ format: 'date-time' })),
|
|
26
|
+
});
|
|
27
|
+
// ========================================
|
|
28
|
+
// Request Schemas
|
|
29
|
+
// ========================================
|
|
30
|
+
/**
|
|
31
|
+
* World name path parameter
|
|
32
|
+
*/
|
|
33
|
+
export const WorldNameParamsSchema = Type.Object({
|
|
34
|
+
name: Type.String({ minLength: 1 }),
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Create world request body
|
|
38
|
+
*/
|
|
39
|
+
export const CreateWorldRequestSchema = Type.Object({
|
|
40
|
+
name: Type.String({ minLength: 1, pattern: '^[a-zA-Z0-9_-]+$' }),
|
|
41
|
+
seed: Type.Optional(Type.String()),
|
|
42
|
+
serverName: Type.Optional(Type.String()),
|
|
43
|
+
autoStart: Type.Optional(Type.Boolean({ default: false })),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Assign world request body
|
|
47
|
+
*/
|
|
48
|
+
export const AssignWorldRequestSchema = Type.Object({
|
|
49
|
+
serverName: Type.String({ minLength: 1 }),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Delete world query parameters
|
|
53
|
+
*/
|
|
54
|
+
export const DeleteWorldQuerySchema = Type.Object({
|
|
55
|
+
force: Type.Optional(Type.Boolean({ default: false })),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Release world query parameters
|
|
59
|
+
*/
|
|
60
|
+
export const ReleaseWorldQuerySchema = Type.Object({
|
|
61
|
+
force: Type.Optional(Type.Boolean({ default: false })),
|
|
62
|
+
});
|
|
63
|
+
// ========================================
|
|
64
|
+
// Response Schemas
|
|
65
|
+
// ========================================
|
|
66
|
+
/**
|
|
67
|
+
* World list response
|
|
68
|
+
*/
|
|
69
|
+
export const WorldListResponseSchema = Type.Object({
|
|
70
|
+
worlds: Type.Array(WorldSummarySchema),
|
|
71
|
+
total: Type.Number(),
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* World detail response
|
|
75
|
+
*/
|
|
76
|
+
export const WorldDetailResponseSchema = Type.Object({
|
|
77
|
+
world: WorldDetailSchema,
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* Create world response
|
|
81
|
+
*/
|
|
82
|
+
export const CreateWorldResponseSchema = Type.Object({
|
|
83
|
+
success: Type.Boolean(),
|
|
84
|
+
worldName: Type.String(),
|
|
85
|
+
seed: Type.Optional(Type.String()),
|
|
86
|
+
serverName: Type.Optional(Type.String()),
|
|
87
|
+
started: Type.Optional(Type.Boolean()),
|
|
88
|
+
error: Type.Optional(Type.String()),
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Assign world response
|
|
92
|
+
*/
|
|
93
|
+
export const AssignWorldResponseSchema = Type.Object({
|
|
94
|
+
success: Type.Boolean(),
|
|
95
|
+
worldName: Type.String(),
|
|
96
|
+
serverName: Type.String(),
|
|
97
|
+
error: Type.Optional(Type.String()),
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* Release world response
|
|
101
|
+
*/
|
|
102
|
+
export const ReleaseWorldResponseSchema = Type.Object({
|
|
103
|
+
success: Type.Boolean(),
|
|
104
|
+
worldName: Type.String(),
|
|
105
|
+
previousServer: Type.Optional(Type.String()),
|
|
106
|
+
error: Type.Optional(Type.String()),
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* Delete world response
|
|
110
|
+
*/
|
|
111
|
+
export const DeleteWorldResponseSchema = Type.Object({
|
|
112
|
+
success: Type.Boolean(),
|
|
113
|
+
worldName: Type.String(),
|
|
114
|
+
size: Type.Optional(Type.String()),
|
|
115
|
+
error: Type.Optional(Type.String()),
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* Error response
|
|
119
|
+
*/
|
|
120
|
+
export const WorldErrorResponseSchema = Type.Object({
|
|
121
|
+
error: Type.String(),
|
|
122
|
+
message: Type.String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C,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5C,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;CACpC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,MAAM,CAAC;IACnD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;IACvB,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;IACxB,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAClC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;CACpC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CAAC;IAClD,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface DockerComposeResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
stdout?: string;
|
|
4
|
+
stderr?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export type ServerAction = 'start' | 'stop' | 'restart';
|
|
8
|
+
/**
|
|
9
|
+
* Platform directory path.
|
|
10
|
+
* Uses config.platformPath which is resolved from:
|
|
11
|
+
* 1. PLATFORM_PATH environment variable
|
|
12
|
+
* 2. MCCTL_ROOT environment variable
|
|
13
|
+
* 3. ~/minecraft-servers (default)
|
|
14
|
+
*/
|
|
15
|
+
declare function getPlatformPath(): string;
|
|
16
|
+
export declare function isValidServerName(name: string): boolean;
|
|
17
|
+
export declare function sanitizeServerName(name: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Execute a docker compose command for a specific server action.
|
|
20
|
+
*/
|
|
21
|
+
export declare function executeServerAction(serverName: string, action: ServerAction): Promise<DockerComposeResult>;
|
|
22
|
+
export { getPlatformPath };
|
|
23
|
+
//# sourceMappingURL=docker-compose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-compose.d.ts","sourceRoot":"","sources":["../../src/utils/docker-compose.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAMxD;;;;;;GAMG;AACH,iBAAS,eAAe,IAAI,MAAM,CAEjC;AAaD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKvD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQvD;AAMD;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,mBAAmB,CAAC,CAgD9B;AAMD,OAAO,EAAE,eAAe,EAAE,CAAC"}
|