@minecraft-docker/shared 1.6.0 → 1.6.2
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/dist/application/index.d.ts +3 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +5 -0
- package/dist/application/index.js.map +1 -0
- package/dist/application/ports/inbound/IBackupUseCase.d.ts +69 -0
- package/dist/application/ports/inbound/IBackupUseCase.d.ts.map +1 -0
- package/dist/application/ports/inbound/IBackupUseCase.js +2 -0
- package/dist/application/ports/inbound/IBackupUseCase.js.map +1 -0
- package/dist/application/ports/inbound/ICreateServerUseCase.d.ts +32 -0
- package/dist/application/ports/inbound/ICreateServerUseCase.d.ts.map +1 -0
- package/dist/application/ports/inbound/ICreateServerUseCase.js +2 -0
- package/dist/application/ports/inbound/ICreateServerUseCase.js.map +1 -0
- package/dist/application/ports/inbound/IDeleteServerUseCase.d.ts +26 -0
- package/dist/application/ports/inbound/IDeleteServerUseCase.d.ts.map +1 -0
- package/dist/application/ports/inbound/IDeleteServerUseCase.js +2 -0
- package/dist/application/ports/inbound/IDeleteServerUseCase.js.map +1 -0
- package/dist/application/ports/inbound/IPlayerLookupUseCase.d.ts +47 -0
- package/dist/application/ports/inbound/IPlayerLookupUseCase.d.ts.map +1 -0
- package/dist/application/ports/inbound/IPlayerLookupUseCase.js +2 -0
- package/dist/application/ports/inbound/IPlayerLookupUseCase.js.map +1 -0
- package/dist/application/ports/inbound/IServerStatusUseCase.d.ts +34 -0
- package/dist/application/ports/inbound/IServerStatusUseCase.d.ts.map +1 -0
- package/dist/application/ports/inbound/IServerStatusUseCase.js +2 -0
- package/dist/application/ports/inbound/IServerStatusUseCase.js.map +1 -0
- package/dist/application/ports/inbound/IWorldManagementUseCase.d.ts +97 -0
- package/dist/application/ports/inbound/IWorldManagementUseCase.d.ts.map +1 -0
- package/dist/application/ports/inbound/IWorldManagementUseCase.js +2 -0
- package/dist/application/ports/inbound/IWorldManagementUseCase.js.map +1 -0
- package/dist/application/ports/inbound/index.d.ts +7 -0
- package/dist/application/ports/inbound/index.d.ts.map +1 -0
- package/dist/application/ports/inbound/index.js +2 -0
- package/dist/application/ports/inbound/index.js.map +1 -0
- package/dist/application/ports/index.d.ts +3 -0
- package/dist/application/ports/index.d.ts.map +1 -0
- package/dist/application/ports/index.js +2 -0
- package/dist/application/ports/index.js.map +1 -0
- package/dist/application/ports/outbound/IDocProvider.d.ts +73 -0
- package/dist/application/ports/outbound/IDocProvider.d.ts.map +1 -0
- package/dist/application/ports/outbound/IDocProvider.js +2 -0
- package/dist/application/ports/outbound/IDocProvider.js.map +1 -0
- package/dist/application/ports/outbound/IModSourcePort.d.ts +71 -0
- package/dist/application/ports/outbound/IModSourcePort.d.ts.map +1 -0
- package/dist/application/ports/outbound/IModSourcePort.js +19 -0
- package/dist/application/ports/outbound/IModSourcePort.js.map +1 -0
- package/dist/application/ports/outbound/IPromptPort.d.ts +148 -0
- package/dist/application/ports/outbound/IPromptPort.d.ts.map +1 -0
- package/dist/application/ports/outbound/IPromptPort.js +2 -0
- package/dist/application/ports/outbound/IPromptPort.js.map +1 -0
- package/dist/application/ports/outbound/IServerRepository.d.ts +54 -0
- package/dist/application/ports/outbound/IServerRepository.d.ts.map +1 -0
- package/dist/application/ports/outbound/IServerRepository.js +2 -0
- package/dist/application/ports/outbound/IServerRepository.js.map +1 -0
- package/dist/application/ports/outbound/IServiceManagerPort.d.ts +115 -0
- package/dist/application/ports/outbound/IServiceManagerPort.d.ts.map +1 -0
- package/dist/application/ports/outbound/IServiceManagerPort.js +2 -0
- package/dist/application/ports/outbound/IServiceManagerPort.js.map +1 -0
- package/dist/application/ports/outbound/IShellPort.d.ts +114 -0
- package/dist/application/ports/outbound/IShellPort.d.ts.map +1 -0
- package/dist/application/ports/outbound/IShellPort.js +2 -0
- package/dist/application/ports/outbound/IShellPort.js.map +1 -0
- package/dist/application/ports/outbound/IUserRepository.d.ts +42 -0
- package/dist/application/ports/outbound/IUserRepository.d.ts.map +1 -0
- package/dist/application/ports/outbound/IUserRepository.js +2 -0
- package/dist/application/ports/outbound/IUserRepository.js.map +1 -0
- package/dist/application/ports/outbound/IWorldRepository.d.ts +90 -0
- package/dist/application/ports/outbound/IWorldRepository.d.ts.map +1 -0
- package/dist/application/ports/outbound/IWorldRepository.js +2 -0
- package/dist/application/ports/outbound/IWorldRepository.js.map +1 -0
- package/dist/application/ports/outbound/index.d.ts +9 -0
- package/dist/application/ports/outbound/index.d.ts.map +1 -0
- package/dist/application/ports/outbound/index.js +2 -0
- package/dist/application/ports/outbound/index.js.map +1 -0
- package/dist/application/use-cases/BackupUseCase.d.ts +35 -0
- package/dist/application/use-cases/BackupUseCase.d.ts.map +1 -0
- package/dist/application/use-cases/BackupUseCase.js +222 -0
- package/dist/application/use-cases/BackupUseCase.js.map +1 -0
- package/dist/application/use-cases/CreateServerUseCase.d.ts +22 -0
- package/dist/application/use-cases/CreateServerUseCase.d.ts.map +1 -0
- package/dist/application/use-cases/CreateServerUseCase.js +144 -0
- package/dist/application/use-cases/CreateServerUseCase.js.map +1 -0
- package/dist/application/use-cases/DeleteServerUseCase.d.ts +24 -0
- package/dist/application/use-cases/DeleteServerUseCase.d.ts.map +1 -0
- package/dist/application/use-cases/DeleteServerUseCase.js +108 -0
- package/dist/application/use-cases/DeleteServerUseCase.js.map +1 -0
- package/dist/application/use-cases/PlayerLookupUseCase.d.ts +23 -0
- package/dist/application/use-cases/PlayerLookupUseCase.d.ts.map +1 -0
- package/dist/application/use-cases/PlayerLookupUseCase.js +130 -0
- package/dist/application/use-cases/PlayerLookupUseCase.js.map +1 -0
- package/dist/application/use-cases/ServerStatusUseCase.d.ts +30 -0
- package/dist/application/use-cases/ServerStatusUseCase.d.ts.map +1 -0
- package/dist/application/use-cases/ServerStatusUseCase.js +117 -0
- package/dist/application/use-cases/ServerStatusUseCase.js.map +1 -0
- package/dist/application/use-cases/WorldManagementUseCase.d.ts +50 -0
- package/dist/application/use-cases/WorldManagementUseCase.d.ts.map +1 -0
- package/dist/application/use-cases/WorldManagementUseCase.js +571 -0
- package/dist/application/use-cases/WorldManagementUseCase.js.map +1 -0
- package/dist/application/use-cases/index.d.ts +7 -0
- package/dist/application/use-cases/index.d.ts.map +1 -0
- package/dist/application/use-cases/index.js +7 -0
- package/dist/application/use-cases/index.js.map +1 -0
- package/dist/docker/index.d.ts +125 -0
- package/dist/docker/index.d.ts.map +1 -0
- package/dist/docker/index.js +557 -0
- package/dist/docker/index.js.map +1 -0
- package/dist/domain/entities/Server.d.ts +77 -0
- package/dist/domain/entities/Server.d.ts.map +1 -0
- package/dist/domain/entities/Server.js +138 -0
- package/dist/domain/entities/Server.js.map +1 -0
- package/dist/domain/entities/User.d.ts +77 -0
- package/dist/domain/entities/User.d.ts.map +1 -0
- package/dist/domain/entities/User.js +121 -0
- package/dist/domain/entities/User.js.map +1 -0
- package/dist/domain/entities/World.d.ts +76 -0
- package/dist/domain/entities/World.d.ts.map +1 -0
- package/dist/domain/entities/World.js +141 -0
- package/dist/domain/entities/World.js.map +1 -0
- package/dist/domain/entities/index.d.ts +4 -0
- package/dist/domain/entities/index.d.ts.map +1 -0
- package/dist/domain/entities/index.js +4 -0
- package/dist/domain/entities/index.js.map +1 -0
- package/dist/domain/index.d.ts +3 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +7 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/mod/ModDependency.d.ts +18 -0
- package/dist/domain/mod/ModDependency.d.ts.map +1 -0
- package/dist/domain/mod/ModDependency.js +5 -0
- package/dist/domain/mod/ModDependency.js.map +1 -0
- package/dist/domain/mod/ModFile.d.ts +27 -0
- package/dist/domain/mod/ModFile.d.ts.map +1 -0
- package/dist/domain/mod/ModFile.js +5 -0
- package/dist/domain/mod/ModFile.js.map +1 -0
- package/dist/domain/mod/ModProject.d.ts +36 -0
- package/dist/domain/mod/ModProject.d.ts.map +1 -0
- package/dist/domain/mod/ModProject.js +5 -0
- package/dist/domain/mod/ModProject.js.map +1 -0
- package/dist/domain/mod/ModSearchResult.d.ts +18 -0
- package/dist/domain/mod/ModSearchResult.d.ts.map +1 -0
- package/dist/domain/mod/ModSearchResult.js +5 -0
- package/dist/domain/mod/ModSearchResult.js.map +1 -0
- package/dist/domain/mod/ModVersion.d.ts +36 -0
- package/dist/domain/mod/ModVersion.d.ts.map +1 -0
- package/dist/domain/mod/ModVersion.js +5 -0
- package/dist/domain/mod/ModVersion.js.map +1 -0
- package/dist/domain/mod/index.d.ts +11 -0
- package/dist/domain/mod/index.d.ts.map +1 -0
- package/dist/domain/mod/index.js +6 -0
- package/dist/domain/mod/index.js.map +1 -0
- package/dist/domain/mod/types.d.ts +43 -0
- package/dist/domain/mod/types.d.ts.map +1 -0
- package/dist/domain/mod/types.js +6 -0
- package/dist/domain/mod/types.js.map +1 -0
- package/dist/domain/value-objects/McVersion.d.ts +35 -0
- package/dist/domain/value-objects/McVersion.d.ts.map +1 -0
- package/dist/domain/value-objects/McVersion.js +117 -0
- package/dist/domain/value-objects/McVersion.js.map +1 -0
- package/dist/domain/value-objects/Memory.d.ts +37 -0
- package/dist/domain/value-objects/Memory.d.ts.map +1 -0
- package/dist/domain/value-objects/Memory.js +107 -0
- package/dist/domain/value-objects/Memory.js.map +1 -0
- package/dist/domain/value-objects/ProcessInfo.d.ts +99 -0
- package/dist/domain/value-objects/ProcessInfo.d.ts.map +1 -0
- package/dist/domain/value-objects/ProcessInfo.js +171 -0
- package/dist/domain/value-objects/ProcessInfo.js.map +1 -0
- package/dist/domain/value-objects/Role.d.ts +41 -0
- package/dist/domain/value-objects/Role.d.ts.map +1 -0
- package/dist/domain/value-objects/Role.js +66 -0
- package/dist/domain/value-objects/Role.js.map +1 -0
- package/dist/domain/value-objects/ServerName.d.ts +21 -0
- package/dist/domain/value-objects/ServerName.d.ts.map +1 -0
- package/dist/domain/value-objects/ServerName.js +58 -0
- package/dist/domain/value-objects/ServerName.js.map +1 -0
- package/dist/domain/value-objects/ServerType.d.ts +40 -0
- package/dist/domain/value-objects/ServerType.d.ts.map +1 -0
- package/dist/domain/value-objects/ServerType.js +136 -0
- package/dist/domain/value-objects/ServerType.js.map +1 -0
- package/dist/domain/value-objects/ServiceStatus.d.ts +64 -0
- package/dist/domain/value-objects/ServiceStatus.d.ts.map +1 -0
- package/dist/domain/value-objects/ServiceStatus.js +99 -0
- package/dist/domain/value-objects/ServiceStatus.js.map +1 -0
- package/dist/domain/value-objects/UserId.d.ts +21 -0
- package/dist/domain/value-objects/UserId.d.ts.map +1 -0
- package/dist/domain/value-objects/UserId.js +43 -0
- package/dist/domain/value-objects/UserId.js.map +1 -0
- package/dist/domain/value-objects/Username.d.ts +16 -0
- package/dist/domain/value-objects/Username.d.ts.map +1 -0
- package/dist/domain/value-objects/Username.js +46 -0
- package/dist/domain/value-objects/Username.js.map +1 -0
- package/dist/domain/value-objects/WorldOptions.d.ts +49 -0
- package/dist/domain/value-objects/WorldOptions.d.ts.map +1 -0
- package/dist/domain/value-objects/WorldOptions.js +149 -0
- package/dist/domain/value-objects/WorldOptions.js.map +1 -0
- package/dist/domain/value-objects/index.d.ts +11 -0
- package/dist/domain/value-objects/index.d.ts.map +1 -0
- package/dist/domain/value-objects/index.js +13 -0
- package/dist/domain/value-objects/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/adapters/ApiPromptAdapter.d.ts +115 -0
- package/dist/infrastructure/adapters/ApiPromptAdapter.d.ts.map +1 -0
- package/dist/infrastructure/adapters/ApiPromptAdapter.js +268 -0
- package/dist/infrastructure/adapters/ApiPromptAdapter.js.map +1 -0
- package/dist/infrastructure/adapters/DocsAdapter.d.ts +45 -0
- package/dist/infrastructure/adapters/DocsAdapter.d.ts.map +1 -0
- package/dist/infrastructure/adapters/DocsAdapter.js +490 -0
- package/dist/infrastructure/adapters/DocsAdapter.js.map +1 -0
- package/dist/infrastructure/adapters/ServerRepository.d.ts +49 -0
- package/dist/infrastructure/adapters/ServerRepository.d.ts.map +1 -0
- package/dist/infrastructure/adapters/ServerRepository.js +206 -0
- package/dist/infrastructure/adapters/ServerRepository.js.map +1 -0
- package/dist/infrastructure/adapters/ShellAdapter.d.ts +41 -0
- package/dist/infrastructure/adapters/ShellAdapter.d.ts.map +1 -0
- package/dist/infrastructure/adapters/ShellAdapter.js +198 -0
- package/dist/infrastructure/adapters/ShellAdapter.js.map +1 -0
- package/dist/infrastructure/adapters/SqliteUserRepository.d.ts +70 -0
- package/dist/infrastructure/adapters/SqliteUserRepository.d.ts.map +1 -0
- package/dist/infrastructure/adapters/SqliteUserRepository.js +149 -0
- package/dist/infrastructure/adapters/SqliteUserRepository.js.map +1 -0
- package/dist/infrastructure/adapters/WorldRepository.d.ts +67 -0
- package/dist/infrastructure/adapters/WorldRepository.d.ts.map +1 -0
- package/dist/infrastructure/adapters/WorldRepository.js +283 -0
- package/dist/infrastructure/adapters/WorldRepository.js.map +1 -0
- package/dist/infrastructure/adapters/YamlUserRepository.d.ts +67 -0
- package/dist/infrastructure/adapters/YamlUserRepository.d.ts.map +1 -0
- package/dist/infrastructure/adapters/YamlUserRepository.js +161 -0
- package/dist/infrastructure/adapters/YamlUserRepository.js.map +1 -0
- package/dist/infrastructure/adapters/index.d.ts +12 -0
- package/dist/infrastructure/adapters/index.d.ts.map +1 -0
- package/dist/infrastructure/adapters/index.js +12 -0
- package/dist/infrastructure/adapters/index.js.map +1 -0
- package/dist/infrastructure/config/Pm2EcosystemConfig.d.ts +192 -0
- package/dist/infrastructure/config/Pm2EcosystemConfig.d.ts.map +1 -0
- package/dist/infrastructure/config/Pm2EcosystemConfig.js +48 -0
- package/dist/infrastructure/config/Pm2EcosystemConfig.js.map +1 -0
- package/dist/infrastructure/config/index.d.ts +6 -0
- package/dist/infrastructure/config/index.d.ts.map +1 -0
- package/dist/infrastructure/config/index.js +6 -0
- package/dist/infrastructure/config/index.js.map +1 -0
- package/dist/infrastructure/factories/ModSourceFactory.d.ts +73 -0
- package/dist/infrastructure/factories/ModSourceFactory.d.ts.map +1 -0
- package/dist/infrastructure/factories/ModSourceFactory.js +98 -0
- package/dist/infrastructure/factories/ModSourceFactory.js.map +1 -0
- package/dist/infrastructure/factories/index.d.ts +5 -0
- package/dist/infrastructure/factories/index.d.ts.map +1 -0
- package/dist/infrastructure/factories/index.js +5 -0
- package/dist/infrastructure/factories/index.js.map +1 -0
- package/dist/infrastructure/index.d.ts +7 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +7 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/types/index.d.ts +151 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +81 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +200 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +10 -2
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { ServerName, ServerType, McVersion, Memory, WorldOptions, Server, World } from '../../../domain/index.js';
|
|
2
|
+
import type { WorldWithServerStatus } from './IWorldRepository.js';
|
|
3
|
+
/**
|
|
4
|
+
* Prompt Port - Outbound Port
|
|
5
|
+
* Interface for user interaction/prompts
|
|
6
|
+
*/
|
|
7
|
+
export interface IPromptPort {
|
|
8
|
+
/**
|
|
9
|
+
* Show introduction message
|
|
10
|
+
*/
|
|
11
|
+
intro(message: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Show conclusion message
|
|
14
|
+
*/
|
|
15
|
+
outro(message: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Text input prompt
|
|
18
|
+
*/
|
|
19
|
+
text(options: TextPromptOptions): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Select from options
|
|
22
|
+
*/
|
|
23
|
+
select<T>(options: SelectPromptOptions<T>): Promise<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Confirm yes/no prompt
|
|
26
|
+
*/
|
|
27
|
+
confirm(options: ConfirmPromptOptions): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Password input prompt (masked)
|
|
30
|
+
*/
|
|
31
|
+
password(options: PasswordPromptOptions): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Prompt for server name with validation
|
|
34
|
+
*/
|
|
35
|
+
promptServerName(): Promise<ServerName>;
|
|
36
|
+
/**
|
|
37
|
+
* Prompt for server type selection
|
|
38
|
+
*/
|
|
39
|
+
promptServerType(): Promise<ServerType>;
|
|
40
|
+
/**
|
|
41
|
+
* Prompt for Minecraft version
|
|
42
|
+
*/
|
|
43
|
+
promptMcVersion(serverType: ServerType): Promise<McVersion>;
|
|
44
|
+
/**
|
|
45
|
+
* Prompt for memory allocation
|
|
46
|
+
*/
|
|
47
|
+
promptMemory(): Promise<Memory>;
|
|
48
|
+
/**
|
|
49
|
+
* Prompt for world options (new/existing/download)
|
|
50
|
+
*/
|
|
51
|
+
promptWorldOptions(): Promise<WorldOptions>;
|
|
52
|
+
/**
|
|
53
|
+
* Prompt for server selection from list
|
|
54
|
+
*/
|
|
55
|
+
promptServerSelection(servers: Server[]): Promise<Server>;
|
|
56
|
+
/**
|
|
57
|
+
* Prompt for world selection from list
|
|
58
|
+
*/
|
|
59
|
+
promptWorldSelection(worlds: World[]): Promise<World>;
|
|
60
|
+
/**
|
|
61
|
+
* Prompt for existing world selection with availability status
|
|
62
|
+
* Shows worlds categorized by: available, stopped server, running server
|
|
63
|
+
* @param worlds - List of worlds with their server status
|
|
64
|
+
* @returns Selected world or null if cancelled/no selection
|
|
65
|
+
*/
|
|
66
|
+
promptExistingWorldSelection(worlds: WorldWithServerStatus[]): Promise<World | null>;
|
|
67
|
+
/**
|
|
68
|
+
* Start a spinner with message
|
|
69
|
+
*/
|
|
70
|
+
spinner(): Spinner;
|
|
71
|
+
/**
|
|
72
|
+
* Display success message
|
|
73
|
+
*/
|
|
74
|
+
success(message: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* Display error message
|
|
77
|
+
*/
|
|
78
|
+
error(message: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Display warning message
|
|
81
|
+
*/
|
|
82
|
+
warn(message: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Display info message
|
|
85
|
+
*/
|
|
86
|
+
info(message: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* Display note
|
|
89
|
+
*/
|
|
90
|
+
note(message: string, title?: string): void;
|
|
91
|
+
/**
|
|
92
|
+
* Check if user cancelled
|
|
93
|
+
*/
|
|
94
|
+
isCancel(value: unknown): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Handle user cancellation
|
|
97
|
+
*/
|
|
98
|
+
handleCancel(): never;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Text prompt options
|
|
102
|
+
*/
|
|
103
|
+
export interface TextPromptOptions {
|
|
104
|
+
message: string;
|
|
105
|
+
placeholder?: string;
|
|
106
|
+
initialValue?: string;
|
|
107
|
+
validate?: (value: string) => string | void;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Select prompt options
|
|
111
|
+
*/
|
|
112
|
+
export interface SelectPromptOptions<T> {
|
|
113
|
+
message: string;
|
|
114
|
+
options: SelectOption<T>[];
|
|
115
|
+
initialValue?: T;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Select option
|
|
119
|
+
*/
|
|
120
|
+
export interface SelectOption<T> {
|
|
121
|
+
value: T;
|
|
122
|
+
label: string;
|
|
123
|
+
hint?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Confirm prompt options
|
|
127
|
+
*/
|
|
128
|
+
export interface ConfirmPromptOptions {
|
|
129
|
+
message: string;
|
|
130
|
+
initialValue?: boolean;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Password prompt options
|
|
134
|
+
*/
|
|
135
|
+
export interface PasswordPromptOptions {
|
|
136
|
+
message: string;
|
|
137
|
+
mask?: string;
|
|
138
|
+
validate?: (value: string) => string | void;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Spinner interface
|
|
142
|
+
*/
|
|
143
|
+
export interface Spinner {
|
|
144
|
+
start(message?: string): void;
|
|
145
|
+
stop(message?: string): void;
|
|
146
|
+
message(message: string): void;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=IPromptPort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPromptPort.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IPromptPort.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACN,YAAY,EACZ,MAAM,EACN,KAAK,EACN,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAK1B;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElD;;OAEG;IACH,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAEvD;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzD;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAM1D;;OAEG;IACH,gBAAgB,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAExC;;OAEG;IACH,gBAAgB,IAAI,OAAO,CAAC,UAAU,C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MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPromptPort.js","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IPromptPort.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Server, ServerStatus } from '../../../domain/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Server Repository Port - Outbound Port
|
|
4
|
+
* Interface for server data access
|
|
5
|
+
*/
|
|
6
|
+
export interface IServerRepository {
|
|
7
|
+
/**
|
|
8
|
+
* Get all servers
|
|
9
|
+
*/
|
|
10
|
+
findAll(): Promise<Server[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Find server by name
|
|
13
|
+
*/
|
|
14
|
+
findByName(name: string): Promise<Server | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Check if server exists
|
|
17
|
+
*/
|
|
18
|
+
exists(name: string): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Get server status
|
|
21
|
+
*/
|
|
22
|
+
getStatus(name: string): Promise<ServerStatus>;
|
|
23
|
+
/**
|
|
24
|
+
* Get server configuration from config.env
|
|
25
|
+
*/
|
|
26
|
+
getConfig(name: string): Promise<ServerConfigData | null>;
|
|
27
|
+
/**
|
|
28
|
+
* List server names
|
|
29
|
+
*/
|
|
30
|
+
listNames(): Promise<string[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Get running servers
|
|
33
|
+
*/
|
|
34
|
+
findRunning(): Promise<Server[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Get stopped servers
|
|
37
|
+
*/
|
|
38
|
+
findStopped(): Promise<Server[]>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Server configuration data from config.env
|
|
42
|
+
*/
|
|
43
|
+
export interface ServerConfigData {
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
46
|
+
version: string;
|
|
47
|
+
memory?: string;
|
|
48
|
+
rconPassword?: string;
|
|
49
|
+
seed?: string;
|
|
50
|
+
worldName?: string;
|
|
51
|
+
worldUrl?: string;
|
|
52
|
+
customEnv?: Record<string, string>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=IServerRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IServerRepository.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IServerRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE7B;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEjD;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAE/C;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAE1D;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE/B;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEjC;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IServerRepository.js","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IServerRepository.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ProcessInfo } from '../../../domain/value-objects/ProcessInfo.js';
|
|
2
|
+
/**
|
|
3
|
+
* Service start options
|
|
4
|
+
*/
|
|
5
|
+
export interface ServiceStartOptions {
|
|
6
|
+
/** Environment variables to pass to the service */
|
|
7
|
+
env?: Record<string, string>;
|
|
8
|
+
/** Working directory for the service */
|
|
9
|
+
cwd?: string;
|
|
10
|
+
/** Whether to wait for the service to be ready */
|
|
11
|
+
wait?: boolean;
|
|
12
|
+
/** Timeout in milliseconds when waiting */
|
|
13
|
+
waitTimeout?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Service stop options
|
|
17
|
+
*/
|
|
18
|
+
export interface ServiceStopOptions {
|
|
19
|
+
/** Force stop (SIGKILL) instead of graceful shutdown */
|
|
20
|
+
force?: boolean;
|
|
21
|
+
/** Timeout in milliseconds before force stop */
|
|
22
|
+
timeout?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Service restart options
|
|
26
|
+
*/
|
|
27
|
+
export interface ServiceRestartOptions extends ServiceStartOptions, ServiceStopOptions {
|
|
28
|
+
/** Update environment variables before restart */
|
|
29
|
+
updateEnv?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Service logs options
|
|
33
|
+
*/
|
|
34
|
+
export interface ServiceLogsOptions {
|
|
35
|
+
/** Number of lines to return */
|
|
36
|
+
lines?: number;
|
|
37
|
+
/** Return error logs instead of output logs */
|
|
38
|
+
err?: boolean;
|
|
39
|
+
/** Filter logs by timestamp (return logs after this date) */
|
|
40
|
+
since?: Date;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Service Manager Port - Outbound Port
|
|
44
|
+
* Interface for managing service processes (PM2, systemd, etc.)
|
|
45
|
+
*
|
|
46
|
+
* This port abstracts process management operations to allow
|
|
47
|
+
* different implementations (PM2, systemd, Docker, etc.)
|
|
48
|
+
*/
|
|
49
|
+
export interface IServiceManagerPort {
|
|
50
|
+
/**
|
|
51
|
+
* Start a service by name
|
|
52
|
+
* @param name - The service name as defined in ecosystem config
|
|
53
|
+
* @param options - Optional start configuration
|
|
54
|
+
* @throws Error if service not found or start fails
|
|
55
|
+
*/
|
|
56
|
+
start(name: string, options?: ServiceStartOptions): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Stop a service by name
|
|
59
|
+
* @param name - The service name
|
|
60
|
+
* @param options - Optional stop configuration
|
|
61
|
+
* @throws Error if service not found or stop fails
|
|
62
|
+
*/
|
|
63
|
+
stop(name: string, options?: ServiceStopOptions): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Restart a service by name
|
|
66
|
+
* @param name - The service name
|
|
67
|
+
* @param options - Optional restart configuration
|
|
68
|
+
* @throws Error if service not found or restart fails
|
|
69
|
+
*/
|
|
70
|
+
restart(name: string, options?: ServiceRestartOptions): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Get status of one or all services
|
|
73
|
+
* @param name - Optional service name. If not provided, returns all services
|
|
74
|
+
* @returns Array of process information
|
|
75
|
+
*/
|
|
76
|
+
status(name?: string): Promise<ProcessInfo[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Get logs for a service
|
|
79
|
+
* @param name - The service name
|
|
80
|
+
* @param options - Optional log retrieval options
|
|
81
|
+
* @returns Log content as string
|
|
82
|
+
*/
|
|
83
|
+
logs(name: string, options?: ServiceLogsOptions): Promise<string>;
|
|
84
|
+
/**
|
|
85
|
+
* Delete a service from the process manager
|
|
86
|
+
* @param name - The service name to delete
|
|
87
|
+
* @throws Error if service not found
|
|
88
|
+
*/
|
|
89
|
+
delete(name: string): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Reload ecosystem configuration
|
|
92
|
+
* @param configPath - Path to ecosystem config file
|
|
93
|
+
*/
|
|
94
|
+
reload(configPath: string): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Check if a service exists
|
|
97
|
+
* @param name - The service name
|
|
98
|
+
* @returns true if service is registered
|
|
99
|
+
*/
|
|
100
|
+
exists(name: string): Promise<boolean>;
|
|
101
|
+
/**
|
|
102
|
+
* Flush logs for a service
|
|
103
|
+
* @param name - The service name
|
|
104
|
+
*/
|
|
105
|
+
flush(name: string): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Save current process list (for restart persistence)
|
|
108
|
+
*/
|
|
109
|
+
save(): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Resurrect saved processes
|
|
112
|
+
*/
|
|
113
|
+
resurrect(): Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=IServiceManagerPort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IServiceManagerPort.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IServiceManagerPort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB,EAAE,kBAAkB;IACpF,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC7D,KAAK,CAAC,EA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ort.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { ServerName, ServerType, McVersion, WorldOptions, Memory } from '../../../domain/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Shell Port - Outbound Port
|
|
4
|
+
* Interface for shell script execution
|
|
5
|
+
*/
|
|
6
|
+
export interface IShellPort {
|
|
7
|
+
/**
|
|
8
|
+
* Create a new server
|
|
9
|
+
*/
|
|
10
|
+
createServer(name: ServerName, options: CreateServerOptions): Promise<ShellResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Delete a server
|
|
13
|
+
*/
|
|
14
|
+
deleteServer(name: ServerName, force?: boolean): Promise<ShellResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Start a server
|
|
17
|
+
*/
|
|
18
|
+
startServer(name: ServerName | string): Promise<ShellResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Stop a server
|
|
21
|
+
*/
|
|
22
|
+
stopServer(name: ServerName | string): Promise<ShellResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Get server status
|
|
25
|
+
*/
|
|
26
|
+
serverStatus(name: string): Promise<ShellResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Set server config value
|
|
29
|
+
*/
|
|
30
|
+
setServerConfig(serverName: string, key: string, value: string): Promise<ShellResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Get server logs
|
|
33
|
+
*/
|
|
34
|
+
logs(name: ServerName, options?: LogsOptions): Promise<ShellResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Connect to RCON console
|
|
37
|
+
*/
|
|
38
|
+
console(name: ServerName): Promise<ShellResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Get status of all servers
|
|
41
|
+
*/
|
|
42
|
+
status(json?: boolean): Promise<ShellResult>;
|
|
43
|
+
/**
|
|
44
|
+
* List worlds
|
|
45
|
+
*/
|
|
46
|
+
worldList(json?: boolean): Promise<ShellResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Assign world to server
|
|
49
|
+
*/
|
|
50
|
+
worldAssign(worldName: string, serverName: string, force?: boolean): Promise<ShellResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Release world lock
|
|
53
|
+
*/
|
|
54
|
+
worldRelease(worldName: string): Promise<ShellResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Lookup player
|
|
57
|
+
*/
|
|
58
|
+
playerLookup(name: string): Promise<ShellResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Get player UUID
|
|
61
|
+
*/
|
|
62
|
+
playerUuid(name: string, offline?: boolean): Promise<ShellResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Push backup
|
|
65
|
+
*/
|
|
66
|
+
backupPush(message?: string): Promise<ShellResult>;
|
|
67
|
+
/**
|
|
68
|
+
* Get backup status
|
|
69
|
+
*/
|
|
70
|
+
backupStatus(): Promise<ShellResult>;
|
|
71
|
+
/**
|
|
72
|
+
* Get backup history
|
|
73
|
+
*/
|
|
74
|
+
backupHistory(json?: boolean): Promise<ShellResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Restore from backup
|
|
77
|
+
*/
|
|
78
|
+
backupRestore(commitHash: string): Promise<ShellResult>;
|
|
79
|
+
/**
|
|
80
|
+
* Execute arbitrary script
|
|
81
|
+
*/
|
|
82
|
+
exec(script: string, args?: string[]): Promise<ShellResult>;
|
|
83
|
+
/**
|
|
84
|
+
* Execute script interactively
|
|
85
|
+
*/
|
|
86
|
+
execInteractive(script: string, args?: string[]): Promise<number>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Create server options
|
|
90
|
+
*/
|
|
91
|
+
export interface CreateServerOptions {
|
|
92
|
+
type: ServerType;
|
|
93
|
+
version: McVersion;
|
|
94
|
+
worldOptions: WorldOptions;
|
|
95
|
+
memory?: Memory;
|
|
96
|
+
autoStart?: boolean;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Logs options
|
|
100
|
+
*/
|
|
101
|
+
export interface LogsOptions {
|
|
102
|
+
follow?: boolean;
|
|
103
|
+
lines?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Shell execution result
|
|
107
|
+
*/
|
|
108
|
+
export interface ShellResult {
|
|
109
|
+
code: number;
|
|
110
|
+
stdout: string;
|
|
111
|
+
stderr: string;
|
|
112
|
+
success: boolean;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=IShellPort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IShellPort.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IShellPort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEnG;;;GAGG;AACH,MAAM,WAAW,UAAU;IAKzB;;OAEG;IACH,YAAY,CACV,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEtE;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE7D;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE5D;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEjD;;OAEG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEtF;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OA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,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,SAAS,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IShellPort.js","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IShellPort.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { User } from '../../../domain/entities/User.js';
|
|
2
|
+
import { UserId } from '../../../domain/value-objects/UserId.js';
|
|
3
|
+
import { Username } from '../../../domain/value-objects/Username.js';
|
|
4
|
+
/**
|
|
5
|
+
* User Repository Port - Outbound Port
|
|
6
|
+
* Interface for user data access
|
|
7
|
+
*/
|
|
8
|
+
export interface IUserRepository {
|
|
9
|
+
/**
|
|
10
|
+
* Find a user by their unique ID
|
|
11
|
+
* @param id - The user's unique identifier
|
|
12
|
+
* @returns The user if found, null otherwise
|
|
13
|
+
*/
|
|
14
|
+
findById(id: UserId): Promise<User | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Find a user by their username
|
|
17
|
+
* @param username - The username to search for
|
|
18
|
+
* @returns The user if found, null otherwise
|
|
19
|
+
*/
|
|
20
|
+
findByUsername(username: Username): Promise<User | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Get all users in the system
|
|
23
|
+
* @returns Array of all users
|
|
24
|
+
*/
|
|
25
|
+
findAll(): Promise<User[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Save a user (create or update)
|
|
28
|
+
* @param user - The user entity to save
|
|
29
|
+
*/
|
|
30
|
+
save(user: User): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Delete a user by their ID
|
|
33
|
+
* @param id - The user's unique identifier
|
|
34
|
+
*/
|
|
35
|
+
delete(id: UserId): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Get the total count of users
|
|
38
|
+
* @returns The number of users in the system
|
|
39
|
+
*/
|
|
40
|
+
count(): Promise<number>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=IUserRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUserRepository.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IUserRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAE3C;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAEzD;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAE3B;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhC;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUserRepository.js","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IUserRepository.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { World } from '../../../domain/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Server status for world availability
|
|
4
|
+
*/
|
|
5
|
+
export type ServerStatus = 'running' | 'stopped' | 'not_found';
|
|
6
|
+
/**
|
|
7
|
+
* World availability category
|
|
8
|
+
*/
|
|
9
|
+
export type WorldAvailabilityCategory = 'available' | 'stopped' | 'running';
|
|
10
|
+
/**
|
|
11
|
+
* World with server status information
|
|
12
|
+
*/
|
|
13
|
+
export interface WorldWithServerStatus {
|
|
14
|
+
world: World;
|
|
15
|
+
assignedServer?: string;
|
|
16
|
+
serverStatus?: ServerStatus;
|
|
17
|
+
category: WorldAvailabilityCategory;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* World Repository Port - Outbound Port
|
|
21
|
+
* Interface for world data access
|
|
22
|
+
*/
|
|
23
|
+
export interface IWorldRepository {
|
|
24
|
+
/**
|
|
25
|
+
* Get all worlds
|
|
26
|
+
*/
|
|
27
|
+
findAll(): Promise<World[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Find world by name
|
|
30
|
+
*/
|
|
31
|
+
findByName(name: string): Promise<World | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Check if world exists
|
|
34
|
+
*/
|
|
35
|
+
exists(name: string): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Get unlocked worlds
|
|
38
|
+
*/
|
|
39
|
+
findUnlocked(): Promise<World[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Get locked worlds
|
|
42
|
+
*/
|
|
43
|
+
findLocked(): Promise<World[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Get worlds locked by a specific server
|
|
46
|
+
*/
|
|
47
|
+
findByServer(serverName: string): Promise<World[]>;
|
|
48
|
+
/**
|
|
49
|
+
* List world names
|
|
50
|
+
*/
|
|
51
|
+
listNames(): Promise<string[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Get lock status for a world
|
|
54
|
+
*/
|
|
55
|
+
getLockStatus(name: string): Promise<WorldLockData | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Get all worlds with their server status
|
|
58
|
+
* Returns worlds categorized by availability
|
|
59
|
+
*/
|
|
60
|
+
findAllWithServerStatus(): Promise<WorldWithServerStatus[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Delete a world directory
|
|
63
|
+
* @param name World name to delete
|
|
64
|
+
* @returns true if deleted successfully
|
|
65
|
+
*/
|
|
66
|
+
delete(name: string): Promise<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* Create a new world directory with optional seed
|
|
69
|
+
* @param name World name to create
|
|
70
|
+
* @param seed Optional seed for world generation
|
|
71
|
+
* @returns Created World entity
|
|
72
|
+
*/
|
|
73
|
+
create(name: string, seed?: string): Promise<World>;
|
|
74
|
+
/**
|
|
75
|
+
* Get seed for a world from .meta file
|
|
76
|
+
* @param name World name
|
|
77
|
+
* @returns Seed string or null if not found
|
|
78
|
+
*/
|
|
79
|
+
getSeed(name: string): Promise<string | null>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* World lock data from lock file
|
|
83
|
+
*/
|
|
84
|
+
export interface WorldLockData {
|
|
85
|
+
worldName: string;
|
|
86
|
+
serverName: string;
|
|
87
|
+
timestamp: Date;
|
|
88
|
+
pid?: number;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=IWorldRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IWorldRepository.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IWorldRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,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,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEpD;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IWorldRepository.js","sourceRoot":"","sources":["../../../../src/application/ports/outbound/IWorldRepository.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { IPromptPort, TextPromptOptions, SelectPromptOptions, SelectOption, ConfirmPromptOptions, PasswordPromptOptions, Spinner, } from './IPromptPort.js';
|
|
2
|
+
export type { IShellPort, CreateServerOptions, LogsOptions, ShellResult, } from './IShellPort.js';
|
|
3
|
+
export type { IDocProvider, DocServerTypeInfo, DocEnvVarInfo, DocVersionInfo, DocMemoryInfo, } from './IDocProvider.js';
|
|
4
|
+
export type { IServerRepository, ServerConfigData, } from './IServerRepository.js';
|
|
5
|
+
export type { IWorldRepository, WorldLockData, WorldWithServerStatus, ServerStatus, WorldAvailabilityCategory, } from './IWorldRepository.js';
|
|
6
|
+
export type { IModSourcePort } from './IModSourcePort.js';
|
|
7
|
+
export type { IUserRepository } from './IUserRepository.js';
|
|
8
|
+
export type { IServiceManagerPort, ServiceStartOptions, ServiceStopOptions, ServiceRestartOptions, ServiceLogsOptions, } from './IServiceManagerPort.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/application/ports/outbound/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,GACR,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/application/ports/outbound/index.ts"],"names":[],"mappings":""}
|