@lgriffin/esi.ts 9.1.0 → 9.6.0

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 (185) hide show
  1. package/CHANGELOG.md +388 -388
  2. package/LICENSE +26 -26
  3. package/README.md +1030 -988
  4. package/dist/EsiClient.d.ts +5 -0
  5. package/dist/EsiClient.d.ts.map +1 -1
  6. package/dist/EsiClientBuilder.d.ts.map +1 -1
  7. package/dist/clients/CosmeticsClient.d.ts +11 -0
  8. package/dist/clients/CosmeticsClient.d.ts.map +1 -0
  9. package/dist/clients/MercenaryClient.d.ts +19 -1
  10. package/dist/clients/MercenaryClient.d.ts.map +1 -1
  11. package/dist/clients/ParagonHubClient.d.ts +13 -0
  12. package/dist/clients/ParagonHubClient.d.ts.map +1 -0
  13. package/dist/clients/SkyhooksClient.d.ts +19 -1
  14. package/dist/clients/SkyhooksClient.d.ts.map +1 -1
  15. package/dist/core/ApiClient.d.ts +3 -0
  16. package/dist/core/ApiClient.d.ts.map +1 -1
  17. package/dist/core/ApiRequestHandler.d.ts.map +1 -1
  18. package/dist/core/ClientRegistry.d.ts +5 -3
  19. package/dist/core/ClientRegistry.d.ts.map +1 -1
  20. package/dist/core/cache/cacheKey.d.ts +3 -0
  21. package/dist/core/cache/cacheKey.d.ts.map +1 -0
  22. package/dist/core/constants.d.ts +2 -2
  23. package/dist/core/endpoints/accessListEndpoints.d.ts +4 -18
  24. package/dist/core/endpoints/accessListEndpoints.d.ts.map +1 -1
  25. package/dist/core/endpoints/assetEndpoints.d.ts +2 -12
  26. package/dist/core/endpoints/assetEndpoints.d.ts.map +1 -1
  27. package/dist/core/endpoints/calendarEndpoints.d.ts +3 -19
  28. package/dist/core/endpoints/calendarEndpoints.d.ts.map +1 -1
  29. package/dist/core/endpoints/characterEndpoints.d.ts +4 -20
  30. package/dist/core/endpoints/characterEndpoints.d.ts.map +1 -1
  31. package/dist/core/endpoints/cloneEndpoints.d.ts +2 -8
  32. package/dist/core/endpoints/cloneEndpoints.d.ts.map +1 -1
  33. package/dist/core/endpoints/contactEndpoints.d.ts +3 -18
  34. package/dist/core/endpoints/contactEndpoints.d.ts.map +1 -1
  35. package/dist/core/endpoints/contractEndpoints.d.ts +9 -75
  36. package/dist/core/endpoints/contractEndpoints.d.ts.map +1 -1
  37. package/dist/core/endpoints/corporationEndpoints.d.ts +7 -36
  38. package/dist/core/endpoints/corporationEndpoints.d.ts.map +1 -1
  39. package/dist/core/endpoints/cosmeticsEndpoints.d.ts +52 -0
  40. package/dist/core/endpoints/cosmeticsEndpoints.d.ts.map +1 -0
  41. package/dist/core/endpoints/factionEndpoints.d.ts +1 -6
  42. package/dist/core/endpoints/factionEndpoints.d.ts.map +1 -1
  43. package/dist/core/endpoints/fleetEndpoints.d.ts +2 -12
  44. package/dist/core/endpoints/fleetEndpoints.d.ts.map +1 -1
  45. package/dist/core/endpoints/incursionEndpoints.d.ts +1 -5
  46. package/dist/core/endpoints/incursionEndpoints.d.ts.map +1 -1
  47. package/dist/core/endpoints/industryEndpoints.d.ts +2 -16
  48. package/dist/core/endpoints/industryEndpoints.d.ts.map +1 -1
  49. package/dist/core/endpoints/mailEndpoints.d.ts +2 -12
  50. package/dist/core/endpoints/mailEndpoints.d.ts.map +1 -1
  51. package/dist/core/endpoints/marketEndpoints.d.ts +2 -8
  52. package/dist/core/endpoints/marketEndpoints.d.ts.map +1 -1
  53. package/dist/core/endpoints/mercenaryEndpoints.d.ts +46 -6
  54. package/dist/core/endpoints/mercenaryEndpoints.d.ts.map +1 -1
  55. package/dist/core/endpoints/paragonHubEndpoints.d.ts +163 -0
  56. package/dist/core/endpoints/paragonHubEndpoints.d.ts.map +1 -0
  57. package/dist/core/endpoints/piEndpoints.d.ts +1 -10
  58. package/dist/core/endpoints/piEndpoints.d.ts.map +1 -1
  59. package/dist/core/endpoints/skyhookEndpoints.d.ts +64 -0
  60. package/dist/core/endpoints/skyhookEndpoints.d.ts.map +1 -1
  61. package/dist/core/endpoints/sovereigntyEndpoints.d.ts +1 -6
  62. package/dist/core/endpoints/sovereigntyEndpoints.d.ts.map +1 -1
  63. package/dist/core/endpoints/universeEndpoints.d.ts +1 -11
  64. package/dist/core/endpoints/universeEndpoints.d.ts.map +1 -1
  65. package/dist/core/requestPipeline/cachePolicy.d.ts +3 -3
  66. package/dist/core/requestPipeline/cachePolicy.d.ts.map +1 -1
  67. package/dist/core/requestPipeline/headers.d.ts.map +1 -1
  68. package/dist/core/requestPipeline/statusHandling.d.ts +2 -2
  69. package/dist/core/requestPipeline/statusHandling.d.ts.map +1 -1
  70. package/dist/errors.js.map +1 -1
  71. package/dist/errors.mjs.map +1 -1
  72. package/dist/index.d.ts +2 -0
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +2167 -1676
  75. package/dist/index.js.map +1 -1
  76. package/dist/index.mjs +2165 -1676
  77. package/dist/index.mjs.map +1 -1
  78. package/dist/schemas/access-lists.d.ts +4 -18
  79. package/dist/schemas/access-lists.d.ts.map +1 -1
  80. package/dist/schemas/alliance.d.ts +1 -5
  81. package/dist/schemas/alliance.d.ts.map +1 -1
  82. package/dist/schemas/assets.d.ts +1 -6
  83. package/dist/schemas/assets.d.ts.map +1 -1
  84. package/dist/schemas/calendar.d.ts +3 -19
  85. package/dist/schemas/calendar.d.ts.map +1 -1
  86. package/dist/schemas/character.d.ts +3 -15
  87. package/dist/schemas/character.d.ts.map +1 -1
  88. package/dist/schemas/clones.d.ts +2 -8
  89. package/dist/schemas/clones.d.ts.map +1 -1
  90. package/dist/schemas/common.d.ts +1 -5
  91. package/dist/schemas/common.d.ts.map +1 -1
  92. package/dist/schemas/contacts.d.ts +1 -6
  93. package/dist/schemas/contacts.d.ts.map +1 -1
  94. package/dist/schemas/contracts.d.ts +3 -25
  95. package/dist/schemas/contracts.d.ts.map +1 -1
  96. package/dist/schemas/corporation.d.ts +6 -31
  97. package/dist/schemas/corporation.d.ts.map +1 -1
  98. package/dist/schemas/cosmetics.d.ts +58 -0
  99. package/dist/schemas/cosmetics.d.ts.map +1 -0
  100. package/dist/schemas/esiEnum.d.ts +3 -0
  101. package/dist/schemas/esiEnum.d.ts.map +1 -0
  102. package/dist/schemas/faction-warfare.d.ts +1 -6
  103. package/dist/schemas/faction-warfare.d.ts.map +1 -1
  104. package/dist/schemas/fleet.d.ts +2 -12
  105. package/dist/schemas/fleet.d.ts.map +1 -1
  106. package/dist/schemas/incursions.d.ts +1 -5
  107. package/dist/schemas/incursions.d.ts.map +1 -1
  108. package/dist/schemas/index.d.ts +3 -0
  109. package/dist/schemas/index.d.ts.map +1 -1
  110. package/dist/schemas/index.js +1784 -1486
  111. package/dist/schemas/index.js.map +1 -1
  112. package/dist/schemas/index.mjs +1749 -1486
  113. package/dist/schemas/index.mjs.map +1 -1
  114. package/dist/schemas/industry.d.ts +1 -8
  115. package/dist/schemas/industry.d.ts.map +1 -1
  116. package/dist/schemas/mail.d.ts +1 -6
  117. package/dist/schemas/mail.d.ts.map +1 -1
  118. package/dist/schemas/market.d.ts +2 -8
  119. package/dist/schemas/market.d.ts.map +1 -1
  120. package/dist/schemas/mercenary.d.ts +55 -6
  121. package/dist/schemas/mercenary.d.ts.map +1 -1
  122. package/dist/schemas/paragon-hub.d.ts +96 -0
  123. package/dist/schemas/paragon-hub.d.ts.map +1 -0
  124. package/dist/schemas/pi.d.ts +1 -10
  125. package/dist/schemas/pi.d.ts.map +1 -1
  126. package/dist/schemas/skyhooks.d.ts +101 -0
  127. package/dist/schemas/skyhooks.d.ts.map +1 -1
  128. package/dist/schemas/sovereignty.d.ts +1 -6
  129. package/dist/schemas/sovereignty.d.ts.map +1 -1
  130. package/dist/schemas/universe.d.ts +1 -11
  131. package/dist/schemas/universe.d.ts.map +1 -1
  132. package/dist/sde/IStaticDataProvider.d.ts +106 -0
  133. package/dist/sde/IStaticDataProvider.d.ts.map +1 -0
  134. package/dist/sde/MemorySdeProvider.d.ts +167 -0
  135. package/dist/sde/MemorySdeProvider.d.ts.map +1 -0
  136. package/dist/sde/SdeDataProvider.d.ts +119 -0
  137. package/dist/sde/SdeDataProvider.d.ts.map +1 -0
  138. package/dist/sde/SdeTestDataFactory.d.ts +33 -0
  139. package/dist/sde/SdeTestDataFactory.d.ts.map +1 -0
  140. package/dist/sde/errors.d.ts +23 -0
  141. package/dist/sde/errors.d.ts.map +1 -0
  142. package/dist/sde/index.d.ts +9 -0
  143. package/dist/sde/index.d.ts.map +1 -0
  144. package/dist/sde/index.js +2591 -0
  145. package/dist/sde/index.js.map +1 -0
  146. package/dist/sde/index.mjs +2544 -0
  147. package/dist/sde/index.mjs.map +1 -0
  148. package/dist/sde/ingestion/SdeDatabaseBuilder.d.ts +18 -0
  149. package/dist/sde/ingestion/SdeDatabaseBuilder.d.ts.map +1 -0
  150. package/dist/sde/ingestion/SdeDownloader.d.ts +14 -0
  151. package/dist/sde/ingestion/SdeDownloader.d.ts.map +1 -0
  152. package/dist/sde/ingestion/SdeExtractor.d.ts +18 -0
  153. package/dist/sde/ingestion/SdeExtractor.d.ts.map +1 -0
  154. package/dist/sde/ingestion/constants.d.ts +13 -0
  155. package/dist/sde/ingestion/constants.d.ts.map +1 -0
  156. package/dist/sde/ingestion/index.d.ts +10 -0
  157. package/dist/sde/ingestion/index.d.ts.map +1 -0
  158. package/dist/sde/ingestion/transforms.d.ts +13 -0
  159. package/dist/sde/ingestion/transforms.d.ts.map +1 -0
  160. package/dist/sde/memory.d.ts +8 -0
  161. package/dist/sde/memory.d.ts.map +1 -0
  162. package/dist/sde/memory.js +1100 -0
  163. package/dist/sde/memory.js.map +1 -0
  164. package/dist/sde/memory.mjs +1064 -0
  165. package/dist/sde/memory.mjs.map +1 -0
  166. package/dist/sde/schemas.d.ts +1121 -0
  167. package/dist/sde/schemas.d.ts.map +1 -0
  168. package/dist/sde/types.d.ts +1039 -0
  169. package/dist/sde/types.d.ts.map +1 -0
  170. package/dist/sde/version.d.ts +7 -0
  171. package/dist/sde/version.d.ts.map +1 -0
  172. package/dist/testing/TestDataFactory.d.ts +1 -1
  173. package/dist/testing/index.js.map +1 -1
  174. package/dist/testing/index.mjs.map +1 -1
  175. package/dist/types/api-responses.d.ts +2 -0
  176. package/dist/types/api-responses.d.ts.map +1 -1
  177. package/dist/types/cosmetics.d.ts +8 -0
  178. package/dist/types/cosmetics.d.ts.map +1 -0
  179. package/dist/types/mercenary.d.ts +3 -1
  180. package/dist/types/mercenary.d.ts.map +1 -1
  181. package/dist/types/paragon-hub.d.ts +8 -0
  182. package/dist/types/paragon-hub.d.ts.map +1 -0
  183. package/dist/types/skyhooks.d.ts +3 -1
  184. package/dist/types/skyhooks.d.ts.map +1 -1
  185. package/package.json +289 -257
