@niscorp/vex 0.2.2 → 0.3.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +172 -0
  2. package/DESIGN.md +66 -3
  3. package/DOCS.md +156 -12
  4. package/dist/adapters/express/index.cjs +102 -17
  5. package/dist/adapters/express/index.cjs.map +1 -1
  6. package/dist/adapters/express/index.d.cts +2 -2
  7. package/dist/adapters/express/index.d.ts +2 -2
  8. package/dist/adapters/express/index.js +2 -2
  9. package/dist/adapters/hono/index.cjs +121 -22
  10. package/dist/adapters/hono/index.cjs.map +1 -1
  11. package/dist/adapters/hono/index.d.cts +2 -2
  12. package/dist/adapters/hono/index.d.ts +2 -2
  13. package/dist/adapters/hono/index.js +21 -7
  14. package/dist/adapters/hono/index.js.map +1 -1
  15. package/dist/agent/index.cjs +2 -0
  16. package/dist/agent/index.cjs.map +1 -1
  17. package/dist/agent/index.d.cts +1 -1
  18. package/dist/agent/index.d.ts +1 -1
  19. package/dist/agent/index.js +1 -1
  20. package/dist/{chunk-HF25Q53I.js → chunk-H4BHW76Q.js} +6 -3
  21. package/dist/chunk-H4BHW76Q.js.map +1 -0
  22. package/dist/{chunk-HCEH55PP.js → chunk-IQM4SQE2.js} +123 -21
  23. package/dist/chunk-IQM4SQE2.js.map +1 -0
  24. package/dist/{handler-Cql8SJ3F.d.cts → handler-BGCL6_Si.d.ts} +3 -2
  25. package/dist/{handler-mICf9ins.d.ts → handler-CMrjTXNx.d.cts} +3 -2
  26. package/dist/index.cjs +163 -35
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +3 -3
  29. package/dist/index.d.ts +3 -3
  30. package/dist/index.js +44 -22
  31. package/dist/index.js.map +1 -1
  32. package/dist/{types-BRvMB6IM.d.cts → types-Bi-Lg86b.d.cts} +48 -2
  33. package/dist/{types-BRvMB6IM.d.ts → types-Bi-Lg86b.d.ts} +48 -2
  34. package/package.json +5 -5
  35. package/dist/chunk-HCEH55PP.js.map +0 -1
  36. package/dist/chunk-HF25Q53I.js.map +0 -1
@@ -502,6 +502,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
502
502
  field: z.ZodString;
503
503
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
504
504
  }, z.core.$strict>;
505
+ }, z.core.$strict>, z.ZodObject<{
506
+ $returned: z.ZodString;
505
507
  }, z.core.$strict>]>>;
506
508
  onConflict: z.ZodOptional<z.ZodObject<{
507
509
  target: z.ZodArray<z.ZodString>;
@@ -513,6 +515,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
513
515
  field: z.ZodString;
514
516
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
515
517
  }, z.core.$strict>;
518
+ }, z.core.$strict>, z.ZodObject<{
519
+ $returned: z.ZodString;
516
520
  }, z.core.$strict>]>>>;
517
521
  }, z.core.$strict>>;
518
522
  }, z.core.$strict>, z.ZodObject<{
@@ -529,6 +533,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
529
533
  field: z.ZodString;
530
534
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
531
535
  }, z.core.$strict>;
536
+ }, z.core.$strict>, z.ZodObject<{
537
+ $returned: z.ZodString;
532
538
  }, z.core.$strict>]>, z.ZodObject<{
533
539
  $item: z.ZodString;
534
540
  }, z.core.$strict>]>>;
@@ -542,6 +548,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
542
548
  field: z.ZodString;
543
549
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
544
550
  }, z.core.$strict>;
551
+ }, z.core.$strict>, z.ZodObject<{
552
+ $returned: z.ZodString;
545
553
  }, z.core.$strict>]>>>;
546
554
  }, z.core.$strict>>;
