eve-esi-types 1.0.1 → 1.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 (205) hide show
  1. package/README.md +28 -2
  2. package/esi-request.d.mts +58 -0
  3. package/esi-request.mjs +44 -8
  4. package/package.json +12 -3
  5. package/src/get_alliances_alliance_id_contacts_labels_ok.d.ts +10 -13
  6. package/src/get_alliances_alliance_id_contacts_ok.d.ts +16 -24
  7. package/src/get_alliances_alliance_id_corporations_ok.d.ts +3 -8
  8. package/src/get_alliances_alliance_id_icons_ok.d.ts +10 -13
  9. package/src/get_alliances_alliance_id_ok.d.ts +30 -38
  10. package/src/get_alliances_ok.d.ts +3 -8
  11. package/src/get_characters_character_id_agents_research_ok.d.ts +19 -28
  12. package/src/get_characters_character_id_assets_ok.d.ts +23 -33
  13. package/src/get_characters_character_id_attributes_ok.d.ts +34 -43
  14. package/src/get_characters_character_id_blueprints_ok.d.ts +27 -38
  15. package/src/get_characters_character_id_bookmarks_folders_ok.d.ts +10 -13
  16. package/src/get_characters_character_id_bookmarks_ok.d.ts +47 -63
  17. package/src/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +6 -8
  18. package/src/get_characters_character_id_calendar_event_id_ok.d.ts +38 -48
  19. package/src/get_characters_character_id_calendar_ok.d.ts +18 -23
  20. package/src/get_characters_character_id_clones_ok.d.ts +32 -44
  21. package/src/get_characters_character_id_contacts_labels_ok.d.ts +10 -13
  22. package/src/get_characters_character_id_contacts_ok.d.ts +24 -34
  23. package/src/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +18 -23
  24. package/src/get_characters_character_id_contracts_contract_id_items_ok.d.ts +23 -33
  25. package/src/get_characters_character_id_contracts_ok.d.ts +78 -98
  26. package/src/get_characters_character_id_corporationhistory_ok.d.ts +18 -23
  27. package/src/get_characters_character_id_fatigue_ok.d.ts +14 -18
  28. package/src/get_characters_character_id_fittings_ok.d.ts +20 -33
  29. package/src/get_characters_character_id_fleet_ok.d.ts +14 -18
  30. package/src/get_characters_character_id_fw_stats_ok.d.ts +42 -53
  31. package/src/get_characters_character_id_implants_ok.d.ts +3 -8
  32. package/src/get_characters_character_id_industry_jobs_ok.d.ts +80 -108
  33. package/src/get_characters_character_id_killmails_recent_ok.d.ts +10 -13
  34. package/src/get_characters_character_id_location_ok.d.ts +14 -18
  35. package/src/get_characters_character_id_loyalty_points_ok.d.ts +10 -13
  36. package/src/get_characters_character_id_mail_labels_ok.d.ts +18 -23
  37. package/src/get_characters_character_id_mail_lists_ok.d.ts +10 -13
  38. package/src/get_characters_character_id_mail_mail_id_ok.d.ts +32 -44
  39. package/src/get_characters_character_id_mail_ok.d.ts +32 -44
  40. package/src/get_characters_character_id_medals_ok.d.ts +46 -58
  41. package/src/get_characters_character_id_mining_ok.d.ts +15 -23
  42. package/src/get_characters_character_id_notifications_contacts_ok.d.ts +22 -28
  43. package/src/get_characters_character_id_notifications_ok.d.ts +22 -28
  44. package/src/get_characters_character_id_ok.d.ts +42 -53
  45. package/src/get_characters_character_id_online_ok.d.ts +18 -23
  46. package/src/get_characters_character_id_opportunities_ok.d.ts +10 -13
  47. package/src/get_characters_character_id_orders_history_ok.d.ts +51 -68
  48. package/src/get_characters_character_id_orders_ok.d.ts +51 -68
  49. package/src/get_characters_character_id_planets_ok.d.ts +26 -33
  50. package/src/get_characters_character_id_planets_planet_id_ok.d.ts +111 -151
  51. package/src/get_characters_character_id_portrait_ok.d.ts +18 -23
  52. package/src/get_characters_character_id_roles_ok.d.ts +2 -3
  53. package/src/get_characters_character_id_search_ok.d.ts +63 -124
  54. package/src/get_characters_character_id_ship_ok.d.ts +11 -18
  55. package/src/get_characters_character_id_skillqueue_ok.d.ts +34 -43
  56. package/src/get_characters_character_id_skills_ok.d.ts +26 -33
  57. package/src/get_characters_character_id_standings_ok.d.ts +10 -13
  58. package/src/get_characters_character_id_titles_ok.d.ts +10 -13
  59. package/src/get_characters_character_id_wallet_journal_ok.d.ts +46 -58
  60. package/src/get_characters_character_id_wallet_ok.d.ts +2 -3
  61. package/src/get_characters_character_id_wallet_transactions_ok.d.ts +39 -53
  62. package/src/get_contracts_public_bids_contract_id_ok.d.ts +14 -18
  63. package/src/get_contracts_public_items_contract_id_ok.d.ts +35 -48
  64. package/src/get_contracts_public_region_id_ok.d.ts +62 -78
  65. package/src/get_corporation_corporation_id_mining_extractions_ok.d.ts +25 -31
  66. package/src/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +21 -30
  67. package/src/get_corporation_corporation_id_mining_observers_ok.d.ts +11 -14
  68. package/src/get_corporations_corporation_id_alliancehistory_ok.d.ts +18 -23
  69. package/src/get_corporations_corporation_id_assets_ok.d.ts +23 -33
  70. package/src/get_corporations_corporation_id_blueprints_ok.d.ts +27 -38
  71. package/src/get_corporations_corporation_id_bookmarks_folders_ok.d.ts +14 -18
  72. package/src/get_corporations_corporation_id_bookmarks_ok.d.ts +47 -63
  73. package/src/get_corporations_corporation_id_contacts_labels_ok.d.ts +10 -13
  74. package/src/get_corporations_corporation_id_contacts_ok.d.ts +20 -29
  75. package/src/get_corporations_corporation_id_containers_logs_ok.d.ts +32 -48
  76. package/src/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +18 -23
  77. package/src/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +23 -33
  78. package/src/get_corporations_corporation_id_contracts_ok.d.ts +78 -98
  79. package/src/get_corporations_corporation_id_customs_offices_ok.d.ts +54 -68
  80. package/src/get_corporations_corporation_id_divisions_ok.d.ts +18 -23
  81. package/src/get_corporations_corporation_id_facilities_ok.d.ts +11 -18
  82. package/src/get_corporations_corporation_id_fw_stats_ok.d.ts +38 -48
  83. package/src/get_corporations_corporation_id_icons_ok.d.ts +14 -18
  84. package/src/get_corporations_corporation_id_industry_jobs_ok.d.ts +80 -108
  85. package/src/get_corporations_corporation_id_killmails_recent_ok.d.ts +10 -13
  86. package/src/get_corporations_corporation_id_medals_issued_ok.d.ts +22 -28
  87. package/src/get_corporations_corporation_id_medals_ok.d.ts +22 -28
  88. package/src/get_corporations_corporation_id_members_limit_ok.d.ts +2 -3
  89. package/src/get_corporations_corporation_id_members_ok.d.ts +3 -8
  90. package/src/get_corporations_corporation_id_members_titles_ok.d.ts +144 -147
  91. package/src/get_corporations_corporation_id_membertracking_ok.d.ts +27 -38
  92. package/src/get_corporations_corporation_id_ok.d.ts +58 -73
  93. package/src/get_corporations_corporation_id_orders_history_ok.d.ts +55 -73
  94. package/src/get_corporations_corporation_id_orders_ok.d.ts +55 -73
  95. package/src/get_corporations_corporation_id_roles_history_ok.d.ts +14 -18
  96. package/src/get_corporations_corporation_id_roles_ok.d.ts +6 -8
  97. package/src/get_corporations_corporation_id_shareholders_ok.d.ts +10 -13
  98. package/src/get_corporations_corporation_id_standings_ok.d.ts +10 -13
  99. package/src/get_corporations_corporation_id_starbases_ok.d.ts +27 -38
  100. package/src/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +35 -48
  101. package/src/get_corporations_corporation_id_structures_ok.d.ts +55 -73
  102. package/src/get_corporations_corporation_id_titles_ok.d.ts +10 -13
  103. package/src/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +46 -58
  104. package/src/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +35 -48
  105. package/src/get_corporations_corporation_id_wallets_ok.d.ts +10 -13
  106. package/src/get_corporations_npccorps_ok.d.ts +3 -8
  107. package/src/get_dogma_attributes_attribute_id_ok.d.ts +42 -53
  108. package/src/get_dogma_attributes_ok.d.ts +3 -8
  109. package/src/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +24 -38
  110. package/src/get_dogma_effects_effect_id_ok.d.ts +106 -133
  111. package/src/get_dogma_effects_ok.d.ts +3 -8
  112. package/src/get_fleets_fleet_id_members_ok.d.ts +35 -48
  113. package/src/get_fleets_fleet_id_ok.d.ts +18 -23
  114. package/src/get_fleets_fleet_id_wings_ok.d.ts +18 -23
  115. package/src/get_fw_leaderboards_characters_ok.d.ts +50 -63
  116. package/src/get_fw_leaderboards_corporations_ok.d.ts +50 -63
  117. package/src/get_fw_leaderboards_ok.d.ts +50 -63
  118. package/src/get_fw_stats_ok.d.ts +38 -48
  119. package/src/get_fw_systems_ok.d.ts +22 -28
  120. package/src/get_fw_wars_ok.d.ts +10 -13
  121. package/src/get_incursions_ok.d.ts +29 -44
  122. package/src/get_industry_facilities_ok.d.ts +23 -33
  123. package/src/get_industry_systems_ok.d.ts +10 -13
  124. package/src/get_insurance_prices_ok.d.ts +15 -23
  125. package/src/get_killmails_killmail_id_killmail_hash_ok.d.ts +128 -180
  126. package/src/get_loyalty_stores_corporation_id_offers_ok.d.ts +28 -43
  127. package/src/get_markets_groups_market_group_id_ok.d.ts +19 -34
  128. package/src/get_markets_groups_ok.d.ts +3 -8
  129. package/src/get_markets_prices_ok.d.ts +11 -18
  130. package/src/get_markets_region_id_history_ok.d.ts +26 -33
  131. package/src/get_markets_region_id_orders_ok.d.ts +43 -58
  132. package/src/get_markets_region_id_types_ok.d.ts +3 -8
  133. package/src/get_markets_structures_structure_id_ok.d.ts +39 -53
  134. package/src/get_opportunities_groups_group_id_ok.d.ts +30 -45
  135. package/src/get_opportunities_groups_ok.d.ts +3 -8
  136. package/src/get_opportunities_tasks_ok.d.ts +3 -8
  137. package/src/get_opportunities_tasks_task_id_ok.d.ts +18 -23
  138. package/src/get_route_origin_destination_ok.d.ts +3 -8
  139. package/src/get_sovereignty_campaigns_ok.d.ts +49 -60
  140. package/src/get_sovereignty_map_ok.d.ts +18 -23
  141. package/src/get_sovereignty_structures_ok.d.ts +32 -44
  142. package/src/get_status_ok.d.ts +18 -23
  143. package/src/get_universe_ancestries_ok.d.ts +26 -33
  144. package/src/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +22 -28
  145. package/src/get_universe_bloodlines_ok.d.ts +43 -58
  146. package/src/get_universe_categories_category_id_ok.d.ts +20 -29
  147. package/src/get_universe_categories_ok.d.ts +3 -8
  148. package/src/get_universe_constellations_constellation_id_ok.d.ts +32 -44
  149. package/src/get_universe_constellations_ok.d.ts +3 -8
  150. package/src/get_universe_factions_ok.d.ts +42 -53
  151. package/src/get_universe_graphics_graphic_id_ok.d.ts +34 -43
  152. package/src/get_universe_graphics_ok.d.ts +3 -8
  153. package/src/get_universe_groups_group_id_ok.d.ts +19 -34
  154. package/src/get_universe_groups_ok.d.ts +3 -8
  155. package/src/get_universe_moons_moon_id_ok.d.ts +26 -33
  156. package/src/get_universe_planets_planet_id_ok.d.ts +27 -38
  157. package/src/get_universe_races_ok.d.ts +18 -23
  158. package/src/get_universe_regions_ok.d.ts +3 -8
  159. package/src/get_universe_regions_region_id_ok.d.ts +20 -29
  160. package/src/get_universe_schematics_schematic_id_ok.d.ts +10 -13
  161. package/src/get_universe_stargates_stargate_id_ok.d.ts +35 -48
  162. package/src/get_universe_stars_star_id_ok.d.ts +27 -38
  163. package/src/get_universe_stations_station_id_ok.d.ts +51 -68
  164. package/src/get_universe_structures_ok.d.ts +3 -8
  165. package/src/get_universe_structures_structure_id_ok.d.ts +27 -38
  166. package/src/get_universe_system_jumps_ok.d.ts +10 -13
  167. package/src/get_universe_system_kills_ok.d.ts +18 -23
  168. package/src/get_universe_systems_ok.d.ts +3 -8
  169. package/src/get_universe_systems_system_id_ok.d.ts +66 -97
  170. package/src/get_universe_types_ok.d.ts +3 -8
  171. package/src/get_universe_types_type_id_ok.d.ts +71 -93
  172. package/src/get_wars_ok.d.ts +3 -8
  173. package/src/get_wars_war_id_killmails_ok.d.ts +10 -13
  174. package/src/get_wars_war_id_ok.d.ts +70 -88
  175. package/src/index.d.ts +42 -26
  176. package/src/post_characters_affiliation_ok.d.ts +18 -23
  177. package/src/post_characters_character_id_assets_locations_ok.d.ts +18 -23
  178. package/src/post_characters_character_id_assets_names_ok.d.ts +10 -13
  179. package/src/post_characters_character_id_contacts_created.d.ts +3 -8
  180. package/src/post_characters_character_id_cspa_created.d.ts +2 -3
  181. package/src/post_characters_character_id_fittings_created.d.ts +6 -8
  182. package/src/post_characters_character_id_mail_created.d.ts +2 -3
  183. package/src/post_characters_character_id_mail_labels_created.d.ts +2 -3
  184. package/src/post_corporations_corporation_id_assets_locations_ok.d.ts +18 -23
  185. package/src/post_corporations_corporation_id_assets_names_ok.d.ts +10 -13
  186. package/src/post_fleets_fleet_id_wings_created.d.ts +6 -8
  187. package/src/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +6 -8
  188. package/src/post_universe_ids_ok.d.ts +83 -238
  189. package/src/post_universe_names_ok.d.ts +10 -13
  190. package/tsconfig.json +1 -0
  191. package/esi-request.mts +0 -309
  192. package/src/post_characters_character_id_contacts_contact_ids.d.ts +0 -18
  193. package/src/post_characters_character_id_cspa_characters.d.ts +0 -18
  194. package/src/post_characters_character_id_fittings_fitting.d.ts +0 -101
  195. package/src/post_characters_character_id_mail_labels_label.d.ts +0 -39
  196. package/src/post_characters_character_id_mail_mail.d.ts +0 -53
  197. package/src/post_fleets_fleet_id_members_invitation.d.ts +0 -31
  198. package/src/post_ui_openwindow_newmail_new_mail.d.ts +0 -46
  199. package/src/put_characters_character_id_calendar_event_id_response.d.ts +0 -16
  200. package/src/put_characters_character_id_contacts_contact_ids.d.ts +0 -18
  201. package/src/put_characters_character_id_mail_mail_id_contents.d.ts +0 -27
  202. package/src/put_fleets_fleet_id_members_member_id_movement.d.ts +0 -30
  203. package/src/put_fleets_fleet_id_new_settings.d.ts +0 -21
  204. package/src/put_fleets_fleet_id_squads_squad_id_naming.d.ts +0 -16
  205. package/src/put_fleets_fleet_id_wings_wing_id_naming.d.ts +0 -16
