eve-esi-types 2.1.0 → 2.2.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.
- package/README.md +28 -2
- package/esi-types-util.md +108 -0
- package/package.json +9 -9
- package/rq-util.d.mts +84 -0
- package/rq-util.mjs +107 -0
- package/tsconfig.json +1 -0
- package/v2/extra-types.d.ts +28 -1091
- package/v2/get_alliances_alliance_id_contacts_labels_ok.d.ts +1 -1
- package/v2/get_alliances_alliance_id_contacts_ok.d.ts +1 -1
- package/v2/get_alliances_alliance_id_corporations_ok.d.ts +1 -1
- package/v2/get_alliances_alliance_id_icons_ok.d.ts +1 -1
- package/v2/get_alliances_alliance_id_ok.d.ts +1 -1
- package/v2/get_alliances_ok.d.ts +1 -1
- package/v2/get_characters_character_id_agents_research_ok.d.ts +1 -1
- package/v2/get_characters_character_id_assets_ok.d.ts +1 -1
- package/v2/get_characters_character_id_attributes_ok.d.ts +1 -1
- package/v2/get_characters_character_id_blueprints_ok.d.ts +1 -1
- package/v2/get_characters_character_id_bookmarks_folders_ok.d.ts +1 -1
- package/v2/get_characters_character_id_bookmarks_ok.d.ts +1 -1
- package/v2/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +1 -1
- package/v2/get_characters_character_id_calendar_event_id_ok.d.ts +1 -1
- package/v2/get_characters_character_id_calendar_ok.d.ts +1 -1
- package/v2/get_characters_character_id_clones_ok.d.ts +1 -1
- package/v2/get_characters_character_id_contacts_labels_ok.d.ts +1 -1
- package/v2/get_characters_character_id_contacts_ok.d.ts +1 -1
- package/v2/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +1 -1
- package/v2/get_characters_character_id_contracts_contract_id_items_ok.d.ts +1 -1
- package/v2/get_characters_character_id_contracts_ok.d.ts +1 -1
- package/v2/get_characters_character_id_corporationhistory_ok.d.ts +1 -1
- package/v2/get_characters_character_id_fatigue_ok.d.ts +1 -1
- package/v2/get_characters_character_id_fittings_ok.d.ts +1 -1
- package/v2/get_characters_character_id_fleet_ok.d.ts +1 -1
- package/v2/get_characters_character_id_fw_stats_ok.d.ts +1 -1
- package/v2/get_characters_character_id_implants_ok.d.ts +1 -1
- package/v2/get_characters_character_id_industry_jobs_ok.d.ts +1 -1
- package/v2/get_characters_character_id_killmails_recent_ok.d.ts +1 -1
- package/v2/get_characters_character_id_location_ok.d.ts +1 -1
- package/v2/get_characters_character_id_loyalty_points_ok.d.ts +1 -1
- package/v2/get_characters_character_id_mail_labels_ok.d.ts +1 -1
- package/v2/get_characters_character_id_mail_lists_ok.d.ts +1 -1
- package/v2/get_characters_character_id_mail_mail_id_ok.d.ts +1 -1
- package/v2/get_characters_character_id_mail_ok.d.ts +1 -1
- package/v2/get_characters_character_id_medals_ok.d.ts +1 -1
- package/v2/get_characters_character_id_mining_ok.d.ts +1 -1
- package/v2/get_characters_character_id_notifications_contacts_ok.d.ts +1 -1
- package/v2/get_characters_character_id_notifications_ok.d.ts +1 -1
- package/v2/get_characters_character_id_ok.d.ts +1 -1
- package/v2/get_characters_character_id_online_ok.d.ts +1 -1
- package/v2/get_characters_character_id_opportunities_ok.d.ts +1 -1
- package/v2/get_characters_character_id_orders_history_ok.d.ts +1 -1
- package/v2/get_characters_character_id_orders_ok.d.ts +1 -1
- package/v2/get_characters_character_id_planets_ok.d.ts +1 -1
- package/v2/get_characters_character_id_planets_planet_id_ok.d.ts +1 -1
- package/v2/get_characters_character_id_portrait_ok.d.ts +1 -1
- package/v2/get_characters_character_id_roles_ok.d.ts +1 -1
- package/v2/get_characters_character_id_search_ok.d.ts +1 -1
- package/v2/get_characters_character_id_ship_ok.d.ts +1 -1
- package/v2/get_characters_character_id_skillqueue_ok.d.ts +1 -1
- package/v2/get_characters_character_id_skills_ok.d.ts +1 -1
- package/v2/get_characters_character_id_standings_ok.d.ts +1 -1
- package/v2/get_characters_character_id_titles_ok.d.ts +1 -1
- package/v2/get_characters_character_id_wallet_journal_ok.d.ts +1 -1
- package/v2/get_characters_character_id_wallet_ok.d.ts +1 -1
- package/v2/get_characters_character_id_wallet_transactions_ok.d.ts +1 -1
- package/v2/get_contracts_public_bids_contract_id_ok.d.ts +1 -1
- package/v2/get_contracts_public_items_contract_id_ok.d.ts +1 -1
- package/v2/get_contracts_public_region_id_ok.d.ts +1 -1
- package/v2/get_corporation_corporation_id_mining_extractions_ok.d.ts +1 -1
- package/v2/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +1 -1
- package/v2/get_corporation_corporation_id_mining_observers_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_alliancehistory_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_assets_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_blueprints_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_bookmarks_folders_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_bookmarks_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_contacts_labels_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_contacts_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_containers_logs_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_contracts_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_customs_offices_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_divisions_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_facilities_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_fw_stats_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_icons_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_industry_jobs_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_killmails_recent_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_medals_issued_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_medals_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_members_limit_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_members_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_members_titles_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_membertracking_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_orders_history_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_orders_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_roles_history_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_roles_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_shareholders_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_standings_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_starbases_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_structures_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_titles_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +1 -1
- package/v2/get_corporations_corporation_id_wallets_ok.d.ts +1 -1
- package/v2/get_corporations_npccorps_ok.d.ts +1 -1
- package/v2/get_dogma_attributes_attribute_id_ok.d.ts +1 -1
- package/v2/get_dogma_attributes_ok.d.ts +1 -1
- package/v2/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +1 -1
- package/v2/get_dogma_effects_effect_id_ok.d.ts +1 -1
- package/v2/get_dogma_effects_ok.d.ts +1 -1
- package/v2/get_fleets_fleet_id_members_ok.d.ts +1 -1
- package/v2/get_fleets_fleet_id_ok.d.ts +1 -1
- package/v2/get_fleets_fleet_id_wings_ok.d.ts +1 -1
- package/v2/get_fw_leaderboards_characters_ok.d.ts +1 -1
- package/v2/get_fw_leaderboards_corporations_ok.d.ts +1 -1
- package/v2/get_fw_leaderboards_ok.d.ts +1 -1
- package/v2/get_fw_stats_ok.d.ts +1 -1
- package/v2/get_fw_systems_ok.d.ts +1 -1
- package/v2/get_fw_wars_ok.d.ts +1 -1
- package/v2/get_incursions_ok.d.ts +1 -1
- package/v2/get_industry_facilities_ok.d.ts +1 -1
- package/v2/get_industry_systems_ok.d.ts +1 -1
- package/v2/get_insurance_prices_ok.d.ts +1 -1
- package/v2/get_killmails_killmail_id_killmail_hash_ok.d.ts +1 -1
- package/v2/get_loyalty_stores_corporation_id_offers_ok.d.ts +1 -1
- package/v2/get_markets_groups_market_group_id_ok.d.ts +1 -1
- package/v2/get_markets_groups_ok.d.ts +1 -1
- package/v2/get_markets_prices_ok.d.ts +1 -1
- package/v2/get_markets_region_id_history_ok.d.ts +1 -1
- package/v2/get_markets_region_id_orders_ok.d.ts +1 -1
- package/v2/get_markets_region_id_types_ok.d.ts +1 -1
- package/v2/get_markets_structures_structure_id_ok.d.ts +1 -1
- package/v2/get_opportunities_groups_group_id_ok.d.ts +1 -1
- package/v2/get_opportunities_groups_ok.d.ts +1 -1
- package/v2/get_opportunities_tasks_ok.d.ts +1 -1
- package/v2/get_opportunities_tasks_task_id_ok.d.ts +1 -1
- package/v2/get_route_origin_destination_ok.d.ts +1 -1
- package/v2/get_sovereignty_campaigns_ok.d.ts +1 -1
- package/v2/get_sovereignty_map_ok.d.ts +1 -1
- package/v2/get_sovereignty_structures_ok.d.ts +1 -1
- package/v2/get_status_ok.d.ts +1 -1
- package/v2/get_universe_ancestries_ok.d.ts +1 -1
- package/v2/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +1 -1
- package/v2/get_universe_bloodlines_ok.d.ts +1 -1
- package/v2/get_universe_categories_category_id_ok.d.ts +1 -1
- package/v2/get_universe_categories_ok.d.ts +1 -1
- package/v2/get_universe_constellations_constellation_id_ok.d.ts +1 -1
- package/v2/get_universe_constellations_ok.d.ts +1 -1
- package/v2/get_universe_factions_ok.d.ts +1 -1
- package/v2/get_universe_graphics_graphic_id_ok.d.ts +1 -1
- package/v2/get_universe_graphics_ok.d.ts +1 -1
- package/v2/get_universe_groups_group_id_ok.d.ts +1 -1
- package/v2/get_universe_groups_ok.d.ts +1 -1
- package/v2/get_universe_moons_moon_id_ok.d.ts +1 -1
- package/v2/get_universe_planets_planet_id_ok.d.ts +1 -1
- package/v2/get_universe_races_ok.d.ts +1 -1
- package/v2/get_universe_regions_ok.d.ts +1 -1
- package/v2/get_universe_regions_region_id_ok.d.ts +1 -1
- package/v2/get_universe_schematics_schematic_id_ok.d.ts +1 -1
- package/v2/get_universe_stargates_stargate_id_ok.d.ts +1 -1
- package/v2/get_universe_stars_star_id_ok.d.ts +1 -1
- package/v2/get_universe_stations_station_id_ok.d.ts +1 -1
- package/v2/get_universe_structures_ok.d.ts +1 -1
- package/v2/get_universe_structures_structure_id_ok.d.ts +1 -1
- package/v2/get_universe_system_jumps_ok.d.ts +1 -1
- package/v2/get_universe_system_kills_ok.d.ts +1 -1
- package/v2/get_universe_systems_ok.d.ts +1 -1
- package/v2/get_universe_systems_system_id_ok.d.ts +1 -1
- package/v2/get_universe_types_ok.d.ts +1 -1
- package/v2/get_universe_types_type_id_ok.d.ts +1 -1
- package/v2/get_wars_ok.d.ts +1 -1
- package/v2/get_wars_war_id_killmails_ok.d.ts +1 -1
- package/v2/get_wars_war_id_ok.d.ts +1 -1
- package/v2/index.d.ts +171 -40
- package/v2/post_characters_affiliation_ok.d.ts +1 -1
- package/v2/post_characters_character_id_assets_locations_ok.d.ts +1 -1
- package/v2/post_characters_character_id_assets_names_ok.d.ts +1 -1
- package/v2/post_characters_character_id_contacts_created.d.ts +1 -1
- package/v2/post_characters_character_id_cspa_created.d.ts +1 -1
- package/v2/post_characters_character_id_fittings_created.d.ts +1 -1
- package/v2/post_characters_character_id_mail_created.d.ts +1 -1
- package/v2/post_characters_character_id_mail_labels_created.d.ts +1 -1
- package/v2/post_corporations_corporation_id_assets_locations_ok.d.ts +1 -1
- package/v2/post_corporations_corporation_id_assets_names_ok.d.ts +1 -1
- package/v2/post_fleets_fleet_id_wings_created.d.ts +1 -1
- package/v2/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +1 -1
- package/v2/post_universe_ids_ok.d.ts +1 -1
- package/v2/post_universe_names_ok.d.ts +1 -1
- package/v2.d.mts +32 -0
- package/v2.mjs +10 -93
- package/esi-request.mjs +0 -247
- package/src/get_alliances_alliance_id_contacts_labels_ok.d.ts +0 -27
- package/src/get_alliances_alliance_id_contacts_ok.d.ts +0 -43
- package/src/get_alliances_alliance_id_corporations_ok.d.ts +0 -14
- package/src/get_alliances_alliance_id_icons_ok.d.ts +0 -21
- package/src/get_alliances_alliance_id_ok.d.ts +0 -46
- package/src/get_alliances_ok.d.ts +0 -14
- package/src/get_characters_character_id_agents_research_ok.d.ts +0 -42
- package/src/get_characters_character_id_assets_ok.d.ts +0 -144
- package/src/get_characters_character_id_attributes_ok.d.ts +0 -51
- package/src/get_characters_character_id_blueprints_ok.d.ts +0 -133
- package/src/get_characters_character_id_bookmarks_folders_ok.d.ts +0 -27
- package/src/get_characters_character_id_bookmarks_ok.d.ts +0 -91
- package/src/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +0 -32
- package/src/get_characters_character_id_calendar_event_id_ok.d.ts +0 -66
- package/src/get_characters_character_id_calendar_ok.d.ts +0 -42
- package/src/get_characters_character_id_clones_ok.d.ts +0 -82
- package/src/get_characters_character_id_contacts_labels_ok.d.ts +0 -27
- package/src/get_characters_character_id_contacts_ok.d.ts +0 -53
- package/src/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +0 -37
- package/src/get_characters_character_id_contracts_contract_id_items_ok.d.ts +0 -48
- package/src/get_characters_character_id_contracts_ok.d.ts +0 -137
- package/src/get_characters_character_id_corporationhistory_ok.d.ts +0 -37
- package/src/get_characters_character_id_fatigue_ok.d.ts +0 -26
- package/src/get_characters_character_id_fittings_ok.d.ts +0 -108
- package/src/get_characters_character_id_fleet_ok.d.ts +0 -35
- package/src/get_characters_character_id_fw_stats_ok.d.ts +0 -75
- package/src/get_characters_character_id_implants_ok.d.ts +0 -14
- package/src/get_characters_character_id_industry_jobs_ok.d.ts +0 -133
- package/src/get_characters_character_id_killmails_recent_ok.d.ts +0 -27
- package/src/get_characters_character_id_location_ok.d.ts +0 -26
- package/src/get_characters_character_id_loyalty_points_ok.d.ts +0 -27
- package/src/get_characters_character_id_mail_labels_ok.d.ts +0 -67
- package/src/get_characters_character_id_mail_lists_ok.d.ts +0 -27
- package/src/get_characters_character_id_mail_mail_id_ok.d.ts +0 -71
- package/src/get_characters_character_id_mail_ok.d.ts +0 -77
- package/src/get_characters_character_id_medals_ok.d.ts +0 -147
- package/src/get_characters_character_id_mining_ok.d.ts +0 -37
- package/src/get_characters_character_id_notifications_contacts_ok.d.ts +0 -42
- package/src/get_characters_character_id_notifications_ok.d.ts +0 -297
- package/src/get_characters_character_id_ok.d.ts +0 -66
- package/src/get_characters_character_id_online_ok.d.ts +0 -31
- package/src/get_characters_character_id_opportunities_ok.d.ts +0 -27
- package/src/get_characters_character_id_orders_history_ok.d.ts +0 -104
- package/src/get_characters_character_id_orders_ok.d.ts +0 -99
- package/src/get_characters_character_id_planets_ok.d.ts +0 -131
- package/src/get_characters_character_id_planets_planet_id_ok.d.ts +0 -323
- package/src/get_characters_character_id_portrait_ok.d.ts +0 -31
- package/src/get_characters_character_id_roles_ok.d.ts +0 -271
- package/src/get_characters_character_id_search_ok.d.ts +0 -132
- package/src/get_characters_character_id_ship_ok.d.ts +0 -26
- package/src/get_characters_character_id_skillqueue_ok.d.ts +0 -57
- package/src/get_characters_character_id_skills_ok.d.ts +0 -54
- package/src/get_characters_character_id_standings_ok.d.ts +0 -32
- package/src/get_characters_character_id_titles_ok.d.ts +0 -187
- package/src/get_characters_character_id_wallet_journal_ok.d.ts +0 -240
- package/src/get_characters_character_id_wallet_ok.d.ts +0 -8
- package/src/get_characters_character_id_wallet_transactions_ok.d.ts +0 -67
- package/src/get_contracts_public_bids_contract_id_ok.d.ts +0 -32
- package/src/get_contracts_public_items_contract_id_ok.d.ts +0 -62
- package/src/get_contracts_public_region_id_ok.d.ts +0 -97
- package/src/get_corporation_corporation_id_mining_extractions_ok.d.ts +0 -45
- package/src/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +0 -45
- package/src/get_corporation_corporation_id_mining_observers_ok.d.ts +0 -33
- package/src/get_corporations_corporation_id_alliancehistory_ok.d.ts +0 -37
- package/src/get_corporations_corporation_id_assets_ok.d.ts +0 -180
- package/src/get_corporations_corporation_id_blueprints_ok.d.ts +0 -174
- package/src/get_corporations_corporation_id_bookmarks_folders_ok.d.ts +0 -32
- package/src/get_corporations_corporation_id_bookmarks_ok.d.ts +0 -91
- package/src/get_corporations_corporation_id_contacts_labels_ok.d.ts +0 -27
- package/src/get_corporations_corporation_id_contacts_ok.d.ts +0 -48
- package/src/get_corporations_corporation_id_containers_logs_ok.d.ts +0 -204
- package/src/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +0 -38
- package/src/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +0 -48
- package/src/get_corporations_corporation_id_contracts_ok.d.ts +0 -137
- package/src/get_corporations_corporation_id_customs_offices_ok.d.ts +0 -92
- package/src/get_corporations_corporation_id_divisions_ok.d.ts +0 -133
- package/src/get_corporations_corporation_id_facilities_ok.d.ts +0 -32
- package/src/get_corporations_corporation_id_fw_stats_ok.d.ts +0 -70
- package/src/get_corporations_corporation_id_icons_ok.d.ts +0 -26
- package/src/get_corporations_corporation_id_industry_jobs_ok.d.ts +0 -133
- package/src/get_corporations_corporation_id_killmails_recent_ok.d.ts +0 -27
- package/src/get_corporations_corporation_id_medals_issued_ok.d.ts +0 -47
- package/src/get_corporations_corporation_id_medals_ok.d.ts +0 -42
- package/src/get_corporations_corporation_id_members_limit_ok.d.ts +0 -8
- package/src/get_corporations_corporation_id_members_ok.d.ts +0 -14
- package/src/get_corporations_corporation_id_members_titles_ok.d.ts +0 -197
- package/src/get_corporations_corporation_id_membertracking_ok.d.ts +0 -52
- package/src/get_corporations_corporation_id_ok.d.ts +0 -81
- package/src/get_corporations_corporation_id_orders_history_ok.d.ts +0 -109
- package/src/get_corporations_corporation_id_orders_ok.d.ts +0 -104
- package/src/get_corporations_corporation_id_roles_history_ok.d.ts +0 -175
- package/src/get_corporations_corporation_id_roles_ok.d.ts +0 -545
- package/src/get_corporations_corporation_id_shareholders_ok.d.ts +0 -32
- package/src/get_corporations_corporation_id_standings_ok.d.ts +0 -32
- package/src/get_corporations_corporation_id_starbases_ok.d.ts +0 -62
- package/src/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +0 -369
- package/src/get_corporations_corporation_id_structures_ok.d.ts +0 -194
- package/src/get_corporations_corporation_id_titles_ok.d.ts +0 -715
- package/src/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +0 -241
- package/src/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +0 -63
- package/src/get_corporations_corporation_id_wallets_ok.d.ts +0 -65
- package/src/get_corporations_npccorps_ok.d.ts +0 -14
- package/src/get_dogma_attributes_attribute_id_ok.d.ts +0 -61
- package/src/get_dogma_attributes_ok.d.ts +0 -14
- package/src/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +0 -72
- package/src/get_dogma_effects_effect_id_ok.d.ts +0 -154
- package/src/get_dogma_effects_ok.d.ts +0 -14
- package/src/get_fleets_fleet_id_members_ok.d.ts +0 -67
- package/src/get_fleets_fleet_id_ok.d.ts +0 -31
- package/src/get_fleets_fleet_id_wings_ok.d.ts +0 -50
- package/src/get_fw_leaderboards_characters_ok.d.ts +0 -163
- package/src/get_fw_leaderboards_corporations_ok.d.ts +0 -589
- package/src/get_fw_leaderboards_ok.d.ts +0 -235
- package/src/get_fw_stats_ok.d.ts +0 -76
- package/src/get_fw_systems_ok.d.ts +0 -47
- package/src/get_fw_wars_ok.d.ts +0 -27
- package/src/get_incursions_ok.d.ts +0 -63
- package/src/get_industry_facilities_ok.d.ts +0 -47
- package/src/get_industry_systems_ok.d.ts +0 -122
- package/src/get_insurance_prices_ok.d.ts +0 -70
- package/src/get_killmails_killmail_id_killmail_hash_ok.d.ts +0 -242
- package/src/get_loyalty_stores_corporation_id_offers_ok.d.ts +0 -70
- package/src/get_markets_groups_market_group_id_ok.d.ts +0 -42
- package/src/get_markets_groups_ok.d.ts +0 -14
- package/src/get_markets_prices_ok.d.ts +0 -32
- package/src/get_markets_region_id_history_ok.d.ts +0 -47
- package/src/get_markets_region_id_orders_ok.d.ts +0 -89
- package/src/get_markets_region_id_types_ok.d.ts +0 -14
- package/src/get_markets_structures_structure_id_ok.d.ts +0 -84
- package/src/get_opportunities_groups_group_id_ok.d.ts +0 -53
- package/src/get_opportunities_groups_ok.d.ts +0 -14
- package/src/get_opportunities_tasks_ok.d.ts +0 -14
- package/src/get_opportunities_tasks_task_id_ok.d.ts +0 -31
- package/src/get_route_origin_destination_ok.d.ts +0 -14
- package/src/get_sovereignty_campaigns_ok.d.ts +0 -94
- package/src/get_sovereignty_map_ok.d.ts +0 -37
- package/src/get_sovereignty_structures_ok.d.ts +0 -58
- package/src/get_status_ok.d.ts +0 -31
- package/src/get_universe_ancestries_ok.d.ts +0 -47
- package/src/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +0 -43
- package/src/get_universe_bloodlines_ok.d.ts +0 -72
- package/src/get_universe_categories_category_id_ok.d.ts +0 -37
- package/src/get_universe_categories_ok.d.ts +0 -14
- package/src/get_universe_constellations_constellation_id_ok.d.ts +0 -59
- package/src/get_universe_constellations_ok.d.ts +0 -14
- package/src/get_universe_factions_ok.d.ts +0 -67
- package/src/get_universe_graphics_graphic_id_ok.d.ts +0 -51
- package/src/get_universe_graphics_ok.d.ts +0 -14
- package/src/get_universe_groups_group_id_ok.d.ts +0 -42
- package/src/get_universe_groups_ok.d.ts +0 -14
- package/src/get_universe_moons_moon_id_ok.d.ts +0 -48
- package/src/get_universe_planets_planet_id_ok.d.ts +0 -53
- package/src/get_universe_races_ok.d.ts +0 -57
- package/src/get_universe_regions_ok.d.ts +0 -14
- package/src/get_universe_regions_region_id_ok.d.ts +0 -37
- package/src/get_universe_schematics_schematic_id_ok.d.ts +0 -21
- package/src/get_universe_stargates_stargate_id_ok.d.ts +0 -70
- package/src/get_universe_stars_star_id_ok.d.ts +0 -140
- package/src/get_universe_stations_station_id_ok.d.ts +0 -121
- package/src/get_universe_structures_ok.d.ts +0 -14
- package/src/get_universe_structures_structure_id_ok.d.ts +0 -54
- package/src/get_universe_system_jumps_ok.d.ts +0 -27
- package/src/get_universe_system_kills_ok.d.ts +0 -37
- package/src/get_universe_systems_ok.d.ts +0 -14
- package/src/get_universe_systems_system_id_ok.d.ts +0 -125
- package/src/get_universe_types_ok.d.ts +0 -14
- package/src/get_universe_types_type_id_ok.d.ts +0 -127
- package/src/get_wars_ok.d.ts +0 -14
- package/src/get_wars_war_id_killmails_ok.d.ts +0 -27
- package/src/get_wars_war_id_ok.d.ts +0 -123
- package/src/index.d.ts +0 -404
- package/src/post_characters_affiliation_ok.d.ts +0 -37
- package/src/post_characters_character_id_assets_locations_ok.d.ts +0 -44
- package/src/post_characters_character_id_assets_names_ok.d.ts +0 -27
- package/src/post_characters_character_id_contacts_contact_ids.d.ts +0 -18
- package/src/post_characters_character_id_contacts_created.d.ts +0 -14
- package/src/post_characters_character_id_cspa_characters.d.ts +0 -18
- package/src/post_characters_character_id_cspa_created.d.ts +0 -8
- package/src/post_characters_character_id_fittings_created.d.ts +0 -16
- package/src/post_characters_character_id_fittings_fitting.d.ts +0 -101
- package/src/post_characters_character_id_mail_created.d.ts +0 -8
- package/src/post_characters_character_id_mail_labels_created.d.ts +0 -8
- package/src/post_characters_character_id_mail_labels_label.d.ts +0 -39
- package/src/post_characters_character_id_mail_mail.d.ts +0 -53
- package/src/post_corporations_corporation_id_assets_locations_ok.d.ts +0 -44
- package/src/post_corporations_corporation_id_assets_names_ok.d.ts +0 -27
- package/src/post_fleets_fleet_id_members_invitation.d.ts +0 -31
- package/src/post_fleets_fleet_id_wings_created.d.ts +0 -16
- package/src/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +0 -16
- package/src/post_ui_openwindow_newmail_new_mail.d.ts +0 -46
- package/src/post_universe_ids_ok.d.ts +0 -241
- package/src/post_universe_names_ok.d.ts +0 -41
- package/src/put_characters_character_id_calendar_event_id_response.d.ts +0 -16
- package/src/put_characters_character_id_contacts_contact_ids.d.ts +0 -18
- package/src/put_characters_character_id_mail_mail_id_contents.d.ts +0 -27
- package/src/put_fleets_fleet_id_members_member_id_movement.d.ts +0 -30
- package/src/put_fleets_fleet_id_new_settings.d.ts +0 -21
- package/src/put_fleets_fleet_id_squads_squad_id_naming.d.ts +0 -16
- package/src/put_fleets_fleet_id_wings_wing_id_naming.d.ts +0 -16
- package/v2/post_fleets_fleet_id_members_invitation.d.ts +0 -27
- package/v2/post_ui_openwindow_newmail_new_mail.d.ts +0 -40
- package/v2/put_characters_character_id_calendar_event_id_response.d.ts +0 -15
- package/v2/put_characters_character_id_contacts_contact_ids.d.ts +0 -16
- package/v2/put_characters_character_id_mail_mail_id_contents.d.ts +0 -20
- package/v2/put_fleets_fleet_id_members_member_id_movement.d.ts +0 -27
- package/v2/put_fleets_fleet_id_new_settings.d.ts +0 -18
- package/v2/put_fleets_fleet_id_squads_squad_id_naming.d.ts +0 -14
- package/v2/put_fleets_fleet_id_wings_wing_id_naming.d.ts +0 -14
package/v2.d.mts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
3
|
+
Copyright (C) 2025 jeffy-g <hirotom1107@gmail.com>
|
|
4
|
+
Released under the MIT license
|
|
5
|
+
https://opensource.org/licenses/mit-license.php
|
|
6
|
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
7
|
+
*/
|
|
8
|
+
import type { TESIResponseOKMap } from "./v2";
|
|
9
|
+
import { type ESIRequestOptions } from "./rq-util.mjs";
|
|
10
|
+
/**
|
|
11
|
+
* fire ESI request
|
|
12
|
+
* @template {TESIEntryMethod} M
|
|
13
|
+
* @template {keyof TESIResponseOKMap[M]} EP
|
|
14
|
+
* @template {IsParameterizedPath<EP, number | number[], Opt>} P2
|
|
15
|
+
* @template {IdentifyParameters<TESIResponseOKMap[M][EP], ESIRequestOptions>} Opt
|
|
16
|
+
* @template {InferESIResponseResult<M, EP>} R
|
|
17
|
+
*
|
|
18
|
+
* @param {M} mthd
|
|
19
|
+
* @param {EP} endp - The endpoint to request.
|
|
20
|
+
* @param {Opt} [opt] - default is empty object {}. `body` is json string
|
|
21
|
+
* @param {P2} [pathParams] - Optional path parameters.
|
|
22
|
+
* @returns {Promise<R>} - The response from the endpoint.
|
|
23
|
+
* @throws
|
|
24
|
+
* @async
|
|
25
|
+
*/
|
|
26
|
+
export declare function fire<
|
|
27
|
+
M extends TESIEntryMethod,
|
|
28
|
+
EP extends keyof TESIResponseOKMap[M],
|
|
29
|
+
Opt extends IdentifyParameters<TESIResponseOKMap[M][EP], ESIRequestOptions>,
|
|
30
|
+
P2 extends IsParameterizedPath<EP, number | number[], Opt>,
|
|
31
|
+
R extends InferESIResponseResult<M, EP>
|
|
32
|
+
>(mthd: M, endp: EP, pathParams?: P2, opt?: Opt): Promise<R>;
|
package/v2.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// import type { TESIResponseOKMap } from "eve-esi-types";
|
|
2
|
+
import { curl, replaceCbt, fetchP, ESIRequesError, ESIErrorLimitReachedError } from "./rq-util.mjs";
|
|
2
3
|
// - - - - - - - - - - - - - - - - - - - -
|
|
3
4
|
// constants, types
|
|
4
5
|
// - - - - - - - - - - - - - - - - - - - -
|
|
@@ -9,19 +10,16 @@ const isArray = Array.isArray;
|
|
|
9
10
|
* enable/disable console.log
|
|
10
11
|
*/
|
|
11
12
|
let LOG = false;
|
|
12
|
-
/**
|
|
13
|
-
* this always `https://esi.evetech.net`
|
|
14
|
-
*/
|
|
15
|
-
const BASE = "https://esi.evetech.net";
|
|
16
13
|
/**
|
|
17
14
|
* @typedef {import("./v2").TESIResponseOKMap} TESIResponseOKMap
|
|
18
15
|
*/
|
|
19
16
|
/**
|
|
17
|
+
* @typedef {`${string}.${string}.${string}`} TAcccessToken __{Header}.{Payload}.{Signature}__
|
|
20
18
|
* @typedef ESIRequestOptions
|
|
21
19
|
* @prop {Record<string, any>} [query] query params for ESI request.
|
|
22
20
|
* @prop {any} [body] will need it for `POST` request etc.
|
|
23
21
|
* @prop {true=} [auth] Can be an empty object if no authentication is required.description
|
|
24
|
-
* @prop {
|
|
22
|
+
* @prop {TAcccessToken} [token] Can be an empty object if no authentication is required.description
|
|
25
23
|
* @prop {boolean} [ignoreError] if want response data with ignore error then can be set to `true`.
|
|
26
24
|
* @prop {AbortController} [cancelable] cancel request immediately
|
|
27
25
|
*/
|
|
@@ -32,88 +30,7 @@ const BASE = "https://esi.evetech.net";
|
|
|
32
30
|
* Get the number of currently executing ESI requests
|
|
33
31
|
*/
|
|
34
32
|
let ax = 0;
|
|
35
|
-
|
|
36
|
-
* simple named error class.
|
|
37
|
-
*/
|
|
38
|
-
class ESIRequesError extends Error {
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* throws when x-esi-error-limit-remain header value is "0". (http status: 420)
|
|
42
|
-
*/
|
|
43
|
-
class ESIErrorLimitReachedError extends Error {
|
|
44
|
-
constructor() {
|
|
45
|
-
super("Cannot continue ESI request because 'x-esi-error-limit-remain' is zero!");
|
|
46
|
-
}
|
|
47
|
-
valueOf() {
|
|
48
|
-
return 420;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* fetch the extra pages
|
|
53
|
-
*
|
|
54
|
-
* + if the `x-pages` header property ware more than 1
|
|
55
|
-
*
|
|
56
|
-
* @param {string} endpointUrl
|
|
57
|
-
* @param {RequestInit} rqopt request options
|
|
58
|
-
* @param {Record<string, any>} qs queries
|
|
59
|
-
* @param {number} pc pageCount
|
|
60
|
-
*/
|
|
61
|
-
const fetchP = async (endpointUrl, rqopt, qs, pc) => {
|
|
62
|
-
const rqs = [];
|
|
63
|
-
const rqp = new URLSearchParams(qs);
|
|
64
|
-
for (let i = 2; i <= pc;) {
|
|
65
|
-
rqp.set("page", (i++) + "");
|
|
66
|
-
ax++;
|
|
67
|
-
rqs.push(fetch(`${endpointUrl}?${rqp + ""}`, rqopt).then(res => res.json()).catch(reason => {
|
|
68
|
-
console.warn(reason);
|
|
69
|
-
return [];
|
|
70
|
-
}).finally(() => {
|
|
71
|
-
ax--;
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
return Promise.all(rqs).then(jsons => {
|
|
75
|
-
// DEVNOTE: let check the page 2, type is array?
|
|
76
|
-
if (isArray(jsons[0])) {
|
|
77
|
-
let combined = [];
|
|
78
|
-
for (let i = 0, end = jsons.length; i < end;) {
|
|
79
|
-
combined = combined.concat(jsons[i++]);
|
|
80
|
-
}
|
|
81
|
-
return combined;
|
|
82
|
-
}
|
|
83
|
-
LOG && log("> > > pages result are object < < < --", jsons);
|
|
84
|
-
return null;
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
/** ### replace (C)urly (B)races (T)oken
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* "/characters/{character_id}/skills"
|
|
91
|
-
* // ->
|
|
92
|
-
* "/characters/<char.character_id>/skills"
|
|
93
|
-
*
|
|
94
|
-
* @param {string} endpoint e.g - "/characters/{character_id}/"
|
|
95
|
-
* @param {number[]} ids
|
|
96
|
-
* @returns fragment of qualified endpoint uri or null.
|
|
97
|
-
*/
|
|
98
|
-
const replaceCbt = (endpoint, ids) => {
|
|
99
|
-
const re = /{([\w]+)}/g;
|
|
100
|
-
/** @type {RegExpExecArray?} */
|
|
101
|
-
let m;
|
|
102
|
-
let idx = 0;
|
|
103
|
-
while (m = re.exec(endpoint)) {
|
|
104
|
-
endpoint = endpoint.replace(m[0], ids[idx++] + "");
|
|
105
|
-
}
|
|
106
|
-
return endpoint;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
*
|
|
110
|
-
* @param {string} endp this means endpoint url fragment like `/characters/{character_id}/` or `/characters/{character_id}/agents_research/`
|
|
111
|
-
* + The version parameter can be omitted by using `<version>/<endpoint>`
|
|
112
|
-
*/
|
|
113
|
-
const curl = (endp) => {
|
|
114
|
-
endp = endp.replace(/^\/+|\/+$/g, "");
|
|
115
|
-
return `${BASE}/latest/${endp}/`;
|
|
116
|
-
};
|
|
33
|
+
const incrementAx = (minus) => minus ? ax-- : ax++;
|
|
117
34
|
// - - - - - - - - - - - - - - - - - - - -
|
|
118
35
|
// main functions
|
|
119
36
|
// - - - - - - - - - - - - - - - - - - - -
|
|
@@ -141,6 +58,8 @@ async function getEVEStatus() {
|
|
|
141
58
|
order_type: "all"
|
|
142
59
|
},
|
|
143
60
|
});
|
|
61
|
+
// TODO: want TypeScript semantics to throw an error because there is a required query parameter, but it's not possible
|
|
62
|
+
await fire("get", "/characters/{character_id}/search/");
|
|
144
63
|
console.log(ok);
|
|
145
64
|
}
|
|
146
65
|
catch (error) {
|
|
@@ -158,8 +77,8 @@ async function getEVEStatus() {
|
|
|
158
77
|
*
|
|
159
78
|
* @param {M} mthd
|
|
160
79
|
* @param {EP} endp - The endpoint to request.
|
|
161
|
-
* @param {P2} [pathParams] - Optional path parameters.
|
|
162
80
|
* @param {Opt} [opt] - default is empty object {}. `body` is json string
|
|
81
|
+
* @param {P2} [pathParams] - Optional path parameters.
|
|
163
82
|
* @returns {Promise<R>} - The response from the endpoint.
|
|
164
83
|
* @throws
|
|
165
84
|
* @async
|
|
@@ -167,7 +86,7 @@ async function getEVEStatus() {
|
|
|
167
86
|
export async function fire(mthd, endp, pathParams, opt) {
|
|
168
87
|
if (typeof pathParams === "number") {
|
|
169
88
|
// @ts-ignore
|
|
170
|
-
pathParams = [pathParams];
|
|
89
|
+
pathParams = [pathParams]; // as unknown as P2;
|
|
171
90
|
}
|
|
172
91
|
if (isArray(pathParams)) {
|
|
173
92
|
// @ts-ignore actualy endp is string
|
|
@@ -216,9 +135,7 @@ export async function fire(mthd, endp, pathParams, opt) {
|
|
|
216
135
|
ax++;
|
|
217
136
|
try {
|
|
218
137
|
// @ts-ignore A silly type error will appear, but ignore it.
|
|
219
|
-
const res = await fetch(`${endpointUrl}?${new URLSearchParams(qss) + ""}`, rqopt).finally(() =>
|
|
220
|
-
ax--;
|
|
221
|
-
});
|
|
138
|
+
const res = await fetch(`${endpointUrl}?${new URLSearchParams(qss) + ""}`, rqopt).finally(() => ax--);
|
|
222
139
|
const stat = res.status;
|
|
223
140
|
if (!res.ok && !actualOpt.ignoreError) {
|
|
224
141
|
if (stat === 420) {
|
|
@@ -249,7 +166,7 @@ export async function fire(mthd, endp, pathParams, opt) {
|
|
|
249
166
|
// has remaining pages? NaN > 1 === false !isNaN(pageCount)
|
|
250
167
|
if (pc > 1) {
|
|
251
168
|
LOG && log('found "x-pages" header, pages: %d', pc);
|
|
252
|
-
const remData = await fetchP(endpointUrl, rqopt, qss, pc);
|
|
169
|
+
const remData = await fetchP(endpointUrl, rqopt, qss, pc, incrementAx);
|
|
253
170
|
// finally, decide product data.
|
|
254
171
|
if (isArray(data) && isArray(remData)) {
|
|
255
172
|
// DEVNOTE: 2019/7/23 15:01:48 - types
|
package/esi-request.mjs
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
// import type { TESIResponseOKMap } from "eve-esi-types";
|
|
2
|
-
// - - - - - - - - - - - - - - - - - - - -
|
|
3
|
-
// constants, types
|
|
4
|
-
// - - - - - - - - - - - - - - - - - - - -
|
|
5
|
-
// shorthands
|
|
6
|
-
const log = console.log;
|
|
7
|
-
const isArray = Array.isArray;
|
|
8
|
-
/**
|
|
9
|
-
* enable/disable console.log
|
|
10
|
-
*/
|
|
11
|
-
let LOG = false;
|
|
12
|
-
/**
|
|
13
|
-
* this always `https://esi.evetech.net`
|
|
14
|
-
*/
|
|
15
|
-
const BASE = "https://esi.evetech.net";
|
|
16
|
-
/**
|
|
17
|
-
* @typedef {import("./src").TESIResponseOKMap} TESIResponseOKMap
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* @typedef ESIRequestOptions
|
|
21
|
-
* @prop {Record<string, any>} [queries] query params for ESI request.
|
|
22
|
-
* @prop {any} [body] will need it for `POST` request etc.
|
|
23
|
-
* @prop {boolean} [ignoreError] if want response data with ignore error then can be set to `true`.
|
|
24
|
-
* @prop {AbortController} [cancelable] cancel request immediately
|
|
25
|
-
* @prop {string} [token] Can be an empty object if no authentication is required.description
|
|
26
|
-
*/
|
|
27
|
-
// - - - - - - - - - - - - - - - - - - - -
|
|
28
|
-
// module vars, functions
|
|
29
|
-
// - - - - - - - - - - - - - - - - - - - -
|
|
30
|
-
/**
|
|
31
|
-
* Get the number of currently executing ESI requests
|
|
32
|
-
*/
|
|
33
|
-
let ax = 0;
|
|
34
|
-
/**
|
|
35
|
-
* simple named error class.
|
|
36
|
-
*/
|
|
37
|
-
class ESIRequesError extends Error {
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* throws when x-esi-error-limit-remain header value is "0". (http status: 420)
|
|
41
|
-
*/
|
|
42
|
-
class ESIErrorLimitReachedError extends Error {
|
|
43
|
-
constructor() {
|
|
44
|
-
super("Cannot continue ESI request because 'x-esi-error-limit-remain' is zero!");
|
|
45
|
-
}
|
|
46
|
-
valueOf() {
|
|
47
|
-
return 420;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* fetch the extra pages
|
|
52
|
-
*
|
|
53
|
-
* + if the `x-pages` header property ware more than 1
|
|
54
|
-
*
|
|
55
|
-
* @param {string} endpointUrl
|
|
56
|
-
* @param {RequestInit} rqopt request options
|
|
57
|
-
* @param {Record<string, any>} qs queries
|
|
58
|
-
* @param {number} pc pageCount
|
|
59
|
-
*/
|
|
60
|
-
const fetchP = async (endpointUrl, rqopt, qs, pc) => {
|
|
61
|
-
const rqs = [];
|
|
62
|
-
const rqp = new URLSearchParams(qs);
|
|
63
|
-
for (let i = 2; i <= pc;) {
|
|
64
|
-
rqp.set("page", (i++) + "");
|
|
65
|
-
ax++;
|
|
66
|
-
rqs.push(fetch(`${endpointUrl}?${rqp + ""}`, rqopt).then(res => res.json()).catch(reason => {
|
|
67
|
-
console.warn(reason);
|
|
68
|
-
return [];
|
|
69
|
-
}).finally(() => {
|
|
70
|
-
ax--;
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
return Promise.all(rqs).then(jsons => {
|
|
74
|
-
// DEVNOTE: let check the page 2, type is array?
|
|
75
|
-
if (isArray(jsons[0])) {
|
|
76
|
-
let combined = [];
|
|
77
|
-
for (let i = 0, end = jsons.length; i < end;) {
|
|
78
|
-
combined = combined.concat(jsons[i++]);
|
|
79
|
-
}
|
|
80
|
-
return combined;
|
|
81
|
-
}
|
|
82
|
-
LOG && log("> > > pages result are object < < < --", jsons);
|
|
83
|
-
return null;
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
/** ### replace (C)urly (B)races (T)oken
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* "/characters/{character_id}/skills"
|
|
90
|
-
* // ->
|
|
91
|
-
* "/characters/<char.character_id>/skills"
|
|
92
|
-
*
|
|
93
|
-
* @param {string} endpoint e.g - "/characters/{character_id}/"
|
|
94
|
-
* @param {number[]} ids
|
|
95
|
-
* @returns fragment of qualified endpoint uri or null.
|
|
96
|
-
*/
|
|
97
|
-
const replaceCbt = (endpoint, ids) => {
|
|
98
|
-
const re = /{([\w]+)}/g;
|
|
99
|
-
/** @type {RegExpExecArray?} */
|
|
100
|
-
let m;
|
|
101
|
-
let idx = 0;
|
|
102
|
-
while (m = re.exec(endpoint)) {
|
|
103
|
-
endpoint = endpoint.replace(m[0], ids[idx++] + "");
|
|
104
|
-
}
|
|
105
|
-
return endpoint;
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
* @param {string} endp this means endpoint url fragment like `/characters/{character_id}/` or `/characters/{character_id}/agents_research/`
|
|
110
|
-
* + The version parameter can be omitted by using `<version>/<endpoint>`
|
|
111
|
-
*/
|
|
112
|
-
const curl = (endp) => {
|
|
113
|
-
endp = endp.replace(/^\/+|\/+$/g, "");
|
|
114
|
-
return `${BASE}/latest/${endp}/`;
|
|
115
|
-
};
|
|
116
|
-
// - - - - - - - - - - - - - - - - - - - -
|
|
117
|
-
// main functions
|
|
118
|
-
// - - - - - - - - - - - - - - - - - - - -
|
|
119
|
-
/**
|
|
120
|
-
* fire ESI request
|
|
121
|
-
* @template {"get" | "post" | "put" | "delete"} M
|
|
122
|
-
* @template {keyof TESIResponseOKMap[M]} EP
|
|
123
|
-
* @template {TESIResponseOKMap[M][EP]} R
|
|
124
|
-
*
|
|
125
|
-
* @param {M} mthd
|
|
126
|
-
* @param {EP} endp - The endpoint to request.
|
|
127
|
-
* @param {number | number[] | ESIRequestOptions} [pathParams] - Optional path parameters.
|
|
128
|
-
* @param {ESIRequestOptions} [opt] - default is empty object {}. `body` is json string
|
|
129
|
-
* @returns {Promise<R>} - The response from the endpoint.
|
|
130
|
-
* @throws
|
|
131
|
-
* @async
|
|
132
|
-
*/
|
|
133
|
-
export async function fire(mthd, endp, pathParams, opt = {}) {
|
|
134
|
-
if (typeof pathParams === "number") {
|
|
135
|
-
pathParams = /** @type {number[]} */ ([pathParams]);
|
|
136
|
-
}
|
|
137
|
-
if (isArray(pathParams)) {
|
|
138
|
-
// @ts-ignore actualy endp is string
|
|
139
|
-
endp = replaceCbt(endp, pathParams);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
// When only options are provided
|
|
143
|
-
opt = /** @type {ESIRequestOptions} */ (pathParams) || opt;
|
|
144
|
-
}
|
|
145
|
-
/** @type {RequestInit} */
|
|
146
|
-
const rqopt = {
|
|
147
|
-
method: mthd,
|
|
148
|
-
mode: "cors",
|
|
149
|
-
cache: "no-cache",
|
|
150
|
-
signal: opt.cancelable?.signal,
|
|
151
|
-
headers: {}
|
|
152
|
-
};
|
|
153
|
-
const qss = {
|
|
154
|
-
// language: "en",
|
|
155
|
-
};
|
|
156
|
-
if (opt.queries) {
|
|
157
|
-
// Object.assign(queries, options.queries); Object.assign is too slow
|
|
158
|
-
const oqs = opt.queries;
|
|
159
|
-
for (const k of Object.keys(oqs)) {
|
|
160
|
-
qss[k] = oqs[k];
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
// DEVNOTE: when datasource is not empty string. (e.g - "singularity"
|
|
164
|
-
// in this case must specify datasource.
|
|
165
|
-
// disabled since `REMOVING DATASOURCE SINGULARITY`
|
|
166
|
-
// if (opt.datasource === "singularity") {
|
|
167
|
-
// opt.datasource = "tranquility";
|
|
168
|
-
// }
|
|
169
|
-
if (opt.token) {
|
|
170
|
-
// @ts-ignore The header is indeed an object
|
|
171
|
-
rqopt.headers.authorization = `Bearer ${opt.token}`;
|
|
172
|
-
}
|
|
173
|
-
if (opt.body) { // means "POST" method etc
|
|
174
|
-
// @ts-ignore The header is indeed an object
|
|
175
|
-
rqopt.headers["content-type"] = "application/json";
|
|
176
|
-
rqopt.body = JSON.stringify(opt.body);
|
|
177
|
-
}
|
|
178
|
-
// @ts-ignore actualy endp is string
|
|
179
|
-
const endpointUrl = curl(endp);
|
|
180
|
-
ax++;
|
|
181
|
-
try {
|
|
182
|
-
// @ts-ignore A silly type error will appear, but ignore it.
|
|
183
|
-
const res = await fetch(`${endpointUrl}?${new URLSearchParams(qss) + ""}`, rqopt).finally(() => {
|
|
184
|
-
ax--;
|
|
185
|
-
});
|
|
186
|
-
const stat = res.status;
|
|
187
|
-
if (!res.ok && !opt.ignoreError) {
|
|
188
|
-
if (stat === 420) {
|
|
189
|
-
opt.cancelable && opt.cancelable.abort();
|
|
190
|
-
throw new ESIErrorLimitReachedError();
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
// @ts-ignore actualy endp is string
|
|
194
|
-
throw new ESIRequesError(`maybe network disconneted or otherwise request data are invalid. (endpoint=${endp}, http status=${stat})`);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
// DEVNOTE: - 204 No Content
|
|
199
|
-
if (stat === 204) {
|
|
200
|
-
// this result is empty, decided to return status code.
|
|
201
|
-
return /** @type {R} */ ({ status: stat });
|
|
202
|
-
}
|
|
203
|
-
/** @type {R} */
|
|
204
|
-
const data = await res.json();
|
|
205
|
-
if (opt.ignoreError) {
|
|
206
|
-
// meaning `forceJson`?
|
|
207
|
-
return data;
|
|
208
|
-
}
|
|
209
|
-
// - - - - x-pages response.
|
|
210
|
-
// +undefined is NaN
|
|
211
|
-
// @ts-ignore becouse +null is 0
|
|
212
|
-
const pc = +res.headers.get("x-pages");
|
|
213
|
-
// has remaining pages? NaN > 1 === false !isNaN(pageCount)
|
|
214
|
-
if (pc > 1) {
|
|
215
|
-
LOG && log('found "x-pages" header, pages: %d', pc);
|
|
216
|
-
const remData = await fetchP(endpointUrl, rqopt, qss, pc);
|
|
217
|
-
// finally, decide product data.
|
|
218
|
-
if (isArray(data) && isArray(remData)) {
|
|
219
|
-
// DEVNOTE: 2019/7/23 15:01:48 - types
|
|
220
|
-
return /** @type {R} */ (data.concat(remData));
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
// @ts-ignore TODO: fix type
|
|
224
|
-
remData && Object.assign(data, remData);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return data;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
catch (e) {
|
|
231
|
-
// @ts-ignore actualy endp is string
|
|
232
|
-
throw new ESIRequesError(`unknown error occurred, message: ${e.message}, endpoint=${endp}`);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
// It should complete correctly.
|
|
236
|
-
async function getEVEStatus() {
|
|
237
|
-
return fire("get", "/status/");
|
|
238
|
-
}
|
|
239
|
-
// type following and run
|
|
240
|
-
// node esi-request.mjs
|
|
241
|
-
// or yarn test
|
|
242
|
-
getEVEStatus().then(eveStatus => console.log(eveStatus));
|
|
243
|
-
// {
|
|
244
|
-
// "players": 16503,
|
|
245
|
-
// "server_version": "2794925",
|
|
246
|
-
// "start_time": "2025-01-21T11:02:34Z"
|
|
247
|
-
// }
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ESI endpoint: /alliances/{alliance_id}/contacts/labels/
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* label_id integer
|
|
7
|
-
*/
|
|
8
|
-
type GetAlliancesAllianceIdContactsLabelsLabelId = number;
|
|
9
|
-
/**
|
|
10
|
-
* label_name string
|
|
11
|
-
*/
|
|
12
|
-
type GetAlliancesAllianceIdContactsLabelsLabelName = string;
|
|
13
|
-
/**
|
|
14
|
-
* 200 ok array
|
|
15
|
-
*
|
|
16
|
-
* @maxItems 64
|
|
17
|
-
*/
|
|
18
|
-
type GetAlliancesAllianceIdContactsLabelsOk = GetAlliancesAllianceIdContactsLabels_200Ok[];
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 200 ok object
|
|
22
|
-
*/
|
|
23
|
-
interface GetAlliancesAllianceIdContactsLabels_200Ok {
|
|
24
|
-
label_id: GetAlliancesAllianceIdContactsLabelsLabelId;
|
|
25
|
-
label_name: GetAlliancesAllianceIdContactsLabelsLabelName;
|
|
26
|
-
[k: string]: unknown | undefined;
|
|
27
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ESI endpoint: /alliances/{alliance_id}/contacts/
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* contact_id integer
|
|
7
|
-
*/
|
|
8
|
-
type GetAlliancesAllianceIdContactsContactId = number;
|
|
9
|
-
/**
|
|
10
|
-
* contact_type string
|
|
11
|
-
*/
|
|
12
|
-
type GetAlliancesAllianceIdContactsContactType = "character" | "corporation" | "alliance" | "faction";
|
|
13
|
-
/**
|
|
14
|
-
* Label IDs applied to the contact
|
|
15
|
-
*/
|
|
16
|
-
type GetAlliancesAllianceIdContactsLabelId = number;
|
|
17
|
-
/**
|
|
18
|
-
* label_ids array
|
|
19
|
-
*
|
|
20
|
-
* @maxItems 63
|
|
21
|
-
*/
|
|
22
|
-
type GetAlliancesAllianceIdContactsLabelIds = GetAlliancesAllianceIdContactsLabelId[];
|
|
23
|
-
/**
|
|
24
|
-
* Standing of the contact
|
|
25
|
-
*/
|
|
26
|
-
type GetAlliancesAllianceIdContactsStanding = number;
|
|
27
|
-
/**
|
|
28
|
-
* 200 ok array
|
|
29
|
-
*
|
|
30
|
-
* @maxItems 1000
|
|
31
|
-
*/
|
|
32
|
-
type GetAlliancesAllianceIdContactsOk = GetAlliancesAllianceIdContacts_200Ok[];
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 200 ok object
|
|
36
|
-
*/
|
|
37
|
-
interface GetAlliancesAllianceIdContacts_200Ok {
|
|
38
|
-
contact_id: GetAlliancesAllianceIdContactsContactId;
|
|
39
|
-
contact_type: GetAlliancesAllianceIdContactsContactType;
|
|
40
|
-
label_ids?: GetAlliancesAllianceIdContactsLabelIds;
|
|
41
|
-
standing: GetAlliancesAllianceIdContactsStanding;
|
|
42
|
-
[k: string]: unknown | undefined;
|
|
43
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ESI endpoint: /alliances/{alliance_id}/corporations/
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 200 ok integer
|
|
7
|
-
*/
|
|
8
|
-
type GetAlliancesAllianceIdCorporations_200Ok = number;
|
|
9
|
-
/**
|
|
10
|
-
* 200 ok array
|
|
11
|
-
*
|
|
12
|
-
* @maxItems 1000
|
|
13
|
-
*/
|
|
14
|
-
type GetAlliancesAllianceIdCorporationsOk = GetAlliancesAllianceIdCorporations_200Ok[];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ESI endpoint: /alliances/{alliance_id}/icons/
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* px128x128 string
|
|
7
|
-
*/
|
|
8
|
-
type GetAlliancesAllianceIdIconsPx128X128 = string;
|
|
9
|
-
/**
|
|
10
|
-
* px64x64 string
|
|
11
|
-
*/
|
|
12
|
-
type GetAlliancesAllianceIdIconsPx64X64 = string;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 200 ok object
|
|
16
|
-
*/
|
|
17
|
-
interface GetAlliancesAllianceIdIconsOk {
|
|
18
|
-
px128x128?: GetAlliancesAllianceIdIconsPx128X128;
|
|
19
|
-
px64x64?: GetAlliancesAllianceIdIconsPx64X64;
|
|
20
|
-
[k: string]: unknown | undefined;
|
|
21
|
-
}
|