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.
Files changed (403) hide show
  1. package/README.md +28 -2
  2. package/esi-types-util.md +108 -0
  3. package/package.json +9 -9
  4. package/rq-util.d.mts +84 -0
  5. package/rq-util.mjs +107 -0
  6. package/tsconfig.json +1 -0
  7. package/v2/extra-types.d.ts +28 -1091
  8. package/v2/get_alliances_alliance_id_contacts_labels_ok.d.ts +1 -1
  9. package/v2/get_alliances_alliance_id_contacts_ok.d.ts +1 -1
  10. package/v2/get_alliances_alliance_id_corporations_ok.d.ts +1 -1
  11. package/v2/get_alliances_alliance_id_icons_ok.d.ts +1 -1
  12. package/v2/get_alliances_alliance_id_ok.d.ts +1 -1
  13. package/v2/get_alliances_ok.d.ts +1 -1
  14. package/v2/get_characters_character_id_agents_research_ok.d.ts +1 -1
  15. package/v2/get_characters_character_id_assets_ok.d.ts +1 -1
  16. package/v2/get_characters_character_id_attributes_ok.d.ts +1 -1
  17. package/v2/get_characters_character_id_blueprints_ok.d.ts +1 -1
  18. package/v2/get_characters_character_id_bookmarks_folders_ok.d.ts +1 -1
  19. package/v2/get_characters_character_id_bookmarks_ok.d.ts +1 -1
  20. package/v2/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +1 -1
  21. package/v2/get_characters_character_id_calendar_event_id_ok.d.ts +1 -1
  22. package/v2/get_characters_character_id_calendar_ok.d.ts +1 -1
  23. package/v2/get_characters_character_id_clones_ok.d.ts +1 -1
  24. package/v2/get_characters_character_id_contacts_labels_ok.d.ts +1 -1
  25. package/v2/get_characters_character_id_contacts_ok.d.ts +1 -1
  26. package/v2/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +1 -1
  27. package/v2/get_characters_character_id_contracts_contract_id_items_ok.d.ts +1 -1
  28. package/v2/get_characters_character_id_contracts_ok.d.ts +1 -1
  29. package/v2/get_characters_character_id_corporationhistory_ok.d.ts +1 -1
  30. package/v2/get_characters_character_id_fatigue_ok.d.ts +1 -1
  31. package/v2/get_characters_character_id_fittings_ok.d.ts +1 -1
  32. package/v2/get_characters_character_id_fleet_ok.d.ts +1 -1
  33. package/v2/get_characters_character_id_fw_stats_ok.d.ts +1 -1
  34. package/v2/get_characters_character_id_implants_ok.d.ts +1 -1
  35. package/v2/get_characters_character_id_industry_jobs_ok.d.ts +1 -1
  36. package/v2/get_characters_character_id_killmails_recent_ok.d.ts +1 -1
  37. package/v2/get_characters_character_id_location_ok.d.ts +1 -1
  38. package/v2/get_characters_character_id_loyalty_points_ok.d.ts +1 -1
  39. package/v2/get_characters_character_id_mail_labels_ok.d.ts +1 -1
  40. package/v2/get_characters_character_id_mail_lists_ok.d.ts +1 -1
  41. package/v2/get_characters_character_id_mail_mail_id_ok.d.ts +1 -1
  42. package/v2/get_characters_character_id_mail_ok.d.ts +1 -1
  43. package/v2/get_characters_character_id_medals_ok.d.ts +1 -1
  44. package/v2/get_characters_character_id_mining_ok.d.ts +1 -1
  45. package/v2/get_characters_character_id_notifications_contacts_ok.d.ts +1 -1
  46. package/v2/get_characters_character_id_notifications_ok.d.ts +1 -1
  47. package/v2/get_characters_character_id_ok.d.ts +1 -1
  48. package/v2/get_characters_character_id_online_ok.d.ts +1 -1
  49. package/v2/get_characters_character_id_opportunities_ok.d.ts +1 -1
  50. package/v2/get_characters_character_id_orders_history_ok.d.ts +1 -1
  51. package/v2/get_characters_character_id_orders_ok.d.ts +1 -1
  52. package/v2/get_characters_character_id_planets_ok.d.ts +1 -1
  53. package/v2/get_characters_character_id_planets_planet_id_ok.d.ts +1 -1
  54. package/v2/get_characters_character_id_portrait_ok.d.ts +1 -1
  55. package/v2/get_characters_character_id_roles_ok.d.ts +1 -1
  56. package/v2/get_characters_character_id_search_ok.d.ts +1 -1
  57. package/v2/get_characters_character_id_ship_ok.d.ts +1 -1
  58. package/v2/get_characters_character_id_skillqueue_ok.d.ts +1 -1
  59. package/v2/get_characters_character_id_skills_ok.d.ts +1 -1
  60. package/v2/get_characters_character_id_standings_ok.d.ts +1 -1
  61. package/v2/get_characters_character_id_titles_ok.d.ts +1 -1
  62. package/v2/get_characters_character_id_wallet_journal_ok.d.ts +1 -1
  63. package/v2/get_characters_character_id_wallet_ok.d.ts +1 -1
  64. package/v2/get_characters_character_id_wallet_transactions_ok.d.ts +1 -1
  65. package/v2/get_contracts_public_bids_contract_id_ok.d.ts +1 -1
  66. package/v2/get_contracts_public_items_contract_id_ok.d.ts +1 -1
  67. package/v2/get_contracts_public_region_id_ok.d.ts +1 -1
  68. package/v2/get_corporation_corporation_id_mining_extractions_ok.d.ts +1 -1
  69. package/v2/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +1 -1
  70. package/v2/get_corporation_corporation_id_mining_observers_ok.d.ts +1 -1
  71. package/v2/get_corporations_corporation_id_alliancehistory_ok.d.ts +1 -1
  72. package/v2/get_corporations_corporation_id_assets_ok.d.ts +1 -1
  73. package/v2/get_corporations_corporation_id_blueprints_ok.d.ts +1 -1
  74. package/v2/get_corporations_corporation_id_bookmarks_folders_ok.d.ts +1 -1
  75. package/v2/get_corporations_corporation_id_bookmarks_ok.d.ts +1 -1
  76. package/v2/get_corporations_corporation_id_contacts_labels_ok.d.ts +1 -1
  77. package/v2/get_corporations_corporation_id_contacts_ok.d.ts +1 -1
  78. package/v2/get_corporations_corporation_id_containers_logs_ok.d.ts +1 -1
  79. package/v2/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +1 -1
  80. package/v2/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +1 -1
  81. package/v2/get_corporations_corporation_id_contracts_ok.d.ts +1 -1
  82. package/v2/get_corporations_corporation_id_customs_offices_ok.d.ts +1 -1
  83. package/v2/get_corporations_corporation_id_divisions_ok.d.ts +1 -1
  84. package/v2/get_corporations_corporation_id_facilities_ok.d.ts +1 -1
  85. package/v2/get_corporations_corporation_id_fw_stats_ok.d.ts +1 -1
  86. package/v2/get_corporations_corporation_id_icons_ok.d.ts +1 -1
  87. package/v2/get_corporations_corporation_id_industry_jobs_ok.d.ts +1 -1
  88. package/v2/get_corporations_corporation_id_killmails_recent_ok.d.ts +1 -1
  89. package/v2/get_corporations_corporation_id_medals_issued_ok.d.ts +1 -1
  90. package/v2/get_corporations_corporation_id_medals_ok.d.ts +1 -1
  91. package/v2/get_corporations_corporation_id_members_limit_ok.d.ts +1 -1
  92. package/v2/get_corporations_corporation_id_members_ok.d.ts +1 -1
  93. package/v2/get_corporations_corporation_id_members_titles_ok.d.ts +1 -1
  94. package/v2/get_corporations_corporation_id_membertracking_ok.d.ts +1 -1
  95. package/v2/get_corporations_corporation_id_ok.d.ts +1 -1
  96. package/v2/get_corporations_corporation_id_orders_history_ok.d.ts +1 -1
  97. package/v2/get_corporations_corporation_id_orders_ok.d.ts +1 -1
  98. package/v2/get_corporations_corporation_id_roles_history_ok.d.ts +1 -1
  99. package/v2/get_corporations_corporation_id_roles_ok.d.ts +1 -1
  100. package/v2/get_corporations_corporation_id_shareholders_ok.d.ts +1 -1
  101. package/v2/get_corporations_corporation_id_standings_ok.d.ts +1 -1
  102. package/v2/get_corporations_corporation_id_starbases_ok.d.ts +1 -1
  103. package/v2/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +1 -1
  104. package/v2/get_corporations_corporation_id_structures_ok.d.ts +1 -1
  105. package/v2/get_corporations_corporation_id_titles_ok.d.ts +1 -1
  106. package/v2/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +1 -1
  107. package/v2/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +1 -1
  108. package/v2/get_corporations_corporation_id_wallets_ok.d.ts +1 -1
  109. package/v2/get_corporations_npccorps_ok.d.ts +1 -1
  110. package/v2/get_dogma_attributes_attribute_id_ok.d.ts +1 -1
  111. package/v2/get_dogma_attributes_ok.d.ts +1 -1
  112. package/v2/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +1 -1
  113. package/v2/get_dogma_effects_effect_id_ok.d.ts +1 -1
  114. package/v2/get_dogma_effects_ok.d.ts +1 -1
  115. package/v2/get_fleets_fleet_id_members_ok.d.ts +1 -1
  116. package/v2/get_fleets_fleet_id_ok.d.ts +1 -1
  117. package/v2/get_fleets_fleet_id_wings_ok.d.ts +1 -1
  118. package/v2/get_fw_leaderboards_characters_ok.d.ts +1 -1
  119. package/v2/get_fw_leaderboards_corporations_ok.d.ts +1 -1
  120. package/v2/get_fw_leaderboards_ok.d.ts +1 -1
  121. package/v2/get_fw_stats_ok.d.ts +1 -1
  122. package/v2/get_fw_systems_ok.d.ts +1 -1
  123. package/v2/get_fw_wars_ok.d.ts +1 -1
  124. package/v2/get_incursions_ok.d.ts +1 -1
  125. package/v2/get_industry_facilities_ok.d.ts +1 -1
  126. package/v2/get_industry_systems_ok.d.ts +1 -1
  127. package/v2/get_insurance_prices_ok.d.ts +1 -1
  128. package/v2/get_killmails_killmail_id_killmail_hash_ok.d.ts +1 -1
  129. package/v2/get_loyalty_stores_corporation_id_offers_ok.d.ts +1 -1
  130. package/v2/get_markets_groups_market_group_id_ok.d.ts +1 -1
  131. package/v2/get_markets_groups_ok.d.ts +1 -1
  132. package/v2/get_markets_prices_ok.d.ts +1 -1
  133. package/v2/get_markets_region_id_history_ok.d.ts +1 -1
  134. package/v2/get_markets_region_id_orders_ok.d.ts +1 -1
  135. package/v2/get_markets_region_id_types_ok.d.ts +1 -1
  136. package/v2/get_markets_structures_structure_id_ok.d.ts +1 -1
  137. package/v2/get_opportunities_groups_group_id_ok.d.ts +1 -1
  138. package/v2/get_opportunities_groups_ok.d.ts +1 -1
  139. package/v2/get_opportunities_tasks_ok.d.ts +1 -1
  140. package/v2/get_opportunities_tasks_task_id_ok.d.ts +1 -1
  141. package/v2/get_route_origin_destination_ok.d.ts +1 -1
  142. package/v2/get_sovereignty_campaigns_ok.d.ts +1 -1
  143. package/v2/get_sovereignty_map_ok.d.ts +1 -1
  144. package/v2/get_sovereignty_structures_ok.d.ts +1 -1
  145. package/v2/get_status_ok.d.ts +1 -1
  146. package/v2/get_universe_ancestries_ok.d.ts +1 -1
  147. package/v2/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +1 -1
  148. package/v2/get_universe_bloodlines_ok.d.ts +1 -1
  149. package/v2/get_universe_categories_category_id_ok.d.ts +1 -1
  150. package/v2/get_universe_categories_ok.d.ts +1 -1
  151. package/v2/get_universe_constellations_constellation_id_ok.d.ts +1 -1
  152. package/v2/get_universe_constellations_ok.d.ts +1 -1
  153. package/v2/get_universe_factions_ok.d.ts +1 -1
  154. package/v2/get_universe_graphics_graphic_id_ok.d.ts +1 -1
  155. package/v2/get_universe_graphics_ok.d.ts +1 -1
  156. package/v2/get_universe_groups_group_id_ok.d.ts +1 -1
  157. package/v2/get_universe_groups_ok.d.ts +1 -1
  158. package/v2/get_universe_moons_moon_id_ok.d.ts +1 -1
  159. package/v2/get_universe_planets_planet_id_ok.d.ts +1 -1
  160. package/v2/get_universe_races_ok.d.ts +1 -1
  161. package/v2/get_universe_regions_ok.d.ts +1 -1
  162. package/v2/get_universe_regions_region_id_ok.d.ts +1 -1
  163. package/v2/get_universe_schematics_schematic_id_ok.d.ts +1 -1
  164. package/v2/get_universe_stargates_stargate_id_ok.d.ts +1 -1
  165. package/v2/get_universe_stars_star_id_ok.d.ts +1 -1
  166. package/v2/get_universe_stations_station_id_ok.d.ts +1 -1
  167. package/v2/get_universe_structures_ok.d.ts +1 -1
  168. package/v2/get_universe_structures_structure_id_ok.d.ts +1 -1
  169. package/v2/get_universe_system_jumps_ok.d.ts +1 -1
  170. package/v2/get_universe_system_kills_ok.d.ts +1 -1
  171. package/v2/get_universe_systems_ok.d.ts +1 -1
  172. package/v2/get_universe_systems_system_id_ok.d.ts +1 -1
  173. package/v2/get_universe_types_ok.d.ts +1 -1
  174. package/v2/get_universe_types_type_id_ok.d.ts +1 -1
  175. package/v2/get_wars_ok.d.ts +1 -1
  176. package/v2/get_wars_war_id_killmails_ok.d.ts +1 -1
  177. package/v2/get_wars_war_id_ok.d.ts +1 -1
  178. package/v2/index.d.ts +171 -40
  179. package/v2/post_characters_affiliation_ok.d.ts +1 -1
  180. package/v2/post_characters_character_id_assets_locations_ok.d.ts +1 -1
  181. package/v2/post_characters_character_id_assets_names_ok.d.ts +1 -1
  182. package/v2/post_characters_character_id_contacts_created.d.ts +1 -1
  183. package/v2/post_characters_character_id_cspa_created.d.ts +1 -1
  184. package/v2/post_characters_character_id_fittings_created.d.ts +1 -1
  185. package/v2/post_characters_character_id_mail_created.d.ts +1 -1
  186. package/v2/post_characters_character_id_mail_labels_created.d.ts +1 -1
  187. package/v2/post_corporations_corporation_id_assets_locations_ok.d.ts +1 -1
  188. package/v2/post_corporations_corporation_id_assets_names_ok.d.ts +1 -1
  189. package/v2/post_fleets_fleet_id_wings_created.d.ts +1 -1
  190. package/v2/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +1 -1
  191. package/v2/post_universe_ids_ok.d.ts +1 -1
  192. package/v2/post_universe_names_ok.d.ts +1 -1
  193. package/v2.d.mts +32 -0
  194. package/v2.mjs +10 -93
  195. package/esi-request.mjs +0 -247
  196. package/src/get_alliances_alliance_id_contacts_labels_ok.d.ts +0 -27
  197. package/src/get_alliances_alliance_id_contacts_ok.d.ts +0 -43
  198. package/src/get_alliances_alliance_id_corporations_ok.d.ts +0 -14
  199. package/src/get_alliances_alliance_id_icons_ok.d.ts +0 -21
  200. package/src/get_alliances_alliance_id_ok.d.ts +0 -46
  201. package/src/get_alliances_ok.d.ts +0 -14
  202. package/src/get_characters_character_id_agents_research_ok.d.ts +0 -42
  203. package/src/get_characters_character_id_assets_ok.d.ts +0 -144
  204. package/src/get_characters_character_id_attributes_ok.d.ts +0 -51
  205. package/src/get_characters_character_id_blueprints_ok.d.ts +0 -133
  206. package/src/get_characters_character_id_bookmarks_folders_ok.d.ts +0 -27
  207. package/src/get_characters_character_id_bookmarks_ok.d.ts +0 -91
  208. package/src/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +0 -32
  209. package/src/get_characters_character_id_calendar_event_id_ok.d.ts +0 -66
  210. package/src/get_characters_character_id_calendar_ok.d.ts +0 -42
  211. package/src/get_characters_character_id_clones_ok.d.ts +0 -82
  212. package/src/get_characters_character_id_contacts_labels_ok.d.ts +0 -27
  213. package/src/get_characters_character_id_contacts_ok.d.ts +0 -53
  214. package/src/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +0 -37
  215. package/src/get_characters_character_id_contracts_contract_id_items_ok.d.ts +0 -48
  216. package/src/get_characters_character_id_contracts_ok.d.ts +0 -137
  217. package/src/get_characters_character_id_corporationhistory_ok.d.ts +0 -37
  218. package/src/get_characters_character_id_fatigue_ok.d.ts +0 -26
  219. package/src/get_characters_character_id_fittings_ok.d.ts +0 -108
  220. package/src/get_characters_character_id_fleet_ok.d.ts +0 -35
  221. package/src/get_characters_character_id_fw_stats_ok.d.ts +0 -75
  222. package/src/get_characters_character_id_implants_ok.d.ts +0 -14
  223. package/src/get_characters_character_id_industry_jobs_ok.d.ts +0 -133
  224. package/src/get_characters_character_id_killmails_recent_ok.d.ts +0 -27
  225. package/src/get_characters_character_id_location_ok.d.ts +0 -26
  226. package/src/get_characters_character_id_loyalty_points_ok.d.ts +0 -27
  227. package/src/get_characters_character_id_mail_labels_ok.d.ts +0 -67
  228. package/src/get_characters_character_id_mail_lists_ok.d.ts +0 -27
  229. package/src/get_characters_character_id_mail_mail_id_ok.d.ts +0 -71
  230. package/src/get_characters_character_id_mail_ok.d.ts +0 -77
  231. package/src/get_characters_character_id_medals_ok.d.ts +0 -147
  232. package/src/get_characters_character_id_mining_ok.d.ts +0 -37
  233. package/src/get_characters_character_id_notifications_contacts_ok.d.ts +0 -42
  234. package/src/get_characters_character_id_notifications_ok.d.ts +0 -297
  235. package/src/get_characters_character_id_ok.d.ts +0 -66
  236. package/src/get_characters_character_id_online_ok.d.ts +0 -31
  237. package/src/get_characters_character_id_opportunities_ok.d.ts +0 -27
  238. package/src/get_characters_character_id_orders_history_ok.d.ts +0 -104
  239. package/src/get_characters_character_id_orders_ok.d.ts +0 -99
  240. package/src/get_characters_character_id_planets_ok.d.ts +0 -131
  241. package/src/get_characters_character_id_planets_planet_id_ok.d.ts +0 -323
  242. package/src/get_characters_character_id_portrait_ok.d.ts +0 -31
  243. package/src/get_characters_character_id_roles_ok.d.ts +0 -271
  244. package/src/get_characters_character_id_search_ok.d.ts +0 -132
  245. package/src/get_characters_character_id_ship_ok.d.ts +0 -26
  246. package/src/get_characters_character_id_skillqueue_ok.d.ts +0 -57
  247. package/src/get_characters_character_id_skills_ok.d.ts +0 -54
  248. package/src/get_characters_character_id_standings_ok.d.ts +0 -32
  249. package/src/get_characters_character_id_titles_ok.d.ts +0 -187
  250. package/src/get_characters_character_id_wallet_journal_ok.d.ts +0 -240
  251. package/src/get_characters_character_id_wallet_ok.d.ts +0 -8
  252. package/src/get_characters_character_id_wallet_transactions_ok.d.ts +0 -67
  253. package/src/get_contracts_public_bids_contract_id_ok.d.ts +0 -32
  254. package/src/get_contracts_public_items_contract_id_ok.d.ts +0 -62
  255. package/src/get_contracts_public_region_id_ok.d.ts +0 -97
  256. package/src/get_corporation_corporation_id_mining_extractions_ok.d.ts +0 -45
  257. package/src/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +0 -45
  258. package/src/get_corporation_corporation_id_mining_observers_ok.d.ts +0 -33
  259. package/src/get_corporations_corporation_id_alliancehistory_ok.d.ts +0 -37
  260. package/src/get_corporations_corporation_id_assets_ok.d.ts +0 -180
  261. package/src/get_corporations_corporation_id_blueprints_ok.d.ts +0 -174
  262. package/src/get_corporations_corporation_id_bookmarks_folders_ok.d.ts +0 -32
  263. package/src/get_corporations_corporation_id_bookmarks_ok.d.ts +0 -91
  264. package/src/get_corporations_corporation_id_contacts_labels_ok.d.ts +0 -27
  265. package/src/get_corporations_corporation_id_contacts_ok.d.ts +0 -48
  266. package/src/get_corporations_corporation_id_containers_logs_ok.d.ts +0 -204
  267. package/src/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +0 -38
  268. package/src/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +0 -48
  269. package/src/get_corporations_corporation_id_contracts_ok.d.ts +0 -137
  270. package/src/get_corporations_corporation_id_customs_offices_ok.d.ts +0 -92
  271. package/src/get_corporations_corporation_id_divisions_ok.d.ts +0 -133
  272. package/src/get_corporations_corporation_id_facilities_ok.d.ts +0 -32
  273. package/src/get_corporations_corporation_id_fw_stats_ok.d.ts +0 -70
  274. package/src/get_corporations_corporation_id_icons_ok.d.ts +0 -26
  275. package/src/get_corporations_corporation_id_industry_jobs_ok.d.ts +0 -133
  276. package/src/get_corporations_corporation_id_killmails_recent_ok.d.ts +0 -27
  277. package/src/get_corporations_corporation_id_medals_issued_ok.d.ts +0 -47
  278. package/src/get_corporations_corporation_id_medals_ok.d.ts +0 -42
  279. package/src/get_corporations_corporation_id_members_limit_ok.d.ts +0 -8
  280. package/src/get_corporations_corporation_id_members_ok.d.ts +0 -14
  281. package/src/get_corporations_corporation_id_members_titles_ok.d.ts +0 -197
  282. package/src/get_corporations_corporation_id_membertracking_ok.d.ts +0 -52
  283. package/src/get_corporations_corporation_id_ok.d.ts +0 -81
  284. package/src/get_corporations_corporation_id_orders_history_ok.d.ts +0 -109
  285. package/src/get_corporations_corporation_id_orders_ok.d.ts +0 -104
  286. package/src/get_corporations_corporation_id_roles_history_ok.d.ts +0 -175
  287. package/src/get_corporations_corporation_id_roles_ok.d.ts +0 -545
  288. package/src/get_corporations_corporation_id_shareholders_ok.d.ts +0 -32
  289. package/src/get_corporations_corporation_id_standings_ok.d.ts +0 -32
  290. package/src/get_corporations_corporation_id_starbases_ok.d.ts +0 -62
  291. package/src/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +0 -369
  292. package/src/get_corporations_corporation_id_structures_ok.d.ts +0 -194
  293. package/src/get_corporations_corporation_id_titles_ok.d.ts +0 -715
  294. package/src/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +0 -241
  295. package/src/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +0 -63
  296. package/src/get_corporations_corporation_id_wallets_ok.d.ts +0 -65
  297. package/src/get_corporations_npccorps_ok.d.ts +0 -14
  298. package/src/get_dogma_attributes_attribute_id_ok.d.ts +0 -61
  299. package/src/get_dogma_attributes_ok.d.ts +0 -14
  300. package/src/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +0 -72
  301. package/src/get_dogma_effects_effect_id_ok.d.ts +0 -154
  302. package/src/get_dogma_effects_ok.d.ts +0 -14
  303. package/src/get_fleets_fleet_id_members_ok.d.ts +0 -67
  304. package/src/get_fleets_fleet_id_ok.d.ts +0 -31
  305. package/src/get_fleets_fleet_id_wings_ok.d.ts +0 -50
  306. package/src/get_fw_leaderboards_characters_ok.d.ts +0 -163
  307. package/src/get_fw_leaderboards_corporations_ok.d.ts +0 -589
  308. package/src/get_fw_leaderboards_ok.d.ts +0 -235
  309. package/src/get_fw_stats_ok.d.ts +0 -76
  310. package/src/get_fw_systems_ok.d.ts +0 -47
  311. package/src/get_fw_wars_ok.d.ts +0 -27
  312. package/src/get_incursions_ok.d.ts +0 -63
  313. package/src/get_industry_facilities_ok.d.ts +0 -47
  314. package/src/get_industry_systems_ok.d.ts +0 -122
  315. package/src/get_insurance_prices_ok.d.ts +0 -70
  316. package/src/get_killmails_killmail_id_killmail_hash_ok.d.ts +0 -242
  317. package/src/get_loyalty_stores_corporation_id_offers_ok.d.ts +0 -70
  318. package/src/get_markets_groups_market_group_id_ok.d.ts +0 -42
  319. package/src/get_markets_groups_ok.d.ts +0 -14
  320. package/src/get_markets_prices_ok.d.ts +0 -32
  321. package/src/get_markets_region_id_history_ok.d.ts +0 -47
  322. package/src/get_markets_region_id_orders_ok.d.ts +0 -89
  323. package/src/get_markets_region_id_types_ok.d.ts +0 -14
  324. package/src/get_markets_structures_structure_id_ok.d.ts +0 -84
  325. package/src/get_opportunities_groups_group_id_ok.d.ts +0 -53
  326. package/src/get_opportunities_groups_ok.d.ts +0 -14
  327. package/src/get_opportunities_tasks_ok.d.ts +0 -14
  328. package/src/get_opportunities_tasks_task_id_ok.d.ts +0 -31
  329. package/src/get_route_origin_destination_ok.d.ts +0 -14
  330. package/src/get_sovereignty_campaigns_ok.d.ts +0 -94
  331. package/src/get_sovereignty_map_ok.d.ts +0 -37
  332. package/src/get_sovereignty_structures_ok.d.ts +0 -58
  333. package/src/get_status_ok.d.ts +0 -31
  334. package/src/get_universe_ancestries_ok.d.ts +0 -47
  335. package/src/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +0 -43
  336. package/src/get_universe_bloodlines_ok.d.ts +0 -72
  337. package/src/get_universe_categories_category_id_ok.d.ts +0 -37
  338. package/src/get_universe_categories_ok.d.ts +0 -14
  339. package/src/get_universe_constellations_constellation_id_ok.d.ts +0 -59
  340. package/src/get_universe_constellations_ok.d.ts +0 -14
  341. package/src/get_universe_factions_ok.d.ts +0 -67
  342. package/src/get_universe_graphics_graphic_id_ok.d.ts +0 -51
  343. package/src/get_universe_graphics_ok.d.ts +0 -14
  344. package/src/get_universe_groups_group_id_ok.d.ts +0 -42
  345. package/src/get_universe_groups_ok.d.ts +0 -14
  346. package/src/get_universe_moons_moon_id_ok.d.ts +0 -48
  347. package/src/get_universe_planets_planet_id_ok.d.ts +0 -53
  348. package/src/get_universe_races_ok.d.ts +0 -57
  349. package/src/get_universe_regions_ok.d.ts +0 -14
  350. package/src/get_universe_regions_region_id_ok.d.ts +0 -37
  351. package/src/get_universe_schematics_schematic_id_ok.d.ts +0 -21
  352. package/src/get_universe_stargates_stargate_id_ok.d.ts +0 -70
  353. package/src/get_universe_stars_star_id_ok.d.ts +0 -140
  354. package/src/get_universe_stations_station_id_ok.d.ts +0 -121
  355. package/src/get_universe_structures_ok.d.ts +0 -14
  356. package/src/get_universe_structures_structure_id_ok.d.ts +0 -54
  357. package/src/get_universe_system_jumps_ok.d.ts +0 -27
  358. package/src/get_universe_system_kills_ok.d.ts +0 -37
  359. package/src/get_universe_systems_ok.d.ts +0 -14
  360. package/src/get_universe_systems_system_id_ok.d.ts +0 -125
  361. package/src/get_universe_types_ok.d.ts +0 -14
  362. package/src/get_universe_types_type_id_ok.d.ts +0 -127
  363. package/src/get_wars_ok.d.ts +0 -14
  364. package/src/get_wars_war_id_killmails_ok.d.ts +0 -27
  365. package/src/get_wars_war_id_ok.d.ts +0 -123
  366. package/src/index.d.ts +0 -404
  367. package/src/post_characters_affiliation_ok.d.ts +0 -37
  368. package/src/post_characters_character_id_assets_locations_ok.d.ts +0 -44
  369. package/src/post_characters_character_id_assets_names_ok.d.ts +0 -27
  370. package/src/post_characters_character_id_contacts_contact_ids.d.ts +0 -18
  371. package/src/post_characters_character_id_contacts_created.d.ts +0 -14
  372. package/src/post_characters_character_id_cspa_characters.d.ts +0 -18
  373. package/src/post_characters_character_id_cspa_created.d.ts +0 -8
  374. package/src/post_characters_character_id_fittings_created.d.ts +0 -16
  375. package/src/post_characters_character_id_fittings_fitting.d.ts +0 -101
  376. package/src/post_characters_character_id_mail_created.d.ts +0 -8
  377. package/src/post_characters_character_id_mail_labels_created.d.ts +0 -8
  378. package/src/post_characters_character_id_mail_labels_label.d.ts +0 -39
  379. package/src/post_characters_character_id_mail_mail.d.ts +0 -53
  380. package/src/post_corporations_corporation_id_assets_locations_ok.d.ts +0 -44
  381. package/src/post_corporations_corporation_id_assets_names_ok.d.ts +0 -27
  382. package/src/post_fleets_fleet_id_members_invitation.d.ts +0 -31
  383. package/src/post_fleets_fleet_id_wings_created.d.ts +0 -16
  384. package/src/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +0 -16
  385. package/src/post_ui_openwindow_newmail_new_mail.d.ts +0 -46
  386. package/src/post_universe_ids_ok.d.ts +0 -241
  387. package/src/post_universe_names_ok.d.ts +0 -41
  388. package/src/put_characters_character_id_calendar_event_id_response.d.ts +0 -16
  389. package/src/put_characters_character_id_contacts_contact_ids.d.ts +0 -18
  390. package/src/put_characters_character_id_mail_mail_id_contents.d.ts +0 -27
  391. package/src/put_fleets_fleet_id_members_member_id_movement.d.ts +0 -30
  392. package/src/put_fleets_fleet_id_new_settings.d.ts +0 -21
  393. package/src/put_fleets_fleet_id_squads_squad_id_naming.d.ts +0 -16
  394. package/src/put_fleets_fleet_id_wings_wing_id_naming.d.ts +0 -16
  395. package/v2/post_fleets_fleet_id_members_invitation.d.ts +0 -27
  396. package/v2/post_ui_openwindow_newmail_new_mail.d.ts +0 -40
  397. package/v2/put_characters_character_id_calendar_event_id_response.d.ts +0 -15
  398. package/v2/put_characters_character_id_contacts_contact_ids.d.ts +0 -16
  399. package/v2/put_characters_character_id_mail_mail_id_contents.d.ts +0 -20
  400. package/v2/put_fleets_fleet_id_members_member_id_movement.d.ts +0 -27
  401. package/v2/put_fleets_fleet_id_new_settings.d.ts +0 -18
  402. package/v2/put_fleets_fleet_id_squads_squad_id_naming.d.ts +0 -14
  403. package/v2/put_fleets_fleet_id_wings_wing_id_naming.d.ts +0 -14
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/affiliation/
2
+ * ESI endpoint: post:/characters/affiliation/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/assets/locations/
2
+ * ESI endpoint: post:/characters/{character_id}/assets/locations/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/assets/names/
2
+ * ESI endpoint: post:/characters/{character_id}/assets/names/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/contacts/
2
+ * ESI endpoint: post:/characters/{character_id}/contacts/
3
3
  */
