diff --git a/lib/endpoints/alliance.test.ts b/lib/endpoints/alliance.test.ts index 08fb6fb..af3b060 100644 --- a/lib/endpoints/alliance.test.ts +++ b/lib/endpoints/alliance.test.ts @@ -17,12 +17,8 @@ test('find', async () => { }); test('viewProfile', async () => { - // The `EmpireBlock` type (lib/types/status.ts) has no `alliance_id` - // field, but the live empire/get_status response actually includes one - // at runtime (it's just missing from the hand-written type) - cast to - // pick it up. const { result: statusResult } = await lacuna.empire.getStatus(); - const allianceId = (statusResult?.empire as { alliance_id?: number } | undefined)?.alliance_id; + const allianceId = statusResult?.empire?.alliance_id; if (allianceId === undefined) { console.warn('Skipping: fixture empire has no alliance_id on empire/get_status'); diff --git a/lib/types/alliance.ts b/lib/types/alliance.ts index 5282f64..f30f2a9 100644 --- a/lib/types/alliance.ts +++ b/lib/types/alliance.ts @@ -6,13 +6,13 @@ export interface ViewProfileParams { export interface ViewProfileResponse { profile: { - id: string; + id: number; name: string; description: string; - leader_id: string; + leader_id: number; date_created: string; - members: Array<{ id: string; name: string }>; - space_stations: Array<{ id: string; name: string; x: number; y: number }>; + members: Array<{ id: number; name: string }>; + space_stations: Array<{ id: number; name: string; x: number; y: number }>; influence: number; }; status: { @@ -27,7 +27,7 @@ export interface FindParams { } export interface FindResponse { - alliances: Array<{ id: string; name: string }>; + alliances: Array<{ id: number; name: string }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; diff --git a/lib/types/archaeology.ts b/lib/types/archaeology.ts index 2d5d28a..072b22d 100644 --- a/lib/types/archaeology.ts +++ b/lib/types/archaeology.ts @@ -52,7 +52,7 @@ export interface GetGlyphSummaryParams { } export interface GetGlyphSummaryResponse { - glyphs: Array<{ id: string; name: string; type: string; quantity: number }>; + glyphs: Array<{ id: number; name: string; type: string; quantity: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -96,7 +96,7 @@ export interface ViewExcavatorsResponse { max_excavators: number; travelling: number; excavators: Array<{ - id: string; + id: number; date_landed: string; body?: Record; artifact_chance?: number; diff --git a/lib/types/body.ts b/lib/types/body.ts index 3c9f47d..54fde8c 100644 --- a/lib/types/body.ts +++ b/lib/types/body.ts @@ -1,4 +1,5 @@ import { StatusBlock } from './status'; +import type { components } from './schema'; export interface BuildingSummary { efficiency: number; @@ -29,50 +30,6 @@ export interface GetStatusParams { export interface GetStatusResponse extends StatusBlock {} -export interface GetBodyStatusParams { - body_id: number; -} - -export interface GetBodyStatusResponse { - body: { - id: number; - x: number; - y: number; - zone: string; - star_id: number; - star_name: string; - orbit: number; - type: string; - name: string; - image: string; - size: number; - water: number; - - ore: { - anthracite: number; - bauxite: number; - beryl: number; - chromite: number; - chalcopyrite: number; - fluorite: number; - galena: number; - goethite: number; - gold: number; - gypsum: number; - halite: number; - kerogen: number; - magnetite: number; - methane: number; - monazite: number; - rutile: number; - sulfur: number; - trona: number; - uraninite: number; - zircon: number; - }; - }; -} - export interface RearrangeBuildingsParams { body_id: number; arrangement: Array<{ @@ -90,6 +47,11 @@ export interface RearrangeBuildingsResponse { name: string; x: number; y: number; - id: string; + id: number; }>; + status: { + server: components['schemas']['server_status']; + empire?: components['schemas']['empire_status']; + body?: components['schemas']['body_status']; + }; } diff --git a/lib/types/building.ts b/lib/types/building.ts index ab36b56..53c6b33 100644 --- a/lib/types/building.ts +++ b/lib/types/building.ts @@ -1,5 +1,6 @@ import { BuildingSummary } from './body'; import { ServerDate } from '.'; +import type { components } from './schema'; export interface Building { id: number; @@ -82,6 +83,11 @@ export interface ViewParams { export interface ViewResponse { building: Building; + status: { + server: components['schemas']['server_status']; + empire?: components['schemas']['empire_status']; + body?: components['schemas']['body_status']; + }; } export interface UpgradeParams { @@ -98,13 +104,28 @@ export interface UpgradeResponse { }; level: number; }; + status: { + server: components['schemas']['server_status']; + empire?: components['schemas']['empire_status']; + body?: components['schemas']['body_status']; + }; } export interface DowngradeParams { building_id: number; } -export interface DowngradeResponse {} +export interface DowngradeResponse { + building: Building; + status: { + server: components['schemas']['server_status']; + empire?: components['schemas']['empire_status']; + body?: components['schemas']['body_status']; + }; + buildings: { + [index: string]: BuildingSummary; + }; +} export interface DemolishParams { building_id: number; @@ -112,6 +133,11 @@ export interface DemolishParams { export interface DemolishResponse { /** Untested - no test demolishes a building. Shape per @tlecommunity/api-spec. */ + status: { + server: components['schemas']['server_status']; + empire?: components['schemas']['empire_status']; + body?: components['schemas']['body_status']; + }; buildings: { [index: string]: BuildingSummary; }; @@ -133,6 +159,14 @@ export interface BuildResponse { end: ServerDate; }; }; + status: { + server: components['schemas']['server_status']; + empire?: components['schemas']['empire_status']; + body?: components['schemas']['body_status']; + }; + buildings: { + [index: string]: BuildingSummary; + }; } export interface RepairParams { @@ -141,6 +175,14 @@ export interface RepairParams { export interface RepairResponse { building: Building; + status: { + server: components['schemas']['server_status']; + empire?: components['schemas']['empire_status']; + body?: components['schemas']['body_status']; + }; + buildings: { + [index: string]: BuildingSummary; + }; } export interface GetStatsForLevelParams { @@ -191,4 +233,9 @@ export interface GetStatsForLevelResponse { image: string; }; }; + status: { + server: components['schemas']['server_status']; + empire?: components['schemas']['empire_status']; + body?: components['schemas']['body_status']; + }; } diff --git a/lib/types/development.ts b/lib/types/development.ts index c73632c..bf02655 100644 --- a/lib/types/development.ts +++ b/lib/types/development.ts @@ -29,7 +29,7 @@ export interface SubsidizeOneBuildResponse { export interface CancelBuildParams { building_id: number; - scheduled_id?: string | Array; + scheduled_id?: number | Array; cancel_all?: boolean; } @@ -41,7 +41,7 @@ export interface CancelBuildResponse { body?: components['schemas']['body_status']; }; build_queue: Array<{ - building_id: string; + building_id: number; name: string; to_level: number; seconds_remaining: number; diff --git a/lib/types/embassy.ts b/lib/types/embassy.ts index 6be9b12..512c5b5 100644 --- a/lib/types/embassy.ts +++ b/lib/types/embassy.ts @@ -18,10 +18,10 @@ export interface GetAllianceStatusParams { } export interface GetAllianceStatusResponse { - id?: string; + id?: number; name?: string; - members?: Array<{ empire_id?: string; name?: string }>; - leader_id?: string; + members?: Array<{ empire_id?: number; name?: string }>; + leader_id?: number; forum_uri?: string; description?: string; announcements?: string; @@ -91,7 +91,7 @@ export interface GetPendingInvitesParams { } export interface GetPendingInvitesResponse { - invites: Array<{ id?: string; name?: string; empire_id?: string }>; + invites: Array<{ id?: number; name?: string; empire_id?: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -132,7 +132,7 @@ export interface GetMyInvitesParams { } export interface GetMyInvitesResponse { - invites: Array<{ id?: string; name?: string; alliance_id?: string }>; + invites: Array<{ id?: number; name?: string; alliance_id?: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -228,7 +228,7 @@ export interface ViewPropositionsParams { export interface ViewPropositionsResponse { propositions: Array<{ - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -236,7 +236,7 @@ export interface ViewPropositionsResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }>; status: { diff --git a/lib/types/genetics-lab.ts b/lib/types/genetics-lab.ts index add3672..52900e3 100644 --- a/lib/types/genetics-lab.ts +++ b/lib/types/genetics-lab.ts @@ -11,7 +11,7 @@ export interface PrepareExperimentResponse { body?: components['schemas']['body_status']; }; grafts: Array<{ - spy: { id: string; name: string }; + spy: { id: number; name: string }; species: { name: string; description: string; @@ -50,7 +50,7 @@ export interface RunExperimentResponse { body?: components['schemas']['body_status']; }; grafts: Array<{ - spy: { id: string; name: string }; + spy: { id: number; name: string }; species: { name: string; description: string; diff --git a/lib/types/inbox.ts b/lib/types/inbox.ts index b75c46f..6eae0e3 100644 --- a/lib/types/inbox.ts +++ b/lib/types/inbox.ts @@ -25,13 +25,13 @@ export interface ViewInboxParams { export interface ViewInboxResponse { messages: Array<{ - id: string; + id: number; subject: string; date: string; from: string; - from_id: string; + from_id: number; to: string; - to_id: string; + to_id: number; has_read: 1 | 0; has_replied: 1 | 0; body_preview: string; @@ -84,13 +84,13 @@ export interface ViewArchivedParams { export interface ViewArchivedResponse { messages: Array<{ - id: string; + id: number; subject: string; date: string; from: string; - from_id: string; + from_id: number; to: string; - to_id: string; + to_id: number; has_read: 1 | 0; has_replied: 1 | 0; body_preview: string; @@ -143,13 +143,13 @@ export interface ViewTrashedParams { export interface ViewTrashedResponse { messages: Array<{ - id: string; + id: number; subject: string; date: string; from: string; - from_id: string; + from_id: number; to: string; - to_id: string; + to_id: number; has_read: 1 | 0; has_replied: 1 | 0; body_preview: string; @@ -202,13 +202,13 @@ export interface ViewSentParams { export interface ViewSentResponse { messages: Array<{ - id: string; + id: number; subject: string; date: string; from: string; - from_id: string; + from_id: number; to: string; - to_id: string; + to_id: number; has_read: 1 | 0; has_replied: 1 | 0; body_preview: string; @@ -261,13 +261,13 @@ export interface ViewUnreadParams { export interface ViewUnreadResponse { messages: Array<{ - id: string; + id: number; subject: string; date: string; from: string; - from_id: string; + from_id: number; to: string; - to_id: string; + to_id: number; has_read: 1 | 0; has_replied: 1 | 0; body_preview: string; @@ -301,11 +301,11 @@ export interface ReadMessageParams { export interface ReadMessageResponse { message: { - id: string; + id: number; from: string; - from_id: string; + from_id: number; to: string; - to_id: string; + to_id: number; subject: string; body: string; date: string; diff --git a/lib/types/index.ts b/lib/types/index.ts index 8a0a593..973cc3c 100644 --- a/lib/types/index.ts +++ b/lib/types/index.ts @@ -1,12 +1,52 @@ +import * as Alliance from './alliance'; +import * as Archaeology from './archaeology'; import * as Body from './body'; import * as Building from './building'; +import * as Capitol from './capitol'; import * as Captcha from './captcha'; +import * as Development from './development'; +import * as DistributionCenter from './distribution-center'; +import * as Embassy from './embassy'; import * as Empire from './empire'; +import * as EnergyReserve from './energy-reserve'; +import * as Entertainment from './entertainment'; import * as EssentiaVein from './essentia-vein'; +import * as FoodReserve from './food-reserve'; +import * as GeneticsLab from './genetics-lab'; +import * as Inbox from './inbox'; +import * as Intelligence from './intelligence'; +import * as LibraryOfJith from './library-of-jith'; +// `Map` intentionally shadows the global `Map` constructor within this +// file's scope only (unused here) - kept to mirror `lacuna.map` / +// `lib/endpoints/map.ts`'s `Map` class 1:1. +import * as Map from './map'; +import * as MercenariesGuild from './mercenaries-guild'; +import * as MiningMinistry from './mining-ministry'; +import * as MissionCommand from './mission-command'; +import * as Network19 from './network19'; +import * as Observatory from './observatory'; +import * as OracleOfAnid from './oracle-of-anid'; +import * as OreStorage from './ore-storage'; +import * as Park from './park'; +import * as Parliament from './parliament'; +import * as PlanetaryCommand from './planetary-command'; +import * as PoliceStation from './police-station'; +import * as Security from './security'; import * as Shipyard from './shipyard'; import * as SpacePort from './space-port'; +import * as SpaceStationLab from './space-station-lab'; +import * as StationCommand from './station-command'; import * as Stats from './stats'; import * as Status from './status'; +import * as SubspaceSupplyDepot from './subspace-supply-depot'; +import * as TempleOfTheDrajilites from './temple-of-the-drajilites'; +import * as TheDillonForge from './the-dillon-forge'; +import * as ThemePark from './theme-park'; +import * as Trade from './trade'; +import * as Transporter from './transporter'; +import * as WasteExchanger from './waste-exchanger'; +import * as WasteRecycling from './waste-recycling'; +import * as WaterStorage from './water-storage'; export type ServerDate = string; export type EmpireName = string; @@ -21,4 +61,51 @@ export interface LacunaConfig { serverUrl?: string; } -export { Body, Building, Captcha, Empire, EssentiaVein, Shipyard, SpacePort, Stats, Status }; +export { + Alliance, + Archaeology, + Body, + Building, + Capitol, + Captcha, + Development, + DistributionCenter, + Embassy, + Empire, + EnergyReserve, + Entertainment, + EssentiaVein, + FoodReserve, + GeneticsLab, + Inbox, + Intelligence, + LibraryOfJith, + Map, + MercenariesGuild, + MiningMinistry, + MissionCommand, + Network19, + Observatory, + OracleOfAnid, + OreStorage, + Park, + Parliament, + PlanetaryCommand, + PoliceStation, + Security, + Shipyard, + SpacePort, + SpaceStationLab, + StationCommand, + Stats, + Status, + SubspaceSupplyDepot, + TempleOfTheDrajilites, + TheDillonForge, + ThemePark, + Trade, + Transporter, + WasteExchanger, + WasteRecycling, + WaterStorage, +}; diff --git a/lib/types/intelligence.ts b/lib/types/intelligence.ts index ce3bc08..7c3b4eb 100644 --- a/lib/types/intelligence.ts +++ b/lib/types/intelligence.ts @@ -23,7 +23,7 @@ export interface ViewSpiesParams { export interface ViewSpiesResponse { spies: Array<{ - id: string; + id: number; name: string; assignment: string; possible_assignments?: Array<{ task?: string; recovery?: number; skill?: string }>; @@ -34,8 +34,8 @@ export interface ViewSpiesResponse { intel: number; offense_rating?: number; defense_rating?: number; - assigned_to?: { body_id?: string; name?: string; x?: number; y?: number }; - based_from?: { body_id?: string; name?: string; x?: number; y?: number }; + assigned_to?: { body_id?: number; name?: string; x?: number; y?: number }; + based_from?: { body_id?: number; name?: string; x?: number; y?: number }; is_available: 1 | 0; available_on?: string; started_assignment?: string; @@ -56,7 +56,7 @@ export interface ViewAllSpiesParams { export interface ViewAllSpiesResponse { spies: Array<{ - id: string; + id: number; name: string; assignment: string; possible_assignments?: Array<{ task?: string; recovery?: number; skill?: string }>; @@ -67,8 +67,8 @@ export interface ViewAllSpiesResponse { intel: number; offense_rating?: number; defense_rating?: number; - assigned_to?: { body_id?: string; name?: string; x?: number; y?: number }; - based_from?: { body_id?: string; name?: string; x?: number; y?: number }; + assigned_to?: { body_id?: number; name?: string; x?: number; y?: number }; + based_from?: { body_id?: number; name?: string; x?: number; y?: number }; is_available: 1 | 0; available_on?: string; started_assignment?: string; @@ -132,7 +132,7 @@ export interface NameSpiesParams { export interface NameSpiesResponse { spies: Array<{ - id: string; + id: number; name: string; assignment: string; possible_assignments?: Array<{ task?: string; recovery?: number; skill?: string }>; @@ -143,8 +143,8 @@ export interface NameSpiesResponse { intel: number; offense_rating?: number; defense_rating?: number; - assigned_to?: { body_id?: string; name?: string; x?: number; y?: number }; - based_from?: { body_id?: string; name?: string; x?: number; y?: number }; + assigned_to?: { body_id?: number; name?: string; x?: number; y?: number }; + based_from?: { body_id?: number; name?: string; x?: number; y?: number }; is_available: 1 | 0; available_on?: string; started_assignment?: string; @@ -225,11 +225,11 @@ export interface AssignSpyParams { export interface AssignSpyResponse { mission: { result?: 'Accepted' | 'Success' | 'Bounce' | 'Failure'; - message_id?: string; + message_id?: number; reason?: string; }; spy: { - id: string; + id: number; name: string; assignment: string; possible_assignments?: Array<{ task?: string; recovery?: number; skill?: string }>; @@ -240,8 +240,8 @@ export interface AssignSpyResponse { intel: number; offense_rating?: number; defense_rating?: number; - assigned_to?: { body_id?: string; name?: string; x?: number; y?: number }; - based_from?: { body_id?: string; name?: string; x?: number; y?: number }; + assigned_to?: { body_id?: number; name?: string; x?: number; y?: number }; + based_from?: { body_id?: number; name?: string; x?: number; y?: number }; is_available: 1 | 0; available_on?: string; started_assignment?: string; diff --git a/lib/types/map.ts b/lib/types/map.ts index 223d881..3de3917 100644 --- a/lib/types/map.ts +++ b/lib/types/map.ts @@ -55,8 +55,8 @@ export interface GetStarsResponse { x: number; y: number; zone: string; - id: string; - station?: { id: string; x: number; y: number; name: string }; + id: number; + station?: { id: number; x: number; y: number; name: string }; bodies?: Array; }>; status: { @@ -90,8 +90,8 @@ export interface GetStarResponse { x: number; y: number; zone: string; - id: string; - station?: { id: string; x: number; y: number; name: string }; + id: number; + station?: { id: number; x: number; y: number; name: string }; bodies?: Array; }; status: { @@ -112,8 +112,8 @@ export interface GetStarByNameResponse { x: number; y: number; zone: string; - id: string; - station?: { id: string; x: number; y: number; name: string }; + id: number; + station?: { id: number; x: number; y: number; name: string }; bodies?: Array; }; status: { @@ -135,8 +135,8 @@ export interface GetStarByXyResponse { x: number; y: number; zone: string; - id: string; - station?: { id: string; x: number; y: number; name: string }; + id: number; + station?: { id: number; x: number; y: number; name: string }; bodies?: Array; }; status: { @@ -177,5 +177,5 @@ export interface ViewLawsResponse { empire?: components['schemas']['empire_status']; body?: components['schemas']['body_status']; }; - laws: Array<{ id: string; name: string; description: string; date_enacted: string }>; + laws: Array<{ id: number; name: string; description: string; date_enacted: string }>; } diff --git a/lib/types/mercenaries-guild.ts b/lib/types/mercenaries-guild.ts index 3bf0bc6..694b30c 100644 --- a/lib/types/mercenaries-guild.ts +++ b/lib/types/mercenaries-guild.ts @@ -8,7 +8,7 @@ export interface AddToMarketParams { } export interface AddToMarketResponse { - trade_id: string; + trade_id: number; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -21,7 +21,7 @@ export interface GetSpiesParams { } export interface GetSpiesResponse { - spies: Array<{ id: string; name: string; level: number }>; + spies: Array<{ id: number; name: string; level: number }>; cargo_space_used_each: number; status: { server: components['schemas']['server_status']; @@ -64,11 +64,11 @@ export interface ViewMarketParams { export interface ViewMarketResponse { trades: Array<{ date_offered: string; - id: string; + id: number; ask: number; offer: Array; - body?: { id: string }; - empire?: { id: string; name: string }; + body?: { id: number }; + empire?: { id: number; name: string }; }>; trade_count: number; page_number: number; @@ -87,11 +87,11 @@ export interface ViewMyMarketParams { export interface ViewMyMarketResponse { trades: Array<{ date_offered: string; - id: string; + id: number; ask: number; offer: Array; - body?: { id: string }; - empire?: { id: string; name: string }; + body?: { id: number }; + empire?: { id: number; name: string }; }>; trade_count: number; page_number: number; @@ -108,7 +108,7 @@ export interface GetTradeShipsParams { } export interface GetTradeShipsResponse { - ships: Array<{ id: string; type: string; name: string; estimated_travel_time?: number }>; + ships: Array<{ id: number; type: string; name: string; estimated_travel_time?: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; diff --git a/lib/types/mining-ministry.ts b/lib/types/mining-ministry.ts index f236f8d..475bcdd 100644 --- a/lib/types/mining-ministry.ts +++ b/lib/types/mining-ministry.ts @@ -7,8 +7,8 @@ export interface ViewPlatformsParams { export interface ViewPlatformsResponse { max_platforms: number; platforms: Array<{ - id: string; - asteroid: { id: string; name: string; x: number; y: number; image: string }; + id: number; + asteroid: { id: number; name: string; x: number; y: number; image: string }; rutile_hour?: number; chromite_hour?: number; chalcopyrite_hour?: number; @@ -43,7 +43,7 @@ export interface ViewShipsParams { } export interface ViewShipsResponse { - ships: Array<{ name: string; id: string; task: string; speed: number; hold_size: number }>; + ships: Array<{ name: string; id: number; task: string; speed: number; hold_size: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; diff --git a/lib/types/mission-command.ts b/lib/types/mission-command.ts index 1e8fc0b..c9bd1bd 100644 --- a/lib/types/mission-command.ts +++ b/lib/types/mission-command.ts @@ -6,7 +6,7 @@ export interface GetMissionsParams { export interface GetMissionsResponse { missions: Array<{ - id: string; + id: number; max_university_level: number; date_posted: string; name: string; diff --git a/lib/types/observatory.ts b/lib/types/observatory.ts index c10b6bd..4aeec41 100644 --- a/lib/types/observatory.ts +++ b/lib/types/observatory.ts @@ -7,7 +7,7 @@ export interface GetProbedStarsParams { export interface GetProbedStarsResponse { stars: Array<{ - id: string; + id: number; color: string; name: string; x: number; diff --git a/lib/types/oracle-of-anid.ts b/lib/types/oracle-of-anid.ts index 5386f15..d4d2290 100644 --- a/lib/types/oracle-of-anid.ts +++ b/lib/types/oracle-of-anid.ts @@ -7,7 +7,7 @@ export interface GetStarParams { export interface GetStarResponse { star: { - id: string; + id: number; color: string; name: string; x: number; @@ -30,7 +30,7 @@ export interface GetProbedStarsParams { export interface GetProbedStarsResponse { stars: Array<{ - id: string; + id: number; color: string; name: string; x: number; diff --git a/lib/types/parliament.ts b/lib/types/parliament.ts index cb4fb5b..2575589 100644 --- a/lib/types/parliament.ts +++ b/lib/types/parliament.ts @@ -5,7 +5,7 @@ export interface ViewLawsParams { } export interface ViewLawsResponse { - laws: Array<{ id?: string; name?: string; description?: string; date_enacted?: string }>; + laws: Array<{ id?: number; name?: string; description?: string; date_enacted?: string }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -19,7 +19,7 @@ export interface ViewPropositionsParams { export interface ViewPropositionsResponse { propositions: Array<{ - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -27,7 +27,7 @@ export interface ViewPropositionsResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }>; status: { @@ -42,7 +42,7 @@ export interface ViewTaxesCollectedParams { } export interface ViewTaxesCollectedResponse { - taxes_collected: Array<{ id?: string; name?: string; paid?: Array; total?: number }>; + taxes_collected: Array<{ id?: number; name?: string; paid?: Array; total?: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -60,7 +60,7 @@ export interface GetStarsInJurisdictionResponse { color?: string; x?: number; y?: number; - station?: { id?: string; x?: number; y?: number; name?: string }; + station?: { id?: number; x?: number; y?: number; name?: string }; }>; status: { server: components['schemas']['server_status']; @@ -89,7 +89,7 @@ export interface GetMiningPlatformsForAsteroidInJurisdictionParams { } export interface GetMiningPlatformsForAsteroidInJurisdictionResponse { - platforms: Array<{ id?: string; empire?: { id?: string; name?: string } }>; + platforms: Array<{ id?: number; empire?: { id?: number; name?: string } }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -110,7 +110,7 @@ export interface CastVoteResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -118,7 +118,7 @@ export interface CastVoteResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -136,7 +136,7 @@ export interface ProposeWritResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -144,7 +144,7 @@ export interface ProposeWritResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -161,7 +161,7 @@ export interface ProposeRepealLawResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -169,7 +169,7 @@ export interface ProposeRepealLawResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -186,7 +186,7 @@ export interface ProposeTransferStationOwnershipResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -194,7 +194,7 @@ export interface ProposeTransferStationOwnershipResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -212,7 +212,7 @@ export interface ProposeRenameStarResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -220,7 +220,7 @@ export interface ProposeRenameStarResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -237,7 +237,7 @@ export interface ProposeBroadcastOnNetwork19Response { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -245,7 +245,7 @@ export interface ProposeBroadcastOnNetwork19Response { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -263,7 +263,7 @@ export interface ProposeInductMemberResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -271,7 +271,7 @@ export interface ProposeInductMemberResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -289,7 +289,7 @@ export interface ProposeExpelMemberResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -297,7 +297,7 @@ export interface ProposeExpelMemberResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -314,7 +314,7 @@ export interface ProposeElectNewLeaderResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -322,7 +322,7 @@ export interface ProposeElectNewLeaderResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -340,7 +340,7 @@ export interface ProposeRenameAsteroidResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -348,7 +348,7 @@ export interface ProposeRenameAsteroidResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -364,7 +364,7 @@ export interface ProposeMembersOnlyMiningRightsResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -372,7 +372,7 @@ export interface ProposeMembersOnlyMiningRightsResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -389,7 +389,7 @@ export interface ProposeEvictMiningPlatformResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -397,7 +397,7 @@ export interface ProposeEvictMiningPlatformResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -414,7 +414,7 @@ export interface ProposeTaxationResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -422,7 +422,7 @@ export interface ProposeTaxationResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -440,7 +440,7 @@ export interface ProposeForeignAidResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -448,7 +448,7 @@ export interface ProposeForeignAidResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -466,7 +466,7 @@ export interface ProposeRenameUninhabitedResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -474,7 +474,7 @@ export interface ProposeRenameUninhabitedResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -490,7 +490,7 @@ export interface ProposeMembersOnlyColonizationResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -498,7 +498,7 @@ export interface ProposeMembersOnlyColonizationResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -514,7 +514,7 @@ export interface ProposeMembersOnlyExcavationResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -522,7 +522,7 @@ export interface ProposeMembersOnlyExcavationResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -538,7 +538,7 @@ export interface ProposeMembersOnlyStationsResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -546,7 +546,7 @@ export interface ProposeMembersOnlyStationsResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -562,7 +562,7 @@ export interface ProposeNeutralizeBhgResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -570,7 +570,7 @@ export interface ProposeNeutralizeBhgResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -588,7 +588,7 @@ export interface ProposeFireBfgResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -596,7 +596,7 @@ export interface ProposeFireBfgResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } @@ -613,7 +613,7 @@ export interface AllowBhgByAllianceResponse { body?: components['schemas']['body_status']; }; proposition: { - id?: string; + id?: number; name?: string; description?: string; votes_needed?: number; @@ -621,7 +621,7 @@ export interface AllowBhgByAllianceResponse { votes_no?: number; status?: string; date_ends?: string; - proposed_by?: { id?: string; name?: string }; + proposed_by?: { id?: number; name?: string }; my_vote?: 1 | 0; }; } diff --git a/lib/types/planetary-command.ts b/lib/types/planetary-command.ts index 8d33c3c..c935691 100644 --- a/lib/types/planetary-command.ts +++ b/lib/types/planetary-command.ts @@ -19,7 +19,7 @@ export interface ViewIncomingSupplyChainsParams { export interface ViewIncomingSupplyChainsResponse { supply_chains: Array<{ - id?: string; + id?: number; from_body?: string; resource_hour?: number; resource_type?: string; diff --git a/lib/types/police-station.ts b/lib/types/police-station.ts index 475b9ee..ac23a04 100644 --- a/lib/types/police-station.ts +++ b/lib/types/police-station.ts @@ -7,7 +7,7 @@ export interface ViewPrisonersParams { export interface ViewPrisonersResponse { prisoners: Array<{ - id?: string; + id?: number; name?: string; level?: number; task?: 'Captured' | 'Prisoner Transport'; @@ -67,13 +67,13 @@ export interface ViewForeignShipsParams { export interface ViewForeignShipsResponse { ships: Array<{ - id?: string; + id?: number; name?: string; type?: string; type_human?: string; date_arrives?: string; date_arrived?: string; - from?: { id?: string; name?: string; empire?: { id?: string; name?: string } }; + from?: { id?: number; name?: string; empire?: { id?: number; name?: string } }; }>; number_of_ships: number; status: { @@ -90,12 +90,12 @@ export interface ViewShipsTravellingParams { export interface ViewShipsTravellingResponse { ships_travelling: Array<{ - id?: string; + id?: number; type?: string; type_human?: string; date_arrives?: string; - from?: { id?: string; type?: string; name?: string }; - to?: { id?: string; type?: string; name?: string }; + from?: { id?: number; type?: string; name?: string }; + to?: { id?: number; type?: string; name?: string }; }>; number_of_ships_travelling: number; status: { @@ -112,13 +112,13 @@ export interface ViewShipsOrbitingParams { export interface ViewShipsOrbitingResponse { ships: Array<{ - id?: string; + id?: number; name?: string; type?: string; type_human?: string; date_arrives?: string; date_arrived?: string; - from?: { id?: string; name?: string; empire?: { id?: string; name?: string } }; + from?: { id?: number; name?: string; empire?: { id?: number; name?: string } }; }>; number_of_ships: number; status: { diff --git a/lib/types/security.ts b/lib/types/security.ts index 2539642..3e8ee40 100644 --- a/lib/types/security.ts +++ b/lib/types/security.ts @@ -12,7 +12,7 @@ export interface ViewPrisonersResponse { body?: components['schemas']['body_status']; }; prisoners: Array<{ - id: string; + id: number; name: string; level: number; task: 'Captured' | 'Prisoner Transport'; diff --git a/lib/types/station-command.ts b/lib/types/station-command.ts index 2b8c767..a6f6923 100644 --- a/lib/types/station-command.ts +++ b/lib/types/station-command.ts @@ -19,8 +19,8 @@ export interface ViewIncomingSupplyChainsParams { export interface ViewIncomingSupplyChainsResponse { supply_chains: Array<{ - id?: string; - from_body?: { id?: string; name?: string; x?: number; y?: number; image?: string }; + id?: number; + from_body?: { id?: number; name?: string; x?: number; y?: number; image?: string }; resource_hour?: number; resource_type?: string; percent_transferred?: number; diff --git a/lib/types/status.ts b/lib/types/status.ts index 5dd00f6..d2e54eb 100644 --- a/lib/types/status.ts +++ b/lib/types/status.ts @@ -13,6 +13,7 @@ export interface BodiesList { } export interface EmpireBlock { + alliance_id?: number; bodies: { colonies: BodiesList[]; mystations?: BodiesList[]; diff --git a/lib/types/temple-of-the-drajilites.ts b/lib/types/temple-of-the-drajilites.ts index bf5a966..7cf18de 100644 --- a/lib/types/temple-of-the-drajilites.ts +++ b/lib/types/temple-of-the-drajilites.ts @@ -6,7 +6,7 @@ export interface ListPlanetsParams { } export interface ListPlanetsResponse { - planets: Array<{ id: string; name: string }>; + planets: Array<{ id: number; name: string }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; diff --git a/lib/types/trade.ts b/lib/types/trade.ts index e74d6a1..20d451b 100644 --- a/lib/types/trade.ts +++ b/lib/types/trade.ts @@ -17,7 +17,7 @@ export interface AddToMarketParams { } export interface AddToMarketResponse { - trade_id: string; + trade_id: number; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -33,7 +33,7 @@ export interface ViewMarketParams { export interface ViewMarketResponse { trades: Array<{ - id: string; + id: number; date: string; ask: number; offer: Array<{ @@ -43,11 +43,11 @@ export interface ViewMarketResponse { plan_type?: string; level?: number; extra_build_level?: number; - prisoner_id?: string; - ship_id?: string; + prisoner_id?: number; + ship_id?: number; }>; - empire?: { id?: string; name?: string }; - body?: { id?: string; name?: string }; + empire?: { id?: number; name?: string }; + body?: { id?: number; name?: string }; transmitter_delivery_time?: number; }>; status: { @@ -64,7 +64,7 @@ export interface ViewMyMarketParams { export interface ViewMyMarketResponse { trades: Array<{ - id: string; + id: number; date: string; ask: number; offer: Array<{ @@ -74,11 +74,11 @@ export interface ViewMyMarketResponse { plan_type?: string; level?: number; extra_build_level?: number; - prisoner_id?: string; - ship_id?: string; + prisoner_id?: number; + ship_id?: number; }>; - empire?: { id?: string; name?: string }; - body?: { id?: string; name?: string }; + empire?: { id?: number; name?: string }; + body?: { id?: number; name?: string }; transmitter_delivery_time?: number; }>; status: { @@ -159,7 +159,7 @@ export interface GetTradeShipsParams { export interface GetTradeShipsResponse { ships: Array<{ - id?: string; + id?: number; name?: string; type?: string; hold_size?: number; @@ -178,7 +178,7 @@ export interface GetShipsParams { } export interface GetShipsResponse { - ships: Array<{ id?: string; name?: string; type?: string; hold_size?: number; speed?: number }>; + ships: Array<{ id?: number; name?: string; type?: string; hold_size?: number; speed?: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -191,7 +191,7 @@ export interface GetWasteShipsParams { } export interface GetWasteShipsResponse { - ships: Array<{ id?: string; name?: string; task?: string; speed?: number; hold_size?: number }>; + ships: Array<{ id?: number; name?: string; task?: string; speed?: number; hold_size?: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -204,7 +204,7 @@ export interface GetSupplyShipsParams { } export interface GetSupplyShipsResponse { - ships: Array<{ id?: string; name?: string; task?: string; speed?: number; hold_size?: number }>; + ships: Array<{ id?: number; name?: string; task?: string; speed?: number; hold_size?: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -218,7 +218,7 @@ export interface ViewSupplyChainsParams { export interface ViewSupplyChainsResponse { supply_chains: Array<{ - id?: string; + id?: number; resource_type?: string; resource_hour?: number; percent_transferred?: number; @@ -306,7 +306,7 @@ export interface ViewWasteChainsParams { } export interface ViewWasteChainsResponse { - waste_chain: Array<{ id?: string; waste_hour?: number; percent_transferred?: number }>; + waste_chain: Array<{ id?: number; waste_hour?: number; percent_transferred?: number }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -359,7 +359,7 @@ export interface GetPrisonersParams { } export interface GetPrisonersResponse { - prisoners: Array<{ id?: string; name?: string; level?: number; sentence_expires?: string }>; + prisoners: Array<{ id?: number; name?: string; level?: number; sentence_expires?: string }>; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; diff --git a/lib/types/transporter.ts b/lib/types/transporter.ts index ef6a28d..635a676 100644 --- a/lib/types/transporter.ts +++ b/lib/types/transporter.ts @@ -15,7 +15,7 @@ export interface AddToMarketParams { } export interface AddToMarketResponse { - trade_id: string; + trade_id: number; status: { server: components['schemas']['server_status']; empire?: components['schemas']['empire_status']; @@ -28,7 +28,7 @@ export interface GetShipsParams { } export interface GetShipsResponse { - ships: Array<{ id?: string; name?: string; type?: string; hold_size?: number; speed?: number }>; + ships: Array<{ id?: number; name?: string; type?: string; hold_size?: number; speed?: number }>; cargo_space_used_each: number; status: { server: components['schemas']['server_status']; @@ -42,7 +42,7 @@ export interface GetPrisonersParams { } export interface GetPrisonersResponse { - prisoners: Array<{ id?: string; name?: string; level?: number; sentence_expires?: string }>; + prisoners: Array<{ id?: number; name?: string; level?: number; sentence_expires?: string }>; cargo_space_used_each: number; status: { server: components['schemas']['server_status']; @@ -113,11 +113,11 @@ export interface ViewMarketParams { export interface ViewMarketResponse { trades: Array<{ - id: string; + id: number; date_offered: string; ask: number; offer: Array; - empire?: { id?: string; name?: string }; + empire?: { id?: number; name?: string }; }>; trade_count: number; page_number: number; @@ -135,11 +135,11 @@ export interface ViewMyMarketParams { export interface ViewMyMarketResponse { trades: Array<{ - id: string; + id: number; date_offered: string; ask: number; offer: Array; - empire?: { id?: string; name?: string }; + empire?: { id?: number; name?: string }; }>; trade_count: number; page_number: number;