eve-esi-types 3.1.7 → 3.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 (214) hide show
  1. package/CHANGELOG.md +182 -0
  2. package/jsconfig.json +28 -0
  3. package/lib/rq-util.mjs +1 -1
  4. package/lib/tagged-request-api.mjs +5 -6
  5. package/package.json +14 -7
  6. package/v2/esi-tagged-types.d.ts +9 -5
  7. package/v2/{get_alliances_alliance_id_ok.d.ts → globals/alliance.d.ts} +44 -0
  8. package/v2/globals/assets.d.ts +443 -0
  9. package/v2/globals/calendar.d.ts +130 -0
  10. package/v2/globals/character.d.ts +1084 -0
  11. package/v2/{get_characters_character_id_clones_ok.d.ts → globals/clones.d.ts} +15 -0
  12. package/v2/globals/contacts.d.ts +212 -0
  13. package/v2/globals/contracts.d.ts +546 -0
  14. package/v2/globals/corporation.d.ts +2329 -0
  15. package/v2/globals/dogma.d.ts +262 -0
  16. package/v2/globals/factionwarfare.d.ts +668 -0
  17. package/v2/{get_characters_character_id_fittings_ok.d.ts → globals/fittings.d.ts} +23 -0
  18. package/v2/globals/fleets.d.ts +201 -0
  19. package/v2/{get_incursions_ok.d.ts → globals/incursions.d.ts} +5 -0
  20. package/v2/globals/industry.d.ts +445 -0
  21. package/v2/globals/insurance.d.ts +47 -0
  22. package/v2/{get_killmails_killmail_id_killmail_hash_ok.d.ts → globals/killmails.d.ts} +55 -0
  23. package/v2/globals/location.d.ts +74 -0
  24. package/v2/{get_loyalty_stores_corporation_id_offers_ok.d.ts → globals/loyalty.d.ts} +30 -0
  25. package/v2/globals/mail.d.ts +237 -0
  26. package/v2/globals/market.d.ts +615 -0
  27. package/v2/globals/planetaryinteraction.d.ts +344 -0
  28. package/v2/globals/routes.d.ts +14 -0
  29. package/v2/{get_characters_character_id_search_ok.d.ts → globals/search.d.ts} +5 -0
  30. package/v2/globals/skills.d.ts +144 -0
  31. package/v2/globals/sovereignty.d.ts +168 -0
  32. package/v2/{get_status_ok.d.ts → globals/status.d.ts} +5 -0
  33. package/v2/globals/universe.d.ts +1297 -0
  34. package/v2/globals/wallet.d.ts +601 -0
  35. package/v2/{get_wars_war_id_ok.d.ts → globals/wars.d.ts} +40 -0
  36. package/v2/index.d.ts +27 -152
  37. package/v2/response-map.d.ts +1 -24
  38. package/v2/types-index.d.ts +31 -182
  39. package/v2/types-util.d.ts +335 -0
  40. package/v2/util.d.ts +4 -2
  41. package/web/index.html +1 -1
  42. package/tsconfig.json +0 -28
  43. package/v2/get_alliances_alliance_id_contacts_labels_ok.d.ts +0 -24
  44. package/v2/get_alliances_alliance_id_contacts_ok.d.ts +0 -35
  45. package/v2/get_alliances_alliance_id_corporations_ok.d.ts +0 -9
  46. package/v2/get_alliances_alliance_id_icons_ok.d.ts +0 -18
  47. package/v2/get_alliances_ok.d.ts +0 -9
  48. package/v2/get_characters_character_id_agents_research_ok.d.ts +0 -33
  49. package/v2/get_characters_character_id_assets_ok.d.ts +0 -134
  50. package/v2/get_characters_character_id_attributes_ok.d.ts +0 -42
  51. package/v2/get_characters_character_id_blueprints_ok.d.ts +0 -122
  52. package/v2/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +0 -30
  53. package/v2/get_characters_character_id_calendar_event_id_ok.d.ts +0 -56
  54. package/v2/get_characters_character_id_calendar_ok.d.ts +0 -37
  55. package/v2/get_characters_character_id_contacts_labels_ok.d.ts +0 -24
  56. package/v2/get_characters_character_id_contacts_ok.d.ts +0 -43
  57. package/v2/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +0 -32
  58. package/v2/get_characters_character_id_contracts_contract_id_items_ok.d.ts +0 -38
  59. package/v2/get_characters_character_id_contracts_ok.d.ts +0 -117
  60. package/v2/get_characters_character_id_corporationhistory_ok.d.ts +0 -32
  61. package/v2/get_characters_character_id_fatigue_ok.d.ts +0 -22
  62. package/v2/get_characters_character_id_fleet_ok.d.ts +0 -31
  63. package/v2/get_characters_character_id_fw_stats_ok.d.ts +0 -64
  64. package/v2/get_characters_character_id_implants_ok.d.ts +0 -9
  65. package/v2/get_characters_character_id_industry_jobs_ok.d.ts +0 -105
  66. package/v2/get_characters_character_id_killmails_recent_ok.d.ts +0 -24
  67. package/v2/get_characters_character_id_location_ok.d.ts +0 -22
  68. package/v2/get_characters_character_id_loyalty_points_ok.d.ts +0 -24
  69. package/v2/get_characters_character_id_mail_labels_ok.d.ts +0 -62
  70. package/v2/get_characters_character_id_mail_lists_ok.d.ts +0 -24
  71. package/v2/get_characters_character_id_mail_mail_id_ok.d.ts +0 -59
  72. package/v2/get_characters_character_id_mail_ok.d.ts +0 -65
  73. package/v2/get_characters_character_id_medals_ok.d.ts +0 -135
  74. package/v2/get_characters_character_id_mining_ok.d.ts +0 -29
  75. package/v2/get_characters_character_id_notifications_contacts_ok.d.ts +0 -36
  76. package/v2/get_characters_character_id_notifications_ok.d.ts +0 -291
  77. package/v2/get_characters_character_id_ok.d.ts +0 -55
  78. package/v2/get_characters_character_id_online_ok.d.ts +0 -26
  79. package/v2/get_characters_character_id_opportunities_ok.d.ts +0 -24
  80. package/v2/get_characters_character_id_orders_history_ok.d.ts +0 -87
  81. package/v2/get_characters_character_id_orders_ok.d.ts +0 -82
  82. package/v2/get_characters_character_id_planets_ok.d.ts +0 -124
  83. package/v2/get_characters_character_id_planets_planet_id_ok.d.ts +0 -283
  84. package/v2/get_characters_character_id_portrait_ok.d.ts +0 -26
  85. package/v2/get_characters_character_id_roles_ok.d.ts +0 -270
  86. package/v2/get_characters_character_id_ship_ok.d.ts +0 -19
  87. package/v2/get_characters_character_id_skillqueue_ok.d.ts +0 -48
  88. package/v2/get_characters_character_id_skills_ok.d.ts +0 -47
  89. package/v2/get_characters_character_id_standings_ok.d.ts +0 -29
  90. package/v2/get_characters_character_id_titles_ok.d.ts +0 -184
  91. package/v2/get_characters_character_id_wallet_journal_ok.d.ts +0 -228
  92. package/v2/get_characters_character_id_wallet_ok.d.ts +0 -7
  93. package/v2/get_characters_character_id_wallet_transactions_ok.d.ts +0 -53
  94. package/v2/get_contracts_public_bids_contract_id_ok.d.ts +0 -28
  95. package/v2/get_contracts_public_items_contract_id_ok.d.ts +0 -49
  96. package/v2/get_contracts_public_region_id_ok.d.ts +0 -81
  97. package/v2/get_corporation_corporation_id_mining_extractions_ok.d.ts +0 -39
  98. package/v2/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +0 -36
  99. package/v2/get_corporation_corporation_id_mining_observers_ok.d.ts +0 -30
  100. package/v2/get_corporations_corporation_id_alliancehistory_ok.d.ts +0 -32
  101. package/v2/get_corporations_corporation_id_assets_ok.d.ts +0 -170
  102. package/v2/get_corporations_corporation_id_blueprints_ok.d.ts +0 -163
  103. package/v2/get_corporations_corporation_id_contacts_labels_ok.d.ts +0 -24
  104. package/v2/get_corporations_corporation_id_contacts_ok.d.ts +0 -39
  105. package/v2/get_corporations_corporation_id_containers_logs_ok.d.ts +0 -188
  106. package/v2/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +0 -33
  107. package/v2/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +0 -38
  108. package/v2/get_corporations_corporation_id_contracts_ok.d.ts +0 -117
  109. package/v2/get_corporations_corporation_id_customs_offices_ok.d.ts +0 -78
  110. package/v2/get_corporations_corporation_id_divisions_ok.d.ts +0 -128
  111. package/v2/get_corporations_corporation_id_facilities_ok.d.ts +0 -25
  112. package/v2/get_corporations_corporation_id_fw_stats_ok.d.ts +0 -60
  113. package/v2/get_corporations_corporation_id_icons_ok.d.ts +0 -22
  114. package/v2/get_corporations_corporation_id_industry_jobs_ok.d.ts +0 -105
  115. package/v2/get_corporations_corporation_id_killmails_recent_ok.d.ts +0 -24
  116. package/v2/get_corporations_corporation_id_medals_issued_ok.d.ts +0 -41
  117. package/v2/get_corporations_corporation_id_medals_ok.d.ts +0 -36
  118. package/v2/get_corporations_corporation_id_members_limit_ok.d.ts +0 -7
  119. package/v2/get_corporations_corporation_id_members_ok.d.ts +0 -9
  120. package/v2/get_corporations_corporation_id_members_titles_ok.d.ts +0 -194
  121. package/v2/get_corporations_corporation_id_membertracking_ok.d.ts +0 -41
  122. package/v2/get_corporations_corporation_id_ok.d.ts +0 -66
  123. package/v2/get_corporations_corporation_id_orders_history_ok.d.ts +0 -91
  124. package/v2/get_corporations_corporation_id_orders_ok.d.ts +0 -86
  125. package/v2/get_corporations_corporation_id_roles_history_ok.d.ts +0 -171
  126. package/v2/get_corporations_corporation_id_roles_ok.d.ts +0 -543
  127. package/v2/get_corporations_corporation_id_shareholders_ok.d.ts +0 -29
  128. package/v2/get_corporations_corporation_id_standings_ok.d.ts +0 -29
  129. package/v2/get_corporations_corporation_id_starbases_ok.d.ts +0 -51
  130. package/v2/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +0 -110
  131. package/v2/get_corporations_corporation_id_structures_ok.d.ts +0 -176
  132. package/v2/get_corporations_corporation_id_titles_ok.d.ts +0 -548
  133. package/v2/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +0 -229
  134. package/v2/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +0 -50
  135. package/v2/get_corporations_corporation_id_wallets_ok.d.ts +0 -62
  136. package/v2/get_corporations_npccorps_ok.d.ts +0 -9
  137. package/v2/get_dogma_attributes_attribute_id_ok.d.ts +0 -50
  138. package/v2/get_dogma_attributes_ok.d.ts +0 -9
  139. package/v2/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +0 -58
  140. package/v2/get_dogma_effects_effect_id_ok.d.ts +0 -127
  141. package/v2/get_dogma_effects_ok.d.ts +0 -9
  142. package/v2/get_fleets_fleet_id_members_ok.d.ts +0 -54
  143. package/v2/get_fleets_fleet_id_ok.d.ts +0 -26
  144. package/v2/get_fleets_fleet_id_wings_ok.d.ts +0 -45
  145. package/v2/get_fw_leaderboards_characters_ok.d.ts +0 -110
  146. package/v2/get_fw_leaderboards_corporations_ok.d.ts +0 -109
  147. package/v2/get_fw_leaderboards_ok.d.ts +0 -182
  148. package/v2/get_fw_stats_ok.d.ts +0 -66
  149. package/v2/get_fw_systems_ok.d.ts +0 -41
  150. package/v2/get_fw_wars_ok.d.ts +0 -24
  151. package/v2/get_industry_facilities_ok.d.ts +0 -37
  152. package/v2/get_industry_systems_ok.d.ts +0 -119
  153. package/v2/get_insurance_prices_ok.d.ts +0 -62
  154. package/v2/get_markets_groups_market_group_id_ok.d.ts +0 -27
  155. package/v2/get_markets_groups_ok.d.ts +0 -9
  156. package/v2/get_markets_prices_ok.d.ts +0 -25
  157. package/v2/get_markets_region_id_history_ok.d.ts +0 -40
  158. package/v2/get_markets_region_id_orders_ok.d.ts +0 -74
  159. package/v2/get_markets_region_id_types_ok.d.ts +0 -9
  160. package/v2/get_markets_structures_structure_id_ok.d.ts +0 -70
  161. package/v2/get_opportunities_groups_group_id_ok.d.ts +0 -38
  162. package/v2/get_opportunities_groups_ok.d.ts +0 -9
  163. package/v2/get_opportunities_tasks_ok.d.ts +0 -9
  164. package/v2/get_opportunities_tasks_task_id_ok.d.ts +0 -26
  165. package/v2/get_route_origin_destination_ok.d.ts +0 -9
  166. package/v2/get_sovereignty_campaigns_ok.d.ts +0 -83
  167. package/v2/get_sovereignty_map_ok.d.ts +0 -32
  168. package/v2/get_sovereignty_structures_ok.d.ts +0 -46
  169. package/v2/get_universe_ancestries_ok.d.ts +0 -40
  170. package/v2/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +0 -37
  171. package/v2/get_universe_bloodlines_ok.d.ts +0 -57
  172. package/v2/get_universe_categories_category_id_ok.d.ts +0 -28
  173. package/v2/get_universe_categories_ok.d.ts +0 -9
  174. package/v2/get_universe_constellations_constellation_id_ok.d.ts +0 -47
  175. package/v2/get_universe_constellations_ok.d.ts +0 -9
  176. package/v2/get_universe_factions_ok.d.ts +0 -56
  177. package/v2/get_universe_graphics_graphic_id_ok.d.ts +0 -42
  178. package/v2/get_universe_graphics_ok.d.ts +0 -9
  179. package/v2/get_universe_groups_group_id_ok.d.ts +0 -27
  180. package/v2/get_universe_groups_ok.d.ts +0 -9
  181. package/v2/get_universe_moons_moon_id_ok.d.ts +0 -41
  182. package/v2/get_universe_planets_planet_id_ok.d.ts +0 -42
  183. package/v2/get_universe_races_ok.d.ts +0 -52
  184. package/v2/get_universe_regions_ok.d.ts +0 -9
  185. package/v2/get_universe_regions_region_id_ok.d.ts +0 -28
  186. package/v2/get_universe_schematics_schematic_id_ok.d.ts +0 -18
  187. package/v2/get_universe_stargates_stargate_id_ok.d.ts +0 -57
  188. package/v2/get_universe_stars_star_id_ok.d.ts +0 -129
  189. package/v2/get_universe_stations_station_id_ok.d.ts +0 -104
  190. package/v2/get_universe_structures_ok.d.ts +0 -9
  191. package/v2/get_universe_structures_structure_id_ok.d.ts +0 -43
  192. package/v2/get_universe_system_jumps_ok.d.ts +0 -24
  193. package/v2/get_universe_system_kills_ok.d.ts +0 -32
  194. package/v2/get_universe_systems_ok.d.ts +0 -9
  195. package/v2/get_universe_systems_system_id_ok.d.ts +0 -94
  196. package/v2/get_universe_types_ok.d.ts +0 -9
  197. package/v2/get_universe_types_type_id_ok.d.ts +0 -105
  198. package/v2/get_wars_ok.d.ts +0 -9
  199. package/v2/get_wars_war_id_killmails_ok.d.ts +0 -24
  200. package/v2/post_characters_affiliation_ok.d.ts +0 -32
  201. package/v2/post_characters_character_id_assets_locations_ok.d.ts +0 -39
  202. package/v2/post_characters_character_id_assets_names_ok.d.ts +0 -24
  203. package/v2/post_characters_character_id_contacts_created.d.ts +0 -9
  204. package/v2/post_characters_character_id_cspa_created.d.ts +0 -7
  205. package/v2/post_characters_character_id_fittings_created.d.ts +0 -14
  206. package/v2/post_characters_character_id_mail_created.d.ts +0 -7
  207. package/v2/post_characters_character_id_mail_labels_created.d.ts +0 -7
  208. package/v2/post_corporations_corporation_id_assets_locations_ok.d.ts +0 -39
  209. package/v2/post_corporations_corporation_id_assets_names_ok.d.ts +0 -24
  210. package/v2/post_fleets_fleet_id_wings_created.d.ts +0 -14
  211. package/v2/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +0 -14
  212. package/v2/post_universe_ids_ok.d.ts +0 -86
  213. package/v2/post_universe_names_ok.d.ts +0 -38
  214. /package/v2/{extra-types.d.ts → globals/extra-types.d.ts} +0 -0