547
555
  }, z.core.$strict>, z.ZodObject<{
@@ -555,6 +563,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
555
563
  field: z.ZodString;
556
564
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
557
565
  }, z.core.$strict>;
566
+ }, z.core.$strict>, z.ZodObject<{
567
+ $returned: z.ZodString;
558
568
  }, z.core.$strict>]>>;
559
569
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
560
570
  }, z.core.$strict>, z.ZodObject<{
@@ -572,6 +582,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
572
582
  field: z.ZodString;
573
583
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
574
584
  }, z.core.$strict>;
585
+ }, z.core.$strict>, z.ZodObject<{
586
+ $returned: z.ZodString;
575
587
  }, z.core.$strict>]>>;
576
588
  insert: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
577
589
  $context: z.ZodString;
@@ -581,6 +593,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
581
593
  field: z.ZodString;
582
594
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
583
595
  }, z.core.$strict>;
596
+ }, z.core.$strict>, z.ZodObject<{
597
+ $returned: z.ZodString;
584
598
  }, z.core.$strict>]>>>;
585
599
  key: z.ZodString;
586
600
  }, z.core.$strict>], "op">;
@@ -599,6 +613,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
599
613
  field: z.ZodString;
600
614
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
601
615
  }, z.core.$strict>;
616
+ }, z.core.$strict>, z.ZodObject<{
617
+ $returned: z.ZodString;
602
618
  }, z.core.$strict>]>>;
603
619
  onConflict: z.ZodOptional<z.ZodObject<{
604
620
  target: z.ZodArray<z.ZodString>;
@@ -610,6 +626,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
610
626
  field: z.ZodString;
611
627
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
612
628
  }, z.core.$strict>;
629
+ }, z.core.$strict>, z.ZodObject<{
630
+ $returned: z.ZodString;
613
631
  }, z.core.$strict>]>>>;
614
632
  }, z.core.$strict>>;
615
633
  }, z.core.$strict>, z.ZodObject<{
@@ -626,6 +644,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
626
644
  field: z.ZodString;
627
645
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
628
646
  }, z.core.$strict>;
647
+ }, z.core.$strict>, z.ZodObject<{
648
+ $returned: z.ZodString;
629
649
  }, z.core.$strict>]>, z.ZodObject<{
630
650
  $item: z.ZodString;
631
651
  }, z.core.$strict>]>>;
@@ -639,6 +659,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
639
659
  field: z.ZodString;
640
660
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
641
661
  }, z.core.$strict>;
662
+ }, z.core.$strict>, z.ZodObject<{
663
+ $returned: z.ZodString;
642
664
  }, z.core.$strict>]>>>;
643
665
  }, z.core.$strict>>;
644
666
  }, z.core.$strict>, z.ZodObject<{
@@ -652,6 +674,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
652
674
  field: z.ZodString;
653
675
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
654
676
  }, z.core.$strict>;
677
+ }, z.core.$strict>, z.ZodObject<{
678
+ $returned: z.ZodString;
655
679
  }, z.core.$strict>]>>;
656
680
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
657
681
  }, z.core.$strict>, z.ZodObject<{
@@ -669,6 +693,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
669
693
  field: z.ZodString;
670
694
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
671
695
  }, z.core.$strict>;
696
+ }, z.core.$strict>, z.ZodObject<{
697
+ $returned: z.ZodString;
672
698
  }, z.core.$strict>]>>;
673
699
  insert: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
674
700
  $context: z.ZodString;
@@ -678,6 +704,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
678
704
  field: z.ZodString;
679
705
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
680
706
  }, z.core.$strict>;
707
+ }, z.core.$strict>, z.ZodObject<{
708
+ $returned: z.ZodString;
681
709
  }, z.core.$strict>]>>>;
682
710
  key: z.ZodString;
683
711
  }, z.core.$strict>], "op">, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -691,6 +719,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
691
719
  field: z.ZodString;
692
720
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
693
721
  }, z.core.$strict>;
722
+ }, z.core.$strict>, z.ZodObject<{
723
+ $returned: z.ZodString;
694
724
  }, z.core.$strict>]>>;
