@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.
Files changed (261) 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 +97 -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/IModSourcePort.d.ts +71 -0
  42. package/dist/application/ports/outbound/IModSourcePort.d.ts.map +1 -0
  43. package/dist/application/ports/outbound/IModSourcePort.js +19 -0
  44. package/dist/application/ports/outbound/IModSourcePort.js.map +1 -0
  45. package/dist/application/ports/outbound/IPromptPort.d.ts +148 -0
  46. package/dist/application/ports/outbound/IPromptPort.d.ts.map +1 -0
  47. package/dist/application/ports/outbound/IPromptPort.js +2 -0
  48. package/dist/application/ports/outbound/IPromptPort.js.map +1 -0
  49. package/dist/application/ports/outbound/IServerRepository.d.ts +54 -0
  50. package/dist/application/ports/outbound/IServerRepository.d.ts.map +1 -0
  51. package/dist/application/ports/outbound/IServerRepository.js +2 -0
  52. package/dist/application/ports/outbound/IServerRepository.js.map +1 -0
  53. package/dist/application/ports/outbound/IServiceManagerPort.d.ts +115 -0
  54. package/dist/application/ports/outbound/IServiceManagerPort.d.ts.map +1 -0
  55. package/dist/application/ports/outbound/IServiceManagerPort.js +2 -0
  56. package/dist/application/ports/outbound/IServiceManagerPort.js.map +1 -0
  57. package/dist/application/ports/outbound/IShellPort.d.ts +114 -0
  58. package/dist/application/ports/outbound/IShellPort.d.ts.map +1 -0
  59. package/dist/application/ports/outbound/IShellPort.js +2 -0
  60. package/dist/application/ports/outbound/IShellPort.js.map +1 -0
  61. package/dist/application/ports/outbound/IUserRepository.d.ts +42 -0
  62. package/dist/application/ports/outbound/IUserRepository.d.ts.map +1 -0
  63. package/dist/application/ports/outbound/IUserRepository.js +2 -0
  64. package/dist/application/ports/outbound/IUserRepository.js.map +1 -0
  65. package/dist/application/ports/outbound/IWorldRepository.d.ts +90 -0
  66. package/dist/application/ports/outbound/IWorldRepository.d.ts.map +1 -0
  67. package/dist/application/ports/outbound/IWorldRepository.js +2 -0
  68. package/dist/application/ports/outbound/IWorldRepository.js.map +1 -0
  69. package/dist/application/ports/outbound/index.d.ts +9 -0
  70. package/dist/application/ports/outbound/index.d.ts.map +1 -0
  71. package/dist/application/ports/outbound/index.js +2 -0
  72. package/dist/application/ports/outbound/index.js.map +1 -0
  73. package/dist/application/use-cases/BackupUseCase.d.ts +35 -0
  74. package/dist/application/use-cases/BackupUseCase.d.ts.map +1 -0
  75. package/dist/application/use-cases/BackupUseCase.js +222 -0
  76. package/dist/application/use-cases/BackupUseCase.js.map +1 -0
  77. package/dist/application/use-cases/CreateServerUseCase.d.ts +22 -0
  78. package/dist/application/use-cases/CreateServerUseCase.d.ts.map +1 -0
  79. package/dist/application/use-cases/CreateServerUseCase.js +144 -0
  80. package/dist/application/use-cases/CreateServerUseCase.js.map +1 -0
  81. package/dist/application/use-cases/DeleteServerUseCase.d.ts +24 -0
  82. package/dist/application/use-cases/DeleteServerUseCase.d.ts.map +1 -0
  83. package/dist/application/use-cases/DeleteServerUseCase.js +108 -0
  84. package/dist/application/use-cases/DeleteServerUseCase.js.map +1 -0
  85. package/dist/application/use-cases/PlayerLookupUseCase.d.ts +23 -0
  86. package/dist/application/use-cases/PlayerLookupUseCase.d.ts.map +1 -0
  87. package/dist/application/use-cases/PlayerLookupUseCase.js +130 -0
  88. package/dist/application/use-cases/PlayerLookupUseCase.js.map +1 -0
  89. package/dist/application/use-cases/ServerStatusUseCase.d.ts +30 -0
  90. package/dist/application/use-cases/ServerStatusUseCase.d.ts.map +1 -0
  91. package/dist/application/use-cases/ServerStatusUseCase.js +117 -0
  92. package/dist/application/use-cases/ServerStatusUseCase.js.map +1 -0
  93. package/dist/application/use-cases/WorldManagementUseCase.d.ts +50 -0
  94. package/dist/application/use-cases/WorldManagementUseCase.d.ts.map +1 -0
  95. package/dist/application/use-cases/WorldManagementUseCase.js +571 -0
  96. package/dist/application/use-cases/WorldManagementUseCase.js.map +1 -0
  97. package/dist/application/use-cases/index.d.ts +7 -0
  98. package/dist/application/use-cases/index.d.ts.map +1 -0
  99. package/dist/application/use-cases/index.js +7 -0
  100. package/dist/application/use-cases/index.js.map +1 -0
  101. package/dist/docker/index.d.ts +125 -0
  102. package/dist/docker/index.d.ts.map +1 -0
  103. package/dist/docker/index.js +557 -0
  104. package/dist/docker/index.js.map +1 -0
  105. package/dist/domain/entities/Server.d.ts +77 -0
  106. package/dist/domain/entities/Server.d.ts.map +1 -0
  107. package/dist/domain/entities/Server.js +138 -0
  108. package/dist/domain/entities/Server.js.map +1 -0
  109. package/dist/domain/entities/User.d.ts +77 -0
  110. package/dist/domain/entities/User.d.ts.map +1 -0
  111. package/dist/domain/entities/User.js +121 -0
  112. package/dist/domain/entities/User.js.map +1 -0
  113. package/dist/domain/entities/World.d.ts +76 -0
  114. package/dist/domain/entities/World.d.ts.map +1 -0
  115. package/dist/domain/entities/World.js +141 -0
  116. package/dist/domain/entities/World.js.map +1 -0
  117. package/dist/domain/entities/index.d.ts +4 -0
  118. package/dist/domain/entities/index.d.ts.map +1 -0
  119. package/dist/domain/entities/index.js +4 -0
  120. package/dist/domain/entities/index.js.map +1 -0
  121. package/dist/domain/index.d.ts +3 -0
  122. package/dist/domain/index.d.ts.map +1 -0
  123. package/dist/domain/index.js +7 -0
  124. package/dist/domain/index.js.map +1 -0
  125. package/dist/domain/mod/ModDependency.d.ts +18 -0
  126. package/dist/domain/mod/ModDependency.d.ts.map +1 -0
  127. package/dist/domain/mod/ModDependency.js +5 -0
  128. package/dist/domain/mod/ModDependency.js.map +1 -0
  129. package/dist/domain/mod/ModFile.d.ts +27 -0
  130. package/dist/domain/mod/ModFile.d.ts.map +1 -0
  131. package/dist/domain/mod/ModFile.js +5 -0
  132. package/dist/domain/mod/ModFile.js.map +1 -0
  133. package/dist/domain/mod/ModProject.d.ts +36 -0
  134. package/dist/domain/mod/ModProject.d.ts.map +1 -0
  135. package/dist/domain/mod/ModProject.js +5 -0
  136. package/dist/domain/mod/ModProject.js.map +1 -0
  137. package/dist/domain/mod/ModSearchResult.d.ts +18 -0
  138. package/dist/domain/mod/ModSearchResult.d.ts.map +1 -0
  139. package/dist/domain/mod/ModSearchResult.js +5 -0
  140. package/dist/domain/mod/ModSearchResult.js.map +1 -0
  141. package/dist/domain/mod/ModVersion.d.ts +36 -0
  142. package/dist/domain/mod/ModVersion.d.ts.map +1 -0
  143. package/dist/domain/mod/ModVersion.js +5 -0
  144. package/dist/domain/mod/ModVersion.js.map +1 -0
  145. package/dist/domain/mod/index.d.ts +11 -0
  146. package/dist/domain/mod/index.d.ts.map +1 -0
  147. package/dist/domain/mod/index.js +6 -0
  148. package/dist/domain/mod/index.js.map +1 -0
  149. package/dist/domain/mod/types.d.ts +43 -0
  150. package/dist/domain/mod/types.d.ts.map +1 -0
  151. package/dist/domain/mod/types.js +6 -0
  152. package/dist/domain/mod/types.js.map +1 -0
  153. package/dist/domain/value-objects/McVersion.d.ts +35 -0
  154. package/dist/domain/value-objects/McVersion.d.ts.map +1 -0
  155. package/dist/domain/value-objects/McVersion.js +117 -0
  156. package/dist/domain/value-objects/McVersion.js.map +1 -0
  157. package/dist/domain/value-objects/Memory.d.ts +37 -0
  158. package/dist/domain/value-objects/Memory.d.ts.map +1 -0
  159. package/dist/domain/value-objects/Memory.js +107 -0
  160. package/dist/domain/value-objects/Memory.js.map +1 -0
  161. package/dist/domain/value-objects/ProcessInfo.d.ts +99 -0
  162. package/dist/domain/value-objects/ProcessInfo.d.ts.map +1 -0
  163. package/dist/domain/value-objects/ProcessInfo.js +171 -0
  164. package/dist/domain/value-objects/ProcessInfo.js.map +1 -0
  165. package/dist/domain/value-objects/Role.d.ts +41 -0
  166. package/dist/domain/value-objects/Role.d.ts.map +1 -0
  167. package/dist/domain/value-objects/Role.js +66 -0
  168. package/dist/domain/value-objects/Role.js.map +1 -0
  169. package/dist/domain/value-objects/ServerName.d.ts +21 -0
  170. package/dist/domain/value-objects/ServerName.d.ts.map +1 -0
  171. package/dist/domain/value-objects/ServerName.js +58 -0
  172. package/dist/domain/value-objects/ServerName.js.map +1 -0
  173. package/dist/domain/value-objects/ServerType.d.ts +40 -0
  174. package/dist/domain/value-objects/ServerType.d.ts.map +1 -0
  175. package/dist/domain/value-objects/ServerType.js +136 -0
  176. package/dist/domain/value-objects/ServerType.js.map +1 -0
  177. package/dist/domain/value-objects/ServiceStatus.d.ts +64 -0
  178. package/dist/domain/value-objects/ServiceStatus.d.ts.map +1 -0
  179. package/dist/domain/value-objects/ServiceStatus.js +99 -0
  180. package/dist/domain/value-objects/ServiceStatus.js.map +1 -0
  181. package/dist/domain/value-objects/UserId.d.ts +21 -0
  182. package/dist/domain/value-objects/UserId.d.ts.map +1 -0
  183. package/dist/domain/value-objects/UserId.js +43 -0
  184. package/dist/domain/value-objects/UserId.js.map +1 -0
  185. package/dist/domain/value-objects/Username.d.ts +16 -0
  186. package/dist/domain/value-objects/Username.d.ts.map +1 -0
  187. package/dist/domain/value-objects/Username.js +46 -0
  188. package/dist/domain/value-objects/Username.js.map +1 -0
  189. package/dist/domain/value-objects/WorldOptions.d.ts +49 -0
  190. package/dist/domain/value-objects/WorldOptions.d.ts.map +1 -0
  191. package/dist/domain/value-objects/WorldOptions.js +149 -0
  192. package/dist/domain/value-objects/WorldOptions.js.map +1 -0
  193. package/dist/domain/value-objects/index.d.ts +11 -0
  194. package/dist/domain/value-objects/index.d.ts.map +1 -0
  195. package/dist/domain/value-objects/index.js +13 -0
  196. package/dist/domain/value-objects/index.js.map +1 -0
  197. package/dist/index.d.ts +9 -0
  198. package/dist/index.d.ts.map +1 -0
  199. package/dist/index.js +21 -0
  200. package/dist/index.js.map +1 -0
  201. package/dist/infrastructure/adapters/ApiPromptAdapter.d.ts +115 -0
  202. package/dist/infrastructure/adapters/ApiPromptAdapter.d.ts.map +1 -0
  203. package/dist/infrastructure/adapters/ApiPromptAdapter.js +268 -0
  204. package/dist/infrastructure/adapters/ApiPromptAdapter.js.map +1 -0
  205. package/dist/infrastructure/adapters/DocsAdapter.d.ts +45 -0
  206. package/dist/infrastructure/adapters/DocsAdapter.d.ts.map +1 -0
  207. package/dist/infrastructure/adapters/DocsAdapter.js +490 -0
  208. package/dist/infrastructure/adapters/DocsAdapter.js.map +1 -0
  209. package/dist/infrastructure/adapters/ServerRepository.d.ts +49 -0
  210. package/dist/infrastructure/adapters/ServerRepository.d.ts.map +1 -0
  211. package/dist/infrastructure/adapters/ServerRepository.js +206 -0
  212. package/dist/infrastructure/adapters/ServerRepository.js.map +1 -0
  213. package/dist/infrastructure/adapters/ShellAdapter.d.ts +41 -0
  214. package/dist/infrastructure/adapters/ShellAdapter.d.ts.map +1 -0
  215. package/dist/infrastructure/adapters/ShellAdapter.js +198 -0
  216. package/dist/infrastructure/adapters/ShellAdapter.js.map +1 -0
  217. package/dist/infrastructure/adapters/SqliteUserRepository.d.ts +70 -0
  218. package/dist/infrastructure/adapters/SqliteUserRepository.d.ts.map +1 -0
  219. package/dist/infrastructure/adapters/SqliteUserRepository.js +149 -0
  220. package/dist/infrastructure/adapters/SqliteUserRepository.js.map +1 -0
  221. package/dist/infrastructure/adapters/WorldRepository.d.ts +67 -0
  222. package/dist/infrastructure/adapters/WorldRepository.d.ts.map +1 -0
  223. package/dist/infrastructure/adapters/WorldRepository.js +283 -0
  224. package/dist/infrastructure/adapters/WorldRepository.js.map +1 -0
  225. package/dist/infrastructure/adapters/YamlUserRepository.d.ts +67 -0
  226. package/dist/infrastructure/adapters/YamlUserRepository.d.ts.map +1 -0
  227. package/dist/infrastructure/adapters/YamlUserRepository.js +161 -0
  228. package/dist/infrastructure/adapters/YamlUserRepository.js.map +1 -0
  229. package/dist/infrastructure/adapters/index.d.ts +12 -0
  230. package/dist/infrastructure/adapters/index.d.ts.map +1 -0
  231. package/dist/infrastructure/adapters/index.js +12 -0
  232. package/dist/infrastructure/adapters/index.js.map +1 -0
  233. package/dist/infrastructure/config/Pm2EcosystemConfig.d.ts +192 -0
  234. package/dist/infrastructure/config/Pm2EcosystemConfig.d.ts.map +1 -0
  235. package/dist/infrastructure/config/Pm2EcosystemConfig.js +48 -0
  236. package/dist/infrastructure/config/Pm2EcosystemConfig.js.map +1 -0
  237. package/dist/infrastructure/config/index.d.ts +6 -0
  238. package/dist/infrastructure/config/index.d.ts.map +1 -0
  239. package/dist/infrastructure/config/index.js +6 -0
  240. package/dist/infrastructure/config/index.js.map +1 -0
  241. package/dist/infrastructure/factories/ModSourceFactory.d.ts +73 -0
  242. package/dist/infrastructure/factories/ModSourceFactory.d.ts.map +1 -0
  243. package/dist/infrastructure/factories/ModSourceFactory.js +98 -0
  244. package/dist/infrastructure/factories/ModSourceFactory.js.map +1 -0
  245. package/dist/infrastructure/factories/index.d.ts +5 -0
  246. package/dist/infrastructure/factories/index.d.ts.map +1 -0
  247. package/dist/infrastructure/factories/index.js +5 -0
  248. package/dist/infrastructure/factories/index.js.map +1 -0
  249. package/dist/infrastructure/index.d.ts +7 -0
  250. package/dist/infrastructure/index.d.ts.map +1 -0
  251. package/dist/infrastructure/index.js +7 -0
  252. package/dist/infrastructure/index.js.map +1 -0
  253. package/dist/types/index.d.ts +151 -0
  254. package/dist/types/index.d.ts.map +1 -0
  255. package/dist/types/index.js +2 -0
  256. package/dist/types/index.js.map +1 -0
  257. package/dist/utils/index.d.ts +81 -0
  258. package/dist/utils/index.d.ts.map +1 -0
  259. package/dist/utils/index.js +200 -0
  260. package/dist/utils/index.js.map +1 -0
  261. package/package.json +10 -2
