@lgriffin/esi.ts 9.4.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 (77) hide show
  1. package/CHANGELOG.md +388 -388
  2. package/LICENSE +26 -26
  3. package/README.md +1030 -1018
  4. package/dist/EsiClient.d.ts +4 -0
  5. package/dist/EsiClient.d.ts.map +1 -1
  6. package/dist/clients/CosmeticsClient.d.ts +11 -0
  7. package/dist/clients/CosmeticsClient.d.ts.map +1 -0
  8. package/dist/clients/MercenaryClient.d.ts +19 -1
  9. package/dist/clients/MercenaryClient.d.ts.map +1 -1
  10. package/dist/clients/ParagonHubClient.d.ts +13 -0
  11. package/dist/clients/ParagonHubClient.d.ts.map +1 -0
  12. package/dist/clients/SkyhooksClient.d.ts +19 -1
  13. package/dist/clients/SkyhooksClient.d.ts.map +1 -1
  14. package/dist/core/ApiClient.d.ts.map +1 -1
  15. package/dist/core/ApiRequestHandler.d.ts.map +1 -1
  16. package/dist/core/ClientRegistry.d.ts +5 -3
  17. package/dist/core/ClientRegistry.d.ts.map +1 -1
  18. package/dist/core/cache/cacheKey.d.ts +3 -0
  19. package/dist/core/cache/cacheKey.d.ts.map +1 -0
  20. package/dist/core/endpoints/cosmeticsEndpoints.d.ts +52 -0
  21. package/dist/core/endpoints/cosmeticsEndpoints.d.ts.map +1 -0
  22. package/dist/core/endpoints/mercenaryEndpoints.d.ts +45 -0
  23. package/dist/core/endpoints/mercenaryEndpoints.d.ts.map +1 -1
  24. package/dist/core/endpoints/paragonHubEndpoints.d.ts +163 -0
  25. package/dist/core/endpoints/paragonHubEndpoints.d.ts.map +1 -0
  26. package/dist/core/endpoints/skyhookEndpoints.d.ts +64 -0
  27. package/dist/core/endpoints/skyhookEndpoints.d.ts.map +1 -1
  28. package/dist/core/requestPipeline/cachePolicy.d.ts +3 -3
  29. package/dist/core/requestPipeline/cachePolicy.d.ts.map +1 -1
  30. package/dist/core/requestPipeline/headers.d.ts.map +1 -1
  31. package/dist/core/requestPipeline/statusHandling.d.ts +2 -2
  32. package/dist/core/requestPipeline/statusHandling.d.ts.map +1 -1
  33. package/dist/errors.js.map +1 -1
  34. package/dist/errors.mjs.map +1 -1
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +497 -49
  38. package/dist/index.js.map +1 -1
  39. package/dist/index.mjs +495 -49
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/schemas/cosmetics.d.ts +58 -0
  42. package/dist/schemas/cosmetics.d.ts.map +1 -0
  43. package/dist/schemas/index.d.ts +2 -0
  44. package/dist/schemas/index.d.ts.map +1 -1
  45. package/dist/schemas/index.js +1461 -1191
  46. package/dist/schemas/index.js.map +1 -1
  47. package/dist/schemas/index.mjs +1427 -1191
  48. package/dist/schemas/index.mjs.map +1 -1
  49. package/dist/schemas/mercenary.d.ts +54 -0
  50. package/dist/schemas/mercenary.d.ts.map +1 -1
  51. package/dist/schemas/paragon-hub.d.ts +96 -0
  52. package/dist/schemas/paragon-hub.d.ts.map +1 -0
  53. package/dist/schemas/skyhooks.d.ts +101 -0
  54. package/dist/schemas/skyhooks.d.ts.map +1 -1
  55. package/dist/sde/index.js +7 -5100
  56. package/dist/sde/index.js.map +1 -1
  57. package/dist/sde/index.mjs +12 -5134
  58. package/dist/sde/index.mjs.map +1 -1
  59. package/dist/sde/memory.d.ts +8 -0
  60. package/dist/sde/memory.d.ts.map +1 -0
  61. package/dist/sde/memory.js +1100 -0
  62. package/dist/sde/memory.js.map +1 -0
  63. package/dist/sde/memory.mjs +1064 -0
  64. package/dist/sde/memory.mjs.map +1 -0
  65. package/dist/testing/index.js.map +1 -1
  66. package/dist/testing/index.mjs.map +1 -1
  67. package/dist/types/api-responses.d.ts +2 -0
  68. package/dist/types/api-responses.d.ts.map +1 -1
  69. package/dist/types/cosmetics.d.ts +8 -0
  70. package/dist/types/cosmetics.d.ts.map +1 -0
  71. package/dist/types/mercenary.d.ts +3 -1
  72. package/dist/types/mercenary.d.ts.map +1 -1
  73. package/dist/types/paragon-hub.d.ts +8 -0
  74. package/dist/types/paragon-hub.d.ts.map +1 -0
  75. package/dist/types/skyhooks.d.ts +3 -1
  76. package/dist/types/skyhooks.d.ts.map +1 -1
  77. package/package.json +289 -282