695
725
  onConflict: z.ZodOptional<z.ZodObject<{
696
726
  target: z.ZodArray<z.ZodString>;
@@ -702,6 +732,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
702
732
  field: z.ZodString;
703
733
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
704
734
  }, z.core.$strict>;
735
+ }, z.core.$strict>, z.ZodObject<{
736
+ $returned: z.ZodString;
705
737
  }, z.core.$strict>]>>>;
706
738
  }, z.core.$strict>>;
707
739
  }, z.core.$strict>, z.ZodObject<{
@@ -718,6 +750,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
718
750
  field: z.ZodString;
719
751
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
720
752
  }, z.core.$strict>;
753
+ }, z.core.$strict>, z.ZodObject<{
754
+ $returned: z.ZodString;
721
755
  }, z.core.$strict>]>, z.ZodObject<{
722
756
  $item: z.ZodString;
723
757
  }, z.core.$strict>]>>;
@@ -731,6 +765,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
731
765
  field: z.ZodString;
732
766
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
733
767
  }, z.core.$strict>;
768
+ }, z.core.$strict>, z.ZodObject<{
769
+ $returned: z.ZodString;
734
770
  }, z.core.$strict>]>>>;
735
771
  }, z.core.$strict>>;
736
772
  }, z.core.$strict>, z.ZodObject<{
@@ -744,6 +780,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
744
780
  field: z.ZodString;
745
781
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
746
782
  }, z.core.$strict>;
783
+ }, z.core.$strict>, z.ZodObject<{
784
+ $returned: z.ZodString;
747
785
  }, z.core.$strict>]>>;
748
786
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
749
787
  }, z.core.$strict>, z.ZodObject<{
@@ -761,6 +799,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
761
799
  field: z.ZodString;
762
800
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
763
801
  }, z.core.$strict>;
802
+ }, z.core.$strict>, z.ZodObject<{
803
+ $returned: z.ZodString;
764
804
  }, z.core.$strict>]>>;
765
805
  insert: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
766
806
  $context: z.ZodString;
@@ -770,6 +810,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
770
810
  field: z.ZodString;
771
811
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
772
812
  }, z.core.$strict>;
813
+ }, z.core.$strict>, z.ZodObject<{
814
+ $returned: z.ZodString;
773
815
  }, z.core.$strict>]>>>;
774
816
  key: z.ZodString;
775
817
  }, z.core.$strict>], "op">>]>;
@@ -781,10 +823,13 @@ type LookupValue = {
781
823
  where: Filter;
782
824
  };
783
825
  };
826
+ type ReturnedRef = {
827
+ $returned: string;
828
+ };
784
829
  type ItemRef = {
785
830
  $item: string;
786
831
  };
