@niscorp/vex 0.4.4 → 0.4.5

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.
@@ -1,7 +1,7 @@
1
1
  import { a as Filter, F as FieldOrValue, Q as Query, C as ComputeExpression, A as AggregateExpression } from './query.schema-B-LVNfyX.cjs';
2
2
  import { CompiledIr, JsonValue } from '@niscorp/prism';
3
3
  import { z } from 'zod';
4
- import { Sequence } from '@niscorp/strata';
4
+ import { Sequence, Upgrader } from '@niscorp/strata';
5
5
 
6
6
  type ScopeValues = Record<string, unknown>;
7
7
  type ScopeMatchOne = {
@@ -891,6 +891,35 @@ declare const scopeProfiles: (behaviors: ScopeBehaviors) => ReadonlySet<string>;
891
891
  declare const createScopePolicy: (grants: ReadonlySet<string>, behaviors?: ScopeBehaviors, scoping?: string) => ScopePolicy;
892
892
  declare const mergeScopePolicies: (policies: readonly ScopePolicy[]) => ScopePolicy;
893
893
 
894
+ declare const UNREADABLE_MODES: readonly ["refuse", "omit", "null"];
895
+ declare const UpgradedColumnSchema: z.ZodObject<{
896
+ stamp: z.ZodString;
897
+ kind: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
898
+ grammar: z.ZodString;
899
+ column: z.ZodString;
900
+ }, z.core.$strict>]>;
901
+ unreadable: z.ZodOptional<z.ZodEnum<{
902
+ null: "null";
903
+ refuse: "refuse";
904
+ omit: "omit";
905
+ }>>;
906
+ }, z.core.$strict>;
907
+ declare const UpgradedColumnsSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
908
+ stamp: z.ZodString;
909
+ kind: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
910
+ grammar: z.ZodString;
911
+ column: z.ZodString;
912
+ }, z.core.$strict>]>;
913
+ unreadable: z.ZodOptional<z.ZodEnum<{
914
+ null: "null";
915
+ refuse: "refuse";
916
+ omit: "omit";
917
+ }>>;
918
+ }, z.core.$strict>>>;
919
+ type UpgradedColumn = z.infer<typeof UpgradedColumnSchema>;
920
+ type UpgradedColumns = z.infer<typeof UpgradedColumnsSchema>;
921
+ type ColumnUpgrader = Pick<Upgrader, 'upgrade' | 'locate' | 'stamp'>;
922
+
894
923
  type GenerationCaller = {
895
924
  read: (dsl: Query) => Promise<{
896
925
  rows: Row[];
@@ -928,6 +957,8 @@ type QueryEngineConfig = {
928
957
  */
929
958
  behaviors?: ScopeBehaviors;
930
959
  mapToShape?: MapToShape;
960
+ upgradedColumns?: UpgradedColumns;
961
+ upgrader?: ColumnUpgrader;
931
962
  rows?: LiveRowsConfig;
932
963
  config?: {
933
964
  maxNestingDepth?: number;
@@ -967,4 +998,4 @@ type ExecuteOptions = {
967
998
  onChange?: (response: QueryResponse) => void;
968
999
  };
969
1000
 
970
- export { type ResolvedSemantic 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 QueryErrorResponse as H, type IndexSchema as I, type QueryRequest as J, QueryRequestSchema as K, type LiveRowsConfig as L, type MutationDefinition as M, type NamedScopeBehaviors as N, type OkCacheEntry as O, type ParamSlot as P, type QueryEngineConfig as Q, type ResolvedQuery as R, type ScopePolicy as S, type QueryResponse as T, REFRESH_MODES as U, type RelationSchema as V, type ResolvedField as W, type ResolvedFilter as X, type ResolvedJoin as Y, type ResolvedMutation as Z, type ResolvedOnConflict as _, type QueryEngine as a, type ResolvedSource as a0, type ReturnedRef as a1, SCOPE_VERBS as a2, type ScopeBehaviors as a3, type ScopeBinding as a4, type ScopeEntityRule as a5, type ScopeMatch as a6, type ScopeRule as a7, type ScopeRules as a8, type ScopeSet as a9, type ScopeValues as aa, type TestResult as ab, type UnsatisfiableCacheEntry as ac, type VexEvent as ad, type VexEventHandler as ae, createScopePolicy as af, isRefresh as ag, mergeScopePolicies as ah, scopeBindings as ai, scopeGrants as aj, scopeProfiles as ak, type AnalysisResult as b, type ContextMeta as c, type DatabaseAdapter as d, type Row as e, type ResolvedExists as f, type QueryErrorCode as g, type CacheBackend as h, type CacheEntry as i, type Refresh as j, type ContextContract as k, type AdapterCapabilities as l, type CoreMutation as m, type ExecuteOptions as n, type GenerationCaller as o, type IntrospectOptions as p, type ItemRef as q, type LiveRowsStats as r, type LookupValue as s, type MapToShape as t, type Mutation as u, type MutationCacheEntry as v, MutationDefinitionSchema as w, MutationSchema as x, type MutationValue as y, type NormalizedType as z };
1001
+ export { type ResolvedOnConflict 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 NormalizedType as H, type IndexSchema as I, type QueryErrorResponse as J, type QueryRequest as K, type LiveRowsConfig as L, type MutationDefinition as M, type NamedScopeBehaviors as N, type OkCacheEntry as O, type ParamSlot as P, type QueryEngineConfig as Q, type ResolvedQuery as R, type ScopePolicy as S, QueryRequestSchema as T, type QueryResponse as U, REFRESH_MODES as V, type RelationSchema as W, type ResolvedField as X, type ResolvedFilter as Y, type ResolvedJoin as Z, type ResolvedMutation as _, type QueryEngine as a, type ResolvedSemantic as a0, type ResolvedSource as a1, type ReturnedRef as a2, SCOPE_VERBS as a3, type ScopeBehaviors as a4, type ScopeBinding as a5, type ScopeEntityRule as a6, type ScopeMatch as a7, type ScopeRule as a8, type ScopeRules as a9, type ScopeSet as aa, type ScopeValues as ab, type TestResult as ac, UNREADABLE_MODES as ad, type UnsatisfiableCacheEntry as ae, type UpgradedColumn as af, type UpgradedColumns as ag, UpgradedColumnsSchema as ah, type VexEvent as ai, type VexEventHandler as aj, createScopePolicy as ak, isRefresh as al, mergeScopePolicies as am, scopeBindings as an, scopeGrants as ao, scopeProfiles as ap, type AnalysisResult as b, type ContextMeta as c, type DatabaseAdapter as d, type Row as e, type ResolvedExists as f, type QueryErrorCode as g, type CacheBackend as h, type CacheEntry as i, type Refresh as j, type ContextContract as k, type AdapterCapabilities as l, type ColumnUpgrader as m, type CoreMutation as n, type ExecuteOptions as o, type GenerationCaller as p, type IntrospectOptions as q, type ItemRef as r, type LiveRowsStats as s, type LookupValue as t, type MapToShape as u, type Mutation as v, type MutationCacheEntry as w, MutationDefinitionSchema as x, MutationSchema as y, type MutationValue as z };
@@ -1,7 +1,7 @@
1
1
  import { a as Filter, F as FieldOrValue, Q as Query, C as ComputeExpression, A as AggregateExpression } from './query.schema-B-LVNfyX.js';
2
2
  import { CompiledIr, JsonValue } from '@niscorp/prism';
3
3
  import { z } from 'zod';
4
- import { Sequence } from '@niscorp/strata';
4
+ import { Sequence, Upgrader } from '@niscorp/strata';
5
5
 
6
6
  type ScopeValues = Record<string, unknown>;
7
7
  type ScopeMatchOne = {
@@ -891,6 +891,35 @@ declare const scopeProfiles: (behaviors: ScopeBehaviors) => ReadonlySet<string>;
891
891
  declare const createScopePolicy: (grants: ReadonlySet<string>, behaviors?: ScopeBehaviors, scoping?: string) => ScopePolicy;
892
892
  declare const mergeScopePolicies: (policies: readonly ScopePolicy[]) => ScopePolicy;
893
893
 
894
+ declare const UNREADABLE_MODES: readonly ["refuse", "omit", "null"];
895
+ declare const UpgradedColumnSchema: z.ZodObject<{
896
+ stamp: z.ZodString;
897
+ kind: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
898
+ grammar: z.ZodString;
899
+ column: z.ZodString;
900
+ }, z.core.$strict>]>;
901
+ unreadable: z.ZodOptional<z.ZodEnum<{
902
+ null: "null";
903
+ refuse: "refuse";
904
+ omit: "omit";
905
+ }>>;
906
+ }, z.core.$strict>;
907
+ declare const UpgradedColumnsSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
908
+ stamp: z.ZodString;
909
+ kind: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
910
+ grammar: z.ZodString;
911
+ column: z.ZodString;
912
+ }, z.core.$strict>]>;
913
+ unreadable: z.ZodOptional<z.ZodEnum<{
914
+ null: "null";
915
+ refuse: "refuse";
916
+ omit: "omit";
917
+ }>>;
918
+ }, z.core.$strict>>>;
919
+ type UpgradedColumn = z.infer<typeof UpgradedColumnSchema>;
920
+ type UpgradedColumns = z.infer<typeof UpgradedColumnsSchema>;
921
+ type ColumnUpgrader = Pick<Upgrader, 'upgrade' | 'locate' | 'stamp'>;
922
+
894
923
  type GenerationCaller = {
895
924
  read: (dsl: Query) => Promise<{
896
925
  rows: Row[];
@@ -928,6 +957,8 @@ type QueryEngineConfig = {
928
957
  */
929
958
  behaviors?: ScopeBehaviors;
930
959
  mapToShape?: MapToShape;
960
+ upgradedColumns?: UpgradedColumns;
961
+ upgrader?: ColumnUpgrader;
931
962
  rows?: LiveRowsConfig;
932
963
  config?: {
933
964
  maxNestingDepth?: number;
@@ -967,4 +998,4 @@ type ExecuteOptions = {
967
998
  onChange?: (response: QueryResponse) => void;
968
999
  };
969
1000
 
970
- export { type ResolvedSemantic 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 QueryErrorResponse as H, type IndexSchema as I, type QueryRequest as J, QueryRequestSchema as K, type LiveRowsConfig as L, type MutationDefinition as M, type NamedScopeBehaviors as N, type OkCacheEntry as O, type ParamSlot as P, type QueryEngineConfig as Q, type ResolvedQuery as R, type ScopePolicy as S, type QueryResponse as T, REFRESH_MODES as U, type RelationSchema as V, type ResolvedField as W, type ResolvedFilter as X, type ResolvedJoin as Y, type ResolvedMutation as Z, type ResolvedOnConflict as _, type QueryEngine as a, type ResolvedSource as a0, type ReturnedRef as a1, SCOPE_VERBS as a2, type ScopeBehaviors as a3, type ScopeBinding as a4, type ScopeEntityRule as a5, type ScopeMatch as a6, type ScopeRule as a7, type ScopeRules as a8, type ScopeSet as a9, type ScopeValues as aa, type TestResult as ab, type UnsatisfiableCacheEntry as ac, type VexEvent as ad, type VexEventHandler as ae, createScopePolicy as af, isRefresh as ag, mergeScopePolicies as ah, scopeBindings as ai, scopeGrants as aj, scopeProfiles as ak, type AnalysisResult as b, type ContextMeta as c, type DatabaseAdapter as d, type Row as e, type ResolvedExists as f, type QueryErrorCode as g, type CacheBackend as h, type CacheEntry as i, type Refresh as j, type ContextContract as k, type AdapterCapabilities as l, type CoreMutation as m, type ExecuteOptions as n, type GenerationCaller as o, type IntrospectOptions as p, type ItemRef as q, type LiveRowsStats as r, type LookupValue as s, type MapToShape as t, type Mutation as u, type MutationCacheEntry as v, MutationDefinitionSchema as w, MutationSchema as x, type MutationValue as y, type NormalizedType as z };
1001
+ export { type ResolvedOnConflict 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 NormalizedType as H, type IndexSchema as I, type QueryErrorResponse as J, type QueryRequest as K, type LiveRowsConfig as L, type MutationDefinition as M, type NamedScopeBehaviors as N, type OkCacheEntry as O, type ParamSlot as P, type QueryEngineConfig as Q, type ResolvedQuery as R, type ScopePolicy as S, QueryRequestSchema as T, type QueryResponse as U, REFRESH_MODES as V, type RelationSchema as W, type ResolvedField as X, type ResolvedFilter as Y, type ResolvedJoin as Z, type ResolvedMutation as _, type QueryEngine as a, type ResolvedSemantic as a0, type ResolvedSource as a1, type ReturnedRef as a2, SCOPE_VERBS as a3, type ScopeBehaviors as a4, type ScopeBinding as a5, type ScopeEntityRule as a6, type ScopeMatch as a7, type ScopeRule as a8, type ScopeRules as a9, type ScopeSet as aa, type ScopeValues as ab, type TestResult as ac, UNREADABLE_MODES as ad, type UnsatisfiableCacheEntry as ae, type UpgradedColumn as af, type UpgradedColumns as ag, UpgradedColumnsSchema as ah, type VexEvent as ai, type VexEventHandler as aj, createScopePolicy as ak, isRefresh as al, mergeScopePolicies as am, scopeBindings as an, scopeGrants as ao, scopeProfiles as ap, type AnalysisResult as b, type ContextMeta as c, type DatabaseAdapter as d, type Row as e, type ResolvedExists as f, type QueryErrorCode as g, type CacheBackend as h, type CacheEntry as i, type Refresh as j, type ContextContract as k, type AdapterCapabilities as l, type ColumnUpgrader as m, type CoreMutation as n, type ExecuteOptions as o, type GenerationCaller as p, type IntrospectOptions as q, type ItemRef as r, type LiveRowsStats as s, type LookupValue as t, type MapToShape as u, type Mutation as v, type MutationCacheEntry as w, MutationDefinitionSchema as x, MutationSchema as y, type MutationValue as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niscorp/vex",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Declarative query synthesis — intent to SQL with caching and scope policies",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -99,8 +99,8 @@
99
99
  "pg": "^8",
100
100
  "zod": "^4.2.0",
101
101
  "@niscorp/cortex": "^0.1.6",
102
- "@niscorp/strata": "^0.1.9",
103
- "@niscorp/prism": "^0.3.3"
102
+ "@niscorp/prism": "^0.3.4",
103
+ "@niscorp/strata": "^0.1.9"
104
104
  },
105
105
  "devDependencies": {
106
106
  "@electric-sql/pglite": "^0.5.1",
@@ -114,9 +114,9 @@
114
114
  "tsx": "^4.20.3",
115
115
  "vitest": "^4.1.2",
116
116
  "zod": "^4.6.5",
117
+ "@niscorp/prism": "^0.3.4",
117
118
  "@niscorp/cortex": "^0.1.6",
118
119
  "@niscorp/signal": "^0.1.9",
119
- "@niscorp/prism": "^0.3.3",
120
120
  "@niscorp/strata": "^0.1.9"
121
121
  },
122
122
  "peerDependenciesMeta": {