Magek Framework
    Preparing search index...

    Class MagekConfig

    Class used by external packages that needs to get a representation of the Magek config.

    Index

    Accessors

    • get thereAreRoles(): boolean

      This is a convenience property to easily check if the application has defined any roles. Only in that case we will create a user pool and an authorization API. If there are no roles defined, it means that all app endpoints are public and users won't be registered (they are all anonymous)

      Returns boolean

    Constructors

    Methods

    • Returns the name of the ReadModel from the name of its resouce (normally, a table)

      Parameters

      • resourceName: string

      Returns string

    Properties

    logLevel: Level = Level.debug
    logPrefix?: string
    logger?: Logger
    eventStoreAdapter?: EventStoreAdapter
    readModelStoreAdapter?: ReadModelStoreAdapter
    sessionStoreAdapter?: SessionStoreAdapter
    appName: string = 'new-magek-app'
    assets?: string[]
    defaultResponseHeaders: Record<string, string> = {}
    subscriptions: {
        maxConnectionDurationInSeconds: number;
        maxDurationInSeconds: number;
    } = ...
    enableGraphQLIntrospection: boolean = true
    codeRelativePath: string = 'dist'
    eventDispatcherHandler: string = ...
    eventStreamConsumer: string = ...
    eventStreamProducer: string = ...
    serveGraphQLHandler: string = ...
    sensorHealthHandler: string = ...
    scheduledTaskHandler: string = ...
    notifySubscribersHandler: string = ...
    functionRelativePath: string = ...
    events: Record<EventName, EventMetadata> = {}
    notifications: Record<EventName, NotificationMetadata> = {}
    partitionKeys: Record<EventName, string> = {}
    topicToEvent: Record<string, EventName> = {}
    eventToTopic: Record<EventName, string> = {}
    entities: Record<EntityName, EntityMetadata> = {}
    reducers: Record<EventName, ReducerMetadata> = {}
    commandHandlers: Record<CommandName, CommandMetadata> = {}
    queryHandlers: Record<QueryName, QueryMetadata> = {}
    eventHandlers: Record<EventName, EventHandlerInterface[]> = {}
    readModels: Record<ReadModelName, ReadModelMetadata> = {}
    projections: Record<
        EntityName,
        ProjectionMetadata<EntityInterface, ReadModelInterface>[],
    > = {}
    unProjections: Record<
        EntityName,
        ProjectionMetadata<EntityInterface, ReadModelInterface>[],
    > = {}
    readModelSequenceKeys: Record<EntityName, string> = {}
    roles: Record<RoleName, RoleMetadata> = {}
    schemaMigrations: Record<ConceptName, Map<Version, SchemaMigrationMetadata>> = {}
    scheduledCommandHandlers: Record<ScheduledCommandName, ScheduledCommandMetadata> = {}
    dataMigrationHandlers: Record<DataMigrationName, DataMigrationMetadata> = {}
    userHealthIndicators: Record<string, HealthIndicatorMetadata> = {}
    sensorConfiguration: SensorConfiguration = ...
    globalErrorsHandler: GlobalErrorHandlerMetadata | undefined
    enableSubscriptions: boolean = true
    nonExposedGraphQLMetadataKey: Record<string, string[]> = {}
    dispatchedEventsTtl: number = 300
    eventPollingIntervalMs: number = 1000

    Interval in milliseconds between event polling cycles. Default: 1000ms

    eventProcessingBatchSize: number = 100

    Number of events to process per polling cycle. Default: 100

    traceConfiguration: TraceConfiguration = ...
    eventStreamConfiguration: EventStreamConfiguration = ...
    env: Record<string, string> = {}

    Environment variables to set when running the application

    tokenVerifiers: TokenVerifier[] = []

    Add TokenVerifier implementations to this array to enable token verification. When a bearer token arrives in a request 'Authorization' header, it will be checked against all the verifiers registered here.

    environmentName: string