@inixiative/json-rules 3.5.0 → 3.5.1
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/README.md +21 -7
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -651,6 +651,24 @@ declare const bindLens: <T extends Lens | LensNarrowing>(lensOrNarrowing: T, bin
|
|
|
651
651
|
/** The base lens a narrowing chain is rooted at; a lens is its own. Throws on a cyclic chain. */
|
|
652
652
|
declare const getLensRoot: (x: Lens | LensNarrowing) => Lens;
|
|
653
653
|
|
|
654
|
+
type Clamps = Pick<ModelDefaultNarrowing, 'where' | 'sources'>;
|
|
655
|
+
/** Clamps for {@link clampLens}: a `root` where, and per-map model-default wheres and
|
|
656
|
+
* source wheres. */
|
|
657
|
+
type LensClamps = {
|
|
658
|
+
root?: Pick<ModelDefaultNarrowing, 'where'>;
|
|
659
|
+
mapDefaults?: Record<string, {
|
|
660
|
+
models: Record<string, Clamps>;
|
|
661
|
+
}>;
|
|
662
|
+
};
|
|
663
|
+
/**
|
|
664
|
+
* The lens with `clamps` ANDed into its first narrowing over the base lens (one is added over a
|
|
665
|
+
* bare lens). A clamp that reads what a later layer hides belongs there: only the first layer's
|
|
666
|
+
* clamps read the whole schema. A `where` ANDs with the one in place; a source's `where` ANDs
|
|
667
|
+
* and its `label` / `groupBy` win. Wheres only narrow; a source clamp can add an option set for
|
|
668
|
+
* a field, or relabel or regroup one, but never widens what rows or columns the lens shows.
|
|
669
|
+
*/
|
|
670
|
+
declare const clampLens: (lens: Lens | LensNarrowing, clamps: LensClamps) => LensNarrowing;
|
|
671
|
+
|
|
654
672
|
/** Stamp `coerceType` onto every field rule from the lens's field map: the rule carries its
|
|
655
673
|
* coercion; `check()` never infers types from values. A relation node's condition / filter stamp
|
|
656
674
|
* against the relation's model; below a Json boundary the kind is undeclared, so nothing is
|
|
@@ -881,7 +899,8 @@ type SourcePrismaQuery = {
|
|
|
881
899
|
distinct?: string[];
|
|
882
900
|
select: SourceSelect;
|
|
883
901
|
where: PrismaWhere;
|
|
884
|
-
/** Present
|
|
902
|
+
/** Present when the where needs `executePrismaPlan`: a count step, or a column reference to
|
|
903
|
+
* resolve. Run `executePrismaPlan({ steps }, prisma)` and query with the where it returns. */
|
|
885
904
|
steps?: PrismaStep[];
|
|
886
905
|
};
|
|
887
906
|
/** `sql` is null when the composed where uses a predicate SQL can't express
|
|
@@ -1139,4 +1158,4 @@ declare const toSql: (rule: Condition, compileOptions?: ToSqlOptions) => ToSqlRe
|
|
|
1139
1158
|
*/
|
|
1140
1159
|
declare const orderRecords: <T>(items: readonly T[], orderBy: OrderBy) => T[];
|
|
1141
1160
|
|
|
1142
|
-
export { ALL_KINDS, type AggregateMode, type AggregateRule, type All, type Any, ArrayOperator, type ArrayRule, type Bridge, type BridgeCardinality, type BridgeDictionary, type BridgeEndpoint, type CheckData, type CheckOptions, type CompileOptions, type Condition, type DateConfig, type DateExpr, type DateInputOrExpr, type DateInputValue, type DateOffset, DateOperator, type DateRule, type DateRuleValue, type EdgeExpr, type EngineGlobalsState, type EnumNarrowing, FieldKind, type FieldMap, type FieldMapEntry, type FieldMapSet, type FuzzyConfig, type GroupByStep, type IfThenElse, type Lens, type LensNarrowing, type LensPathHop, type LensPathResolution, LensRefusal, type LensRelationSelect, type LensSelect, type LensSelectOptions, type LensValue, type ListBindingsOptions, 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 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, type SourcePrismaQuery, type SourceQuery, type SourceRowShape, type SourceSelect, type SourceSpec, type SourceSqlQuery, type SourceValues, 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, type ValidateRuleOptions, type ValidationIssue, type ValidationResult, ValueShape, type ValueSourceFields, type ValueSourceOf, type WeekStart, type WhereStep, type WindowFields, assertValidFieldMaps, assertValidNarrowing, assertValidRule, bindLens, bindRule, check, coerceRule, composeLens, createLens, describeRule, describeRuleSources, engineGlobals, executePrismaPlan, getAggregateOperators, getArrayOperators, getLensRoot, getOperatorsForKind, getValueShape, indexBridges, lensVisit, listBindings, listLensBindings, materializeSourceQuery, materializeSources, narrowRule, orderRecords, parseScopeRef, projectLens, projectRows, readLensValue, readScopeRef, stitchFieldMaps, storeLens, toLensSelect, toPrisma, toSourceQueries, toSql, validateFieldMaps, validateNarrowing, validateRule, validateRuleInLens, walkLensPath };
|
|
1161
|
+
export { ALL_KINDS, type AggregateMode, type AggregateRule, type All, type Any, ArrayOperator, type ArrayRule, type Bridge, type BridgeCardinality, type BridgeDictionary, type BridgeEndpoint, type CheckData, type CheckOptions, type CompileOptions, type Condition, type DateConfig, type DateExpr, type DateInputOrExpr, type DateInputValue, type DateOffset, DateOperator, type DateRule, type DateRuleValue, type EdgeExpr, type EngineGlobalsState, type EnumNarrowing, FieldKind, type FieldMap, type FieldMapEntry, type FieldMapSet, type FuzzyConfig, type GroupByStep, type IfThenElse, type Lens, type LensClamps, type LensNarrowing, type LensPathHop, type LensPathResolution, LensRefusal, type LensRelationSelect, type LensSelect, type LensSelectOptions, type LensValue, type ListBindingsOptions, 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 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, type SourcePrismaQuery, type SourceQuery, type SourceRowShape, type SourceSelect, type SourceSpec, type SourceSqlQuery, type SourceValues, 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, type ValidateRuleOptions, type ValidationIssue, type ValidationResult, ValueShape, type ValueSourceFields, type ValueSourceOf, type WeekStart, type WhereStep, type WindowFields, assertValidFieldMaps, assertValidNarrowing, assertValidRule, bindLens, bindRule, check, clampLens, coerceRule, composeLens, createLens, describeRule, describeRuleSources, engineGlobals, executePrismaPlan, getAggregateOperators, getArrayOperators, getLensRoot, getOperatorsForKind, getValueShape, indexBridges, lensVisit, listBindings, listLensBindings, materializeSourceQuery, materializeSources, narrowRule, orderRecords, parseScopeRef, projectLens, projectRows, readLensValue, readScopeRef, stitchFieldMaps, storeLens, toLensSelect, toPrisma, toSourceQueries, toSql, validateFieldMaps, validateNarrowing, validateRule, validateRuleInLens, walkLensPath };
|
package/dist/index.d.ts
CHANGED
|
@@ -651,6 +651,24 @@ declare const bindLens: <T extends Lens | LensNarrowing>(lensOrNarrowing: T, bin
|
|
|
651
651
|
/** The base lens a narrowing chain is rooted at; a lens is its own. Throws on a cyclic chain. */
|
|
652
652
|
declare const getLensRoot: (x: Lens | LensNarrowing) => Lens;
|
|
653
653
|
|
|
654
|
+
type Clamps = Pick<ModelDefaultNarrowing, 'where' | 'sources'>;
|
|
655
|
+
/** Clamps for {@link clampLens}: a `root` where, and per-map model-default wheres and
|
|
656
|
+
* source wheres. */
|
|
657
|
+
type LensClamps = {
|
|
658
|
+
root?: Pick<ModelDefaultNarrowing, 'where'>;
|
|
659
|
+
mapDefaults?: Record<string, {
|
|
660
|
+
models: Record<string, Clamps>;
|
|
661
|
+
}>;
|
|
662
|
+
};
|
|
663
|
+
/**
|
|
664
|
+
* The lens with `clamps` ANDed into its first narrowing over the base lens (one is added over a
|
|
665
|
+
* bare lens). A clamp that reads what a later layer hides belongs there: only the first layer's
|
|
666
|
+
* clamps read the whole schema. A `where` ANDs with the one in place; a source's `where` ANDs
|
|
667
|
+
* and its `label` / `groupBy` win. Wheres only narrow; a source clamp can add an option set for
|
|
668
|
+
* a field, or relabel or regroup one, but never widens what rows or columns the lens shows.
|
|
669
|
+
*/
|
|
670
|
+
declare const clampLens: (lens: Lens | LensNarrowing, clamps: LensClamps) => LensNarrowing;
|
|
671
|
+
|
|
654
672
|
/** Stamp `coerceType` onto every field rule from the lens's field map: the rule carries its
|
|
655
673
|
* coercion; `check()` never infers types from values. A relation node's condition / filter stamp
|
|
656
674
|
* against the relation's model; below a Json boundary the kind is undeclared, so nothing is
|
|
@@ -881,7 +899,8 @@ type SourcePrismaQuery = {
|
|
|
881
899
|
distinct?: string[];
|
|
882
900
|
select: SourceSelect;
|
|
883
901
|
where: PrismaWhere;
|
|
884
|
-
/** Present
|
|
902
|
+
/** Present when the where needs `executePrismaPlan`: a count step, or a column reference to
|
|
903
|
+
* resolve. Run `executePrismaPlan({ steps }, prisma)` and query with the where it returns. */
|
|
885
904
|
steps?: PrismaStep[];
|
|
886
905
|
};
|
|
887
906
|
/** `sql` is null when the composed where uses a predicate SQL can't express
|
|
@@ -1139,4 +1158,4 @@ declare const toSql: (rule: Condition, compileOptions?: ToSqlOptions) => ToSqlRe
|
|
|
1139
1158
|
*/
|
|
1140
1159
|
declare const orderRecords: <T>(items: readonly T[], orderBy: OrderBy) => T[];
|
|
1141
1160
|
|
|
1142
|
-
export { ALL_KINDS, type AggregateMode, type AggregateRule, type All, type Any, ArrayOperator, type ArrayRule, type Bridge, type BridgeCardinality, type BridgeDictionary, type BridgeEndpoint, type CheckData, type CheckOptions, type CompileOptions, type Condition, type DateConfig, type DateExpr, type DateInputOrExpr, type DateInputValue, type DateOffset, DateOperator, type DateRule, type DateRuleValue, type EdgeExpr, type EngineGlobalsState, type EnumNarrowing, FieldKind, type FieldMap, type FieldMapEntry, type FieldMapSet, type FuzzyConfig, type GroupByStep, type IfThenElse, type Lens, type LensNarrowing, type LensPathHop, type LensPathResolution, LensRefusal, type LensRelationSelect, type LensSelect, type LensSelectOptions, type LensValue, type ListBindingsOptions, 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 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, type SourcePrismaQuery, type SourceQuery, type SourceRowShape, type SourceSelect, type SourceSpec, type SourceSqlQuery, type SourceValues, 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, type ValidateRuleOptions, type ValidationIssue, type ValidationResult, ValueShape, type ValueSourceFields, type ValueSourceOf, type WeekStart, type WhereStep, type WindowFields, assertValidFieldMaps, assertValidNarrowing, assertValidRule, bindLens, bindRule, check, coerceRule, composeLens, createLens, describeRule, describeRuleSources, engineGlobals, executePrismaPlan, getAggregateOperators, getArrayOperators, getLensRoot, getOperatorsForKind, getValueShape, indexBridges, lensVisit, listBindings, listLensBindings, materializeSourceQuery, materializeSources, narrowRule, orderRecords, parseScopeRef, projectLens, projectRows, readLensValue, readScopeRef, stitchFieldMaps, storeLens, toLensSelect, toPrisma, toSourceQueries, toSql, validateFieldMaps, validateNarrowing, validateRule, validateRuleInLens, walkLensPath };
|
|
1161
|
+
export { ALL_KINDS, type AggregateMode, type AggregateRule, type All, type Any, ArrayOperator, type ArrayRule, type Bridge, type BridgeCardinality, type BridgeDictionary, type BridgeEndpoint, type CheckData, type CheckOptions, type CompileOptions, type Condition, type DateConfig, type DateExpr, type DateInputOrExpr, type DateInputValue, type DateOffset, DateOperator, type DateRule, type DateRuleValue, type EdgeExpr, type EngineGlobalsState, type EnumNarrowing, FieldKind, type FieldMap, type FieldMapEntry, type FieldMapSet, type FuzzyConfig, type GroupByStep, type IfThenElse, type Lens, type LensClamps, type LensNarrowing, type LensPathHop, type LensPathResolution, LensRefusal, type LensRelationSelect, type LensSelect, type LensSelectOptions, type LensValue, type ListBindingsOptions, 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 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, type SourcePrismaQuery, type SourceQuery, type SourceRowShape, type SourceSelect, type SourceSpec, type SourceSqlQuery, type SourceValues, 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, type ValidateRuleOptions, type ValidationIssue, type ValidationResult, ValueShape, type ValueSourceFields, type ValueSourceOf, type WeekStart, type WhereStep, type WindowFields, assertValidFieldMaps, assertValidNarrowing, assertValidRule, bindLens, bindRule, check, clampLens, coerceRule, composeLens, createLens, describeRule, describeRuleSources, engineGlobals, executePrismaPlan, getAggregateOperators, getArrayOperators, getLensRoot, getOperatorsForKind, getValueShape, indexBridges, lensVisit, listBindings, listLensBindings, materializeSourceQuery, materializeSources, narrowRule, orderRecords, parseScopeRef, projectLens, projectRows, readLensValue, readScopeRef, stitchFieldMaps, storeLens, toLensSelect, toPrisma, toSourceQueries, toSql, validateFieldMaps, validateNarrowing, validateRule, validateRuleInLens, walkLensPath };
|