@inixiative/json-rules 2.17.1 → 2.18.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
@@ -417,11 +417,12 @@ declare const resolveFuzzy: (ruleFlag?: boolean | FuzzyConfig) => FuzzyConfig |
417
417
 
418
418
  type PrismaWhere = Record<string, unknown>;
419
419
  /** A selectable option — the standard `<select>` shape: a value with an optional display
420
- * label, plus the partition key when the source declares a `groupBy`. */
420
+ * label, plus the partition keys (index-aligned with the source's `groupBy` axes)
421
+ * when the source is grouped. */
421
422
  type SourceOption = {
422
423
  value: string;
423
424
  label?: string;
424
- group?: string;
425
+ groups?: string[];
425
426
  };
426
427
  type FieldMapEntry = {
427
428
  kind: 'scalar' | 'object' | 'enum' | 'bridge';
@@ -443,6 +444,12 @@ type FieldMapEntry = {
443
444
  * and for sourced fields (the fetched pairs from a materialized `SourceValues`).
444
445
  */
445
446
  options?: readonly SourceOption[];
447
+ /**
448
+ * Present on projection/surface output when the field's source partitions its
449
+ * options: the dotted to-one axes (relative to this model) whose values are
450
+ * each option's `groups`, index-aligned.
451
+ */
452
+ groupBy?: readonly string[];
446
453
  };
447
454
  type ModelEntry = {
448
455
  dbName?: string | null;
@@ -578,15 +585,15 @@ type ModelDefaultNarrowing = {
578
585
  type SourceSpec = {
579
586
  where: Condition;
580
587
  label?: string;
581
- groupBy?: string;
588
+ groupBy?: string | string[];
582
589
  } | {
583
590
  where?: Condition;
584
591
  label: string;
585
- groupBy?: string;
592
+ groupBy?: string | string[];
586
593
  } | {
587
594
  where?: Condition;
588
595
  label?: string;
589
- groupBy: string;
596
+ groupBy: string | string[];
590
597
  };
591
598
  /** A `sources` entry: a bare eligibility `Condition`, or a richer `SourceSpec`. */
592
599
  type SourceValue = Condition | SourceSpec;
@@ -680,8 +687,8 @@ type ProjectedVisit = {
680
687
  sources: Record<string, Condition[]>;
681
688
  /** Per-field display-label column for a sourced field (from a SourceSpec's `label`). */
682
689
  sourceLabels: Record<string, string>;
683
- /** Per-field option-partition path for a sourced field (from a SourceSpec's `groupBy`). */
684
- sourceGroupBys: Record<string, string>;
690
+ /** Per-field option-partition axes for a sourced field (from a SourceSpec's `groupBy`). */
691
+ sourceGroupBys: Record<string, string[]>;
685
692
  };
686
693
  type PathProjection = Map<string, ProjectedVisit>;
687
694
  /**
@@ -737,9 +744,9 @@ type SourceQuery = {
737
744
  field: string;
738
745
  /** Sibling column co-selected as each value's display label (from a SourceSpec's `label`). */
739
746
  label?: string;
740
- /** Option-partition path (from a SourceSpec's `groupBy`); its column is selected
741
- * nested in prisma and aliased `__group` in sql. */
742
- groupBy?: string;
747
+ /** Option-partition axes (from a SourceSpec's `groupBy`, normalized); each axis
748
+ * column is selected nested in prisma and aliased `__group_i` in sql. */
749
+ groupBy?: string[];
743
750
  composedWhere: Condition;
744
751
  prisma: SourcePrismaQuery;
745
752
  sql: SourceSqlQuery;
@@ -759,9 +766,10 @@ type SourceRowShape = 'prisma' | 'sql';
759
766
  /**
760
767
  * Materialize one compiled `SourceQuery`'s fetched rows into its `SourceValues` —
761
768
  * the executor-side counterpart of `sourceQueries`, so apps never hand-map rows.
762
- * `rowShape` names the wire format: prisma rows (default) nest the `groupBy` path
763
- * as related objects; sql rows carry it flat under the statement's `__group` alias.
764
- * Grouped queries fetch without DISTINCT, so dedup per (group, value) happens here.
769
+ * `rowShape` names the wire format: prisma rows (default) nest each `groupBy` axis
770
+ * as related objects; sql rows carry them flat under the statement's `__group_i`
771
+ * aliases. Grouped queries fetch without DISTINCT, so dedup per (groups, value)
772
+ * happens here.
765
773
  */
766
774
  declare const sourceValuesFromQueryRows: (query: SourceQuery, rows: readonly Row$1[], opts?: {
767
775
  rowShape?: SourceRowShape;
package/dist/index.d.ts CHANGED
@@ -417,11 +417,12 @@ declare const resolveFuzzy: (ruleFlag?: boolean | FuzzyConfig) => FuzzyConfig |
417
417
 
418
418
  type PrismaWhere = Record<string, unknown>;
419
419
  /** A selectable option — the standard `<select>` shape: a value with an optional display
420
- * label, plus the partition key when the source declares a `groupBy`. */
420
+ * label, plus the partition keys (index-aligned with the source's `groupBy` axes)
421
+ * when the source is grouped. */
421
422
  type SourceOption = {
422
423
  value: string;
423
424
  label?: string;
424
- group?: string;
425
+ groups?: string[];
425
426
  };
426
427
  type FieldMapEntry = {
427
428
  kind: 'scalar' | 'object' | 'enum' | 'bridge';
@@ -443,6 +444,12 @@ type FieldMapEntry = {
443
444
  * and for sourced fields (the fetched pairs from a materialized `SourceValues`).
444
445
  */
445
446
  options?: readonly SourceOption[];
447
+ /**
448
+ * Present on projection/surface output when the field's source partitions its
449
+ * options: the dotted to-one axes (relative to this model) whose values are
450
+ * each option's `groups`, index-aligned.
451
+ */
452
+ groupBy?: readonly string[];
446
453
  };
447
454
  type ModelEntry = {
448
455
  dbName?: string | null;
@@ -578,15 +585,15 @@ type ModelDefaultNarrowing = {
578
585
  type SourceSpec = {
579
586
  where: Condition;
580
587
  label?: string;
581
- groupBy?: string;
588
+ groupBy?: string | string[];
582
589
  } | {
583
590
  where?: Condition;
584
591
  label: string;
585
- groupBy?: string;
592
+ groupBy?: string | string[];
586
593
  } | {
587
594
  where?: Condition;
588
595
  label?: string;
589
- groupBy: string;
596
+ groupBy: string | string[];
590
597
  };
591
598
  /** A `sources` entry: a bare eligibility `Condition`, or a richer `SourceSpec`. */
592
599
  type SourceValue = Condition | SourceSpec;
@@ -680,8 +687,8 @@ type ProjectedVisit = {
680
687
  sources: Record<string, Condition[]>;
681
688
  /** Per-field display-label column for a sourced field (from a SourceSpec's `label`). */
682
689
  sourceLabels: Record<string, string>;
683
- /** Per-field option-partition path for a sourced field (from a SourceSpec's `groupBy`). */
684
- sourceGroupBys: Record<string, string>;
690
+ /** Per-field option-partition axes for a sourced field (from a SourceSpec's `groupBy`). */
691
+ sourceGroupBys: Record<string, string[]>;
685
692
  };
686
693
  type PathProjection = Map<string, ProjectedVisit>;
687
694
  /**
@@ -737,9 +744,9 @@ type SourceQuery = {
737
744
  field: string;
738
745
  /** Sibling column co-selected as each value's display label (from a SourceSpec's `label`). */
739
746
  label?: string;
740
- /** Option-partition path (from a SourceSpec's `groupBy`); its column is selected
741
- * nested in prisma and aliased `__group` in sql. */
742
- groupBy?: string;
747
+ /** Option-partition axes (from a SourceSpec's `groupBy`, normalized); each axis
748
+ * column is selected nested in prisma and aliased `__group_i` in sql. */
749
+ groupBy?: string[];
743
750
  composedWhere: Condition;
744
751
  prisma: SourcePrismaQuery;
745
752
  sql: SourceSqlQuery;
@@ -759,9 +766,10 @@ type SourceRowShape = 'prisma' | 'sql';
759
766
  /**
760
767
  * Materialize one compiled `SourceQuery`'s fetched rows into its `SourceValues` —
761
768
  * the executor-side counterpart of `sourceQueries`, so apps never hand-map rows.
762
- * `rowShape` names the wire format: prisma rows (default) nest the `groupBy` path
763
- * as related objects; sql rows carry it flat under the statement's `__group` alias.
764
- * Grouped queries fetch without DISTINCT, so dedup per (group, value) happens here.
769
+ * `rowShape` names the wire format: prisma rows (default) nest each `groupBy` axis
770
+ * as related objects; sql rows carry them flat under the statement's `__group_i`
771
+ * aliases. Grouped queries fetch without DISTINCT, so dedup per (groups, value)
772
+ * happens here.
765
773
  */
766
774
  declare const sourceValuesFromQueryRows: (query: SourceQuery, rows: readonly Row$1[], opts?: {
767
775
  rowShape?: SourceRowShape;