eve-esi-types 1.0.1 → 1.1.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.
- package/README.md +28 -2
- package/esi-request.d.mts +58 -0
- package/esi-request.mjs +44 -8
- package/package.json +12 -3
- package/src/get_alliances_alliance_id_contacts_labels_ok.d.ts +9 -12
- package/src/get_alliances_alliance_id_contacts_ok.d.ts +15 -23
- package/src/get_alliances_alliance_id_corporations_ok.d.ts +2 -7
- package/src/get_alliances_alliance_id_icons_ok.d.ts +9 -12
- package/src/get_alliances_alliance_id_ok.d.ts +29 -37
- package/src/get_alliances_ok.d.ts +2 -7
- package/src/get_characters_character_id_agents_research_ok.d.ts +18 -27
- package/src/get_characters_character_id_assets_ok.d.ts +22 -32
- package/src/get_characters_character_id_attributes_ok.d.ts +33 -42
- package/src/get_characters_character_id_blueprints_ok.d.ts +26 -37
- package/src/get_characters_character_id_bookmarks_folders_ok.d.ts +9 -12
- package/src/get_characters_character_id_bookmarks_ok.d.ts +46 -62
- package/src/get_characters_character_id_calendar_event_id_attendees_ok.d.ts +5 -7
- package/src/get_characters_character_id_calendar_event_id_ok.d.ts +37 -47
- package/src/get_characters_character_id_calendar_ok.d.ts +17 -22
- package/src/get_characters_character_id_clones_ok.d.ts +31 -43
- package/src/get_characters_character_id_contacts_labels_ok.d.ts +9 -12
- package/src/get_characters_character_id_contacts_ok.d.ts +23 -33
- package/src/get_characters_character_id_contracts_contract_id_bids_ok.d.ts +17 -22
- package/src/get_characters_character_id_contracts_contract_id_items_ok.d.ts +22 -32
- package/src/get_characters_character_id_contracts_ok.d.ts +77 -97
- package/src/get_characters_character_id_corporationhistory_ok.d.ts +17 -22
- package/src/get_characters_character_id_fatigue_ok.d.ts +13 -17
- package/src/get_characters_character_id_fittings_ok.d.ts +19 -32
- package/src/get_characters_character_id_fleet_ok.d.ts +13 -17
- package/src/get_characters_character_id_fw_stats_ok.d.ts +41 -52
- package/src/get_characters_character_id_implants_ok.d.ts +2 -7
- package/src/get_characters_character_id_industry_jobs_ok.d.ts +79 -107
- package/src/get_characters_character_id_killmails_recent_ok.d.ts +9 -12
- package/src/get_characters_character_id_location_ok.d.ts +13 -17
- package/src/get_characters_character_id_loyalty_points_ok.d.ts +9 -12
- package/src/get_characters_character_id_mail_labels_ok.d.ts +17 -22
- package/src/get_characters_character_id_mail_lists_ok.d.ts +9 -12
- package/src/get_characters_character_id_mail_mail_id_ok.d.ts +31 -43
- package/src/get_characters_character_id_mail_ok.d.ts +31 -43
- package/src/get_characters_character_id_medals_ok.d.ts +45 -57
- package/src/get_characters_character_id_mining_ok.d.ts +14 -22
- package/src/get_characters_character_id_notifications_contacts_ok.d.ts +21 -27
- package/src/get_characters_character_id_notifications_ok.d.ts +21 -27
- package/src/get_characters_character_id_ok.d.ts +41 -52
- package/src/get_characters_character_id_online_ok.d.ts +17 -22
- package/src/get_characters_character_id_opportunities_ok.d.ts +9 -12
- package/src/get_characters_character_id_orders_history_ok.d.ts +50 -67
- package/src/get_characters_character_id_orders_ok.d.ts +50 -67
- package/src/get_characters_character_id_planets_ok.d.ts +25 -32
- package/src/get_characters_character_id_planets_planet_id_ok.d.ts +110 -150
- package/src/get_characters_character_id_portrait_ok.d.ts +17 -22
- package/src/get_characters_character_id_roles_ok.d.ts +1 -2
- package/src/get_characters_character_id_search_ok.d.ts +62 -123
- package/src/get_characters_character_id_ship_ok.d.ts +10 -17
- package/src/get_characters_character_id_skillqueue_ok.d.ts +33 -42
- package/src/get_characters_character_id_skills_ok.d.ts +25 -32
- package/src/get_characters_character_id_standings_ok.d.ts +9 -12
- package/src/get_characters_character_id_titles_ok.d.ts +9 -12
- package/src/get_characters_character_id_wallet_journal_ok.d.ts +45 -57
- package/src/get_characters_character_id_wallet_ok.d.ts +1 -2
- package/src/get_characters_character_id_wallet_transactions_ok.d.ts +38 -52
- package/src/get_contracts_public_bids_contract_id_ok.d.ts +13 -17
- package/src/get_contracts_public_items_contract_id_ok.d.ts +34 -47
- package/src/get_contracts_public_region_id_ok.d.ts +61 -77
- package/src/get_corporation_corporation_id_mining_extractions_ok.d.ts +24 -30
- package/src/get_corporation_corporation_id_mining_observers_observer_id_ok.d.ts +20 -29
- package/src/get_corporation_corporation_id_mining_observers_ok.d.ts +10 -13
- package/src/get_corporations_corporation_id_alliancehistory_ok.d.ts +17 -22
- package/src/get_corporations_corporation_id_assets_ok.d.ts +22 -32
- package/src/get_corporations_corporation_id_blueprints_ok.d.ts +26 -37
- package/src/get_corporations_corporation_id_bookmarks_folders_ok.d.ts +13 -17
- package/src/get_corporations_corporation_id_bookmarks_ok.d.ts +46 -62
- package/src/get_corporations_corporation_id_contacts_labels_ok.d.ts +9 -12
- package/src/get_corporations_corporation_id_contacts_ok.d.ts +19 -28
- package/src/get_corporations_corporation_id_containers_logs_ok.d.ts +31 -47
- package/src/get_corporations_corporation_id_contracts_contract_id_bids_ok.d.ts +17 -22
- package/src/get_corporations_corporation_id_contracts_contract_id_items_ok.d.ts +22 -32
- package/src/get_corporations_corporation_id_contracts_ok.d.ts +77 -97
- package/src/get_corporations_corporation_id_customs_offices_ok.d.ts +53 -67
- package/src/get_corporations_corporation_id_divisions_ok.d.ts +17 -22
- package/src/get_corporations_corporation_id_facilities_ok.d.ts +10 -17
- package/src/get_corporations_corporation_id_fw_stats_ok.d.ts +37 -47
- package/src/get_corporations_corporation_id_icons_ok.d.ts +13 -17
- package/src/get_corporations_corporation_id_industry_jobs_ok.d.ts +79 -107
- package/src/get_corporations_corporation_id_killmails_recent_ok.d.ts +9 -12
- package/src/get_corporations_corporation_id_medals_issued_ok.d.ts +21 -27
- package/src/get_corporations_corporation_id_medals_ok.d.ts +21 -27
- package/src/get_corporations_corporation_id_members_limit_ok.d.ts +1 -2
- package/src/get_corporations_corporation_id_members_ok.d.ts +2 -7
- package/src/get_corporations_corporation_id_members_titles_ok.d.ts +143 -146
- package/src/get_corporations_corporation_id_membertracking_ok.d.ts +26 -37
- package/src/get_corporations_corporation_id_ok.d.ts +57 -72
- package/src/get_corporations_corporation_id_orders_history_ok.d.ts +54 -72
- package/src/get_corporations_corporation_id_orders_ok.d.ts +54 -72
- package/src/get_corporations_corporation_id_roles_history_ok.d.ts +13 -17
- package/src/get_corporations_corporation_id_roles_ok.d.ts +5 -7
- package/src/get_corporations_corporation_id_shareholders_ok.d.ts +9 -12
- package/src/get_corporations_corporation_id_standings_ok.d.ts +9 -12
- package/src/get_corporations_corporation_id_starbases_ok.d.ts +26 -37
- package/src/get_corporations_corporation_id_starbases_starbase_id_ok.d.ts +34 -47
- package/src/get_corporations_corporation_id_structures_ok.d.ts +54 -72
- package/src/get_corporations_corporation_id_titles_ok.d.ts +9 -12
- package/src/get_corporations_corporation_id_wallets_division_journal_ok.d.ts +45 -57
- package/src/get_corporations_corporation_id_wallets_division_transactions_ok.d.ts +34 -47
- package/src/get_corporations_corporation_id_wallets_ok.d.ts +9 -12
- package/src/get_corporations_npccorps_ok.d.ts +2 -7
- package/src/get_dogma_attributes_attribute_id_ok.d.ts +41 -52
- package/src/get_dogma_attributes_ok.d.ts +2 -7
- package/src/get_dogma_dynamic_items_type_id_item_id_ok.d.ts +23 -37
- package/src/get_dogma_effects_effect_id_ok.d.ts +105 -132
- package/src/get_dogma_effects_ok.d.ts +2 -7
- package/src/get_fleets_fleet_id_members_ok.d.ts +34 -47
- package/src/get_fleets_fleet_id_ok.d.ts +17 -22
- package/src/get_fleets_fleet_id_wings_ok.d.ts +17 -22
- package/src/get_fw_leaderboards_characters_ok.d.ts +49 -62
- package/src/get_fw_leaderboards_corporations_ok.d.ts +49 -62
- package/src/get_fw_leaderboards_ok.d.ts +49 -62
- package/src/get_fw_stats_ok.d.ts +37 -47
- package/src/get_fw_systems_ok.d.ts +21 -27
- package/src/get_fw_wars_ok.d.ts +9 -12
- package/src/get_incursions_ok.d.ts +28 -43
- package/src/get_industry_facilities_ok.d.ts +22 -32
- package/src/get_industry_systems_ok.d.ts +9 -12
- package/src/get_insurance_prices_ok.d.ts +14 -22
- package/src/get_killmails_killmail_id_killmail_hash_ok.d.ts +127 -179
- package/src/get_loyalty_stores_corporation_id_offers_ok.d.ts +27 -42
- package/src/get_markets_groups_market_group_id_ok.d.ts +18 -33
- package/src/get_markets_groups_ok.d.ts +2 -7
- package/src/get_markets_prices_ok.d.ts +10 -17
- package/src/get_markets_region_id_history_ok.d.ts +25 -32
- package/src/get_markets_region_id_orders_ok.d.ts +42 -57
- package/src/get_markets_region_id_types_ok.d.ts +2 -7
- package/src/get_markets_structures_structure_id_ok.d.ts +38 -52
- package/src/get_opportunities_groups_group_id_ok.d.ts +29 -44
- package/src/get_opportunities_groups_ok.d.ts +2 -7
- package/src/get_opportunities_tasks_ok.d.ts +2 -7
- package/src/get_opportunities_tasks_task_id_ok.d.ts +17 -22
- package/src/get_route_origin_destination_ok.d.ts +2 -7
- package/src/get_sovereignty_campaigns_ok.d.ts +48 -59
- package/src/get_sovereignty_map_ok.d.ts +17 -22
- package/src/get_sovereignty_structures_ok.d.ts +31 -43
- package/src/get_status_ok.d.ts +17 -22
- package/src/get_universe_ancestries_ok.d.ts +25 -32
- package/src/get_universe_asteroid_belts_asteroid_belt_id_ok.d.ts +21 -27
- package/src/get_universe_bloodlines_ok.d.ts +42 -57
- package/src/get_universe_categories_category_id_ok.d.ts +19 -28
- package/src/get_universe_categories_ok.d.ts +2 -7
- package/src/get_universe_constellations_constellation_id_ok.d.ts +31 -43
- package/src/get_universe_constellations_ok.d.ts +2 -7
- package/src/get_universe_factions_ok.d.ts +41 -52
- package/src/get_universe_graphics_graphic_id_ok.d.ts +33 -42
- package/src/get_universe_graphics_ok.d.ts +2 -7
- package/src/get_universe_groups_group_id_ok.d.ts +18 -33
- package/src/get_universe_groups_ok.d.ts +2 -7
- package/src/get_universe_moons_moon_id_ok.d.ts +25 -32
- package/src/get_universe_planets_planet_id_ok.d.ts +26 -37
- package/src/get_universe_races_ok.d.ts +17 -22
- package/src/get_universe_regions_ok.d.ts +2 -7
- package/src/get_universe_regions_region_id_ok.d.ts +19 -28
- package/src/get_universe_schematics_schematic_id_ok.d.ts +9 -12
- package/src/get_universe_stargates_stargate_id_ok.d.ts +34 -47
- package/src/get_universe_stars_star_id_ok.d.ts +26 -37
- package/src/get_universe_stations_station_id_ok.d.ts +50 -67
- package/src/get_universe_structures_ok.d.ts +2 -7
- package/src/get_universe_structures_structure_id_ok.d.ts +26 -37
- package/src/get_universe_system_jumps_ok.d.ts +9 -12
- package/src/get_universe_system_kills_ok.d.ts +17 -22
- package/src/get_universe_systems_ok.d.ts +2 -7
- package/src/get_universe_systems_system_id_ok.d.ts +65 -96
- package/src/get_universe_types_ok.d.ts +2 -7
- package/src/get_universe_types_type_id_ok.d.ts +70 -92
- package/src/get_wars_ok.d.ts +2 -7
- package/src/get_wars_war_id_killmails_ok.d.ts +9 -12
- package/src/get_wars_war_id_ok.d.ts +69 -87
- package/src/index.d.ts +33 -8
- package/src/post_characters_affiliation_ok.d.ts +17 -22
- package/src/post_characters_character_id_assets_locations_ok.d.ts +17 -22
- package/src/post_characters_character_id_assets_names_ok.d.ts +9 -12
- package/src/post_characters_character_id_contacts_created.d.ts +2 -7
- package/src/post_characters_character_id_cspa_created.d.ts +1 -2
- package/src/post_characters_character_id_fittings_created.d.ts +5 -7
- package/src/post_characters_character_id_mail_created.d.ts +1 -2
- package/src/post_characters_character_id_mail_labels_created.d.ts +1 -2
- package/src/post_corporations_corporation_id_assets_locations_ok.d.ts +17 -22
- package/src/post_corporations_corporation_id_assets_names_ok.d.ts +9 -12
- package/src/post_fleets_fleet_id_members_invitation.d.ts +13 -17
- package/src/post_fleets_fleet_id_wings_created.d.ts +5 -7
- package/src/post_fleets_fleet_id_wings_wing_id_squads_created.d.ts +5 -7
- package/src/post_ui_openwindow_newmail_new_mail.d.ts +22 -28
- package/src/post_universe_ids_ok.d.ts +82 -237
- package/src/post_universe_names_ok.d.ts +9 -12
- package/src/put_characters_character_id_calendar_event_id_response.d.ts +1 -2
- package/src/put_characters_character_id_contacts_contact_ids.d.ts +6 -8
- package/src/put_characters_character_id_mail_mail_id_contents.d.ts +11 -18
- package/src/put_fleets_fleet_id_members_member_id_movement.d.ts +9 -12
- package/src/put_fleets_fleet_id_new_settings.d.ts +9 -12
- package/src/put_fleets_fleet_id_squads_squad_id_naming.d.ts +5 -7
- package/src/put_fleets_fleet_id_wings_wing_id_naming.d.ts +5 -7
- package/tsconfig.json +2 -1
- package/esi-request.mts +0 -309
- package/src/post_characters_character_id_contacts_contact_ids.d.ts +0 -18
- package/src/post_characters_character_id_cspa_characters.d.ts +0 -18
- package/src/post_characters_character_id_fittings_fitting.d.ts +0 -101
- package/src/post_characters_character_id_mail_labels_label.d.ts +0 -39
- package/src/post_characters_character_id_mail_mail.d.ts +0 -53
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
|
-
>
|
|
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>} [
|
|
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 {
|
|
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 {
|
|
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
|
-
|
|
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.
|
|
159
|
+
if (opt.query) {
|
|
157
160
|
// Object.assign(queries, options.queries); Object.assign is too slow
|
|
158
|
-
const oqs = opt.
|
|
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
|
|
4
|
-
"description": "Extracted the main type of ESI. use for ESI request response types",
|
|
3
|
+
"version": "1.1.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": "
|
|
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
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* ESI endpoint: /alliances/{alliance_id}/contacts/labels/
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* label_id integer
|
|
7
|
-
*/
|
|
8
|
-
type GetAlliancesAllianceIdContactsLabelsLabelId = number;
|
|
9
|
-
/**
|
|
10
|
-
* label_name string
|
|
11
|
-
*/
|
|
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
|
-
|
|
25
|
-
|
|
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
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* ESI endpoint: /alliances/{alliance_id}/contacts/
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* contact_id integer
|
|
7
|
-
*/
|
|
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
|
-
|
|
19
|
+
/**
|
|
20
|
+
* contact_id integer
|
|
21
|
+
*/
|
|
22
|
+
contact_id: number;
|
|
39
23
|
contact_type: GetAlliancesAllianceIdContactsContactType;
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* ESI endpoint: /alliances/{alliance_id}/corporations/
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 200 ok integer
|
|
7
|
-
*/
|
|
8
|
-
type GetAlliancesAllianceIdCorporations_200Ok = number;
|
|
9
4
|
/**
|
|
10
5
|
* 200 ok array
|
|
11
6
|
*
|
|
12
7
|
* @maxItems 1000
|
|
13
8
|
*/
|
|
14
|
-
type GetAlliancesAllianceIdCorporationsOk =
|
|
9
|
+
type GetAlliancesAllianceIdCorporationsOk = number[];
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* ESI endpoint: /alliances/{alliance_id}/icons/
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* px128x128 string
|
|
7
|
-
*/
|
|
8
|
-
type GetAlliancesAllianceIdIconsPx128X128 = string;
|
|
9
|
-
/**
|
|
10
|
-
* px64x64 string
|
|
11
|
-
*/
|
|
12
|
-
type GetAlliancesAllianceIdIconsPx64X64 = string;
|
|
13
|
-
|
|
14
5
|
/**
|
|
15
6
|
* 200 ok object
|
|
16
7
|
*/
|
|
17
8
|
interface GetAlliancesAllianceIdIconsOk {
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* ESI endpoint: /alliances/{alliance_id}/
|
|
3
3
|
*/
|
|
4
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
|
|
31
|
-
*/
|
|
32
|
-
type GetAlliancesAllianceIdTicker = string;
|
|
33
|
-
|
|
34
5
|
/**
|
|
35
6
|
* 200 ok object
|
|
36
7
|
*/
|
|
37
8
|
interface GetAlliancesAllianceIdOk {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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,27 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* ESI endpoint: /characters/{character_id}/agents_research/
|
|
3
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
|
|
23
|
-
*/
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* ESI endpoint: /characters/{character_id}/assets/
|
|
3
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
|
|
15
|
-
*/
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
123
|
+
/**
|
|
124
|
+
* location_id integer
|
|
125
|
+
*/
|
|
126
|
+
location_id: number;
|
|
140
127
|
location_type: GetCharactersCharacterIdAssetsLocationType;
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
1
|
+
/*!
|
|
2
2
|
* ESI endpoint: /characters/{character_id}/attributes/
|
|
3
3
|
*/
|
|
4
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
|
|
35
|
-
*/
|
|
36
|
-
type GetCharactersCharacterIdAttributesWillpower = number;
|
|
37
|
-
|
|
38
5
|
/**
|
|
39
6
|
* 200 ok object
|
|
40
7
|
*/
|
|
41
8
|
interface GetCharactersCharacterIdAttributesOk {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
}
|