Options
All
  • Public
  • Public/Protected
  • All
Menu

Module lib/models/configuration-validation

Index

Functions

mergeConfiguration

  • The function mergeConfiguration is in charge to provide the dynamic configuration to module's processing functions as well as to provide the description of eventual errors/intrus.

    The dynamic configuration is obtained by merging the static configuration (the one constructed from ModuleConfiguration) with eventual dynamic values - e.g. those provided by the configuration returned by an Adaptor.

    Errors can arise in two cases:

    • when an attributes in newAttributes exist in the original data structure but types do not align.
    • when some attributes in the original data structure disappear because of the merge

    Intrus are the fields in newAttributes that are actually not part of the original data structure.

    ❕ The persistentData provided as argument to the function should have been decorated using Schema and Property at construction.

    Type parameters

    • T: Object

    Parameters

    • persistentData: T

      persistent data of the module (ModuleFlux.getPersistentData)

    • Optional newAttributes: {}

      dynamic attributes - e.g. the configuration part returned by an adaptor

      • [key: string]: unknown

    Returns ConfigurationStatus<T>

    status of the result, either a ConsistentConfiguration or a InconsistentConfiguration

Generated using TypeDoc