@inixiative/json-rules 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,3 +1,5 @@
1
+ import { ModelEntry, FieldEntry, FieldMap, ScalarPath, RelationPath, RelationPathTarget, ScalarFieldNameOf, RelationFieldNameOf, RelationTargetOf } from '@inixiative/field-map';
2
+
1
3
  declare const Operator: {
2
4
  readonly equals: "equals";
3
5
  readonly notEquals: "notEquals";
@@ -58,52 +60,57 @@ type SourceOption = {
58
60
  label?: string;
59
61
  groups?: string[];
60
62
  };
61
- type FieldMapEntry = {
62
- kind: 'scalar' | 'object' | 'enum' | 'bridge';
63
- type: string;
64
- isList?: boolean;
65
- /**
66
- * Whether the column is NOT NULL. `toPrisma` reads this to decide if a negated
67
- * operator needs an explicit `equals: null` arm (Prisma's `not`/`notIn` follow SQL
68
- * three-valued logic and drop NULL rows); absent = unknown = no arm.
69
- */
70
- isRequired?: boolean;
71
- fromFields?: string[];
72
- toFields?: string[];
73
- relationName?: string;
74
- /**
75
- * Per-field allowed values, primarily for enum fields. Takes precedence over
76
- * `FieldMap.enums[type]` if both are set. Pass-through from codegen
77
- * (e.g. prisma-map's `EnumField.values`). Consumed by `validateRuleInLens`.
78
- */
79
- values?: readonly string[];
63
+ /** A relation across sources that `stitchFieldMaps` adds to each bridge endpoint's model, named
64
+ * after the other endpoint (`<fieldMap>:<Model>`). */
65
+ type BridgeEntry = {
66
+ readonly kind: 'bridge';
67
+ readonly type: string;
68
+ readonly isList?: boolean;
69
+ readonly isRequired?: boolean;
70
+ };
71
+ /** What projection and surface output add to a field. */
72
+ type ProjectedFields = {
80
73
  /**
81
74
  * A field's selectable option set as `{ value, label? }` pairs — the display
82
75
  * shape a picker consumes. On projection/surface output this is populated for
83
76
  * every value-gated field (enum members normalized to `{ value, label: value }`)
84
77
  * and for sourced fields (the fetched pairs from a materialized `SourceValues`).
85
78
  */
86
- options?: readonly SourceOption[];
79
+ readonly options?: readonly SourceOption[];
87
80
  /**
88
81
  * Present on projection/surface output when the field's source partitions its
89
82
  * options: the dotted to-one axes (relative to this model) whose values are
90
83
  * each option's `groups`, index-aligned.
91
84
  */
92
- groupBy?: readonly string[];
93
- };
94
- type ModelEntry = {
95
- dbName?: string | null;
96
- fields: Record<string, FieldMapEntry>;
85
+ readonly groupBy?: readonly string[];
86
+ };
87
+ type ReadableFields = {
88
+ readonly values?: readonly string[];
89
+ readonly fromFields?: readonly string[];
90
+ readonly toFields?: readonly string[];
91
+ readonly relationName?: string;
92
+ };
93
+ /** A field as a lens reads it: a schema field (`@inixiative/field-map`), or a bridge
94
+ * `stitchFieldMaps` added, with what a projection adds. */
95
+ type FieldMapEntry = (FieldEntry | BridgeEntry) & ProjectedFields & ReadableFields;
96
+ /** A model as a lens reads it. */
97
+ type LensModelEntry = Omit<ModelEntry, 'fields'> & {
98
+ readonly fields: {
99
+ readonly [field: string]: FieldMapEntry;
100
+ };
97
101
  };
98
102
  /**
99
- * A schema map: models keyed by name, plus an optional enum registry scoped to
100
- * this source. In multi-source setups (Prisma + Salesforce + CRM) each FieldMap
101
- * carries its own enums so namespaces don't collide across sources.
103
+ * The field map a lens reads: a schema map (`@inixiative/field-map`'s `FieldMap`, which is one),
104
+ * with its bridges stitched in and, on projection output, its options. In multi-source setups
105
+ * (Prisma + Salesforce + CRM) each map carries its own enums, so namespaces don't collide.
102
106
  */
103
- type FieldMap = {
104
- models: Record<string, ModelEntry>;
105
- /** Enum name → allowed values, e.g. `{ UserRole: ['ADMIN', 'USER'] }`. */
106
- enums?: Record<string, readonly string[]>;
107
+ type LensFieldMap = {
108
+ readonly models: {
109
+ readonly [model: string]: LensModelEntry;
110
+ };
111
+ readonly enums?: {
112
+ readonly [enumName: string]: readonly string[];
113
+ };
107
114
  };
108
115
  type BridgeEndpoint = {
109
116
  fieldMap: string;
@@ -131,7 +138,7 @@ type Bridge = {
131
138
  cardinality: BridgeCardinality;
132
139
  };
133
140
  type FieldMapSet = {
134
- maps: Record<string, FieldMap>;
141
+ maps: Record<string, LensFieldMap>;
135
142
  bridges?: Bridge[];
136
143
  };
137
144
 
@@ -292,12 +299,27 @@ type OperatorFamily = 'field' | 'date' | 'array';
292
299
  * Throws on an operator the family doesn't have. */
293
300
  declare const getValueShape: (operator: string, family: OperatorFamily) => ValueShape;
294
301
  /** The field and date operators a field kind takes, narrowed to one target when given. */
295
- declare const getOperatorsForKind: (kind: FieldKind, target?: RuleTarget) => {
302
+ declare const getOperatorsForKind: (kind: FieldKind, target?: RuleTarget, options?: {
303
+ positive?: boolean;
304
+ }) => {
296
305
  field: Operator[];
297
306
  date: DateOperator[];
298
307
  };
299
308
  /** The array operators, narrowed to one target when given. */
300
309
  declare const getArrayOperators: (target?: RuleTarget) => ArrayOperator[];
310
+ /** The kinds `min` / `max` order: numbers and dates. A string column orders through `coerceType`,
311
+ * never by character code. */
312
+ declare const ORDERED_VALUE_KINDS: readonly FieldKind[];
313
+ /** The kinds `distinct` lists: strings, enums, dates, booleans and numbers — each compared as
314
+ * stored, so `1` and `Decimal('1')` stay two values unless `coerceType` reads them as one. */
315
+ declare const DISTINCT_VALUE_KINDS: readonly FieldKind[];
316
+ /** The aggregate modes that read values of `kind`; `{ comparable: true }` keeps the ones an
317
+ * aggregate rule compares. */
318
+ declare const aggregateModesForKind: (kind: FieldKind, options?: {
319
+ comparable?: boolean;
320
+ }) => ValueAggregateMode[];
321
+ /** The modes an aggregate rule compares (`sum`, `avg`). */
322
+ declare const AGGREGATE_MODES: readonly AggregateMode[];
301
323
  /** Every mode a value expression's aggregate takes. */
302
324
  declare const VALUE_AGGREGATE_MODES: readonly ValueAggregateMode[];
303
325
  /** The comparisons an aggregate rule takes; every target compiles all of them. */
@@ -587,12 +609,12 @@ type StrictIfThenElse<TRuleValue = RuleValue, TDateValue = DateRuleValue> = {
587
609
  type StrictCondition<TRuleValue = RuleValue, TDateValue = DateRuleValue> = StrictRule<TRuleValue> | StrictAggregateRule<TRuleValue, TDateValue> | StrictArrayRule<TRuleValue, TDateValue> | StrictDateRule | StrictAll<TRuleValue, TDateValue> | StrictAny<TRuleValue, TDateValue> | StrictIfThenElse<TRuleValue, TDateValue> | boolean;
588
610
  /** A row as a rule reads it: a record of fields. */
589
611
  type Row = Record<string, unknown>;
590
- /** What both compilers take: the schema (a FieldMap, or a FieldMapSet with `mapName`), the
612
+ /** What both compilers take: the schema (a LensFieldMap, or a FieldMapSet with `mapName`), the
591
613
  * model the rule reads, and the clock. `lens` compiles the
592
614
  * rule under a lens instead — narrowed (`narrowRule`), against the base lens's maps, map and
593
615
  * model — and can't be passed with `map` / `mapName` / `model`. */
594
616
  type CompileOptions = {
595
- map?: FieldMap | FieldMapSet;
617
+ map?: LensFieldMap | FieldMapSet;
596
618
  mapName?: string;
597
619
  model?: string;
598
620
  lens?: Lens | LensNarrowing;
@@ -649,10 +671,17 @@ type ListValue = ValueExpression[] | {
649
671
  };
650
672
  /** A scalar written as itself, as a stored value is: `5`, `'gold'`, `true`, `null`, a Date. */
651
673
  type BareLiteral = string | number | boolean | bigint | Date | null;
652
- /** A value computed from a row: a literal (bare, or `{ value }` — an object literal needs the
653
- * wrapper), a path read (`{ path }`), a binding (`{ bind }`), an aggregate over a relation's rows,
654
- * if / then / else, or a list. */
655
- type ValueExpression = BareLiteral | ValueSourceOf<RuleValue> | AggregateValue | IfThenElseValue | ListValue;
674
+ /** A literal read as a kind, with the field rule's own key: `{ value: '2027-01-01', coerceType:
675
+ * 'DateTime' }` evaluates to a Date. Its kind is stamped by whoever knows it (the editor, from
676
+ * the caller's target); json-rules never guesses it. */
677
+ type CoercedLiteral = {
678
+ value: RuleValue;
679
+ coerceType: FieldKind;
680
+ } & Never<'path' | 'bind' | 'bindOptional'>;
681
+ /** A value computed from a row: a literal (bare, `{ value }` — an object literal needs the
682
+ * wrapper — or a `CoercedLiteral`), a path read (`{ path }`), a binding (`{ bind }`), an
683
+ * aggregate over a relation's rows, if / then / else, or a list. */
684
+ type ValueExpression = BareLiteral | ValueSourceOf<RuleValue> | CoercedLiteral | AggregateValue | IfThenElseValue | ListValue;
656
685
  /** What a value expression returns: its kind (null when it can only be null), whether it is a
657
686
  * list, and whether it can be null. */
658
687
  type ValueType = {
@@ -830,11 +859,11 @@ type ValidationResult = {
830
859
  errors: ValidationIssue[];
831
860
  };
832
861
  /** Which engine a rule must compile for; `check` (the default) accepts every rule. The schema
833
- * (`map` — a FieldMap, or a FieldMapSet with `mapName` — and `model`) lets the Prisma target
862
+ * (`map` — a LensFieldMap, or a FieldMapSet with `mapName` — and `model`) lets the Prisma target
834
863
  * accept a column compared with a column it can compile. */
835
864
  type ValidateRuleOptions = {
836
865
  target?: RuleTarget;
837
- map?: FieldMap | FieldMapSet;
866
+ map?: LensFieldMap | FieldMapSet;
838
867
  mapName?: string;
839
868
  model?: string;
840
869
  /** Refuse every shape that can hold on a value the row doesn't carry: `if`/`then`/`else`,
@@ -898,8 +927,11 @@ declare const clampLens: (lens: Lens | LensNarrowing, clamps: LensClamps) => Len
898
927
  * names its coercion are left as they are. */
899
928
  declare const coerceRule: (condition: Condition, lensOrNarrowing: Lens | LensNarrowing) => Condition;
900
929
 
901
- /** A lens over field maps, its bridges stitched into the maps as fields. */
902
- declare const createLens: ({ maps, bridges, mapName, model }: Lens) => Lens;
930
+ /** A lens over field maps, its bridges stitched into the maps as fields. Over a literal map
931
+ * (`typeof prismaMap`), `model` must be one of `mapName`'s models. */
932
+ declare const createLens: <const L extends Lens>({ maps, bridges, mapName, model, }: L & {
933
+ model: Extract<keyof L["maps"][L["mapName"]]["models"], string>;
934
+ }) => Lens;
903
935
 
904
936
  type RuleDescription = {
905
937
  sources: string[];
@@ -1443,7 +1475,7 @@ type WhereSqlOptions = {
1443
1475
  tables?: Record<string, string>;
1444
1476
  /** The schema the condition reads: it types each literal by its column, finds a relation's key,
1445
1477
  * and refuses what has no form here (a date, Json or list value, a bridge, a to-many hop). */
1446
- map: FieldMap | FieldMapSet;
1478
+ map: LensFieldMap | FieldMapSet;
1447
1479
  mapName?: string;
1448
1480
  model: string;
1449
1481
  };
@@ -1477,6 +1509,99 @@ type ConditionShapeKeys = {
1477
1509
  };
1478
1510
  /** The keys a node of one shape takes: those it must have and those it may. */
1479
1511
  declare const getConditionShapeKeys: (shape: ConditionShape) => ConditionShapeKeys;
1512
+ declare const ValueExpressionShape: {
1513
+ readonly literal: "literal";
1514
+ readonly list: "list";
1515
+ readonly if: "if";
1516
+ readonly aggregate: "aggregate";
1517
+ readonly source: "source";
1518
+ };
1519
+ type ValueExpressionShape = (typeof ValueExpressionShape)[keyof typeof ValueExpressionShape];
1520
+ /** A list's items: a bare array, or the `list` of `{ list, distinct }`. */
1521
+ declare const listItems: (expr: unknown) => unknown[];
1522
+ /** What a value expression node is — a bare literal, a list, if / then / else, an aggregate, or a
1523
+ * value source — or null when it is none of them or names more than one. */
1524
+ declare const valueExpressionShape: (expr: unknown) => ValueExpressionShape | null;
1525
+
1526
+ /**
1527
+ * The path spellings `ConditionOn` passes through as `string`, unchecked: a scope ref into an
1528
+ * enclosing row (`$.x`, `$$.x`), a bridge into another map (`map:Model.field`), the actor
1529
+ * (`__actor.x`), and a bracket spelling (`a[0].b`). The lens gate (`validateRuleInLens`) still
1530
+ * reads them at run time.
1531
+ */
1532
+ type UncheckedPath = `$.${string}` | `$$.${string}` | `${string}:${string}` | `__actor.${string}` | `${string}[${string}`;
1533
+ type FieldOn<M extends FieldMap, Model extends string> = ScalarPath<M, Model> | UncheckedPath;
1534
+ type Window<M extends FieldMap, Target extends string, Root extends string, TR, TD> = {
1535
+ filter?: ConditionOn<M, Target, Root, TR, TD>;
1536
+ orderBy?: {
1537
+ field: FieldOn<M, Target>;
1538
+ dir: SortDir;
1539
+ }[];
1540
+ };
1541
+ type RuleOn<M extends FieldMap, Model extends string, Root extends string, TR> = Omit<Rule<TR>, 'field' | 'path'> & {
1542
+ field: FieldOn<M, Model>;
1543
+ path?: FieldOn<M, Root>;
1544
+ };
1545
+ type DateRuleOn<M extends FieldMap, Model extends string, Root extends string, TD> = Omit<DateRule<TD>, 'field' | 'path'> & {
1546
+ field: FieldOn<M, Model>;
1547
+ path?: FieldOn<M, Root>;
1548
+ };
1549
+ type RelationArrayOn<M extends FieldMap, Model extends string, Root extends string, TR, TD> = {
1550
+ [P in RelationPath<M, Model>]: Omit<ArrayRule<TR, TD>, 'field' | 'condition' | 'filter' | 'orderBy'> & Window<M, RelationPathTarget<M, Model, P>, Root, TR, TD> & {
1551
+ field: P;
1552
+ condition?: ConditionOn<M, RelationPathTarget<M, Model, P>, Root, TR, TD>;
1553
+ };
1554
+ }[RelationPath<M, Model>];
1555
+ type ValueArrayOn<M extends FieldMap, Model extends string, TR, TD> = Omit<ArrayRule<TR, TD>, 'field'> & {
1556
+ field: FieldOn<M, Model>;
1557
+ };
1558
+ type AggregateOn<M extends FieldMap, Model extends string, Root extends string, TR, TD> = {
1559
+ [P in RelationPath<M, Model>]: Omit<AggregateRule<TR, TD>, 'field' | 'aggregate' | 'condition' | 'filter' | 'orderBy'> & Window<M, RelationPathTarget<M, Model, P>, Root, TR, TD> & {
1560
+ field: P;
1561
+ aggregate: AggregateRule['aggregate'] & {
1562
+ field?: FieldOn<M, RelationPathTarget<M, Model, P>>;
1563
+ };
1564
+ condition?: ConditionOn<M, RelationPathTarget<M, Model, P>, Root, TR, TD>;
1565
+ };
1566
+ }[RelationPath<M, Model>];
1567
+ /**
1568
+ * A `Condition` whose paths are checked against a literal map at compile time: a field rule or
1569
+ * date rule names a `ScalarPath` of `Model` (through to-one relations, into Json); an array or
1570
+ * aggregate rule names a `RelationPath` and its `condition`, `filter`, `orderBy` and
1571
+ * `aggregate.field` read the related model; a `{ path }` value source reads the root row
1572
+ * (`Root`, the model the rule is checked on). `all` / `any` / `if` nest as themselves.
1573
+ * `UncheckedPath` spellings pass through. Assignable to `Condition`.
1574
+ */
1575
+ type ConditionOn<M extends FieldMap, Model extends string, Root extends string = Model, TRuleValue = RuleValue, TDateValue = DateRuleValue> = RuleOn<M, Model, Root, TRuleValue> | DateRuleOn<M, Model, Root, TDateValue> | RelationArrayOn<M, Model, Root, TRuleValue, TDateValue> | ValueArrayOn<M, Model, TRuleValue, TDateValue> | AggregateOn<M, Model, Root, TRuleValue, TDateValue> | {
1576
+ all: ConditionOn<M, Model, Root, TRuleValue, TDateValue>[];
1577
+ error?: string;
1578
+ } | {
1579
+ any: ConditionOn<M, Model, Root, TRuleValue, TDateValue>[];
1580
+ error?: string;
1581
+ } | {
1582
+ if: ConditionOn<M, Model, Root, TRuleValue, TDateValue>;
1583
+ then: ConditionOn<M, Model, Root, TRuleValue, TDateValue>;
1584
+ else?: ConditionOn<M, Model, Root, TRuleValue, TDateValue>;
1585
+ error?: string;
1586
+ } | boolean;
1587
+ /**
1588
+ * A `ModelNarrowing` checked against a literal map: `picks` / `omits` name the model's columns,
1589
+ * `relations` its relation fields (each narrowing the related model in turn), and `where` is a
1590
+ * `ConditionOn` the model. Assignable to `ModelNarrowing`.
1591
+ */
1592
+ type ModelNarrowingOn<M extends FieldMap, Model extends string> = Omit<ModelNarrowing, 'picks' | 'omits' | 'where' | 'relations'> & {
1593
+ picks?: ScalarFieldNameOf<M, Model>[];
1594
+ omits?: ScalarFieldNameOf<M, Model>[];
1595
+ where?: ConditionOn<M, Model>;
1596
+ relations?: {
1597
+ [F in RelationFieldNameOf<M, Model>]?: ModelNarrowingOn<M, RelationTargetOf<M, Model, F>>;
1598
+ };
1599
+ };
1600
+ /** A `LensNarrowing` whose `root` is a `ModelNarrowingOn` the lens's anchor model. Assignable to
1601
+ * `LensNarrowing`. */
1602
+ type LensNarrowingOn<M extends FieldMap, Model extends string> = Omit<LensNarrowing, 'root'> & {
1603
+ root?: ModelNarrowingOn<M, Model>;
1604
+ };
1480
1605
 
1481
1606
  /**
1482
1607
  * A row's category: the value of the first case whose `if` holds (`match: 'first'`, the default;
@@ -1507,9 +1632,19 @@ type ValueDescription = {
1507
1632
  };
1508
1633
  declare const describeValue: (expression: ValueExpression, lensOrNarrowing: Lens | LensNarrowing) => ValueDescription;
1509
1634
 
1635
+ /** What `describeCategorization` reports: as `describeValue` does, for the value `categorize` gives. */
1636
+ type CategorizationDescription = ValueDescription;
1637
+ /** A categorization under a lens: the type `categorize` returns (every case's value and the
1638
+ * default unified; a list of them under `match: 'all'`; nullable when nothing may hold and there
1639
+ * is no default), the dotted paths its conditions and values read, its clock unit, and every
1640
+ * problem the validator, the lens gate and type inference find, at the case it was found in.
1641
+ * Never throws on a bad categorization. */
1642
+ declare const describeCategorization: (categorization: Categorization, lensOrNarrowing: Lens | LensNarrowing) => CategorizationDescription;
1643
+
1510
1644
  /**
1511
1645
  * The value an expression computes from a row, in memory, with what check() takes (`bindings`,
1512
- * `now`, `timeZone`, `weekStart`, `absent`): a literal (bare or `{ value }`), a path read (null when absent), a bound
1646
+ * `now`, `timeZone`, `weekStart`, `absent`): a literal (bare, `{ value }`, or `{ value, coerceType }`
1647
+ * read as that kind), a path read (null when absent), a bound
1513
1648
  * value, an aggregate over a relation's rows (`count`, `sum`, `avg`, `min`, `max`, through its
1514
1649
  * window and condition; `avg` and `min` / `max` over no values are null), the branch an `if` picks,
1515
1650
  * or a list (`distinct: true` drops repeats). Throws on a malformed expression,
@@ -1561,4 +1696,4 @@ declare const valueClockUnit: (expression: ValueExpression) => ClockUnit | null;
1561
1696
  */
1562
1697
  declare const orderRecords: <T>(items: readonly T[], orderBy: OrderBy) => T[];
1563
1698
 
1564
- export { ALL_KINDS, type Absent, type AggregateMode, type AggregateRule, type AggregateValue, type All, type Any, ArrayOperator, type ArrayRule, type BareLiteral, type Bridge, type BridgeCardinality, type BridgeDictionary, type BridgeEndpoint, CATEGORIZATION_MATCHES, CLOCK_UNITS, type Categorization, type CategorizationMatch, type Category, type CheckData, type CheckOptions, type ClockUnit, type CompileOptions, type Condition, ConditionShape, type ConditionShapeKeys, type DateConfig, type DateExpr, type DateInputOrExpr, type DateInputValue, type DateOffset, DateOperator, type DateRule, type DateRuleValue, type EdgeExpr, type EngineGlobalDefaults, type EngineGlobalPath, type EngineGlobalValues, type EngineGlobalsState, type EnumNarrowing, FieldKind, type FieldMap, type FieldMapEntry, type FieldMapSet, type FuzzyConfig, type GroupByStep, type IfThenElse, type IfThenElseValue, type Lens, type LensClamps, type LensNarrowing, type LensPathHop, type LensPathResolution, LensRefusal, type LensRelationSelect, type LensSelect, type LensSelectOptions, type LensValue, type LensWhereSql, type LensWhereSqlOptions, type ListBindingsOptions, type ListValue, type Magnitude, type MaterializeSourceQueryOptions, type ModelDefaultNarrowing, type ModelEntry, type ModelNarrowing, NUMERIC_KINDS, type NarrowingDefaults, type NumberOffset, Operator, type OperatorFamily, type OrderBy, type OrderedRuleValue, type PathProjection, type PeriodExpr, type PeriodUnit, type PrismaProvider, type PrismaStep, type PrismaWhere, type ProjectLensOptions, type ProjectRowsOptions, type ProjectedVisit, type RelativeUnit, type RelativeUnits, type RollingExpr, type Row, type Rule, type RuleDescription, type RuleScalar, type RuleSourceDescription, RuleTarget, type RuleValue, type ScopeOutOfBounds, type ScopeRef, type ScopedRef, type SortDir, type SourceEntry, type SourceOption, SourceOptionOrder, type SourcePrismaQuery, type SourceQuery, type SourceRowShape, type SourceSelect, type SourceSpec, type SourceSqlQuery, type SourceValues, SqlDialect, type StepRef, type StoredLens, type StrictAggregateRule, type StrictAll, type StrictAny, type StrictArrayCountRule, type StrictArrayPredicateRule, type StrictArrayPresenceRule, type StrictArrayRule, type StrictCondition, type StrictContainsRule, type StrictDateComparisonRule, type StrictDateDayRule, type StrictDateRangeRule, type StrictDateRule, type StrictEqualityRule, type StrictIfThenElse, type StrictMembershipRule, type StrictOrderedComparisonRule, type StrictPatternRule, type StrictPresenceRule, type StrictRangeRule, type StrictRule, type StrictStringBoundaryRule, type TimeZoneConfig, type ToPrismaOptions, type ToPrismaResult, type ToSqlOptions, type ToSqlResult, UsageError, VALUE_AGGREGATE_MODES, type ValidateRuleOptions, type ValidationIssue, type ValidationResult, type ValueAggregateMode, type ValueDescription, type ValueExpression, ValueShape, type ValueSourceFields, type ValueSourceOf, type ValueType, type WeekStart, type WhereSqlOptions, type WhereStep, type WindowFields, andWhere, assertValidCategorization, assertValidFieldMaps, assertValidNarrowing, assertValidRule, assertValidValue, bindLens, bindRule, categorize, check, clampLens, clockUnit, coerceRule, coerceValue, composeLens, createLens, describeRule, describeRuleSources, describeValue, engineGlobals, evaluateValue, executePrismaPlan, getAggregateOperators, getArrayOperators, getConditionShapeKeys, getLensRoot, getOperatorsForKind, getValueShape, indexBridges, inferValueType, lensVisit, listBindings, listFields, listLensBindings, matchAll, matchNothing, materializeSourceQuery, materializeSources, narrowRule, orWhere, orderRecords, parseScopeRef, pathSegments, prefixConditionFields, projectLens, projectRows, readLensValue, readScopeRef, registerEngineGlobals, stitchFieldMaps, storeLens, toLensSelect, toLensWhereSql, toPrisma, toSourceQueries, toSql, toWhereSql, validateCategorization, validateFieldMaps, validateNarrowing, validateRule, validateRuleInLens, validateValue, valueClockUnit, walkLensPath };
1699
+ export { AGGREGATE_MODES, ALL_KINDS, type Absent, type AggregateMode, type AggregateRule, type AggregateValue, type All, type Any, ArrayOperator, type ArrayRule, type BareLiteral, type Bridge, type BridgeCardinality, type BridgeDictionary, type BridgeEndpoint, type BridgeEntry, CATEGORIZATION_MATCHES, CLOCK_UNITS, type Categorization, type CategorizationDescription, type CategorizationMatch, type Category, type CheckData, type CheckOptions, type ClockUnit, type CoercedLiteral, type CompileOptions, type Condition, type ConditionOn, ConditionShape, type ConditionShapeKeys, DISTINCT_VALUE_KINDS, type DateConfig, type DateExpr, type DateInputOrExpr, type DateInputValue, type DateOffset, DateOperator, type DateRule, type DateRuleValue, type EdgeExpr, type EngineGlobalDefaults, type EngineGlobalPath, type EngineGlobalValues, type EngineGlobalsState, type EnumNarrowing, FieldKind, type FieldMapEntry, type FieldMapSet, type FuzzyConfig, type GroupByStep, type IfThenElse, type IfThenElseValue, type Lens, type LensClamps, type LensFieldMap, type LensModelEntry, type LensNarrowing, type LensNarrowingOn, type LensPathHop, type LensPathResolution, LensRefusal, type LensRelationSelect, type LensSelect, type LensSelectOptions, type LensValue, type LensWhereSql, type LensWhereSqlOptions, type ListBindingsOptions, type ListValue, type Magnitude, type MaterializeSourceQueryOptions, type ModelDefaultNarrowing, type ModelNarrowing, type ModelNarrowingOn, NUMERIC_KINDS, type NarrowingDefaults, type NumberOffset, ORDERED_VALUE_KINDS, Operator, type OperatorFamily, type OrderBy, type OrderedRuleValue, type PathProjection, type PeriodExpr, type PeriodUnit, type PrismaProvider, type PrismaStep, type PrismaWhere, type ProjectLensOptions, type ProjectRowsOptions, type ProjectedVisit, type RelativeUnit, type RelativeUnits, type RollingExpr, type Row, type Rule, type RuleDescription, type RuleScalar, type RuleSourceDescription, RuleTarget, type RuleValue, type ScopeOutOfBounds, type ScopeRef, type ScopedRef, type SortDir, type SourceEntry, type SourceOption, SourceOptionOrder, type SourcePrismaQuery, type SourceQuery, type SourceRowShape, type SourceSelect, type SourceSpec, type SourceSqlQuery, type SourceValues, SqlDialect, type StepRef, type StoredLens, type StrictAggregateRule, type StrictAll, type StrictAny, type StrictArrayCountRule, type StrictArrayPredicateRule, type StrictArrayPresenceRule, type StrictArrayRule, type StrictCondition, type StrictContainsRule, type StrictDateComparisonRule, type StrictDateDayRule, type StrictDateRangeRule, type StrictDateRule, type StrictEqualityRule, type StrictIfThenElse, type StrictMembershipRule, type StrictOrderedComparisonRule, type StrictPatternRule, type StrictPresenceRule, type StrictRangeRule, type StrictRule, type StrictStringBoundaryRule, type TimeZoneConfig, type ToPrismaOptions, type ToPrismaResult, type ToSqlOptions, type ToSqlResult, type UncheckedPath, UsageError, VALUE_AGGREGATE_MODES, type ValidateRuleOptions, type ValidationIssue, type ValidationResult, type ValueAggregateMode, type ValueDescription, type ValueExpression, ValueExpressionShape, ValueShape, type ValueSourceFields, type ValueSourceOf, type ValueType, type WeekStart, type WhereSqlOptions, type WhereStep, type WindowFields, aggregateModesForKind, andWhere, assertValidCategorization, assertValidFieldMaps, assertValidNarrowing, assertValidRule, assertValidValue, bindLens, bindRule, categorize, check, clampLens, clockUnit, coerceRule, coerceValue, composeLens, createLens, describeCategorization, describeRule, describeRuleSources, describeValue, engineGlobals, evaluateValue, executePrismaPlan, getAggregateOperators, getArrayOperators, getConditionShapeKeys, getLensRoot, getOperatorsForKind, getValueShape, indexBridges, inferValueType, lensVisit, listBindings, listFields, listItems, listLensBindings, matchAll, matchNothing, materializeSourceQuery, materializeSources, narrowRule, orWhere, orderRecords, parseScopeRef, pathSegments, prefixConditionFields, projectLens, projectRows, readLensValue, readScopeRef, registerEngineGlobals, stitchFieldMaps, storeLens, toLensSelect, toLensWhereSql, toPrisma, toSourceQueries, toSql, toWhereSql, validateCategorization, validateFieldMaps, validateNarrowing, validateRule, validateRuleInLens, validateValue, valueClockUnit, valueExpressionShape, walkLensPath };