eve-esi-types 1.1.0 → 1.2.4

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 (198) hide show
  1. package/esi-request.d.mts +9 -20
  2. package/esi-request.mjs +63 -32
  3. package/package.json +6 -4
  4. package/src/get_alliances_alliance_id_contacts_labels_ok.d.ts +1 -1
  5. package/src/get_alliances_alliance_id_contacts_ok.d.ts +1 -1
  6. package/src/get_alliances_alliance_id_corporations_ok.d.ts +1 -1
  7. package/src/get_alliances_alliance_id_icons_ok.d.ts +1 -1
  8. package/src/get_alliances_alliance_id_ok.d.ts +1 -1
  9. package/src/get_alliances_ok.d.ts +1 -1
  10. package/src/get_characters_character_id_agents_research_ok.d.ts +1 -1
  11. package/src/get_characters_character_id_assets_ok.d.ts +1 -1
  12. package/src/get_characters_character_id_attributes_ok.d.ts +1 -1
  13. package/src/get_characters_character_id_blueprints_ok.d.ts +1 -1
  14. package/src/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +1 -1
  15. package/src/get_characters_character_id_calendar_event_id_ok.d.ts +1 -1
  16. package/src/get_characters_character_id_calendar_ok.d.ts +1 -1
  17. package/src/get_characters_character_id_clones_ok.d.ts +1 -1
  18. package/src/get_characters_character_id_contacts_labels_ok.d.ts +1 -1
  19. package/src/get_characters_character_id_contacts_ok.d.ts +1 -1
  20. package/src/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +1 -1
  21. package/src/get_characters_character_id_contracts_contract_id_items_ok.d.ts +1 -1
  22. package/src/get_characters_character_id_contracts_ok.d.ts +1 -1
  23. package/src/get_characters_character_id_corporationhistory_ok.d.ts +1 -1
  24. package/src/get_characters_character_id_fatigue_ok.d.ts +1 -1
  25. package/src/get_characters_character_id_fittings_ok.d.ts +1 -1
  26. package/src/get_characters_character_id_fleet_ok.d.ts +1 -1
  27. package/src/get_characters_character_id_fw_stats_ok.d.ts +1 -1
  28. package/src/get_characters_character_id_implants_ok.d.ts +1 -1
  29. package/src/get_characters_character_id_industry_jobs_ok.d.ts +1 -1
  30. package/src/get_characters_character_id_killmails_recent_ok.d.ts +1 -1
  31. package/src/get_characters_character_id_location_ok.d.ts +1 -1
  32. package/src/get_characters_character_id_loyalty_points_ok.d.ts +1 -1
  33. package/src/get_characters_character_id_mail_labels_ok.d.ts +1 -1
  34. package/src/get_characters_character_id_mail_lists_ok.d.ts +1 -1
  35. package/src/get_characters_character_id_mail_mail_id_ok.d.ts +1 -1
  36. package/src/get_characters_character_id_mail_ok.d.ts +1 -1
  37. package/src/get_characters_character_id_medals_ok.d.ts +1 -1
  38. package/src/get_characters_character_id_mining_ok.d.ts +1 -1
  39. package/src/get_characters_character_id_notifications_contacts_ok.d.ts +1 -1
  40. package/src/get_characters_character_id_notifications_ok.d.ts +1 -1
  41. package/src/get_characters_character_id_ok.d.ts +1 -1
  42. package/src/get_characters_character_id_online_ok.d.ts +1 -1
  43. package/src/get_characters_character_id_opportunities_ok.d.ts +1 -1
  44. package/src/get_characters_character_id_orders_history_ok.d.ts +1 -1
  45. package/src/get_characters_character_id_orders_ok.d.ts +1 -1
  46. package/src/get_characters_character_id_planets_ok.d.ts +1 -1
  47. package/src/get_characters_character_id_planets_planet_id_ok.d.ts +1 -1
  48. package/src/get_characters_character_id_portrait_ok.d.ts +1 -1
  49. package/src/get_characters_character_id_roles_ok.d.ts +1 -1
  50. package/src/get_characters_character_id_search_ok.d.ts +1 -1
  51. package/src/get_characters_character_id_ship_ok.d.ts +1 -1
  52. package/src/get_characters_character_id_skillqueue_ok.d.ts +1 -1
  53. package/src/get_characters_character_id_skills_ok.d.ts +1 -1
  54. package/src/get_characters_character_id_standings_ok.d.ts +1 -1
  55. package/src/get_characters_character_id_titles_ok.d.ts +1 -1
  56. package/src/get_characters_character_id_wallet_journal_ok.d.ts +1 -1
  57. package/src/get_characters_character_id_wallet_ok.d.ts +1 -1
  58. package/src/get_characters_character_id_wallet_transactions_ok.d.ts +1 -1
  59. package/src/get_contracts_public_bids_contract_id_ok.d.ts +1 -1
  60. package/src/get_contracts_public_items_contract_id_ok.d.ts +1 -1
  61. package/src/get_contracts_public_region_id_ok.d.ts +1 -1
  62. package/src/get_corporation_corporation_id_mining_extractions_ok.d.ts +1 -1
  63. package/src/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +1 -1
  64. package/src/get_corporation_corporation_id_mining_observers_ok.d.ts +1 -1
  65. package/src/get_corporations_corporation_id_alliancehistory_ok.d.ts +1 -1
  66. package/src/get_corporations_corporation_id_assets_ok.d.ts +1 -1
  67. package/src/get_corporations_corporation_id_blueprints_ok.d.ts +1 -1
  68. package/src/get_corporations_corporation_id_contacts_labels_ok.d.ts +1 -1
  69. package/src/get_corporations_corporation_id_contacts_ok.d.ts +1 -1
  70. package/src/get_corporations_corporation_id_containers_logs_ok.d.ts +1 -1
  71. package/src/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +1 -1
  72. package/src/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +1 -1
  73. package/src/get_corporations_corporation_id_contracts_ok.d.ts +1 -1
  74. package/src/get_corporations_corporation_id_customs_offices_ok.d.ts +1 -1
  75. package/src/get_corporations_corporation_id_divisions_ok.d.ts +1 -1
  76. package/src/get_corporations_corporation_id_facilities_ok.d.ts +1 -1
  77. package/src/get_corporations_corporation_id_fw_stats_ok.d.ts +1 -1
  78. package/src/get_corporations_corporation_id_icons_ok.d.ts +1 -1
  79. package/src/get_corporations_corporation_id_industry_jobs_ok.d.ts +1 -1
  80. package/src/get_corporations_corporation_id_killmails_recent_ok.d.ts +1 -1
  81. package/src/get_corporations_corporation_id_medals_issued_ok.d.ts +1 -1
  82. package/src/get_corporations_corporation_id_medals_ok.d.ts +1 -1
  83. package/src/get_corporations_corporation_id_members_limit_ok.d.ts +1 -1
  84. package/src/get_corporations_corporation_id_members_ok.d.ts +1 -1
  85. package/src/get_corporations_corporation_id_members_titles_ok.d.ts +1 -1
  86. package/src/get_corporations_corporation_id_membertracking_ok.d.ts +1 -1
  87. package/src/get_corporations_corporation_id_ok.d.ts +1 -1
  88. package/src/get_corporations_corporation_id_orders_history_ok.d.ts +1 -1
  89. package/src/get_corporations_corporation_id_orders_ok.d.ts +1 -1
  90. package/src/get_corporations_corporation_id_roles_history_ok.d.ts +1 -1
  91. package/src/get_corporations_corporation_id_roles_ok.d.ts +1 -1
  92. package/src/get_corporations_corporation_id_shareholders_ok.d.ts +1 -1
  93. package/src/get_corporations_corporation_id_standings_ok.d.ts +1 -1
  94. package/src/get_corporations_corporation_id_starbases_ok.d.ts +1 -1
  95. package/src/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +2 -248
  96. package/src/get_corporations_corporation_id_structures_ok.d.ts +1 -1
  97. package/src/get_corporations_corporation_id_titles_ok.d.ts +2 -166
  98. package/src/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +1 -1
  99. package/src/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +1 -1
  100. package/src/get_corporations_corporation_id_wallets_ok.d.ts +1 -1
  101. package/src/get_corporations_npccorps_ok.d.ts +1 -1
  102. package/src/get_dogma_attributes_attribute_id_ok.d.ts +1 -1
  103. package/src/get_dogma_attributes_ok.d.ts +1 -1
  104. package/src/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +1 -1
  105. package/src/get_dogma_effects_effect_id_ok.d.ts +1 -1
  106. package/src/get_dogma_effects_ok.d.ts +1 -1
  107. package/src/get_fleets_fleet_id_members_ok.d.ts +1 -1
  108. package/src/get_fleets_fleet_id_ok.d.ts +1 -1
  109. package/src/get_fleets_fleet_id_wings_ok.d.ts +1 -1
  110. package/src/get_fw_leaderboards_characters_ok.d.ts +5 -45
  111. package/src/get_fw_leaderboards_corporations_ok.d.ts +11 -478
  112. package/src/get_fw_leaderboards_ok.d.ts +5 -45
  113. package/src/get_fw_stats_ok.d.ts +1 -1
  114. package/src/get_fw_systems_ok.d.ts +1 -1
  115. package/src/get_fw_wars_ok.d.ts +1 -1
  116. package/src/get_incursions_ok.d.ts +1 -1
  117. package/src/get_industry_facilities_ok.d.ts +1 -1
  118. package/src/get_industry_systems_ok.d.ts +1 -1
  119. package/src/get_insurance_prices_ok.d.ts +1 -1
  120. package/src/get_killmails_killmail_id_killmail_hash_ok.d.ts +1 -1
  121. package/src/get_loyalty_stores_corporation_id_offers_ok.d.ts +1 -1
  122. package/src/get_markets_groups_market_group_id_ok.d.ts +1 -1
  123. package/src/get_markets_groups_ok.d.ts +1 -1
  124. package/src/get_markets_prices_ok.d.ts +1 -1
  125. package/src/get_markets_region_id_history_ok.d.ts +1 -1
  126. package/src/get_markets_region_id_orders_ok.d.ts +1 -1
  127. package/src/get_markets_region_id_types_ok.d.ts +1 -1
  128. package/src/get_markets_structures_structure_id_ok.d.ts +1 -1
  129. package/src/get_opportunities_groups_group_id_ok.d.ts +1 -1
  130. package/src/get_opportunities_groups_ok.d.ts +1 -1
  131. package/src/get_opportunities_tasks_ok.d.ts +1 -1
  132. package/src/get_opportunities_tasks_task_id_ok.d.ts +1 -1
  133. package/src/get_route_origin_destination_ok.d.ts +1 -1
  134. package/src/get_sovereignty_campaigns_ok.d.ts +1 -1
  135. package/src/get_sovereignty_map_ok.d.ts +1 -1
  136. package/src/get_sovereignty_structures_ok.d.ts +1 -1
  137. package/src/get_status_ok.d.ts +1 -1
  138. package/src/get_universe_ancestries_ok.d.ts +1 -1
  139. package/src/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +1 -1
  140. package/src/get_universe_bloodlines_ok.d.ts +1 -1
  141. package/src/get_universe_categories_category_id_ok.d.ts +1 -1
  142. package/src/get_universe_categories_ok.d.ts +1 -1
  143. package/src/get_universe_constellations_constellation_id_ok.d.ts +1 -1
  144. package/src/get_universe_constellations_ok.d.ts +1 -1
  145. package/src/get_universe_factions_ok.d.ts +1 -1
  146. package/src/get_universe_graphics_graphic_id_ok.d.ts +1 -1
  147. package/src/get_universe_graphics_ok.d.ts +1 -1
  148. package/src/get_universe_groups_group_id_ok.d.ts +1 -1
  149. package/src/get_universe_groups_ok.d.ts +1 -1
  150. package/src/get_universe_moons_moon_id_ok.d.ts +1 -1
  151. package/src/get_universe_planets_planet_id_ok.d.ts +1 -1
  152. package/src/get_universe_races_ok.d.ts +1 -1
  153. package/src/get_universe_regions_ok.d.ts +1 -1
  154. package/src/get_universe_regions_region_id_ok.d.ts +1 -1
  155. package/src/get_universe_schematics_schematic_id_ok.d.ts +1 -1
  156. package/src/get_universe_stargates_stargate_id_ok.d.ts +1 -1
  157. package/src/get_universe_stars_star_id_ok.d.ts +1 -1
  158. package/src/get_universe_stations_station_id_ok.d.ts +1 -1
  159. package/src/get_universe_structures_ok.d.ts +1 -1
  160. package/src/get_universe_structures_structure_id_ok.d.ts +1 -1
  161. package/src/get_universe_system_jumps_ok.d.ts +1 -1
  162. package/src/get_universe_system_kills_ok.d.ts +1 -1
  163. package/src/get_universe_systems_ok.d.ts +1 -1
  164. package/src/get_universe_systems_system_id_ok.d.ts +1 -1
  165. package/src/get_universe_types_ok.d.ts +1 -1
  166. package/src/get_universe_types_type_id_ok.d.ts +1 -1
  167. package/src/get_wars_ok.d.ts +1 -1
  168. package/src/get_wars_war_id_killmails_ok.d.ts +1 -1
  169. package/src/get_wars_war_id_ok.d.ts +1 -1
  170. package/src/index.d.ts +201 -182
  171. package/src/post_characters_affiliation_ok.d.ts +1 -1
  172. package/src/post_characters_character_id_assets_locations_ok.d.ts +1 -1
  173. package/src/post_characters_character_id_assets_names_ok.d.ts +1 -1
  174. package/src/post_characters_character_id_contacts_created.d.ts +1 -1
  175. package/src/post_characters_character_id_cspa_created.d.ts +1 -1
  176. package/src/post_characters_character_id_fittings_created.d.ts +1 -1
  177. package/src/post_characters_character_id_mail_created.d.ts +1 -1
  178. package/src/post_characters_character_id_mail_labels_created.d.ts +1 -1
  179. package/src/post_corporations_corporation_id_assets_locations_ok.d.ts +1 -1
  180. package/src/post_corporations_corporation_id_assets_names_ok.d.ts +1 -1
  181. package/src/post_fleets_fleet_id_wings_created.d.ts +1 -1
  182. package/src/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +1 -1
  183. package/src/post_universe_ids_ok.d.ts +1 -1
  184. package/src/post_universe_names_ok.d.ts +1 -1
  185. package/tsconfig.json +4 -5
  186. package/src/get_characters_character_id_bookmarks_folders_ok.d.ts +0 -24
  187. package/src/get_characters_character_id_bookmarks_ok.d.ts +0 -75
  188. package/src/get_corporations_corporation_id_bookmarks_folders_ok.d.ts +0 -28
  189. package/src/get_corporations_corporation_id_bookmarks_ok.d.ts +0 -75
  190. package/src/post_fleets_fleet_id_members_invitation.d.ts +0 -27
  191. package/src/post_ui_openwindow_newmail_new_mail.d.ts +0 -40
  192. package/src/put_characters_character_id_calendar_event_id_response.d.ts +0 -15
  193. package/src/put_characters_character_id_contacts_contact_ids.d.ts +0 -16
  194. package/src/put_characters_character_id_mail_mail_id_contents.d.ts +0 -20
  195. package/src/put_fleets_fleet_id_members_member_id_movement.d.ts +0 -27
  196. package/src/put_fleets_fleet_id_new_settings.d.ts +0 -18
  197. package/src/put_fleets_fleet_id_squads_squad_id_naming.d.ts +0 -14
  198. package/src/put_fleets_fleet_id_wings_wing_id_naming.d.ts +0 -14