@@ -0,0 +1,161 @@
1
+ import { readFile, writeFile, mkdir } from 'node:fs/promises';
2
+ import { dirname } from 'node:path';
3
+ import { existsSync } from 'node:fs';
4
+ import * as yaml from 'js-yaml';
5
+ import * as bcrypt from 'bcryptjs';
6
+ import { User } from '../../domain/entities/User.js';
7
+ /**
8
+ * YamlUserRepository
9
+ * Implements IUserRepository using YAML file storage
10
+ */
11
+ export class YamlUserRepository {
12
+ static SALT_ROUNDS = 10;
13
+ filePath;
14
+ /**
15
+ * Create a new YamlUserRepository
16
+ * @param filePath - Path to the YAML file for user storage
17
+ */
18
+ constructor(filePath) {
19
+ this.filePath = filePath;
20
+ }
21
+ /**
22
+ * Find a user by their unique ID
23
+ */
24
+ async findById(id) {
25
+ const users = await this.loadUsers();
26
+ const userData = users.find((u) => u.id === id.value);
27
+ if (!userData) {
28
+ return null;
29
+ }
30
+ return this.toUser(userData);
31
+ }
32
+ /**
33
+ * Find a user by their username
34
+ */
35
+ async findByUsername(username) {
36
+ const users = await this.loadUsers();
37
+ // Case-insensitive username comparison
38
+ const userData = users.find((u) => u.username.toLowerCase() === username.value.toLowerCase());
39
+ if (!userData) {
40
+ return null;
41
+ }
42
+ return this.toUser(userData);
43
+ }
44
+ /**
45
+ * Get all users in the system
46
+ */
47
+ async findAll() {
48
+ const users = await this.loadUsers();
49
+ return users.map((u) => this.toUser(u));
50
+ }
51
+ /**
52
+ * Save a user (create or update)
53
+ */
54
+ async save(user) {
55
+ const users = await this.loadUsers();
56
+ const existingIndex = users.findIndex((u) => u.id === user.id.value);
57
+ const userData = {
58
+ id: user.id.value,
59
+ username: user.username.value,
60
+ passwordHash: user.passwordHash,
61
+ role: user.role.value,
62
+ createdAt: user.createdAt.toISOString(),
63
+ updatedAt: user.updatedAt.toISOString(),
64
+ };
65
+ if (existingIndex >= 0) {
66
+ // Update existing user
67
+ users[existingIndex] = userData;
68
+ }
69
+ else {
70
+ // Add new user
71
+ users.push(userData);
72
+ }
73
+ await this.saveUsers(users);
74
+ }
75
+ /**
76
+ * Delete a user by their ID
77
+ */
78
+ async delete(id) {
79
+ const users = await this.loadUsers();
80
+ const filteredUsers = users.filter((u) => u.id !== id.value);
81
+ if (filteredUsers.length !== users.length) {
82
+ await this.saveUsers(filteredUsers);
83
+ }
84
+ }
85
+ /**
86
+ * Get the total count of users
87
+ */
88
+ async count() {
89
+ const users = await this.loadUsers();
90
+ return users.length;
91
+ }
92
+ /**
93
+ * Hash a password using bcrypt
94
+ * @param password - Plain text password to hash
95
+ * @returns Hashed password
96
+ */
97
+ async hashPassword(password) {
98
+ return bcrypt.hash(password, YamlUserRepository.SALT_ROUNDS);
99
+ }
100
+ /**
101
+ * Verify a password against a hash
102
+ * @param password - Plain text password to verify
103
+ * @param hash - Password hash to verify against
104
+ * @returns True if password matches, false otherwise
105
+ */
106
+ async verifyPassword(password, hash) {
107
+ return bcrypt.compare(password, hash);
108
+ }
109
+ /**
110
+ * Load users from YAML file
111
+ */
112
+ async loadUsers() {
113
+ if (!existsSync(this.filePath)) {
114
+ return [];
115
+ }
116
+ try {
117
+ const content = await readFile(this.filePath, 'utf-8');
118
+ const data = yaml.load(content);
119
+ if (!data || !Array.isArray(data.users)) {
120
+ return [];
121
+ }
122
+ return data.users;
123
+ }
124
+ catch {
125
+ // If file is empty or invalid, return empty array
126
+ return [];
127
+ }
128
+ }
129
+ /**
130
+ * Save users to YAML file
131
+ */
132
+ async saveUsers(users) {
133
+ // Ensure directory exists
134
+ const dir = dirname(this.filePath);
135
+ if (!existsSync(dir)) {
136
+ await mkdir(dir, { recursive: true });
137
+ }
138
+ const data = { users };
139
+ const yamlContent = yaml.dump(data, {
140
+ indent: 2,
141
+ lineWidth: -1, // No line wrapping
142
+ quotingType: '"',
143
+ forceQuotes: false,
144
+ });
145
+ await writeFile(this.filePath, yamlContent, 'utf-8');
146
+ }
147
+ /**
148
+ * Convert YAML user data to User entity
149
+ */
150
+ toUser(data) {
151
+ return User.fromRaw({
152
+ id: data.id,
153
+ username: data.username,
154
+ passwordHash: data.passwordHash,
155
+ role: data.role,
156
+ createdAt: data.createdAt,
157
+ updatedAt: data.updatedAt,
158
+ });
159
+ }
160
+ }
161
+ //# sourceMappingURL=YamlUserRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YamlUserRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/adapters/YamlUserRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAoBrD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IACrB,MAAM,CAAU,WAAW,GAAG,EAAE,CAAC;IACxB,QAAQ,CAAS;IAElC;;;OAGG;IACH,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;QAEtD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,QAAkB;QACrC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAA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;SAC1B,CAAC,CAAC;IACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Infrastructure Adapters
3
+ * Concrete implementations of application ports
4
+ */
5
+ export { ShellAdapter, type ShellAdapterOptions } from './ShellAdapter.js';
6
+ export { ServerRepository } from './ServerRepository.js';
7
+ export { WorldRepository } from './WorldRepository.js';
8
+ export { DocsAdapter } from './DocsAdapter.js';
9
+ export { YamlUserRepository } from './YamlUserRepository.js';
10
+ export { SqliteUserRepository } from './SqliteUserRepository.js';
11
+ export { ApiPromptAdapter, ApiModeError, type ApiPromptOptions, type WorldSetupType, type MessageType, type CollectedMessage, } from './ApiPromptAdapter.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/adapters/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Infrastructure Adapters
3
+ * Concrete implementations of application ports
4
+ */
5
+ export { ShellAdapter } from './ShellAdapter.js';
6
+ export { ServerRepository } from './ServerRepository.js';
7
+ export { WorldRepository } from './WorldRepository.js';
8
+ export { DocsAdapter } from './DocsAdapter.js';
9
+ export { YamlUserRepository } from './YamlUserRepository.js';
10
+ export { SqliteUserRepository } from './SqliteUserRepository.js';
11
+ export { ApiPromptAdapter, ApiModeError, } from './ApiPromptAdapter.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/adapters/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAA4B,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,YAAY,GAKb,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,192 @@
1
+ /**
2
+ * PM2 Ecosystem Configuration Types
3
+ * Based on PM2 ecosystem.config.js specification
4
+ * @see https://pm2.keymetrics.io/docs/usage/application-declaration/
5
+ */
6
+ /**
7
+ * PM2 execution mode
8
+ */
9
+ export type Pm2ExecMode = 'fork' | 'cluster';
10
+ /**
11
+ * PM2 interpreter type
12
+ */
13
+ export type Pm2Interpreter = 'node' | 'bash' | 'python' | 'python3' | 'ruby' | 'perl' | string;
14
+ /**
15
+ * PM2 log configuration
16
+ */
17
+ export interface IPm2LogConfig {
18
+ /** Output log file path */
19
+ output?: string;
20
+ /** Error log file path */
21
+ error?: string;
22
+ /** Combined log file path */
23
+ log?: string;
24
+ /** Log date format */
25
+ logDateFormat?: string;
26
+ /** Merge logs from different instances */
27
+ mergeLogs?: boolean;
28
+ }
29
+ /**
30
+ * PM2 restart strategy
31
+ */
32
+ export interface IPm2RestartConfig {
33
+ /** Delay between restart (ms) */
34
+ restartDelay?: number;
35
+ /** Maximum restarts within exponential backoff window */
36
+ maxRestarts?: number;
37
+ /** Minimum uptime to be considered started (ms) */
38
+ minUptime?: number;
39
+ /** Maximum memory before restart */
40
+ maxMemoryRestart?: string;
41
+ /** Enable exponential backoff restart */
42
+ expBackoffRestartDelay?: number;
43
+ }
44
+ /**
45
+ * PM2 watch configuration
46
+ */
47
+ export interface IPm2WatchConfig {
48
+ /** Enable watching */
49
+ watch?: boolean | string[];
50
+ /** Paths to ignore for watching */
51
+ ignoreWatch?: string[];
52
+ /** Watch options passed to chokidar */
53
+ watchOptions?: {
54
+ usePolling?: boolean;
55
+ interval?: number;
56
+ };
57
+ }
58
+ /**
59
+ * PM2 application configuration
60
+ * Defines a single application/service in PM2
61
+ */
62
+ export interface IPm2AppConfig {
63
+ /** Application name (required) */
64
+ name: string;
65
+ /** Script path to run (required) */
66
+ script: string;
67
+ /** Working directory */
68
+ cwd?: string;
69
+ /** Script arguments */
70
+ args?: string | string[];
71
+ /** Interpreter to use */
72
+ interpreter?: Pm2Interpreter;
73
+ /** Interpreter arguments */
74
+ interpreterArgs?: string | string[];
75
+ /** Node.js arguments (alias for interpreterArgs when using node) */
76
+ nodeArgs?: string | string[];
77
+ /** Number of instances (cluster mode) */
78
+ instances?: number | 'max';
79
+ /** Execution mode: 'fork' or 'cluster' */
80
+ execMode?: Pm2ExecMode;
81
+ /** Environment variables */
82
+ env?: Record<string, string>;
83
+ /** Production environment variables */
84
+ envProduction?: Record<string, string>;
85
+ /** Development environment variables */
86
+ envDevelopment?: Record<string, string>;
87
+ /** Log configuration */
88
+ logConfig?: IPm2LogConfig;
89
+ /** Output log file path (shorthand) */
90
+ output?: string;
91
+ /** Error log file path (shorthand) */
92
+ error?: string;
93
+ /** Combined log file path (shorthand) */
94
+ log?: string;
95
+ /** Log date format */
96
+ logDateFormat?: string;
97
+ /** Merge logs from different instances */
98
+ mergeLogs?: boolean;
99
+ /** Restart configuration */
100
+ restartConfig?: IPm2RestartConfig;
101
+ /** Delay between restart (ms, shorthand) */
102
+ restartDelay?: number;
103
+ /** Maximum restarts within exponential backoff window (shorthand) */
104
+ maxRestarts?: number;
105
+ /** Minimum uptime to be considered started (ms, shorthand) */
106
+ minUptime?: number;
107
+ /** Maximum memory before restart (shorthand) */
108
+ maxMemoryRestart?: string;
109
+ /** Enable exponential backoff restart (shorthand) */
110
+ expBackoffRestartDelay?: number;
111
+ /** Watch configuration */
112
+ watchConfig?: IPm2WatchConfig;
113
+ /** Enable watching (shorthand) */
114
+ watch?: boolean | string[];
115
+ /** Paths to ignore for watching (shorthand) */
116
+ ignoreWatch?: string[];
117
+ /** Auto restart on crash */
118
+ autorestart?: boolean;
119
+ /** Cron pattern for scheduled restart */
120
+ cron?: string;
121
+ /** Enable listening on a port */
122
+ listenTimeout?: number;
123
+ /** Kill timeout (ms) */
124
+ killTimeout?: number;
125
+ /** Wait ready signal (process.send('ready')) */
126
+ waitReady?: boolean;
127
+ /** Source map support */
128
+ sourceMapSupport?: boolean;
129
+ /** Instance variable name for environment */
130
+ instanceVar?: string;
131
+ /** Filter environment variables */
132
+ filterEnv?: string[];
133
+ /** Additional raw PM2 options */
134
+ [key: string]: unknown;
135
+ }
136
+ /**
137
+ * PM2 Ecosystem Configuration
138
+ * Defines the complete ecosystem.config.js structure
139
+ */
140
+ export interface IPm2EcosystemConfig {
141
+ /** List of applications */
142
+ apps: IPm2AppConfig[];
143
+ /** Deploy configuration (optional) */
144
+ deploy?: Record<string, IPm2DeployConfig>;
145
+ }
146
+ /**
147
+ * PM2 Deploy Configuration
148
+ * For deployment targets
149
+ */
150
+ export interface IPm2DeployConfig {
151
+ /** User to use for SSH */
152
+ user: string;
153
+ /** Host(s) to deploy to */
154
+ host: string | string[];
155
+ /** SSH port */
156
+ port?: number;
157
+ /** Git repository URL */
158
+ repo: string;
159
+ /** Git reference to deploy */
160
+ ref: string;
161
+ /** Path on remote server */
162
+ path: string;
163
+ /** SSH key path */
164
+ key?: string;
165
+ /** Pre-setup commands */
166
+ preSetup?: string;
167
+ /** Post-setup commands */
168
+ postSetup?: string;
169
+ /** Pre-deploy commands (local) */
170
+ preDeploy?: string;
171
+ /** Post-deploy commands (remote) */
172
+ postDeploy?: string;
173
+ /** Environment variables */
174
+ env?: Record<string, string>;
175
+ }
176
+ /**
177
+ * Create a minimal PM2 app configuration
178
+ */
179
+ export declare function createPm2AppConfig(name: string, script: string, options?: Partial<Omit<IPm2AppConfig, 'name' | 'script'>>): IPm2AppConfig;
180
+ /**
181
+ * Create a PM2 ecosystem configuration
182
+ */
183
+ export declare function createPm2EcosystemConfig(apps: IPm2AppConfig[], deploy?: Record<string, IPm2DeployConfig>): IPm2EcosystemConfig;
184
+ /**
185
+ * Default PM2 app configuration values
186
+ */
187
+ export declare const PM2_APP_DEFAULTS: Partial<IPm2AppConfig>;
188
+ /**
189
+ * Merge app config with defaults
190
+ */
191
+ export declare function withPm2Defaults(config: IPm2AppConfig): IPm2AppConfig;
192
+ //# sourceMappingURL=Pm2EcosystemConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pm2EcosystemConfig.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/config/Pm2EcosystemConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,SAA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AO,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,GACxD,aAAa,CAMf;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,aAAa,EAAE,EACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GACxC,mBAAmB,CAKrB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,aAAa,CAU1C,CAAC;AAEX;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAKpE"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * PM2 Ecosystem Configuration Types
3
+ * Based on PM2 ecosystem.config.js specification
4
+ * @see https://pm2.keymetrics.io/docs/usage/application-declaration/
5
+ */
6
+ /**
7
+ * Create a minimal PM2 app configuration
8
+ */
9
+ export function createPm2AppConfig(name, script, options) {
10
+ return {
11
+ name,
12
+ script,
13
+ ...options,
14
+ };
15
+ }
16
+ /**
17
+ * Create a PM2 ecosystem configuration
18
+ */
19
+ export function createPm2EcosystemConfig(apps, deploy) {
20
+ return {
21
+ apps,
22
+ ...(deploy && { deploy }),
23
+ };
24
+ }
25
+ /**
26
+ * Default PM2 app configuration values
27
+ */
28
+ export const PM2_APP_DEFAULTS = {
29
+ interpreter: 'node',
30
+ execMode: 'fork',
31
+ instances: 1,
32
+ autorestart: true,
33
+ maxRestarts: 10,
34
+ minUptime: 1000,
35
+ killTimeout: 3000,
36
+ listenTimeout: 3000,
37
+ mergeLogs: true,
38
+ };
39
+ /**
40
+ * Merge app config with defaults
41
+ */
42
+ export function withPm2Defaults(config) {
43
+ return {
44
+ ...PM2_APP_DEFAULTS,
45
+ ...config,
46
+ };
47
+ }
48
+ //# sourceMappingURL=Pm2EcosystemConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pm2EcosystemConfig.js","sourceRoot":"","sources":["../../../src/infrastructure/config/Pm2EcosystemConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmOH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,MAAc,EACd,OAAyD;IAEzD,OAAO;QACL,IAAI;QACJ,MAAM;QACN,GAAG,OAAO;KACX,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAqB,EACrB,MAAyC;IAEzC,OAAO;QACL,IAAI;QACJ,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,EAAE;IACf,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,IAAI;CACP,CAAC;AAEX;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAqB;IACnD,OAAO;QACL,GAAG,gBAAgB;QACnB,GAAG,MAAM;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Infrastructure Configuration Types
3
+ * Configuration type definitions for external services
4
+ */
5
+ export { type Pm2ExecMode, type Pm2Interpreter, type IPm2LogConfig, type IPm2RestartConfig, type IPm2WatchConfig, type IPm2AppConfig, type IPm2EcosystemConfig, type IPm2DeployConfig, createPm2AppConfig, createPm2EcosystemConfig, PM2_APP_DEFAULTS, withPm2Defaults, } from './Pm2EcosystemConfig.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/config/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,GAChB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Infrastructure Configuration Types
3
+ * Configuration type definitions for external services
4
+ */
5
+ export { createPm2AppConfig, createPm2EcosystemConfig, PM2_APP_DEFAULTS, withPm2Defaults, } from './Pm2EcosystemConfig.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/config/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EASL,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,GAChB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * ModSourceFactory - Factory pattern for mod source adapters
3
+ *
4
+ * This factory manages registration and retrieval of mod source adapters.
5
+ * Adapters register themselves when their modules are imported.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // Register an adapter
10
+ * ModSourceFactory.register(new ModrinthAdapter());
11
+ *
12
+ * // Get an adapter by name
13
+ * const source = ModSourceFactory.get('modrinth');
14
+ * const results = await source.search('sodium');
15
+ *
16
+ * // List available sources
17
+ * const sources = ModSourceFactory.getSupportedSources();
18
+ * ```
19
+ */
20
+ import type { IModSourcePort } from '../../application/ports/outbound/IModSourcePort.js';
21
+ /**
22
+ * Factory for creating and managing mod source adapters
23
+ */
24
+ export declare class ModSourceFactory {
25
+ /** Registered adapters by source name */
26
+ private static adapters;
27
+ /**
28
+ * Register a mod source adapter
29
+ * @param adapter - Adapter instance to register
30
+ * @throws Error if an adapter with the same name is already registered
31
+ */
32
+ static register(adapter: IModSourcePort): void;
33
+ /**
34
+ * Get a registered adapter by source name
35
+ * @param source - Source name (case-insensitive)
36
+ * @returns The registered adapter
37
+ * @throws Error if no adapter is registered for the given source
38
+ */
39
+ static get(source: string): IModSourcePort;
40
+ /**
41
+ * Get a registered adapter or null if not found
42
+ * @param source - Source name (case-insensitive)
43
+ * @returns The registered adapter or null
44
+ */
45
+ static getOrNull(source: string): IModSourcePort | null;
46
+ /**
47
+ * Check if a source is registered
48
+ * @param source - Source name (case-insensitive)
49
+ * @returns true if the source is registered
50
+ */
51
+ static isSupported(source: string): boolean;
52
+ /**
53
+ * Get list of all registered source names
54
+ * @returns Array of source names
55
+ */
56
+ static getSupportedSources(): string[];
57
+ /**
58
+ * Get all registered adapters
59
+ * @returns Array of all adapters
60
+ */
61
+ static getAllAdapters(): IModSourcePort[];
62
+ /**
63
+ * Get the default source name
64
+ * @returns 'modrinth' as the default source
65
+ */
66
+ static getDefaultSource(): string;
67
+ /**
68
+ * Clear all registered adapters
69
+ * Primarily used for testing
70
+ */
71
+ static clear(): void;
72
+ }
73
+ //# sourceMappingURL=ModSourceFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModSourceFactory.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/factories/ModSourceFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AAEzF;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,yCAAyC;IACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAqC;IAE5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAY9C;;;;;OAKG;IACH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc;IAc1C;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAIvD;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAI3C;;;OAGG;IACH,MAAM,CAAC,mBAAmB,IAAI,MAAM,EAAE;IAItC;;;OAGG;IACH,MAAM,CAAC,cAAc,IAAI,cAAc,EAAE;IAIzC;;;OAGG;IACH,MAAM,CAAC,gBAAgB,IAAI,MAAM;IAIjC;;;OAGG;IACH,MAAM,CAAC,KAAK,IAAI,IAAI;CAGrB"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * ModSourceFactory - Factory pattern for mod source adapters
3
+ *
4
+ * This factory manages registration and retrieval of mod source adapters.
5
+ * Adapters register themselves when their modules are imported.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // Register an adapter
10
+ * ModSourceFactory.register(new ModrinthAdapter());
11
+ *
12
+ * // Get an adapter by name
13
+ * const source = ModSourceFactory.get('modrinth');
14
+ * const results = await source.search('sodium');
15
+ *
16
+ * // List available sources
17
+ * const sources = ModSourceFactory.getSupportedSources();
18
+ * ```
19
+ */
20
+ /**
21
+ * Factory for creating and managing mod source adapters
22
+ */
23
+ export class ModSourceFactory {
24
+ /** Registered adapters by source name */
25
+ static adapters = new Map();
26
+ /**
27
+ * Register a mod source adapter
28
+ * @param adapter - Adapter instance to register
29
+ * @throws Error if an adapter with the same name is already registered
30
+ */
31
+ static register(adapter) {
32
+ const key = adapter.sourceName.toLowerCase();
33
+ if (this.adapters.has(key)) {
34
+ throw new Error(`Mod source adapter '${adapter.sourceName}' is already registered`);
35
+ }
36
+ this.adapters.set(key, adapter);
37
+ }
38
+ /**
39
+ * Get a registered adapter by source name
40
+ * @param source - Source name (case-insensitive)
41
+ * @returns The registered adapter
42
+ * @throws Error if no adapter is registered for the given source
43
+ */
44
+ static get(source) {
45
+ const key = source.toLowerCase();
46
+ const adapter = this.adapters.get(key);
47
+ if (!adapter) {
48
+ const available = this.getSupportedSources().join(', ');
49
+ throw new Error(`Unknown mod source: '${source}'. Available sources: ${available || 'none'}`);
50
+ }
51
+ return adapter;
52
+ }
53
+ /**
54
+ * Get a registered adapter or null if not found
55
+ * @param source - Source name (case-insensitive)
56
+ * @returns The registered adapter or null
57
+ */
58
+ static getOrNull(source) {
59
+ return this.adapters.get(source.toLowerCase()) ?? null;
60
+ }
61
+ /**
62
+ * Check if a source is registered
63
+ * @param source - Source name (case-insensitive)
64
+ * @returns true if the source is registered
65
+ */
66
+ static isSupported(source) {
67
+ return this.adapters.has(source.toLowerCase());
68
+ }
69
+ /**
70
+ * Get list of all registered source names
71
+ * @returns Array of source names
72
+ */
73
+ static getSupportedSources() {
74
+ return Array.from(this.adapters.keys());
75
+ }
76
+ /**
77
+ * Get all registered adapters
78
+ * @returns Array of all adapters
79
+ */
80
+ static getAllAdapters() {
81
+ return Array.from(this.adapters.values());
82
+ }
83
+ /**
84
+ * Get the default source name
85
+ * @returns 'modrinth' as the default source
86
+ */
87
+ static getDefaultSource() {
88
+ return 'modrinth';
89
+ }
90
+ /**
91
+ * Clear all registered adapters
92
+ * Primarily used for testing
93
+ */
94
+ static clear() {
95
+ this.adapters.clear();
96
+ }
97
+ }
98
+ //# sourceMappingURL=ModSourceFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModSourceFactory.js","sourceRoot":"","sources":["../../../src/infrastructure/factories/ModSourceFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAC3B,yCAAyC;IACjC,MAAM,CAAC,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;IAE5D;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAuB;QACrC,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;QAE7C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,uBAAuB,OAAO,CAAC,UAAU,yBAAyB,CACnE,CAAC;QACJ,CAAC;QAED,IAAI,CAA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