787
- type MutationValue = FieldOrValue | LookupValue;
832
+ type MutationValue = FieldOrValue | LookupValue | ReturnedRef;
788
833
  type ResolvedOnConflict = {
789
834
  target: string[];
790
835
  set?: Record<string, MutationValue>;
@@ -1443,6 +1488,7 @@ type QueryEngineConfig = {
1443
1488
  maxNestingDepth?: number;
1444
1489
  defaultLimit?: number;
1445
1490
  maxLimit?: number;
1491
+ capAuthored?: boolean;
1446
1492
  rejectCartesianProducts?: boolean;
1447
1493
  warnUnindexedFilters?: boolean;
1448
1494
  rejectUnindexedFilters?: boolean;
@@ -1488,4 +1534,4 @@ type ExecuteOptions = {
1488
1534
  onChange?: (response: QueryResponse) => void;
1489
1535
  };
1490
1536
 
1491
- export { QueryRequestSchema as $, type AnalysisConfig as A, type BoundParams as B, type CompiledQuery as C, type DatabaseSchema as D, type EntitySchema as E, type FieldSchema as F, type GenerateDsl as G, type LiveRowsStats as H, type IndexSchema as I, type LookupValue as J, type MapToShape as K, type LiveRowsConfig as L, type MutationDefinition as M, type Mutation as N, type MutationCacheEntry as O, type ParamSlot as P, type QueryEngineConfig as Q, type ResolvedQuery as R, type ScopePolicy as S, MutationDefinitionSchema as T, MutationSchema as U, type MutationValue as V, type NamedScopeBehaviors as W, type NormalizedType as X, type OkCacheEntry as Y, type QueryErrorResponse as Z, type QueryRequest as _, type QueryEngine as a, type QueryResponse as a0, QuerySchema as a1, REFRESH_MODES as a2, type RelationSchema as a3, type ResolvedField as a4, type ResolvedFilter as a5, type ResolvedJoin as a6, type ResolvedMutation as a7, type ResolvedOnConflict as a8, type ResolvedSemantic as a9, type ResolvedSource as aa, SCOPE_VERBS as ab, type ScopeBehaviors as ac, type ScopeBinding as ad, type ScopeEntityRule as ae, type ScopeMatch as af, type ScopeRef as ag, type ScopeRule as ah, type ScopeRules as ai, type ScopeSet as aj, type ScopeValues as ak, type SortEntry as al, type Source as am, type TestResult as an, type UnsatisfiableCacheEntry as ao, type VexEvent as ap, type VexEventHandler as aq, createScopePolicy as ar, isRefresh as as, mergeScopePolicies as at, scopeBindings as au, scopeGrants as av, scopeProfiles as aw, type Query as b, type AnalysisResult as c, type ContextMeta as d, type DatabaseAdapter as e, type Row as f, type ResolvedExists as g, type FieldOrValue as h, type Filter as i, type QueryErrorCode as j, type CacheBackend as k, type CacheEntry as l, type Refresh as m, type ContextContract as n, type AdapterCapabilities as o, type AggregateExpression as p, AggregateExpressionSchema as q, type ComputeExpression as r, ComputeExpressionSchema as s, type ContextRef as t, type CoreMutation as u, type ExecuteOptions as v, FilterSchema as w, type GenerationCaller as x, type IntrospectOptions as y, type ItemRef as z };
1537
+ export { QueryRequestSchema as $, type AnalysisConfig as A, type BoundParams as B, type CompiledQuery as C, type DatabaseSchema as D, type EntitySchema as E, type FieldSchema as F, type GenerateDsl as G, type LiveRowsStats as H, type IndexSchema as I, type LookupValue as J, type MapToShape as K, type LiveRowsConfig as L, type MutationDefinition as M, type Mutation as N, type MutationCacheEntry as O, type ParamSlot as P, type QueryEngineConfig as Q, type ResolvedQuery as R, type ScopePolicy as S, MutationDefinitionSchema as T, MutationSchema as U, type MutationValue as V, type NamedScopeBehaviors as W, type NormalizedType as X, type OkCacheEntry as Y, type QueryErrorResponse as Z, type QueryRequest as _, type QueryEngine as a, type QueryResponse as a0, QuerySchema as a1, REFRESH_MODES as a2, type RelationSchema as a3, type ResolvedField as a4, type ResolvedFilter as a5, type ResolvedJoin as a6, type ResolvedMutation as a7, type ResolvedOnConflict as a8, type ResolvedSemantic as a9, type ResolvedSource as aa, type ReturnedRef as ab, SCOPE_VERBS as ac, type ScopeBehaviors as ad, type ScopeBinding as ae, type ScopeEntityRule as af, type ScopeMatch as ag, type ScopeRef as ah, type ScopeRule as ai, type ScopeRules as aj, type ScopeSet as ak, type ScopeValues as al, type SortEntry as am, type Source as an, type TestResult as ao, type UnsatisfiableCacheEntry as ap, type VexEvent as aq, type VexEventHandler as ar, createScopePolicy as as, isRefresh as at, mergeScopePolicies as au, scopeBindings as av, scopeGrants as aw, scopeProfiles as ax, type Query as b, type AnalysisResult as c, type ContextMeta as d, type DatabaseAdapter as e, type Row as f, type ResolvedExists as g, type FieldOrValue as h, type Filter as i, type QueryErrorCode as j, type CacheBackend as k, type CacheEntry as l, type Refresh as m, type ContextContract as n, type AdapterCapabilities as o, type AggregateExpression as p, AggregateExpressionSchema as q, type ComputeExpression as r, ComputeExpressionSchema as s, type ContextRef as t, type CoreMutation as u, type ExecuteOptions as v, FilterSchema as w, type GenerationCaller as x, type IntrospectOptions as y, type ItemRef as z };
@@ -502,6 +502,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
502
502
  field: z.ZodString;
503
503
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
504
504
  }, z.core.$strict>;
505
+ }, z.core.$strict>, z.ZodObject<{
506
+ $returned: z.ZodString;
505
507
  }, z.core.$strict>]>>;
