eve-esi-types 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +1 -1
  2. package/package.json +3 -1
  3. package/rq-util.d.mts +84 -0
  4. package/rq-util.mjs +107 -0
  5. package/v2/get_alliances_alliance_id_contacts_labels_ok.d.ts +1 -1
  6. package/v2/get_alliances_alliance_id_contacts_ok.d.ts +1 -1
  7. package/v2/get_alliances_alliance_id_corporations_ok.d.ts +1 -1
  8. package/v2/get_alliances_alliance_id_icons_ok.d.ts +1 -1
  9. package/v2/get_alliances_alliance_id_ok.d.ts +1 -1
  10. package/v2/get_alliances_ok.d.ts +1 -1
  11. package/v2/get_characters_character_id_agents_research_ok.d.ts +1 -1
  12. package/v2/get_characters_character_id_assets_ok.d.ts +1 -1
  13. package/v2/get_characters_character_id_attributes_ok.d.ts +1 -1
  14. package/v2/get_characters_character_id_blueprints_ok.d.ts +1 -1
  15. package/v2/get_characters_character_id_bookmarks_folders_ok.d.ts +1 -1
  16. package/v2/get_characters_character_id_bookmarks_ok.d.ts +1 -1
  17. package/v2/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +1 -1
  18. package/v2/get_characters_character_id_calendar_event_id_ok.d.ts +1 -1
  19. package/v2/get_characters_character_id_calendar_ok.d.ts +1 -1
  20. package/v2/get_characters_character_id_clones_ok.d.ts +1 -1
  21. package/v2/get_characters_character_id_contacts_labels_ok.d.ts +1 -1
  22. package/v2/get_characters_character_id_contacts_ok.d.ts +1 -1
  23. package/v2/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +1 -1
  24. package/v2/get_characters_character_id_contracts_contract_id_items_ok.d.ts +1 -1
  25. package/v2/get_characters_character_id_contracts_ok.d.ts +1 -1
  26. package/v2/get_characters_character_id_corporationhistory_ok.d.ts +1 -1
  27. package/v2/get_characters_character_id_fatigue_ok.d.ts +1 -1
  28. package/v2/get_characters_character_id_fittings_ok.d.ts +1 -1
  29. package/v2/get_characters_character_id_fleet_ok.d.ts +1 -1
  30. package/v2/get_characters_character_id_fw_stats_ok.d.ts +1 -1
  31. package/v2/get_characters_character_id_implants_ok.d.ts +1 -1
  32. package/v2/get_characters_character_id_industry_jobs_ok.d.ts +1 -1
  33. package/v2/get_characters_character_id_killmails_recent_ok.d.ts +1 -1
  34. package/v2/get_characters_character_id_location_ok.d.ts +1 -1
  35. package/v2/get_characters_character_id_loyalty_points_ok.d.ts +1 -1
  36. package/v2/get_characters_character_id_mail_labels_ok.d.ts +1 -1
  37. package/v2/get_characters_character_id_mail_lists_ok.d.ts +1 -1
  38. package/v2/get_characters_character_id_mail_mail_id_ok.d.ts +1 -1
  39. package/v2/get_characters_character_id_mail_ok.d.ts +1 -1
  40. package/v2/get_characters_character_id_medals_ok.d.ts +1 -1
  41. package/v2/get_characters_character_id_mining_ok.d.ts +1 -1
  42. package/v2/get_characters_character_id_notifications_contacts_ok.d.ts +1 -1
  43. package/v2/get_characters_character_id_notifications_ok.d.ts +1 -1
  44. package/v2/get_characters_character_id_ok.d.ts +1 -1
  45. package/v2/get_characters_character_id_online_ok.d.ts +1 -1
  46. package/v2/get_characters_character_id_opportunities_ok.d.ts +1 -1
  47. package/v2/get_characters_character_id_orders_history_ok.d.ts +1 -1
  48. package/v2/get_characters_character_id_orders_ok.d.ts +1 -1
  49. package/v2/get_characters_character_id_planets_ok.d.ts +1 -1
  50. package/v2/get_characters_character_id_planets_planet_id_ok.d.ts +1 -1
  51. package/v2/get_characters_character_id_portrait_ok.d.ts +1 -1
  52. package/v2/get_characters_character_id_roles_ok.d.ts +1 -1
  53. package/v2/get_characters_character_id_search_ok.d.ts +1 -1
  54. package/v2/get_characters_character_id_ship_ok.d.ts +1 -1
  55. package/v2/get_characters_character_id_skillqueue_ok.d.ts +1 -1
  56. package/v2/get_characters_character_id_skills_ok.d.ts +1 -1
  57. package/v2/get_characters_character_id_standings_ok.d.ts +1 -1
  58. package/v2/get_characters_character_id_titles_ok.d.ts +1 -1
  59. package/v2/get_characters_character_id_wallet_journal_ok.d.ts +1 -1
  60. package/v2/get_characters_character_id_wallet_ok.d.ts +1 -1
  61. package/v2/get_characters_character_id_wallet_transactions_ok.d.ts +1 -1
  62. package/v2/get_contracts_public_bids_contract_id_ok.d.ts +1 -1
  63. package/v2/get_contracts_public_items_contract_id_ok.d.ts +1 -1
  64. package/v2/get_contracts_public_region_id_ok.d.ts +1 -1
  65. package/v2/get_corporation_corporation_id_mining_extractions_ok.d.ts +1 -1
  66. package/v2/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +1 -1
  67. package/v2/get_corporation_corporation_id_mining_observers_ok.d.ts +1 -1
  68. package/v2/get_corporations_corporation_id_alliancehistory_ok.d.ts +1 -1
  69. package/v2/get_corporations_corporation_id_assets_ok.d.ts +1 -1
  70. package/v2/get_corporations_corporation_id_blueprints_ok.d.ts +1 -1
  71. package/v2/get_corporations_corporation_id_bookmarks_folders_ok.d.ts +1 -1
  72. package/v2/get_corporations_corporation_id_bookmarks_ok.d.ts +1 -1
  73. package/v2/get_corporations_corporation_id_contacts_labels_ok.d.ts +1 -1
  74. package/v2/get_corporations_corporation_id_contacts_ok.d.ts +1 -1
  75. package/v2/get_corporations_corporation_id_containers_logs_ok.d.ts +1 -1
  76. package/v2/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +1 -1
  77. package/v2/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +1 -1
  78. package/v2/get_corporations_corporation_id_contracts_ok.d.ts +1 -1
  79. package/v2/get_corporations_corporation_id_customs_offices_ok.d.ts +1 -1
  80. package/v2/get_corporations_corporation_id_divisions_ok.d.ts +1 -1
  81. package/v2/get_corporations_corporation_id_facilities_ok.d.ts +1 -1
  82. package/v2/get_corporations_corporation_id_fw_stats_ok.d.ts +1 -1
  83. package/v2/get_corporations_corporation_id_icons_ok.d.ts +1 -1
  84. package/v2/get_corporations_corporation_id_industry_jobs_ok.d.ts +1 -1
  85. package/v2/get_corporations_corporation_id_killmails_recent_ok.d.ts +1 -1
  86. package/v2/get_corporations_corporation_id_medals_issued_ok.d.ts +1 -1
  87. package/v2/get_corporations_corporation_id_medals_ok.d.ts +1 -1
  88. package/v2/get_corporations_corporation_id_members_limit_ok.d.ts +1 -1
  89. package/v2/get_corporations_corporation_id_members_ok.d.ts +1 -1
  90. package/v2/get_corporations_corporation_id_members_titles_ok.d.ts +1 -1
  91. package/v2/get_corporations_corporation_id_membertracking_ok.d.ts +1 -1
  92. package/v2/get_corporations_corporation_id_ok.d.ts +1 -1
  93. package/v2/get_corporations_corporation_id_orders_history_ok.d.ts +1 -1
  94. package/v2/get_corporations_corporation_id_orders_ok.d.ts +1 -1
  95. package/v2/get_corporations_corporation_id_roles_history_ok.d.ts +1 -1
  96. package/v2/get_corporations_corporation_id_roles_ok.d.ts +1 -1
  97. package/v2/get_corporations_corporation_id_shareholders_ok.d.ts +1 -1
  98. package/v2/get_corporations_corporation_id_standings_ok.d.ts +1 -1
  99. package/v2/get_corporations_corporation_id_starbases_ok.d.ts +1 -1
  100. package/v2/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +1 -1
  101. package/v2/get_corporations_corporation_id_structures_ok.d.ts +1 -1
  102. package/v2/get_corporations_corporation_id_titles_ok.d.ts +1 -1
  103. package/v2/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +1 -1
  104. package/v2/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +1 -1
  105. package/v2/get_corporations_corporation_id_wallets_ok.d.ts +1 -1
  106. package/v2/get_corporations_npccorps_ok.d.ts +1 -1
  107. package/v2/get_dogma_attributes_attribute_id_ok.d.ts +1 -1
  108. package/v2/get_dogma_attributes_ok.d.ts +1 -1
  109. package/v2/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +1 -1
  110. package/v2/get_dogma_effects_effect_id_ok.d.ts +1 -1
  111. package/v2/get_dogma_effects_ok.d.ts +1 -1
  112. package/v2/get_fleets_fleet_id_members_ok.d.ts +1 -1
  113. package/v2/get_fleets_fleet_id_ok.d.ts +1 -1
  114. package/v2/get_fleets_fleet_id_wings_ok.d.ts +1 -1
  115. package/v2/get_fw_leaderboards_characters_ok.d.ts +1 -1
  116. package/v2/get_fw_leaderboards_corporations_ok.d.ts +1 -1
  117. package/v2/get_fw_leaderboards_ok.d.ts +1 -1
  118. package/v2/get_fw_stats_ok.d.ts +1 -1
  119. package/v2/get_fw_systems_ok.d.ts +1 -1
  120. package/v2/get_fw_wars_ok.d.ts +1 -1
  121. package/v2/get_incursions_ok.d.ts +1 -1
  122. package/v2/get_industry_facilities_ok.d.ts +1 -1
  123. package/v2/get_industry_systems_ok.d.ts +1 -1
  124. package/v2/get_insurance_prices_ok.d.ts +1 -1
  125. package/v2/get_killmails_killmail_id_killmail_hash_ok.d.ts +1 -1
  126. package/v2/get_loyalty_stores_corporation_id_offers_ok.d.ts +1 -1
  127. package/v2/get_markets_groups_market_group_id_ok.d.ts +1 -1
  128. package/v2/get_markets_groups_ok.d.ts +1 -1
  129. package/v2/get_markets_prices_ok.d.ts +1 -1
  130. package/v2/get_markets_region_id_history_ok.d.ts +1 -1
  131. package/v2/get_markets_region_id_orders_ok.d.ts +1 -1
  132. package/v2/get_markets_region_id_types_ok.d.ts +1 -1
  133. package/v2/get_markets_structures_structure_id_ok.d.ts +1 -1
  134. package/v2/get_opportunities_groups_group_id_ok.d.ts +1 -1
  135. package/v2/get_opportunities_groups_ok.d.ts +1 -1
  136. package/v2/get_opportunities_tasks_ok.d.ts +1 -1
  137. package/v2/get_opportunities_tasks_task_id_ok.d.ts +1 -1
  138. package/v2/get_route_origin_destination_ok.d.ts +1 -1
  139. package/v2/get_sovereignty_campaigns_ok.d.ts +1 -1
  140. package/v2/get_sovereignty_map_ok.d.ts +1 -1
  141. package/v2/get_sovereignty_structures_ok.d.ts +1 -1
  142. package/v2/get_status_ok.d.ts +1 -1
  143. package/v2/get_universe_ancestries_ok.d.ts +1 -1
  144. package/v2/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +1 -1
  145. package/v2/get_universe_bloodlines_ok.d.ts +1 -1
  146. package/v2/get_universe_categories_category_id_ok.d.ts +1 -1
  147. package/v2/get_universe_categories_ok.d.ts +1 -1
  148. package/v2/get_universe_constellations_constellation_id_ok.d.ts +1 -1
  149. package/v2/get_universe_constellations_ok.d.ts +1 -1
  150. package/v2/get_universe_factions_ok.d.ts +1 -1
  151. package/v2/get_universe_graphics_graphic_id_ok.d.ts +1 -1
  152. package/v2/get_universe_graphics_ok.d.ts +1 -1
  153. package/v2/get_universe_groups_group_id_ok.d.ts +1 -1
  154. package/v2/get_universe_groups_ok.d.ts +1 -1
  155. package/v2/get_universe_moons_moon_id_ok.d.ts +1 -1
  156. package/v2/get_universe_planets_planet_id_ok.d.ts +1 -1
  157. package/v2/get_universe_races_ok.d.ts +1 -1
  158. package/v2/get_universe_regions_ok.d.ts +1 -1
  159. package/v2/get_universe_regions_region_id_ok.d.ts +1 -1
  160. package/v2/get_universe_schematics_schematic_id_ok.d.ts +1 -1
  161. package/v2/get_universe_stargates_stargate_id_ok.d.ts +1 -1
  162. package/v2/get_universe_stars_star_id_ok.d.ts +1 -1
  163. package/v2/get_universe_stations_station_id_ok.d.ts +1 -1
  164. package/v2/get_universe_structures_ok.d.ts +1 -1
  165. package/v2/get_universe_structures_structure_id_ok.d.ts +1 -1
  166. package/v2/get_universe_system_jumps_ok.d.ts +1 -1
  167. package/v2/get_universe_system_kills_ok.d.ts +1 -1
  168. package/v2/get_universe_systems_ok.d.ts +1 -1
  169. package/v2/get_universe_systems_system_id_ok.d.ts +1 -1
  170. package/v2/get_universe_types_ok.d.ts +1 -1
  171. package/v2/get_universe_types_type_id_ok.d.ts +1 -1
  172. package/v2/get_wars_ok.d.ts +1 -1
  173. package/v2/get_wars_war_id_killmails_ok.d.ts +1 -1
  174. package/v2/get_wars_war_id_ok.d.ts +1 -1
  175. package/v2/index.d.ts +166 -36
  176. package/v2/post_characters_affiliation_ok.d.ts +1 -1
  177. package/v2/post_characters_character_id_assets_locations_ok.d.ts +1 -1
  178. package/v2/post_characters_character_id_assets_names_ok.d.ts +1 -1
  179. package/v2/post_characters_character_id_contacts_created.d.ts +1 -1
  180. package/v2/post_characters_character_id_cspa_created.d.ts +1 -1
  181. package/v2/post_characters_character_id_fittings_created.d.ts +1 -1
  182. package/v2/post_characters_character_id_mail_created.d.ts +1 -1
  183. package/v2/post_characters_character_id_mail_labels_created.d.ts +1 -1
  184. package/v2/post_corporations_corporation_id_assets_locations_ok.d.ts +1 -1
  185. package/v2/post_corporations_corporation_id_assets_names_ok.d.ts +1 -1
  186. package/v2/post_fleets_fleet_id_wings_created.d.ts +1 -1
  187. package/v2/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +1 -1
  188. package/v2/post_universe_ids_ok.d.ts +1 -1
  189. package/v2/post_universe_names_ok.d.ts +1 -1
  190. package/v2.d.mts +1 -27
  191. package/v2.mjs +4 -88
  192. package/v2/post_fleets_fleet_id_members_invitation.d.ts +0 -27
  193. package/v2/post_ui_openwindow_newmail_new_mail.d.ts +0 -40
  194. package/v2/put_characters_character_id_calendar_event_id_response.d.ts +0 -15
  195. package/v2/put_characters_character_id_contacts_contact_ids.d.ts +0 -16
  196. package/v2/put_characters_character_id_mail_mail_id_contents.d.ts +0 -20
  197. package/v2/put_fleets_fleet_id_members_member_id_movement.d.ts +0 -27
  198. package/v2/put_fleets_fleet_id_new_settings.d.ts +0 -18
  199. package/v2/put_fleets_fleet_id_squads_squad_id_naming.d.ts +0 -14
  200. package/v2/put_fleets_fleet_id_wings_wing_id_naming.d.ts +0 -14
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/affiliation/
2
+ * ESI endpoint: post:/characters/affiliation/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/assets/locations/
2
+ * ESI endpoint: post:/characters/{character_id}/assets/locations/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/assets/names/
2
+ * ESI endpoint: post:/characters/{character_id}/assets/names/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/contacts/
2
+ * ESI endpoint: post:/characters/{character_id}/contacts/
3
3
  */
