@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,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* World lock status
|
|
3
|
+
*/
|
|
4
|
+
export var WorldLockStatus;
|
|
5
|
+
(function (WorldLockStatus) {
|
|
6
|
+
WorldLockStatus["UNLOCKED"] = "unlocked";
|
|
7
|
+
WorldLockStatus["LOCKED"] = "locked";
|
|
8
|
+
})(WorldLockStatus || (WorldLockStatus = {}));
|
|
9
|
+
/**
|
|
10
|
+
* World entity
|
|
11
|
+
* Represents a Minecraft world with lock management
|
|
12
|
+
*/
|
|
13
|
+
export class World {
|
|
14
|
+
_name;
|
|
15
|
+
_path;
|
|
16
|
+
_lockStatus;
|
|
17
|
+
_lock;
|
|
18
|
+
_sizeBytes;
|
|
19
|
+
_lastModified;
|
|
20
|
+
_seed;
|
|
21
|
+
constructor(name, path) {
|
|
22
|
+
this._name = name;
|
|
23
|
+
this._path = path;
|
|
24
|
+
this._lockStatus = WorldLockStatus.UNLOCKED;
|
|
25
|
+
}
|
|
26
|
+
get name() {
|
|
27
|
+
return this._name;
|
|
28
|
+
}
|
|
29
|
+
get path() {
|
|
30
|
+
return this._path;
|
|
31
|
+
}
|
|
32
|
+
get lockStatus() {
|
|
33
|
+
return this._lockStatus;
|
|
34
|
+
}
|
|
35
|
+
get lock() {
|
|
36
|
+
return this._lock;
|
|
37
|
+
}
|
|
38
|
+
get isLocked() {
|
|
39
|
+
return this._lockStatus === WorldLockStatus.LOCKED;
|
|
40
|
+
}
|
|
41
|
+
get isUnlocked() {
|
|
42
|
+
return this._lockStatus === WorldLockStatus.UNLOCKED;
|
|
43
|
+
}
|
|
44
|
+
get lockedBy() {
|
|
45
|
+
return this._lock?.serverName;
|
|
46
|
+
}
|
|
47
|
+
get sizeBytes() {
|
|
48
|
+
return this._sizeBytes;
|
|
49
|
+
}
|
|
50
|
+
get lastModified() {
|
|
51
|
+
return this._lastModified;
|
|
52
|
+
}
|
|
53
|
+
get seed() {
|
|
54
|
+
return this._seed;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get human-readable size
|
|
58
|
+
*/
|
|
59
|
+
get sizeFormatted() {
|
|
60
|
+
if (!this._sizeBytes)
|
|
61
|
+
return 'Unknown';
|
|
62
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
63
|
+
let size = this._sizeBytes;
|
|
64
|
+
let unitIndex = 0;
|
|
65
|
+
while (size >= 1024 && unitIndex < units.length - 1) {
|
|
66
|
+
size /= 1024;
|
|
67
|
+
unitIndex++;
|
|
68
|
+
}
|
|
69
|
+
return `${size.toFixed(1)}${units[unitIndex]}`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Lock the world to a server
|
|
73
|
+
*/
|
|
74
|
+
lockTo(serverName, pid) {
|
|
75
|
+
if (this._lockStatus === WorldLockStatus.LOCKED) {
|
|
76
|
+
throw new Error(`World '${this._name}' is already locked by '${this._lock?.serverName}'`);
|
|
77
|
+
}
|
|
78
|
+
this._lockStatus = WorldLockStatus.LOCKED;
|
|
79
|
+
this._lock = {
|
|
80
|
+
serverName,
|
|
81
|
+
timestamp: new Date(),
|
|
82
|
+
pid,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Release the lock
|
|
87
|
+
*/
|
|
88
|
+
release() {
|
|
89
|
+
this._lockStatus = WorldLockStatus.UNLOCKED;
|
|
90
|
+
this._lock = undefined;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Force release (for stale locks)
|
|
94
|
+
*/
|
|
95
|
+
forceRelease() {
|
|
96
|
+
this._lockStatus = WorldLockStatus.UNLOCKED;
|
|
97
|
+
this._lock = undefined;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Set world metadata
|
|
101
|
+
*/
|
|
102
|
+
setMetadata(sizeBytes, lastModified, seed) {
|
|
103
|
+
this._sizeBytes = sizeBytes;
|
|
104
|
+
this._lastModified = lastModified;
|
|
105
|
+
if (seed !== undefined) {
|
|
106
|
+
this._seed = seed;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Set world seed
|
|
111
|
+
*/
|
|
112
|
+
setSeed(seed) {
|
|
113
|
+
this._seed = seed;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Check if lock is stale (older than specified minutes)
|
|
117
|
+
*/
|
|
118
|
+
isLockStale(maxAgeMinutes = 60) {
|
|
119
|
+
if (!this._lock)
|
|
120
|
+
return false;
|
|
121
|
+
const now = new Date();
|
|
122
|
+
const lockAge = (now.getTime() - this._lock.timestamp.getTime()) / (1000 * 60);
|
|
123
|
+
return lockAge > maxAgeMinutes;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Create world from directory listing
|
|
127
|
+
*/
|
|
128
|
+
static fromDirectory(name, basePath) {
|
|
129
|
+
return new World(name, `${basePath}/${name}`);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Create world with lock status
|
|
133
|
+
*/
|
|
134
|
+
static withLock(name, path, serverName, timestamp, pid) {
|
|
135
|
+
const world = new World(name, path);
|
|
136
|
+
world._lockStatus = WorldLockStatus.LOCKED;
|
|
137
|
+
world._lock = { serverName, timestamp, pid };
|
|
138
|
+
return world;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=World.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"World.js","sourceRoot":"","sources":["../../../src/domain/entities/World.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;AACnB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAWD;;;GAGG;AACH,MAAM,OAAO,KAAK;IACC,KAAK,CAAS;IACd,KAAK,CAAS;IACvB,WAAW,CAAkB;IAC7B,KAAK,CAAa;IAClB,UAAU,CAAU;IACpB,aAAa,CAAQ;IACrB,KAAK,CAAU;IAEvB,YAAY,IAAY,EAAE,IAAY;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC;IAC9C,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,CAAC,MAAM,CAAC;IACrD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,CAAC,QAAQ,CAAC;IACvD,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC;IAChC,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QACf,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO,SAAS,CAAC;QAEvC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;QAC3B,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,OAAO,IAAI,IAAI,IAAI,IAAI,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpD,IAAI,IAAI,IAAI,CAAC;YACb,SAAS,EAAE,CAAC;QACd,CAAC;QAED,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAkB,EAAE,GAAY;QACrC,IAAI,IAAI,CAAC,WAAW,KAAK,eAAe,CAAC,MAAM,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CACb,UAAU,IAAI,CAAC,KAAK,2BAA2B,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,CACzE,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG;YACX,UAAU;YACV,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,GAAG;SACJ,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC;QAC5C,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,YAAY;QACV,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC;QAC5C,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,SAAiB,EAAE,YAAkB,EAAE,IAAa;QAC9D,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,gBAAwB,EAAE;QACpC,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAE9B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;QAC/E,OAAO,OAAO,GAAG,aAAa,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,IAAY,EAAE,QAAgB;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CACb,IAAY,EACZ,IAAY,EACZ,UAAkB,EAClB,SAAe,EACf,GAAY;QAEZ,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpC,KAAK,CAAC,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC;QAC3C,KAAK,CAAC,KAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;QAC7C,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAqB,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAkB,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,IAAI,EAAiB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ServerName, ServerType, ServerTypeEnum, type ServerTypeInfo, McVersion, Memory, WorldOptions, WorldSetupType, type WorldOptionsData, UserId, Username, Role, RoleEnum, ServiceStatus, ServiceStatusEnum, ProcessInfo, type ProcessInfoData, type ProcessMetrics, } from './value-objects/index.js';
|
|
2
|
+
export { Server, ServerStatus, type ServerConfig, World, WorldLockStatus, type WorldLock, User, type UserData, } from './entities/index.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,KAAK,cAAc,EACnB,SAAS,EACT,MAAM,EACN,YAAY,EACZ,cAAc,EACd,KAAK,gBAAgB,EACrB,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,QAAQ,EAER,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,MAAM,EACN,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,EACL,eAAe,EACf,KAAK,SAAS,EACd,IAAI,EACJ,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Value Objects
|
|
2
|
+
export { ServerName, ServerType, ServerTypeEnum, McVersion, Memory, WorldOptions, WorldSetupType, UserId, Username, Role, RoleEnum,
|
|
3
|
+
// Service management value objects
|
|
4
|
+
ServiceStatus, ServiceStatusEnum, ProcessInfo, } from './value-objects/index.js';
|
|
5
|
+
// Entities
|
|
6
|
+
export { Server, ServerStatus, World, WorldLockStatus, User, } from './entities/index.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EAEd,SAAS,EACT,MAAM,EACN,YAAY,EACZ,cAAc,EAEd,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,QAAQ;AACR,mCAAmC;AACnC,aAAa,EACb,iBAAiB,EACjB,WAAW,GAGZ,MAAM,0BAA0B,CAAC;AAElC,WAAW;AACX,OAAO,EACL,MAAM,EACN,YAAY,EAEZ,KAAK,EACL,eAAe,EAEf,IAAI,GAEL,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModDependency - Domain model for mod dependency
|
|
3
|
+
*/
|
|
4
|
+
import type { ModDependencyType } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a mod dependency relationship
|
|
7
|
+
*/
|
|
8
|
+
export interface ModDependency {
|
|
9
|
+
/** Project ID of the dependency */
|
|
10
|
+
projectId: string;
|
|
11
|
+
/** Project slug (if available) */
|
|
12
|
+
projectSlug?: string;
|
|
13
|
+
/** Dependency type */
|
|
14
|
+
dependencyType: ModDependencyType;
|
|
15
|
+
/** Specific version ID (if pinned) */
|
|
16
|
+
versionId?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ModDependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModDependency.d.ts","sourceRoot":"","sources":["../../../src/domain/mod/ModDependency.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAElB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,sBAAsB;IACtB,cAAc,EAAE,iBAAiB,CAAC;IAElC,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModDependency.js","sourceRoot":"","sources":["../../../src/domain/mod/ModDependency.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModFile - Domain model for downloadable mod file
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* File hash information
|
|
6
|
+
*/
|
|
7
|
+
export interface ModFileHashes {
|
|
8
|
+
sha1?: string;
|
|
9
|
+
sha512?: string;
|
|
10
|
+
md5?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents a downloadable mod file
|
|
14
|
+
*/
|
|
15
|
+
export interface ModFile {
|
|
16
|
+
/** Direct download URL */
|
|
17
|
+
url: string;
|
|
18
|
+
/** File name */
|
|
19
|
+
filename: string;
|
|
20
|
+
/** File size in bytes */
|
|
21
|
+
size: number;
|
|
22
|
+
/** File hashes for verification */
|
|
23
|
+
hashes: ModFileHashes;
|
|
24
|
+
/** Whether this is the primary file */
|
|
25
|
+
primary: boolean;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ModFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModFile.d.ts","sourceRoot":"","sources":["../../../src/domain/mod/ModFile.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IAEZ,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IAEjB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,mCAAmC;IACnC,MAAM,EAAE,aAAa,CAAC;IAEtB,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModFile.js","sourceRoot":"","sources":["../../../src/domain/mod/ModFile.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModProject - Domain model for mod/plugin project
|
|
3
|
+
*/
|
|
4
|
+
import type { ModSideSupport, ModProjectType } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a mod/plugin project from any source
|
|
7
|
+
*/
|
|
8
|
+
export interface ModProject {
|
|
9
|
+
/** Unique slug identifier */
|
|
10
|
+
slug: string;
|
|
11
|
+
/** Display title */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Short description */
|
|
14
|
+
description: string;
|
|
15
|
+
/** Total download count */
|
|
16
|
+
downloads: number;
|
|
17
|
+
/** Icon/logo URL */
|
|
18
|
+
iconUrl: string | null;
|
|
19
|
+
/** Server-side support requirement */
|
|
20
|
+
serverSide: ModSideSupport;
|
|
21
|
+
/** Client-side support requirement */
|
|
22
|
+
clientSide: ModSideSupport;
|
|
23
|
+
/** Project type */
|
|
24
|
+
projectType: ModProjectType;
|
|
25
|
+
/** Category tags */
|
|
26
|
+
categories: string[];
|
|
27
|
+
/** Author/owner name */
|
|
28
|
+
author: string;
|
|
29
|
+
/** License identifier */
|
|
30
|
+
license: string;
|
|
31
|
+
/** Source-specific project ID */
|
|
32
|
+
sourceId: string;
|
|
33
|
+
/** Source name (modrinth, curseforge, spiget) */
|
|
34
|
+
sourceName: string;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=ModProject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModProject.d.ts","sourceRoot":"","sources":["../../../src/domain/mod/ModProject.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IAEb,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IAEd,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;IAEpB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAElB,oBAAoB;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,sCAAsC;IACtC,UAAU,EAAE,cAAc,CAAC;IAE3B,sCAAsC;IACtC,UAAU,EAAE,cAAc,CAAC;IAE3B,mBAAmB;IACnB,WAAW,EAAE,cAAc,CAAC;IAE5B,oBAAoB;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IAErB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IAEf,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAEhB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IAEjB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModProject.js","sourceRoot":"","sources":["../../../src/domain/mod/ModProject.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModSearchResult - Domain model for search results
|
|
3
|
+
*/
|
|
4
|
+
import type { ModProject } from './ModProject.js';
|
|
5
|
+
/**
|
|
6
|
+
* Represents paginated search results
|
|
7
|
+
*/
|
|
8
|
+
export interface ModSearchResult {
|
|
9
|
+
/** Found projects */
|
|
10
|
+
hits: ModProject[];
|
|
11
|
+
/** Total number of matches */
|
|
12
|
+
totalHits: number;
|
|
13
|
+
/** Current offset */
|
|
14
|
+
offset: number;
|
|
15
|
+
/** Results per page */
|
|
16
|
+
limit: number;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ModSearchResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModSearchResult.d.ts","sourceRoot":"","sources":["../../../src/domain/mod/ModSearchResult.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,IAAI,EAAE,UAAU,EAAE,CAAC;IAEnB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAElB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IAEf,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModSearchResult.js","sourceRoot":"","sources":["../../../src/domain/mod/ModSearchResult.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModVersion - Domain model for mod version
|
|
3
|
+
*/
|
|
4
|
+
import type { ModVersionType } from './types.js';
|
|
5
|
+
import type { ModFile } from './ModFile.js';
|
|
6
|
+
import type { ModDependency } from './ModDependency.js';
|
|
7
|
+
/**
|
|
8
|
+
* Represents a specific version of a mod
|
|
9
|
+
*/
|
|
10
|
+
export interface ModVersion {
|
|
11
|
+
/** Version ID */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Parent project ID */
|
|
14
|
+
projectId: string;
|
|
15
|
+
/** Version display name */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Semantic version number */
|
|
18
|
+
versionNumber: string;
|
|
19
|
+
/** Release type */
|
|
20
|
+
versionType: ModVersionType;
|
|
21
|
+
/** Supported Minecraft versions */
|
|
22
|
+
gameVersions: string[];
|
|
23
|
+
/** Supported mod loaders */
|
|
24
|
+
loaders: string[];
|
|
25
|
+
/** Downloadable files */
|
|
26
|
+
files: ModFile[];
|
|
27
|
+
/** Dependencies */
|
|
28
|
+
dependencies: ModDependency[];
|
|
29
|
+
/** Download count for this version */
|
|
30
|
+
downloads: number;
|
|
31
|
+
/** Publication date (ISO string) */
|
|
32
|
+
datePublished: string;
|
|
33
|
+
/** Changelog (may be empty) */
|
|
34
|
+
changelog?: string;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=ModVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModVersion.d.ts","sourceRoot":"","sources":["../../../src/domain/mod/ModVersion.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,iBAAiB;IACjB,EAAE,EAAE,MAAM,CAAC;IAEX,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAElB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,aAAa,EAAE,MAAM,CAAC;IAEtB,mBAAmB;IACnB,WAAW,EAAE,cAAc,CAAC;IAE5B,mCAAmC;IACnC,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,yBAAyB;IACzB,KAAK,EAAE,OAAO,EAAE,CAAC;IAEjB,mBAAmB;IACnB,YAAY,EAAE,aAAa,EAAE,CAAC;IAE9B,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAElB,oCAAoC;IACpC,aAAa,EAAE,MAAM,CAAC;IAEtB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModVersion.js","sourceRoot":"","sources":["../../../src/domain/mod/ModVersion.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mod Domain Models
|
|
3
|
+
* Re-export all mod-related domain types
|
|
4
|
+
*/
|
|
5
|
+
export type { ModSideSupport, ModProjectType, ModVersionType, ModDependencyType, ModSearchIndex, ModSearchOptions, ModVersionOptions, } from './types.js';
|
|
6
|
+
export type { ModProject } from './ModProject.js';
|
|
7
|
+
export type { ModVersion } from './ModVersion.js';
|
|
8
|
+
export type { ModFile, ModFileHashes } from './ModFile.js';
|
|
9
|
+
export type { ModDependency } from './ModDependency.js';
|
|
10
|
+
export type { ModSearchResult } from './ModSearchResult.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/mod/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/mod/index.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mod Domain Types
|
|
3
|
+
* Common types and enums for mod management
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Side support for mods (client/server)
|
|
7
|
+
*/
|
|
8
|
+
export type ModSideSupport = 'required' | 'optional' | 'unsupported';
|
|
9
|
+
/**
|
|
10
|
+
* Project type
|
|
11
|
+
*/
|
|
12
|
+
export type ModProjectType = 'mod' | 'modpack' | 'resourcepack' | 'shader' | 'plugin';
|
|
13
|
+
/**
|
|
14
|
+
* Version release type
|
|
15
|
+
*/
|
|
16
|
+
export type ModVersionType = 'release' | 'beta' | 'alpha';
|
|
17
|
+
/**
|
|
18
|
+
* Dependency type
|
|
19
|
+
*/
|
|
20
|
+
export type ModDependencyType = 'required' | 'optional' | 'incompatible' | 'embedded';
|
|
21
|
+
/**
|
|
22
|
+
* Search result sort index
|
|
23
|
+
*/
|
|
24
|
+
export type ModSearchIndex = 'relevance' | 'downloads' | 'follows' | 'newest' | 'updated';
|
|
25
|
+
/**
|
|
26
|
+
* Search options
|
|
27
|
+
*/
|
|
28
|
+
export interface ModSearchOptions {
|
|
29
|
+
limit?: number;
|
|
30
|
+
offset?: number;
|
|
31
|
+
gameVersions?: string[];
|
|
32
|
+
loaders?: string[];
|
|
33
|
+
index?: ModSearchIndex;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Version filter options
|
|
37
|
+
*/
|
|
38
|
+
export interface ModVersionOptions {
|
|
39
|
+
gameVersions?: string[];
|
|
40
|
+
loaders?: string[];
|
|
41
|
+
featured?: boolean;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/domain/mod/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,SAAS,GAAG,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,UAAU,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1F;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/domain/mod/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* McVersion Value Object
|
|
3
|
+
* Represents a validated Minecraft version
|
|
4
|
+
*/
|
|
5
|
+
export declare class McVersion {
|
|
6
|
+
private readonly _value;
|
|
7
|
+
private readonly _major;
|
|
8
|
+
private readonly _minor;
|
|
9
|
+
private readonly _patch;
|
|
10
|
+
private constructor();
|
|
11
|
+
get value(): string;
|
|
12
|
+
get major(): number;
|
|
13
|
+
get minor(): number;
|
|
14
|
+
get patch(): number;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the recommended Java version for this Minecraft version
|
|
17
|
+
*/
|
|
18
|
+
get recommendedJavaVersion(): number;
|
|
19
|
+
/**
|
|
20
|
+
* Check if this version is compatible with Java version
|
|
21
|
+
*/
|
|
22
|
+
isCompatibleWithJava(javaVersion: number): boolean;
|
|
23
|
+
static create(value: string): McVersion;
|
|
24
|
+
static latest(): McVersion;
|
|
25
|
+
/**
|
|
26
|
+
* Compare versions
|
|
27
|
+
* Returns: negative if this < other, 0 if equal, positive if this > other
|
|
28
|
+
*/
|
|
29
|
+
compareTo(other: McVersion): number;
|
|
30
|
+
isNewerThan(other: McVersion): boolean;
|
|
31
|
+
isOlderThan(other: McVersion): boolean;
|
|
32
|
+
equals(other: McVersion): boolean;
|
|
33
|
+
toString(): string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=McVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McVersion.d.ts","sourceRoot":"","sources":["../../../src/domain/value-objects/McVersion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,SAAS;IAElB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,OAAO;IASP,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;OAEG;IACH,IAAI,sBAAsB,IAAI,MAAM,CAenC;IAED;;OAEG;IACH,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAIlD,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAsCvC,MAAM,CAAC,MAAM,IAAI,SAAS;IAI1B;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAenC,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAItC,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAItC,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAIjC,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* McVersion Value Object
|
|
3
|
+
* Represents a validated Minecraft version
|
|
4
|
+
*/
|
|
5
|
+
export class McVersion {
|
|
6
|
+
_value;
|
|
7
|
+
_major;
|
|
8
|
+
_minor;
|
|
9
|
+
_patch;
|
|
10
|
+
constructor(_value, _major, _minor, _patch) {
|
|
11
|
+
this._value = _value;
|
|
12
|
+
this._major = _major;
|
|
13
|
+
this._minor = _minor;
|
|
14
|
+
this._patch = _patch;
|
|
15
|
+
Object.freeze(this);
|
|
16
|
+
}
|
|
17
|
+
get value() {
|
|
18
|
+
return this._value;
|
|
19
|
+
}
|
|
20
|
+
get major() {
|
|
21
|
+
return this._major;
|
|
22
|
+
}
|
|
23
|
+
get minor() {
|
|
24
|
+
return this._minor;
|
|
25
|
+
}
|
|
26
|
+
get patch() {
|
|
27
|
+
return this._patch;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns the recommended Java version for this Minecraft version
|
|
31
|
+
*/
|
|
32
|
+
get recommendedJavaVersion() {
|
|
33
|
+
// Minecraft 1.21+ requires Java 21
|
|
34
|
+
if (this._major >= 1 && this._minor >= 21) {
|
|
35
|
+
return 21;
|
|
36
|
+
}
|
|
37
|
+
// Minecraft 1.18-1.20.x requires Java 17
|
|
38
|
+
if (this._major >= 1 && this._minor >= 18) {
|
|
39
|
+
return 17;
|
|
40
|
+
}
|
|
41
|
+
// Minecraft 1.17 requires Java 16
|
|
42
|
+
if (this._major >= 1 && this._minor === 17) {
|
|
43
|
+
return 16;
|
|
44
|
+
}
|
|
45
|
+
// Older versions use Java 8
|
|
46
|
+
return 8;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Check if this version is compatible with Java version
|
|
50
|
+
*/
|
|
51
|
+
isCompatibleWithJava(javaVersion) {
|
|
52
|
+
return javaVersion >= this.recommendedJavaVersion;
|
|
53
|
+
}
|
|
54
|
+
static create(value) {
|
|
55
|
+
const trimmed = value.trim();
|
|
56
|
+
// Special case for "LATEST"
|
|
57
|
+
if (trimmed.toUpperCase() === 'LATEST') {
|
|
58
|
+
return new McVersion('LATEST', 0, 0, 0);
|
|
59
|
+
}
|
|
60
|
+
// Parse semantic version: 1.21.1, 1.20, 1.19.4
|
|
61
|
+
const versionMatch = trimmed.match(/^(\d+)\.(\d+)(?:\.(\d+))?$/);
|
|
62
|
+
if (!versionMatch) {
|
|
63
|
+
throw new Error(`Invalid Minecraft version format: ${value}. Expected format: X.Y or X.Y.Z (e.g., 1.21 or 1.21.1)`);
|
|
64
|
+
}
|
|
65
|
+
const major = parseInt(versionMatch[1], 10);
|
|
66
|
+
const minor = parseInt(versionMatch[2], 10);
|
|
67
|
+
const patch = versionMatch[3] ? parseInt(versionMatch[3], 10) : 0;
|
|
68
|
+
// Minecraft versions start at 1.0
|
|
69
|
+
if (major < 1) {
|
|
70
|
+
throw new Error('Minecraft major version must be at least 1');
|
|
71
|
+
}
|
|
72
|
+
// Current versions are around 1.21, so limit to reasonable range
|
|
73
|
+
if (major === 1 && (minor < 0 || minor > 99)) {
|
|
74
|
+
throw new Error('Minecraft minor version must be between 0 and 99');
|
|
75
|
+
}
|
|
76
|
+
if (patch < 0 || patch > 99) {
|
|
77
|
+
throw new Error('Minecraft patch version must be between 0 and 99');
|
|
78
|
+
}
|
|
79
|
+
return new McVersion(trimmed, major, minor, patch);
|
|
80
|
+
}
|
|
81
|
+
static latest() {
|
|
82
|
+
return new McVersion('LATEST', 0, 0, 0);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Compare versions
|
|
86
|
+
* Returns: negative if this < other, 0 if equal, positive if this > other
|
|
87
|
+
*/
|
|
88
|
+
compareTo(other) {
|
|
89
|
+
// LATEST is always considered newest
|
|
90
|
+
if (this._value === 'LATEST' && other._value !== 'LATEST')
|
|
91
|
+
return 1;
|
|
92
|
+
if (this._value !== 'LATEST' && other._value === 'LATEST')
|
|
93
|
+
return -1;
|
|
94
|
+
if (this._value === 'LATEST' && other._value === 'LATEST')
|
|
95
|
+
return 0;
|
|
96
|
+
if (this._major !== other._major) {
|
|
97
|
+
return this._major - other._major;
|
|
98
|
+
}
|
|
99
|
+
if (this._minor !== other._minor) {
|
|
100
|
+
return this._minor - other._minor;
|
|
101
|
+
}
|
|
102
|
+
return this._patch - other._patch;
|
|
103
|
+
}
|
|
104
|
+
isNewerThan(other) {
|
|
105
|
+
return this.compareTo(other) > 0;
|
|
106
|
+
}
|
|
107
|
+
isOlderThan(other) {
|
|
108
|
+
return this.compareTo(other) < 0;
|
|
109
|
+
}
|
|
110
|
+
equals(other) {
|
|
111
|
+
return this._value === other._value;
|
|
112
|
+
}
|
|
113
|
+
toString() {
|
|
114
|
+
return this._value;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=McVersion.js.map
|