@@ -0,0 +1,1100 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/sde/memory.ts
21
+ var memory_exports = {};
22
+ __export(memory_exports, {
23
+ MemorySdeProvider: () => MemorySdeProvider,
24
+ SdeDatabaseError: () => SdeDatabaseError,
25
+ SdeError: () => SdeError,
26
+ SdeTestDataFactory: () => SdeTestDataFactory,
27
+ SdeValidationError: () => SdeValidationError,
28
+ SdeVersionMismatchError: () => SdeVersionMismatchError,
29
+ isSdeDatabaseError: () => isSdeDatabaseError,
30
+ isSdeError: () => isSdeError,
31
+ isSdeValidationError: () => isSdeValidationError,
32
+ isSdeVersionMismatch: () => isSdeVersionMismatch
33
+ });
34
+ module.exports = __toCommonJS(memory_exports);
35
+
36
+ // src/sde/MemorySdeProvider.ts
37
+ var MemorySdeProvider = class {
38
+ data = /* @__PURE__ */ new Map();
39
+ versionInfo;
40
+ constructor(data = {}) {
41
+ const register = (key, items, idFn) => {
42
+ this.data.set(
43
+ key,
44
+ new Map((items ?? []).map((item) => [idFn(item), item]))
45
+ );
46
+ };
47
+ register("eve_types", data.types, (t) => t.typeId);
48
+ register("eve_groups", data.groups, (g) => g.groupId);
49
+ register("eve_categories", data.categories, (c) => c.categoryId);
50
+ register("eve_regions", data.regions, (r) => r.regionId);
51
+ register(
52
+ "eve_constellations",
53
+ data.constellations,
54
+ (c) => c.constellationId
55
+ );
56
+ register("eve_solar_systems", data.solarSystems, (s) => s.systemId);
57
+ register("eve_stargates", data.stargates, (s) => s.stargateId);
58
+ register("eve_stars", data.stars, (s) => s.starId);
59
+ register("eve_planets", data.planets, (p) => p.planetId);
60
+ register("eve_moons", data.moons, (m) => m.moonId);
61
+ register("eve_asteroid_belts", data.asteroidBelts, (a) => a.asteroidBeltId);
62
+ register("eve_factions", data.factions, (f) => f.factionId);
63
+ register("eve_races", data.races, (r) => r.raceId);
64
+ register("eve_bloodlines", data.bloodlines, (b) => b.bloodlineId);
65
+ register("eve_ancestries", data.ancestries, (a) => a.ancestryId);
66
+ register(
67
+ "eve_npc_corporations",
68
+ data.npcCorporations,
69
+ (c) => c.corporationId
70
+ );
71
+ register("eve_npc_stations", data.npcStations, (s) => s.stationId);
72
+ register("eve_market_groups", data.marketGroups, (g) => g.marketGroupId);
73
+ register("eve_meta_groups", data.metaGroups, (g) => g.metaGroupId);
74
+ register("eve_icons", data.icons, (i) => i.iconId);
75
+ register("eve_graphics", data.graphics, (g) => g.graphicId);
76
+ register(
77
+ "eve_dogma_attributes",
78
+ data.dogmaAttributes,
79
+ (a) => a.attributeId
80
+ );
81
+ register("eve_dogma_effects", data.dogmaEffects, (e) => e.effectId);
82
+ register("eve_blueprints", data.blueprints, (b) => b.blueprintTypeId);
83
+ register(
84
+ "eve_planet_schematics",
85
+ data.planetSchematics,
86
+ (s) => s.planetSchematicId
87
+ );
88
+ register("eve_agent_types", data.agentTypes, (a) => a.agentTypeId);
89
+ register("eve_agents_in_space", data.agentsInSpace, (a) => a.characterId);
90
+ register("eve_certificates", data.certificates, (c) => c.certificateId);
91
+ register(
92
+ "eve_character_attributes",
93
+ data.characterAttributes,
94
+ (c) => c.attributeId
95
+ );
96
+ register("eve_clone_grades", data.cloneGrades, (c) => c.cloneGradeId);
97
+ register(
98
+ "eve_corporation_activities",
99
+ data.corporationActivities,
100
+ (c) => c.corporationActivityId
101
+ );
102
+ register(
103
+ "eve_dogma_attribute_categories",
104
+ data.dogmaAttributeCategories,
105
+ (d) => d.attributeCategoryId
106
+ );
107
+ register("eve_dogma_units", data.dogmaUnits, (d) => d.unitId);
108
+ register(
109
+ "eve_industry_activities",
110
+ data.industryActivities,
111
+ (i) => i.industryActivityId
112
+ );
113
+ register("eve_landmarks", data.landmarks, (l) => l.landmarkId);
114
+ register(
115
+ "eve_notification_types",
116
+ data.notificationTypes,
117
+ (n) => n.notificationTypeId
118
+ );
119
+ register("eve_npc_characters", data.npcCharacters, (n) => n.characterId);
120
+ register(
121
+ "eve_npc_corporation_divisions",
122
+ data.npcCorporationDivisions,
123
+ (n) => n.npcCorporationDivisionId
124
+ );
125
+ register("eve_schools", data.schools, (s) => s.schoolId);
126
+ register("eve_secondary_suns", data.secondarySuns, (s) => s.secondarySunId);
127
+ register("eve_skins", data.skins, (s) => s.skinId);
128
+ register("eve_skin_licenses", data.skinLicenses, (s) => s.licenseTypeId);
129
+ register(
130
+ "eve_station_operations",
131
+ data.stationOperations,
132
+ (s) => s.stationOperationId
133
+ );
134
+ register(
135
+ "eve_station_services",
136
+ data.stationServices,
137
+ (s) => s.stationServiceId
138
+ );
139
+ register("eve_type_dogma", data.typeDogma, (t) => t.typeId);
140
+ register("eve_type_materials", data.typeMaterials, (t) => t.typeId);
141
+ register("eve_type_bonuses", data.typeBonuses, (t) => t.typeId);
142
+ register("eve_missions", data.missions, (m) => m.missionId);
143
+ register("eve_dungeons", data.dungeons, (d) => d.dungeonId);
144
+ register("eve_epic_arcs", data.epicArcs, (e) => e.epicArcId);
145
+ this.versionInfo = {
146
+ version: data.version?.version ?? "1.0.0-test",
147
+ buildDate: data.version?.buildDate ?? "2024-01-01T00:00:00Z",
148
+ importedAt: data.version?.importedAt ?? "2024-01-01T00:00:00Z",
149
+ checksum: data.version?.checksum
150
+ };
151
+ }
152
+ getById(table, id) {
153
+ return this.data.get(table)?.get(id) ?? null;
154
+ }
155
+ getAllFrom(table) {
156
+ const map = this.data.get(table);
157
+ return map ? Array.from(map.values()) : [];
158
+ }
159
+ filterBy(table, field, value) {
160
+ return this.getAllFrom(table).filter(
161
+ (item) => item[field] === value
162
+ );
163
+ }
164
+ searchBy(table, field, query, limit = 25) {
165
+ const lowerQuery = query.toLowerCase();
166
+ const results = [];
167
+ for (const item of this.getAllFrom(table)) {
168
+ const val = item[field];
169
+ if (typeof val === "string" && val.toLowerCase().includes(lowerQuery)) {
170
+ results.push(item);
171
+ if (results.length >= limit) break;
172
+ }
173
+ }
174
+ return results;
175
+ }
176
+ // --- Types, Groups, Categories ---
177
+ getType(typeId) {
178
+ return this.getById("eve_types", typeId);
179
+ }
180
+ getTypesByGroup(groupId) {
181
+ return this.filterBy("eve_types", "groupId", groupId);
182
+ }
183
+ getGroup(groupId) {
184
+ return this.getById("eve_groups", groupId);
185
+ }
186
+ getGroupsByCategory(categoryId) {
187
+ return this.filterBy("eve_groups", "categoryId", categoryId);
188
+ }
189
+ getCategory(categoryId) {
190
+ return this.getById("eve_categories", categoryId);
191
+ }
192
+ getAllCategories() {
193
+ return this.getAllFrom("eve_categories");
194
+ }
195
+ // --- Regions, Constellations, Solar Systems, Stargates ---
196
+ getRegion(regionId) {
197
+ return this.getById("eve_regions", regionId);
198
+ }
199
+ getAllRegions() {
200
+ return this.getAllFrom("eve_regions");
201
+ }
202
+ getConstellation(constellationId) {
203
+ return this.getById("eve_constellations", constellationId);
204
+ }
205
+ getConstellationsByRegion(regionId) {
206
+ return this.filterBy("eve_constellations", "regionId", regionId);
207
+ }
208
+ getSolarSystem(systemId) {
209
+ return this.getById("eve_solar_systems", systemId);
210
+ }
211
+ getSolarSystemsByConstellation(constellationId) {
212
+ return this.filterBy(
213
+ "eve_solar_systems",
214
+ "constellationId",
215
+ constellationId
216
+ );
217
+ }
218
+ getStargate(stargateId) {
219
+ return this.getById("eve_stargates", stargateId);
220
+ }
221
+ getStargatesBySystem(systemId) {
222
+ return this.filterBy("eve_stargates", "solarSystemId", systemId);
223
+ }
224
+ // --- Search ---
225
+ searchTypesByName(query, limit = 25) {
226
+ return this.searchBy("eve_types", "name", query, limit);
227
+ }
228
+ searchSolarSystemsByName(query, limit = 25) {
229
+ return this.searchBy("eve_solar_systems", "name", query, limit);
230
+ }
231
+ // --- Universe ---
232
+ getStar(starId) {
233
+ return this.getById("eve_stars", starId);
234
+ }
235
+ getStarBySystem(systemId) {
236
+ return this.filterBy("eve_stars", "solarSystemId", systemId)[0] ?? null;
237
+ }
238
+ getPlanet(planetId) {
239
+ return this.getById("eve_planets", planetId);
240
+ }
241
+ getPlanetsBySystem(systemId) {
242
+ return this.filterBy("eve_planets", "solarSystemId", systemId);
243
+ }
244
+ getMoon(moonId) {
245
+ return this.getById("eve_moons", moonId);
246
+ }
247
+ getMoonsBySystem(systemId) {
248
+ return this.filterBy("eve_moons", "solarSystemId", systemId);
249
+ }
250
+ getAsteroidBelt(asteroidBeltId) {
251
+ return this.getById("eve_asteroid_belts", asteroidBeltId);
252
+ }
253
+ getAsteroidBeltsBySystem(systemId) {
254
+ return this.filterBy("eve_asteroid_belts", "solarSystemId", systemId);
255
+ }
256
+ // --- Character/Lore ---
257
+ getFaction(factionId) {
258
+ return this.getById("eve_factions", factionId);
259
+ }
260
+ getAllFactions() {
261
+ return this.getAllFrom("eve_factions");
262
+ }
263
+ getRace(raceId) {
264
+ return this.getById("eve_races", raceId);
265
+ }
266
+ getAllRaces() {
267
+ return this.getAllFrom("eve_races");
268
+ }
269
+ getBloodline(bloodlineId) {
270
+ return this.getById("eve_bloodlines", bloodlineId);
271
+ }
272
+ getBloodlinesByRace(raceId) {
273
+ return this.filterBy("eve_bloodlines", "raceId", raceId);
274
+ }
275
+ getAncestry(ancestryId) {
276
+ return this.getById("eve_ancestries", ancestryId);
277
+ }
278
+ getAncestriesByBloodline(bloodlineId) {
279
+ return this.filterBy("eve_ancestries", "bloodlineId", bloodlineId);
280
+ }
281
+ // --- NPC Infrastructure ---
282
+ getNpcCorporation(corporationId) {
283
+ return this.getById("eve_npc_corporations", corporationId);
284
+ }
285
+ getNpcCorporationsByFaction(factionId) {
286
+ return this.filterBy("eve_npc_corporations", "factionId", factionId);
287
+ }
288
+ getNpcStation(stationId) {
289
+ return this.getById("eve_npc_stations", stationId);
290
+ }
291
+ getNpcStationsBySystem(systemId) {
292
+ return this.filterBy("eve_npc_stations", "solarSystemId", systemId);
293
+ }
294
+ getNpcStationsByOwner(ownerId) {
295
+ return this.filterBy("eve_npc_stations", "ownerId", ownerId);
296
+ }
297
+ // --- Market ---
298
+ getMarketGroup(marketGroupId) {
299
+ return this.getById("eve_market_groups", marketGroupId);
300
+ }
301
+ getMarketGroupsByParent(parentGroupId) {
302
+ return this.filterBy("eve_market_groups", "parentGroupId", parentGroupId);
303
+ }
304
+ getRootMarketGroups() {
305
+ return this.getAllFrom("eve_market_groups").filter(
306
+ (g) => g.parentGroupId === null
307
+ );
308
+ }
309
+ getTypesByMarketGroup(marketGroupId) {
310
+ return this.filterBy("eve_types", "marketGroupId", marketGroupId);
311
+ }
312
+ searchMarketGroupsByName(query, limit = 25) {
313
+ return this.searchBy("eve_market_groups", "name", query, limit);
314
+ }
315
+ // --- Meta/UI ---
316
+ getMetaGroup(metaGroupId) {
317
+ return this.getById("eve_meta_groups", metaGroupId);
318
+ }
319
+ getAllMetaGroups() {
320
+ return this.getAllFrom("eve_meta_groups");
321
+ }
322
+ getIcon(iconId) {
323
+ return this.getById("eve_icons", iconId);
324
+ }
325
+ getGraphic(graphicId) {
326
+ return this.getById("eve_graphics", graphicId);
327
+ }
328
+ // --- Dogma ---
329
+ getDogmaAttribute(attributeId) {
330
+ return this.getById("eve_dogma_attributes", attributeId);
331
+ }
332
+ searchDogmaAttributesByName(query, limit = 25) {
333
+ return this.searchBy("eve_dogma_attributes", "name", query, limit);
334
+ }
335
+ getDogmaEffect(effectId) {
336
+ return this.getById("eve_dogma_effects", effectId);
337
+ }
338
+ searchDogmaEffectsByName(query, limit = 25) {
339
+ return this.searchBy("eve_dogma_effects", "name", query, limit);
340
+ }
341
+ getDogmaAttributeCategory(attributeCategoryId) {
342
+ return this.getById("eve_dogma_attribute_categories", attributeCategoryId);
343
+ }
344
+ getAllDogmaAttributeCategories() {
345
+ return this.getAllFrom("eve_dogma_attribute_categories");
346
+ }
347
+ getDogmaUnit(unitId) {
348
+ return this.getById("eve_dogma_units", unitId);
349
+ }
350
+ getAllDogmaUnits() {
351
+ return this.getAllFrom("eve_dogma_units");
352
+ }
353
+ // --- Industry ---
354
+ getBlueprint(blueprintTypeId) {
355
+ return this.getById("eve_blueprints", blueprintTypeId);
356
+ }
357
+ getPlanetSchematic(planetSchematicId) {
358
+ return this.getById("eve_planet_schematics", planetSchematicId);
359
+ }
360
+ getAllPlanetSchematics() {
361
+ return this.getAllFrom("eve_planet_schematics");
362
+ }
363
+ getIndustryActivity(industryActivityId) {
364
+ return this.getById("eve_industry_activities", industryActivityId);
365
+ }
366
+ getAllIndustryActivities() {
367
+ return this.getAllFrom("eve_industry_activities");
368
+ }
369
+ // --- Agent System ---
370
+ getAgentType(agentTypeId) {
371
+ return this.getById("eve_agent_types", agentTypeId);
372
+ }
373
+ getAllAgentTypes() {
374
+ return this.getAllFrom("eve_agent_types");
375
+ }
376
+ getAgentInSpace(characterId) {
377
+ return this.getById("eve_agents_in_space", characterId);
378
+ }
379
+ getAgentsInSpaceBySystem(systemId) {
380
+ return this.filterBy("eve_agents_in_space", "solarSystemId", systemId);
381
+ }
382
+ // --- Certificates ---
383
+ getCertificate(certificateId) {
384
+ return this.getById("eve_certificates", certificateId);
385
+ }
386
+ getAllCertificates() {
387
+ return this.getAllFrom("eve_certificates");
388
+ }
389
+ // --- Character Attributes ---
390
+ getCharacterAttribute(attributeId) {
391
+ return this.getById("eve_character_attributes", attributeId);
392
+ }
393
+ getAllCharacterAttributes() {
394
+ return this.getAllFrom("eve_character_attributes");
395
+ }
396
+ // --- NPC Characters ---
397
+ getNpcCharacter(characterId) {
398
+ return this.getById("eve_npc_characters", characterId);
399
+ }
400
+ getNpcCharactersByCorporation(corporationId) {
401
+ return this.filterBy("eve_npc_characters", "corporationId", corporationId);
402
+ }
403
+ searchNpcCharactersByName(query, limit = 25) {
404
+ return this.searchBy("eve_npc_characters", "name", query, limit);
405
+ }
406
+ // --- Clone Grades ---
407
+ getCloneGrade(cloneGradeId) {
408
+ return this.getById("eve_clone_grades", cloneGradeId);
409
+ }
410
+ getAllCloneGrades() {
411
+ return this.getAllFrom("eve_clone_grades");
412
+ }
413
+ // --- Corporation Reference ---
414
+ getCorporationActivity(corporationActivityId) {
415
+ return this.getById("eve_corporation_activities", corporationActivityId);
416
+ }
417
+ getAllCorporationActivities() {
418
+ return this.getAllFrom("eve_corporation_activities");
419
+ }
420
+ getNpcCorporationDivision(npcCorporationDivisionId) {
421
+ return this.getById(
422
+ "eve_npc_corporation_divisions",
423
+ npcCorporationDivisionId
424
+ );
425
+ }
426
+ getAllNpcCorporationDivisions() {
427
+ return this.getAllFrom("eve_npc_corporation_divisions");
428
+ }
429
+ // --- Landmarks ---
430
+ getLandmark(landmarkId) {
431
+ return this.getById("eve_landmarks", landmarkId);
432
+ }
433
+ getAllLandmarks() {
434
+ return this.getAllFrom("eve_landmarks");
435
+ }
436
+ // --- Notifications ---
437
+ getNotificationType(notificationTypeId) {
438
+ return this.getById("eve_notification_types", notificationTypeId);
439
+ }
440
+ // --- Schools ---
441
+ getSchool(schoolId) {
442
+ return this.getById("eve_schools", schoolId);
443
+ }
444
+ getAllSchools() {
445
+ return this.getAllFrom("eve_schools");
446
+ }
447
+ // --- Secondary Suns ---
448
+ getSecondarySun(secondarySunId) {
449
+ return this.getById("eve_secondary_suns", secondarySunId);
450
+ }
451
+ getSecondarySunsBySystem(systemId) {
452
+ return this.filterBy("eve_secondary_suns", "solarSystemId", systemId);
453
+ }
454
+ // --- Skins ---
455
+ getSkin(skinId) {
456
+ return this.getById("eve_skins", skinId);
457
+ }
458
+ getSkinLicense(licenseTypeId) {
459
+ return this.getById("eve_skin_licenses", licenseTypeId);
460
+ }
461
+ getSkinLicensesBySkin(skinId) {
462
+ return this.filterBy("eve_skin_licenses", "skinId", skinId);
463
+ }
464
+ // --- Station Operations & Services ---
465
+ getStationOperation(stationOperationId) {
466
+ return this.getById("eve_station_operations", stationOperationId);
467
+ }
468
+ getAllStationOperations() {
469
+ return this.getAllFrom("eve_station_operations");
470
+ }
471
+ getStationService(stationServiceId) {
472
+ return this.getById("eve_station_services", stationServiceId);
473
+ }
474
+ getAllStationServices() {
475
+ return this.getAllFrom("eve_station_services");
476
+ }
477
+ // --- Type Extensions ---
478
+ getTypeDogma(typeId) {
479
+ return this.getById("eve_type_dogma", typeId);
480
+ }
481
+ getTypeMaterial(typeId) {
482
+ return this.getById("eve_type_materials", typeId);
483
+ }
484
+ getTypeBonus(typeId) {
485
+ return this.getById("eve_type_bonuses", typeId);
486
+ }
487
+ // --- Missions & Content ---
488
+ getMission(missionId) {
489
+ return this.getById("eve_missions", missionId);
490
+ }
491
+ getDungeon(dungeonId) {
492
+ return this.getById("eve_dungeons", dungeonId);
493
+ }
494
+ getEpicArc(epicArcId) {
495
+ return this.getById("eve_epic_arcs", epicArcId);
496
+ }
497
+ getAllEpicArcs() {
498
+ return this.getAllFrom("eve_epic_arcs");
499
+ }
500
+ // --- Generic accessor ---
501
+ getEntity(tableName, id) {
502
+ return this.getById(tableName, id);
503
+ }
504
+ getAllEntities(tableName) {
505
+ return this.getAllFrom(tableName);
506
+ }
507
+ // --- Version & Lifecycle ---
508
+ getVersion() {
509
+ return { ...this.versionInfo };
510
+ }
511
+ close() {
512
+ this.data.clear();
513
+ }
514
+ };
515
+
516
+ // src/sde/errors.ts
517
+ var SdeError = class extends Error {
518
+ constructor(message) {
519
+ super(message);
520
+ this.name = "SdeError";
521
+ }
522
+ };
523
+ var SdeDatabaseError = class extends SdeError {
524
+ cause;
525
+ constructor(message, cause) {
526
+ super(message);
527
+ this.name = "SdeDatabaseError";
528
+ this.cause = cause;
529
+ }
530
+ };
531
+ var SdeValidationError = class extends SdeError {
532
+ validationError;
533
+ entityType;
534
+ entityId;
535
+ constructor(entityType, validationError, entityId) {
536
+ const idSuffix = entityId !== void 0 ? ` (id: ${entityId})` : "";
537
+ super(`SDE validation failed for ${entityType}${idSuffix}`);
538
+ this.name = "SdeValidationError";
539
+ this.validationError = validationError;
540
+ this.entityType = entityType;
541
+ this.entityId = entityId;
542
+ }
543
+ };
544
+ var SdeVersionMismatchError = class extends SdeError {
545
+ expected;
546
+ actual;
547
+ constructor(expected, actual) {
548
+ super(`SDE version mismatch: expected ${expected}, got ${actual}`);
549
+ this.name = "SdeVersionMismatchError";
550
+ this.expected = expected;
551
+ this.actual = actual;
552
+ }
553
+ };
554
+ function isSdeError(error) {
555
+ return error instanceof SdeError;
556
+ }
557
+ function isSdeDatabaseError(error) {
558
+ return error instanceof SdeDatabaseError;
559
+ }
560
+ function isSdeValidationError(error) {
561
+ return error instanceof SdeValidationError;
562
+ }
563
+ function isSdeVersionMismatch(error) {
564
+ return error instanceof SdeVersionMismatchError;
565
+ }
566
+
567
+ // src/sde/SdeTestDataFactory.ts
568
+ var SdeTestDataFactory = class {
569
+ static createEveType(overrides = {}) {
570
+ return {
571
+ typeId: 34,
572
+ groupId: 18,
573
+ mass: 1,
574
+ name: "Tritanium",
575
+ portionSize: 1,
576
+ published: true,
577
+ packagedVolume: null,
578
+ volume: 0.01,
579
+ radius: null,
580
+ description: "The most common mineral in the known universe.",
581
+ graphicId: 20,
582
+ soundId: null,
583
+ iconId: null,
584
+ raceId: null,
585
+ basePrice: 4,
586
+ marketGroupId: 1857,
587
+ capacity: null,
588
+ isRepackable: null,
589
+ ...overrides
590
+ };
591
+ }
592
+ static createEveGroup(overrides = {}) {
593
+ return {
594
+ groupId: 18,
595
+ anchorable: false,
596
+ anchored: false,
597
+ categoryId: 4,
598
+ fittableNonSingleton: false,
599
+ name: "Mineral",
600
+ published: true,
601
+ useBasePrice: true,
602
+ iconId: null,
603
+ ...overrides
604
+ };
605
+ }
606
+ static createEveCategory(overrides = {}) {
607
+ return {
608
+ categoryId: 4,
609
+ name: "Material",
610
+ published: true,
611
+ iconId: null,
612
+ ...overrides
613
+ };
614
+ }
615
+ static createRegion(overrides = {}) {
616
+ return {
617
+ regionId: 10000002,
618
+ constellationIDs: [20000020],
619
+ description: "The Forge is the industrial heart of the Caldari State.",
620
+ factionId: 500001,
621
+ name: "The Forge",
622
+ nebulaId: 10,
623
+ position: { x: -96e15, y: 6e16, z: -11e16 },
624
+ wormholeClassId: 0,
625
+ ...overrides
626
+ };
627
+ }
628
+ static createConstellation(overrides = {}) {
629
+ return {
630
+ constellationId: 20000020,
631
+ factionId: 500001,
632
+ name: "Kimotoro",
633
+ position: { x: -97e15, y: 61e15, z: -115e15 },
634
+ regionId: 10000002,
635
+ solarSystemIDs: [30000142, 30000144],
636
+ wormholeClassId: 0,
637
+ ...overrides
638
+ };
639
+ }
640
+ static createSolarSystem(overrides = {}) {
641
+ return {
642
+ systemId: 30000142,
643
+ border: false,
644
+ constellationId: 20000020,
645
+ hub: true,
646
+ international: false,
647
+ luminosity: 0.02142,
648
+ name: "Jita",
649
+ planetIDs: [40009077],
650
+ position: { x: -129e15, y: 607e14, z: -112e15 },
651
+ position2D: { x: -129e15, y: -112e15 },
652
+ radius: 467e10,
653
+ regionId: 10000002,
654
+ regional: false,
655
+ securityClass: "B",
656
+ securityStatus: 0.9459991455078125,
657
+ starId: 40009082,
658
+ stargateIDs: [50001248],
659
+ corridor: null,
660
+ fringe: null,
661
+ wormholeClassId: null,
662
+ visualEffect: null,
663
+ ...overrides
664
+ };
665
+ }
666
+ static createStargate(overrides = {}) {
667
+ return {
668
+ stargateId: 50001248,
669
+ destination: { solarSystemId: 30000144, stargateId: 50001249 },
670
+ position: { x: 15e11, y: 32e10, z: -87e10 },
671
+ solarSystemId: 30000142,
672
+ typeId: 16,
673
+ ...overrides
674
+ };
675
+ }
676
+ static createStar(overrides = {}) {
677
+ return {
678
+ starId: 40009082,
679
+ radius: 3466e5,
680
+ solarSystemId: 30000142,
681
+ statistics: {
682
+ age: 76e9,
683
+ life: 1e11,
684
+ luminosity: 0.02142,
685
+ locked: false,
686
+ spectralClass: "K7 V",
687
+ temperature: 4e3
688
+ },
689
+ typeId: 3796,
690
+ ...overrides
691
+ };
692
+ }
693
+ static createPlanet(overrides = {}) {
694
+ return {
695
+ planetId: 40009077,
696
+ asteroidBeltIDs: [40009079],
697
+ attributes: {},
698
+ celestialIndex: 1,
699
+ moonIDs: [40009078],
700
+ orbitId: 40009082,
701
+ position: { x: 12e12, y: 1e11, z: -35e11 },
702
+ radius: 233e4,
703
+ solarSystemId: 30000142,
704
+ statistics: {},
705
+ typeId: 2015,
706
+ npcStationIDs: null,
707
+ ...overrides
708
+ };
709
+ }
710
+ static createMoon(overrides = {}) {
711
+ return {
712
+ moonId: 40009078,
713
+ attributes: {},
714
+ celestialIndex: 1,
715
+ orbitId: 40009077,
716
+ orbitIndex: 1,
717
+ position: { x: 121e11, y: 101e9, z: -351e10 },
718
+ radius: 24e4,
719
+ solarSystemId: 30000142,
720
+ statistics: {},
721
+ typeId: 14,
722
+ npcStationIDs: null,
723
+ ...overrides
724
+ };
725
+ }
726
+ static createAsteroidBelt(overrides = {}) {
727
+ return {
728
+ asteroidBeltId: 40009079,
729
+ celestialIndex: 1,
730
+ orbitId: 40009077,
731
+ orbitIndex: 1,
732
+ position: { x: 119e11, y: 99e9, z: -349e10 },
733
+ radius: 5e4,
734
+ solarSystemId: 30000142,
735
+ statistics: {},
736
+ typeId: 15,
737
+ ...overrides
738
+ };
739
+ }
740
+ static createFaction(overrides = {}) {
741
+ return {
742
+ factionId: 500001,
743
+ corporationId: 1000035,
744
+ description: "The Caldari State is a corporate dictatorship.",
745
+ flatLogo: "res:/ui/texture/corps/caldari.png",
746
+ flatLogoWithName: "res:/ui/texture/corps/caldari_name.png",
747
+ iconId: 1439,
748
+ memberRaces: [1],
749
+ militiaCorporationId: 1000180,
750
+ name: "Caldari State",
751
+ shortDescription: "Caldari",
752
+ sizeFactor: 5,
753
+ solarSystemId: 30000142,
754
+ uniqueName: true,
755
+ ...overrides
756
+ };
757
+ }
758
+ static createRace(overrides = {}) {
759
+ return {
760
+ raceId: 1,
761
+ description: "The Caldari State is a corporate dictatorship.",
762
+ iconId: 1439,
763
+ name: "Caldari",
764
+ shipTypeId: 601,
765
+ skills: {},
766
+ ...overrides
767
+ };
768
+ }
769
+ static createBloodline(overrides = {}) {
770
+ return {
771
+ bloodlineId: 1,
772
+ charisma: 3,
773
+ corporationId: 1000006,
774
+ description: "The Deteis are regarded as the face of the Caldari State.",
775
+ iconId: 1383,
776
+ intelligence: 7,
777
+ memory: 7,
778
+ name: "Deteis",
779
+ perception: 5,
780
+ raceId: 1,
781
+ willpower: 5,
782
+ ...overrides
783
+ };
784
+ }
785
+ static createAncestry(overrides = {}) {
786
+ return {
787
+ ancestryId: 1,
788
+ bloodlineId: 1,
789
+ charisma: 0,
790
+ description: "Born and raised in a capsule.",
791
+ iconId: 1664,
792
+ intelligence: 0,
793
+ memory: 0,
794
+ name: "Tube Child",
795
+ perception: 0,
796
+ shortDescription: "Raised in a capsule.",
797
+ willpower: 2,
798
+ ...overrides
799
+ };
800
+ }
801
+ static createNpcCorporation(overrides = {}) {
802
+ return {
803
+ corporationId: 1000035,
804
+ ceoId: 3004451,
805
+ deleted: false,
806
+ description: "The Caldari Navy is the armed forces of the Caldari State.",
807
+ extent: "G",
808
+ hasPlayerPersonnelManager: false,
809
+ initialPrice: 0,
810
+ memberLimit: 0,
811
+ minSecurity: 0,
812
+ minimumJoinStanding: 0,
813
+ name: "Caldari Navy",
814
+ sendCharTerminationMessage: true,
815
+ shares: 1e5,
816
+ size: "H",
817
+ stationId: 60003760,
818
+ taxRate: 0,
819
+ tickerName: "CN",
820
+ uniqueName: true,
821
+ allowedMemberRaces: null,
822
+ corporationTrades: null,
823
+ divisions: null,
824
+ enemyId: null,
825
+ factionId: 500001,
826
+ friendId: null,
827
+ iconId: 1439,
828
+ investors: null,
829
+ lpOfferTables: null,
830
+ mainActivityId: null,
831
+ raceId: 1,
832
+ sizeFactor: null,
833
+ solarSystemId: 30000142,
834
+ secondaryActivityId: null,
835
+ ...overrides
836
+ };
837
+ }
838
+ static createNpcStation(overrides = {}) {
839
+ return {
840
+ stationId: 60003760,
841
+ celestialIndex: 4,
842
+ operationId: 1,
843
+ orbitId: 40009081,
844
+ orbitIndex: 4,
845
+ ownerId: 1000035,
846
+ position: { x: 158e12, y: 963e10, z: 106e12 },
847
+ reprocessingEfficiency: 0.5,
848
+ reprocessingHangarFlag: 4,
849
+ reprocessingStationsTake: 0.05,
850
+ solarSystemId: 30000142,
851
+ typeId: 1529,
852
+ useOperationName: true,
853
+ ...overrides
854
+ };
855
+ }
856
+ static createMarketGroup(overrides = {}) {
857
+ return {
858
+ marketGroupId: 1857,
859
+ description: "Refined minerals used in manufacturing.",
860
+ hasTypes: true,
861
+ iconId: 22,
862
+ name: "Minerals",
863
+ parentGroupId: 1031,
864
+ ...overrides
865
+ };
866
+ }
867
+ static createMetaGroup(overrides = {}) {
868
+ return {
869
+ metaGroupId: 1,
870
+ color: { r: 255, g: 255, b: 255, a: 255 },
871
+ name: "Tech I",
872
+ iconId: null,
873
+ iconSuffix: null,
874
+ description: null,
875
+ ...overrides
876
+ };
877
+ }
878
+ static createIcon(overrides = {}) {
879
+ return {
880
+ iconId: 22,
881
+ iconFile: "res:/UI/Texture/Icons/22_32_2.png",
882
+ ...overrides
883
+ };
884
+ }
885
+ static createGraphic(overrides = {}) {
886
+ return {
887
+ graphicId: 20,
888
+ graphicFile: "res:/dx9/model/worldobject/asteroid/oreveld001.red",
889
+ iconFolder: null,
890
+ sofFactionName: null,
891
+ sofHullName: null,
892
+ sofRaceName: null,
893
+ ...overrides
894
+ };
895
+ }
896
+ static createDogmaAttribute(overrides = {}) {
897
+ return {
898
+ attributeId: 9,
899
+ attributeCategoryId: 1,
900
+ dataType: 2,
901
+ defaultValue: 0,
902
+ description: "Hit points for a ship.",
903
+ displayWhenZero: false,
904
+ highIsGood: true,
905
+ name: "hp",
906
+ published: true,
907
+ stackable: false,
908
+ displayName: null,
909
+ iconId: null,
910
+ tooltipDescription: null,
911
+ tooltipTitle: null,
912
+ unitId: 1,
913
+ chargeRechargeTimeId: null,
914
+ maxAttributeId: null,
915
+ minAttributeId: null,
916
+ ...overrides
917
+ };
918
+ }
919
+ static createDogmaEffect(overrides = {}) {
920
+ return {
921
+ effectId: 11,
922
+ disallowAutoRepeat: false,
923
+ dischargeAttributeId: 0,
924
+ durationAttributeId: 0,
925
+ effectCategoryId: 0,
926
+ electronicChance: false,
927
+ guid: "effects.LowSlotModifier",
928
+ isAssistance: false,
929
+ isOffensive: false,
930
+ isWarpSafe: true,
931
+ name: "lowSlotModifier",
932
+ propulsionChance: false,
933
+ published: true,
934
+ rangeChance: false,
935
+ distribution: null,
936
+ falloffAttributeId: null,
937
+ rangeAttributeId: null,
938
+ trackingSpeedAttributeId: null,
939
+ description: null,
940
+ displayName: null,
941
+ iconId: null,
942
+ modifierInfo: null,
943
+ ...overrides
944
+ };
945
+ }
946
+ static createBlueprint(overrides = {}) {
947
+ return {
948
+ activities: {
949
+ manufacturing: {
950
+ time: 6e3,
951
+ materials: [
952
+ { typeId: 34, quantity: 100 },
953
+ { typeId: 35, quantity: 50 }
954
+ ],
955
+ products: [{ typeId: 587, quantity: 1 }]
956
+ }
957
+ },
958
+ blueprintTypeId: 787,
959
+ maxProductionLimit: 10,
960
+ ...overrides
961
+ };
962
+ }
963
+ static createPlanetSchematic(overrides = {}) {
964
+ return {
965
+ planetSchematicId: 65,
966
+ cycleTime: 1800,
967
+ name: "Bacteria",
968
+ pins: [],
969
+ types: [],
970
+ ...overrides
971
+ };
972
+ }
973
+ static createVersionInfo(overrides = {}) {
974
+ return {
975
+ version: "2024-01-15.1",
976
+ buildDate: "2024-01-15T00:00:00Z",
977
+ importedAt: "2024-01-16T12:00:00Z",
978
+ checksum: "abc123def456",
979
+ ...overrides
980
+ };
981
+ }
982
+ static createHierarchicalTestData() {
983
+ const category = this.createEveCategory();
984
+ const group = this.createEveGroup({ categoryId: category.categoryId });
985
+ const type1 = this.createEveType({
986
+ typeId: 34,
987
+ name: "Tritanium",
988
+ groupId: group.groupId
989
+ });
990
+ const type2 = this.createEveType({
991
+ typeId: 35,
992
+ name: "Pyerite",
993
+ groupId: group.groupId
994
+ });
995
+ const type3 = this.createEveType({
996
+ typeId: 36,
997
+ name: "Mexallon",
998
+ groupId: group.groupId
999
+ });
1000
+ const region = this.createRegion();
1001
+ const constellation = this.createConstellation({
1002
+ regionId: region.regionId
1003
+ });
1004
+ const system1 = this.createSolarSystem({
1005
+ systemId: 30000142,
1006
+ name: "Jita",
1007
+ constellationId: constellation.constellationId,
1008
+ regionId: region.regionId
1009
+ });
1010
+ const system2 = this.createSolarSystem({
1011
+ systemId: 30000144,
1012
+ name: "Perimeter",
1013
+ constellationId: constellation.constellationId,
1014
+ regionId: region.regionId,
1015
+ securityStatus: 0.9
1016
+ });
1017
+ const stargate = this.createStargate({
1018
+ solarSystemId: system1.systemId,
1019
+ destination: { solarSystemId: system2.systemId, stargateId: 50001249 }
1020
+ });
1021
+ const star = this.createStar({ solarSystemId: system1.systemId });
1022
+ const planet = this.createPlanet({ solarSystemId: system1.systemId });
1023
+ const moon = this.createMoon({ solarSystemId: system1.systemId });
1024
+ const asteroidBelt = this.createAsteroidBelt({
1025
+ solarSystemId: system1.systemId
1026
+ });
1027
+ const race = this.createRace();
1028
+ const faction = this.createFaction({ memberRaces: [race.raceId] });
1029
+ const bloodline = this.createBloodline({ raceId: race.raceId });
1030
+ const ancestry = this.createAncestry({
1031
+ bloodlineId: bloodline.bloodlineId
1032
+ });
1033
+ const npcCorp = this.createNpcCorporation({
1034
+ factionId: faction.factionId,
1035
+ raceId: race.raceId
1036
+ });
1037
+ const npcStation = this.createNpcStation({
1038
+ solarSystemId: system1.systemId,
1039
+ ownerId: npcCorp.corporationId
1040
+ });
1041
+ const rootMarketGroup = this.createMarketGroup({
1042
+ marketGroupId: 1031,
1043
+ name: "Manufacture & Research",
1044
+ parentGroupId: null,
1045
+ hasTypes: false
1046
+ });
1047
+ const marketGroup = this.createMarketGroup({
1048
+ parentGroupId: rootMarketGroup.marketGroupId
1049
+ });
1050
+ const metaGroup = this.createMetaGroup();
1051
+ const icon = this.createIcon();
1052
+ const graphic = this.createGraphic();
1053
+ const dogmaAttribute = this.createDogmaAttribute();
1054
+ const dogmaEffect = this.createDogmaEffect();
1055
+ const blueprint = this.createBlueprint();
1056
+ const planetSchematic = this.createPlanetSchematic();
1057
+ return {
1058
+ categories: [category],
1059
+ groups: [group],
1060
+ types: [type1, type2, type3],
1061
+ regions: [region],
1062
+ constellations: [constellation],
1063
+ solarSystems: [system1, system2],
1064
+ stargates: [stargate],
1065
+ stars: [star],
1066
+ planets: [planet],
1067
+ moons: [moon],
1068
+ asteroidBelts: [asteroidBelt],
1069
+ factions: [faction],
1070
+ races: [race],
1071
+ bloodlines: [bloodline],
1072
+ ancestries: [ancestry],
1073
+ npcCorporations: [npcCorp],
1074
+ npcStations: [npcStation],
1075
+ marketGroups: [rootMarketGroup, marketGroup],
1076
+ metaGroups: [metaGroup],
1077
+ icons: [icon],
1078
+ graphics: [graphic],
1079
+ dogmaAttributes: [dogmaAttribute],
1080
+ dogmaEffects: [dogmaEffect],
1081
+ blueprints: [blueprint],
1082
+ planetSchematics: [planetSchematic],
1083
+ version: this.createVersionInfo()
1084
+ };
1085
+ }
1086
+ };
1087
+ // Annotate the CommonJS export names for ESM import in node:
1088
+ 0 && (module.exports = {
1089
+ MemorySdeProvider,
1090
+ SdeDatabaseError,
1091
+ SdeError,
1092
+ SdeTestDataFactory,
1093
+ SdeValidationError,
1094
+ SdeVersionMismatchError,
1095
+ isSdeDatabaseError,
1096
+ isSdeError,
1097
+ isSdeValidationError,
1098
+ isSdeVersionMismatch
1099
+ });
1100
+ //# sourceMappingURL=memory.js.map