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