Documentation
    Preparing search index...

    The core static class managing the registration and retrieval of backend adapters. Quatrain supports multiple concurrent backends, allowing different models to route their persistence to different data stores (e.g. Postgres, Firestore, REST).

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _backends: BackendRegistry<any> = {}

    Internal registry mapping aliases to their configured AbstractBackendAdapter instances.

    classRegistry: { [key: string]: any } = {}

    Dictionary holding registered active Quatrain models/components.

    defaultBackend: string = 'default'

    The alias of the currently active default backend adapter.

    logger: any = ...

    Winston logger instance dedicated to the Backend module.

    logLevel: DEBUG = LogLevel.DEBUG

    System-wide base log verbosity.

    me: string = ...

    Identifying namespace for this core component.

    storage: typeof NodePersist = persist

    Persistent key-value storage engine reference.

    storagePrefix: "core" = 'core'

    Context prefix string for scoped storage keys.

    userClass: any

    Global reference to the registered user class for authentication and relationships.

    Methods

    • Registers a new backend adapter instance into the global registry.

      Parameters

      • backend: AbstractBackendAdapter

        An instantiated adapter (e.g., FirestoreAdapter, PostgresAdapter).

      • alias: string

        The string identifier used to retrieve this backend later.

      • setDefault: boolean = false

        If true, this adapter becomes the default fallback for all operations.

      Returns void

    • Maps a specific entity class to an active name so the factory reflection can locate it.

      Parameters

      • name: string

        Semantic registry name.

      • obj: any

        Class constructor.

      Returns void

    • Stores a primitive value durably in the core storage instance.

      Parameters

      • key: string

        Identification string.

      • value: any

        Value.

      Returns Promise<void>

    • Injects a new logger block under a specific namespace alias.

      Parameters

      • alias: string = ...

        The logging context name.

      Returns any

      Instantiated LoggerAdapter.

    • Triggers a debug log on the core logger.

      Parameters

      • ...message: any

        Content to log.

      Returns void

    • Deprecated: Reserved schema definition hook.

      Parameters

      • key: string

        The property block to generate.

      Returns { manifest: { mandatory: boolean; type: StringConstructor } }

      Field definitions block.

    • Triggers an error log on the core logger.

      Parameters

      • ...message: any

        Content to log.

      Returns void

    • Retrieves a configured backend adapter from the registry by its alias.

      Type Parameters

      Parameters

      • alias: string = ...

        The string identifier of the backend to retrieve (defaults to the defaultBackend).

      Returns T

      The requested AbstractBackendAdapter instance.

      If the requested alias is not found in the registry.

    • Returns an injected class constructor by its registry identifier.

      Parameters

      • name: string

        The semantic name to resolve.

      Returns any

      Class definition.

    • Recovers a durably persisted value from the storage layer.

      Parameters

      • key: string

        The target identifier.

      Returns Promise<any>

      The recovered value.

    • Utility lookup to find executable paths in the system using which.

      Parameters

      • command: string

        The executable.

      Returns Promise<string>

      The resolved system path.

    • Triggers an info log on the core logger.

      Parameters

      • ...message: any

        Content to log.

      Returns void

    • Triggers a standard log on the core logger.

      Parameters

      • ...message: any

        Content to log.

      Returns void

    • Mutates the underlying verbosity constraints.

      Parameters

      Returns void

    • Execution suspension utility blocking the event loop context.

      Parameters

      • seconds: number = 1

        Duration count.

      Returns Promise<unknown>

      The promise to await.

    • Returns an ISO string representing the current time.

      Returns string

    • Triggers a trace log on the core logger.

      Parameters

      • ...message: any

        Content to log.

      Returns void

    • Triggers a warning log on the core logger.

      Parameters

      • ...message: any

        Content to log.

      Returns void