Class: Squads

Squads

An api adapter over the end points handling the squads in a wing 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 Squads are functions and can be invoked directly, besides accessing its members. Its default function action is equivalent to get.


new Squads(wing)

Create a new Squads function owned by the given wing.

Parameters:
Name Type Description
wing Wing

The owning wing

Methods


add()

Create a new squad in a fleet.

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

On success, this resolves to the id of the created entity. The id is extracted from the squad_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>

get()

The Squad api adapter for accessing and modifying the specific squad of a wing.

Returns:
Type
Squad