new Corporations(agent)
Create a new Corporations function using the given api.
Parameters:
| Name | Type | Description |
|---|---|---|
agent |
ESIAgent | The ESI agent |
Members
-
search :Search
-
A Search module instance configured to search over the
'corporation'type.Type:
Methods
-
get(id)
-
Create a new Corporation end point targeting the particular corporation by
id.Parameters:
Name Type Description idNumber The corporation id
Returns:
- Type
- Corporation
-
names(ids)
-
Resolve a set of corporation IDs to corporation names. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/corporations/names/. The route version isv1.The array length of
idsmust be between1and100.On success, this resolves to list of id/name associations. An example result is:
[ { "id": 1000171, "name": "Republic University" } ]Note that the type schema of the response is modified from what is defined in ESI. Specifically:
- The
corporation_idproperty is renamed toid. - The
corporation_nameproperty is renamed toname.
Parameters:
Name Type Description idsArray.<Number> A comma separated list of corporation IDs.
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
- The
-
npc()
-
Get a list of npc corporations. This route expires daily at 11:05.
This makes an HTTP GET request to
/corporations/npccorps/. The route version isv1.On success, this resolves to a list of npc corporation ids.
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Number>>