@hypequery/protocol 0.16.0 → 0.17.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.
@@ -0,0 +1,21 @@
1
+ import type { BuildProtocolCachePreimageOptions, ProtocolCachePreimageErrorCode } from './types.js';
2
+ export declare class ProtocolCachePreimageError extends Error {
3
+ readonly code: ProtocolCachePreimageErrorCode;
4
+ constructor(code: ProtocolCachePreimageErrorCode);
5
+ }
6
+ /**
7
+ * The RFC 0009 tenant fingerprint: tells two tenants apart without revealing
8
+ * either. Keyed by a namespace secret, because tenant identifier spaces are
9
+ * small enough that an unkeyed digest could be reversed by enumeration.
10
+ */
11
+ export declare function deriveProtocolTenantFingerprint(secret: Uint8Array, tenantId: string): string;
12
+ /**
13
+ * Builds the RFC 0009 cache preimage: the canonical bytes that identify a
14
+ * cached semantic result. Feed them to `deriveProtocolCacheKey` (RFC 0013); never
15
+ * log them, emit them, or use them as a key.
16
+ *
17
+ * Checks run in the RFC's normative order, so every implementation reports the
18
+ * same first failure.
19
+ */
20
+ export declare function buildProtocolCachePreimage(options: BuildProtocolCachePreimageOptions): string;
21
+ //# sourceMappingURL=cache-preimages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-preimages.d.ts","sourceRoot":"","sources":["../../src/cache-preimages/cache-preimages.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,iCAAiC,EACjC,8BAA8B,EAC/B,MAAM,YAAY,CAAC;AAQpB,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,EAAE,8BAA8B,CAAC;gBAElC,IAAI,EAAE,8BAA8B;CAOjD;AAwBD;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5F;AAoED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,iCAAiC,GAAG,MAAM,CAmB7F"}
@@ -0,0 +1,143 @@
1
+ import { hmac } from '@noble/hashes/hmac';
2
+ import { sha256 } from '@noble/hashes/sha2';
3
+ import { bytesToHex } from '@noble/hashes/utils';
4
+ import { validateProtocolSemanticQuery } from '../expressions/validate.js';
5
+ import { serializeJcs } from '../values/jcs.js';
6
+ const FINGERPRINT_DOMAIN = 'hypequery.tenant.fingerprint.v1';
7
+ const MIN_SECRET_BYTES = 32;
8
+ const DEFINITION_IDENTITY = /^[0-9a-f]{64}$/;
9
+ const textEncoder = new TextEncoder();
10
+ export class ProtocolCachePreimageError extends Error {
11
+ code;
12
+ constructor(code) {
13
+ // The code and nothing else: the secret, tenant identifiers, and filter
14
+ // values are all in scope wherever this is raised.
15
+ super(code);
16
+ this.name = 'ProtocolCachePreimageError';
17
+ this.code = code;
18
+ }
19
+ }
20
+ function fail(code) {
21
+ throw new ProtocolCachePreimageError(code);
22
+ }
23
+ function requireSecret(secret) {
24
+ if (!secret || secret.byteLength === 0)
25
+ fail('HQ_CACHE_PREIMAGE_SECRET_MISSING');
26
+ if (secret.byteLength < MIN_SECRET_BYTES)
27
+ fail('HQ_CACHE_PREIMAGE_SECRET_TOO_SHORT');
28
+ return secret;
29
+ }
30
+ function fingerprint(secret, tenantId) {
31
+ if (typeof tenantId !== 'string' || tenantId.length === 0) {
32
+ fail('HQ_CACHE_PREIMAGE_INVALID_TENANT');
33
+ }
34
+ const domain = textEncoder.encode(FINGERPRINT_DOMAIN);
35
+ const id = textEncoder.encode(tenantId);
36
+ const input = new Uint8Array(domain.byteLength + 1 + id.byteLength);
37
+ input.set(domain, 0);
38
+ input.set(id, domain.byteLength + 1);
39
+ return bytesToHex(hmac(sha256, secret, input));
40
+ }
41
+ /**
42
+ * The RFC 0009 tenant fingerprint: tells two tenants apart without revealing
43
+ * either. Keyed by a namespace secret, because tenant identifier spaces are
44
+ * small enough that an unkeyed digest could be reversed by enumeration.
45
+ */
46
+ export function deriveProtocolTenantFingerprint(secret, tenantId) {
47
+ return fingerprint(requireSecret(secret), tenantId);
48
+ }
49
+ /** Byte order of the UTF-8 encoding, which is what the RFC sorts by. */
50
+ function compareUtf8(left, right) {
51
+ const a = textEncoder.encode(left);
52
+ const b = textEncoder.encode(right);
53
+ const length = Math.min(a.byteLength, b.byteLength);
54
+ for (let index = 0; index < length; index += 1) {
55
+ const difference = a[index] - b[index];
56
+ if (difference !== 0)
57
+ return difference;
58
+ }
59
+ return a.byteLength - b.byteLength;
60
+ }
61
+ function normalizeQuery(source) {
62
+ let query;
63
+ try {
64
+ query = validateProtocolSemanticQuery(source, { extension: 2 });
65
+ }
66
+ catch {
67
+ // The expression code is not surfaced, so this family's set stays closed.
68
+ fail('HQ_CACHE_PREIMAGE_INVALID_QUERY');
69
+ }
70
+ // AND-combined, so order cannot change rows; identical filters collapse.
71
+ const filters = new Map();
72
+ for (const filter of query.filters ?? [])
73
+ filters.set(serializeJcs(filter), filter);
74
+ const normalized = {
75
+ kind: query.kind,
76
+ dataset: query.dataset,
77
+ dimensions: query.dimensions ?? [],
78
+ filters: [...filters.keys()].sort(compareUtf8).map((key) => filters.get(key)),
79
+ segments: [...(query.segments ?? [])].sort(compareUtf8),
80
+ orderBy: query.orderBy ?? [],
81
+ by: query.by ?? null,
82
+ offset: query.offset || null,
83
+ };
84
+ if (query.kind === 'metric') {
85
+ normalized.metric = query.metric;
86
+ }
87
+ else {
88
+ // Absent selects every measure and `[]` selects none, so they stay distinct.
89
+ normalized.measures = query.measures ?? null;
90
+ }
91
+ return normalized;
92
+ }
93
+ function normalizeTenant(tenant, secret) {
94
+ if (tenant === null || typeof tenant !== 'object' || Array.isArray(tenant)) {
95
+ fail('HQ_CACHE_PREIMAGE_INVALID_TENANT');
96
+ }
97
+ const record = tenant;
98
+ const fields = Object.keys(record).sort().join(',');
99
+ if ((record.mode === 'none' || record.mode === 'all') && fields === 'mode') {
100
+ return { mode: record.mode };
101
+ }
102
+ if (record.mode !== 'scoped' || fields !== 'ids,mode')
103
+ fail('HQ_CACHE_PREIMAGE_INVALID_TENANT');
104
+ const ids = record.ids;
105
+ if (!Array.isArray(ids) || ids.length === 0)
106
+ fail('HQ_CACHE_PREIMAGE_INVALID_TENANT');
107
+ const fingerprints = new Set(ids.map((id) => fingerprint(secret, id)));
108
+ return { mode: 'scoped', fingerprints: [...fingerprints].sort() };
109
+ }
110
+ function normalizeRowLimit(rowLimit) {
111
+ if (rowLimit === null)
112
+ return null;
113
+ if (typeof rowLimit !== 'number' || !Number.isSafeInteger(rowLimit) || rowLimit < 0) {
114
+ fail('HQ_CACHE_PREIMAGE_INVALID_LIMIT');
115
+ }
116
+ return rowLimit;
117
+ }
118
+ /**
119
+ * Builds the RFC 0009 cache preimage: the canonical bytes that identify a
120
+ * cached semantic result. Feed them to `deriveProtocolCacheKey` (RFC 0013); never
121
+ * log them, emit them, or use them as a key.
122
+ *
123
+ * Checks run in the RFC's normative order, so every implementation reports the
124
+ * same first failure.
125
+ */
126
+ export function buildProtocolCachePreimage(options) {
127
+ const secret = requireSecret(options.secret);
128
+ if (typeof options.definitionIdentity !== 'string'
129
+ || !DEFINITION_IDENTITY.test(options.definitionIdentity)) {
130
+ fail('HQ_CACHE_PREIMAGE_INVALID_DEFINITION');
131
+ }
132
+ const query = normalizeQuery(options.query);
133
+ const tenant = normalizeTenant(options.tenant, secret);
134
+ const rowLimit = normalizeRowLimit(options.rowLimit);
135
+ return serializeJcs({
136
+ kind: 'hypequery-cache-preimage',
137
+ version: 1,
138
+ definition: options.definitionIdentity,
139
+ query,
140
+ tenant,
141
+ rowLimit,
142
+ });
143
+ }
@@ -0,0 +1,3 @@
1
+ export { ProtocolCachePreimageError, buildProtocolCachePreimage, deriveProtocolTenantFingerprint, } from './cache-preimages.js';
2
+ export type { BuildProtocolCachePreimageOptions, ProtocolCachePreimageErrorCode, ProtocolCacheTenantScope, } from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache-preimages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export { ProtocolCachePreimageError, buildProtocolCachePreimage, deriveProtocolTenantFingerprint, } from './cache-preimages.js';
@@ -0,0 +1,29 @@
1
+ /** Stable failure codes for cache preimage version 1 (RFC 0009). */
2
+ export type ProtocolCachePreimageErrorCode = 'HQ_CACHE_PREIMAGE_SECRET_MISSING' | 'HQ_CACHE_PREIMAGE_SECRET_TOO_SHORT' | 'HQ_CACHE_PREIMAGE_INVALID_DEFINITION' | 'HQ_CACHE_PREIMAGE_INVALID_QUERY' | 'HQ_CACHE_PREIMAGE_INVALID_TENANT' | 'HQ_CACHE_PREIMAGE_INVALID_LIMIT';
3
+ /**
4
+ * The tenant scope an execution runs under, as resolved server-side.
5
+ *
6
+ * `all` is a trusted execution the runtime itself scopes to every tenant. It
7
+ * is never reachable from a request and is not the cross-tenant administrative
8
+ * capability, which never touches the data plane.
9
+ */
10
+ export type ProtocolCacheTenantScope = {
11
+ readonly mode: 'none';
12
+ } | {
13
+ readonly mode: 'scoped';
14
+ readonly ids: readonly string[];
15
+ } | {
16
+ readonly mode: 'all';
17
+ };
18
+ export interface BuildProtocolCachePreimageOptions {
19
+ /** The namespace's RFC 0013 cache-key secret; keys tenant fingerprints. */
20
+ readonly secret: Uint8Array;
21
+ /** 64 lowercase hex characters; the RFC 0007 bundle identity when released. */
22
+ readonly definitionIdentity: string;
23
+ /** An RFC 0003 semantic query, validated under expression extension 2. */
24
+ readonly query: unknown;
25
+ readonly tenant: ProtocolCacheTenantScope;
26
+ /** The effective maximum row count, or `null` when none applies. */
27
+ readonly rowLimit: number | null;
28
+ }
29
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cache-preimages/types.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,MAAM,8BAA8B,GACtC,kCAAkC,GAClC,oCAAoC,GACpC,sCAAsC,GACtC,iCAAiC,GACjC,kCAAkC,GAClC,iCAAiC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7B,MAAM,WAAW,iCAAiC;IAChD,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;IAC1C,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC"}
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -2,11 +2,13 @@ export { DEFAULT_CANONICAL_VALUE_LIMITS, ProtocolValueError, decodeCanonicalValu
2
2
  export type { ArrayTaggedValue, BytesTaggedValue, CanonicalValue, CanonicalValueLimits, CanonicalValueOptions, DateTaggedValue, DatetimeTaggedValue, DecimalTaggedValue, EnumTaggedValue, IntegerTaggedValue, MapTaggedValue, ProtocolValueErrorCode, TaggedValue, TupleTaggedValue, UuidTaggedValue, } from './values/index.js';
3
3
  export { PROTOCOL_IDENTIFIER_LIMITS, ProtocolIdentifierError, isProtocolIdentifier, isProtocolQualifiedIdentifier, joinProtocolQualifiedIdentifier, parseProtocolIdentifier, parseProtocolQualifiedIdentifier, splitProtocolQualifiedIdentifier, } from './identifiers/index.js';
4
4
  export { PROTOCOL_CACHE_KEY_LIMITS, ProtocolCacheKeyError, deriveProtocolCacheKey, deriveProtocolCacheNamespaceToken, } from './cache-keys/index.js';
5
+ export { ProtocolCachePreimageError, buildProtocolCachePreimage, deriveProtocolTenantFingerprint, } from './cache-preimages/index.js';
5
6
  export { DEFAULT_PROTOCOL_EXPRESSION_LIMITS, ProtocolExpressionError, validateProtocolExpression, validateProtocolSemanticQuery, } from './expressions/index.js';
6
7
  export { DEFAULT_PROTOCOL_SCHEMA_LIMITS, DEFAULT_PROTOCOL_SCHEMA_VALUE_LIMITS, ProtocolSchemaError, ProtocolSchemaValueError, applyProtocolSchemaValue, createProtocolSchemaValueParser, resolveProtocolSchemaValueLimits, validateProtocolSchema, } from './schemas/index.js';
7
8
  export type { ProtocolSchema, ProtocolSchemaErrorCode, ProtocolSchemaLimits, ProtocolSchemaOptions, ProtocolSchemaValueLimits, ProtocolSchemaValueOptions, ProtocolSchemaValueParser, } from './schemas/index.js';
8
9
  export type { ProtocolAggregation, ProtocolBinaryOperator, ProtocolComparisonOperator, ProtocolDatasetQuery, ProtocolExpression, ProtocolExpressionErrorCode, ProtocolExpressionExtension, ProtocolExpressionLimits, ProtocolExpressionOptions, ProtocolFunctionName, ProtocolMetricQuery, ProtocolOrderBy, ProtocolSemanticQuery, ProtocolQueryTimeGrain, ProtocolTimeGrain, } from './expressions/index.js';
9
10
  export type { DeriveProtocolCacheKeyOptions, ProtocolCacheKeyErrorCode, ProtocolCacheKeyNamespace, } from './cache-keys/index.js';
11
+ export type { BuildProtocolCachePreimageOptions, ProtocolCachePreimageErrorCode, ProtocolCacheTenantScope, } from './cache-preimages/index.js';
10
12
  export type { ProtocolIdentifier, ProtocolIdentifierErrorCode, ProtocolQualifiedIdentifier, } from './identifiers/index.js';
11
13
  export { DEFAULT_PROTOCOL_QUERY_IMPLEMENTATION_LIMITS, ProtocolQueryImplementationError, validateProtocolQueryImplementation, validateProtocolSqlExpression, } from './query-implementations/index.js';
12
14
  export { DEFAULT_PROTOCOL_QUERY_EVENT_LIMITS, ProtocolQueryDiagnosticsError, ProtocolQueryEventError, validateProtocolQueryDiagnostics, validateProtocolQueryEvent, } from './events/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,6BAA6B,EAC7B,+BAA+B,EAC/B,uBAAuB,EACvB,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kCAAkC,EAClC,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,8BAA8B,EAC9B,oCAAoC,EACpC,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACr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,2BAA2B,EAC3B,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,2BAA2B,EAC3B,oCAAoC,EACpC,iCAAiC,EACjC,kCAAkC,EAClC,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,EAC5B,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,6BAA6B,EAC7B,+BAA+B,EAC/B,uBAAuB,EACvB,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,4BAA4B,C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C/B,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,kCAAkC,EAClC,oCAAoC,EACpC,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,2BAA2B,EAC3B,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,2BAA2B,EAC3B,oCAAoC,EACpC,iCAAiC,EACjC,kCAAkC,EAClC,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export { DEFAULT_CANONICAL_VALUE_LIMITS, ProtocolValueError, decodeCanonicalValue, encodeCanonicalValue, encodeCanonicalValueToString, hashCanonicalValue, validateCanonicalValue, } from './values/index.js';
2
2
  export { PROTOCOL_IDENTIFIER_LIMITS, ProtocolIdentifierError, isProtocolIdentifier, isProtocolQualifiedIdentifier, joinProtocolQualifiedIdentifier, parseProtocolIdentifier, parseProtocolQualifiedIdentifier, splitProtocolQualifiedIdentifier, } from './identifiers/index.js';
3
3
  export { PROTOCOL_CACHE_KEY_LIMITS, ProtocolCacheKeyError, deriveProtocolCacheKey, deriveProtocolCacheNamespaceToken, } from './cache-keys/index.js';
4
+ export { ProtocolCachePreimageError, buildProtocolCachePreimage, deriveProtocolTenantFingerprint, } from './cache-preimages/index.js';
4
5
  export { DEFAULT_PROTOCOL_EXPRESSION_LIMITS, ProtocolExpressionError, validateProtocolExpression, validateProtocolSemanticQuery, } from './expressions/index.js';
5
6
  export { DEFAULT_PROTOCOL_SCHEMA_LIMITS, DEFAULT_PROTOCOL_SCHEMA_VALUE_LIMITS, ProtocolSchemaError, ProtocolSchemaValueError, applyProtocolSchemaValue, createProtocolSchemaValueParser, resolveProtocolSchemaValueLimits, validateProtocolSchema, } from './schemas/index.js';
6
7
  export { DEFAULT_PROTOCOL_QUERY_IMPLEMENTATION_LIMITS, ProtocolQueryImplementationError, validateProtocolQueryImplementation, validateProtocolSqlExpression, } from './query-implementations/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypequery/protocol",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Portable analytics contracts and TypeScript reference implementation for Hypequery",
5
5
  "keywords": [
6
6
  "hypequery",