4
4
  /**
5
5
  * 201 created array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/cspa/
2
+ * ESI endpoint: post:/characters/{character_id}/cspa/
3
3
  */
4
4
  /**
5
5
  * 201 created number
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/fittings/
2
+ * ESI endpoint: post:/characters/{character_id}/fittings/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mail/
2
+ * ESI endpoint: post:/characters/{character_id}/mail/
3
3
  */
4
4
  /**
5
5
  * Mail ID
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /characters/{character_id}/mail/labels/
2
+ * ESI endpoint: post:/characters/{character_id}/mail/labels/
3
3
  */
4
4
  /**
5
5
  * Label ID
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /corporations/{corporation_id}/assets/locations/
2
+ * ESI endpoint: post:/corporations/{corporation_id}/assets/locations/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /corporations/{corporation_id}/assets/names/
2
+ * ESI endpoint: post:/corporations/{corporation_id}/assets/names/
3
3
  */
4
4
  /**
5
5
  * 200 ok array
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /fleets/{fleet_id}/wings/
2
+ * ESI endpoint: post:/fleets/{fleet_id}/wings/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /fleets/{fleet_id}/wings/{wing_id}/squads/
2
+ * ESI endpoint: post:/fleets/{fleet_id}/wings/{wing_id}/squads/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /universe/ids/
2
+ * ESI endpoint: post:/universe/ids/
3
3
  */
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ESI endpoint: /universe/names/
2
+ * ESI endpoint: post:/universe/names/
3
3
  */