package/README.md CHANGED
@@ -1,12 +1,38 @@
1
- # eve-esi-types
1
+ # eve-esi-types (version 1)
2
+
2
3
  Extracted the main type of ESI. Used for ESI request response types.
3
4
 
5
+ + Version 1 makes it somewhat easier to handle types,
6
+
7
+ but as a trade-off, it does not support query parameter completion etc.
8
+
4
9
  ## Usage
5
10
 
6
- > Sample code is provided -> [`esi-request.mjs`](./esi-request.mjs)
11
+ > This package is configured to use version 1 only.
12
+
13
+ + If you need to use version 2, please refer to the following link:
14
+ [eve-esi-types v2](https://github.com/jeffy-g/eve-esi-types)
7
15
 
8
16
 
17
+ > Sample code is provided -> [`esi-request.mjs`](./esi-request.mjs)
18
+
9
19
  ```shell
10
20
  $ node esi-request.mjs
11
21
  ```
22
+ ## API
12
23
 
24
+ > The following function signature allows you to benefit from `eve-esi-types`.
25
+ > By specifying the method (`get`, `post`, `put`, `delete`) for each `endpoint`,
26
+ > you can determine the result type of the ESI request.
27
+
28
+ ```ts
29
+ // function signature
30
+ export async function fire<
31
+ M extends TRequestMethod,
32
+ EP extends keyof TESIResponseOKMap[M],
33
+ Opt extends number | number[] | ESIRequestOptions,
34
+ R extends TESIResponseOKMap[M][EP]
35
+ >(
36
+ mthd: M, endp: EP, pathParams?: Opt, opt?: ESIRequestOptions
37
+ ): Promise<R>;
38
+ ```
@@ -0,0 +1,58 @@
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 "./src";
9
+ type TRequestMethod = "get" | "post" | "put" | "delete";
10
+ /**
11
+ * __{Header}.{Payload}.{Signature}__
12
+ */
13
+ type TAcccessToken = `${string}.${string}.${string}`;
14
+ type ESIRequestOptions = {
15
+ /**
16
+ * query params for ESI request.
17
+ */
18
+ query?: Record<string, any>;
19
+ /**
20
+ * will need it for `POST` request etc.
21
+ */
22
+ body?: any;
23
+ /**
24
+ * if want response data with ignore error then can be set to `true`.
25
+ */
26
+ ignoreError?: boolean;
27
+ /**
28
+ * cancel request immediately
29
+ */
30
+ cancelable?: AbortController;
31
+ /**
32
+ * Can be an empty object if no authentication is required.description
33
+ */
34
+ token?: TAcccessToken;
35
+ };
36
+ /**
37
+ * 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
42
+ *
43
+ * @param {M} mthd
44
+ * @param {EP} endp - The endpoint to request.
45
+ * @param {Opt} [pathParams] - Optional path parameters.
46
+ * @param {ESIRequestOptions} [opt] - default is empty object {}. `body` is json string
47
+ * @returns {Promise<R>} - The response from the endpoint.
48
+ * @throws
49
+ * @async
50
+ */
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>;
package/esi-request.mjs CHANGED
@@ -15,14 +15,15 @@ let LOG = false;
15
15
  const BASE = "https://esi.evetech.net";
16
16
  /**
17
17
  * @typedef {import("./src").TESIResponseOKMap} TESIResponseOKMap
18
+ * @typedef {`${string}.${string}.${string}`} TAcccessToken __{Header}.{Payload}.{Signature}__
18
19
  */
19
20
  /**
20
21
  * @typedef ESIRequestOptions
21
- * @prop {Record<string, any>} [queries] query params for ESI request.
22
+ * @prop {Record<string, any>} [query] query params for ESI request.
22
23
  * @prop {any} [body] will need it for `POST` request etc.
23
24
  * @prop {boolean} [ignoreError] if want response data with ignore error then can be set to `true`.
24
25
  * @prop {AbortController} [cancelable] cancel request immediately
25
- * @prop {string} [token] Can be an empty object if no authentication is required.description
26
+ * @prop {TAcccessToken} [token] Can be an empty object if no authentication is required.description
26
27
  */
27
28
  // - - - - - - - - - - - - - - - - - - - -
28
29
  // module vars, functions
@@ -120,11 +121,12 @@ const curl = (endp) => {
120
121
  * fire ESI request
121
122
  * @template {"get" | "post" | "put" | "delete"} M
122
123
  * @template {keyof TESIResponseOKMap[M]} EP
124
+ * @template {number | number[] | ESIRequestOptions} Opt
123
125
  * @template {TESIResponseOKMap[M][EP]} R
124
126
  *
125
127
  * @param {M} mthd
126
128
  * @param {EP} endp - The endpoint to request.
127
- * @param {number | number[] | ESIRequestOptions} [pathParams] - Optional path parameters.
129
+ * @param {Opt} [pathParams] - Optional path parameters.
128
130
  * @param {ESIRequestOptions} [opt] - default is empty object {}. `body` is json string
129
131
  * @returns {Promise<R>} - The response from the endpoint.
130
132
  * @throws
@@ -132,7 +134,8 @@ const curl = (endp) => {
132
134
  */
133
135
  export async function fire(mthd, endp, pathParams, opt = {}) {
134
136
  if (typeof pathParams === "number") {
135
- pathParams = /** @type {number[]} */ ([pathParams]);
137
+ // @ts-expect-error
138
+ pathParams = [pathParams];
136
139
  }
137
140
  if (isArray(pathParams)) {
138
141
  // @ts-ignore actualy endp is string
@@ -153,9 +156,9 @@ export async function fire(mthd, endp, pathParams, opt = {}) {
153
156
  const qss = {
154
157
  // language: "en",
155
158
  };
156
- if (opt.queries) {
159
+ if (opt.query) {
157
160
  // Object.assign(queries, options.queries); Object.assign is too slow
158
- const oqs = opt.queries;
161
+ const oqs = opt.query;
159
162
  for (const k of Object.keys(oqs)) {
160
163
  qss[k] = oqs[k];
161
164
  }
@@ -234,12 +237,45 @@ export async function fire(mthd, endp, pathParams, opt = {}) {
234
237
  }
235
238
  // It should complete correctly.
236
239
  async function getEVEStatus() {
240
+ try {
241
+ const ok = await fire("get", "/characters/{character_id}/ship/", 994562, {
242
+ // This token is completely random, but a simple check can be done with type TAcccessToken
243
+ token: "eyJhbGciOiJIjoiSldUIn0.YDbHqu0xPwtK5eTER7aPl8I0oYC.YDbHqu0xPwtK5eTER7aPl8I0oYC"
244
+ });
245
+ // query patameter `filter` is optional
246
+ // Version 1 makes it somewhat easier to handle types,
247
+ // but as a trade-off, it does not support query parameter completion.
248
+ await fire("get", "/universe/structures/", {
249
+ query: {
250
+ filter: "market"
251
+ }
252
+ });
253
+ // in this case, "categories" and "search" is required
254
+ await fire("get", "/characters/{character_id}/search/", 994562, {
255
+ query: {
256
+ categories: ["agent"],
257
+ search: "ok"
258
+ },
259
+ token: "eyJhbGciOiJIjoiSldUIn0.YDbHqu0xPwtK5eTER7aPl8I0oYC.YDbHqu0xPwtK5eTER7aPl8I0oYC"
260
+ });
261
+ // in this case, "order_type" is required
262
+ await fire("get", "/markets/{region_id}/orders/", 994562, {
263
+ query: {
264
+ order_type: "all"
265
+ },
266
+ });
267
+ // TODO: want TypeScript semantics to throw an error because there is a required query parameter, but it's not possible
268
+ await fire("get", "/characters/{character_id}/search/");
269
+ console.log(ok);
270
+ }
271
+ catch (error) {
272
+ console.error("Failed to get character ship -", error);
273
+ }
237
274
  return fire("get", "/status/");
238
275
  }
239
276
  // type following and run
240
- // tsc
241
- // then run
242
277
  // node esi-request.mjs
278
+ // or yarn test
243
279
  getEVEStatus().then(eveStatus => console.log(eveStatus));
244
280
  // {
245
281
  // "players": 16503,
package/package.json CHANGED
@@ -1,15 +1,24 @@
1
1
  {
2
2
  "name": "eve-esi-types",
3
- "version": "1.0.1",
4
- "description": "Extracted the main type of ESI. use for ESI request response types",
3
+ "version": "1.2.0",
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": {
7
- "test": "echo ok?"
7
+ "test": "node esi-request.mjs"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+ssh://git@github.com/jeffy-g/eve-esi-types.git"
12
12
  },
13
+ "files": [
14
+ "src",
15
+ "esi-request.mjs",
16
+ "esi-request.d.mts",
17
+ "LICENSE",
18
+ "*.md",
19
+ "package.json",
20
+ "tsconfig.json"
21
+ ],
13
22
  "keywords": [
14
23
  "eve",
15
24
  "esi",
@@ -1,15 +1,6 @@
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
1
+ /*!
2
+ * ESI endpoint: get:/alliances/{alliance_id}/contacts/labels/
11
3
  */
12
- type GetAlliancesAllianceIdContactsLabelsLabelName = string;
13
4
  /**
14
5
  * 200 ok array
15
6
  *
@@ -21,7 +12,13 @@ type GetAlliancesAllianceIdContactsLabelsOk = GetAlliancesAllianceIdContactsLabe
21
12
  * 200 ok object
22
13
  */
23
14
  interface GetAlliancesAllianceIdContactsLabels_200Ok {
24
- label_id: GetAlliancesAllianceIdContactsLabelsLabelId;
25
- label_name: GetAlliancesAllianceIdContactsLabelsLabelName;
15
+ /**
16
+ * label_id integer
17
+ */
18
+ label_id: number;
19
+ /**
20
+ * label_name string
21
+ */
22
+ label_name: string;
26
23
  [k: string]: unknown | undefined;
27
24
  }
@@ -1,29 +1,10 @@
1
- /**
2
- * ESI endpoint: /alliances/{alliance_id}/contacts/
3
- */
4
-
5
- /**
6
- * contact_id integer
1
+ /*!
2
+ * ESI endpoint: get:/alliances/{alliance_id}/contacts/
7
3
  */
8
- type GetAlliancesAllianceIdContactsContactId = number;
9
4
  /**
10
5
  * contact_type string
11
6
  */
12
7
  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
8
  /**
28
9
  * 200 ok array
29
10
  *
@@ -35,9 +16,20 @@ type GetAlliancesAllianceIdContactsOk = GetAlliancesAllianceIdContacts_200Ok[];
35
16
  * 200 ok object
36
17
  */
37
18
  interface GetAlliancesAllianceIdContacts_200Ok {
38
- contact_id: GetAlliancesAllianceIdContactsContactId;
19
+ /**
20
+ * contact_id integer
21
+ */
22
+ contact_id: number;
39
23
  contact_type: GetAlliancesAllianceIdContactsContactType;
40
- label_ids?: GetAlliancesAllianceIdContactsLabelIds;
41
- standing: GetAlliancesAllianceIdContactsStanding;
24
+ /**
25
+ * label_ids array
26
+ *
27
+ * @maxItems 63
28
+ */
29
+ label_ids?: number[];
30
+ /**
31
+ * Standing of the contact
32
+ */
33
+ standing: number;
42
34
  [k: string]: unknown | undefined;
43
35
  }
@@ -1,14 +1,9 @@
1
- /**
2
- * ESI endpoint: /alliances/{alliance_id}/corporations/
3
- */
4
-
5
- /**
6
- * 200 ok integer
1
+ /*!
2
+ * ESI endpoint: get:/alliances/{alliance_id}/corporations/
7
3
  */
8
- type GetAlliancesAllianceIdCorporations_200Ok = number;
9
4
  /**
10
5
  * 200 ok array
11
6
  *
12
7
  * @maxItems 1000
13
8
  */
14
- type GetAlliancesAllianceIdCorporationsOk = GetAlliancesAllianceIdCorporations_200Ok[];
9
+ type GetAlliancesAllianceIdCorporationsOk = number[];
@@ -1,21 +1,18 @@
1
- /**
2
- * ESI endpoint: /alliances/{alliance_id}/icons/
3
- */
4
-
5
- /**
6
- * px128x128 string
7
- */
8
- type GetAlliancesAllianceIdIconsPx128X128 = string;
9
- /**
10
- * px64x64 string
1
+ /*!
2
+ * ESI endpoint: get:/alliances/{alliance_id}/icons/
11
3
  */
12
- type GetAlliancesAllianceIdIconsPx64X64 = string;
13
4
 
14
5
  /**
15
6
  * 200 ok object
16
7
  */
17
8
  interface GetAlliancesAllianceIdIconsOk {
18
- px128x128?: GetAlliancesAllianceIdIconsPx128X128;
19
- px64x64?: GetAlliancesAllianceIdIconsPx64X64;
9
+ /**
10
+ * px128x128 string
11
+ */
12
+ px128x128?: string;
13
+ /**
14
+ * px64x64 string
15
+ */
16
+ px64x64?: string;
20
17
  [k: string]: unknown | undefined;
21
18
  }
@@ -1,46 +1,38 @@
1
- /**
2
- * ESI endpoint: /alliances/{alliance_id}/
3
- */
4
-
5
- /**
6
- * ID of the corporation that created the alliance
7
- */
8
- type GetAlliancesAllianceIdCreatorCorporationId = number;
9
- /**
10
- * ID of the character that created the alliance
11
- */
12
- type GetAlliancesAllianceIdCreatorId = number;
13
- /**
14
- * date_founded string
15
- */
16
- type GetAlliancesAllianceIdDateFounded = string;
17
- /**
18
- * the executor corporation ID, if this alliance is not closed
19
- */
20
- type GetAlliancesAllianceIdExecutorCorporationId = number;
21
- /**
22
- * Faction ID this alliance is fighting for, if this alliance is enlisted in factional warfare
23
- */
24
- type GetAlliancesAllianceIdFactionId = number;
25
- /**
26
- * the full name of the alliance
27
- */
28
- type GetAlliancesAllianceIdName = string;
29
- /**
30
- * the short name of the alliance
1
+ /*!
2
+ * ESI endpoint: get:/alliances/{alliance_id}/
31
3
  */
32
- type GetAlliancesAllianceIdTicker = string;
33
4
 
34
5
  /**
35
6
  * 200 ok object
36
7
  */
37
8
  interface GetAlliancesAllianceIdOk {
38
- creator_corporation_id: GetAlliancesAllianceIdCreatorCorporationId;
39
- creator_id: GetAlliancesAllianceIdCreatorId;
40
- date_founded: GetAlliancesAllianceIdDateFounded;
41
- executor_corporation_id?: GetAlliancesAllianceIdExecutorCorporationId;
42
- faction_id?: GetAlliancesAllianceIdFactionId;
43
- name: GetAlliancesAllianceIdName;
44
- ticker: GetAlliancesAllianceIdTicker;
9
+ /**
10
+ * ID of the corporation that created the alliance
11
+ */
12
+ creator_corporation_id: number;
13
+ /**
14
+ * ID of the character that created the alliance
15
+ */
16
+ creator_id: number;
17
+ /**
18
+ * date_founded string
19
+ */
20
+ date_founded: string;
21
+ /**
22
+ * the executor corporation ID, if this alliance is not closed
23
+ */
24
+ executor_corporation_id?: number;
25
+ /**
26
+ * Faction ID this alliance is fighting for, if this alliance is enlisted in factional warfare
27
+ */
28
+ faction_id?: number;
29
+ /**
30
+ * the full name of the alliance
31
+ */
32
+ name: string;
33
+ /**
34
+ * the short name of the alliance
35
+ */
36
+ ticker: string;
45
37
  [k: string]: unknown | undefined;
46
38
  }
@@ -1,14 +1,9 @@
1
- /**
2
- * ESI endpoint: /alliances/
3
- */
4
-
5
- /**
6
- * 200 ok integer
1
+ /*!
2
+ * ESI endpoint: get:/alliances/
7
3
  */
8
- type GetAlliances_200Ok = number;
9
4
  /**
10
5
  * 200 ok array
11
6
  *
12
7
  * @maxItems 5000
13
8
  */
14
- type GetAlliancesOk = GetAlliances_200Ok[];
9
+ type GetAlliancesOk = number[];
@@ -1,27 +1,6 @@
1
- /**
2
- * ESI endpoint: /characters/{character_id}/agents_research/
3
- */
4
-
5
- /**
6
- * agent_id integer
7
- */
8
- type GetCharactersCharacterIdAgentsResearchAgentId = number;
9
- /**
10
- * points_per_day number
11
- */
12
- type GetCharactersCharacterIdAgentsResearchPointsPerDay = number;
13
- /**
14
- * remainder_points number
15
- */
16
- type GetCharactersCharacterIdAgentsResearchRemainderPoints = number;
17
- /**
18
- * skill_type_id integer
19
- */
20
- type GetCharactersCharacterIdAgentsResearchSkillTypeId = number;
21
- /**
22
- * started_at string
1
+ /*!
2
+ * ESI endpoint: get:/characters/{character_id}/agents_research/
23
3
  */
24
- type GetCharactersCharacterIdAgentsResearchStartedAt = string;
25
4
  /**
26
5
  * 200 ok array
27
6
  *
@@ -33,10 +12,22 @@ type GetCharactersCharacterIdAgentsResearchOk = GetCharactersCharacterIdAgentsRe
33
12
  * 200 ok object
34
13
  */
35
14
  interface GetCharactersCharacterIdAgentsResearch_200Ok {
36
- agent_id: GetCharactersCharacterIdAgentsResearchAgentId;
37
- points_per_day: GetCharactersCharacterIdAgentsResearchPointsPerDay;
38
- remainder_points: GetCharactersCharacterIdAgentsResearchRemainderPoints;
39
- skill_type_id: GetCharactersCharacterIdAgentsResearchSkillTypeId;
40
- started_at: GetCharactersCharacterIdAgentsResearchStartedAt;
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;
41
32
  [k: string]: unknown | undefined;
42
33
  }
@@ -1,19 +1,6 @@
1
- /**
2
- * ESI endpoint: /characters/{character_id}/assets/
3
- */
4
-
5
- /**
6
- * is_blueprint_copy boolean
7
- */
8
- type GetCharactersCharacterIdAssetsIsBlueprintCopy = boolean;
9
- /**
10
- * is_singleton boolean
11
- */
12
- type GetCharactersCharacterIdAssetsIsSingleton = boolean;
13
- /**
14
- * item_id integer
1
+ /*!
2
+ * ESI endpoint: get:/characters/{character_id}/assets/
15
3
  */
16
- type GetCharactersCharacterIdAssetsItemId = number;
17
4
  /**
18
5
  * location_flag string
19
6
  */
@@ -105,22 +92,10 @@ type GetCharactersCharacterIdAssetsLocationFlag =
105
92
  | "SubSystemSlot7"
106
93
  | "Unlocked"
107
94
  | "Wardrobe";
108
- /**
109
- * location_id integer
110
- */
111
- type GetCharactersCharacterIdAssetsLocationId = number;
112
95
  /**
113
96
  * location_type string
114
97
  */
115
98
  type GetCharactersCharacterIdAssetsLocationType = "station" | "solar_system" | "item" | "other";
116
- /**
117
- * quantity integer
118
- */
119
- type GetCharactersCharacterIdAssetsQuantity = number;
120
- /**
121
- * type_id integer
122
- */
123
- type GetCharactersCharacterIdAssetsTypeId = number;
124
99
  /**
125
100
  * 200 ok array
126
101
  *
@@ -132,13 +107,28 @@ type GetCharactersCharacterIdAssetsOk = GetCharactersCharacterIdAssets_200Ok[];
132
107
  * 200 ok object
133
108
  */
134
109
  interface GetCharactersCharacterIdAssets_200Ok {
135
- is_blueprint_copy?: GetCharactersCharacterIdAssetsIsBlueprintCopy;
136
- is_singleton: GetCharactersCharacterIdAssetsIsSingleton;
137
- item_id: GetCharactersCharacterIdAssetsItemId;
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;
138
122
  location_flag: GetCharactersCharacterIdAssetsLocationFlag;
139
- location_id: GetCharactersCharacterIdAssetsLocationId;
123
+ /**
124
+ * location_id integer
125
+ */
126
+ location_id: number;
140
127
  location_type: GetCharactersCharacterIdAssetsLocationType;
141
- quantity: GetCharactersCharacterIdAssetsQuantity;
142
- type_id: GetCharactersCharacterIdAssetsTypeId;
128
+ /**
129
+ * quantity integer
130
+ */
131
+ quantity: number;
132
+ type_id: number;
143
133
  [k: string]: unknown | undefined;
144
134
  }
@@ -1,51 +1,42 @@
1
- /**
2
- * ESI endpoint: /characters/{character_id}/attributes/
3
- */
4
-
5
- /**
6
- * Neural remapping cooldown after a character uses remap accrued over time
7
- */
8
- type GetCharactersCharacterIdAttributesAccruedRemapCooldownDate = string;
9
- /**
10
- * Number of available bonus character neural remaps
11
- */
12
- type GetCharactersCharacterIdAttributesBonusRemaps = number;
13
- /**
14
- * charisma integer
15
- */
16
- type GetCharactersCharacterIdAttributesCharisma = number;
17
- /**
18
- * intelligence integer
19
- */
20
- type GetCharactersCharacterIdAttributesIntelligence = number;
21
- /**
22
- * Datetime of last neural remap, including usage of bonus remaps
23
- */
24
- type GetCharactersCharacterIdAttributesLastRemapDate = string;
25
- /**
26
- * memory integer
27
- */
28
- type GetCharactersCharacterIdAttributesMemory = number;
29
- /**
30
- * perception integer
31
- */
32
- type GetCharactersCharacterIdAttributesPerception = number;
33
- /**
34
- * willpower integer
1
+ /*!
2
+ * ESI endpoint: get:/characters/{character_id}/attributes/
35
3
  */
36
- type GetCharactersCharacterIdAttributesWillpower = number;
37
4
 
38
5
  /**
39
6
  * 200 ok object
40
7
  */
41
8
  interface GetCharactersCharacterIdAttributesOk {
42
- accrued_remap_cooldown_date?: GetCharactersCharacterIdAttributesAccruedRemapCooldownDate;
43
- bonus_remaps?: GetCharactersCharacterIdAttributesBonusRemaps;
44
- charisma: GetCharactersCharacterIdAttributesCharisma;
45
- intelligence: GetCharactersCharacterIdAttributesIntelligence;
46
- last_remap_date?: GetCharactersCharacterIdAttributesLastRemapDate;
47
- memory: GetCharactersCharacterIdAttributesMemory;
48
- perception: GetCharactersCharacterIdAttributesPerception;
49
- willpower: GetCharactersCharacterIdAttributesWillpower;
9
+ /**
10
+ * Neural remapping cooldown after a character uses remap accrued over time
11
+ */
12
+ accrued_remap_cooldown_date?: string;
13
+ /**
14
+ * Number of available bonus character neural remaps
15
+ */
16
+ bonus_remaps?: number;
17
+ /**
18
+ * charisma integer
19
+ */
20
+ charisma: number;
21
+ /**
22
+ * intelligence integer
23
+ */
24
+ intelligence: number;
25
+ /**
26
+ * Datetime of last neural remap, including usage of bonus remaps
27
+ */
28
+ last_remap_date?: string;
29
+ /**
30
+ * memory integer
31
+ */
32
+ memory: number;
33
+ /**
34
+ * perception integer
35
+ */
36
+ perception: number;
37
+ /**
38
+ * willpower integer
39
+ */
40
+ willpower: number;
50
41
  [k: string]: unknown | undefined;
51
42
  }