Class: Settings#

settings.Settings

A class to handle requests to /api/settings

Implements#

Constructors#

constructor#

new Settings(options)

Parameters#

Name

Type

options

IOptions

Defined in#

packages/settings/lib/settings.d.ts:7

Properties#

_getFederated#

Private _getFederated: any

Get the settings for a federated extension

param The id of a plugin

Defined in#

packages/settings/lib/settings.d.ts:58


_localforage#

Private _localforage: any

Defined in#

packages/settings/lib/settings.d.ts:62


_ready#

Private _ready: any

Defined in#

packages/settings/lib/settings.d.ts:63


_storage#

Private _storage: any

Defined in#

packages/settings/lib/settings.d.ts:61


_storageDrivers#

Private _storageDrivers: any

Defined in#

packages/settings/lib/settings.d.ts:60


_storageName#

Private _storageName: any

Defined in#

packages/settings/lib/settings.d.ts:59

Accessors#

defaultStorageOptions#

Protected get defaultStorageOptions(): LocalForageOptions

Get default options for localForage instances

Returns#

LocalForageOptions

Defined in#

packages/settings/lib/settings.d.ts:27


ready#

get ready(): Promise<void>

A promise that resolves when the settings storage is fully initialized

Returns#

Promise<void>

Implementation of#

ISettings.ready

Defined in#

packages/settings/lib/settings.d.ts:11


storage#

Protected get storage(): Promise<LocalForage>

A lazy reference to initialized storage

Returns#

Promise<LocalForage>

Defined in#

packages/settings/lib/settings.d.ts:15

Methods#

defaultSettingsStorage#

Protected defaultSettingsStorage(): LocalForage

Create a settings store.

Returns#

LocalForage

Defined in#

packages/settings/lib/settings.d.ts:31


get#

get(pluginId): Promise<undefined | IPlugin>

Get settings by plugin id

Parameters#

Name

Type

Description

pluginId

string

the id of the plugin

Returns#

Promise<undefined | IPlugin>

Implementation of#

ISettings.get

Defined in#

packages/settings/lib/settings.d.ts:38


getAll#

getAll(): Promise<{ settings: IPlugin[] }>

Get all the settings

Returns#

Promise<{ settings: IPlugin[] }>

Implementation of#

ISettings.getAll

Defined in#

packages/settings/lib/settings.d.ts:42


initStorage#

Protected initStorage(): Promise<void>

Prepare the storage

Returns#

Promise<void>

Defined in#

packages/settings/lib/settings.d.ts:23


initialize#

initialize(): Promise<void>

Finish any initialization after server has started and all extensions are applied.

Returns#

Promise<void>

Defined in#

packages/settings/lib/settings.d.ts:19


save#

save(pluginId, raw): Promise<void>

Save settings for a given plugin id

Parameters#

Name

Type

Description

pluginId

string

The id of the plugin

raw

string

The raw settings

Returns#

Promise<void>

Implementation of#

ISettings.save

Defined in#

packages/settings/lib/settings.d.ts:52