package/esi-request.d.mts CHANGED
@@ -5,13 +5,12 @@
5
5
  https://opensource.org/licenses/mit-license.php
6
6
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7
7
  */
8
- import type { TESIResponseOKMap } from "./src";
9
- type TRequestMethod = "get" | "post" | "put" | "delete";
8
+ export type TRequestMethod = "get" | "post" | "put" | "delete";
10
9
  /**
11
10
  * __{Header}.{Payload}.{Signature}__
12
11
  */
13
- type TAcccessToken = `${string}.${string}.${string}`;
14
- type ESIRequestOptions = {
12
+ export type TAcccessToken = `${string}.${string}.${string}`;
13
+ export type ESIRequestOptions = {
15
14
  /**
16
15
  * query params for ESI request.
17
16
  */
@@ -35,24 +34,14 @@ type ESIRequestOptions = {
35
34
  };
36
35
  /**
37
36
  * fire ESI request
38
- * @template {"get" | "post" | "put" | "delete"} M
39
- * @template {keyof TESIResponseOKMap[M]} EP
40
- * @template {number | number[] | ESIRequestOptions} Opt
41
- * @template {TESIResponseOKMap[M][EP]} R
37
+ * @type {TESIRequestFunctionSignatureV1<ESIRequestOptions>}
42
38
  *
43
- * @param {M} mthd
44
- * @param {EP} endp - The endpoint to request.
45
- * @param {Opt} [pathParams] - Optional path parameters.
39
+ * @param method
40
+ * @param endpoint - The endpoint to request.
41
+ * @param [pathParams] - Optional path parameters.
46
42
  * @param {ESIRequestOptions} [opt] - default is empty object {}. `body` is json string
47
- * @returns {Promise<R>} - The response from the endpoint.
43
+ * @returns - The response from the endpoint.
48
44
  * @throws
49
45
  * @async
50
46
  */
51
- export declare function fire<
52
- M extends TRequestMethod,
53
- EP extends keyof TESIResponseOKMap[M],
54
- Opt extends number | number[] | ESIRequestOptions,
55
- R extends TESIResponseOKMap[M][EP]
56
- >(
57
- mthd: M, endp: EP, pathParams?: Opt, opt?: ESIRequestOptions
58
- ): Promise<R>;
47
+ export declare const fire: TESIRequestFunctionSignatureV1<ESIRequestOptions>;
package/esi-request.mjs CHANGED
@@ -1,4 +1,14 @@
1
- // import type { TESIResponseOKMap } from "eve-esi-types";
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
+ /// <reference path="./src/index.d.ts"/>
9
+ // - - - - - - - - - - - - - - - - - - - -
10
+ // imports
11
+ // - - - - - - - - - - - - - - - - - - - -
2
12
  // - - - - - - - - - - - - - - - - - - - -
3
13
  // constants, types
4
14
  // - - - - - - - - - - - - - - - - - - - -
@@ -16,6 +26,7 @@ const BASE = "https://esi.evetech.net";
16
26
  /**
17
27
  * @typedef {import("./src").TESIResponseOKMap} TESIResponseOKMap
18
28
  * @typedef {`${string}.${string}.${string}`} TAcccessToken __{Header}.{Payload}.{Signature}__
29
+ * @typedef {"get" | "post" | "put" | "delete"} TRequestMethod
19
30
  */
20
31
  /**
21
32
  * @typedef ESIRequestOptions
@@ -40,7 +51,7 @@ class ESIRequesError extends Error {
40
51
  /**
41
52
  * throws when x-esi-error-limit-remain header value is "0". (http status: 420)
42
53
  */
43
- class ESIErrorLimitReachedError extends Error {
54
+ class ESIErrorLimitReachedError extends ESIRequesError {
44
55
  constructor() {
45
56
  super("Cannot continue ESI request because 'x-esi-error-limit-remain' is zero!");
46
57
  }
@@ -107,39 +118,62 @@ const replaceCbt = (endpoint, ids) => {
107
118
  };
108
119
  /**
109
120
  *
110
- * @param {string} endp this means endpoint url fragment like `/characters/{character_id}/` or `/characters/{character_id}/agents_research/`
121
+ * @param {string} endpoint this means endpoint url fragment like `/characters/{character_id}/` or `/characters/{character_id}/agents_research/`
111
122
  * + The version parameter can be omitted by using `<version>/<endpoint>`
112
123
  */
113
- const curl = (endp) => {
114
- endp = endp.replace(/^\/+|\/+$/g, "");
115
- return `${BASE}/latest/${endp}/`;
124
+ const curl = (endpoint) => {
125
+ endpoint = endpoint.replace(/^\/+|\/+$/g, "");
126
+ return `${BASE}/latest/${endpoint}/`;
116
127
  };
117
128
  // - - - - - - - - - - - - - - - - - - - -
118
129
  // main functions
119
130
  // - - - - - - - - - - - - - - - - - - - -
131
+ /* ctt
120
132
  /**
121
133
  * fire ESI request
122
- * @template {"get" | "post" | "put" | "delete"} M
134
+ * @template {TRequestMethod} M
123
135
  * @template {keyof TESIResponseOKMap[M]} EP
124
- * @template {number | number[] | ESIRequestOptions} Opt
136
+ * @template {IfParameterizedPath<EP, ESIRequestOptions>} P2
125
137
  * @template {TESIResponseOKMap[M][EP]} R
126
138
  *
127
- * @param {M} mthd
128
- * @param {EP} endp - The endpoint to request.
129
- * @param {Opt} [pathParams] - Optional path parameters.
139
+ * @param {M} method
140
+ * @param {EP} endpoint - The endpoint to request.
141
+ * @param {P2} [pathParams] - Optional path parameters.
130
142
  * @param {ESIRequestOptions} [opt] - default is empty object {}. `body` is json string
131
143
  * @returns {Promise<R>} - The response from the endpoint.
132
144
  * @throws
133
145
  * @async
146
+ * /
147
+ export async function fire<
148
+ M extends TRequestMethod,
149
+ EP extends keyof TESIResponseOKMap[M],
150
+ P2 extends IfParameterizedPath<EP, ESIRequestOptions>,
151
+ R extends TESIResponseOKMap[M][EP]
152
+ >(
153
+ method: M, endpoint: EP, pathParams?: P2, opt: ESIRequestOptions = {}
154
+ ): Promise<R> {
155
+ /*/
156
+ /**
157
+ * fire ESI request
158
+ * @type {TESIRequestFunctionSignatureV1<ESIRequestOptions>}
159
+ *
160
+ * @param method
161
+ * @param endpoint - The endpoint to request.
162
+ * @param [pathParams] - Optional path parameters.
163
+ * @param {ESIRequestOptions} [opt] - default is empty object {}. `body` is json string
164
+ * @returns - The response from the endpoint.
165
+ * @throws
166
+ * @async
134
167
  */
135
- export async function fire(mthd, endp, pathParams, opt = {}) {
168
+ export const fire = async (method, endpoint, pathParams, opt = {}) => {
169
+ //*/
136
170
  if (typeof pathParams === "number") {
137
171
  // @ts-expect-error
138
172
  pathParams = [pathParams];
139
173
  }
140
174
  if (isArray(pathParams)) {
141
- // @ts-ignore actualy endp is string
142
- endp = replaceCbt(endp, pathParams);
175
+ // @ts-expect-error actualy endpoint is string
176
+ endpoint = replaceCbt(endpoint, pathParams);
143
177
  }
144
178
  else {
145
179
  // When only options are provided
@@ -147,21 +181,19 @@ export async function fire(mthd, endp, pathParams, opt = {}) {
147
181
  }
148
182
  /** @type {RequestInit} */
149
183
  const rqopt = {
150
- method: mthd,
184
+ method,
151
185
  mode: "cors",
152
186
  cache: "no-cache",
153
187
  signal: opt.cancelable?.signal,
154
188
  headers: {}
155
189
  };
156
190
  const qss = {
157
- // language: "en",
191
+ language: "en"
158
192
  };
159
193
  if (opt.query) {
160
194
  // Object.assign(queries, options.queries); Object.assign is too slow
161
195
  const oqs = opt.query;
162
- for (const k of Object.keys(oqs)) {
163
- qss[k] = oqs[k];
164
- }
196
+ Object.keys(oqs).forEach(k => qss[k] = oqs[k]);
165
197
  }
166
198
  // DEVNOTE: when datasource is not empty string. (e.g - "singularity"
167
199
  // in this case must specify datasource.
@@ -178,14 +210,12 @@ export async function fire(mthd, endp, pathParams, opt = {}) {
178
210
  rqopt.headers["content-type"] = "application/json";
179
211
  rqopt.body = JSON.stringify(opt.body);
180
212
  }
181
- // @ts-ignore actualy endp is string
182
- const endpointUrl = curl(endp);
213
+ // @ts-ignore actualy endpoint is string
214
+ const endpointUrl = curl(endpoint);
183
215
  ax++;
184
216
  try {
185
217
  // @ts-ignore A silly type error will appear, but ignore it.
186
- const res = await fetch(`${endpointUrl}?${new URLSearchParams(qss) + ""}`, rqopt).finally(() => {
187
- ax--;
188
- });
218
+ const res = await fetch(`${endpointUrl}?${new URLSearchParams(qss) + ""}`, rqopt).finally(() => ax--);
189
219
  const stat = res.status;
190
220
  if (!res.ok && !opt.ignoreError) {
191
221
  if (stat === 420) {
@@ -193,17 +223,17 @@ export async function fire(mthd, endp, pathParams, opt = {}) {
193
223
  throw new ESIErrorLimitReachedError();
194
224
  }
195
225
  else {
196
- // @ts-ignore actualy endp is string
197
- throw new ESIRequesError(`maybe network disconneted or otherwise request data are invalid. (endpoint=${endp}, http status=${stat})`);
226
+ // @ts-ignore actualy endpoint is string
227
+ throw new ESIRequesError(`maybe network disconneted or otherwise request data are invalid. (endpoint=${endpoint}, http status=${stat})`);
198
228
  }
199
229
  }
200
230
  else {
201
231
  // DEVNOTE: - 204 No Content
202
232
  if (stat === 204) {
203
233
  // this result is empty, decided to return status code.
204
- return /** @type {R} */ ({ status: stat });
234
+ // @ts-ignore
235
+ return { status: stat };
205
236
  }
206
- /** @type {R} */
207
237
  const data = await res.json();
208
238
  if (opt.ignoreError) {
209
239
  // meaning `forceJson`?
@@ -220,7 +250,8 @@ export async function fire(mthd, endp, pathParams, opt = {}) {
220
250
  // finally, decide product data.
221
251
  if (isArray(data) && isArray(remData)) {
222
252
  // DEVNOTE: 2019/7/23 15:01:48 - types
223
- return /** @type {R} */ (data.concat(remData));
253
+ // @ts-ignore
254
+ return data.concat(remData);
224
255
  }
225
256
  else {
226
257
  // @ts-ignore TODO: fix type
@@ -231,10 +262,10 @@ export async function fire(mthd, endp, pathParams, opt = {}) {
231
262
  }
232
263
  }
233
264
  catch (e) {
234
- // @ts-ignore actualy endp is string
235
- throw new ESIRequesError(`unknown error occurred, message: ${e.message}, endpoint=${endp}`);
265
+ // @ts-ignore actualy endpoint is string
266
+ throw new ESIRequesError(`unknown error occurred, message: ${e.message}, endpoint=${endpoint}`);
236
267
  }
237
- }
268
+ };
238
269
  // It should complete correctly.
239
270
  async function getEVEStatus() {
240
271
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve-esi-types",
3
- "version": "1.1.0",
3
+ "version": "1.2.4",
4
4
  "description": "Extracted the main type of ESI. use for ESI request response types (version 1 only)",
5
5
  "main": "src/index.d.ts",
6
6
  "scripts": {
@@ -12,8 +12,7 @@
12
12
  },
13
13
  "files": [
14
14
  "src",
15
- "esi-request.mjs",
16
- "esi-request.d.mts",
15
+ "esi-request.*",
17
16
  "LICENSE",
18
17
  "*.md",
19
18
  "package.json",
@@ -33,5 +32,8 @@
33
32
  "bugs": {
34
33
  "url": "https://github.com/jeffy-g/eve-esi-types/issues"
35
34
  },
36
- "homepage": "https://github.com/jeffy-g/eve-esi-types#readme"
35
+ "homepage": "https://github.com/jeffy-g/eve-esi-types#readme",
36
+ "peerDependencies": {
37
+ "typescript": "latest"
38
+ }
37
39
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /alliances/{alliance_id}/contacts/labels/
2
+ * ESI endpoint: get:/alliances/{alliance_id}/contacts/labels/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /alliances/{alliance_id}/contacts/
2
+ * ESI endpoint: get:/alliances/{alliance_id}/contacts/
3
3
  */
4
4
  /**
5
5
  * contact_type string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /alliances/{alliance_id}/corporations/
2
+ * ESI endpoint: get:/alliances/{alliance_id}/corporations/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /alliances/{alliance_id}/icons/
2
+ * ESI endpoint: get:/alliances/{alliance_id}/icons/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /alliances/{alliance_id}/
2
+ * ESI endpoint: get:/alliances/{alliance_id}/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /alliances/
2
+ * ESI endpoint: get:/alliances/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/agents_research/
2
+ * ESI endpoint: get:/characters/{character_id}/agents_research/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/assets/
2
+ * ESI endpoint: get:/characters/{character_id}/assets/
3
3
  */
4
4
  /**
5
5
  * location_flag string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/attributes/
2
+ * ESI endpoint: get:/characters/{character_id}/attributes/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/blueprints/
2
+ * ESI endpoint: get:/characters/{character_id}/blueprints/
3
3
  */
4
4
  /**
5
5
  * Type of the location_id
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/calendar/{event_id}/attendees/
2
+ * ESI endpoint: get:/characters/{character_id}/calendar/{event_id}/attendees/
3
3
  */
4
4
  /**
5
5
  * event_response string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/calendar/{event_id}/
2
+ * ESI endpoint: get:/characters/{character_id}/calendar/{event_id}/
3
3
  */
4
4
  /**
5
5
  * owner_type string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/calendar/
2
+ * ESI endpoint: get:/characters/{character_id}/calendar/
3
3
  */
4
4
  /**
5
5
  * event_response string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/clones/
2
+ * ESI endpoint: get:/characters/{character_id}/clones/
3
3
  */
4
4
  /**
5
5
  * location_type string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/contacts/labels/
2
+ * ESI endpoint: get:/characters/{character_id}/contacts/labels/
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: get:/characters/{character_id}/contacts/
3
3
  */
4
4
  /**
5
5
  * contact_type string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/contracts/{contract_id}/bids/
2
+ * ESI endpoint: get:/characters/{character_id}/contracts/{contract_id}/bids/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/contracts/{contract_id}/items/
2
+ * ESI endpoint: get:/characters/{character_id}/contracts/{contract_id}/items/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/contracts/
2
+ * ESI endpoint: get:/characters/{character_id}/contracts/
3
3
  */
4
4
  /**
5
5
  * To whom the contract is available
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/corporationhistory/
2
+ * ESI endpoint: get:/characters/{character_id}/corporationhistory/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/fatigue/
2
+ * ESI endpoint: get:/characters/{character_id}/fatigue/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/fittings/
2
+ * ESI endpoint: get:/characters/{character_id}/fittings/
3
3
  */
4
4
  /**
5
5
  * flag string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/fleet/
2
+ * ESI endpoint: get:/characters/{character_id}/fleet/
3
3
  */
4
4
  /**
5
5
  * Member’s role in fleet
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/fw/stats/
2
+ * ESI endpoint: get:/characters/{character_id}/fw/stats/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/implants/
2
+ * ESI endpoint: get:/characters/{character_id}/implants/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/industry/jobs/
2
+ * ESI endpoint: get:/characters/{character_id}/industry/jobs/
3
3
  */
4
4
  /**
5
5
  * status string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/killmails/recent/
2
+ * ESI endpoint: get:/characters/{character_id}/killmails/recent/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/location/
2
+ * ESI endpoint: get:/characters/{character_id}/location/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/loyalty/points/
2
+ * ESI endpoint: get:/characters/{character_id}/loyalty/points/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mail/labels/
2
+ * ESI endpoint: get:/characters/{character_id}/mail/labels/
3
3
  */
4
4
  /**
5
5
  * color string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mail/lists/
2
+ * ESI endpoint: get:/characters/{character_id}/mail/lists/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mail/{mail_id}/
2
+ * ESI endpoint: get:/characters/{character_id}/mail/{mail_id}/
3
3
  */
4
4
  /**
5
5
  * recipient_type string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mail/
2
+ * ESI endpoint: get:/characters/{character_id}/mail/
3
3
  */
4
4
  /**
5
5
  * recipient_type string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/medals/
2
+ * ESI endpoint: get:/characters/{character_id}/medals/
3
3
  */
4
4
  /**
5
5
  * graphics array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mining/
2
+ * ESI endpoint: get:/characters/{character_id}/mining/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/notifications/contacts/
2
+ * ESI endpoint: get:/characters/{character_id}/notifications/contacts/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/notifications/
2
+ * ESI endpoint: get:/characters/{character_id}/notifications/
3
3
  */
4
4
  /**
5
5
  * sender_type string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/
2
+ * ESI endpoint: get:/characters/{character_id}/
3
3
  */
4
4
  /**
5
5
  * gender string
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/online/
2
+ * ESI endpoint: get:/characters/{character_id}/online/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/opportunities/
2
+ * ESI endpoint: get:/characters/{character_id}/opportunities/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/orders/history/
2
+ * ESI endpoint: get:/characters/{character_id}/orders/history/
3
3
  */
4
4
  /**
5
5
  * Valid order range, numbers are ranges in jumps
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/orders/
2
+ * ESI endpoint: get:/characters/{character_id}/orders/
3
3
  */
4
4
  /**
5
5
  * Valid order range, numbers are ranges in jumps
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/planets/
2
+ * ESI endpoint: get:/characters/{character_id}/planets/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/planets/{planet_id}/
2
+ * ESI endpoint: get:/characters/{character_id}/planets/{planet_id}/
3
3
  */
4
4
  /**
5
5
  * links array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/portrait/
2
+ * ESI endpoint: get:/characters/{character_id}/portrait/
3
3
  */
4
4
 
5
5
  /**