@minecraft-docker/shared 1.5.0 → 1.6.1

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.
Files changed (169) hide show
  1. package/dist/application/index.d.ts +3 -0
  2. package/dist/application/index.d.ts.map +1 -0
  3. package/dist/application/index.js +5 -0
  4. package/dist/application/index.js.map +1 -0
  5. package/dist/application/ports/inbound/IBackupUseCase.d.ts +69 -0
  6. package/dist/application/ports/inbound/IBackupUseCase.d.ts.map +1 -0
  7. package/dist/application/ports/inbound/IBackupUseCase.js +2 -0
  8. package/dist/application/ports/inbound/IBackupUseCase.js.map +1 -0
  9. package/dist/application/ports/inbound/ICreateServerUseCase.d.ts +32 -0
  10. package/dist/application/ports/inbound/ICreateServerUseCase.d.ts.map +1 -0
  11. package/dist/application/ports/inbound/ICreateServerUseCase.js +2 -0
  12. package/dist/application/ports/inbound/ICreateServerUseCase.js.map +1 -0
  13. package/dist/application/ports/inbound/IDeleteServerUseCase.d.ts +26 -0
  14. package/dist/application/ports/inbound/IDeleteServerUseCase.d.ts.map +1 -0
  15. package/dist/application/ports/inbound/IDeleteServerUseCase.js +2 -0
  16. package/dist/application/ports/inbound/IDeleteServerUseCase.js.map +1 -0
  17. package/dist/application/ports/inbound/IPlayerLookupUseCase.d.ts +47 -0
  18. package/dist/application/ports/inbound/IPlayerLookupUseCase.d.ts.map +1 -0
  19. package/dist/application/ports/inbound/IPlayerLookupUseCase.js +2 -0
  20. package/dist/application/ports/inbound/IPlayerLookupUseCase.js.map +1 -0
  21. package/dist/application/ports/inbound/IServerStatusUseCase.d.ts +34 -0
  22. package/dist/application/ports/inbound/IServerStatusUseCase.d.ts.map +1 -0
  23. package/dist/application/ports/inbound/IServerStatusUseCase.js +2 -0
  24. package/dist/application/ports/inbound/IServerStatusUseCase.js.map +1 -0
  25. package/dist/application/ports/inbound/IWorldManagementUseCase.d.ts +56 -0
  26. package/dist/application/ports/inbound/IWorldManagementUseCase.d.ts.map +1 -0
  27. package/dist/application/ports/inbound/IWorldManagementUseCase.js +2 -0
  28. package/dist/application/ports/inbound/IWorldManagementUseCase.js.map +1 -0
  29. package/dist/application/ports/inbound/index.d.ts +7 -0
  30. package/dist/application/ports/inbound/index.d.ts.map +1 -0
  31. package/dist/application/ports/inbound/index.js +2 -0
  32. package/dist/application/ports/inbound/index.js.map +1 -0
  33. package/dist/application/ports/index.d.ts +3 -0
  34. package/dist/application/ports/index.d.ts.map +1 -0
  35. package/dist/application/ports/index.js +2 -0
  36. package/dist/application/ports/index.js.map +1 -0
  37. package/dist/application/ports/outbound/IDocProvider.d.ts +73 -0
  38. package/dist/application/ports/outbound/IDocProvider.d.ts.map +1 -0
  39. package/dist/application/ports/outbound/IDocProvider.js +2 -0
  40. package/dist/application/ports/outbound/IDocProvider.js.map +1 -0
  41. package/dist/application/ports/outbound/IPromptPort.d.ts +136 -0
  42. package/dist/application/ports/outbound/IPromptPort.d.ts.map +1 -0
  43. package/dist/application/ports/outbound/IPromptPort.js +2 -0
  44. package/dist/application/ports/outbound/IPromptPort.js.map +1 -0
  45. package/dist/application/ports/outbound/IServerRepository.d.ts +54 -0
  46. package/dist/application/ports/outbound/IServerRepository.d.ts.map +1 -0
  47. package/dist/application/ports/outbound/IServerRepository.js +2 -0
  48. package/dist/application/ports/outbound/IServerRepository.js.map +1 -0
  49. package/dist/application/ports/outbound/IShellPort.d.ts +106 -0
  50. package/dist/application/ports/outbound/IShellPort.d.ts.map +1 -0
  51. package/dist/application/ports/outbound/IShellPort.js +2 -0
  52. package/dist/application/ports/outbound/IShellPort.js.map +1 -0
  53. package/dist/application/ports/outbound/IWorldRepository.d.ts +71 -0
  54. package/dist/application/ports/outbound/IWorldRepository.d.ts.map +1 -0
  55. package/dist/application/ports/outbound/IWorldRepository.js +2 -0
  56. package/dist/application/ports/outbound/IWorldRepository.js.map +1 -0
  57. package/dist/application/ports/outbound/index.d.ts +6 -0
  58. package/dist/application/ports/outbound/index.d.ts.map +1 -0
  59. package/dist/application/ports/outbound/index.js +2 -0
  60. package/dist/application/ports/outbound/index.js.map +1 -0
  61. package/dist/application/use-cases/BackupUseCase.d.ts +35 -0
  62. package/dist/application/use-cases/BackupUseCase.d.ts.map +1 -0
  63. package/dist/application/use-cases/BackupUseCase.js +222 -0
  64. package/dist/application/use-cases/BackupUseCase.js.map +1 -0
  65. package/dist/application/use-cases/CreateServerUseCase.d.ts +22 -0
  66. package/dist/application/use-cases/CreateServerUseCase.d.ts.map +1 -0
  67. package/dist/application/use-cases/CreateServerUseCase.js +145 -0
  68. package/dist/application/use-cases/CreateServerUseCase.js.map +1 -0
  69. package/dist/application/use-cases/DeleteServerUseCase.d.ts +24 -0
  70. package/dist/application/use-cases/DeleteServerUseCase.d.ts.map +1 -0
  71. package/dist/application/use-cases/DeleteServerUseCase.js +108 -0
  72. package/dist/application/use-cases/DeleteServerUseCase.js.map +1 -0
  73. package/dist/application/use-cases/PlayerLookupUseCase.d.ts +23 -0
  74. package/dist/application/use-cases/PlayerLookupUseCase.d.ts.map +1 -0
  75. package/dist/application/use-cases/PlayerLookupUseCase.js +130 -0
  76. package/dist/application/use-cases/PlayerLookupUseCase.js.map +1 -0
  77. package/dist/application/use-cases/ServerStatusUseCase.d.ts +30 -0
  78. package/dist/application/use-cases/ServerStatusUseCase.d.ts.map +1 -0
  79. package/dist/application/use-cases/ServerStatusUseCase.js +117 -0
  80. package/dist/application/use-cases/ServerStatusUseCase.js.map +1 -0
  81. package/dist/application/use-cases/WorldManagementUseCase.d.ts +33 -0
  82. package/dist/application/use-cases/WorldManagementUseCase.d.ts.map +1 -0
  83. package/dist/application/use-cases/WorldManagementUseCase.js +239 -0
  84. package/dist/application/use-cases/WorldManagementUseCase.js.map +1 -0
  85. package/dist/application/use-cases/index.d.ts +7 -0
  86. package/dist/application/use-cases/index.d.ts.map +1 -0
  87. package/dist/application/use-cases/index.js +7 -0
  88. package/dist/application/use-cases/index.js.map +1 -0
  89. package/dist/docker/index.d.ts +111 -0
  90. package/dist/docker/index.d.ts.map +1 -0
  91. package/dist/docker/index.js +532 -0
  92. package/dist/docker/index.js.map +1 -0
  93. package/dist/domain/entities/Server.d.ts +77 -0
  94. package/dist/domain/entities/Server.d.ts.map +1 -0
  95. package/dist/domain/entities/Server.js +138 -0
  96. package/dist/domain/entities/Server.js.map +1 -0
  97. package/dist/domain/entities/World.d.ts +70 -0
  98. package/dist/domain/entities/World.d.ts.map +1 -0
  99. package/dist/domain/entities/World.js +128 -0
  100. package/dist/domain/entities/World.js.map +1 -0
  101. package/dist/domain/entities/index.d.ts +3 -0
  102. package/dist/domain/entities/index.d.ts.map +1 -0
  103. package/dist/domain/entities/index.js +3 -0
  104. package/dist/domain/entities/index.js.map +1 -0
  105. package/dist/domain/index.d.ts +3 -0
  106. package/dist/domain/index.d.ts.map +1 -0
  107. package/dist/domain/index.js +5 -0
  108. package/dist/domain/index.js.map +1 -0
  109. package/dist/domain/value-objects/McVersion.d.ts +35 -0
  110. package/dist/domain/value-objects/McVersion.d.ts.map +1 -0
  111. package/dist/domain/value-objects/McVersion.js +117 -0
  112. package/dist/domain/value-objects/McVersion.js.map +1 -0
  113. package/dist/domain/value-objects/Memory.d.ts +37 -0
  114. package/dist/domain/value-objects/Memory.d.ts.map +1 -0
  115. package/dist/domain/value-objects/Memory.js +107 -0
  116. package/dist/domain/value-objects/Memory.js.map +1 -0
  117. package/dist/domain/value-objects/ServerName.d.ts +21 -0
  118. package/dist/domain/value-objects/ServerName.d.ts.map +1 -0
  119. package/dist/domain/value-objects/ServerName.js +58 -0
  120. package/dist/domain/value-objects/ServerName.js.map +1 -0
  121. package/dist/domain/value-objects/ServerType.d.ts +39 -0
  122. package/dist/domain/value-objects/ServerType.d.ts.map +1 -0
  123. package/dist/domain/value-objects/ServerType.js +128 -0
  124. package/dist/domain/value-objects/ServerType.js.map +1 -0
  125. package/dist/domain/value-objects/WorldOptions.d.ts +49 -0
  126. package/dist/domain/value-objects/WorldOptions.d.ts.map +1 -0
  127. package/dist/domain/value-objects/WorldOptions.js +149 -0
  128. package/dist/domain/value-objects/WorldOptions.js.map +1 -0
  129. package/dist/domain/value-objects/index.d.ts +6 -0
  130. package/dist/domain/value-objects/index.d.ts.map +1 -0
  131. package/dist/domain/value-objects/index.js +6 -0
  132. package/dist/domain/value-objects/index.js.map +1 -0
  133. package/dist/index.d.ts +7 -0
  134. package/dist/index.d.ts.map +1 -0
  135. package/dist/index.js +17 -0
  136. package/dist/index.js.map +1 -0
  137. package/dist/infrastructure/adapters/DocsAdapter.d.ts +45 -0
  138. package/dist/infrastructure/adapters/DocsAdapter.d.ts.map +1 -0
  139. package/dist/infrastructure/adapters/DocsAdapter.js +490 -0
  140. package/dist/infrastructure/adapters/DocsAdapter.js.map +1 -0
  141. package/dist/infrastructure/adapters/ServerRepository.d.ts +49 -0
  142. package/dist/infrastructure/adapters/ServerRepository.d.ts.map +1 -0
  143. package/dist/infrastructure/adapters/ServerRepository.js +206 -0
  144. package/dist/infrastructure/adapters/ServerRepository.js.map +1 -0
  145. package/dist/infrastructure/adapters/ShellAdapter.d.ts +39 -0
  146. package/dist/infrastructure/adapters/ShellAdapter.d.ts.map +1 -0
  147. package/dist/infrastructure/adapters/ShellAdapter.js +188 -0
  148. package/dist/infrastructure/adapters/ShellAdapter.js.map +1 -0
  149. package/dist/infrastructure/adapters/WorldRepository.d.ts +55 -0
  150. package/dist/infrastructure/adapters/WorldRepository.d.ts.map +1 -0
  151. package/dist/infrastructure/adapters/WorldRepository.js +213 -0
  152. package/dist/infrastructure/adapters/WorldRepository.js.map +1 -0
  153. package/dist/infrastructure/adapters/index.d.ts +9 -0
  154. package/dist/infrastructure/adapters/index.d.ts.map +1 -0
  155. package/dist/infrastructure/adapters/index.js +9 -0
  156. package/dist/infrastructure/adapters/index.js.map +1 -0
  157. package/dist/infrastructure/index.d.ts +6 -0
  158. package/dist/infrastructure/index.d.ts.map +1 -0
  159. package/dist/infrastructure/index.js +6 -0
  160. package/dist/infrastructure/index.js.map +1 -0
  161. package/dist/types/index.d.ts +151 -0
  162. package/dist/types/index.d.ts.map +1 -0
  163. package/dist/types/index.js +2 -0
  164. package/dist/types/index.js.map +1 -0
  165. package/dist/utils/index.d.ts +81 -0
  166. package/dist/utils/index.d.ts.map +1 -0
  167. package/dist/utils/index.js +200 -0
  168. package/dist/utils/index.js.map +1 -0
  169. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorldManagementUseCase.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/WorldManagementUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,uBAAuB;IAElE,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAHV,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,gBAAgB,EAC3B,UAAU,EAAE,iBAAiB;IAGhD;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAa9C;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAiF/C;;OAEG;IACG,iBAAiB,CACrB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC;IA2C7B;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC;IA0EjD;;OAEG;IACG,kBAAkB,CACtB,SAAS,EAAE,MAAM,EACjB,KAAK,UAAQ,GACZ,OAAO,CAAC,kBAAkB,CAAC;CA8B/B"}