506
508
  onConflict: z.ZodOptional<z.ZodObject<{
507
509
  target: z.ZodArray<z.ZodString>;
@@ -513,6 +515,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
513
515
  field: z.ZodString;
514
516
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
515
517
  }, z.core.$strict>;
518
+ }, z.core.$strict>, z.ZodObject<{
519
+ $returned: z.ZodString;
516
520
  }, z.core.$strict>]>>>;
517
521
  }, z.core.$strict>>;
518
522
  }, z.core.$strict>, z.ZodObject<{
@@ -529,6 +533,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
529
533
  field: z.ZodString;
530
534
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
531
535
  }, z.core.$strict>;
536
+ }, z.core.$strict>, z.ZodObject<{
537
+ $returned: z.ZodString;
532
538
  }, z.core.$strict>]>, z.ZodObject<{
533
539
  $item: z.ZodString;
534
540
  }, z.core.$strict>]>>;
@@ -542,6 +548,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
542
548
  field: z.ZodString;
543
549
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
544
550
  }, z.core.$strict>;
551
+ }, z.core.$strict>, z.ZodObject<{
552
+ $returned: z.ZodString;
545
553
  }, z.core.$strict>]>>>;
546
554
  }, z.core.$strict>>;
547
555
  }, z.core.$strict>, z.ZodObject<{
@@ -555,6 +563,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
555
563
  field: z.ZodString;
556
564
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
557
565
  }, z.core.$strict>;
566
+ }, z.core.$strict>, z.ZodObject<{
567
+ $returned: z.ZodString;
558
568
  }, z.core.$strict>]>>;
559
569
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
560
570
  }, z.core.$strict>, z.ZodObject<{
@@ -572,6 +582,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
572
582
  field: z.ZodString;
573
583
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
574
584
  }, z.core.$strict>;
585
+ }, z.core.$strict>, z.ZodObject<{
586
+ $returned: z.ZodString;
575
587
  }, z.core.$strict>]>>;
576
588
  insert: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
577
589
  $context: z.ZodString;
@@ -581,6 +593,8 @@ declare const MutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
581
593
  field: z.ZodString;
582
594
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
583
595
  }, z.core.$strict>;
596
+ }, z.core.$strict>, z.ZodObject<{
597
+ $returned: z.ZodString;
584
598
  }, z.core.$strict>]>>>;
585
599
  key: z.ZodString;
586
600
  }, z.core.$strict>], "op">;
@@ -599,6 +613,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
599
613
  field: z.ZodString;
600
614
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
601
615
  }, z.core.$strict>;
616
+ }, z.core.$strict>, z.ZodObject<{
617
+ $returned: z.ZodString;
602
618
  }, z.core.$strict>]>>;
603
619
  onConflict: z.ZodOptional<z.ZodObject<{
604
620
  target: z.ZodArray<z.ZodString>;
@@ -610,6 +626,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
610
626
  field: z.ZodString;
611
627
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
612
628
  }, z.core.$strict>;
629
+ }, z.core.$strict>, z.ZodObject<{
630
+ $returned: z.ZodString;
613
631
  }, z.core.$strict>]>>>;
614
632
  }, z.core.$strict>>;