4
4
  /**
5
5
  * category string
package/v2.d.mts CHANGED
@@ -6,33 +6,7 @@
6
6
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7
7
  */
8
8
  import type { TESIResponseOKMap } from "./v2";
9
- /**
10
- * __{Header}.{Payload}.{Signature}__
11
- */
12
- type TAcccessToken = `${string}.${string}.${string}`;
13
- type ESIRequestOptions = {
14
- /**
15
- * query params for ESI request.
16
- */
17
- query?: Record<string, any>;
18
- /**
19
- * will need it for `POST` request etc.
20
- */
21
- body?: any;
22
- /**
23
- * if want response data with ignore error then can be set to `true`.
24
- */
25
- ignoreError?: boolean;
26
- /**
27
- * cancel request immediately
28
- */
29
- cancelable?: AbortController;
30
- /**
31
- * Can be an empty object if no authentication is required.description
32
- */
33
- token?: TAcccessToken;
34
- auth?: true;
35
- };
9
+ import { type ESIRequestOptions } from "./rq-util.mjs";
36
10
  /**
37
11
  * fire ESI request
38
12
  * @template {TESIEntryMethod} M
package/v2.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  // import type { TESIResponseOKMap } from "eve-esi-types";
2
+ import { curl, replaceCbt, fetchP, ESIRequesError, ESIErrorLimitReachedError } from "./rq-util.mjs";
2
3
  // - - - - - - - - - - - - - - - - - - - -
3
4
  // constants, types
4
5
  // - - - - - - - - - - - - - - - - - - - -
@@ -9,10 +10,6 @@ const isArray = Array.isArray;
9
10
  * enable/disable console.log
10
11
  */
