Class: Wars

Wars

An api adapter over the end points handling multiple wars via functions in the wars 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 Wars are functions and can be invoked directly, besides accessing its members. Its default function action is equivalent to get or recent if no id is provided.


new Wars(agent)

Create a new Wars function using the given agent.

Parameters:
Name Type Description
agent ESIAgent

The ESI agent

Methods


get(id)

Create a new War end point targeting the particular war by id.

Parameters:
Name Type Description
id Number

The war id

Returns:
Type
War

recent(maxId)

Return a list of wars. This route is cached for up to 3600 seconds.

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

On success, this resolves to a list of war IDs, in decending order by war_id.

Parameters:
Name Type Default Description
maxId Number 0

Only return wars with ID smaller than this. If not provided (or 0), the newest wars are returned

Returns:

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

Type
Promise.<Array.<Number>>