new Types(agent)
Create a new Types instance using the given agent.
Parameters:
| Name | Type | Description |
|---|---|---|
agent |
ESIAgent | The ESI agent |
Members
-
categories :Categories
-
A Categories instance configured with the same agent.
Type:
-
groups :Groups
-
A Groups instance configured with the same agent.
Type:
-
marketGroups :MarketGroups
-
A MarketGroups instance configured with the same agent.
Type:
-
search :Search
-
A Search module instance configured to search over the
'inventorytype'type.Type:
Methods
-
all(page)
-
Get a list of type ids. This route expires daily at 11:05.
This makes an HTTP GET request to
/universe/types/. The route version isv1.pagemust be at least1.On success, this resolves to a list of type ids.
Parameters:
Name Type Default Description pageNumber 0 Which page to query. If 0, then all pages are returned, concatenated as a single array.
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Number>>
-
get(id)
-
Create a new Type end point targeting the particular type by
id.Parameters:
Name Type Description idNumber The type id
Returns:
- Type
- Type
-
names(ids)
-
Resolve a set of IDs to names and categories. Supported ID's for resolving are: Characters, Corporations, Alliances, Stations, Solar Systems, Constellations, Regions, Types.
This makes an HTTP POST request to
/universe/names/. The route version isv2.The array length of
idsmust be between1and1000.On success, this resolves to list of id/name associations for a set of ID's. ID's that cannot be resolved are not returned. An example result is:
[ { "id": 95465499, "name": "CCP Bartender" } ]Note that the type schema of the response is modified from what is defined in ESI. Specifically:
- The
categoryproperty is removed.
Results will only includes matches with the type category. If
idsis longer than the reported maximum length for ESI, the array will be split into smaller chunks and multiple requests will be made and then concatenated back together.Parameters:
Name Type Description idsArray.<Number> The ids to resolve. If no ids are provided, then all names are returned
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
- The
-
prices()
-
Return a list of prices. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/markets/prices/. The route version isv1.On success, this resolves to a list of prices. An example result is:
[ { "adjusted_price": 306988.09, "average_price": 306292.67, "type_id": 32772 } ]Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>