# Module: plugins

Contains all of the plugin and plugin registry commands.

Author:
  - Seth Hollingsead
Copyright:
  - Copyright © 2022-… by Seth Hollingsead. All rights reserved
Source:
  - commandsBlob/commands/plugins.js, line 1

### Requires

- module:chiefPlugin
- module:warden
- module:loggers
- @haystacks/constants
- path

### Methods

#### (inner) countPluginsInRegistryPath(inputData, inputMetaData) → {array.<boolean, integer>}

This is a command function that calls the chiefPlugin.countAllPluginsInRegistryPath.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 106

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the number of plugins found in the plugins registry.

Type
  array.<boolean, integer>

#### (inner) countPluginsInRgistry(inputData, inputMetaData) → {array.<boolean, integer>}

This is a command function that calls the chiefPlugin.countAllPluginsInRegistry function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 80

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the number of plugins found in the plugins registry.

Type
  array.<boolean, integer>

#### (inner) listAllPluginsInRegistry(inputData, inputMetaData) → {array.<boolean, array.<string>>}

This is a command function that calls the chiefPlugin.getAllPluginsInRegistry function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 28

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the list of plugins in the registry.

Type
  array.<boolean, array.<string>>

#### (inner) listAllPluginsInRegistryPath(inputData, inputMetaData) → {array.<boolean, array.<string>>}

This is a command function that calls the chiefPlugin.getAllPluginsInRegistryPath function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 54

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by the list of plugins in the plugins registry path.

Type
  array.<boolean, array.<string>>

#### (inner) loadPlugin(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the the warden.loadPlugin function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the case the user has entered the correct input as follows: inputData[0] = 'loadPlugin' inputData[1] = pluginPath - The fully qualified path where to load the plugin from.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 277

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if the plugin was loaded successfully or not.

Type
  array.<boolean, boolean>

#### (inner) loadPlugins(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the warden.loadPlugins function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string, array.<string>> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the case the user has entered the correct input as follows: inputData[0] = 'loadPlugins' inputData[1] = Array of fully qualified plugin paths were to load all the plugins from.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 309

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if all the plugins were loaded successfully or not.

Type
  array.<boolean, boolean>

#### (inner) loadPluginsFromRegistry(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the warden.loadPluginsFromRegistry function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 341

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if all the plugins from the plugin registry were loaded successfully or not.

Type
  array.<boolean, boolean>

#### (inner) registerPlugin(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the chiefPlugin.registerNamedPlugin function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the case the user has entered the correct input as follows: inputData[0] = 'registerPlugin' inputData[1] = pluginName inputData[2] = pluginPath
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 132

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if the plugin was registered successfully or not.

Type
  array.<boolean, boolean>

#### (inner) savePluginRegistryToDisk(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the chiefPlugin.savePluginRegistryDisk function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 250

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if the plugin registry was saved successfully or not.

Type
  array.<boolean, boolean>

#### (inner) syncPluginRegistryWithPath(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the chiefPlugin.synchronizePluginRegistryWithPath function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 196

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if the plugin registry synchronization was successful or not.

Type
  array.<boolean, boolean>

#### (inner) unloadAllPlugins(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the warden.unloadAllPlugins function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 432

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if all the plugins were unloaded successfully or not.

Type
  array.<boolean, boolean>

#### (inner) unloadPlugin(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the warden.unloadPlugin function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the case the user has entered the correct input as follows: inputData[0] = 'unloadPlugin' inputData[1] = pluginName - The name of the plugin that should be unloaded.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 368

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if the specified plugin was unloaded successfully or not.

Type
  array.<boolean, boolean>

#### (inner) unloadPlugins(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the warden.unloadPlugins function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string, array.<string>> | An array that could actually contain anything, depending on what the user entered. But the function filters all of that internally and extracts the case the user has entered the correct input as follows: inputData[0] = 'unloadPlugins' inputData[1] = Array of plugin names that should be unloaded.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 400

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if the specified plugin was unloaded successfully or not.

Type
  array.<boolean, boolean>

#### (inner) unregisterAllPlugins(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the chiefPlugin.clearPluginRegistry function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | Not used for this command.
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 223

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if all the plugins were unregistered successfully or not.

Type
  array.<boolean, boolean>

#### (inner) unregisterPlugin(inputData, inputMetaData) → {array.<boolean, boolean>}

This is a command function that calls the chiefPlugin.unregisterNamedPlugin function.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string> | An array that could actually contain anything, dependng on what the user entered. But the function filters all of that internally and extracts the case the user has entered the correct input as follows: inputData[0] = 'unregisterPlugin' inputData[1] = pluginName
`inputMetaData` | string | Not used for this command.

Author:
  - Seth Hollingsead
Source:
  - commandsBlob/commands/plugins.js, line 164

##### Returns:

An array with a boolean True or False value to indicate if the application should exit or not exit, followed by another boolean value to indicate if the plugin was unregistered successfully or not.

Type
  array.<boolean, boolean>