@niscorp/vex 0.1.1 → 0.2.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.
package/dist/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { MutationDefinitionSchema, lintMutation, computeSchemaFingerprint, pruneOptional, buildValidationContext, requireScope, executeQuery, QueryRequestSchema, computeRequestHash, computePolicyKey, presenceOf, presenceSignature, findMissingContext, buildContextContract, optionalKeysOf, resolveParams, fireAndForget, isSetMatch, refuseOptional, quoteIdent, compileCompute, compileAggregate, compileJoinPairs, compileFilter, checkScope, scopeResolved, mintFingerprint, isEntryFresh, canReadTable, isTouchDue } from './chunk-5CBKESBJ.js';
2
- 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, normalizeShape, optionalKeysOf, presenceOf, pruneOptional, requiredContextKeys, resolveParams, scopeResolved, sweepCache, tablesChangedBy } from './chunk-5CBKESBJ.js';
1
+ import { MutationDefinitionSchema, lintMutation, computeSchemaFingerprint, pruneOptional, buildValidationContext, requireScope, executeQuery, QueryRequestSchema, computeRequestHash, computePolicyKey, presenceOf, presenceSignature, findMissingContext, buildContextContract, optionalKeysOf, resolveParams, canonicalHash, fireAndForget, isSetMatch, refuseOptional, canonicalText, quoteIdent, compileCompute, compileAggregate, compileJoinPairs, compileFilter, checkScope, scopeResolved, mintFingerprint, isEntryFresh, canReadTable, hashText, isTouchDue } from './chunk-HCEH55PP.js';
2
+ 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, normalizeShape, optionalKeysOf, presenceOf, pruneOptional, requiredContextKeys, resolveParams, scopeResolved, sweepCache, tablesChangedBy } from './chunk-HCEH55PP.js';
3
3
  import { VexError, QuerySchema, isIdentifier, isFieldPathShape } from './chunk-HF25Q53I.js';
4
4
  export { AggregateExpressionSchema, ComputeExpressionSchema, FilterSchema, QuerySchema, VexError } from './chunk-HF25Q53I.js';
5
5
  import { z } from 'zod';
6
- import { createHash } from 'crypto';
7
6
  import { exceedsDepth, depthRefusal } from '@niscorp/strata';
8
7
  import { compile, execute } from '@niscorp/prism';
9
8
  import { migrate } from '@niscorp/strata/postgres';
@@ -865,18 +864,6 @@ var createMemoryCache = () => {
865
864
  };
866
865
  return { get, set, delete: del, clear, keys, entries };
867
866
  };
868
- var canonical = (value) => {
869
- if (Array.isArray(value)) return value.map(canonical);
870
- if (value !== null && typeof value === "object" && !(value instanceof Date)) {
871
- const sorted = {};
872
- for (const [key, inner] of Object.entries(value).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) sorted[key] = canonical(inner);
873
- return sorted;
874
- }
875
- return value;
876
- };
877
- var canonicalText = (value) => JSON.stringify(canonical(value)) ?? "undefined";
878
- var hashText = (text) => createHash("sha256").update(text).digest("hex");
879
- var canonicalHash = (value) => hashText(canonicalText(value));
880
867
 
881
868
  // src/engine/live.ts
882
869
  var DEFAULT_TTL_MS = 6e4;
@@ -1959,9 +1946,8 @@ var createPostgresAdapter = (config) => {
1959
1946
  return enforcement;
1960
1947
  };
1961
1948
  const execute = async (query, params) => {
1962
- const { transaction } = pool;
1963
1949
  const limit = perStatementMs;
1964
- const result = limit === void 0 || transaction === void 0 ? await pool.query(query.sql, params) : await transaction(async (tx) => {
1950
+ const result = limit === void 0 || pool.transaction === void 0 ? await pool.query(query.sql, params) : await pool.transaction(async (tx) => {
1965
1951
  await tx.query(`SET LOCAL statement_timeout = ${limit}`);
1966
1952
  return tx.query(query.sql, params);
1967
1953
  });