Skip to content

@purista/core v2.0.5


PURISTA API / @purista/core / ConfigStoreBaseClass

Class: abstract ConfigStoreBaseClass<ConfigStoreConfigType>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:20

Base class for config store adapters. The actual store implementation must overwrite the protected methods:

  • getConfigImpl
  • setConfigImpl
  • removeConfigImpl

DO NOT OVERWRITE: the regular methods getConfig, setConfig or removeConfig

Extended by

Type Parameters

ConfigStoreConfigType extends Record<string, unknown> = EmptyObject

Constructors

new ConfigStoreBaseClass()

new ConfigStoreBaseClass<ConfigStoreConfigType>(name, config): ConfigStoreBaseClass<ConfigStoreConfigType>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:28

Parameters

name

string

config

{ [K in string | number | symbol]: ({ cacheTtl?: number; enableCache?: boolean; enableGet?: boolean; enableRemove?: boolean; enableSet?: boolean; logger?: Logger; logLevel?: LogLevelName } & ConfigStoreConfigType)[K] }

Returns

ConfigStoreBaseClass<ConfigStoreConfigType>

Properties

cache

cache: ConfigStoreCacheMap

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:26


config

config: { [K in string | number | symbol]: ({ cacheTtl?: number; enableCache?: boolean; enableGet?: boolean; enableRemove?: boolean; enableSet?: boolean; logger?: Logger; logLevel?: LogLevelName } & ConfigStoreConfigType)[K] }

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:22


logger

logger: Logger

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:21


name

name: string

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:24

Methods

destroy()

destroy(): Promise<void>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:126

Returns

Promise<void>


getConfig()

getConfig<ConfigNames>(...configNames): Promise<ObjectWithKeysFromStringArray<ConfigNames>>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:62

Returns the values for given config properties. This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected getConfigImpl

Type Parameters

ConfigNames extends string[]

Parameters

configNames

...ConfigNames

Returns

Promise<ObjectWithKeysFromStringArray<ConfigNames>>

an object of


getConfigImpl()

abstract protected getConfigImpl<ConfigNames>(...configNames): Promise<ObjectWithKeysFromStringArray<ConfigNames>>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:49

This method must be overwritten by actual store implementation.

Type Parameters

ConfigNames extends string[]

Parameters

configNames

...ConfigNames

list of config items

Returns

Promise<ObjectWithKeysFromStringArray<ConfigNames>>

an object of


removeConfig()

removeConfig(configName): Promise<void>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:89

Removes the config item given by config name. This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected removeConfigImpl

Parameters

configName

string

Returns

Promise<void>


removeConfigImpl()

abstract protected removeConfigImpl(configName): Promise<void>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:79

This method must be overwritten by actual store implementation.

Parameters

configName

string

Returns

Promise<void>


setConfig()

setConfig(configName, configValue): Promise<void>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:116

Sets a config value This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected setConfigImpl

Parameters

configName

string

configValue

unknown

Returns

Promise<void>


setConfigImpl()

abstract protected setConfigImpl(_configName, _configValue): Promise<void>

Defined in: packages/core/src/core/ConfigStore/ConfigStoreBaseClass.impl.ts:105

This method must be overwritten by actual store implementation.

Parameters

_configName

string

_configValue

unknown

Returns

Promise<void>