Class: Wings

Wings

An api adapter over the end points handling the wings in the character's fleet via functions in the fleets 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 Wings 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 Wings(fleet)

Create a new Wings function owned by the given fleet.

Parameters:
Name Type Description
fleet Fleet

The owning fleet

Methods


add()

Create a new wing in a fleet.

This makes an HTTP POST request to /fleets/{fleet_id}/wings/. The route version is v1.

On success, this resolves to the id of the created entity. The id is extracted from the wing_id property of the response object.

This function must be used with an SSO token that has the following scopes:

  • esi-fleets.write_fleet.v1
Returns:

A Promise that resolves to an id.

Type
Promise.<Number>

all()

Return information about wings in a fleet. This route is cached for up to 5 seconds.

This makes an HTTP GET request to /fleets/{fleet_id}/wings/. The route version is v1.

On success, this resolves to a list of fleet wings. An example result is:

[
  {
    "id": 2073711261968,
    "name": "Wing 1",
    "squads": [
      {
        "id": 3129411261968,
        "name": "Squad 1"
      }
    ]
  }
]

This function must be used with an SSO token that has the following scopes:

  • esi-fleets.read_fleet.v1
Returns:

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

Type
Promise.<Array.<Object>>

get()

The Wing api adapter for accessing and modifying the specific wing of a fleet.

Returns:
Type
Wing