new RepositoryController()

Description

Class for controlling Haxball Headless Manager (HHM) repositories.

Methods


<async> addRepository( repository [, append ] ) → {Promise.<boolean>}

Description

Adds a repository.

If append is set to true, the new repository will be added with the lowest priority, i.e. plugins will only be loaded from it they can't be found in any other repository. Otherwise the repository will be added with the highest priority.

Parameters
Name Type Attributes Description
repository Repository

The repository to be added.

append boolean <optional>

Whether to append or prepend the repository to the Array of repositories.

Returns
  • Whether the repository was successfully added.

<async> setRepositories( repository ) → {Promise}

Description

Sets the repositories.

Overwrites all repositories with the given array of repositories. Adds saviolas default repository if its not defined in the given array.

Parameters
Name Type Description
repository Array.<Repository>

The repository to be added.

Returns

<async> hasRepository( repository ) → {boolean}

Description

Returns whether the given repository already exists. Repositories are considered equal if their configuration is the same.

Parameters
Name Type Description
repository Repository

Repository config.

Returns
  • Did the repository exist.

<async> getRepositories() → {Array.<Repository>}

Description

Returns available repositories.

Returns
  • An array of available repositories.

<async> getRepositoryInformation( repository ) → {RepositoryData}

Description

Retrieves information about the given repository.

The information is loaded from repositorys repository.json config file.

Parameters
Name Type Description
repository Repository

The repository that you want to get information from.

Returns
  • The metadata of the repository.