4
4
  /**
5
5
  * 201 created array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/cspa/
2
+ * ESI endpoint: post:/characters/{character_id}/cspa/
3
3
  */
4
4
  /**
5
5
  * 201 created number
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/fittings/
2
+ * ESI endpoint: post:/characters/{character_id}/fittings/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mail/
2
+ * ESI endpoint: post:/characters/{character_id}/mail/
3
3
  */
4
4
  /**
5
5
  * Mail ID
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mail/labels/
2
+ * ESI endpoint: post:/characters/{character_id}/mail/labels/
3
3
  */
4
4
  /**
5
5
  * Label ID
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /corporations/{corporation_id}/assets/locations/
2
+ * ESI endpoint: post:/corporations/{corporation_id}/assets/locations/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /corporations/{corporation_id}/assets/names/
2
+ * ESI endpoint: post:/corporations/{corporation_id}/assets/names/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /fleets/{fleet_id}/wings/
2
+ * ESI endpoint: post:/fleets/{fleet_id}/wings/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /fleets/{fleet_id}/wings/{wing_id}/squads/
2
+ * ESI endpoint: post:/fleets/{fleet_id}/wings/{wing_id}/squads/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /universe/ids/
2
+ * ESI endpoint: post:/universe/ids/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /universe/names/
2
+ * ESI endpoint: post:/universe/names/
3
3
  */
4
4
  /**
5
5
  * category string
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 {string} [token] Can be an empty object if no authentication is required.description
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
- }