11
12
  let LOG = false;
12
- /**
13
- * this always `https://esi.evetech.net`
14
- */
15
- const BASE = "https://esi.evetech.net";
16
13
  /**
17
14
  * @typedef {import("./v2").TESIResponseOKMap} TESIResponseOKMap
18
15
  */
@@ -22,7 +19,7 @@ const BASE = "https://esi.evetech.net";
22
19
  * @prop {Record<string, any>} [query] query params for ESI request.
23
20
  * @prop {any} [body] will need it for `POST` request etc.
24
21
  * @prop {true=} [auth] Can be an empty object if no authentication is required.description
25
- * @prop {string} [token] Can be an empty object if no authentication is required.description
22
+ * @prop {TAcccessToken} [token] Can be an empty object if no authentication is required.description
26
23
  * @prop {boolean} [ignoreError] if want response data with ignore error then can be set to `true`.
27
24
  * @prop {AbortController} [cancelable] cancel request immediately
28
25
  */
@@ -33,88 +30,7 @@ const BASE = "https://esi.evetech.net";
33
30
  * Get the number of currently executing ESI requests
34
31
  */
35
32
  let ax = 0;
36
- /**
37
- * simple named error class.
38
- */
39
- class ESIRequesError extends Error {
40
- }
41
- /**
42
- * throws when x-esi-error-limit-remain header value is "0". (http status: 420)
43
- */
44
- class ESIErrorLimitReachedError extends Error {
45
- constructor() {
46
- super("Cannot continue ESI request because 'x-esi-error-limit-remain' is zero!");
47
- }
48
- valueOf() {
49
- return 420;
50
- }
51
- }
52
- /**
53
- * fetch the extra pages
54
- *
55
- * + if the `x-pages` header property ware more than 1
56
- *
57
- * @param {string} endpointUrl
58
- * @param {RequestInit} rqopt request options
59
- * @param {Record<string, any>} qs queries
60
- * @param {number} pc pageCount
61
- */
62
- const fetchP = async (endpointUrl, rqopt, qs, pc) => {
63
- const rqs = [];
64
- const rqp = new URLSearchParams(qs);
65
- for (let i = 2; i <= pc;) {
66
- rqp.set("page", (i++) + "");
67
- ax++;
68
- rqs.push(fetch(`${endpointUrl}?${rqp + ""}`, rqopt).then(res => res.json()).catch(reason => {
69
- console.warn(reason);
70
- return [];
71
- }).finally(() => {
72
- ax--;
73
- }));
74
- }
75
- return Promise.all(rqs).then(jsons => {
76
- // DEVNOTE: let check the page 2, type is array?
77
- if (isArray(jsons[0])) {
78
- let combined = [];
79
- for (let i = 0, end = jsons.length; i < end;) {
80
- combined = combined.concat(jsons[i++]);
81
- }
82
- return combined;
83
- }
84
- LOG && log("> > > pages result are object < < < --", jsons);
85
- return null;
86
- });
87
- };
88
- /** ### replace (C)urly (B)races (T)oken
89
- *
90
- * @example
91
- * "/characters/{character_id}/skills"
92
- * // ->
93
- * "/characters/<char.character_id>/skills"
94
- *
95
- * @param {string} endpoint e.g - "/characters/{character_id}/"
96
- * @param {number[]} ids
97
- * @returns fragment of qualified endpoint uri or null.
98
- */
99
- const replaceCbt = (endpoint, ids) => {
100
- const re = /{([\w]+)}/g;
101
- /** @type {RegExpExecArray?} */
102
- let m;
103
- let idx = 0;
104
- while (m = re.exec(endpoint)) {
105
- endpoint = endpoint.replace(m[0], ids[idx++] + "");
106
- }
107
- return endpoint;
108
- };
109
- /**
110
- *
111
- * @param {string} endp this means endpoint url fragment like `/characters/{character_id}/` or `/characters/{character_id}/agents_research/`
112
- * + The version parameter can be omitted by using `<version>/<endpoint>`
113
- */
114
- const curl = (endp) => {
115
- endp = endp.replace(/^\/+|\/+$/g, "");
116
- return `${BASE}/latest/${endp}/`;
117
- };
33
+ const incrementAx = (minus) => minus ? ax-- : ax++;
118
34
  // - - - - - - - - - - - - - - - - - - - -