615
633
  }, z.core.$strict>, z.ZodObject<{
@@ -626,6 +644,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
626
644
  field: z.ZodString;
627
645
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
628
646
  }, z.core.$strict>;
647
+ }, z.core.$strict>, z.ZodObject<{
648
+ $returned: z.ZodString;
629
649
  }, z.core.$strict>]>, z.ZodObject<{
630
650
  $item: z.ZodString;
631
651
  }, z.core.$strict>]>>;
@@ -639,6 +659,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
639
659
  field: z.ZodString;
640
660
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
641
661
  }, z.core.$strict>;
662
+ }, z.core.$strict>, z.ZodObject<{
663
+ $returned: z.ZodString;
642
664
  }, z.core.$strict>]>>>;
643
665
  }, z.core.$strict>>;
644
666
  }, z.core.$strict>, z.ZodObject<{
@@ -652,6 +674,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
652
674
  field: z.ZodString;
653
675
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
654
676
  }, z.core.$strict>;
677
+ }, z.core.$strict>, z.ZodObject<{
678
+ $returned: z.ZodString;
655
679
  }, z.core.$strict>]>>;
656
680
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
657
681
  }, z.core.$strict>, z.ZodObject<{
@@ -669,6 +693,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
669
693
  field: z.ZodString;
670
694
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
671
695
  }, z.core.$strict>;
696
+ }, z.core.$strict>, z.ZodObject<{
697
+ $returned: z.ZodString;
672
698
  }, z.core.$strict>]>>;
673
699
  insert: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
674
700
  $context: z.ZodString;
@@ -678,6 +704,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
678
704
  field: z.ZodString;
679
705
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
680
706
  }, z.core.$strict>;
707
+ }, z.core.$strict>, z.ZodObject<{
708
+ $returned: z.ZodString;
681
709
  }, z.core.$strict>]>>>;
682
710
  key: z.ZodString;
683
711
  }, z.core.$strict>], "op">, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -691,6 +719,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
691
719
  field: z.ZodString;
692
720
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
693
721
  }, z.core.$strict>;
722
+ }, z.core.$strict>, z.ZodObject<{
723
+ $returned: z.ZodString;
694
724
  }, z.core.$strict>]>>;
695
725
  onConflict: z.ZodOptional<z.ZodObject<{
696
726
  target: z.ZodArray<z.ZodString>;
@@ -702,6 +732,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
702
732
  field: z.ZodString;
703
733
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
704
734
  }, z.core.$strict>;
735
+ }, z.core.$strict>, z.ZodObject<{
736
+ $returned: z.ZodString;
705
737
  }, z.core.$strict>]>>>;
706
738
  }, z.core.$strict>>;
707
739
  }, z.core.$strict>, z.ZodObject<{
@@ -718,6 +750,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
718
750
  field: z.ZodString;
719
751
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
720
752
  }, z.core.$strict>;
753
+ }, z.core.$strict>, z.ZodObject<{
754
+ $returned: z.ZodString;
721
755
  }, z.core.$strict>]>, z.ZodObject<{
722
756
  $item: z.ZodString;
723
757
  }, z.core.$strict>]>>;
@@ -731,6 +765,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
731
765
  field: z.ZodString;
732
766
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
733
767
  }, z.core.$strict>;
768
+ }, z.core.$strict>, z.ZodObject<{
769
+ $returned: z.ZodString;
734
770
  }, z.core.$strict>]>>>;
735
771
  }, z.core.$strict>>;
736
772
  }, z.core.$strict>, z.ZodObject<{
@@ -744,6 +780,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
744
780
  field: z.ZodString;
745
781
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
746
782
  }, z.core.$strict>;
783
+ }, z.core.$strict>, z.ZodObject<{
784
+ $returned: z.ZodString;
747
785
  }, z.core.$strict>]>>;
748
786
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
749
787
  }, z.core.$strict>, z.ZodObject<{
@@ -761,6 +799,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
761
799
  field: z.ZodString;
762
800
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
763
801
  }, z.core.$strict>;