@@ -0,0 +1,335 @@
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
+ /**
9
+ * THIS DTS IS AUTO GENERATED, DO NOT EDIT
10
+ *
11
+ * @file eve-esi-types/v2/types-util.d.ts
12
+ * @summary This file is auto-generated and defines version 3.2.0 of the EVE Online ESI response types.
13
+ */
14
+ import type { TESIResponseOKMap } from "./response-map.d.ts";
15
+ import "./index.d.ts"
16
+
17
+ // export type TMappingToNumber = { [key in string | number | symbol]: number };
18
+ /**
19
+ * @experimental
20
+ *
21
+ * InferNextEndpoint is an experimental utility type designed to verify and infer the "next" applicable
22
+ * ESI endpoint based on an initial endpoint's result type. In essence, it inspects the URL pattern and
23
+ * the inferred response type (Resut) associated with a given endpoint (EP) and then determines whether that
24
+ * endpoint can be further chained to another ESI endpoint.
25
+ *
26
+ * **The type parameters are as follows**:
27
+ *
28
+ * @param M - The HTTP method type (e.g. "get", "post", etc.), which must extend TESIEntryMethod.
29
+ * @param EP - The current ESI endpoint under inspection; it extends ESIEndpointOf<M>.
30
+ * @param Resut - Defaults to InferESIResponseResult<M, EP>; it is the inferred response result of the endpoint.
31
+ * This type is tested against acceptable response formats (either a number array or an object
32
+ * mapping keys to numbers).
33
+ * @param Endpoints - Defaults to ESIEndpointOf<M>; represents the union of all endpoints for method M to be
34
+ * considered as potential next endpoints.
35
+ *
36
+ * The type works by iterating over each endpoint (EPOrigin) in the union Endpoints. For each EPOrigin:
37
+ * - It checks whether the original endpoint EP is assignable to Endpoints.
38
+ * - It then tests if EPOrigin extends the template literal type `${EP}{${string}}/${string}`—that is, if EPOrigin
39
+ * is a URL based on EP that includes a parameterized section (denoted by `{...}`) followed by some additional
40
+ * path segments.
41
+ * - Next, it ensures that the inferred response result type (Resut) conforms to one of the acceptable formats:
42
+ * either a number array or an object whose values are numbers. The object form uses `{ [x: infer T]: number }`
43
+ * for type inference (this version works as intended).
44
+ * - If all conditions are met, EPOrigin is retained in the union; otherwise, it is replaced with never.
45
+ *
46
+ * Finally, the mapped type is indexed over Endpoints to yield a union of all endpoint URLs that satisfy the above
47
+ * conditions. This allows chaining or conditional logic in ESI client implementations based on response shape.
48
+ *
49
+ * @example
50
+ * // Given:
51
+ * // - M = "get"
52
+ * // - EP = "/characters/{character_id}/"
53
+ * // - And InferESIResponseResult<"get", "/characters/{character_id}/"> is inferred as number[] or a
54
+ * // valid mapping (e.g., { [x: string]: number })
55
+ * // Then, InferNextEndpoint<"get", "/characters/{character_id}/"> computes to the union of endpoints like:
56
+ * // "/characters/{character_id}/assets" // if it matches the template and response type constraint.
57
+ *
58
+ * @remarks
59
+ * This type is highly experimental and leverages advanced TypeScript features—including conditional types,
60
+ * template literal types, and type inference—to perform non-trivial endpoint validation.
61
+ */
62
+ //* ctt ignore path parameter
63
+ export type InferNextEndpoint<
64
+ M extends TESIEntryMethod,
65
+ EP extends Exclude<ESIEndpointOf<M>, symbol> = Exclude<ESIEndpointOf<M>, symbol>,
66
+ BaseResut extends InferESIResponseResult<M, EP> = InferESIResponseResult<M, EP>,
67
+ Endpoints extends ESIEndpointOf<M> = ESIEndpointOf<M>,
68
+ > = {
69
+ [NextEP in Endpoints]: NextEP extends `${EP}${string}{${string}}/${string}`
70
+ // ? BaseResut extends number[] | TMappingToNumber // does not works...("skipLibCheck=false")
71
+ // DEVNOTE: As it turns out, the behavior of this utility type is broken unless you use the "skipLibCheck=true".
72
+ ? BaseResut extends number[] | { [x: infer T]: number }
73
+ //* ctt
74
+ ? NextEP : never
75
+ /*/
76
+ ? __ShiftType extends 0
77
+ ? [EP, NextEP, BaseResut] : NextEP
78
+ : never
79
+ //*/
80
+ : never;
81
+ }[Endpoints];
82
+
83
+ /**
84
+ * `InferNextEndpoint2` is a utility type that infers the next endpoint based on the current endpoint and method.
85
+ *
86
+ * DONE: 2025/4/11 15:45:01
87
+ * ``` jsonc
88
+ * // From the EP, infer the next parameterized endpoint to request.
89
+ * // If the result of the EP is `number[] | { [x: infer T]: number }`, infer the next parameterized endpoint to request.
90
+ * ```
91
+ *
92
+ * @template M - The HTTP method to use for the request.
93
+ * @template EP - The endpoint from which the next parameterized endpoint to request is inferred.
94
+ * @template BaseResut - The base response result type.
95
+ * @template Endpoints - The possible endpoints for the given method.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * type NextEndpoint = InferNextEndpoint2<"post", "/fleets/{fleet_id}/wings/">;
100
+ * // Result: "/fleets/{fleet_id}/wings/{wing_id}/squads/"
101
+ * ```
102
+ * @remarks
103
+ * This type is useful for chaining requests or determining the next endpoint to call based on the current endpoint.
104
+ */
105
+ export type InferNextEndpoint2<
106
+ M extends TESIEntryMethod,
107
+ EP extends ESIEndpointOf<M> = ESIEndpointOf<M>,
108
+ BaseResut extends InferESIResponseResultEX<`${M}:${EP}`> = InferESIResponseResultEX<`${M}:${EP}`>,
109
+ Endpoints extends ESIEndpointOf<M> = ESIEndpointOf<M>,
110
+ > = {
111
+ [NextEP in Endpoints]: NextEP extends `${EP}{${string}}/${string}`
112
+ // ? BaseResut extends number[] | TMappingToNumber // does not works...("skipLibCheck=false")
113
+ // DEVNOTE: As it turns out, the behavior of this utility type is broken unless you use the "skipLibCheck=true".
114
+ ? BaseResut extends number[] | { [x: infer T]: number }
115
+ ? NextEP : never
116
+ : never;
117
+ }[Endpoints];
118
+
119
+ /**
120
+ * `InferNextEndpointLoos` is a utility type that infers the next endpoint based on the current endpoint and method.
121
+ *
122
+ * DONE: 2025/4/11 15:45:01
123
+ * ``` jsonc
124
+ * // Infer the next parameterized endpoint to request from the EP
125
+ * // Does not validate the EP result, just infers the next endpoint to request
126
+ * ```
127
+ *
128
+ * @template M - The HTTP method to use for the request.
129
+ * @template EP - The endpoint from which the next parameterized endpoint to request is inferred.
130
+ * @template Endpoints - The possible endpoints for the given method.
131
+ *
132
+ * @example
133
+ * ```ts
134
+ * type NextEndpoint = InferNextEndpointLoos<"get", "/markets/groups/">;
135
+ * // Result: "/markets/groups/{market_group_id}/"
136
+ * ```
137
+ * @remarks
138
+ * This type is useful for chaining requests or determining the next endpoint to call based on the current endpoint.
139
+ * It does not validate the response type of the endpoint, only the URL pattern.
140
+ */
141
+ export type InferNextEndpointLoos<
142
+ M extends TESIEntryMethod,
143
+ //* ctt
144
+ // DEVNOTE: As it turns out, the behavior of this utility type is broken unless you use the "skipLibCheck=true".
145
+ EP extends ESIEndpointOf<M> = ESIEndpointOf<M>,
146
+ Endpoints extends ESIEndpointOf<M> = ESIEndpointOf<M>,
147
+ /*/
148
+ // This fix is required for skipLibCheck=false
149
+ EP extends Exclude<ESIEndpointOf<M>, symbol> = Exclude<ESIEndpointOf<M>, symbol>,
150
+ Endpoints extends Exclude<ESIEndpointOf<M>, symbol> = Exclude<ESIEndpointOf<M>, symbol>,
151
+ //*/
152
+ > = {
153
+ [NextEP in Endpoints]: NextEP extends `${EP}{${string}}${string}` ? NextEP : never
154
+ }[Endpoints];
155
+
156
+ /**
157
+ * @see For the meaning of this type of comment trick, see {@link InferNextEndpointLoos} line comment.
158
+ */
159
+ type ESIEndpointUnions = {
160
+ [M in TESIEntryMethod]: `${M}:${
161
+ //* ctt
162
+ ESIEndpointOf<M>
163
+ /*/
164
+ Exclude<ESIEndpointOf<M>, symbol>
165
+ //*/
166
+ }`;
167
+ }[TESIEntryMethod];
168
+ export type InferESIResponseResultEX<
169
+ EP extends unknown
170
+ // EP extends ESIEndpointUnions
171
+ > = EP extends `${infer M}:${infer EPRest}`
172
+ ? M extends TESIEntryMethod
173
+ ? EPRest extends ESIEndpointOf<M>
174
+ ? _ESIResponseType<M, EPRest> extends { result: infer U }
175
+ ? U : never
176
+ : never
177
+ : never
178
+ : never;
179
+
180
+ /**
181
+ * Represents a function that can make ESI requests with various HTTP methods.
182
+ *
183
+ * @template ActualOpt - The actual type of the options.
184
+ *
185
+ * @example
186
+ * ```ts
187
+ * // @ ts-expect-error
188
+ * export const request: IESIRequestFunction2<ESIRequestOptions> = (method, endpoint, opt) => {
189
+ * // Implementation for "get" | "post" | "put" | "delete" request
190
+ * };
191
+ * // You can easily implement "get" | "post" | "put" | "delete" requests
192
+ * // with code like the following:
193
+ * (["get", "post", "put", "delete"] as (keyof typeof request)[]).forEach((method) => {
194
+ * request[method] = function (this: typeof request, endpoint, opt) {
195
+ * return this(method, endpoint, opt);
196
+ * } as TESIRequestFunctionEachMethod2<typeof method>;
197
+ * });
198
+ * ```
199
+ */
200
+ export interface IESIRequestFunction2<ActualOpt extends Record<string, unknown>>
201
+ extends TESIRequestFunctionSignature2<ActualOpt>, TESIRequestFunctionMethods2<ActualOpt> {
202
+ }
203
+
204
+ /**
205
+ * Represents the methods available for making ESI requests.
206
+ *
207
+ * + This interface is used when you already have implementation code such as
208
+ * TESIRequestFunctionSignature2 and you want to implement additional shorthand methods.
209
+ *
210
+ * @template ActualOpt - The actual type of the options.
211
+ *
212
+ * @example
213
+ * ```ts
214
+ * export const request: TESIRequestFunctionSignature2<ESIRequestOptions> = (method, endpoint, opt) => {
215
+ * // Implementation for "get" | "post" | "put" | "delete" request
216
+ * };
217
+ * // You can easily implement "get" | "post" | "put" | "delete" requests
218
+ * // with code like the following:
219
+ * const esiMethods = {} as TESIRequestFunctionMethods2<ESIRequestOptions>;
220
+ * (["get", "post", "put", "delete"] as (keyof TESIRequestFunctionMethods2)[]).forEach((method) => {
221
+ * esiMethods[method] = function (endpoint, opt) {
222
+ * return request(method, endpoint, opt);
223
+ * } as TESIRequestFunctionEachMethod2<typeof method>;
224
+ * });
225
+ * ```
226
+ */
227
+ export type TESIRequestFunctionMethods2<ActualOpt extends Record<string, unknown>> = {
228
+ [method in TESIEntryMethod]: TESIRequestFunctionEachMethod2<method, ActualOpt>;
229
+ }
230
+
231
+ /**
232
+ * List of "x-cached-seconds"
233
+ *
234
+ * ```ts
235
+ * // const cacheSecGet: 3600 | 300 | 604800 | 120 | 5 | 600 | 86400 | 60 | 30 | 1200 | 1800 | 30758400
236
+ * const cacheSecGet: TESICachedSeconds<"get">;
237
+ * // const cache5sec: 5
238
+ * const cache5s: TESICachedSeconds<"put">;
239
+ * // const cache3600s: 3600
240
+ * const cache3600s: TESICachedSeconds<"post">;
241
+ * // "/characters/affiliation/"
242
+ * const cache3600sEndpoint: TESICachedSeconds<"post", 1>;
243
+ * ```
244
+ */
245
+ export declare type TESICachedSeconds<
246
+ Method extends TESIEntryMethod, AsEndpoint = 0
247
+ > = {
248
+ [M in TESIEntryMethod]: {
249
+ [EP in ESIEndpointOf<M>]: TESIResponseOKMap[M][EP] extends { cachedSeconds: number }
250
+ ? AsEndpoint extends 0
251
+ ? TESIResponseOKMap[M][EP]["cachedSeconds"]: EP
252
+ : never
253
+ }[ESIEndpointOf<M>];
254
+ }[Method];
255
+
256
+ /**
257
+ * Indicates that no path parameters are allowed.
258
+ *
259
+ * This type serves as a compile-time signal for endpoints that do not support dynamic URL segments.
260
+ * By using this type, it is clear that no path parameters should be provided.
261
+ */
262
+ export declare type TPathParamsNever = { /* pathParams?: never */ };
263
+
264
+ // local types
265
+ /**
266
+ * Infers the response type of an ESI request based on the HTTP method and endpoint.
267
+ *
268
+ * This type extracts the response type from the `TESIResponseOKMap` based on the provided
269
+ * HTTP method and endpoint.
270
+ *
271
+ * @template M - The HTTP method to use for the request.
272
+ * @template EPx - The endpoint path.
273
+ *
274
+ * @example
275
+ * ```ts
276
+ * type ResponseType = _ESIResponseType<"get", "/characters/{character_id}/">;
277
+ * // Result: The inferred response type for the given method and endpoint.
278
+ * ```
279
+ * @internal
280
+ * @see {@link ESIEndpointOf}
281
+ */
282
+ export type _ESIResponseType<
283
+ M extends TESIEntryMethod,
284
+ EPx extends ESIEndpointOf<M> | string,
285
+ > = TESIResponseOKMap[M][Extract<EPx, ESIEndpointOf<M>>];
286
+ // type XOK = _ESIResponseType<"get", "/status/"> extends global._ESIResponseType<"get", "/status/"> ? 1 : 0;
287
+ /**
288
+ * Determines if the endpoint requires path parameters.
289
+ *
290
+ * @template EP - The string representing the endpoint path.
291
+ * @returns {TPathParamsNever | { pathParams: IfParameterizedPath<EP> }}
292
+ * Returns an object with `pathParams` if the endpoint requires parameters, otherwise returns `TPathParamsNever`.
293
+ * @example
294
+ * ```ts
295
+ * type Example = IfNeedPathParams<"/characters/{character_id}/fittings/{fitting_id}/">;
296
+ * // Result: { pathParams: [number, number] }
297
+ * ```
298
+ * @internal
299
+ * @see {@link IfParameterizedPath}
300
+ * @see {@link ReplacePathParams}
301
+ */
302
+ export type _IfNeedPathParams<
303
+ EP extends unknown,
304
+ // will be `never` when cached
305
+ // Parameterized extends IfParameterizedPath<EP> = IfParameterizedPath<EP>
306
+ > = IfParameterizedPath<EP> extends never
307
+ ? TPathParamsNever :
308
+ EP extends ReplacePathParams<EP>
309
+ ? TPathParamsNever : { pathParams: IfParameterizedPath<EP> };
310
+
311
+ /**
312
+ * Infer the result type of an ESI response based on the method and endpoint.
313
+ *
314
+ * @template M - The HTTP method (e.g., "get", "post").
315
+ * @template EP - The endpoint path.
316
+ * @deprecated 2025/3/17
317
+ */
318
+ export type __InferESIResponseResult<
319
+ M extends TESIEntryMethod,
320
+ EP extends ESIEndpointOf<M>
321
+ > = TESIResponseOKMap[M][EP] extends { result: infer U } ? U : never;
322
+ /**
323
+ * Identifies the required parameters for a given entry type.
324
+ *
325
+ * @template Entry - The entry type to identify parameters for.
326
+ * @template Opt - The type of the parameters.
327
+ * @type {Opt & Pick<Entry, Exclude<keyof Entry, "result">>}
328
+ * @deprecated 2025/3/17
329
+ */
330
+ export type __IdentifyParameters<
331
+ Entry, Opt,
332
+ Keys = Exclude<keyof Entry, "result" | "tag" | "cachedSeconds">
333
+ // @ts-expect-error
334
+ > = RequireThese<Opt, Keys> & Pick<Entry, Keys>;
335
+
package/v2/util.d.ts CHANGED
@@ -27,7 +27,7 @@ export type PickPathParameters<Path extends string> =
27
27
  * @template U The union type to convert.
