DecisionSource
export type DecisionSource = { name: string; source: DataSource;};
Attributes
༶ name
: string
The name of the decision source is carried over to the decision store and emitted along with validation errors so that authors can easily pinpoint issues.
༶ source
: DataSource
The data source definition.
༶ schemas
: (optional) SchemaSource
A list of schemas definitions that the decision source relies on.
It is recommended to list all schemas explicitly, including the built-in ones, to make sure that they are loaded even when configuration in the target system does not reference them.
Usage
If your data is going to be consumed in different packages you are encourage to export a constant from the package where the data resides so that consumers can easily configure loaders an processors.
The demo data in @noodlestan/designer-decisions
is exposed like this:
import { DECISION_SCHEMAS } from '@noodlestan/designer-schemas';
const DEMO_DATA: DecisionSource = { name: 'Designer Decisions Demo Data', source: { type: 'package', package: '@noodlestan/designer-decisions', path: 'resources/data/demo', }, schemas: [DECISION_SCHEMAS],};
Both the minimal boilerplate and the Astro boilerplate import this constant to build and validate options for the staticStoreBuilder() function.