Class: SolarSystems

SolarSystems

An api adapter that provides functions for accessing solar system information via the universe and search ESI end points. You should not usually instantiate this directly as its constructor requires an internal api instance.

This is a function class so instances of SolarSystems are functions and can be invoked directly, besides accessing its members. Its default function action is equivalent to get or all if no id is provided.


new SolarSystems(agent)

Create a new SolarSystems instance using the given api.

Parameters:
Name Type Description
agent ESIAgent

The ESI agent

Members


A Search module instance configured to search over the 'solarsystem' type.

Type:

Methods


all()

Get a list of solar systems. This route expires daily at 11:05.

This makes an HTTP GET request to /universe/systems/. The route version is v1.

On success, this resolves to a list of solar system ids.

Returns:

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

Type
Promise.<Array.<Number>>

get(id)

Create a new SolarSystem end point targeting the particular system by id.

Parameters:
Name Type Description
id Number

The solar system id

Returns:
Type
SolarSystem

jumpStats()

Get the number of jumps in solar systems within the last hour ending at the timestamp of the Last-Modified header, excluding wormhole space. Only systems with jumps will be listed. This route is cached for up to 3600 seconds.

This makes an HTTP GET request to /universe/system_jumps/. The route version is v1.

On success, this resolves to a list of systems and number of jumps. An example result is:

[
  {
    "ship_jumps": 42,
    "system_id": 30002410
  }
]
Returns:

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

Type
Promise.<Array.<Object>>

killStats()

Get the number of ship, pod and NPC kills per solar system within the last hour ending at the timestamp of the Last-Modified header, excluding wormhole space. Only systems with kills will be listed. This route is cached for up to 3600 seconds.

This makes an HTTP GET request to /universe/system_kills/. The route version is v1.

On success, this resolves to a list of systems and number of ship, pod and NPC kills. An example result is:

[
  {
    "npc_kills": 0,
    "pod_kills": 24,
    "ship_kills": 42,
    "system_id": 30002410
  }
]
Returns:

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

Type
Promise.<Array.<Object>>

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

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

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 category property is removed.

Results will only include matches with the solar system category. If ids is 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
ids Array.<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>>