@niscorp/vex 0.4.0 → 0.4.2

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 (50) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/DESIGN.md +12 -7
  3. package/DOCS.md +64 -19
  4. package/README.md +2 -2
  5. package/dist/adapters/express/index.cjs +1 -1
  6. package/dist/adapters/express/index.cjs.map +1 -1
  7. package/dist/adapters/express/index.d.cts +2 -2
  8. package/dist/adapters/express/index.d.ts +2 -2
  9. package/dist/adapters/express/index.js +1 -1
  10. package/dist/adapters/hono/index.cjs +1 -1
  11. package/dist/adapters/hono/index.cjs.map +1 -1
  12. package/dist/adapters/hono/index.d.cts +2 -2
  13. package/dist/adapters/hono/index.d.ts +2 -2
  14. package/dist/adapters/hono/index.js +1 -1
  15. package/dist/adapters/pg/index.cjs +44 -0
  16. package/dist/adapters/pg/index.cjs.map +1 -0
  17. package/dist/adapters/pg/index.d.cts +28 -0
  18. package/dist/adapters/pg/index.d.ts +28 -0
  19. package/dist/adapters/pg/index.js +31 -0
  20. package/dist/adapters/pg/index.js.map +1 -0
  21. package/dist/adapters/pglite/index.cjs +3 -1
  22. package/dist/adapters/pglite/index.cjs.map +1 -1
  23. package/dist/adapters/pglite/index.d.cts +5 -4
  24. package/dist/adapters/pglite/index.d.ts +5 -4
  25. package/dist/adapters/pglite/index.js +3 -3
  26. package/dist/adapters/pglite/index.js.map +1 -1
  27. package/dist/agent/index.cjs +144 -22
  28. package/dist/agent/index.cjs.map +1 -1
  29. package/dist/agent/index.d.cts +1 -1
  30. package/dist/agent/index.d.ts +1 -1
  31. package/dist/agent/index.js +144 -22
  32. package/dist/agent/index.js.map +1 -1
  33. package/dist/chunk-DFWYYBJU.js +7 -0
  34. package/dist/chunk-DFWYYBJU.js.map +1 -0
  35. package/dist/{chunk-7F2OH4IP.js → chunk-RGJRUOGQ.js} +7 -4
  36. package/dist/chunk-RGJRUOGQ.js.map +1 -0
  37. package/dist/date-parsers-BaUuE_ax.d.cts +4 -0
  38. package/dist/date-parsers-BaUuE_ax.d.ts +4 -0
  39. package/dist/{handler-Bw7xVmBM.d.ts → handler-CoJxInw-.d.ts} +1 -1
  40. package/dist/{handler-Cy0gNM6K.d.cts → handler-CsFbanZA.d.cts} +1 -1
  41. package/dist/index.cjs +6 -3
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +3 -3
  44. package/dist/index.d.ts +3 -3
  45. package/dist/index.js +3 -3
  46. package/dist/index.js.map +1 -1
  47. package/dist/{types-DO-rYZci.d.cts → types-B2HEmyNq.d.cts} +1 -1
  48. package/dist/{types-Bs_9VM9p.d.ts → types-DC68ZUuq.d.ts} +1 -1
  49. package/package.json +13 -1
  50. package/dist/chunk-7F2OH4IP.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { Q as QueryEngineConfig, a as QueryEngine, D as DatabaseSchema, R as ResolvedQuery, A as AnalysisConfig, b as AnalysisResult, C as CompiledQuery, c as ContextMeta, d as DatabaseAdapter, e as Row, F as FieldSchema, P as ParamSlot, f as ResolvedExists, g as QueryErrorCode, S as ScopePolicy, h as CacheBackend, i as CacheEntry, j as Refresh, M as MutationDefinition, k as ContextContract } from './types-DO-rYZci.cjs';