@@ -0,0 +1,2544 @@
1
+ // src/sde/SdeDataProvider.ts
2
+ import * as fs from "fs";
3
+ import * as path from "path";
4
+ import * as yaml2 from "js-yaml";
5
+
6
+ // src/sde/ingestion/constants.ts
7
+ var SDE_METADATA_FILENAME = "_sde.yaml";
8
+ var SDE_FILE_REGISTRY = [
9
+ // --- Universe / Map ---
10
+ {
11
+ yamlFile: "mapRegions.yaml",
12
+ tableName: "eve_regions",
13
+ idAttribute: "regionId",
14
+ idType: "number",
15
+ injectId: true
16
+ },
17
+ {
18
+ yamlFile: "mapConstellations.yaml",
19
+ tableName: "eve_constellations",
20
+ idAttribute: "constellationId",
21
+ idType: "number",
22
+ injectId: true
23
+ },
24
+ {
25
+ yamlFile: "mapSolarSystems.yaml",
26
+ tableName: "eve_solar_systems",
27
+ idAttribute: "systemId",
28
+ idType: "number",
29
+ injectId: true
30
+ },
31
+ {
32
+ yamlFile: "mapStargates.yaml",
33
+ tableName: "eve_stargates",
34
+ idAttribute: "stargateId",
35
+ idType: "number",
36
+ injectId: true
37
+ },
38
+ {
39
+ yamlFile: "mapStars.yaml",
40
+ tableName: "eve_stars",
41
+ idAttribute: "starId",
42
+ idType: "number",
43
+ injectId: true
44
+ },
45
+ {
46
+ yamlFile: "mapPlanets.yaml",
47
+ tableName: "eve_planets",
48
+ idAttribute: "planetId",
49
+ idType: "number",
50
+ injectId: true
51
+ },
52
+ {
53
+ yamlFile: "mapMoons.yaml",
54
+ tableName: "eve_moons",
55
+ idAttribute: "moonId",
56
+ idType: "number",
57
+ injectId: true
58
+ },
59
+ {
60
+ yamlFile: "mapAsteroidBelts.yaml",
61
+ tableName: "eve_asteroid_belts",
62
+ idAttribute: "asteroidBeltId",
63
+ idType: "number",
64
+ injectId: true
65
+ },
66
+ {
67
+ yamlFile: "mapSecondarySuns.yaml",
68
+ tableName: "eve_secondary_suns",
69
+ idAttribute: "secondarySunId",
70
+ idType: "number",
71
+ injectId: true
72
+ },
73
+ // --- Type System ---
74
+ {
75
+ yamlFile: "types.yaml",
76
+ tableName: "eve_types",
77
+ idAttribute: "typeId",
78
+ idType: "number",
79
+ injectId: true
80
+ },
81
+ {
82
+ yamlFile: "groups.yaml",
83
+ tableName: "eve_groups",
84
+ idAttribute: "groupId",
85
+ idType: "number",
86
+ injectId: true
87
+ },
88
+ {
89
+ yamlFile: "categories.yaml",
90
+ tableName: "eve_categories",
91
+ idAttribute: "categoryId",
92
+ idType: "number",
93
+ injectId: true
94
+ },
95
+ {
96
+ yamlFile: "metaGroups.yaml",
97
+ tableName: "eve_meta_groups",
98
+ idAttribute: "metaGroupId",
99
+ idType: "number",
100
+ injectId: true
101
+ },
102
+ {
103
+ yamlFile: "typeDogma.yaml",
104
+ tableName: "eve_type_dogma",
105
+ idAttribute: "typeId",
106
+ idType: "number",
107
+ injectId: true
108
+ },
109
+ {
110
+ yamlFile: "typeBonus.yaml",
111
+ tableName: "eve_type_bonuses",
112
+ idAttribute: "typeId",
113
+ idType: "number",
114
+ injectId: true
115
+ },
116
+ {
117
+ yamlFile: "typeElements.yaml",
118
+ tableName: "eve_type_elements",
119
+ idAttribute: "typeId",
120
+ idType: "number",
121
+ injectId: true
122
+ },
123
+ {
124
+ yamlFile: "typeLists.yaml",
125
+ tableName: "eve_type_lists",
126
+ idAttribute: "typeListId",
127
+ idType: "number",
128
+ injectId: true
129
+ },
130
+ {
131
+ yamlFile: "typeMaterials.yaml",
132
+ tableName: "eve_type_materials",
133
+ idAttribute: "typeId",
134
+ idType: "number",
135
+ injectId: true
136
+ },
137
+ {
138
+ yamlFile: "compressibleTypes.yaml",
139
+ tableName: "eve_compressible_types",
140
+ idAttribute: "typeId",
141
+ idType: "number",
142
+ injectId: true
143
+ },
144
+ {
145
+ yamlFile: "contrabandTypes.yaml",
146
+ tableName: "eve_contraband_types",
147
+ idAttribute: "typeId",
148
+ idType: "number",
149
+ injectId: true
150
+ },
151
+ // --- Dogma ---
152
+ {
153
+ yamlFile: "dogmaAttributes.yaml",
154
+ tableName: "eve_dogma_attributes",
155
+ idAttribute: "attributeId",
156
+ idType: "number",
157
+ injectId: false
158
+ },
159
+ {
160
+ yamlFile: "dogmaEffects.yaml",
161
+ tableName: "eve_dogma_effects",
162
+ idAttribute: "effectId",
163
+ idType: "number",
164
+ injectId: false
165
+ },
166
+ {
167
+ yamlFile: "dogmaAttributeCategories.yaml",
168
+ tableName: "eve_dogma_attribute_categories",
169
+ idAttribute: "attributeCategoryId",
170
+ idType: "number",
171
+ injectId: true
172
+ },
173
+ {
174
+ yamlFile: "dogmaUnits.yaml",
175
+ tableName: "eve_dogma_units",
176
+ idAttribute: "unitId",
177
+ idType: "number",
178
+ injectId: true
179
+ },
180
+ // --- Industry ---
181
+ {
182
+ yamlFile: "blueprints.yaml",
183
+ tableName: "eve_blueprints",
184
+ idAttribute: "blueprintTypeId",
185
+ idType: "number",
186
+ injectId: false
187
+ },
188
+ {
189
+ yamlFile: "planetSchematics.yaml",
190
+ tableName: "eve_planet_schematics",
191
+ idAttribute: "planetSchematicId",
192
+ idType: "number",
193
+ injectId: true
194
+ },
195
+ {
196
+ yamlFile: "planetResources.yaml",
197
+ tableName: "eve_planet_resources",
198
+ idAttribute: "planetId",
199
+ idType: "number",
200
+ injectId: true
201
+ },
202
+ // --- Market ---
203
+ {
204
+ yamlFile: "marketGroups.yaml",
205
+ tableName: "eve_market_groups",
206
+ idAttribute: "marketGroupId",
207
+ idType: "number",
208
+ injectId: true
209
+ },
210
+ // --- NPCs / Agents ---
211
+ {
212
+ yamlFile: "agentTypes.yaml",
213
+ tableName: "eve_agent_types",
214
+ idAttribute: "agentTypeId",
215
+ idType: "number",
216
+ injectId: true
217
+ },
218
+ {
219
+ yamlFile: "agentsInSpace.yaml",
220
+ tableName: "eve_agents_in_space",
221
+ idAttribute: "characterId",
222
+ idType: "number",
223
+ injectId: true
224
+ },
225
+ {
226
+ yamlFile: "npcCharacters.yaml",
227
+ tableName: "eve_npc_characters",
228
+ idAttribute: "characterId",
229
+ idType: "number",
230
+ injectId: true
231
+ },
232
+ {
233
+ yamlFile: "npcCorporations.yaml",
234
+ tableName: "eve_npc_corporations",
235
+ idAttribute: "corporationId",
236
+ idType: "number",
237
+ injectId: true
238
+ },
239
+ {
240
+ yamlFile: "npcCorporationDivisions.yaml",
241
+ tableName: "eve_npc_corporation_divisions",
242
+ idAttribute: "npcCorporationDivisionId",
243
+ idType: "number",
244
+ injectId: true
245
+ },
246
+ {
247
+ yamlFile: "npcStations.yaml",
248
+ tableName: "eve_npc_stations",
249
+ idAttribute: "stationId",
250
+ idType: "number",
251
+ injectId: true
252
+ },
253
+ {
254
+ yamlFile: "factions.yaml",
255
+ tableName: "eve_factions",
256
+ idAttribute: "factionId",
257
+ idType: "number",
258
+ injectId: true
259
+ },
260
+ // --- Character / Lore ---
261
+ {
262
+ yamlFile: "races.yaml",
263
+ tableName: "eve_races",
264
+ idAttribute: "raceId",
265
+ idType: "number",
266
+ injectId: true
267
+ },
268
+ {
269
+ yamlFile: "bloodlines.yaml",
270
+ tableName: "eve_bloodlines",
271
+ idAttribute: "bloodlineId",
272
+ idType: "number",
273
+ injectId: true
274
+ },
275
+ {
276
+ yamlFile: "ancestries.yaml",
277
+ tableName: "eve_ancestries",
278
+ idAttribute: "ancestryId",
279
+ idType: "number",
280
+ injectId: true
281
+ },
282
+ {
283
+ yamlFile: "characterAttributes.yaml",
284
+ tableName: "eve_character_attributes",
285
+ idAttribute: "attributeId",
286
+ idType: "number",
287
+ injectId: true
288
+ },
289
+ {
290
+ yamlFile: "characterTitles.yaml",
291
+ tableName: "eve_character_titles",
292
+ idAttribute: "characterTitleId",
293
+ idType: "string",
294
+ injectId: false
295
+ },
296
+ {
297
+ yamlFile: "cloneGrades.yaml",
298
+ tableName: "eve_clone_grades",
299
+ idAttribute: "cloneGradeId",
300
+ idType: "number",
301
+ injectId: true
302
+ },
303
+ // --- SKINs ---
304
+ {
305
+ yamlFile: "skins.yaml",
306
+ tableName: "eve_skins",
307
+ idAttribute: "skinId",
308
+ idType: "number",
309
+ injectId: true
310
+ },
311
+ {
312
+ yamlFile: "skinLicenses.yaml",
313
+ tableName: "eve_skin_licenses",
314
+ idAttribute: "licenseTypeId",
315
+ idType: "number",
316
+ injectId: false
317
+ },
318
+ {
319
+ yamlFile: "skinMaterials.yaml",
320
+ tableName: "eve_skin_materials",
321
+ idAttribute: "skinMaterialId",
322
+ idType: "number",
323
+ injectId: false
324
+ },
325
+ // --- SKINR ---
326
+ {
327
+ yamlFile: "skinrComponents.yaml",
328
+ tableName: "eve_skinr_components",
329
+ idAttribute: "skinrComponentId",
330
+ idType: "number",
331
+ injectId: true
332
+ },
333
+ {
334
+ yamlFile: "skinrComponentCategories.yaml",
335
+ tableName: "eve_skinr_component_categories",
336
+ idAttribute: "skinrComponentCategoryId",
337
+ idType: "number",
338
+ injectId: true
339
+ },
340
+ {
341
+ yamlFile: "skinrComponentRarities.yaml",
342
+ tableName: "eve_skinr_component_rarities",
343
+ idAttribute: "skinrComponentRarityId",
344
+ idType: "number",
345
+ injectId: true
346
+ },
347
+ {
348
+ yamlFile: "skinrComponentPointValues.yaml",
349
+ tableName: "eve_skinr_component_point_values",
350
+ idAttribute: "skinrComponentCategoryId",
351
+ idType: "number",
352
+ injectId: false
353
+ },
354
+ {
355
+ yamlFile: "skinrSlots.yaml",
356
+ tableName: "eve_skinr_slots",
357
+ idAttribute: "skinrSlotId",
358
+ idType: "number",
359
+ injectId: true
360
+ },
361
+ {
362
+ yamlFile: "skinrSlotCategories.yaml",
363
+ tableName: "eve_skinr_slot_categories",
364
+ idAttribute: "skinrSlotCategoryId",
365
+ idType: "number",
366
+ injectId: true
367
+ },
368
+ {
369
+ yamlFile: "skinrSlotConfigurations.yaml",
370
+ tableName: "eve_skinr_slot_configurations",
371
+ idAttribute: "skinrSlotConfigurationId",
372
+ idType: "number",
373
+ injectId: true
374
+ },
375
+ {
376
+ yamlFile: "skinrSlotNames.yaml",
377
+ tableName: "eve_skinr_slot_names",
378
+ idAttribute: "skinrSlotNameId",
379
+ idType: "number",
380
+ injectId: true
381
+ },
382
+ {
383
+ yamlFile: "skinrTierThresholds.yaml",
384
+ tableName: "eve_skinr_tier_thresholds",
385
+ idAttribute: "shipTreeGroupId",
386
+ idType: "number",
387
+ injectId: false
388
+ },
389
+ // --- Ship Tree ---
390
+ {
391
+ yamlFile: "shipTreeElements.yaml",
392
+ tableName: "eve_ship_tree_elements",
393
+ idAttribute: "shipTreeElementId",
394
+ idType: "number",
395
+ injectId: true
396
+ },
397
+ {
398
+ yamlFile: "shipTreeFactions.yaml",
399
+ tableName: "eve_ship_tree_factions",
400
+ idAttribute: "factionId",
401
+ idType: "number",
402
+ injectId: true
403
+ },
404
+ {
405
+ yamlFile: "shipTreeGroups.yaml",
406
+ tableName: "eve_ship_tree_groups",
407
+ idAttribute: "shipTreeGroupId",
408
+ idType: "number",
409
+ injectId: true
410
+ },
411
+ // --- Graphics ---
412
+ {
413
+ yamlFile: "graphics.yaml",
414
+ tableName: "eve_graphics",
415
+ idAttribute: "graphicId",
416
+ idType: "number",
417
+ injectId: true
418
+ },
419
+ {
420
+ yamlFile: "graphicMaterialSets.yaml",
421
+ tableName: "eve_graphic_material_sets",
422
+ idAttribute: "materialSetId",
423
+ idType: "number",
424
+ injectId: true
425
+ },
426
+ {
427
+ yamlFile: "icons.yaml",
428
+ tableName: "eve_icons",
429
+ idAttribute: "iconId",
430
+ idType: "number",
431
+ injectId: true
432
+ },
433
+ // --- Stations ---
434
+ {
435
+ yamlFile: "stationOperations.yaml",
436
+ tableName: "eve_station_operations",
437
+ idAttribute: "stationOperationId",
438
+ idType: "number",
439
+ injectId: true
440
+ },
441
+ {
442
+ yamlFile: "stationServices.yaml",
443
+ tableName: "eve_station_services",
444
+ idAttribute: "stationServiceId",
445
+ idType: "number",
446
+ injectId: true
447
+ },
448
+ // --- Sovereignty ---
449
+ {
450
+ yamlFile: "sovereigntyUpgrades.yaml",
451
+ tableName: "eve_sovereignty_upgrades",
452
+ idAttribute: "typeId",
453
+ idType: "number",
454
+ injectId: true
455
+ },
456
+ // --- Certificates / Masteries ---
457
+ {
458
+ yamlFile: "certificates.yaml",
459
+ tableName: "eve_certificates",
460
+ idAttribute: "certificateId",
461
+ idType: "number",
462
+ injectId: true
463
+ },
464
+ {
465
+ yamlFile: "masteries.yaml",
466
+ tableName: "eve_masteries",
467
+ idAttribute: "typeId",
468
+ idType: "number",
469
+ injectId: true
470
+ },
471
+ // --- Misc ---
472
+ {
473
+ yamlFile: "archetypes.yaml",
474
+ tableName: "eve_archetypes",
475
+ idAttribute: "archetypeId",
476
+ idType: "number",
477
+ injectId: true
478
+ },
479
+ {
480
+ yamlFile: "controlTowerResources.yaml",
481
+ tableName: "eve_control_tower_resources",
482
+ idAttribute: "typeId",
483
+ idType: "number",
484
+ injectId: true
485
+ },
486
+ {
487
+ yamlFile: "corporationActivities.yaml",
488
+ tableName: "eve_corporation_activities",
489
+ idAttribute: "corporationActivityId",
490
+ idType: "number",
491
+ injectId: true
492
+ },
493
+ {
494
+ yamlFile: "dbuffCollections.yaml",
495
+ tableName: "eve_dbuff_collections",
496
+ idAttribute: "dbuffCollectionId",
497
+ idType: "number",
498
+ injectId: true
499
+ },
500
+ {
501
+ yamlFile: "dungeons.yaml",
502
+ tableName: "eve_dungeons",
503
+ idAttribute: "dungeonId",
504
+ idType: "number",
505
+ injectId: true
506
+ },
507
+ {
508
+ yamlFile: "dynamicItemAttributes.yaml",
509
+ tableName: "eve_dynamic_item_attributes",
510
+ idAttribute: "dynamicItemAttributeId",
511
+ idType: "number",
512
+ injectId: true
513
+ },
514
+ {
515
+ yamlFile: "epicArcs.yaml",
516
+ tableName: "eve_epic_arcs",
517
+ idAttribute: "epicArcId",
518
+ idType: "number",
519
+ injectId: true
520
+ },
521
+ {
522
+ yamlFile: "freelanceJobSchemas.yaml",
523
+ tableName: "eve_freelance_job_schemas",
524
+ idAttribute: "freelanceJobSchemaGroupId",
525
+ idType: "number",
526
+ injectId: true
527
+ },
528
+ {
529
+ yamlFile: "landmarks.yaml",
530
+ tableName: "eve_landmarks",
531
+ idAttribute: "landmarkId",
532
+ idType: "number",
533
+ injectId: true
534
+ },
535
+ {
536
+ yamlFile: "mercenaryTacticalOperations.yaml",
537
+ tableName: "eve_mercenary_tactical_operations",
538
+ idAttribute: "mercenaryTacticalOperationId",
539
+ idType: "number",
540
+ injectId: true
541
+ },
542
+ {
543
+ yamlFile: "militaryCampaigns.yaml",
544
+ tableName: "eve_military_campaigns",
545
+ idAttribute: "militaryCampaignId",
546
+ idType: "string",
547
+ injectId: true
548
+ },
549
+ {
550
+ yamlFile: "militaryCampaignObjectives.yaml",
551
+ tableName: "eve_military_campaign_objectives",
552
+ idAttribute: "militaryCampaignObjectiveId",
553
+ idType: "string",
554
+ injectId: true
555
+ },
556
+ {
557
+ yamlFile: "missions.yaml",
558
+ tableName: "eve_missions",
559
+ idAttribute: "missionId",
560
+ idType: "number",
561
+ injectId: true
562
+ },
563
+ // --- Translation ---
564
+ {
565
+ yamlFile: "translationLanguages.yaml",
566
+ tableName: "eve_translation_languages",
567
+ idAttribute: "translationLanguageId",
568
+ idType: "string",
569
+ injectId: true
570
+ },
571
+ // --- Industry (extended) ---
572
+ {
573
+ yamlFile: "industryActivities.yaml",
574
+ tableName: "eve_industry_activities",
575
+ idAttribute: "industryActivityId",
576
+ idType: "number",
577
+ injectId: true
578
+ },
579
+ {
580
+ yamlFile: "industryAssemblyLines.yaml",
581
+ tableName: "eve_industry_assembly_lines",
582
+ idAttribute: "assemblyLineId",
583
+ idType: "number",
584
+ injectId: true
585
+ },
586
+ {
587
+ yamlFile: "industryInstallationTypes.yaml",
588
+ tableName: "eve_industry_installation_types",
589
+ idAttribute: "installationTypeId",
590
+ idType: "number",
591
+ injectId: true
592
+ },
593
+ {
594
+ yamlFile: "industryModifierSources.yaml",
595
+ tableName: "eve_industry_modifier_sources",
596
+ idAttribute: "modifierSourceId",
597
+ idType: "number",
598
+ injectId: true
599
+ },
600
+ {
601
+ yamlFile: "industryTargetFilters.yaml",
602
+ tableName: "eve_industry_target_filters",
603
+ idAttribute: "targetFilterId",
604
+ idType: "number",
605
+ injectId: true
606
+ },
607
+ // --- Fighters ---
608
+ {
609
+ yamlFile: "fighterAbilities.yaml",
610
+ tableName: "eve_fighter_abilities",
611
+ idAttribute: "fighterAbilityId",
612
+ idType: "number",
613
+ injectId: true
614
+ },
615
+ {
616
+ yamlFile: "fighterAbilitiesByType.yaml",
617
+ tableName: "eve_fighter_abilities_by_type",
618
+ idAttribute: "typeId",
619
+ idType: "number",
620
+ injectId: true
621
+ },
622
+ // --- Corporation ---
623
+ {
624
+ yamlFile: "corporationRoles.yaml",
625
+ tableName: "eve_corporation_roles",
626
+ idAttribute: "corporationRoleId",
627
+ idType: "number",
628
+ injectId: true
629
+ },
630
+ {
631
+ yamlFile: "corporationRoleGroups.yaml",
632
+ tableName: "eve_corporation_role_groups",
633
+ idAttribute: "corporationRoleGroupId",
634
+ idType: "number",
635
+ injectId: true
636
+ },
637
+ // --- Schools / Education ---
638
+ {
639
+ yamlFile: "schools.yaml",
640
+ tableName: "eve_schools",
641
+ idAttribute: "schoolId",
642
+ idType: "number",
643
+ injectId: true
644
+ },
645
+ {
646
+ yamlFile: "schoolMap.yaml",
647
+ tableName: "eve_school_map",
648
+ idAttribute: "schoolMapId",
649
+ idType: "number",
650
+ injectId: true
651
+ },
652
+ {
653
+ yamlFile: "skillPlans.yaml",
654
+ tableName: "eve_skill_plans",
655
+ idAttribute: "skillPlanId",
656
+ idType: "number",
657
+ injectId: true
658
+ },
659
+ {
660
+ yamlFile: "expertSystems.yaml",
661
+ tableName: "eve_expert_systems",
662
+ idAttribute: "expertSystemId",
663
+ idType: "number",
664
+ injectId: true
665
+ },
666
+ // --- Notifications ---
667
+ {
668
+ yamlFile: "notificationTypes.yaml",
669
+ tableName: "eve_notification_types",
670
+ idAttribute: "notificationTypeId",
671
+ idType: "number",
672
+ injectId: true
673
+ },
674
+ {
675
+ yamlFile: "accountingEntryTypes.yaml",
676
+ tableName: "eve_accounting_entry_types",
677
+ idAttribute: "accountingEntryTypeId",
678
+ idType: "number",
679
+ injectId: true
680
+ },
681
+ // --- Effects / Traps / Dbuffs ---
682
+ {
683
+ yamlFile: "appliedProximityEffects.yaml",
684
+ tableName: "eve_applied_proximity_effects",
685
+ idAttribute: "appliedProximityEffectId",
686
+ idType: "number",
687
+ injectId: true
688
+ },
689
+ {
690
+ yamlFile: "proximityTrap.yaml",
691
+ tableName: "eve_proximity_traps",
692
+ idAttribute: "proximityTrapId",
693
+ idType: "number",
694
+ injectId: true
695
+ },
696
+ {
697
+ yamlFile: "systemDbuffEmitters.yaml",
698
+ tableName: "eve_system_dbuff_emitters",
699
+ idAttribute: "systemDbuffEmitterId",
700
+ idType: "number",
701
+ injectId: true
702
+ },
703
+ {
704
+ yamlFile: "systemWideEffects.yaml",
705
+ tableName: "eve_system_wide_effects",
706
+ idAttribute: "systemWideEffectId",
707
+ idType: "number",
708
+ injectId: true
709
+ },
710
+ {
711
+ yamlFile: "linkWithShip.yaml",
712
+ tableName: "eve_link_with_ship",
713
+ idAttribute: "linkWithShipId",
714
+ idType: "number",
715
+ injectId: true
716
+ },
717
+ // --- Station (extended) ---
718
+ {
719
+ yamlFile: "stationStandingsRestrictions.yaml",
720
+ tableName: "eve_station_standings_restrictions",
721
+ idAttribute: "stationStandingsRestrictionId",
722
+ idType: "number",
723
+ injectId: true
724
+ },
725
+ // --- SKINR (extended) ---
726
+ {
727
+ yamlFile: "skinrSlotsToMaterials.yaml",
728
+ tableName: "eve_skinr_slots_to_materials",
729
+ idAttribute: "skinrSlotToMaterialId",
730
+ idType: "number",
731
+ injectId: true
732
+ },
733
+ // --- Metenox ---
734
+ {
735
+ yamlFile: "metenoxMoonDrill.yaml",
736
+ tableName: "eve_metenox_moon_drill",
737
+ idAttribute: "metenoxMoonDrillId",
738
+ idType: "number",
739
+ injectId: true
740
+ }
741
+ ];
742
+
743
+ // src/sde/ingestion/SdeExtractor.ts
744
+ import AdmZip from "adm-zip";
745
+ import * as yaml from "js-yaml";
746
+
747
+ // src/sde/errors.ts
748
+ var SdeError = class extends Error {
749
+ constructor(message) {
750
+ super(message);
751
+ this.name = "SdeError";
752
+ }
753
+ };
754
+ var SdeDatabaseError = class extends SdeError {
755
+ cause;
756
+ constructor(message, cause) {
757
+ super(message);
758
+ this.name = "SdeDatabaseError";
759
+ this.cause = cause;
760
+ }
761
+ };
762
+ var SdeValidationError = class extends SdeError {
763
+ validationError;
764
+ entityType;
765
+ entityId;
766
+ constructor(entityType, validationError, entityId) {
767
+ const idSuffix = entityId !== void 0 ? ` (id: ${entityId})` : "";
768
+ super(`SDE validation failed for ${entityType}${idSuffix}`);
769
+ this.name = "SdeValidationError";
770
+ this.validationError = validationError;
771
+ this.entityType = entityType;
772
+ this.entityId = entityId;
773
+ }
774
+ };
775
+ var SdeVersionMismatchError = class extends SdeError {
776
+ expected;
777
+ actual;
778
+ constructor(expected, actual) {
779
+ super(`SDE version mismatch: expected ${expected}, got ${actual}`);
780
+ this.name = "SdeVersionMismatchError";
781
+ this.expected = expected;
782
+ this.actual = actual;
783
+ }
784
+ };
785
+ function isSdeError(error) {
786
+ return error instanceof SdeError;
787
+ }
788
+ function isSdeDatabaseError(error) {
789
+ return error instanceof SdeDatabaseError;
790
+ }
791
+ function isSdeValidationError(error) {
792
+ return error instanceof SdeValidationError;
793
+ }
794
+ function isSdeVersionMismatch(error) {
795
+ return error instanceof SdeVersionMismatchError;
796
+ }
797
+
798
+ // src/sde/ingestion/SdeExtractor.ts
799
+ function findEntry(zip, filename) {
800
+ const basename = filename.replace(/^.*[\\/]/, "");
801
+ return zip.getEntries().find((entry) => {
802
+ if (entry.isDirectory) return false;
803
+ const entryBasename = entry.entryName.replace(/^.*[\\/]/, "");
804
+ return entryBasename === basename || entry.entryName === filename || entry.entryName === `sde/${filename}`;
805
+ });
806
+ }
807
+ function readEntryAsString(entry) {
808
+ const buffer = entry.getData();
809
+ return buffer.toString("utf-8");
810
+ }
811
+ var SdeExtractor = class {
812
+ readMetadata(zipPath) {
813
+ const zip = new AdmZip(zipPath);
814
+ const entry = findEntry(zip, SDE_METADATA_FILENAME);
815
+ if (!entry) {
816
+ throw new SdeError(
817
+ `Metadata file '${SDE_METADATA_FILENAME}' not found in archive: ${zipPath}`
818
+ );
819
+ }
820
+ const content = readEntryAsString(entry);
821
+ const parsed = yaml.load(content);
822
+ const bn = parsed.buildNumber;
823
+ const rd = parsed.releaseDate;
824
+ return {
825
+ buildNumber: typeof bn === "string" || typeof bn === "number" ? String(bn) : "",
826
+ releaseDate: typeof rd === "string" || typeof rd === "number" ? String(rd) : ""
827
+ };
828
+ }
829
+ parseFile(zipPath, filename) {
830
+ const zip = new AdmZip(zipPath);
831
+ return this.parseFileFromZip(zip, filename);
832
+ }
833
+ parseFiles(zipPath, filenames) {
834
+ const zip = new AdmZip(zipPath);
835
+ const results = [];
836
+ for (const filename of filenames) {
837
+ const entry = findEntry(zip, filename);
838
+ if (!entry) {
839
+ continue;
840
+ }
841
+ results.push(this.parseEntryAsFile(entry, filename));
842
+ }
843
+ return results;
844
+ }
845
+ extractAll(zipPath, outputDir) {
846
+ const zip = new AdmZip(zipPath);
847
+ zip.extractAllTo(outputDir, true);
848
+ }
849
+ listFiles(zipPath) {
850
+ const zip = new AdmZip(zipPath);
851
+ return zip.getEntries().filter(
852
+ (entry) => !entry.isDirectory && entry.entryName.endsWith(".yaml")
853
+ ).map((entry) => entry.entryName);
854
+ }
855
+ parseFileFromZip(zip, filename) {
856
+ const entry = findEntry(zip, filename);
857
+ if (!entry) {
858
+ throw new SdeError(`File '${filename}' not found in archive`);
859
+ }
860
+ return this.parseEntryAsFile(entry, filename);
861
+ }
862
+ parseEntryAsFile(entry, filename) {
863
+ const content = readEntryAsString(entry);
864
+ const parsed = yaml.load(content);
865
+ const records = new Map(
866
+ Object.entries(parsed).map(([key, value]) => {
867
+ const numKey = Number(key);
868
+ return [Number.isNaN(numKey) ? key : numKey, value];
869
+ })
870
+ );
871
+ return { filename, records };
872
+ }
873
+ };
874
+
875
+ // src/sde/ingestion/transforms.ts
876
+ function extractLocale(field, locale = "en", fallback = "") {
877
+ if (field == null) return fallback;
878
+ if (typeof field === "string") return field;
879
+ if (typeof field === "object" && !Array.isArray(field)) {
880
+ const map = field;
881
+ const value = map[locale];
882
+ if (typeof value === "string") return value;
883
+ return fallback;
884
+ }
885
+ return fallback;
886
+ }
887
+ function normalizeSdeFieldName(name) {
888
+ return name.replace(/ID(?=[A-Z]|$)/g, "Id");
889
+ }
890
+ function isLocaleMap(value) {
891
+ if (value == null || typeof value !== "object" || Array.isArray(value)) {
892
+ return false;
893
+ }
894
+ return "en" in value;
895
+ }
896
+ function normalizeNested(value) {
897
+ if (value == null || typeof value !== "object") return value;
898
+ if (Array.isArray(value)) return value.map(normalizeNested);
899
+ const obj = value;
900
+ if (isLocaleMap(obj)) return extractLocale(obj);
901
+ const out = {};
902
+ for (const [k, v] of Object.entries(obj)) {
903
+ out[normalizeSdeFieldName(k)] = normalizeNested(v);
904
+ }
905
+ return out;
906
+ }
907
+ function transformRecordNative(entityId, raw, spec) {
908
+ const row = {};
909
+ if (spec.injectId) {
910
+ row[spec.idAttribute] = typeof entityId === "string" ? entityId : Number(entityId);
911
+ }
912
+ for (const [key, value] of Object.entries(raw)) {
913
+ const normalizedKey = normalizeSdeFieldName(key);
914
+ if (isLocaleMap(value)) {
915
+ row[normalizedKey] = extractLocale(value);
916
+ } else {
917
+ row[normalizedKey] = normalizeNested(value);
918
+ }
919
+ }
920
+ return row;
921
+ }
922
+
923
+ // src/sde/SdeDataProvider.ts
924
+ var SdeDataProvider = class _SdeDataProvider {
925
+ entities = /* @__PURE__ */ new Map();
926
+ fkIndexes = /* @__PURE__ */ new Map();
927
+ versionInfo;
928
+ constructor(version) {
929
+ this.versionInfo = version;
930
+ }
931
+ static fromDirectory(dirPath) {
932
+ const resolvedDir = path.resolve(dirPath);
933
+ if (!fs.existsSync(resolvedDir)) {
934
+ throw new SdeError(`SDE directory not found: ${resolvedDir}`);
935
+ }
936
+ let version = {
937
+ version: "unknown",
938
+ buildDate: "unknown",
939
+ importedAt: (/* @__PURE__ */ new Date()).toISOString()
940
+ };
941
+ const metaPath = path.join(resolvedDir, "_sde.yaml");
942
+ if (fs.existsSync(metaPath)) {
943
+ const metaContent = fs.readFileSync(metaPath, "utf-8");
944
+ const parsed = yaml2.load(metaContent);
945
+ const sdeBlock = parsed.sde ?? parsed;
946
+ const bn = sdeBlock.buildNumber;
947
+ const rd = sdeBlock.releaseDate;
948
+ version = {
949
+ version: typeof bn === "string" || typeof bn === "number" ? String(bn) : "unknown",
950
+ buildDate: typeof rd === "string" || typeof rd === "number" ? String(rd) : "unknown",
951
+ importedAt: (/* @__PURE__ */ new Date()).toISOString()
952
+ };
953
+ }
954
+ const provider = new _SdeDataProvider(version);
955
+ for (const spec of SDE_FILE_REGISTRY) {
956
+ const filePath = path.join(resolvedDir, spec.yamlFile);
957
+ if (!fs.existsSync(filePath)) continue;
958
+ const content = fs.readFileSync(filePath, "utf-8");
959
+ const parsed = yaml2.load(content);
960
+ if (!parsed || typeof parsed !== "object") continue;
961
+ provider.loadRecords(spec, parsed);
962
+ }
963
+ return provider;
964
+ }
965
+ static fromZip(zipPath) {
966
+ const resolvedPath = path.resolve(zipPath);
967
+ if (!fs.existsSync(resolvedPath)) {
968
+ throw new SdeError(`SDE ZIP file not found: ${resolvedPath}`);
969
+ }
970
+ const extractor = new SdeExtractor();
971
+ const metadata = extractor.readMetadata(resolvedPath);
972
+ const version = {
973
+ version: metadata.buildNumber || "unknown",
974
+ buildDate: metadata.releaseDate || "unknown",
975
+ importedAt: (/* @__PURE__ */ new Date()).toISOString()
976
+ };
977
+ const provider = new _SdeDataProvider(version);
978
+ const yamlFiles = SDE_FILE_REGISTRY.map((s) => s.yamlFile);
979
+ const parsedFiles = extractor.parseFiles(resolvedPath, yamlFiles);
980
+ const specMap = new Map(SDE_FILE_REGISTRY.map((s) => [s.yamlFile, s]));
981
+ for (const file of parsedFiles) {
982
+ const spec = specMap.get(file.filename);
983
+ if (!spec) continue;
984
+ const rawEntries = {};
985
+ for (const [key, value] of file.records) {
986
+ rawEntries[key] = value;
987
+ }
988
+ provider.loadRecords(spec, rawEntries);
989
+ }
990
+ return provider;
991
+ }
992
+ loadRecords(spec, raw) {
993
+ const records = /* @__PURE__ */ new Map();
994
+ for (const [key, value] of Object.entries(raw)) {
995
+ if (value == null || typeof value !== "object") continue;
996
+ const id = spec.idType === "string" ? key : Number(key);
997
+ const transformed = transformRecordNative(id, value, spec);
998
+ records.set(id, transformed);
999
+ }
1000
+ this.entities.set(spec.tableName, records);
1001
+ }
1002
+ // ---------------------------------------------------------------
1003
+ // Generic helpers
1004
+ // ---------------------------------------------------------------
1005
+ getById(tableName, id) {
1006
+ const table = this.entities.get(tableName);
1007
+ if (!table) return null;
1008
+ const row = table.get(id);
1009
+ return row ?? null;
1010
+ }
1011
+ getByFk(tableName, fkField, fkValue) {
1012
+ const indexKey = `${tableName}:${fkField}`;
1013
+ let index = this.fkIndexes.get(indexKey);
1014
+ if (!index) {
1015
+ index = /* @__PURE__ */ new Map();
1016
+ const table = this.entities.get(tableName);
1017
+ if (table) {
1018
+ for (const row of table.values()) {
1019
+ const val = row[fkField];
1020
+ if (val == null) continue;
1021
+ const existing = index.get(val);
1022
+ if (existing) existing.push(row);
1023
+ else index.set(val, [row]);
1024
+ }
1025
+ }
1026
+ this.fkIndexes.set(indexKey, index);
1027
+ }
1028
+ return index.get(fkValue) ?? [];
1029
+ }
1030
+ getAllRecords(tableName) {
1031
+ const table = this.entities.get(tableName);
1032
+ if (!table) return [];
1033
+ return Array.from(table.values());
1034
+ }
1035
+ search(tableName, field, query, limit) {
1036
+ const table = this.entities.get(tableName);
1037
+ if (!table) return [];
1038
+ const lowerQuery = query.toLowerCase();
1039
+ const results = [];
1040
+ for (const row of table.values()) {
1041
+ const val = row[field];
1042
+ if (typeof val === "string" && val.toLowerCase().includes(lowerQuery)) {
1043
+ results.push(row);
1044
+ if (results.length >= limit) break;
1045
+ }
1046
+ }
1047
+ return results;
1048
+ }
1049
+ filterBy(tableName, predicate) {
1050
+ const table = this.entities.get(tableName);
1051
+ if (!table) return [];
1052
+ const results = [];
1053
+ for (const row of table.values()) {
1054
+ if (predicate(row)) results.push(row);
1055
+ }
1056
+ return results;
1057
+ }
1058
+ // ---------------------------------------------------------------
1059
+ // Generic entity accessors (for niche entities)
1060
+ // ---------------------------------------------------------------
1061
+ getEntity(tableName, id) {
1062
+ return this.getById(tableName, id);
1063
+ }
1064
+ getAllEntities(tableName) {
1065
+ return this.getAllRecords(tableName);
1066
+ }
1067
+ // ---------------------------------------------------------------
1068
+ // Types, Groups, Categories
1069
+ // ---------------------------------------------------------------
1070
+ getType(typeId) {
1071
+ return this.getById("eve_types", typeId);
1072
+ }
1073
+ getTypesByGroup(groupId) {
1074
+ return this.getByFk("eve_types", "groupId", groupId);
1075
+ }
1076
+ getGroup(groupId) {
1077
+ return this.getById("eve_groups", groupId);
1078
+ }
1079
+ getGroupsByCategory(categoryId) {
1080
+ return this.getByFk("eve_groups", "categoryId", categoryId);
1081
+ }
1082
+ getCategory(categoryId) {
1083
+ return this.getById("eve_categories", categoryId);
1084
+ }
1085
+ getAllCategories() {
1086
+ return this.getAllRecords("eve_categories");
1087
+ }
1088
+ // ---------------------------------------------------------------
1089
+ // Regions, Constellations, Solar Systems, Stargates
1090
+ // ---------------------------------------------------------------
1091
+ getRegion(regionId) {
1092
+ return this.getById("eve_regions", regionId);
1093
+ }
1094
+ getAllRegions() {
1095
+ return this.getAllRecords("eve_regions");
1096
+ }
1097
+ getConstellation(constellationId) {
1098
+ return this.getById("eve_constellations", constellationId);
1099
+ }
1100
+ getConstellationsByRegion(regionId) {
1101
+ return this.getByFk(
1102
+ "eve_constellations",
1103
+ "regionId",
1104
+ regionId
1105
+ );
1106
+ }
1107
+ getSolarSystem(systemId) {
1108
+ return this.getById("eve_solar_systems", systemId);
1109
+ }
1110
+ getSolarSystemsByConstellation(constellationId) {
1111
+ return this.getByFk(
1112
+ "eve_solar_systems",
1113
+ "constellationId",
1114
+ constellationId
1115
+ );
1116
+ }
1117
+ getStargate(stargateId) {
1118
+ return this.getById("eve_stargates", stargateId);
1119
+ }
1120
+ getStargatesBySystem(systemId) {
1121
+ return this.getByFk("eve_stargates", "solarSystemId", systemId);
1122
+ }
1123
+ // ---------------------------------------------------------------
1124
+ // Search
1125
+ // ---------------------------------------------------------------
1126
+ searchTypesByName(query, limit = 25) {
1127
+ return this.search("eve_types", "name", query, limit);
1128
+ }
1129
+ searchSolarSystemsByName(query, limit = 25) {
1130
+ return this.search("eve_solar_systems", "name", query, limit);
1131
+ }
1132
+ // ---------------------------------------------------------------
1133
+ // Universe
1134
+ // ---------------------------------------------------------------
1135
+ getStar(starId) {
1136
+ return this.getById("eve_stars", starId);
1137
+ }
1138
+ getStarBySystem(systemId) {
1139
+ const stars = this.getByFk("eve_stars", "solarSystemId", systemId);
1140
+ return stars[0] ?? null;
1141
+ }
1142
+ getPlanet(planetId) {
1143
+ return this.getById("eve_planets", planetId);
1144
+ }
1145
+ getPlanetsBySystem(systemId) {
1146
+ return this.getByFk("eve_planets", "solarSystemId", systemId);
1147
+ }
1148
+ getMoon(moonId) {
1149
+ return this.getById("eve_moons", moonId);
1150
+ }
1151
+ getMoonsBySystem(systemId) {
1152
+ return this.getByFk("eve_moons", "solarSystemId", systemId);
1153
+ }
1154
+ getAsteroidBelt(asteroidBeltId) {
1155
+ return this.getById("eve_asteroid_belts", asteroidBeltId);
1156
+ }
1157
+ getAsteroidBeltsBySystem(systemId) {
1158
+ return this.getByFk(
1159
+ "eve_asteroid_belts",
1160
+ "solarSystemId",
1161
+ systemId
1162
+ );
1163
+ }
1164
+ // ---------------------------------------------------------------
1165
+ // Character/Lore
1166
+ // ---------------------------------------------------------------
1167
+ getFaction(factionId) {
1168
+ return this.getById("eve_factions", factionId);
1169
+ }
1170
+ getAllFactions() {
1171
+ return this.getAllRecords("eve_factions");
1172
+ }
1173
+ getRace(raceId) {
1174
+ return this.getById("eve_races", raceId);
1175
+ }
1176
+ getAllRaces() {
1177
+ return this.getAllRecords("eve_races");
1178
+ }
1179
+ getBloodline(bloodlineId) {
1180
+ return this.getById("eve_bloodlines", bloodlineId);
1181
+ }
1182
+ getBloodlinesByRace(raceId) {
1183
+ return this.getByFk("eve_bloodlines", "raceId", raceId);
1184
+ }
1185
+ getAncestry(ancestryId) {
1186
+ return this.getById("eve_ancestries", ancestryId);
1187
+ }
1188
+ getAncestriesByBloodline(bloodlineId) {
1189
+ return this.getByFk("eve_ancestries", "bloodlineId", bloodlineId);
1190
+ }
1191
+ // ---------------------------------------------------------------
1192
+ // NPC Infrastructure
1193
+ // ---------------------------------------------------------------
1194
+ getNpcCorporation(corporationId) {
1195
+ return this.getById("eve_npc_corporations", corporationId);
1196
+ }
1197
+ getNpcCorporationsByFaction(factionId) {
1198
+ return this.getByFk(
1199
+ "eve_npc_corporations",
1200
+ "factionId",
1201
+ factionId
1202
+ );
1203
+ }
1204
+ getNpcStation(stationId) {
1205
+ return this.getById("eve_npc_stations", stationId);
1206
+ }
1207
+ getNpcStationsBySystem(systemId) {
1208
+ return this.getByFk(
1209
+ "eve_npc_stations",
1210
+ "solarSystemId",
1211
+ systemId
1212
+ );
1213
+ }
1214
+ getNpcStationsByOwner(ownerId) {
1215
+ return this.getByFk("eve_npc_stations", "ownerId", ownerId);
1216
+ }
1217
+ // ---------------------------------------------------------------
1218
+ // Market
1219
+ // ---------------------------------------------------------------
1220
+ getMarketGroup(marketGroupId) {
1221
+ return this.getById("eve_market_groups", marketGroupId);
1222
+ }
1223
+ getMarketGroupsByParent(parentGroupId) {
1224
+ return this.getByFk(
1225
+ "eve_market_groups",
1226
+ "parentGroupId",
1227
+ parentGroupId
1228
+ );
1229
+ }
1230
+ getRootMarketGroups() {
1231
+ return this.filterBy(
1232
+ "eve_market_groups",
1233
+ (r) => r.parentGroupId == null
1234
+ );
1235
+ }
1236
+ getTypesByMarketGroup(marketGroupId) {
1237
+ return this.getByFk("eve_types", "marketGroupId", marketGroupId);
1238
+ }
1239
+ searchMarketGroupsByName(query, limit = 25) {
1240
+ return this.search("eve_market_groups", "name", query, limit);
1241
+ }
1242
+ // ---------------------------------------------------------------
1243
+ // Meta/UI
1244
+ // ---------------------------------------------------------------
1245
+ getMetaGroup(metaGroupId) {
1246
+ return this.getById("eve_meta_groups", metaGroupId);
1247
+ }
1248
+ getAllMetaGroups() {
1249
+ return this.getAllRecords("eve_meta_groups");
1250
+ }
1251
+ getIcon(iconId) {
1252
+ return this.getById("eve_icons", iconId);
1253
+ }
1254
+ getGraphic(graphicId) {
1255
+ return this.getById("eve_graphics", graphicId);
1256
+ }
1257
+ // ---------------------------------------------------------------
1258
+ // Dogma
1259
+ // ---------------------------------------------------------------
1260
+ getDogmaAttribute(attributeId) {
1261
+ return this.getById("eve_dogma_attributes", attributeId);
1262
+ }
1263
+ searchDogmaAttributesByName(query, limit = 25) {
1264
+ return this.search(
1265
+ "eve_dogma_attributes",
1266
+ "name",
1267
+ query,
1268
+ limit
1269
+ );
1270
+ }
1271
+ getDogmaEffect(effectId) {
1272
+ return this.getById("eve_dogma_effects", effectId);
1273
+ }
1274
+ searchDogmaEffectsByName(query, limit = 25) {
1275
+ return this.search("eve_dogma_effects", "name", query, limit);
1276
+ }
1277
+ // ---------------------------------------------------------------
1278
+ // Industry
1279
+ // ---------------------------------------------------------------
1280
+ getBlueprint(blueprintTypeId) {
1281
+ return this.getById("eve_blueprints", blueprintTypeId);
1282
+ }
1283
+ getPlanetSchematic(planetSchematicId) {
1284
+ return this.getById(
1285
+ "eve_planet_schematics",
1286
+ planetSchematicId
1287
+ );
1288
+ }
1289
+ getAllPlanetSchematics() {
1290
+ return this.getAllRecords("eve_planet_schematics");
1291
+ }
1292
+ // ---------------------------------------------------------------
1293
+ // Agent System
1294
+ // ---------------------------------------------------------------
1295
+ getAgentType(agentTypeId) {
1296
+ return this.getById("eve_agent_types", agentTypeId);
1297
+ }
1298
+ getAllAgentTypes() {
1299
+ return this.getAllRecords("eve_agent_types");
1300
+ }
1301
+ getAgentInSpace(characterId) {
1302
+ return this.getById("eve_agents_in_space", characterId);
1303
+ }
1304
+ getAgentsInSpaceBySystem(systemId) {
1305
+ return this.getByFk(
1306
+ "eve_agents_in_space",
1307
+ "solarSystemId",
1308
+ systemId
1309
+ );
1310
+ }
1311
+ // ---------------------------------------------------------------
1312
+ // Certificates
1313
+ // ---------------------------------------------------------------
1314
+ getCertificate(certificateId) {
1315
+ return this.getById("eve_certificates", certificateId);
1316
+ }
1317
+ getAllCertificates() {
1318
+ return this.getAllRecords("eve_certificates");
1319
+ }
1320
+ // ---------------------------------------------------------------
1321
+ // Character Attributes
1322
+ // ---------------------------------------------------------------
1323
+ getCharacterAttribute(attributeId) {
1324
+ return this.getById(
1325
+ "eve_character_attributes",
1326
+ attributeId
1327
+ );
1328
+ }
1329
+ getAllCharacterAttributes() {
1330
+ return this.getAllRecords("eve_character_attributes");
1331
+ }
1332
+ // ---------------------------------------------------------------
1333
+ // NPC Characters
1334
+ // ---------------------------------------------------------------
1335
+ getNpcCharacter(characterId) {
1336
+ return this.getById("eve_npc_characters", characterId);
1337
+ }
1338
+ getNpcCharactersByCorporation(corporationId) {
1339
+ return this.getByFk(
1340
+ "eve_npc_characters",
1341
+ "corporationId",
1342
+ corporationId
1343
+ );
1344
+ }
1345
+ searchNpcCharactersByName(query, limit = 25) {
1346
+ return this.search(
1347
+ "eve_npc_characters",
1348
+ "name",
1349
+ query,
1350
+ limit
1351
+ );
1352
+ }
1353
+ // ---------------------------------------------------------------
1354
+ // Clone Grades
1355
+ // ---------------------------------------------------------------
1356
+ getCloneGrade(cloneGradeId) {
1357
+ return this.getById("eve_clone_grades", cloneGradeId);
1358
+ }
1359
+ getAllCloneGrades() {
1360
+ return this.getAllRecords("eve_clone_grades");
1361
+ }
1362
+ // ---------------------------------------------------------------
1363
+ // Corporation Reference
1364
+ // ---------------------------------------------------------------
1365
+ getCorporationActivity(corporationActivityId) {
1366
+ return this.getById(
1367
+ "eve_corporation_activities",
1368
+ corporationActivityId
1369
+ );
1370
+ }
1371
+ getAllCorporationActivities() {
1372
+ return this.getAllRecords(
1373
+ "eve_corporation_activities"
1374
+ );
1375
+ }
1376
+ getNpcCorporationDivision(npcCorporationDivisionId) {
1377
+ return this.getById(
1378
+ "eve_npc_corporation_divisions",
1379
+ npcCorporationDivisionId
1380
+ );
1381
+ }
1382
+ getAllNpcCorporationDivisions() {
1383
+ return this.getAllRecords(
1384
+ "eve_npc_corporation_divisions"
1385
+ );
1386
+ }
1387
+ // ---------------------------------------------------------------
1388
+ // Dogma Reference
1389
+ // ---------------------------------------------------------------
1390
+ getDogmaAttributeCategory(attributeCategoryId) {
1391
+ return this.getById(
1392
+ "eve_dogma_attribute_categories",
1393
+ attributeCategoryId
1394
+ );
1395
+ }
1396
+ getAllDogmaAttributeCategories() {
1397
+ return this.getAllRecords(
1398
+ "eve_dogma_attribute_categories"
1399
+ );
1400
+ }
1401
+ getDogmaUnit(unitId) {
1402
+ return this.getById("eve_dogma_units", unitId);
1403
+ }
1404
+ getAllDogmaUnits() {
1405
+ return this.getAllRecords("eve_dogma_units");
1406
+ }
1407
+ // ---------------------------------------------------------------
1408
+ // Industry Reference
1409
+ // ---------------------------------------------------------------
1410
+ getIndustryActivity(industryActivityId) {
1411
+ return this.getById(
1412
+ "eve_industry_activities",
1413
+ industryActivityId
1414
+ );
1415
+ }
1416
+ getAllIndustryActivities() {
1417
+ return this.getAllRecords("eve_industry_activities");
1418
+ }
1419
+ // ---------------------------------------------------------------
1420
+ // Landmarks
1421
+ // ---------------------------------------------------------------
1422
+ getLandmark(landmarkId) {
1423
+ return this.getById("eve_landmarks", landmarkId);
1424
+ }
1425
+ getAllLandmarks() {
1426
+ return this.getAllRecords("eve_landmarks");
1427
+ }
1428
+ // ---------------------------------------------------------------
1429
+ // Notifications
1430
+ // ---------------------------------------------------------------
1431
+ getNotificationType(notificationTypeId) {
1432
+ return this.getById(
1433
+ "eve_notification_types",
1434
+ notificationTypeId
1435
+ );
1436
+ }
1437
+ // ---------------------------------------------------------------
1438
+ // Schools
1439
+ // ---------------------------------------------------------------
1440
+ getSchool(schoolId) {
1441
+ return this.getById("eve_schools", schoolId);
1442
+ }
1443
+ getAllSchools() {
1444
+ return this.getAllRecords("eve_schools");
1445
+ }
1446
+ // ---------------------------------------------------------------
1447
+ // Secondary Suns
1448
+ // ---------------------------------------------------------------
1449
+ getSecondarySun(secondarySunId) {
1450
+ return this.getById("eve_secondary_suns", secondarySunId);
1451
+ }
1452
+ getSecondarySunsBySystem(systemId) {
1453
+ return this.getByFk(
1454
+ "eve_secondary_suns",
1455
+ "solarSystemId",
1456
+ systemId
1457
+ );
1458
+ }
1459
+ // ---------------------------------------------------------------
1460
+ // Skins
1461
+ // ---------------------------------------------------------------
1462
+ getSkin(skinId) {
1463
+ return this.getById("eve_skins", skinId);
1464
+ }
1465
+ getSkinLicense(licenseTypeId) {
1466
+ return this.getById("eve_skin_licenses", licenseTypeId);
1467
+ }
1468
+ getSkinLicensesBySkin(skinId) {
1469
+ return this.getByFk("eve_skin_licenses", "skinId", skinId);
1470
+ }
1471
+ // ---------------------------------------------------------------
1472
+ // Station Operations & Services
1473
+ // ---------------------------------------------------------------
1474
+ getStationOperation(stationOperationId) {
1475
+ return this.getById(
1476
+ "eve_station_operations",
1477
+ stationOperationId
1478
+ );
1479
+ }
1480
+ getAllStationOperations() {
1481
+ return this.getAllRecords("eve_station_operations");
1482
+ }
1483
+ getStationService(stationServiceId) {
1484
+ return this.getById(
1485
+ "eve_station_services",
1486
+ stationServiceId
1487
+ );
1488
+ }
1489
+ getAllStationServices() {
1490
+ return this.getAllRecords("eve_station_services");
1491
+ }
1492
+ // ---------------------------------------------------------------
1493
+ // Type Properties
1494
+ // ---------------------------------------------------------------
1495
+ getTypeDogma(typeId) {
1496
+ return this.getById("eve_type_dogma", typeId);
1497
+ }
1498
+ getTypeMaterial(typeId) {
1499
+ return this.getById("eve_type_materials", typeId);
1500
+ }
1501
+ getTypeBonus(typeId) {
1502
+ return this.getById("eve_type_bonuses", typeId);
1503
+ }
1504
+ // ---------------------------------------------------------------
1505
+ // Missions & Content
1506
+ // ---------------------------------------------------------------
1507
+ getMission(missionId) {
1508
+ return this.getById("eve_missions", missionId);
1509
+ }
1510
+ getDungeon(dungeonId) {
1511
+ return this.getById("eve_dungeons", dungeonId);
1512
+ }
1513
+ getEpicArc(epicArcId) {
1514
+ return this.getById("eve_epic_arcs", epicArcId);
1515
+ }
1516
+ getAllEpicArcs() {
1517
+ return this.getAllRecords("eve_epic_arcs");
1518
+ }
1519
+ // ---------------------------------------------------------------
1520
+ // Version & Lifecycle
1521
+ // ---------------------------------------------------------------
1522
+ getVersion() {
1523
+ return { ...this.versionInfo };
1524
+ }
1525
+ close() {
1526
+ this.entities.clear();
1527
+ this.fkIndexes.clear();
1528
+ }
1529
+ };
1530
+
1531
+ // src/sde/MemorySdeProvider.ts
1532
+ var MemorySdeProvider = class {
1533
+ data = /* @__PURE__ */ new Map();
1534
+ versionInfo;
1535
+ constructor(data = {}) {
1536
+ const register = (key, items, idFn) => {
1537
+ this.data.set(
1538
+ key,
1539
+ new Map((items ?? []).map((item) => [idFn(item), item]))
1540
+ );
1541
+ };
1542
+ register("eve_types", data.types, (t) => t.typeId);
1543
+ register("eve_groups", data.groups, (g) => g.groupId);
1544
+ register("eve_categories", data.categories, (c) => c.categoryId);
1545
+ register("eve_regions", data.regions, (r) => r.regionId);
1546
+ register(
1547
+ "eve_constellations",
1548
+ data.constellations,
1549
+ (c) => c.constellationId
1550
+ );
1551
+ register("eve_solar_systems", data.solarSystems, (s) => s.systemId);
1552
+ register("eve_stargates", data.stargates, (s) => s.stargateId);
1553
+ register("eve_stars", data.stars, (s) => s.starId);
1554
+ register("eve_planets", data.planets, (p) => p.planetId);
1555
+ register("eve_moons", data.moons, (m) => m.moonId);
1556
+ register("eve_asteroid_belts", data.asteroidBelts, (a) => a.asteroidBeltId);
1557
+ register("eve_factions", data.factions, (f) => f.factionId);
1558
+ register("eve_races", data.races, (r) => r.raceId);
1559
+ register("eve_bloodlines", data.bloodlines, (b) => b.bloodlineId);
1560
+ register("eve_ancestries", data.ancestries, (a) => a.ancestryId);
1561
+ register(
1562
+ "eve_npc_corporations",
1563
+ data.npcCorporations,
1564
+ (c) => c.corporationId
1565
+ );
1566
+ register("eve_npc_stations", data.npcStations, (s) => s.stationId);
1567
+ register("eve_market_groups", data.marketGroups, (g) => g.marketGroupId);
1568
+ register("eve_meta_groups", data.metaGroups, (g) => g.metaGroupId);
1569
+ register("eve_icons", data.icons, (i) => i.iconId);
1570
+ register("eve_graphics", data.graphics, (g) => g.graphicId);
1571
+ register(
1572
+ "eve_dogma_attributes",
1573
+ data.dogmaAttributes,
1574
+ (a) => a.attributeId
1575
+ );
1576
+ register("eve_dogma_effects", data.dogmaEffects, (e) => e.effectId);
1577
+ register("eve_blueprints", data.blueprints, (b) => b.blueprintTypeId);
1578
+ register(
1579
+ "eve_planet_schematics",
1580
+ data.planetSchematics,
1581
+ (s) => s.planetSchematicId
1582
+ );
1583
+ register("eve_agent_types", data.agentTypes, (a) => a.agentTypeId);
1584
+ register("eve_agents_in_space", data.agentsInSpace, (a) => a.characterId);
1585
+ register("eve_certificates", data.certificates, (c) => c.certificateId);
1586
+ register(
1587
+ "eve_character_attributes",
1588
+ data.characterAttributes,
1589
+ (c) => c.attributeId
1590
+ );
1591
+ register("eve_clone_grades", data.cloneGrades, (c) => c.cloneGradeId);
1592
+ register(
1593
+ "eve_corporation_activities",
1594
+ data.corporationActivities,
1595
+ (c) => c.corporationActivityId
1596
+ );
1597
+ register(
1598
+ "eve_dogma_attribute_categories",
1599
+ data.dogmaAttributeCategories,
1600
+ (d) => d.attributeCategoryId
1601
+ );
1602
+ register("eve_dogma_units", data.dogmaUnits, (d) => d.unitId);
1603
+ register(
1604
+ "eve_industry_activities",
1605
+ data.industryActivities,
1606
+ (i) => i.industryActivityId
1607
+ );
1608
+ register("eve_landmarks", data.landmarks, (l) => l.landmarkId);
1609
+ register(
1610
+ "eve_notification_types",
1611
+ data.notificationTypes,
1612
+ (n) => n.notificationTypeId
1613
+ );
1614
+ register("eve_npc_characters", data.npcCharacters, (n) => n.characterId);
1615
+ register(
1616
+ "eve_npc_corporation_divisions",
1617
+ data.npcCorporationDivisions,
1618
+ (n) => n.npcCorporationDivisionId
1619
+ );
1620
+ register("eve_schools", data.schools, (s) => s.schoolId);
1621
+ register("eve_secondary_suns", data.secondarySuns, (s) => s.secondarySunId);
1622
+ register("eve_skins", data.skins, (s) => s.skinId);
1623
+ register("eve_skin_licenses", data.skinLicenses, (s) => s.licenseTypeId);
1624
+ register(
1625
+ "eve_station_operations",
1626
+ data.stationOperations,
1627
+ (s) => s.stationOperationId
1628
+ );
1629
+ register(
1630
+ "eve_station_services",
1631
+ data.stationServices,
1632
+ (s) => s.stationServiceId
1633
+ );
1634
+ register("eve_type_dogma", data.typeDogma, (t) => t.typeId);
1635
+ register("eve_type_materials", data.typeMaterials, (t) => t.typeId);
1636
+ register("eve_type_bonuses", data.typeBonuses, (t) => t.typeId);
1637
+ register("eve_missions", data.missions, (m) => m.missionId);
1638
+ register("eve_dungeons", data.dungeons, (d) => d.dungeonId);
1639
+ register("eve_epic_arcs", data.epicArcs, (e) => e.epicArcId);
1640
+ this.versionInfo = {
1641
+ version: data.version?.version ?? "1.0.0-test",
1642
+ buildDate: data.version?.buildDate ?? "2024-01-01T00:00:00Z",
1643
+ importedAt: data.version?.importedAt ?? "2024-01-01T00:00:00Z",
1644
+ checksum: data.version?.checksum
1645
+ };
1646
+ }
1647
+ getById(table, id) {
1648
+ return this.data.get(table)?.get(id) ?? null;
1649
+ }
1650
+ getAllFrom(table) {
1651
+ const map = this.data.get(table);
1652
+ return map ? Array.from(map.values()) : [];
1653
+ }
1654
+ filterBy(table, field, value) {
1655
+ return this.getAllFrom(table).filter(
1656
+ (item) => item[field] === value
1657
+ );
1658
+ }
1659
+ searchBy(table, field, query, limit = 25) {
1660
+ const lowerQuery = query.toLowerCase();
1661
+ const results = [];
1662
+ for (const item of this.getAllFrom(table)) {
1663
+ const val = item[field];
1664
+ if (typeof val === "string" && val.toLowerCase().includes(lowerQuery)) {
1665
+ results.push(item);
1666
+ if (results.length >= limit) break;
1667
+ }
1668
+ }
1669
+ return results;
1670
+ }
1671
+ // --- Types, Groups, Categories ---
1672
+ getType(typeId) {
1673
+ return this.getById("eve_types", typeId);
1674
+ }
1675
+ getTypesByGroup(groupId) {
1676
+ return this.filterBy("eve_types", "groupId", groupId);
1677
+ }
1678
+ getGroup(groupId) {
1679
+ return this.getById("eve_groups", groupId);
1680
+ }
1681
+ getGroupsByCategory(categoryId) {
1682
+ return this.filterBy("eve_groups", "categoryId", categoryId);
1683
+ }
1684
+ getCategory(categoryId) {
1685
+ return this.getById("eve_categories", categoryId);
1686
+ }
1687
+ getAllCategories() {
1688
+ return this.getAllFrom("eve_categories");
1689
+ }
1690
+ // --- Regions, Constellations, Solar Systems, Stargates ---
1691
+ getRegion(regionId) {
1692
+ return this.getById("eve_regions", regionId);
1693
+ }
1694
+ getAllRegions() {
1695
+ return this.getAllFrom("eve_regions");
1696
+ }
1697
+ getConstellation(constellationId) {
1698
+ return this.getById("eve_constellations", constellationId);
1699
+ }
1700
+ getConstellationsByRegion(regionId) {
1701
+ return this.filterBy("eve_constellations", "regionId", regionId);
1702
+ }
1703
+ getSolarSystem(systemId) {
1704
+ return this.getById("eve_solar_systems", systemId);
1705
+ }
1706
+ getSolarSystemsByConstellation(constellationId) {
1707
+ return this.filterBy(
1708
+ "eve_solar_systems",
1709
+ "constellationId",
1710
+ constellationId
1711
+ );
1712
+ }
1713
+ getStargate(stargateId) {
1714
+ return this.getById("eve_stargates", stargateId);
1715
+ }
1716
+ getStargatesBySystem(systemId) {
1717
+ return this.filterBy("eve_stargates", "solarSystemId", systemId);
1718
+ }
1719
+ // --- Search ---
1720
+ searchTypesByName(query, limit = 25) {
1721
+ return this.searchBy("eve_types", "name", query, limit);
1722
+ }
1723
+ searchSolarSystemsByName(query, limit = 25) {
1724
+ return this.searchBy("eve_solar_systems", "name", query, limit);
1725
+ }
1726
+ // --- Universe ---
1727
+ getStar(starId) {
1728
+ return this.getById("eve_stars", starId);
1729
+ }
1730
+ getStarBySystem(systemId) {
1731
+ return this.filterBy("eve_stars", "solarSystemId", systemId)[0] ?? null;
1732
+ }
1733
+ getPlanet(planetId) {
1734
+ return this.getById("eve_planets", planetId);
1735
+ }
1736
+ getPlanetsBySystem(systemId) {
1737
+ return this.filterBy("eve_planets", "solarSystemId", systemId);
1738
+ }
1739
+ getMoon(moonId) {
1740
+ return this.getById("eve_moons", moonId);
1741
+ }
1742
+ getMoonsBySystem(systemId) {
1743
+ return this.filterBy("eve_moons", "solarSystemId", systemId);
1744
+ }
1745
+ getAsteroidBelt(asteroidBeltId) {
1746
+ return this.getById("eve_asteroid_belts", asteroidBeltId);
1747
+ }
1748
+ getAsteroidBeltsBySystem(systemId) {
1749
+ return this.filterBy("eve_asteroid_belts", "solarSystemId", systemId);
1750
+ }
1751
+ // --- Character/Lore ---
1752
+ getFaction(factionId) {
1753
+ return this.getById("eve_factions", factionId);
1754
+ }
1755
+ getAllFactions() {
1756
+ return this.getAllFrom("eve_factions");
1757
+ }
1758
+ getRace(raceId) {
1759
+ return this.getById("eve_races", raceId);
1760
+ }
1761
+ getAllRaces() {
1762
+ return this.getAllFrom("eve_races");
1763
+ }
1764
+ getBloodline(bloodlineId) {
1765
+ return this.getById("eve_bloodlines", bloodlineId);
1766
+ }
1767
+ getBloodlinesByRace(raceId) {
1768
+ return this.filterBy("eve_bloodlines", "raceId", raceId);
1769
+ }
1770
+ getAncestry(ancestryId) {
1771
+ return this.getById("eve_ancestries", ancestryId);
1772
+ }
1773
+ getAncestriesByBloodline(bloodlineId) {
1774
+ return this.filterBy("eve_ancestries", "bloodlineId", bloodlineId);
1775
+ }
1776
+ // --- NPC Infrastructure ---
1777
+ getNpcCorporation(corporationId) {
1778
+ return this.getById("eve_npc_corporations", corporationId);
1779
+ }
1780
+ getNpcCorporationsByFaction(factionId) {
1781
+ return this.filterBy("eve_npc_corporations", "factionId", factionId);
1782
+ }
1783
+ getNpcStation(stationId) {
1784
+ return this.getById("eve_npc_stations", stationId);
1785
+ }
1786
+ getNpcStationsBySystem(systemId) {
1787
+ return this.filterBy("eve_npc_stations", "solarSystemId", systemId);
1788
+ }
1789
+ getNpcStationsByOwner(ownerId) {
1790
+ return this.filterBy("eve_npc_stations", "ownerId", ownerId);
1791
+ }
1792
+ // --- Market ---
1793
+ getMarketGroup(marketGroupId) {
1794
+ return this.getById("eve_market_groups", marketGroupId);
1795
+ }
1796
+ getMarketGroupsByParent(parentGroupId) {
1797
+ return this.filterBy("eve_market_groups", "parentGroupId", parentGroupId);
1798
+ }
1799
+ getRootMarketGroups() {
1800
+ return this.getAllFrom("eve_market_groups").filter(
1801
+ (g) => g.parentGroupId === null
1802
+ );
1803
+ }
1804
+ getTypesByMarketGroup(marketGroupId) {
1805
+ return this.filterBy("eve_types", "marketGroupId", marketGroupId);
1806
+ }
1807
+ searchMarketGroupsByName(query, limit = 25) {
1808
+ return this.searchBy("eve_market_groups", "name", query, limit);
1809
+ }
1810
+ // --- Meta/UI ---
1811
+ getMetaGroup(metaGroupId) {
1812
+ return this.getById("eve_meta_groups", metaGroupId);
1813
+ }
1814
+ getAllMetaGroups() {
1815
+ return this.getAllFrom("eve_meta_groups");
1816
+ }
1817
+ getIcon(iconId) {
1818
+ return this.getById("eve_icons", iconId);
1819
+ }
1820
+ getGraphic(graphicId) {
1821
+ return this.getById("eve_graphics", graphicId);
1822
+ }
1823
+ // --- Dogma ---
1824
+ getDogmaAttribute(attributeId) {
1825
+ return this.getById("eve_dogma_attributes", attributeId);
1826
+ }
1827
+ searchDogmaAttributesByName(query, limit = 25) {
1828
+ return this.searchBy("eve_dogma_attributes", "name", query, limit);
1829
+ }
1830
+ getDogmaEffect(effectId) {
1831
+ return this.getById("eve_dogma_effects", effectId);
1832
+ }
1833
+ searchDogmaEffectsByName(query, limit = 25) {
1834
+ return this.searchBy("eve_dogma_effects", "name", query, limit);
1835
+ }
1836
+ getDogmaAttributeCategory(attributeCategoryId) {
1837
+ return this.getById("eve_dogma_attribute_categories", attributeCategoryId);
1838
+ }
1839
+ getAllDogmaAttributeCategories() {
1840
+ return this.getAllFrom("eve_dogma_attribute_categories");
1841
+ }
1842
+ getDogmaUnit(unitId) {
1843
+ return this.getById("eve_dogma_units", unitId);
1844
+ }
1845
+ getAllDogmaUnits() {
1846
+ return this.getAllFrom("eve_dogma_units");
1847
+ }
1848
+ // --- Industry ---
1849
+ getBlueprint(blueprintTypeId) {
1850
+ return this.getById("eve_blueprints", blueprintTypeId);
1851
+ }
1852
+ getPlanetSchematic(planetSchematicId) {
1853
+ return this.getById("eve_planet_schematics", planetSchematicId);
1854
+ }
1855
+ getAllPlanetSchematics() {
1856
+ return this.getAllFrom("eve_planet_schematics");
1857
+ }
1858
+ getIndustryActivity(industryActivityId) {
1859
+ return this.getById("eve_industry_activities", industryActivityId);
1860
+ }
1861
+ getAllIndustryActivities() {
1862
+ return this.getAllFrom("eve_industry_activities");
1863
+ }
1864
+ // --- Agent System ---
1865
+ getAgentType(agentTypeId) {
1866
+ return this.getById("eve_agent_types", agentTypeId);
1867
+ }
1868
+ getAllAgentTypes() {
1869
+ return this.getAllFrom("eve_agent_types");
1870
+ }
1871
+ getAgentInSpace(characterId) {
1872
+ return this.getById("eve_agents_in_space", characterId);
1873
+ }
1874
+ getAgentsInSpaceBySystem(systemId) {
1875
+ return this.filterBy("eve_agents_in_space", "solarSystemId", systemId);
1876
+ }
1877
+ // --- Certificates ---
1878
+ getCertificate(certificateId) {
1879
+ return this.getById("eve_certificates", certificateId);
1880
+ }
1881
+ getAllCertificates() {
1882
+ return this.getAllFrom("eve_certificates");
1883
+ }
1884
+ // --- Character Attributes ---
1885
+ getCharacterAttribute(attributeId) {
1886
+ return this.getById("eve_character_attributes", attributeId);
1887
+ }
1888
+ getAllCharacterAttributes() {
1889
+ return this.getAllFrom("eve_character_attributes");
1890
+ }
1891
+ // --- NPC Characters ---
1892
+ getNpcCharacter(characterId) {
1893
+ return this.getById("eve_npc_characters", characterId);
1894
+ }
1895
+ getNpcCharactersByCorporation(corporationId) {
1896
+ return this.filterBy("eve_npc_characters", "corporationId", corporationId);
1897
+ }
1898
+ searchNpcCharactersByName(query, limit = 25) {
1899
+ return this.searchBy("eve_npc_characters", "name", query, limit);
1900
+ }
1901
+ // --- Clone Grades ---
1902
+ getCloneGrade(cloneGradeId) {
1903
+ return this.getById("eve_clone_grades", cloneGradeId);
1904
+ }
1905
+ getAllCloneGrades() {
1906
+ return this.getAllFrom("eve_clone_grades");
1907
+ }
1908
+ // --- Corporation Reference ---
1909
+ getCorporationActivity(corporationActivityId) {
1910
+ return this.getById("eve_corporation_activities", corporationActivityId);
1911
+ }
1912
+ getAllCorporationActivities() {
1913
+ return this.getAllFrom("eve_corporation_activities");
1914
+ }
1915
+ getNpcCorporationDivision(npcCorporationDivisionId) {
1916
+ return this.getById(
1917
+ "eve_npc_corporation_divisions",
1918
+ npcCorporationDivisionId
1919
+ );
1920
+ }
1921
+ getAllNpcCorporationDivisions() {
1922
+ return this.getAllFrom("eve_npc_corporation_divisions");
1923
+ }
1924
+ // --- Landmarks ---
1925
+ getLandmark(landmarkId) {
1926
+ return this.getById("eve_landmarks", landmarkId);
1927
+ }
1928
+ getAllLandmarks() {
1929
+ return this.getAllFrom("eve_landmarks");
1930
+ }
1931
+ // --- Notifications ---
1932
+ getNotificationType(notificationTypeId) {
1933
+ return this.getById("eve_notification_types", notificationTypeId);
1934
+ }
1935
+ // --- Schools ---
1936
+ getSchool(schoolId) {
1937
+ return this.getById("eve_schools", schoolId);
1938
+ }
1939
+ getAllSchools() {
1940
+ return this.getAllFrom("eve_schools");
1941
+ }
1942
+ // --- Secondary Suns ---
1943
+ getSecondarySun(secondarySunId) {
1944
+ return this.getById("eve_secondary_suns", secondarySunId);
1945
+ }
1946
+ getSecondarySunsBySystem(systemId) {
1947
+ return this.filterBy("eve_secondary_suns", "solarSystemId", systemId);
1948
+ }
1949
+ // --- Skins ---
1950
+ getSkin(skinId) {
1951
+ return this.getById("eve_skins", skinId);
1952
+ }
1953
+ getSkinLicense(licenseTypeId) {
1954
+ return this.getById("eve_skin_licenses", licenseTypeId);
1955
+ }
1956
+ getSkinLicensesBySkin(skinId) {
1957
+ return this.filterBy("eve_skin_licenses", "skinId", skinId);
1958
+ }
1959
+ // --- Station Operations & Services ---
1960
+ getStationOperation(stationOperationId) {
1961
+ return this.getById("eve_station_operations", stationOperationId);
1962
+ }
1963
+ getAllStationOperations() {
1964
+ return this.getAllFrom("eve_station_operations");
1965
+ }
1966
+ getStationService(stationServiceId) {
1967
+ return this.getById("eve_station_services", stationServiceId);
1968
+ }
1969
+ getAllStationServices() {
1970
+ return this.getAllFrom("eve_station_services");
1971
+ }
1972
+ // --- Type Extensions ---
1973
+ getTypeDogma(typeId) {
1974
+ return this.getById("eve_type_dogma", typeId);
1975
+ }
1976
+ getTypeMaterial(typeId) {
1977
+ return this.getById("eve_type_materials", typeId);
1978
+ }
1979
+ getTypeBonus(typeId) {
1980
+ return this.getById("eve_type_bonuses", typeId);
1981
+ }
1982
+ // --- Missions & Content ---
1983
+ getMission(missionId) {
1984
+ return this.getById("eve_missions", missionId);
1985
+ }
1986
+ getDungeon(dungeonId) {
1987
+ return this.getById("eve_dungeons", dungeonId);
1988
+ }
1989
+ getEpicArc(epicArcId) {
1990
+ return this.getById("eve_epic_arcs", epicArcId);
1991
+ }
1992
+ getAllEpicArcs() {
1993
+ return this.getAllFrom("eve_epic_arcs");
1994
+ }
1995
+ // --- Generic accessor ---
1996
+ getEntity(tableName, id) {
1997
+ return this.getById(tableName, id);
1998
+ }
1999
+ getAllEntities(tableName) {
2000
+ return this.getAllFrom(tableName);
2001
+ }
2002
+ // --- Version & Lifecycle ---
2003
+ getVersion() {
2004
+ return { ...this.versionInfo };
2005
+ }
2006
+ close() {
2007
+ this.data.clear();
2008
+ }
2009
+ };
2010
+
2011
+ // src/sde/SdeTestDataFactory.ts
2012
+ var SdeTestDataFactory = class {
2013
+ static createEveType(overrides = {}) {
2014
+ return {
2015
+ typeId: 34,
2016
+ groupId: 18,
2017
+ mass: 1,
2018
+ name: "Tritanium",
2019
+ portionSize: 1,
2020
+ published: true,
2021
+ packagedVolume: null,
2022
+ volume: 0.01,
2023
+ radius: null,
2024
+ description: "The most common mineral in the known universe.",
2025
+ graphicId: 20,
2026
+ soundId: null,
2027
+ iconId: null,
2028
+ raceId: null,
2029
+ basePrice: 4,
2030
+ marketGroupId: 1857,
2031
+ capacity: null,
2032
+ isRepackable: null,
2033
+ ...overrides
2034
+ };
2035
+ }
2036
+ static createEveGroup(overrides = {}) {
2037
+ return {
2038
+ groupId: 18,
2039
+ anchorable: false,
2040
+ anchored: false,
2041
+ categoryId: 4,
2042
+ fittableNonSingleton: false,
2043
+ name: "Mineral",
2044
+ published: true,
2045
+ useBasePrice: true,
2046
+ iconId: null,
2047
+ ...overrides
2048
+ };
2049
+ }
2050
+ static createEveCategory(overrides = {}) {
2051
+ return {
2052
+ categoryId: 4,
2053
+ name: "Material",
2054
+ published: true,
2055
+ iconId: null,
2056
+ ...overrides
2057
+ };
2058
+ }
2059
+ static createRegion(overrides = {}) {
2060
+ return {
2061
+ regionId: 10000002,
2062
+ constellationIDs: [20000020],
2063
+ description: "The Forge is the industrial heart of the Caldari State.",
2064
+ factionId: 500001,
2065
+ name: "The Forge",
2066
+ nebulaId: 10,
2067
+ position: { x: -96e15, y: 6e16, z: -11e16 },
2068
+ wormholeClassId: 0,
2069
+ ...overrides
2070
+ };
2071
+ }
2072
+ static createConstellation(overrides = {}) {
2073
+ return {
2074
+ constellationId: 20000020,
2075
+ factionId: 500001,
2076
+ name: "Kimotoro",
2077
+ position: { x: -97e15, y: 61e15, z: -115e15 },
2078
+ regionId: 10000002,
2079
+ solarSystemIDs: [30000142, 30000144],
2080
+ wormholeClassId: 0,
2081
+ ...overrides
2082
+ };
2083
+ }
2084
+ static createSolarSystem(overrides = {}) {
2085
+ return {
2086
+ systemId: 30000142,
2087
+ border: false,
2088
+ constellationId: 20000020,
2089
+ hub: true,
2090
+ international: false,
2091
+ luminosity: 0.02142,
2092
+ name: "Jita",
2093
+ planetIDs: [40009077],
2094
+ position: { x: -129e15, y: 607e14, z: -112e15 },
2095
+ position2D: { x: -129e15, y: -112e15 },
2096
+ radius: 467e10,
2097
+ regionId: 10000002,
2098
+ regional: false,
2099
+ securityClass: "B",
2100
+ securityStatus: 0.9459991455078125,
2101
+ starId: 40009082,
2102
+ stargateIDs: [50001248],
2103
+ corridor: null,
2104
+ fringe: null,
2105
+ wormholeClassId: null,
2106
+ visualEffect: null,
2107
+ ...overrides
2108
+ };
2109
+ }
2110
+ static createStargate(overrides = {}) {
2111
+ return {
2112
+ stargateId: 50001248,
2113
+ destination: { solarSystemId: 30000144, stargateId: 50001249 },
2114
+ position: { x: 15e11, y: 32e10, z: -87e10 },
2115
+ solarSystemId: 30000142,
2116
+ typeId: 16,
2117
+ ...overrides
2118
+ };
2119
+ }
2120
+ static createStar(overrides = {}) {
2121
+ return {
2122
+ starId: 40009082,
2123
+ radius: 3466e5,
2124
+ solarSystemId: 30000142,
2125
+ statistics: {
2126
+ age: 76e9,
2127
+ life: 1e11,
2128
+ luminosity: 0.02142,
2129
+ locked: false,
2130
+ spectralClass: "K7 V",
2131
+ temperature: 4e3
2132
+ },
2133
+ typeId: 3796,
2134
+ ...overrides
2135
+ };
2136
+ }
2137
+ static createPlanet(overrides = {}) {
2138
+ return {
2139
+ planetId: 40009077,
2140
+ asteroidBeltIDs: [40009079],
2141
+ attributes: {},
2142
+ celestialIndex: 1,
2143
+ moonIDs: [40009078],
2144
+ orbitId: 40009082,
2145
+ position: { x: 12e12, y: 1e11, z: -35e11 },
2146
+ radius: 233e4,
2147
+ solarSystemId: 30000142,
2148
+ statistics: {},
2149
+ typeId: 2015,
2150
+ npcStationIDs: null,
2151
+ ...overrides
2152
+ };
2153
+ }
2154
+ static createMoon(overrides = {}) {
2155
+ return {
2156
+ moonId: 40009078,
2157
+ attributes: {},
2158
+ celestialIndex: 1,
2159
+ orbitId: 40009077,
2160
+ orbitIndex: 1,
2161
+ position: { x: 121e11, y: 101e9, z: -351e10 },
2162
+ radius: 24e4,
2163
+ solarSystemId: 30000142,
2164
+ statistics: {},
2165
+ typeId: 14,
2166
+ npcStationIDs: null,
2167
+ ...overrides
2168
+ };
2169
+ }
2170
+ static createAsteroidBelt(overrides = {}) {
2171
+ return {
2172
+ asteroidBeltId: 40009079,
2173
+ celestialIndex: 1,
2174
+ orbitId: 40009077,
2175
+ orbitIndex: 1,
2176
+ position: { x: 119e11, y: 99e9, z: -349e10 },
2177
+ radius: 5e4,
2178
+ solarSystemId: 30000142,
2179
+ statistics: {},
2180
+ typeId: 15,
2181
+ ...overrides
2182
+ };
2183
+ }
2184
+ static createFaction(overrides = {}) {
2185
+ return {
2186
+ factionId: 500001,
2187
+ corporationId: 1000035,
2188
+ description: "The Caldari State is a corporate dictatorship.",
2189
+ flatLogo: "res:/ui/texture/corps/caldari.png",
2190
+ flatLogoWithName: "res:/ui/texture/corps/caldari_name.png",
2191
+ iconId: 1439,
2192
+ memberRaces: [1],
2193
+ militiaCorporationId: 1000180,
2194
+ name: "Caldari State",
2195
+ shortDescription: "Caldari",
2196
+ sizeFactor: 5,
2197
+ solarSystemId: 30000142,
2198
+ uniqueName: true,
2199
+ ...overrides
2200
+ };
2201
+ }
2202
+ static createRace(overrides = {}) {
2203
+ return {
2204
+ raceId: 1,
2205
+ description: "The Caldari State is a corporate dictatorship.",
2206
+ iconId: 1439,
2207
+ name: "Caldari",
2208
+ shipTypeId: 601,
2209
+ skills: {},
2210
+ ...overrides
2211
+ };
2212
+ }
2213
+ static createBloodline(overrides = {}) {
2214
+ return {
2215
+ bloodlineId: 1,
2216
+ charisma: 3,
2217
+ corporationId: 1000006,
2218
+ description: "The Deteis are regarded as the face of the Caldari State.",
2219
+ iconId: 1383,
2220
+ intelligence: 7,
2221
+ memory: 7,
2222
+ name: "Deteis",
2223
+ perception: 5,
2224
+ raceId: 1,
2225
+ willpower: 5,
2226
+ ...overrides
2227
+ };
2228
+ }
2229
+ static createAncestry(overrides = {}) {
2230
+ return {
2231
+ ancestryId: 1,
2232
+ bloodlineId: 1,
2233
+ charisma: 0,
2234
+ description: "Born and raised in a capsule.",
2235
+ iconId: 1664,
2236
+ intelligence: 0,
2237
+ memory: 0,
2238
+ name: "Tube Child",
2239
+ perception: 0,
2240
+ shortDescription: "Raised in a capsule.",
2241
+ willpower: 2,
2242
+ ...overrides
2243
+ };
2244
+ }
2245
+ static createNpcCorporation(overrides = {}) {
2246
+ return {
2247
+ corporationId: 1000035,
2248
+ ceoId: 3004451,
2249
+ deleted: false,
2250
+ description: "The Caldari Navy is the armed forces of the Caldari State.",
2251
+ extent: "G",
2252
+ hasPlayerPersonnelManager: false,
2253
+ initialPrice: 0,
2254
+ memberLimit: 0,
2255
+ minSecurity: 0,
2256
+ minimumJoinStanding: 0,
2257
+ name: "Caldari Navy",
2258
+ sendCharTerminationMessage: true,
2259
+ shares: 1e5,
2260
+ size: "H",
2261
+ stationId: 60003760,
2262
+ taxRate: 0,
2263
+ tickerName: "CN",
2264
+ uniqueName: true,
2265
+ allowedMemberRaces: null,
2266
+ corporationTrades: null,
2267
+ divisions: null,
2268
+ enemyId: null,
2269
+ factionId: 500001,
2270
+ friendId: null,
2271
+ iconId: 1439,
2272
+ investors: null,
2273
+ lpOfferTables: null,
2274
+ mainActivityId: null,
2275
+ raceId: 1,
2276
+ sizeFactor: null,
2277
+ solarSystemId: 30000142,
2278
+ secondaryActivityId: null,
2279
+ ...overrides
2280
+ };
2281
+ }
2282
+ static createNpcStation(overrides = {}) {
2283
+ return {
2284
+ stationId: 60003760,
2285
+ celestialIndex: 4,
2286
+ operationId: 1,
2287
+ orbitId: 40009081,
2288
+ orbitIndex: 4,
2289
+ ownerId: 1000035,
2290
+ position: { x: 158e12, y: 963e10, z: 106e12 },
2291
+ reprocessingEfficiency: 0.5,
2292
+ reprocessingHangarFlag: 4,
2293
+ reprocessingStationsTake: 0.05,
2294
+ solarSystemId: 30000142,
2295
+ typeId: 1529,
2296
+ useOperationName: true,
2297
+ ...overrides
2298
+ };
2299
+ }
2300
+ static createMarketGroup(overrides = {}) {
2301
+ return {
2302
+ marketGroupId: 1857,
2303
+ description: "Refined minerals used in manufacturing.",
2304
+ hasTypes: true,
2305
+ iconId: 22,
2306
+ name: "Minerals",
2307
+ parentGroupId: 1031,
2308
+ ...overrides
2309
+ };
2310
+ }
2311
+ static createMetaGroup(overrides = {}) {
2312
+ return {
2313
+ metaGroupId: 1,
2314
+ color: { r: 255, g: 255, b: 255, a: 255 },
2315
+ name: "Tech I",
2316
+ iconId: null,
2317
+ iconSuffix: null,
2318
+ description: null,
2319
+ ...overrides
2320
+ };
2321
+ }
2322
+ static createIcon(overrides = {}) {
2323
+ return {
2324
+ iconId: 22,
2325
+ iconFile: "res:/UI/Texture/Icons/22_32_2.png",
2326
+ ...overrides
2327
+ };
2328
+ }
2329
+ static createGraphic(overrides = {}) {
2330
+ return {
2331
+ graphicId: 20,
2332
+ graphicFile: "res:/dx9/model/worldobject/asteroid/oreveld001.red",
2333
+ iconFolder: null,
2334
+ sofFactionName: null,
2335
+ sofHullName: null,
2336
+ sofRaceName: null,
2337
+ ...overrides
2338
+ };
2339
+ }
2340
+ static createDogmaAttribute(overrides = {}) {
2341
+ return {
2342
+ attributeId: 9,
2343
+ attributeCategoryId: 1,
2344
+ dataType: 2,
2345
+ defaultValue: 0,
2346
+ description: "Hit points for a ship.",
2347
+ displayWhenZero: false,
2348
+ highIsGood: true,
2349
+ name: "hp",
2350
+ published: true,
2351
+ stackable: false,
2352
+ displayName: null,
2353
+ iconId: null,
2354
+ tooltipDescription: null,
2355
+ tooltipTitle: null,
2356
+ unitId: 1,
2357
+ chargeRechargeTimeId: null,
2358
+ maxAttributeId: null,
2359
+ minAttributeId: null,
2360
+ ...overrides
2361
+ };
2362
+ }
2363
+ static createDogmaEffect(overrides = {}) {
2364
+ return {
2365
+ effectId: 11,
2366
+ disallowAutoRepeat: false,
2367
+ dischargeAttributeId: 0,
2368
+ durationAttributeId: 0,
2369
+ effectCategoryId: 0,
2370
+ electronicChance: false,
2371
+ guid: "effects.LowSlotModifier",
2372
+ isAssistance: false,
2373
+ isOffensive: false,
2374
+ isWarpSafe: true,
2375
+ name: "lowSlotModifier",
2376
+ propulsionChance: false,
2377
+ published: true,
2378
+ rangeChance: false,
2379
+ distribution: null,
2380
+ falloffAttributeId: null,
2381
+ rangeAttributeId: null,
2382
+ trackingSpeedAttributeId: null,
2383
+ description: null,
2384
+ displayName: null,
2385
+ iconId: null,
2386
+ modifierInfo: null,
2387
+ ...overrides
2388
+ };
2389
+ }
2390
+ static createBlueprint(overrides = {}) {
2391
+ return {
2392
+ activities: {
2393
+ manufacturing: {
2394
+ time: 6e3,
2395
+ materials: [
2396
+ { typeId: 34, quantity: 100 },
2397
+ { typeId: 35, quantity: 50 }
2398
+ ],
2399
+ products: [{ typeId: 587, quantity: 1 }]
2400
+ }
2401
+ },
2402
+ blueprintTypeId: 787,
2403
+ maxProductionLimit: 10,
2404
+ ...overrides
2405
+ };
2406
+ }
2407
+ static createPlanetSchematic(overrides = {}) {
2408
+ return {
2409
+ planetSchematicId: 65,
2410
+ cycleTime: 1800,
2411
+ name: "Bacteria",
2412
+ pins: [],
2413
+ types: [],
2414
+ ...overrides
2415
+ };
2416
+ }
2417
+ static createVersionInfo(overrides = {}) {
2418
+ return {
2419
+ version: "2024-01-15.1",
2420
+ buildDate: "2024-01-15T00:00:00Z",
2421
+ importedAt: "2024-01-16T12:00:00Z",
2422
+ checksum: "abc123def456",
2423
+ ...overrides
2424
+ };
2425
+ }
2426
+ static createHierarchicalTestData() {
2427
+ const category = this.createEveCategory();
2428
+ const group = this.createEveGroup({ categoryId: category.categoryId });
2429
+ const type1 = this.createEveType({
2430
+ typeId: 34,
2431
+ name: "Tritanium",
2432
+ groupId: group.groupId
2433
+ });
2434
+ const type2 = this.createEveType({
2435
+ typeId: 35,
2436
+ name: "Pyerite",
2437
+ groupId: group.groupId
2438
+ });
2439
+ const type3 = this.createEveType({
2440
+ typeId: 36,
2441
+ name: "Mexallon",
2442
+ groupId: group.groupId
2443
+ });
2444
+ const region = this.createRegion();
2445
+ const constellation = this.createConstellation({
2446
+ regionId: region.regionId
2447
+ });
2448
+ const system1 = this.createSolarSystem({
2449
+ systemId: 30000142,
2450
+ name: "Jita",
2451
+ constellationId: constellation.constellationId,
2452
+ regionId: region.regionId
2453
+ });
2454
+ const system2 = this.createSolarSystem({
2455
+ systemId: 30000144,
2456
+ name: "Perimeter",
2457
+ constellationId: constellation.constellationId,
2458
+ regionId: region.regionId,
2459
+ securityStatus: 0.9
2460
+ });
2461
+ const stargate = this.createStargate({
2462
+ solarSystemId: system1.systemId,
2463
+ destination: { solarSystemId: system2.systemId, stargateId: 50001249 }
2464
+ });
2465
+ const star = this.createStar({ solarSystemId: system1.systemId });
2466
+ const planet = this.createPlanet({ solarSystemId: system1.systemId });
2467
+ const moon = this.createMoon({ solarSystemId: system1.systemId });
2468
+ const asteroidBelt = this.createAsteroidBelt({
2469
+ solarSystemId: system1.systemId
2470
+ });
2471
+ const race = this.createRace();
2472
+ const faction = this.createFaction({ memberRaces: [race.raceId] });
2473
+ const bloodline = this.createBloodline({ raceId: race.raceId });
2474
+ const ancestry = this.createAncestry({
2475
+ bloodlineId: bloodline.bloodlineId
2476
+ });
2477
+ const npcCorp = this.createNpcCorporation({
2478
+ factionId: faction.factionId,
2479
+ raceId: race.raceId
2480
+ });
2481
+ const npcStation = this.createNpcStation({
2482
+ solarSystemId: system1.systemId,
2483
+ ownerId: npcCorp.corporationId
2484
+ });
2485
+ const rootMarketGroup = this.createMarketGroup({
2486
+ marketGroupId: 1031,
2487
+ name: "Manufacture & Research",
2488
+ parentGroupId: null,
2489
+ hasTypes: false
2490
+ });
2491
+ const marketGroup = this.createMarketGroup({
2492
+ parentGroupId: rootMarketGroup.marketGroupId
2493
+ });
2494
+ const metaGroup = this.createMetaGroup();
2495
+ const icon = this.createIcon();
2496
+ const graphic = this.createGraphic();
2497
+ const dogmaAttribute = this.createDogmaAttribute();
2498
+ const dogmaEffect = this.createDogmaEffect();
2499
+ const blueprint = this.createBlueprint();
2500
+ const planetSchematic = this.createPlanetSchematic();
2501
+ return {
2502
+ categories: [category],
2503
+ groups: [group],
2504
+ types: [type1, type2, type3],
2505
+ regions: [region],
2506
+ constellations: [constellation],
2507
+ solarSystems: [system1, system2],
2508
+ stargates: [stargate],
2509
+ stars: [star],
2510
+ planets: [planet],
2511
+ moons: [moon],
2512
+ asteroidBelts: [asteroidBelt],
2513
+ factions: [faction],
2514
+ races: [race],
2515
+ bloodlines: [bloodline],
2516
+ ancestries: [ancestry],
2517
+ npcCorporations: [npcCorp],
2518
+ npcStations: [npcStation],
2519
+ marketGroups: [rootMarketGroup, marketGroup],
2520
+ metaGroups: [metaGroup],
2521
+ icons: [icon],
2522
+ graphics: [graphic],
2523
+ dogmaAttributes: [dogmaAttribute],
2524
+ dogmaEffects: [dogmaEffect],
2525
+ blueprints: [blueprint],
2526
+ planetSchematics: [planetSchematic],
2527
+ version: this.createVersionInfo()
2528
+ };
2529
+ }
2530
+ };
2531
+ export {
2532
+ MemorySdeProvider,
2533
+ SdeDataProvider,
2534
+ SdeDatabaseError,
2535
+ SdeError,
2536
+ SdeTestDataFactory,
2537
+ SdeValidationError,
2538
+ SdeVersionMismatchError,
2539
+ isSdeDatabaseError,
2540
+ isSdeError,
2541
+ isSdeValidationError,
2542
+ isSdeVersionMismatch
2543
+ };
2544
+ //# sourceMappingURL=index.mjs.map