import fs from 'node:fs'; import { join } from 'node:path'; import type { Unit } from './unit'; import type { SolarSystem } from './solar-system'; import type { Attribute } from './attribute'; import type { Blueprint } from './blueprint'; import type { Category } from './category'; import type { Effect } from './effect'; import type { Group } from './group'; import type { Icon } from './icon'; import type { MarketGroup } from './market-group'; import type { MetaGroup } from './meta-group'; import type { Region } from './region'; import type { Schematic } from './schematic'; import type { Skill } from './skill'; import type { Type } from './type'; const dataSets = { loaded: false, dogma_attributes: {} as Record, blueprints: {} as Record, categories: {} as Record, dogma_effects: {} as Record, groups: {} as Record, icons: {} as Record, market_groups: {} as Record, meta_groups: {} as Record, regions: {} as Record, schematics: {} as Record, skills: {} as Record, solar_systems: {} as Record, types: {} as Record, units: {} as Record, }; export async function loadModels(): Promise { dataSets.dogma_attributes = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/dogma_attributes.json')).toString()); dataSets.blueprints = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/blueprints.json')).toString()); dataSets.categories = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/categories.json')).toString()); dataSets.dogma_effects = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/dogma_effects.json')).toString()); dataSets.groups = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/groups.json')).toString()); dataSets.icons = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/icons.json')).toString()); dataSets.market_groups = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/market_groups.json')).toString()); dataSets.meta_groups = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/meta_groups.json')).toString()); dataSets.regions = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/regions.json')).toString()); dataSets.schematics = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/schematics.json')).toString()); dataSets.skills = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/skills.json')).toString()); dataSets.solar_systems = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/solar_systems.json')).toString()); dataSets.types = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/types.json')).toString()); dataSets.units = JSON.parse(fs.readFileSync(join(__dirname, '../data/reference-data/units.json')).toString()); dataSets.loaded = true; } export { dataSets };