Class: War

War

An api adapter that provides functions for accessing various details for an war specified by id, via functions in the wars ESI endpoints. You should not usually instantiate this directly as its constructor requires an internal api instance.


new War(agent, warId)

Create a new War for the given agent provider and specific warId.

Parameters:
Name Type Description
agent ESIAgent

The ESI agent used to generate web requests

warId Number

The war id that is used for all requests

Methods


info()

Return details about a war. This route is cached for up to 3600 seconds.

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

On success, this resolves to details about a war. An example result is:

{
  "aggressor": {
    "alliance_id": 0,
    "corporation_id": 986665792,
    "isk_destroyed": 0,
    "ships_killed": 0
  },
  "allies": [
    {
      "alliance_id": 0,
      "corporation_id": 0
    }
  ],
  "declared": "2004-05-22T05:20:00Z",
  "defender": {
    "alliance_id": 0,
    "corporation_id": 1001562011,
    "isk_destroyed": 0,
    "ships_killed": 0
  },
  "finished": "",
  "id": 1941,
  "mutual": false,
  "open_for_allies": false,
  "retracted": "",
  "started": ""
}
Returns:

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

Type
Promise.<Object>

killmails(page)

Return a list of kills related to a war. This route is cached for up to 3600 seconds.

This makes an HTTP GET request to /wars/{war_id}/killmails/. The route version is v1.

On success, this resolves to a list of killmail IDs and hashes. An example result is:

[
  {
    "killmail_hash": "8eef5e8fb6b88fe3407c489df33822b2e3b57a5e",
    "killmail_id": 2
  }
]
Parameters:
Name Type Default Description
page Number 0

Optional; which page to query, starting at 1. If 0, then all pages are fetched and concatenated together

See:
Returns:

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

Type
Promise.<Array.<Object>>

kills(page)

Get the kill details for the war's killmails and then uses Killmail#get to map the details. The request resolves to an array, each containing a killmail detail.

Parameters:
Name Type Default Description
page Number 0

Optional; the page of killmails to fetch, starting with page 1. If not provided then all kills are returned.

Returns:
Type
Promise.<Array.<Object>>