2
- export { l as AdapterCapabilities, B as BoundParams, m as CoreMutation, E as EntitySchema, n as ExecuteOptions, G as GenerateDsl, o as GenerationCaller, I as IndexSchema, p as IntrospectOptions, q as ItemRef, L as LiveRowsConfig, r as LiveRowsStats, s as LookupValue, t as MapToShape, u as Mutation, v as MutationCacheEntry, w as MutationDefinitionSchema, x as MutationSchema, y as MutationValue, N as NamedScopeBehaviors, z as NormalizedType, O as OkCacheEntry, H as QueryErrorResponse, J as QueryRequest, K as QueryRequestSchema, T as QueryResponse, U as REFRESH_MODES, V as RelationSchema, W as ResolvedField, X as ResolvedFilter, Y as ResolvedJoin, Z as ResolvedMutation, _ as ResolvedOnConflict, $ as ResolvedSemantic, a0 as ResolvedSource, a1 as ReturnedRef, a2 as SCOPE_VERBS, a3 as ScopeBehaviors, a4 as ScopeBinding, a5 as ScopeEntityRule, a6 as ScopeMatch, a7 as ScopeRule, a8 as ScopeRules, a9 as ScopeSet, aa as ScopeValues, ab as TestResult, ac as UnsatisfiableCacheEntry, ad as VexEvent, ae as VexEventHandler, af as createScopePolicy, ag as isRefresh, ah as mergeScopePolicies, ai as scopeBindings, aj as scopeGrants, ak as scopeProfiles } from './types-DO-rYZci.cjs';
1
+ import { Q as QueryEngineConfig, a as QueryEngine, D as DatabaseSchema, R as ResolvedQuery, A as AnalysisConfig, b as AnalysisResult, C as CompiledQuery, c as ContextMeta, d as DatabaseAdapter, e as Row, F as FieldSchema, P as ParamSlot, f as ResolvedExists, g as QueryErrorCode, S as ScopePolicy, h as CacheBackend, i as CacheEntry, j as Refresh, M as MutationDefinition, k as ContextContract } from './types-B2HEmyNq.cjs';
2
+ export { l as AdapterCapabilities, B as BoundParams, m as CoreMutation, E as EntitySchema, n as ExecuteOptions, G as GenerateDsl, o as GenerationCaller, I as IndexSchema, p as IntrospectOptions, q as ItemRef, L as LiveRowsConfig, r as LiveRowsStats, s as LookupValue, t as MapToShape, u as Mutation, v as MutationCacheEntry, w as MutationDefinitionSchema, x as MutationSchema, y as MutationValue, N as NamedScopeBehaviors, z as NormalizedType, O as OkCacheEntry, H as QueryErrorResponse, J as QueryRequest, K as QueryRequestSchema, T as QueryResponse, U as REFRESH_MODES, V as RelationSchema, W as ResolvedField, X as ResolvedFilter, Y as ResolvedJoin, Z as ResolvedMutation, _ as ResolvedOnConflict, $ as ResolvedSemantic, a0 as ResolvedSource, a1 as ReturnedRef, a2 as SCOPE_VERBS, a3 as ScopeBehaviors, a4 as ScopeBinding, a5 as ScopeEntityRule, a6 as ScopeMatch, a7 as ScopeRule, a8 as ScopeRules, a9 as ScopeSet, aa as ScopeValues, ab as TestResult, ac as UnsatisfiableCacheEntry, ad as VexEvent, ae as VexEventHandler, af as createScopePolicy, ag as isRefresh, ah as mergeScopePolicies, ai as scopeBindings, aj as scopeGrants, ak as scopeProfiles } from './types-B2HEmyNq.cjs';
3
3
  import { Q as Query, F as FieldOrValue, a as Filter } from './query.schema-B-LVNfyX.cjs';
4
4
  export { A as AggregateExpression, b as AggregateExpressionSchema, C as ComputeExpression, c as ComputeExpressionSchema, d as ContextRef, e as FilterSchema, f as QuerySchema, S as ScopeRef, g as SortEntry, h as Source } from './query.schema-B-LVNfyX.cjs';