28
28
  * @returns {I} The intersection type.
29
29
  */
30
- type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
30
+ export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
31
31
 
32
32
  /**
33
33
  * Convert a union type to a tuple.
@@ -35,13 +35,15 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
35
35
  * @template T The union type to convert.
36
36
  * @returns {Array} The tuple representation of the union type.
37
37
  */
38
- type UnionToTuple<T> = UnionToIntersection<
38
+ export type UnionToTuple<T> = UnionToIntersection<
39
39
  T extends any ? () => T : never
40
40
  > extends () => infer R ? [...UnionToTuple<Exclude<T, R>>, R] : [];
41
41
 
42
42
  /**
43
43
  * #### Build an array of elements from a flattened tuple of type "1" | "2" | "3" ...
44
44
  *
45
+ * NOTE: This utility cannot calculate lengths greater than 48 (?).
46
+ *
45
47
  * + Returns the final length of the array.
46
48
  *
47
49
  * @template T The union type to be converted to a tuple and measured.
package/web/index.html CHANGED
@@ -44,7 +44,7 @@
44
44
  if (key === "Enter") {
45
45
  const cmd = inputBuffer;
46
46
  inputBuffer = "";
47
- eval(`(${cmd})`);
47
+ eval(`${cmd}`);
48
48
  } else if (key.length === 1) {
49
49
  inputBuffer += key;
50
50
  }
package/tsconfig.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "compilerOptions": {
4
- "skipDefaultLibCheck": true,
5
- "skipLibCheck": true,
6
- "declaration": true,
7
- // "declarationDir": "./dts",
8
- "outDir": ".",
9
- "target": "esnext",
10
- "module": "esnext",
11
- "diagnostics": true,
12
- "newLine": "LF",
13
- "strict": true,
14
- "moduleResolution": "node",
15
- "rootDirs": [
16
- "./scripts"
17
- ]
18
- },
19
- "include": [
20
- "./scripts/**/*.mts",
21
- "./scripts/**/*.d.ts",
22
- "./v2/*.d.ts"
23
- ],
24
- "exclude": [
25
- "./scripts/auth-*",
26
- "./scripts/esi-*",
27
- ]
28
- }
@@ -1,24 +0,0 @@
1
- /*!
2
- * ESI endpoint: get:/alliances/{alliance_id}/contacts/labels/
3
- */
4
- /**
5
- * 200 ok array
6
- *
7
- * @maxItems 64
8
- */
9
- type GetAlliancesAllianceIdContactsLabelsOk = GetAlliancesAllianceIdContactsLabels_200Ok[];
10
-
11
- /**
12
- * 200 ok object
13
- */
14
- interface GetAlliancesAllianceIdContactsLabels_200Ok {
15
- /**
16
- * label_id integer
17
- */
18
- label_id: number;
19
- /**
20
- * label_name string
21
- */
22
- label_name: string;
23
- [k: string]: unknown | undefined;
24
- }
@@ -1,35 +0,0 @@
1
- /*!
2
- * ESI endpoint: get:/alliances/{alliance_id}/contacts/
3
- */
4
- /**
5
- * contact_type string
6
- */
7
- type GetAlliancesAllianceIdContactsContactType = "character" | "corporation" | "alliance" | "faction";
8
- /**
9
- * 200 ok array
10
- *
11
- * @maxItems 1000
12
- */
13
- type GetAlliancesAllianceIdContactsOk = GetAlliancesAllianceIdContacts_200Ok[];
14
-
15
- /**
16
- * 200 ok object
17
- */
18
- interface GetAlliancesAllianceIdContacts_200Ok {
19
- /**
20
- * contact_id integer
21
- */
22
- contact_id: number;
23
- contact_type: GetAlliancesAllianceIdContactsContactType;
24
- /**
25
- * label_ids array
26
- *
27
- * @maxItems 63
28
- */
29
- label_ids?: number[];
30
- /**
31
- * Standing of the contact
32
- */
33
- standing: number;
34
- [k: string]: unknown | undefined;
35
- }
@@ -1,9 +0,0 @@
1
- /*!
2
- * ESI endpoint: get:/alliances/{alliance_id}/corporations/
3
- */
4
- /**
5
- * 200 ok array
6
- *
7
- * @maxItems 1000
8
- */
9
- type GetAlliancesAllianceIdCorporationsOk = number[];
@@ -1,18 +0,0 @@
1
- /*!
2
- * ESI endpoint: get:/alliances/{alliance_id}/icons/
3
- */
4
-
5
- /**
6
- * 200 ok object
7
- */
8
- interface GetAlliancesAllianceIdIconsOk {
9
- /**
10
- * px128x128 string
11
- */
12
- px128x128?: string;
13
- /**
14
- * px64x64 string
15
- */
16
- px64x64?: string;
17
- [k: string]: unknown | undefined;
18
- }
@@ -1,9 +0,0 @@
1
- /*!
2
- * ESI endpoint: get:/alliances/
3
- */
4
- /**
5
- * 200 ok array
6
- *
7
- * @maxItems 5000
8
- */
9
- type GetAlliancesOk = number[];
@@ -1,33 +0,0 @@
1
- /*!
2
- * ESI endpoint: get:/characters/{character_id}/agents_research/
3
- */
4
- /**
5
- * 200 ok array
6
- *
7
- * @maxItems 1000
8
- */
9
- type GetCharactersCharacterIdAgentsResearchOk = GetCharactersCharacterIdAgentsResearch_200Ok[];
10
-
11
- /**
12
- * 200 ok object
13
- */
14
- interface GetCharactersCharacterIdAgentsResearch_200Ok {
15
- /**
16
- * agent_id integer
17
- */
18
- agent_id: number;
19
- /**
20
- * points_per_day number
21
- */
22
- points_per_day: number;
23
- /**
24
- * remainder_points number
25
- */
26
- remainder_points: number;
27
- skill_type_id: number;
28
- /**
29
- * started_at string
30
- */
31
- started_at: string;
32
- [k: string]: unknown | undefined;
33
- }
@@ -1,134 +0,0 @@
1
- /*!
2
- * ESI endpoint: get:/characters/{character_id}/assets/
3
- */
4
- /**
5
- * location_flag string
6
- */
7
- type GetCharactersCharacterIdAssetsLocationFlag =
8
- | "AssetSafety"
9
- | "AutoFit"
10
- | "BoosterBay"
11
- | "Cargo"
12
- | "CorporationGoalDeliveries"
13
- | "CorpseBay"
14
- | "Deliveries"
15
- | "DroneBay"
16
- | "FighterBay"
17
- | "FighterTube0"
18
- | "FighterTube1"
19
- | "FighterTube2"
20
- | "FighterTube3"
21
- | "FighterTube4"
22
- | "FleetHangar"
23
- | "FrigateEscapeBay"
24
- | "Hangar"
25
- | "HangarAll"
26
- | "HiSlot0"
27
- | "HiSlot1"
28
- | "HiSlot2"
29
- | "HiSlot3"
30
- | "HiSlot4"
31
- | "HiSlot5"
32
- | "HiSlot6"
33
- | "HiSlot7"
34
- | "HiddenModifiers"
35
- | "Implant"
36
- | "InfrastructureHangar"
37
- | "LoSlot0"
38
- | "LoSlot1"
39
- | "LoSlot2"
40
- | "LoSlot3"
41
- | "LoSlot4"
42
- | "LoSlot5"
43
- | "LoSlot6"
44
- | "LoSlot7"
45
- | "Locked"
46
- | "MedSlot0"
47
- | "MedSlot1"
48
- | "MedSlot2"
49
- | "MedSlot3"
50
- | "MedSlot4"
51
- | "MedSlot5"
52
- | "MedSlot6"
53
- | "MedSlot7"
54
- | "MobileDepotHold"
55
- | "MoonMaterialBay"
56
- | "QuafeBay"
57
- | "RigSlot0"
58
- | "RigSlot1"
59
- | "RigSlot2"
60
- | "RigSlot3"
61
- | "RigSlot4"
62
- | "RigSlot5"
63
- | "RigSlot6"
64
- | "RigSlot7"
65
- | "ShipHangar"
66
- | "Skill"
67
- | "SpecializedAmmoHold"
68
- | "SpecializedAsteroidHold"
69
- | "SpecializedCommandCenterHold"
70
- | "SpecializedFuelBay"
71
- | "SpecializedGasHold"
72
- | "SpecializedIceHold"
73
- | "SpecializedIndustrialShipHold"
74
- | "SpecializedLargeShipHold"
75
- | "SpecializedMaterialBay"
76
- | "SpecializedMediumShipHold"
77
- | "SpecializedMineralHold"
78
- | "SpecializedOreHold"
79
- | "SpecializedPlanetaryCommoditiesHold"
80
- | "SpecializedSalvageHold"
81
- | "SpecializedShipHold"
82
- | "SpecializedSmallShipHold"
83
- | "StructureDeedBay"
84
- | "SubSystemBay"
85
- | "SubSystemSlot0"
86
- | "SubSystemSlot1"
87
- | "SubSystemSlot2"
88
- | "SubSystemSlot3"
89
- | "SubSystemSlot4"
90
- | "SubSystemSlot5"
91
- | "SubSystemSlot6"
92
- | "SubSystemSlot7"
93
- | "Unlocked"
94
- | "Wardrobe";
95
- /**
96
- * location_type string
97
- */
98
- type GetCharactersCharacterIdAssetsLocationType = "station" | "solar_system" | "item" | "other";
99
- /**
100
- * 200 ok array
101
- *
102
- * @maxItems 1000
103
- */
104
- type GetCharactersCharacterIdAssetsOk = GetCharactersCharacterIdAssets_200Ok[];
105
-
106
- /**
107
- * 200 ok object
108
- */
109
- interface GetCharactersCharacterIdAssets_200Ok {
110
- /**
111
- * is_blueprint_copy boolean
112
- */
113
- is_blueprint_copy?: boolean;
114
- /**
115
- * is_singleton boolean
116
- */
117
- is_singleton: boolean;
118
- /**
119
- * item_id integer
120
- */
121
- item_id: number;
122
- location_flag: GetCharactersCharacterIdAssetsLocationFlag;
123
- /**
124
- * location_id integer
125
- */
126
- location_id: number;
127
- location_type: GetCharactersCharacterIdAssetsLocationType;
128
- /**
129
- * quantity integer
130
- */
131
- quantity: number;
132
- type_id: number;
133
- [k: string]: unknown | undefined;
134
- }