119
35
  // main functions
120
36
  // - - - - - - - - - - - - - - - - - - - -
@@ -250,7 +166,7 @@ export async function fire(mthd, endp, pathParams, opt) {
250
166
  // has remaining pages? NaN > 1 === false !isNaN(pageCount)
251
167
  if (pc > 1) {
252
168
  LOG && log('found "x-pages" header, pages: %d', pc);
253
- const remData = await fetchP(endpointUrl, rqopt, qss, pc);
169
+ const remData = await fetchP(endpointUrl, rqopt, qss, pc, incrementAx);
254
170
  // finally, decide product data.
255
171
  if (isArray(data) && isArray(remData)) {
256
172
  // DEVNOTE: 2019/7/23 15:01:48 - types
@@ -1,27 +0,0 @@
1
- /*!
2
- * ESI endpoint: /fleets/{fleet_id}/members/
3
- */
4
- /**
5
- * If a character is invited with the `fleet_commander` role, neither `wing_id` or `squad_id` should be specified. If a character is invited with the `wing_commander` role, only `wing_id` should be specified. If a character is invited with the `squad_commander` role, both `wing_id` and `squad_id` should be specified. If a character is invited with the `squad_member` role, `wing_id` and `squad_id` should either both be specified or not specified at all. If they aren’t specified, the invited character will join any squad with available positions.
6
- */
7
- type PostFleetsFleetIdMembersRole = "fleet_commander" | "wing_commander" | "squad_commander" | "squad_member";
8
-
9
- /**
10
- * invitation object
11
- */
12
- interface PostFleetsFleetIdMembersInvitation {
13
- /**
14
- * The character you want to invite
15
- */
16
- character_id: number;
17
- role: PostFleetsFleetIdMembersRole;
18
- /**
19
- * squad_id integer
20
- */
21
- squad_id?: number;
22
- /**
23
- * wing_id integer
24
- */
25
- wing_id?: number;
26
- [k: string]: unknown | undefined;
27
- }
@@ -1,40 +0,0 @@
1
- /*!
2
- * ESI endpoint: /ui/openwindow/newmail/
3
- */
4
- /**
5
- * recipients array
6
- *
7
- * @minItems 1
8
- * @maxItems 50
9
- */
10
- type PostUiOpenwindowNewmailRecipients = [
11
- /**
12
- * recipient integer
13
- */
14
- number,
15
- ...number[]
16
- ];
17
-
18
- /**
19
- * new_mail object
20
- */
21
- interface PostUiOpenwindowNewmailNewMail {
22
- /**
23
- * body string
24
- */
25
- body: string;
26
- recipients: PostUiOpenwindowNewmailRecipients;
27
- /**
28
- * subject string
29
- */
30
- subject: string;
31
- /**
32
- * to_corp_or_alliance_id integer
33
- */
34
- to_corp_or_alliance_id?: number;
35
- /**
36
- * Corporations, alliances and mailing lists are all types of mailing groups. You may only send to one mailing group, at a time, so you may fill out either this field or the to_corp_or_alliance_ids field
37
- */
38
- to_mailing_list_id?: number;
39
- [k: string]: unknown | undefined;
40
- }
@@ -1,15 +0,0 @@
1
- /*!
2
- * ESI endpoint: /characters/{character_id}/calendar/{event_id}/
3
- */
4
- /**
5
- * response string
6
- */
7
- type PutCharactersCharacterIdCalendarEventIdResponseResponse = "accepted" | "declined" | "tentative";
8
-
9
- /**
10
- * response object
11
- */
12
- interface PutCharactersCharacterIdCalendarEventIdResponse {
13
- response: PutCharactersCharacterIdCalendarEventIdResponseResponse;
14
- [k: string]: unknown | undefined;
15
- }
@@ -1,16 +0,0 @@
1
- /*!
2
- * ESI endpoint: /characters/{character_id}/contacts/
3
- */
4
- /**
5
- * contact_ids array
6
- *
7
- * @minItems 1
8
- * @maxItems 100
9
- */
10
- type PutCharactersCharacterIdContactsContactIds = [
11
- /**
12
- * ID of the contact to edit
13
- */
14
- number,
15
- ...number[]
16
- ];
@@ -1,20 +0,0 @@
1
- /*!
2
- * ESI endpoint: /characters/{character_id}/mail/{mail_id}/
3
- */
4
-
5
- /**
6
- * contents object
7
- */
8
- interface PutCharactersCharacterIdMailMailIdContents {
9
- /**
10
- * Labels to assign to the mail. Pre-existing labels are unassigned.
11
- *
12
- * @maxItems 25
13
- */
14
- labels?: number[];
15
- /**
16
- * Whether the mail is flagged as read
17
- */
18
- read?: boolean;
19
- [k: string]: unknown | undefined;
20
- }
@@ -1,27 +0,0 @@
1
- /*!
2
- * ESI endpoint: /fleets/{fleet_id}/members/{member_id}/
3
- */
4
- /**
5
- * If a character is moved to the `fleet_commander` role, neither `wing_id` or `squad_id` should be specified. If a character is moved to the `wing_commander` role, only `wing_id` should be specified. If a character is moved to the `squad_commander` role, both `wing_id` and `squad_id` should be specified. If a character is moved to the `squad_member` role, both `wing_id` and `squad_id` should be specified.
6
- */
7
- type PutFleetsFleetIdMembersMemberIdRole =
8
- | "fleet_commander"
9
- | "wing_commander"
10
- | "squad_commander"
11
- | "squad_member";
12
-
13
- /**
14
- * movement object
15
- */
16
- interface PutFleetsFleetIdMembersMemberIdMovement {
17
- role: PutFleetsFleetIdMembersMemberIdRole;
18
- /**
19
- * squad_id integer
20
- */
21
- squad_id?: number;
22
- /**
23
- * wing_id integer
24
- */
25
- wing_id?: number;
26
- [k: string]: unknown | undefined;
27
- }
@@ -1,18 +0,0 @@
1
- /*!
2
- * ESI endpoint: /fleets/{fleet_id}/
3
- */
4
-
5
- /**
6
- * new_settings object
7
- */
8
- interface PutFleetsFleetIdNewSettings {
9
- /**
10
- * Should free-move be enabled in the fleet
11
- */
12
- is_free_move?: boolean;
13
- /**
14
- * New fleet MOTD in CCP flavoured HTML
15
- */
16
- motd?: string;
17
- [k: string]: unknown | undefined;
18
- }
@@ -1,14 +0,0 @@
1
- /*!
2
- * ESI endpoint: /fleets/{fleet_id}/squads/{squad_id}/
3
- */
4
-
5
- /**
6
- * naming object
7
- */
8
- interface PutFleetsFleetIdSquadsSquadIdNaming {
9
- /**
10
- * name string
11
- */
12
- name: string;
13
- [k: string]: unknown | undefined;
14
- }
@@ -1,14 +0,0 @@
1
- /*!
2
- * ESI endpoint: /fleets/{fleet_id}/wings/{wing_id}/
3
- */
4
-
5
- /**
6
- * naming object
7
- */
8
- interface PutFleetsFleetIdWingsWingIdNaming {
9
- /**
10
- * name string
11
- */
12
- name: string;
13
- [k: string]: unknown | undefined;
14
- }