5
5
  import { P as PgPool } from './introspect-D3OaXHBc.cjs';
6
6
  import { Sequence } from '@niscorp/strata';
7
- export { C as ContextField, a as ContextSignature, D as DiscoveryFingerprint, b as DiscoveryResponse, E as ExecuteRecord, M as MutationClient, c as MutationContext, d as MutationEffect, e as MutationTx, Q as QueryResult, V as VexHandlerConfig, f as VexLive, W as WriteEvent, g as WriteResult, h as collectMutationContext, i as collectQueryContext, j as executeMutation, k as executeWrites, l as handleDiscovery, m as handleFingerprintDelete, n as handleFingerprintPatch, o as handleQuery, p as lintMutation, q as mutationEffect, r as mutationMisfits, s as requiredContextKeys, t as tablesChangedBy } from './handler-Cy0gNM6K.cjs';
7
+ export { C as ContextField, a as ContextSignature, D as DiscoveryFingerprint, b as DiscoveryResponse, E as ExecuteRecord, M as MutationClient, c as MutationContext, d as MutationEffect, e as MutationTx, Q as QueryResult, V as VexHandlerConfig, f as VexLive, W as WriteEvent, g as WriteResult, h as collectMutationContext, i as collectQueryContext, j as executeMutation, k as executeWrites, l as handleDiscovery, m as handleFingerprintDelete, n as handleFingerprintPatch, o as handleQuery, p as lintMutation, q as mutationEffect, r as mutationMisfits, s as requiredContextKeys, t as tablesChangedBy } from './handler-CsFbanZA.cjs';
8
8
  import '@niscorp/prism';
9
9
  import 'zod';
10
10
 
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { Q as QueryEngineConfig, a as QueryEngine, D as DatabaseSchema, R as ResolvedQuery, A as AnalysisConfig, b as AnalysisResult, C as CompiledQuery, c as ContextMeta, d as DatabaseAdapter, e as Row, F as FieldSchema, P as ParamSlot, f as ResolvedExists, g as QueryErrorCode, S as ScopePolicy, h as CacheBackend, i as CacheEntry, j as Refresh, M as MutationDefinition, k as ContextContract } from './types-Bs_9VM9p.js';
2
- export { l as AdapterCapabilities, B as BoundParams, m as CoreMutation, E as EntitySchema, n as ExecuteOptions, G as GenerateDsl, o as GenerationCaller, I as IndexSchema, p as IntrospectOptions, q as ItemRef, L as LiveRowsConfig, r as LiveRowsStats, s as LookupValue, t as MapToShape, u as Mutation, v as MutationCacheEntry, w as MutationDefinitionSchema, x as MutationSchema, y as MutationValue, N as NamedScopeBehaviors, z as NormalizedType, O as OkCacheEntry, H as QueryErrorResponse, J as QueryRequest, K as QueryRequestSchema, T as QueryResponse, U as REFRESH_MODES, V as RelationSchema, W as ResolvedField, X as ResolvedFilter, Y as ResolvedJoin, Z as ResolvedMutation, _ as ResolvedOnConflict, $ as ResolvedSemantic, a0 as ResolvedSource, a1 as ReturnedRef, a2 as SCOPE_VERBS, a3 as ScopeBehaviors, a4 as ScopeBinding, a5 as ScopeEntityRule, a6 as ScopeMatch, a7 as ScopeRule, a8 as ScopeRules, a9 as ScopeSet, aa as ScopeValues, ab as TestResult, ac as UnsatisfiableCacheEntry, ad as VexEvent, ae as VexEventHandler, af as createScopePolicy, ag as isRefresh, ah as mergeScopePolicies, ai as scopeBindings, aj as scopeGrants, ak as scopeProfiles } from './types-Bs_9VM9p.js';
1
+ import { Q as QueryEngineConfig, a as QueryEngine, D as DatabaseSchema, R as ResolvedQuery, A as AnalysisConfig, b as AnalysisResult, C as CompiledQuery, c as ContextMeta, d as DatabaseAdapter, e as Row, F as FieldSchema, P as ParamSlot, f as ResolvedExists, g as QueryErrorCode, S as ScopePolicy, h as CacheBackend, i as CacheEntry, j as Refresh, M as MutationDefinition, k as ContextContract } from './types-DC68ZUuq.js';
2
+ export { l as AdapterCapabilities, B as BoundParams, m as CoreMutation, E as EntitySchema, n as ExecuteOptions, G as GenerateDsl, o as GenerationCaller, I as IndexSchema, p as IntrospectOptions, q as ItemRef, L as LiveRowsConfig, r as LiveRowsStats, s as LookupValue, t as MapToShape, u as Mutation, v as MutationCacheEntry, w as MutationDefinitionSchema, x as MutationSchema, y as MutationValue, N as NamedScopeBehaviors, z as NormalizedType, O as OkCacheEntry, H as QueryErrorResponse, J as QueryRequest, K as QueryRequestSchema, T as QueryResponse, U as REFRESH_MODES, V as RelationSchema, W as ResolvedField, X as ResolvedFilter, Y as ResolvedJoin, Z as ResolvedMutation, _ as ResolvedOnConflict, $ as ResolvedSemantic, a0 as ResolvedSource, a1 as ReturnedRef, a2 as SCOPE_VERBS, a3 as ScopeBehaviors, a4 as ScopeBinding, a5 as ScopeEntityRule, a6 as ScopeMatch, a7 as ScopeRule, a8 as ScopeRules, a9 as ScopeSet, aa as ScopeValues, ab as TestResult, ac as UnsatisfiableCacheEntry, ad as VexEvent, ae as VexEventHandler, af as createScopePolicy, ag as isRefresh, ah as mergeScopePolicies, ai as scopeBindings, aj as scopeGrants, ak as scopeProfiles } from './types-DC68ZUuq.js';
3
3
  import { Q as Query, F as FieldOrValue, a as Filter } from './query.schema-B-LVNfyX.js';
