Class: Corporations

Corporations

An api adapter over the end points handling multiple corporations via functions in the corporation ESI endpoints. You should not usually instantiate this directly as its constructor requires an internal api instance.

This is a function class so instances of Corporations are functions and can be invoked directly, besides accessing its members. Its default function action is equivalent to get.


new Corporations(agent)

Create a new Corporations function using the given api.

Parameters:
Name Type Description
agent ESIAgent

The ESI agent

Members


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
id Number

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 is v1.

The array length of ids must be between 1 and 100.

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_id property is renamed to id.
  • The corporation_name property is renamed to name.
Parameters:
Name Type Description
ids Array.<Number>

A comma separated list of corporation IDs.

Returns:

A Promise that resolves to the parsed JSON of the response.

Type
Promise.<Array.<Object>>

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 is v1.

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>>