new SolarSystem(agent, solarSystemId)
Create a new SolarSystem for the given agent
provider and specific
solarSystemId
.
Parameters:
Name | Type | Description |
---|---|---|
agent |
ESIAgent | The agent used to generate web requests |
solarSystemId |
Number | The system id that is used for all requests |
Methods
-
info()
-
Get information on a solar system. This route expires daily at 11:05.
This makes an HTTP GET request to
/universe/systems/{system_id}/
. The route version isv2
.On success, this resolves to information about a solar system. An example result is:
{ "constellation_id": 20000001, "name": "Akpivem", "planets": [ { "moons": [ 40000042 ], "planet_id": 40000041 } ], "position": { "x": -91174141133075340, "y": 43938227486247170, "z": -56482824383339900 }, "security_class": "B", "security_status": 0.8462923765182495, "stargates": [ 50000342 ], "system_id": 30000003 }
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Object>
-
insecureRoute(to, avoid, connections)
-
Get the systems between origin and destination. This route is cached for up to 86400 seconds.
This makes an HTTP GET request to
/route/{origin}/{destination}/
. The route version isv1
.This function invokes the route with
flag
set to"insecure"
. The array length ofavoid
can be at most100
. The array length ofconnections
can be at most100
.On success, this resolves to solar systems in route from origin to destination.
Parameters:
Name Type Description to
Number Destination solar system ID.
avoid
Array.<Number> Avoid solar system ID(s). Defaults to
[]
connections
Array.<Array.<Number>> Connected solar system pairs. Defaults to
[]
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Number>>
-
secureRoute(to, avoid, connections)
-
Get the systems between origin and destination. This route is cached for up to 86400 seconds.
This makes an HTTP GET request to
/route/{origin}/{destination}/
. The route version isv1
.This function invokes the route with
flag
set to"secure"
. The array length ofavoid
can be at most100
. The array length ofconnections
can be at most100
.On success, this resolves to solar systems in route from origin to destination.
Parameters:
Name Type Description to
Number Destination solar system ID.
avoid
Array.<Number> Avoid solar system ID(s). Defaults to
[]
connections
Array.<Array.<Number>> Connected solar system pairs. Defaults to
[]
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Number>>
-
shortestRoute(to, avoid, connections)
-
Get the systems between origin and destination. This route is cached for up to 86400 seconds.
This makes an HTTP GET request to
/route/{origin}/{destination}/
. The route version isv1
.This function invokes the route with
flag
set to"shortest"
. The array length ofavoid
can be at most100
. The array length ofconnections
can be at most100
.On success, this resolves to solar systems in route from origin to destination.
Parameters:
Name Type Description to
Number Destination solar system ID.
avoid
Array.<Number> Avoid solar system ID(s). Defaults to
[]
connections
Array.<Array.<Number>> Connected solar system pairs. Defaults to
[]
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Number>>