4
4
  export { A as AggregateExpression, b as AggregateExpressionSchema, C as ComputeExpression, c as ComputeExpressionSchema, d as ContextRef, e as FilterSchema, f as QuerySchema, S as ScopeRef, g as SortEntry, h as Source } from './query.schema-B-LVNfyX.js';
5
5
  import { P as PgPool } from './introspect-D3OaXHBc.js';
6
6
  import { Sequence } from '@niscorp/strata';
7
- export { C as ContextField, a as ContextSignature, D as DiscoveryFingerprint, b as DiscoveryResponse, E as ExecuteRecord, M as MutationClient, c as MutationContext, d as MutationEffect, e as MutationTx, Q as QueryResult, V as VexHandlerConfig, f as VexLive, W as WriteEvent, g as WriteResult, h as collectMutationContext, i as collectQueryContext, j as executeMutation, k as executeWrites, l as handleDiscovery, m as handleFingerprintDelete, n as handleFingerprintPatch, o as handleQuery, p as lintMutation, q as mutationEffect, r as mutationMisfits, s as requiredContextKeys, t as tablesChangedBy } from './handler-Bw7xVmBM.js';
7
+ export { C as ContextField, a as ContextSignature, D as DiscoveryFingerprint, b as DiscoveryResponse, E as ExecuteRecord, M as MutationClient, c as MutationContext, d as MutationEffect, e as MutationTx, Q as QueryResult, V as VexHandlerConfig, f as VexLive, W as WriteEvent, g as WriteResult, h as collectMutationContext, i as collectQueryContext, j as executeMutation, k as executeWrites, l as handleDiscovery, m as handleFingerprintDelete, n as handleFingerprintPatch, o as handleQuery, p as lintMutation, q as mutationEffect, r as mutationMisfits, s as requiredContextKeys, t as tablesChangedBy } from './handler-CoJxInw-.js';
8
8
  import '@niscorp/prism';