@@ -0,0 +1,239 @@
1
+ /**
2
+ * World Management Use Case
3
+ * Manages world assignments and locks
4
+ */
5
+ export class WorldManagementUseCase {
6
+ prompt;
7
+ shell;
8
+ worldRepo;
9
+ serverRepo;
10
+ constructor(prompt, shell, worldRepo, serverRepo) {
11
+ this.prompt = prompt;
12
+ this.shell = shell;
13
+ this.worldRepo = worldRepo;
14
+ this.serverRepo = serverRepo;
15
+ }
16
+ /**
17
+ * List all worlds with lock status
18
+ */
19
+ async listWorlds() {
20
+ const worlds = await this.worldRepo.findAll();
21
+ return worlds.map((world) => ({
22
+ name: world.name,
23
+ path: world.path,
24
+ isLocked: world.isLocked,
25
+ lockedBy: world.lockedBy,
26
+ size: world.sizeFormatted,
27
+ lastModified: world.lastModified,
28
+ }));
29
+ }
30
+ /**
31
+ * Interactive world assignment
32
+ */
33
+ async assignWorld() {
34
+ this.prompt.intro('Assign World to Server');
35
+ try {
36
+ // Get unlocked worlds
37
+ const worlds = await this.worldRepo.findUnlocked();
38
+ if (worlds.length === 0) {
39
+ this.prompt.warn('No unlocked worlds available');
40
+ this.prompt.outro('All worlds are currently assigned');
41
+ return {
42
+ success: false,
43
+ worldName: '',
44
+ serverName: '',
45
+ error: 'No unlocked worlds available',
46
+ };
47
+ }
48
+ // Prompt for world selection
49
+ const world = await this.prompt.promptWorldSelection(worlds);
50
+ // Get servers
51
+ const servers = await this.serverRepo.findAll();
52
+ if (servers.length === 0) {
53
+ this.prompt.warn('No servers available');
54
+ this.prompt.outro('Create a server first');
55
+ return {
56
+ success: false,
57
+ worldName: world.name,
58
+ serverName: '',
59
+ error: 'No servers available',
60
+ };
61
+ }
62
+ // Prompt for server selection
63
+ const server = await this.prompt.promptServerSelection(servers);
64
+ // Execute assignment
65
+ const spinner = this.prompt.spinner();
66
+ spinner.start('Assigning world...');
67
+ const result = await this.shell.worldAssign(world.name, server.name.value);
68
+ if (!result.success) {
69
+ spinner.stop('Failed to assign world');
70
+ this.prompt.error(result.stderr || 'Unknown error');
71
+ return {
72
+ success: false,
73
+ worldName: world.name,
74
+ serverName: server.name.value,
75
+ error: result.stderr,
76
+ };
77
+ }
78
+ spinner.stop('World assigned');
79
+ this.prompt.success(`World '${world.name}' assigned to '${server.name.value}'`);
80
+ this.prompt.outro('Assignment complete');
81
+ return {
82
+ success: true,
83
+ worldName: world.name,
84
+ serverName: server.name.value,
85
+ };
86
+ }
87
+ catch (error) {
88
+ if (this.prompt.isCancel(error)) {
89
+ this.prompt.outro('Assignment cancelled');
90
+ return {
91
+ success: false,
92
+ worldName: '',
93
+ serverName: '',
94
+ error: 'Cancelled',
95
+ };
96
+ }
97
+ throw error;
98
+ }
99
+ }
100
+ /**
101
+ * Assign world to server by name
102
+ */
103
+ async assignWorldByName(worldName, serverName) {
104
+ // Check world exists
105
+ const world = await this.worldRepo.findByName(worldName);
106
+ if (!world) {
107
+ return {
108
+ success: false,
109
+ worldName,
110
+ serverName,
111
+ error: `World '${worldName}' not found`,
112
+ };
113
+ }
114
+ // Check world is not locked
115
+ if (world.isLocked) {
116
+ return {
117
+ success: false,
118
+ worldName,
119
+ serverName,
120
+ error: `World '${worldName}' is already locked by '${world.lockedBy}'`,
121
+ };
122
+ }
123
+ // Check server exists
124
+ if (!(await this.serverRepo.exists(serverName))) {
125
+ return {
126
+ success: false,
127
+ worldName,
128
+ serverName,
129
+ error: `Server '${serverName}' not found`,
130
+ };
131
+ }
132
+ // Execute assignment
133
+ const result = await this.shell.worldAssign(worldName, serverName);
134
+ return {
135
+ success: result.success,
136
+ worldName,
137
+ serverName,
138
+ error: result.success ? undefined : result.stderr,
139
+ };
140
+ }
141
+ /**
142
+ * Interactive world release
143
+ */
144
+ async releaseWorld() {
145
+ this.prompt.intro('Release World Lock');
146
+ try {
147
+ // Get locked worlds
148
+ const worlds = await this.worldRepo.findLocked();
149
+ if (worlds.length === 0) {
150
+ this.prompt.warn('No locked worlds found');
151
+ this.prompt.outro('All worlds are unlocked');
152
+ return {
153
+ success: false,
154
+ worldName: '',
155
+ error: 'No locked worlds found',
156
+ };
157
+ }
158
+ // Prompt for world selection
159
+ const world = await this.prompt.promptWorldSelection(worlds);
160
+ // Confirm release
161
+ const confirmed = await this.prompt.confirm({
162
+ message: `Release lock on '${world.name}' (locked by ${world.lockedBy})?`,
163
+ initialValue: true,
164
+ });
165
+ if (!confirmed) {
166
+ this.prompt.outro('Release cancelled');
167
+ return {
168
+ success: false,
169
+ worldName: world.name,
170
+ error: 'Cancelled',
171
+ };
172
+ }
173
+ // Execute release
174
+ const spinner = this.prompt.spinner();
175
+ spinner.start('Releasing lock...');
176
+ const result = await this.shell.worldRelease(world.name);
177
+ if (!result.success) {
178
+ spinner.stop('Failed to release lock');
179
+ this.prompt.error(result.stderr || 'Unknown error');
180
+ return {
181
+ success: false,
182
+ worldName: world.name,
183
+ previousServer: world.lockedBy,
184
+ error: result.stderr,
185
+ };
186
+ }
187
+ spinner.stop('Lock released');
188
+ this.prompt.success(`World '${world.name}' is now unlocked`);
189
+ this.prompt.outro('Release complete');
190
+ return {
191
+ success: true,
192
+ worldName: world.name,
193
+ previousServer: world.lockedBy,
194
+ };
195
+ }
196
+ catch (error) {
197
+ if (this.prompt.isCancel(error)) {
198
+ this.prompt.outro('Release cancelled');
199
+ return {
200
+ success: false,
201
+ worldName: '',
202
+ error: 'Cancelled',
203
+ };
204
+ }
205
+ throw error;
206
+ }
207
+ }
208
+ /**
209
+ * Release world by name
210
+ */
211
+ async releaseWorldByName(worldName, force = false) {
212
+ // Check world exists
213
+ const world = await this.worldRepo.findByName(worldName);
214
+ if (!world) {
215
+ return {
216
+ success: false,
217
+ worldName,
218
+ error: `World '${worldName}' not found`,
219
+ };
220
+ }
221
+ // Check world is locked
222
+ if (!world.isLocked) {
223
+ return {
224
+ success: false,
225
+ worldName,
226
+ error: `World '${worldName}' is not locked`,
227
+ };
228
+ }
229
+ // Execute release
230
+ const result = await this.shell.worldRelease(worldName);
231
+ return {
232
+ success: result.success,
233
+ worldName,
234
+ previousServer: world.lockedBy,
235
+ error: result.success ? undefined : result.stderr,
236
+ };
237
+ }
238
+ }
239
+ //# sourceMappingURL=WorldManagementUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorldManagementUseCase.js","sourceRoot":"","sources":["../../../src/application/use-cases/WorldManagementUseCase.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IAEd;IACA;IACA;IACA;IAJnB,YACmB,MAAmB,EACnB,KAAiB,EACjB,SAA2B,EAC3B,UAA6B;QAH7B,WAAM,GAAN,MAAM,CAAa;QACnB,UAAK,GAAL,KAAK,CAAY;QACjB,cAAS,GAAT,SAAS,CAAkB;QAC3B,eAAU,GAAV,UAAU,CAAmB;IAC7C,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QAE9C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,IAAI,EAAE,KAAK,CAAC,aAAa;YACzB,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,CAAC,CAAC,CAAC;IACN,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW;QACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAE5C,IAAI,CAAC;YACH,sBAAsB;YACtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAEnD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;gBACjD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CA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,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM;SAClD,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ export { CreateServerUseCase } from './CreateServerUseCase.js';
2
+ export { DeleteServerUseCase } from './DeleteServerUseCase.js';
3
+ export { ServerStatusUseCase } from './ServerStatusUseCase.js';
4
+ export { WorldManagementUseCase } from './WorldManagementUseCase.js';
5
+ export { BackupUseCase } from './BackupUseCase.js';
6
+ export { PlayerLookupUseCase } from './PlayerLookupUseCase.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { CreateServerUseCase } from './CreateServerUseCase.js';
2
+ export { DeleteServerUseCase } from './DeleteServerUseCase.js';
3
+ export { ServerStatusUseCase } from './ServerStatusUseCase.js';
4
+ export { WorldManagementUseCase } from './WorldManagementUseCase.js';
5
+ export { BackupUseCase } from './BackupUseCase.js';
6
+ export { PlayerLookupUseCase } from './PlayerLookupUseCase.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/application/use-cases/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,111 @@
1
+ import type { ContainerStatus, HealthStatus, ServerInfo, RouterInfo, PlatformStatus, ContainerStats, PlayerListResult, DetailedServerInfo, RouterDetailInfo } from '../types/index.js';
2
+ /**
3
+ * Check if Docker is available
4
+ */
5
+ export declare function checkDocker(): boolean;
6
+ /**
7
+ * Check if Docker Compose is available
8
+ */
9
+ export declare function checkDockerCompose(): boolean;
10
+ /**
11
+ * Get container status
12
+ */
13
+ export declare function getContainerStatus(container: string): ContainerStatus;
14
+ /**
15
+ * Get container health status
16
+ */
17
+ export declare function getContainerHealth(container: string): HealthStatus;
18
+ /**
19
+ * Check mc-router health via management API
20
+ * mc-router uses distroless image, so Docker healthcheck doesn't work
21
+ * Instead, we check the management API on localhost:25580
22
+ */
23
+ export declare function getRouterHealthViaApi(): HealthStatus;
24
+ /**
25
+ * Check if container exists
26
+ */
27
+ export declare function containerExists(container: string): boolean;
28
+ /**
29
+ * Get container's hostname label (mc-router.host)
30
+ */
31
+ export declare function getContainerHostname(container: string): string;
32
+ /**
33
+ * Get all minecraft server containers (mc-* except mc-router)
34
+ */
35
+ export declare function getMcContainers(): string[];
36
+ /**
37
+ * Get running minecraft server containers
38
+ */
39
+ export declare function getRunningMcContainers(): string[];
40
+ /**
41
+ * Get server info for a container
42
+ */
43
+ export declare function getServerInfo(container: string): ServerInfo;
44
+ /**
45
+ * Get router info
46
+ */
47
+ export declare function getRouterInfo(): RouterInfo;
48
+ /**
49
+ * Get avahi-daemon status
50
+ */
51
+ export declare function getAvahiStatus(): string;
52
+ /**
53
+ * Get full platform status
54
+ */
55
+ export declare function getPlatformStatus(): PlatformStatus;
56
+ /**
57
+ * Start a container
58
+ */
59
+ export declare function startContainer(container: string): boolean;
60
+ /**
61
+ * Stop a container
62
+ */
63
+ export declare function stopContainer(container: string): boolean;
64
+ /**
65
+ * Get container logs
66
+ */
67
+ export declare function getContainerLogs(container: string, lines?: number): string;
68
+ /**
69
+ * Execute shell script with environment variables
70
+ */
71
+ export declare function execScript(scriptPath: string, args: string[], env?: Record<string, string>): Promise<{
72
+ code: number;
73
+ stdout: string;
74
+ stderr: string;
75
+ }>;
76
+ /**
77
+ * Execute shell script with inherited stdio (interactive)
78
+ */
79
+ export declare function execScriptInteractive(scriptPath: string, args: string[], env?: Record<string, string>): Promise<number>;
80
+ /**
81
+ * Get container resource stats (memory, CPU)
82
+ */
83
+ export declare function getContainerStats(container: string): ContainerStats | null;
84
+ /**
85
+ * Get container uptime (time since start)
86
+ */
87
+ export declare function getContainerUptime(container: string): {
88
+ uptime: string;
89
+ seconds: number;
90
+ } | null;
91
+ /**
92
+ * Get online players via RCON
93
+ */
94
+ export declare function getOnlinePlayers(container: string): Promise<PlayerListResult | null>;
95
+ /**
96
+ * Get detailed server info
97
+ */
98
+ export declare function getDetailedServerInfo(container: string, configEnv?: Record<string, string>): DetailedServerInfo;
99
+ /**
100
+ * Get detailed server info with players (async)
101
+ */
102
+ export declare function getDetailedServerInfoWithPlayers(container: string, configEnv?: Record<string, string>): Promise<DetailedServerInfo>;
103
+ /**
104
+ * Get router detailed info
105
+ */
106
+ export declare function getRouterDetailInfo(): RouterDetailInfo;
107
+ /**
108
+ * Format bytes to human readable string
109
+ */
110
+ export declare function formatBytes(bytes: number): string;
111
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docker/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd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