802
+ }, z.core.$strict>, z.ZodObject<{
803
+ $returned: z.ZodString;
764
804
  }, z.core.$strict>]>>;
765
805
  insert: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodObject<{
766
806
  $context: z.ZodString;
@@ -770,6 +810,8 @@ declare const MutationDefinitionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
770
810
  field: z.ZodString;
771
811
  where: z.ZodType<Filter, unknown, z.core.$ZodTypeInternals<Filter, unknown>>;
772
812
  }, z.core.$strict>;
813
+ }, z.core.$strict>, z.ZodObject<{
814
+ $returned: z.ZodString;
773
815
  }, z.core.$strict>]>>>;
774
816
  key: z.ZodString;
775
817
  }, z.core.$strict>], "op">>]>;
@@ -781,10 +823,13 @@ type LookupValue = {
781
823
  where: Filter;
782
824
  };
783
825
  };
826
+ type ReturnedRef = {
827
+ $returned: string;
828
+ };
784
829
  type ItemRef = {
785
830
  $item: string;
786
831
  };
787
- type MutationValue = FieldOrValue | LookupValue;
832
+ type MutationValue = FieldOrValue | LookupValue | ReturnedRef;
788
833
  type ResolvedOnConflict = {
789
834
  target: string[];
790
835
  set?: Record<string, MutationValue>;
@@ -1443,6 +1488,7 @@ type QueryEngineConfig = {
1443
1488
  maxNestingDepth?: number;
1444
1489
  defaultLimit?: number;
1445
1490
  maxLimit?: number;
1491
+ capAuthored?: boolean;
1446
1492
  rejectCartesianProducts?: boolean;
1447
1493
  warnUnindexedFilters?: boolean;
1448
1494
  rejectUnindexedFilters?: boolean;
@@ -1488,4 +1534,4 @@ type ExecuteOptions = {
1488
1534
  onChange?: (response: QueryResponse) => void;
1489
1535
  };
1490
1536
 
1491
- export { QueryRequestSchema as $, type AnalysisConfig as A, type BoundParams as B, type CompiledQuery as C, type DatabaseSchema as D, type EntitySchema as E, type FieldSchema as F, type GenerateDsl as G, type LiveRowsStats as H, type IndexSchema as I, type LookupValue as J, type MapToShape as K, type LiveRowsConfig as L, type MutationDefinition as M, type Mutation as N, type MutationCacheEntry as O, type ParamSlot as P, type QueryEngineConfig as Q, type ResolvedQuery as R, type ScopePolicy as S, MutationDefinitionSchema as T, MutationSchema as U, type MutationValue as V, type NamedScopeBehaviors as W, type NormalizedType as X, type OkCacheEntry as Y, type QueryErrorResponse as Z, type QueryRequest as _, type QueryEngine as a, type QueryResponse as a0, QuerySchema as a1, REFRESH_MODES as a2, type RelationSchema as a3, type ResolvedField as a4, type ResolvedFilter as a5, type ResolvedJoin as a6, type ResolvedMutation as a7, type ResolvedOnConflict as a8, type ResolvedSemantic as a9, type ResolvedSource as aa, SCOPE_VERBS as ab, type ScopeBehaviors as ac, type ScopeBinding as ad, type ScopeEntityRule as ae, type ScopeMatch as af, type ScopeRef as ag, type ScopeRule as ah, type ScopeRules as ai, type ScopeSet as aj, type ScopeValues as ak, type SortEntry as al, type Source as am, type TestResult as an, type UnsatisfiableCacheEntry as ao, type VexEvent as ap, type VexEventHandler as aq, createScopePolicy as ar, isRefresh as as, mergeScopePolicies as at, scopeBindings as au, scopeGrants as av, scopeProfiles as aw, type Query as b, type AnalysisResult as c, type ContextMeta as d, type DatabaseAdapter as e, type Row as f, type ResolvedExists as g, type FieldOrValue as h, type Filter as i, type QueryErrorCode as j, type CacheBackend as k, type CacheEntry as l, type Refresh as m, type ContextContract as n, type AdapterCapabilities as o, type AggregateExpression as p, AggregateExpressionSchema as q, type ComputeExpression as r, ComputeExpressionSchema as s, type ContextRef as t, type CoreMutation as u, type ExecuteOptions as v, FilterSchema as w, type GenerationCaller as x, type IntrospectOptions as y, type ItemRef as z };
1537
+ export { QueryRequestSchema as $, type AnalysisConfig as A, type BoundParams as B, type CompiledQuery as C, type DatabaseSchema as D, type EntitySchema as E, type FieldSchema as F, type GenerateDsl as G, type LiveRowsStats as H, type IndexSchema as I, type LookupValue as J, type MapToShape as K, type LiveRowsConfig as L, type MutationDefinition as M, type Mutation as N, type MutationCacheEntry as O, type ParamSlot as P, type QueryEngineConfig as Q, type ResolvedQuery as R, type ScopePolicy as S, MutationDefinitionSchema as T, MutationSchema as U, type MutationValue as V, type NamedScopeBehaviors as W, type NormalizedType as X, type OkCacheEntry as Y, type QueryErrorResponse as Z, type QueryRequest as _, type QueryEngine as a, type QueryResponse as a0, QuerySchema as a1, REFRESH_MODES as a2, type RelationSchema as a3, type ResolvedField as a4, type ResolvedFilter as a5, type ResolvedJoin as a6, type ResolvedMutation as a7, type ResolvedOnConflict as a8, type ResolvedSemantic as a9, type ResolvedSource as aa, type ReturnedRef as ab, SCOPE_VERBS as ac, type ScopeBehaviors as ad, type ScopeBinding as ae, type ScopeEntityRule as af, type ScopeMatch as ag, type ScopeRef as ah, type ScopeRule as ai, type ScopeRules as aj, type ScopeSet as ak, type ScopeValues as al, type SortEntry as am, type Source as an, type TestResult as ao, type UnsatisfiableCacheEntry as ap, type VexEvent as aq, type VexEventHandler as ar, createScopePolicy as as, isRefresh as at, mergeScopePolicies as au, scopeBindings as av, scopeGrants as aw, scopeProfiles as ax, type Query as b, type AnalysisResult as c, type ContextMeta as d, type DatabaseAdapter as e, type Row as f, type ResolvedExists as g, type FieldOrValue as h, type Filter as i, type QueryErrorCode as j, type CacheBackend as k, type CacheEntry as l, type Refresh as m, type ContextContract as n, type AdapterCapabilities as o, type AggregateExpression as p, AggregateExpressionSchema as q, type ComputeExpression as r, ComputeExpressionSchema as s, type ContextRef as t, type CoreMutation as u, type ExecuteOptions as v, FilterSchema as w, type GenerationCaller as x, type IntrospectOptions as y, type ItemRef as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niscorp/vex",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Declarative query synthesis — intent to SQL with caching and scope policies",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -77,9 +77,9 @@
77
77
  "peerDependencies": {
78
78
  "hono": "^4",
79
79
  "zod": "^4.2.0",
80
- "@niscorp/strata": "^0.1.3",
81
80
  "@niscorp/cortex": "^0.1.3",
82
- "@niscorp/prism": "^0.2.1"
81
+ "@niscorp/prism": "^0.3.0",
82
+ "@niscorp/strata": "^0.1.5"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@electric-sql/pglite": "^0.5.1",
@@ -92,9 +92,9 @@
92
92
  "tsx": "^4.20.3",
93
93
  "vitest": "^4.1.2",
94
94
  "zod": "^4.6.5",
95
- "@niscorp/prism": "^0.2.1",
95
+ "@niscorp/strata": "^0.1.5",
96
96
  "@niscorp/cortex": "^0.1.3",
97
- "@niscorp/strata": "^0.1.3"
97
+ "@niscorp/prism": "^0.3.0"
98
98
  },
99
99
  "peerDependenciesMeta": {
100
100
  "@niscorp/cortex": {