9
9
  import 'zod';
10
10
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { isRefresh } from './chunk-F7RDSWYF.js';
2
2
  export { REFRESH_MODES, isRefresh } from './chunk-F7RDSWYF.js';
3
- import { MutationDefinitionSchema, lintMutation, computeSchemaFingerprint, pruneOptional, buildValidationContext, requireScope, executeQuery, QueryRequestSchema, computeRequestHash, computePolicyKey, presenceOf, presenceSignature, findMissingContext, buildContextContract, optionalKeysOf, resolveParams, canonicalHash, fireAndForget, isSetMatch, refuseOptional, canonicalText, checkScope, scopeResolved, mintFingerprint, isEntryFresh, canReadTable, hashText, quoteIdent, compileCompute, compileAggregate, compileJoinPairs, compileFilter, isTouchDue } from './chunk-7F2OH4IP.js';
4
- export { MutationDefinitionSchema, MutationSchema, QueryRequestSchema, VexScopeError, applyScope, buildContextContract, buildValidationContext, checkScope, collectMutationContext, collectQueryContext, compileFieldOrValue, compileFilter, computeRequestHash, computeSchemaFingerprint, executeMutation, executeQuery, executeWrites, findMissingContext, handleDiscovery, handleFingerprintDelete, handleFingerprintPatch, handleQuery, lintMutation, mintFingerprint, mutationEffect, mutationMisfits, normalizeShape, optionalKeysOf, presenceOf, pruneOptional, requiredContextKeys, resolveParams, scopeResolved, sweepCache, tablesChangedBy } from './chunk-7F2OH4IP.js';
3
+ import { MutationDefinitionSchema, lintMutation, computeSchemaFingerprint, pruneOptional, buildValidationContext, requireScope, executeQuery, QueryRequestSchema, computeRequestHash, computePolicyKey, presenceOf, presenceSignature, findMissingContext, buildContextContract, optionalKeysOf, resolveParams, canonicalHash, fireAndForget, isSetMatch, refuseOptional, canonicalText, checkScope, scopeResolved, mintFingerprint, isEntryFresh, canReadTable, hashText, quoteIdent, compileCompute, compileAggregate, compileJoinPairs, compileFilter, isTouchDue } from './chunk-RGJRUOGQ.js';
4
+ export { MutationDefinitionSchema, MutationSchema, QueryRequestSchema, VexScopeError, applyScope, buildContextContract, buildValidationContext, checkScope, collectMutationContext, collectQueryContext, compileFieldOrValue, compileFilter, computeRequestHash, computeSchemaFingerprint, executeMutation, executeQuery, executeWrites, findMissingContext, handleDiscovery, handleFingerprintDelete, handleFingerprintPatch, handleQuery, lintMutation, mintFingerprint, mutationEffect, mutationMisfits, normalizeShape, optionalKeysOf, presenceOf, pruneOptional, requiredContextKeys, resolveParams, scopeResolved, sweepCache, tablesChangedBy } from './chunk-RGJRUOGQ.js';
5
5
  import { VexError, isVexError } from './chunk-XTOK7YOR.js';
6
6
  export { VexError } from './chunk-XTOK7YOR.js';
7
7
  import { QuerySchema, isIdentifier, isFieldPathShape } from './chunk-UPQMKAAX.js';
@@ -1323,7 +1323,7 @@ var createQueryEngine = (engineConfig) => {
1323
1323
  mappingMs = Date.now() - mapStart;
1324
1324
  } else if (mapToShape !== void 0) {
1325
1325
  const mapStart = Date.now();
1326
- const mapped = await mapToShape(rows, validRequest.shape);
1326
+ const mapped = await mapToShape(rows, validRequest.shape, validRequest.intent);
1327
1327
  mappingMs = Date.now() - mapStart;
1328
1328
  result = mapped.transformed;
1329
1329
  mappedIr = mapped.ir;