@hypequery/protocol 0.25.0 → 0.27.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.
- package/dist/bundles/index.d.ts +1 -1
- package/dist/bundles/index.d.ts.map +1 -1
- package/dist/bundles/limits.d.ts.map +1 -1
- package/dist/bundles/limits.js +1 -0
- package/dist/bundles/types.d.ts +15 -1
- package/dist/bundles/types.d.ts.map +1 -1
- package/dist/bundles/validate.d.ts.map +1 -1
- package/dist/bundles/validate.js +32 -4
- package/dist/business-context/codec.d.ts +13 -0
- package/dist/business-context/codec.d.ts.map +1 -0
- package/dist/business-context/codec.js +30 -0
- package/dist/business-context/errors.d.ts +8 -0
- package/dist/business-context/errors.d.ts.map +1 -0
- package/dist/business-context/errors.js +13 -0
- package/dist/business-context/index.d.ts +7 -0
- package/dist/business-context/index.d.ts.map +1 -0
- package/dist/business-context/index.js +4 -0
- package/dist/business-context/limits.d.ts +5 -0
- package/dist/business-context/limits.d.ts.map +1 -0
- package/dist/business-context/limits.js +21 -0
- package/dist/business-context/types.d.ts +51 -0
- package/dist/business-context/types.d.ts.map +1 -0
- package/dist/business-context/types.js +1 -0
- package/dist/business-context/validate.d.ts +11 -0
- package/dist/business-context/validate.d.ts.map +1 -0
- package/dist/business-context/validate.js +166 -0
- package/dist/client-contract/features.d.ts +18 -0
- package/dist/client-contract/features.d.ts.map +1 -0
- package/dist/client-contract/features.js +24 -0
- package/dist/client-contract/field-metadata.d.ts +10 -0
- package/dist/client-contract/field-metadata.d.ts.map +1 -0
- package/dist/client-contract/field-metadata.js +36 -0
- package/dist/client-contract/index.d.ts +3 -1
- package/dist/client-contract/index.d.ts.map +1 -1
- package/dist/client-contract/index.js +2 -0
- package/dist/client-contract/nodes.d.ts +2 -0
- package/dist/client-contract/nodes.d.ts.map +1 -1
- package/dist/client-contract/nodes.js +14 -2
- package/dist/client-contract/primitives.d.ts +6 -0
- package/dist/client-contract/primitives.d.ts.map +1 -1
- package/dist/client-contract/primitives.js +21 -0
- package/dist/client-contract/types.d.ts +16 -2
- package/dist/client-contract/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/bundles/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export { PROTOCOL_DEPLOYMENT_BUNDLE_IDENTITY_DOMAIN, encodeProtocolDeploymentBun
|
|
|
3
3
|
export type { PreparedProtocolDeploymentBundleManifest } from './codec.js';
|
|
4
4
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_BUNDLE_LIMITS } from './limits.js';
|
|
5
5
|
export { validateProtocolDeploymentBundleManifest } from './validate.js';
|
|
6
|
-
export type { ProtocolDeploymentBundleArtifact, ProtocolDeploymentBundleDeployment, ProtocolDeploymentBundleErrorCode, ProtocolDeploymentBundleFile, ProtocolDeploymentBundleLimits, ProtocolDeploymentBundleManifest, ProtocolDeploymentBundleOptions, ProtocolDeploymentBundleSource, ProtocolDeploymentBundleSourceRevision, } from './types.js';
|
|
6
|
+
export type { ProtocolDeploymentBundleArtifact, ProtocolDeploymentBundleBusinessContext, ProtocolDeploymentBundleDeployment, ProtocolDeploymentBundleErrorCode, ProtocolDeploymentBundleFile, ProtocolDeploymentBundleLimits, ProtocolDeploymentBundleManifest, ProtocolDeploymentBundleOptions, ProtocolDeploymentBundleSource, ProtocolDeploymentBundleSourceRevision, } from './types.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,0CAA0C,EAC1C,sCAAsC,EACtC,8CAA8C,EAC9C,oCAAoC,EACpC,uCAAuC,GACxC,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,wCAAwC,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,yCAAyC,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,wCAAwC,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EACV,gCAAgC,EAChC,kCAAkC,EAClC,iCAAiC,EACjC,4BAA4B,EAC5B,8BAA8B,EAC9B,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,EAC9B,sCAAsC,GACvC,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,0CAA0C,EAC1C,sCAAsC,EACtC,8CAA8C,EAC9C,oCAAoC,EACpC,uCAAuC,GACxC,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,wCAAwC,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,yCAAyC,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,wCAAwC,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EACV,gCAAgC,EAChC,uCAAuC,EACvC,kCAAkC,EAClC,iCAAiC,EACjC,4BAA4B,EAC5B,8BAA8B,EAC9B,gCAAgC,EAChC,+BAA+B,EAC/B,8BAA8B,EAC9B,sCAAsC,GACvC,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/bundles/limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,+BAA+B,EAChC,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,yCAAyC,EACtD,QAAQ,CAAC,8BAA8B,
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/bundles/limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,+BAA+B,EAChC,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,yCAAyC,EACtD,QAAQ,CAAC,8BAA8B,CAUrC,CAAC;AAEH,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,+BAAoC,GAC5C,QAAQ,CAAC,8BAA8B,CAAC,CAe1C"}
|
package/dist/bundles/limits.js
CHANGED
|
@@ -3,6 +3,7 @@ export const DEFAULT_PROTOCOL_DEPLOYMENT_BUNDLE_LIMITS = Object.freeze({
|
|
|
3
3
|
maxSourceFiles: 1_000,
|
|
4
4
|
maxPathBytes: 1_024,
|
|
5
5
|
maxDeploymentBytes: 16 * 1_024 * 1_024,
|
|
6
|
+
maxBusinessContextBytes: 1_024 * 1_024,
|
|
6
7
|
maxArtifactBytes: 128 * 1_024 * 1_024,
|
|
7
8
|
maxSourceFileBytes: 2 * 1_024 * 1_024,
|
|
8
9
|
maxSourceBytes: 32 * 1_024 * 1_024,
|
package/dist/bundles/types.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export interface ProtocolDeploymentBundleFile {
|
|
|
6
6
|
export interface ProtocolDeploymentBundleDeployment extends ProtocolDeploymentBundleFile {
|
|
7
7
|
readonly identity: string;
|
|
8
8
|
}
|
|
9
|
+
/** Reviewed business context file (bundle v2). Its identity is the document identity. */
|
|
10
|
+
export interface ProtocolDeploymentBundleBusinessContext extends ProtocolDeploymentBundleFile {
|
|
11
|
+
readonly identity: string;
|
|
12
|
+
}
|
|
9
13
|
export interface ProtocolDeploymentBundleArtifact extends ProtocolDeploymentBundleFile {
|
|
10
14
|
readonly runtime: 'node' | 'python';
|
|
11
15
|
}
|
|
@@ -24,10 +28,19 @@ export interface ProtocolDeploymentBundleSource {
|
|
|
24
28
|
readonly files: readonly ProtocolDeploymentBundleFile[];
|
|
25
29
|
readonly revision?: ProtocolDeploymentBundleSourceRevision;
|
|
26
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Deployment bundle manifest.
|
|
33
|
+
*
|
|
34
|
+
* Version 1 carries only the executable contract. Version 2 additionally
|
|
35
|
+
* requires `businessContext`; a bundle without business context is always
|
|
36
|
+
* encoded as version 1 so each bundle has exactly one canonical identity.
|
|
37
|
+
*/
|
|
27
38
|
export interface ProtocolDeploymentBundleManifest {
|
|
28
39
|
readonly kind: 'hypequery-deployment-bundle';
|
|
29
|
-
readonly version: 1;
|
|
40
|
+
readonly version: 1 | 2;
|
|
30
41
|
readonly deployment: ProtocolDeploymentBundleDeployment;
|
|
42
|
+
/** Present exactly when `version` is 2. */
|
|
43
|
+
readonly businessContext?: ProtocolDeploymentBundleBusinessContext;
|
|
31
44
|
readonly artifacts: readonly ProtocolDeploymentBundleArtifact[];
|
|
32
45
|
readonly source?: ProtocolDeploymentBundleSource;
|
|
33
46
|
}
|
|
@@ -36,6 +49,7 @@ export interface ProtocolDeploymentBundleLimits {
|
|
|
36
49
|
readonly maxSourceFiles: number;
|
|
37
50
|
readonly maxPathBytes: number;
|
|
38
51
|
readonly maxDeploymentBytes: number;
|
|
52
|
+
readonly maxBusinessContextBytes: number;
|
|
39
53
|
readonly maxArtifactBytes: number;
|
|
40
54
|
readonly maxSourceFileBytes: number;
|
|
41
55
|
readonly maxSourceBytes: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bundles/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,kCAAmC,SAAQ,4BAA4B;IACtF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,gCAAiC,SAAQ,4BAA4B;IACpF,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC;CACrC;AAED,MAAM,WAAW,sCAAsC;IACrD,QAAQ,CAAC,IAA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AM,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC3D;AAED,MAAM,MAAM,iCAAiC,GACzC,gBAAgB,GAChB,yBAAyB,GACzB,2BAA2B,GAC3B,yBAAyB,GACzB,wBAAwB,GACxB,6BAA6B,GAC7B,0BAA0B,GAC1B,qBAAqB,GACrB,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/bundles/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/bundles/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKV,gCAAgC,EAChC,+BAA+B,EAGhC,MAAM,YAAY,CAAC;AAkQpB,wBAAgB,wCAAwC,CACtD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,+BAAoC,GAC5C,gCAAgC,CAsElC"}
|
package/dist/bundles/validate.js
CHANGED
|
@@ -98,6 +98,16 @@ function validateDeployment(input, path, limits) {
|
|
|
98
98
|
byteLength: byteLength(value.byteLength, `${path}.byteLength`, limits.maxDeploymentBytes),
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
+
function validateBusinessContext(input, path, limits) {
|
|
102
|
+
const value = requireRecord(input, path);
|
|
103
|
+
exactFields(value, ['path', 'identity', 'sha256', 'byteLength'], path);
|
|
104
|
+
return freezeRecord({
|
|
105
|
+
path: relativePath(value.path, `${path}.path`, limits.maxPathBytes),
|
|
106
|
+
identity: digest(value.identity, `${path}.identity`),
|
|
107
|
+
sha256: digest(value.sha256, `${path}.sha256`),
|
|
108
|
+
byteLength: byteLength(value.byteLength, `${path}.byteLength`, limits.maxBusinessContextBytes),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
101
111
|
function validateArtifact(input, path, limits) {
|
|
102
112
|
const value = requireRecord(input, path);
|
|
103
113
|
exactFields(value, ['runtime', 'path', 'sha256', 'byteLength'], path);
|
|
@@ -208,25 +218,41 @@ function hasTreeCollision(paths) {
|
|
|
208
218
|
export function validateProtocolDeploymentBundleManifest(input, options = {}) {
|
|
209
219
|
const limits = resolveDeploymentBundleLimits(options);
|
|
210
220
|
const value = requireRecord(input, '$');
|
|
211
|
-
exactFields(value, ['kind', 'version', 'deployment', 'artifacts'], '$', ['source']);
|
|
221
|
+
exactFields(value, ['kind', 'version', 'deployment', 'artifacts'], '$', ['businessContext', 'source']);
|
|
212
222
|
if (value.kind !== 'hypequery-deployment-bundle') {
|
|
213
223
|
if (typeof value.kind !== 'string')
|
|
214
224
|
bundleError('HQ_BUNDLE_TYPE', '$.kind');
|
|
215
225
|
bundleError('HQ_BUNDLE_INVALID_VALUE', '$.kind');
|
|
216
226
|
}
|
|
217
|
-
if (value.version !== 1) {
|
|
227
|
+
if (value.version !== 1 && value.version !== 2) {
|
|
218
228
|
if (typeof value.version !== 'number')
|
|
219
229
|
bundleError('HQ_BUNDLE_TYPE', '$.version');
|
|
220
230
|
bundleError('HQ_BUNDLE_INVALID_VERSION', '$.version');
|
|
221
231
|
}
|
|
232
|
+
const version = value.version;
|
|
233
|
+
// v1 cannot carry business context; v2 exists only to carry it.
|
|
234
|
+
if (version === 1 && value.businessContext !== undefined) {
|
|
235
|
+
bundleError('HQ_BUNDLE_UNKNOWN_FIELD', '$.businessContext');
|
|
236
|
+
}
|
|
237
|
+
if (version === 2 && value.businessContext === undefined) {
|
|
238
|
+
bundleError('HQ_BUNDLE_TYPE', '$.businessContext');
|
|
239
|
+
}
|
|
222
240
|
const deployment = validateDeployment(value.deployment, '$.deployment', limits);
|
|
241
|
+
const businessContext = value.businessContext === undefined
|
|
242
|
+
? undefined
|
|
243
|
+
: validateBusinessContext(value.businessContext, '$.businessContext', limits);
|
|
223
244
|
const artifacts = Object.freeze(requireArray(value.artifacts, '$.artifacts', limits.maxArtifacts)
|
|
224
245
|
.map((artifact, index) => validateArtifact(artifact, `$.artifacts[${index}]`, limits)));
|
|
225
246
|
const source = value.source === undefined
|
|
226
247
|
? undefined
|
|
227
248
|
: validateSource(value.source, '$.source', limits);
|
|
228
249
|
const sourcePaths = source?.files.map(file => `${source.root}/${file.path}`) ?? [];
|
|
229
|
-
const paths = [
|
|
250
|
+
const paths = [
|
|
251
|
+
deployment.path,
|
|
252
|
+
...(businessContext ? [businessContext.path] : []),
|
|
253
|
+
...artifacts.map(artifact => artifact.path),
|
|
254
|
+
...sourcePaths,
|
|
255
|
+
];
|
|
230
256
|
if (new Set(paths).size !== paths.length
|
|
231
257
|
|| new Set(paths.map(bundlePath => bundlePath.toLowerCase())).size !== paths.length
|
|
232
258
|
|| hasTreeCollision(paths)) {
|
|
@@ -240,6 +266,7 @@ export function validateProtocolDeploymentBundleManifest(input, options = {}) {
|
|
|
240
266
|
bundleError('HQ_BUNDLE_INVALID_VALUE', '$.artifacts');
|
|
241
267
|
}
|
|
242
268
|
const totalBytes = deployment.byteLength
|
|
269
|
+
+ (businessContext?.byteLength ?? 0)
|
|
243
270
|
+ artifacts.reduce((total, artifact) => total + artifact.byteLength, 0)
|
|
244
271
|
+ (source?.files.reduce((total, file) => total + file.byteLength, 0) ?? 0);
|
|
245
272
|
if (!Number.isSafeInteger(totalBytes) || totalBytes > limits.maxTotalBytes) {
|
|
@@ -247,8 +274,9 @@ export function validateProtocolDeploymentBundleManifest(input, options = {}) {
|
|
|
247
274
|
}
|
|
248
275
|
return freezeRecord({
|
|
249
276
|
kind: 'hypequery-deployment-bundle',
|
|
250
|
-
version
|
|
277
|
+
version,
|
|
251
278
|
deployment,
|
|
279
|
+
...(businessContext ? { businessContext } : {}),
|
|
252
280
|
artifacts,
|
|
253
281
|
...(source ? { source } : {}),
|
|
254
282
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ProtocolBusinessContext, ProtocolBusinessContextOptions } from './types.js';
|
|
2
|
+
export declare const PROTOCOL_BUSINESS_CONTEXT_IDENTITY_DOMAIN = "hypequery:business-context:v1\0";
|
|
3
|
+
export interface PreparedProtocolBusinessContext {
|
|
4
|
+
readonly context: ProtocolBusinessContext;
|
|
5
|
+
readonly canonical: string;
|
|
6
|
+
readonly bytes: Uint8Array;
|
|
7
|
+
readonly identity: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function prepareProtocolBusinessContext(input: unknown, options?: ProtocolBusinessContextOptions): PreparedProtocolBusinessContext;
|
|
10
|
+
export declare function encodeProtocolBusinessContext(input: unknown, options?: ProtocolBusinessContextOptions): Uint8Array;
|
|
11
|
+
export declare function encodeProtocolBusinessContextToString(input: unknown, options?: ProtocolBusinessContextOptions): string;
|
|
12
|
+
export declare function hashProtocolBusinessContext(input: unknown, options?: ProtocolBusinessContextOptions): string;
|
|
13
|
+
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/business-context/codec.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,uBAAuB,EACvB,8BAA8B,EAC/B,MAAM,YAAY,CAAC;AAKpB,eAAO,MAAM,yCAAyC,oCAAoC,CAAC;AAE3F,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,8BAAmC,GAC3C,+BAA+B,CAWjC;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,8BAAmC,GAC3C,UAAU,CAEZ;AAED,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,8BAAmC,GAC3C,MAAM,CAER;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,8BAAmC,GAC3C,MAAM,CAER"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { sha256 } from '@noble/hashes/sha2.js';
|
|
2
|
+
import { bytesToHex } from '@noble/hashes/utils.js';
|
|
3
|
+
import { serializeJcs } from '../values/jcs.js';
|
|
4
|
+
import { businessContextError } from './errors.js';
|
|
5
|
+
import { resolveBusinessContextLimits } from './limits.js';
|
|
6
|
+
import { validateProtocolBusinessContext } from './validate.js';
|
|
7
|
+
const textEncoder = new TextEncoder();
|
|
8
|
+
export const PROTOCOL_BUSINESS_CONTEXT_IDENTITY_DOMAIN = 'hypequery:business-context:v1\0';
|
|
9
|
+
export function prepareProtocolBusinessContext(input, options = {}) {
|
|
10
|
+
const limits = resolveBusinessContextLimits(options);
|
|
11
|
+
const context = validateProtocolBusinessContext(input, options);
|
|
12
|
+
const canonical = serializeJcs(context);
|
|
13
|
+
const bytes = textEncoder.encode(canonical);
|
|
14
|
+
if (bytes.byteLength > limits.maxBytes)
|
|
15
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TOO_LARGE');
|
|
16
|
+
const identity = bytesToHex(sha256.create()
|
|
17
|
+
.update(textEncoder.encode(PROTOCOL_BUSINESS_CONTEXT_IDENTITY_DOMAIN))
|
|
18
|
+
.update(bytes)
|
|
19
|
+
.digest());
|
|
20
|
+
return Object.freeze({ context, canonical, bytes, identity });
|
|
21
|
+
}
|
|
22
|
+
export function encodeProtocolBusinessContext(input, options = {}) {
|
|
23
|
+
return prepareProtocolBusinessContext(input, options).bytes;
|
|
24
|
+
}
|
|
25
|
+
export function encodeProtocolBusinessContextToString(input, options = {}) {
|
|
26
|
+
return prepareProtocolBusinessContext(input, options).canonical;
|
|
27
|
+
}
|
|
28
|
+
export function hashProtocolBusinessContext(input, options = {}) {
|
|
29
|
+
return prepareProtocolBusinessContext(input, options).identity;
|
|
30
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProtocolBusinessContextErrorCode } from './types.js';
|
|
2
|
+
export declare class ProtocolBusinessContextError extends TypeError {
|
|
3
|
+
readonly code: ProtocolBusinessContextErrorCode;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
constructor(code: ProtocolBusinessContextErrorCode, path?: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function businessContextError(code: ProtocolBusinessContextErrorCode, path?: string): never;
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/business-context/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAEnE,qBAAa,4BAA6B,SAAQ,SAAS;IACzD,QAAQ,CAAC,IAAI,EAAE,gCAAgC,CAAC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,gCAAgC,EAAE,IAAI,SAAM;CAM/D;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,gCAAgC,EACtC,IAAI,SAAM,GACT,KAAK,CAEP"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class ProtocolBusinessContextError extends TypeError {
|
|
2
|
+
code;
|
|
3
|
+
path;
|
|
4
|
+
constructor(code, path = '$') {
|
|
5
|
+
super(`${code} at ${path}`);
|
|
6
|
+
this.name = 'ProtocolBusinessContextError';
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.path = path;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function businessContextError(code, path = '$') {
|
|
12
|
+
throw new ProtocolBusinessContextError(code, path);
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ProtocolBusinessContextError } from './errors.js';
|
|
2
|
+
export { PROTOCOL_BUSINESS_CONTEXT_IDENTITY_DOMAIN, encodeProtocolBusinessContext, encodeProtocolBusinessContextToString, hashProtocolBusinessContext, prepareProtocolBusinessContext, } from './codec.js';
|
|
3
|
+
export type { PreparedProtocolBusinessContext } from './codec.js';
|
|
4
|
+
export { DEFAULT_PROTOCOL_BUSINESS_CONTEXT_LIMITS } from './limits.js';
|
|
5
|
+
export { isEmptyProtocolBusinessContext, validateProtocolBusinessContext, } from './validate.js';
|
|
6
|
+
export type { ProtocolBusinessContext, ProtocolBusinessContextErrorCode, ProtocolBusinessContextGlossaryTerm, ProtocolBusinessContextKpi, ProtocolBusinessContextLimits, ProtocolBusinessContextOptions, } from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/business-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,yCAAyC,EACzC,6BAA6B,EAC7B,qCAAqC,EACrC,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,uBAAuB,EACvB,gCAAgC,EAChC,mCAAmC,EACnC,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ProtocolBusinessContextError } from './errors.js';
|
|
2
|
+
export { PROTOCOL_BUSINESS_CONTEXT_IDENTITY_DOMAIN, encodeProtocolBusinessContext, encodeProtocolBusinessContextToString, hashProtocolBusinessContext, prepareProtocolBusinessContext, } from './codec.js';
|
|
3
|
+
export { DEFAULT_PROTOCOL_BUSINESS_CONTEXT_LIMITS } from './limits.js';
|
|
4
|
+
export { isEmptyProtocolBusinessContext, validateProtocolBusinessContext, } from './validate.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProtocolBusinessContextLimits, ProtocolBusinessContextOptions } from './types.js';
|
|
2
|
+
/** Matches the limits Cloud onboarding already enforces on business profiles. */
|
|
3
|
+
export declare const DEFAULT_PROTOCOL_BUSINESS_CONTEXT_LIMITS: Readonly<ProtocolBusinessContextLimits>;
|
|
4
|
+
export declare function resolveBusinessContextLimits(options?: ProtocolBusinessContextOptions): Readonly<ProtocolBusinessContextLimits>;
|
|
5
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/business-context/limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,YAAY,CAAC;AAEpB,iFAAiF;AACjF,eAAO,MAAM,wCAAwC,EACrD,QAAQ,CAAC,6BAA6B,CAIpC,CAAC;AAEH,wBAAgB,4BAA4B,CAC1C,OAAO,GAAE,8BAAmC,GAC3C,QAAQ,CAAC,6BAA6B,CAAC,CAezC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Matches the limits Cloud onboarding already enforces on business profiles. */
|
|
2
|
+
export const DEFAULT_PROTOCOL_BUSINESS_CONTEXT_LIMITS = Object.freeze({
|
|
3
|
+
maxTextLength: 4_096,
|
|
4
|
+
maxItems: 100,
|
|
5
|
+
maxBytes: 1_024 * 1_024,
|
|
6
|
+
});
|
|
7
|
+
export function resolveBusinessContextLimits(options = {}) {
|
|
8
|
+
const result = { ...DEFAULT_PROTOCOL_BUSINESS_CONTEXT_LIMITS };
|
|
9
|
+
for (const key of Object.keys(result)) {
|
|
10
|
+
const value = options.limits?.[key];
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
continue;
|
|
13
|
+
const maximum = DEFAULT_PROTOCOL_BUSINESS_CONTEXT_LIMITS[key];
|
|
14
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > maximum) {
|
|
15
|
+
throw new RangeError(`${key} must be a positive safe integer no greater than ${maximum} `
|
|
16
|
+
+ '(the business context v1 maximum)');
|
|
17
|
+
}
|
|
18
|
+
result[key] = value;
|
|
19
|
+
}
|
|
20
|
+
return Object.freeze(result);
|
|
21
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface ProtocolBusinessContextKpi {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly definition: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ProtocolBusinessContextGlossaryTerm {
|
|
6
|
+
readonly term: string;
|
|
7
|
+
readonly meaning: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Reviewed business context published alongside a deployment contract.
|
|
11
|
+
*
|
|
12
|
+
* This is descriptive guidance for analysts and assistants. It is deliberately
|
|
13
|
+
* separate from the executable deployment contract: the data plane never reads
|
|
14
|
+
* it, and changing it never changes query semantics.
|
|
15
|
+
*/
|
|
16
|
+
export interface ProtocolBusinessContext {
|
|
17
|
+
readonly kind: 'hypequery-business-context';
|
|
18
|
+
readonly version: 1;
|
|
19
|
+
/** What the business does, in a few sentences. */
|
|
20
|
+
readonly summary?: string;
|
|
21
|
+
readonly industry?: string;
|
|
22
|
+
/** How the business makes money. */
|
|
23
|
+
readonly businessModel?: string;
|
|
24
|
+
/** Who it sells to, and its main segments. */
|
|
25
|
+
readonly customers?: string;
|
|
26
|
+
/** Who asks the questions: roles and teams. */
|
|
27
|
+
readonly audience?: string;
|
|
28
|
+
/** Decisions and recurring questions the data should help with. */
|
|
29
|
+
readonly goals?: readonly string[];
|
|
30
|
+
/** The numbers the business watches, with their business definition. */
|
|
31
|
+
readonly kpis?: readonly ProtocolBusinessContextKpi[];
|
|
32
|
+
/** Business terms and what they mean in this organisation. */
|
|
33
|
+
readonly glossary?: readonly ProtocolBusinessContextGlossaryTerm[];
|
|
34
|
+
/** Reporting conventions: currency, time zone, fiscal year, week start. */
|
|
35
|
+
readonly conventions?: string;
|
|
36
|
+
/** Known data quirks, e.g. test orders or refunds stored elsewhere. */
|
|
37
|
+
readonly caveats?: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export interface ProtocolBusinessContextLimits {
|
|
40
|
+
/** Maximum characters in any single text value. */
|
|
41
|
+
readonly maxTextLength: number;
|
|
42
|
+
/** Maximum items in any list (goals, kpis, glossary, caveats). */
|
|
43
|
+
readonly maxItems: number;
|
|
44
|
+
/** Maximum UTF-8 bytes of the canonical encoding. */
|
|
45
|
+
readonly maxBytes: number;
|
|
46
|
+
}
|
|
47
|
+
export interface ProtocolBusinessContextOptions {
|
|
48
|
+
readonly limits?: Partial<ProtocolBusinessContextLimits>;
|
|
49
|
+
}
|
|
50
|
+
export type ProtocolBusinessContextErrorCode = 'HQ_BUSINESS_CONTEXT_TYPE' | 'HQ_BUSINESS_CONTEXT_UNKNOWN_FIELD' | 'HQ_BUSINESS_CONTEXT_INVALID_VERSION' | 'HQ_BUSINESS_CONTEXT_INVALID_VALUE' | 'HQ_BUSINESS_CONTEXT_DUPLICATE' | 'HQ_BUSINESS_CONTEXT_TOO_MANY_ITEMS' | 'HQ_BUSINESS_CONTEXT_TOO_LARGE' | 'HQ_BUSINESS_CONTEXT_UNSAFE_OBJECT';
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/business-context/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,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-0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ProtocolBusinessContext, ProtocolBusinessContextOptions } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validates and canonicalises a business context document.
|
|
4
|
+
*
|
|
5
|
+
* Canonical form trims text, omits empty lists and keeps author order. Two
|
|
6
|
+
* inputs that differ only in those respects therefore share one identity.
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateProtocolBusinessContext(input: unknown, options?: ProtocolBusinessContextOptions): ProtocolBusinessContext;
|
|
9
|
+
/** True when the document carries no authored content beyond its header. */
|
|
10
|
+
export declare function isEmptyProtocolBusinessContext(context: ProtocolBusinessContext): boolean;
|
|
11
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/business-context/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,uBAAuB,EAIvB,8BAA8B,EAC/B,MAAM,YAAY,CAAC;AAwIpB;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,8BAAmC,GAC3C,uBAAuB,CAoCzB;AAED,4EAA4E;AAC5E,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAExF"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { businessContextError } from './errors.js';
|
|
2
|
+
import { resolveBusinessContextLimits } from './limits.js';
|
|
3
|
+
const TEXT_FIELDS = [
|
|
4
|
+
'summary',
|
|
5
|
+
'industry',
|
|
6
|
+
'businessModel',
|
|
7
|
+
'customers',
|
|
8
|
+
'audience',
|
|
9
|
+
'conventions',
|
|
10
|
+
];
|
|
11
|
+
const TEXT_LIST_FIELDS = ['goals', 'caveats'];
|
|
12
|
+
const FIELD_ORDER = [
|
|
13
|
+
'summary',
|
|
14
|
+
'industry',
|
|
15
|
+
'businessModel',
|
|
16
|
+
'customers',
|
|
17
|
+
'audience',
|
|
18
|
+
'goals',
|
|
19
|
+
'kpis',
|
|
20
|
+
'glossary',
|
|
21
|
+
'conventions',
|
|
22
|
+
'caveats',
|
|
23
|
+
];
|
|
24
|
+
const ALLOWED_FIELDS = new Set(['kind', 'version', ...FIELD_ORDER]);
|
|
25
|
+
/** C0/C1 controls other than tab and newline, which have no meaning in prose. */
|
|
26
|
+
const CONTROL_CHARACTER = /[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/;
|
|
27
|
+
const LONE_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
|
|
28
|
+
function requireRecord(input, path) {
|
|
29
|
+
if (typeof input !== 'object' || input === null || Array.isArray(input)) {
|
|
30
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TYPE', path);
|
|
31
|
+
}
|
|
32
|
+
const prototype = Object.getPrototypeOf(input);
|
|
33
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
34
|
+
businessContextError('HQ_BUSINESS_CONTEXT_UNSAFE_OBJECT', path);
|
|
35
|
+
}
|
|
36
|
+
if (Object.getOwnPropertySymbols(input).length > 0) {
|
|
37
|
+
businessContextError('HQ_BUSINESS_CONTEXT_UNSAFE_OBJECT', path);
|
|
38
|
+
}
|
|
39
|
+
for (const descriptor of Object.values(Object.getOwnPropertyDescriptors(input))) {
|
|
40
|
+
if (!descriptor.enumerable || !('value' in descriptor)) {
|
|
41
|
+
businessContextError('HQ_BUSINESS_CONTEXT_UNSAFE_OBJECT', path);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return input;
|
|
45
|
+
}
|
|
46
|
+
function requireArray(input, path, maxItems) {
|
|
47
|
+
if (!Array.isArray(input))
|
|
48
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TYPE', path);
|
|
49
|
+
if (Object.getPrototypeOf(input) !== Array.prototype
|
|
50
|
+
|| Object.getOwnPropertySymbols(input).length > 0) {
|
|
51
|
+
businessContextError('HQ_BUSINESS_CONTEXT_UNSAFE_OBJECT', path);
|
|
52
|
+
}
|
|
53
|
+
if (input.length > maxItems)
|
|
54
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TOO_MANY_ITEMS', path);
|
|
55
|
+
const descriptors = Object.getOwnPropertyDescriptors(input);
|
|
56
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
57
|
+
const descriptor = descriptors[String(index)];
|
|
58
|
+
if (!descriptor || !descriptor.enumerable || !('value' in descriptor)) {
|
|
59
|
+
businessContextError('HQ_BUSINESS_CONTEXT_UNSAFE_OBJECT', `${path}[${index}]`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (Object.keys(input).length !== input.length
|
|
63
|
+
|| Object.getOwnPropertyNames(input).length !== input.length + 1) {
|
|
64
|
+
businessContextError('HQ_BUSINESS_CONTEXT_UNSAFE_OBJECT', path);
|
|
65
|
+
}
|
|
66
|
+
return input;
|
|
67
|
+
}
|
|
68
|
+
function exactFields(value, allowed, path) {
|
|
69
|
+
for (const key of Object.keys(value)) {
|
|
70
|
+
if (!allowed.has(key))
|
|
71
|
+
businessContextError('HQ_BUSINESS_CONTEXT_UNKNOWN_FIELD', `${path}.${key}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** Trimmed, non-empty prose without control characters or broken UTF-16. */
|
|
75
|
+
function text(value, path, limits) {
|
|
76
|
+
if (typeof value !== 'string')
|
|
77
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TYPE', path);
|
|
78
|
+
const trimmed = value.trim();
|
|
79
|
+
if (trimmed.length === 0 || CONTROL_CHARACTER.test(trimmed) || LONE_SURROGATE.test(trimmed)) {
|
|
80
|
+
businessContextError('HQ_BUSINESS_CONTEXT_INVALID_VALUE', path);
|
|
81
|
+
}
|
|
82
|
+
if (trimmed.length > limits.maxTextLength) {
|
|
83
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TOO_LARGE', path);
|
|
84
|
+
}
|
|
85
|
+
return trimmed;
|
|
86
|
+
}
|
|
87
|
+
/** Case- and whitespace-insensitive key used to reject ambiguous duplicate terms. */
|
|
88
|
+
function termKey(value) {
|
|
89
|
+
return value.normalize('NFKC').toLowerCase().replace(/\s+/g, ' ');
|
|
90
|
+
}
|
|
91
|
+
function textList(value, path, limits) {
|
|
92
|
+
const items = requireArray(value, path, limits.maxItems);
|
|
93
|
+
return Object.freeze(items.map((item, index) => text(item, `${path}[${index}]`, limits)));
|
|
94
|
+
}
|
|
95
|
+
function pairs(value, path, keyField, valueField, limits) {
|
|
96
|
+
const items = requireArray(value, path, limits.maxItems);
|
|
97
|
+
const allowed = new Set([keyField, valueField]);
|
|
98
|
+
const seen = new Set();
|
|
99
|
+
return Object.freeze(items.map((item, index) => {
|
|
100
|
+
const itemPath = `${path}[${index}]`;
|
|
101
|
+
const record = requireRecord(item, itemPath);
|
|
102
|
+
exactFields(record, allowed, itemPath);
|
|
103
|
+
if (!Object.hasOwn(record, keyField))
|
|
104
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TYPE', `${itemPath}.${keyField}`);
|
|
105
|
+
if (!Object.hasOwn(record, valueField))
|
|
106
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TYPE', `${itemPath}.${valueField}`);
|
|
107
|
+
const key = text(record[keyField], `${itemPath}.${keyField}`, limits);
|
|
108
|
+
const normalized = termKey(key);
|
|
109
|
+
if (seen.has(normalized)) {
|
|
110
|
+
businessContextError('HQ_BUSINESS_CONTEXT_DUPLICATE', `${itemPath}.${keyField}`);
|
|
111
|
+
}
|
|
112
|
+
seen.add(normalized);
|
|
113
|
+
return Object.freeze({
|
|
114
|
+
[keyField]: key,
|
|
115
|
+
[valueField]: text(record[valueField], `${itemPath}.${valueField}`, limits),
|
|
116
|
+
});
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Validates and canonicalises a business context document.
|
|
121
|
+
*
|
|
122
|
+
* Canonical form trims text, omits empty lists and keeps author order. Two
|
|
123
|
+
* inputs that differ only in those respects therefore share one identity.
|
|
124
|
+
*/
|
|
125
|
+
export function validateProtocolBusinessContext(input, options = {}) {
|
|
126
|
+
const limits = resolveBusinessContextLimits(options);
|
|
127
|
+
const value = requireRecord(input, '$');
|
|
128
|
+
exactFields(value, ALLOWED_FIELDS, '$');
|
|
129
|
+
if (value.kind !== 'hypequery-business-context') {
|
|
130
|
+
businessContextError('HQ_BUSINESS_CONTEXT_TYPE', '$.kind');
|
|
131
|
+
}
|
|
132
|
+
if (value.version !== 1)
|
|
133
|
+
businessContextError('HQ_BUSINESS_CONTEXT_INVALID_VERSION', '$.version');
|
|
134
|
+
const fields = {};
|
|
135
|
+
for (const key of TEXT_FIELDS) {
|
|
136
|
+
if (value[key] !== undefined)
|
|
137
|
+
fields[key] = text(value[key], `$.${key}`, limits);
|
|
138
|
+
}
|
|
139
|
+
for (const key of TEXT_LIST_FIELDS) {
|
|
140
|
+
if (value[key] === undefined)
|
|
141
|
+
continue;
|
|
142
|
+
const list = textList(value[key], `$.${key}`, limits);
|
|
143
|
+
if (list.length > 0)
|
|
144
|
+
fields[key] = list;
|
|
145
|
+
}
|
|
146
|
+
if (value.kpis !== undefined) {
|
|
147
|
+
const kpis = pairs(value.kpis, '$.kpis', 'name', 'definition', limits);
|
|
148
|
+
if (kpis.length > 0)
|
|
149
|
+
fields.kpis = kpis;
|
|
150
|
+
}
|
|
151
|
+
if (value.glossary !== undefined) {
|
|
152
|
+
const glossary = pairs(value.glossary, '$.glossary', 'term', 'meaning', limits);
|
|
153
|
+
if (glossary.length > 0)
|
|
154
|
+
fields.glossary = glossary;
|
|
155
|
+
}
|
|
156
|
+
const ordered = { kind: 'hypequery-business-context', version: 1 };
|
|
157
|
+
for (const key of FIELD_ORDER) {
|
|
158
|
+
if (fields[key] !== undefined)
|
|
159
|
+
ordered[key] = fields[key];
|
|
160
|
+
}
|
|
161
|
+
return Object.freeze(ordered);
|
|
162
|
+
}
|
|
163
|
+
/** True when the document carries no authored content beyond its header. */
|
|
164
|
+
export function isEmptyProtocolBusinessContext(context) {
|
|
165
|
+
return FIELD_ORDER.every(key => context[key] === undefined);
|
|
166
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional client-contract members a consumer opts into per discovery request.
|
|
3
|
+
*
|
|
4
|
+
* Validators released before a member existed reject it as an unknown field, so
|
|
5
|
+
* a producer emits it only to a consumer that names its feature in this request
|
|
6
|
+
* header. Tokens are comma-separated and case-insensitive; unknown tokens are
|
|
7
|
+
* ignored, and an oversized header names no features.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CLIENT_CONTRACT_FEATURES_HEADER = "x-hypequery-client-features";
|
|
10
|
+
/** Field annotations' synonyms, examples, format, unit and currency (RFC 0018, 2026-11-05). */
|
|
11
|
+
export declare const CLIENT_CONTRACT_FIELD_METADATA_FEATURE = "field-metadata";
|
|
12
|
+
/** Every feature this version understands, as one header value. */
|
|
13
|
+
export declare const CLIENT_CONTRACT_FEATURES = "field-metadata";
|
|
14
|
+
/** The feature tokens named by a features header value (`null`/`undefined` when absent). */
|
|
15
|
+
export declare function parseClientContractFeatures(value: string | null | undefined): ReadonlySet<string>;
|
|
16
|
+
/** Whether a features header value asks for field metadata. */
|
|
17
|
+
export declare function acceptsClientFieldMetadata(value: string | null | undefined): boolean;
|
|
18
|
+
//# sourceMappingURL=features.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/client-contract/features.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,gCAAgC,CAAC;AAC7E,+FAA+F;AAC/F,eAAO,MAAM,sCAAsC,mBAAmB,CAAC;AACvE,mEAAmE;AACnE,eAAO,MAAM,wBAAwB,mBAAyC,CAAC;AAG/E,4FAA4F;AAC5F,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,CAGjG;AAED,+DAA+D;AAC/D,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEpF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional client-contract members a consumer opts into per discovery request.
|
|
3
|
+
*
|
|
4
|
+
* Validators released before a member existed reject it as an unknown field, so
|
|
5
|
+
* a producer emits it only to a consumer that names its feature in this request
|
|
6
|
+
* header. Tokens are comma-separated and case-insensitive; unknown tokens are
|
|
7
|
+
* ignored, and an oversized header names no features.
|
|
8
|
+
*/
|
|
9
|
+
export const CLIENT_CONTRACT_FEATURES_HEADER = 'x-hypequery-client-features';
|
|
10
|
+
/** Field annotations' synonyms, examples, format, unit and currency (RFC 0018, 2026-11-05). */
|
|
11
|
+
export const CLIENT_CONTRACT_FIELD_METADATA_FEATURE = 'field-metadata';
|
|
12
|
+
/** Every feature this version understands, as one header value. */
|
|
13
|
+
export const CLIENT_CONTRACT_FEATURES = CLIENT_CONTRACT_FIELD_METADATA_FEATURE;
|
|
14
|
+
const MAX_FEATURES_HEADER_LENGTH = 256;
|
|
15
|
+
/** The feature tokens named by a features header value (`null`/`undefined` when absent). */
|
|
16
|
+
export function parseClientContractFeatures(value) {
|
|
17
|
+
if (typeof value !== 'string' || value.length > MAX_FEATURES_HEADER_LENGTH)
|
|
18
|
+
return new Set();
|
|
19
|
+
return new Set(value.split(',').map(token => token.replace(/^[ \t]+|[ \t]+$/g, '').toLowerCase()).filter(Boolean));
|
|
20
|
+
}
|
|
21
|
+
/** Whether a features header value asks for field metadata. */
|
|
22
|
+
export function acceptsClientFieldMetadata(value) {
|
|
23
|
+
return parseClientContractFeatures(value).has(CLIENT_CONTRACT_FIELD_METADATA_FEATURE);
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PreparedProtocolClientContract } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The same contract and view without field annotations' synonyms, examples,
|
|
4
|
+
* format, unit and currency, for a consumer that did not ask for field
|
|
5
|
+
* metadata. Field entries, `fields` and `annotations` left empty are omitted, so
|
|
6
|
+
* the result has one canonical encoding; every schemaHash is unchanged and the
|
|
7
|
+
* contentHash is recomputed.
|
|
8
|
+
*/
|
|
9
|
+
export declare function withoutClientFieldMetadata(prepared: PreparedProtocolClientContract): PreparedProtocolClientContract;
|
|
10
|
+
//# sourceMappingURL=field-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-metadata.d.ts","sourceRoot":"","sources":["../../src/client-contract/field-metadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,8BAA8B,EAE/B,MAAM,YAAY,CAAC;AAsBpB;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,8BAA8B,GAAG,8BAA8B,CAQnH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { prepareProtocolClientContract } from './validate.js';
|
|
2
|
+
function fieldText(field) {
|
|
3
|
+
const { label, description } = field;
|
|
4
|
+
if (label === undefined && description === undefined)
|
|
5
|
+
return undefined;
|
|
6
|
+
return { ...(label === undefined ? {} : { label }), ...(description === undefined ? {} : { description }) };
|
|
7
|
+
}
|
|
8
|
+
function textOnly(annotations) {
|
|
9
|
+
const fields = Object.fromEntries(Object.entries(annotations.fields ?? {}).flatMap(([key, field]) => {
|
|
10
|
+
const text = fieldText(field);
|
|
11
|
+
return text ? [[key, text]] : [];
|
|
12
|
+
}));
|
|
13
|
+
const { label, description } = annotations;
|
|
14
|
+
const result = {
|
|
15
|
+
...(label === undefined ? {} : { label }),
|
|
16
|
+
...(description === undefined ? {} : { description }),
|
|
17
|
+
...(Object.keys(fields).length ? { fields } : {}),
|
|
18
|
+
};
|
|
19
|
+
return Object.keys(result).length ? result : undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The same contract and view without field annotations' synonyms, examples,
|
|
23
|
+
* format, unit and currency, for a consumer that did not ask for field
|
|
24
|
+
* metadata. Field entries, `fields` and `annotations` left empty are omitted, so
|
|
25
|
+
* the result has one canonical encoding; every schemaHash is unchanged and the
|
|
26
|
+
* contentHash is recomputed.
|
|
27
|
+
*/
|
|
28
|
+
export function withoutClientFieldMetadata(prepared) {
|
|
29
|
+
const { contract } = prepared;
|
|
30
|
+
const endpoints = contract.endpoints.map((endpoint) => {
|
|
31
|
+
const { schemaHash: _schemaHash, annotations, ...rest } = endpoint;
|
|
32
|
+
const text = annotations ? textOnly(annotations) : undefined;
|
|
33
|
+
return text ? { ...rest, annotations: text } : rest;
|
|
34
|
+
});
|
|
35
|
+
return prepareProtocolClientContract({ kind: contract.kind, version: contract.version, view: contract.view, endpoints });
|
|
36
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { validateProtocolClientContract, prepareProtocolClientContract } from './validate.js';
|
|
2
2
|
export { ProtocolClientContractError, CLIENT_ERROR_MESSAGES } from './errors.js';
|
|
3
3
|
export type { ProtocolClientContractErrorCode } from './errors.js';
|
|
4
|
-
export type { ClientDimension, ClientMeasure, ClientFilter, ClientTime, ClientQueryLimits, ClientEndpointAnnotations, ClientFieldAnnotation, ClientDatasetEndpoint, ClientMetricEndpoint, ProtocolClientEndpoint, ProtocolClientContract, PreparedProtocolClientContract, ClientFieldType, ClientWireType, } from './types.js';
|
|
4
|
+
export type { ClientDimension, ClientMeasure, ClientFilter, ClientTime, ClientQueryLimits, ClientAnnotationText, ClientEndpointAnnotations, ClientFieldAnnotation, ClientDatasetEndpoint, ClientMetricEndpoint, ProtocolClientEndpoint, ProtocolClientContract, PreparedProtocolClientContract, ClientFieldType, ClientWireType, } from './types.js';
|
|
5
5
|
export { validateProtocolClientQuery } from './query.js';
|
|
6
6
|
export type { ClientQueryPlan } from './query.js';
|
|
7
7
|
export { decodeProtocolClientContract } from './decode.js';
|
|
8
|
+
export { CLIENT_CONTRACT_FEATURES, CLIENT_CONTRACT_FEATURES_HEADER, CLIENT_CONTRACT_FIELD_METADATA_FEATURE, acceptsClientFieldMetadata, parseClientContractFeatures, } from './features.js';
|
|
9
|
+
export { withoutClientFieldMetadata } from './field-metadata.js';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client-contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EACV,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAC3E,yBAAyB,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client-contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EACV,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAC3E,oBAAoB,EAAE,yBAAyB,EAAE,qBAAqB,EACtE,qBAAqB,EAAE,oBAAoB,EAAE,sBAAsB,EACnE,sBAAsB,EAAE,8BAA8B,EAAE,eAAe,EAAE,cAAc,GACxF,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,sCAAsC,EACtC,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -2,3 +2,5 @@ export { validateProtocolClientContract, prepareProtocolClientContract } from '.
|
|
|
2
2
|
export { ProtocolClientContractError, CLIENT_ERROR_MESSAGES } from './errors.js';
|
|
3
3
|
export { validateProtocolClientQuery } from './query.js';
|
|
4
4
|
export { decodeProtocolClientContract } from './decode.js';
|
|
5
|
+
export { CLIENT_CONTRACT_FEATURES, CLIENT_CONTRACT_FEATURES_HEADER, CLIENT_CONTRACT_FIELD_METADATA_FEATURE, acceptsClientFieldMetadata, parseClientContractFeatures, } from './features.js';
|
|
6
|
+
export { withoutClientFieldMetadata } from './field-metadata.js';
|
|
@@ -5,6 +5,8 @@ export declare function filter(input: unknown, path: string): ClientFilter;
|
|
|
5
5
|
export declare function fields<T>(input: unknown, path: string, validate: (v: unknown, p: string) => T): Record<string, T>;
|
|
6
6
|
export declare function time(input: unknown, path: string): ClientTime | null;
|
|
7
7
|
export declare function limits(input: unknown, path: string): ClientQueryLimits;
|
|
8
|
+
/** Field annotation members after label/description, in validation order. */
|
|
9
|
+
export declare const CLIENT_FIELD_METADATA_MEMBERS: readonly ["synonyms", "examples", "format", "unit", "currency"];
|
|
8
10
|
/** Presentation text; references to dimension/measure keys are checked with the endpoint's. */
|
|
9
11
|
export declare function annotations(input: unknown, path: string): ClientEndpointAnnotations;
|
|
10
12
|
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/client-contract/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAyB,YAAY,EAAE,aAAa,EAC1G,iBAAiB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AE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CASjH;AACD,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CASpE;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAUtE;AACD,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B,iEAAkE,CAAC;AAa7G,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,yBAAyB,CAiBnF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clientError } from './errors.js';
|
|
2
|
-
import { bool, choice, CLIENT_FIELD_TYPES, CLIENT_GRAINS, CLIENT_OPERATORS, integer, name, names, optionalShape, pointer, record, shape, text, timezone } from './primitives.js';
|
|
2
|
+
import { bool, choice, CLIENT_FIELD_TYPES, CLIENT_GRAINS, CLIENT_OPERATORS, currency, integer, name, names, optionalShape, pointer, record, shape, text, textList, timezone } from './primitives.js';
|
|
3
3
|
export function dimension(input, path) {
|
|
4
4
|
const value = shape(input, ['type', 'wireType', 'nullable', 'groupable', 'orderable'], path);
|
|
5
5
|
const type = choice(value.type, CLIENT_FIELD_TYPES, pointer(path, 'type'));
|
|
@@ -66,6 +66,8 @@ export function limits(input, path) {
|
|
|
66
66
|
}
|
|
67
67
|
return result;
|
|
68
68
|
}
|
|
69
|
+
/** Field annotation members after label/description, in validation order. */
|
|
70
|
+
export const CLIENT_FIELD_METADATA_MEMBERS = ['synonyms', 'examples', 'format', 'unit', 'currency'];
|
|
69
71
|
function annotation(input, path, keys) {
|
|
70
72
|
const value = optionalShape(input, keys, path);
|
|
71
73
|
const result = Object.create(null);
|
|
@@ -73,6 +75,16 @@ function annotation(input, path, keys) {
|
|
|
73
75
|
result.label = text(value.label, pointer(path, 'label'));
|
|
74
76
|
if (Object.hasOwn(value, 'description'))
|
|
75
77
|
result.description = text(value.description, pointer(path, 'description'));
|
|
78
|
+
if (Object.hasOwn(value, 'synonyms'))
|
|
79
|
+
result.synonyms = textList(value.synonyms, pointer(path, 'synonyms'));
|
|
80
|
+
if (Object.hasOwn(value, 'examples'))
|
|
81
|
+
result.examples = textList(value.examples, pointer(path, 'examples'));
|
|
82
|
+
if (Object.hasOwn(value, 'format'))
|
|
83
|
+
result.format = text(value.format, pointer(path, 'format'));
|
|
84
|
+
if (Object.hasOwn(value, 'unit'))
|
|
85
|
+
result.unit = text(value.unit, pointer(path, 'unit'));
|
|
86
|
+
if (Object.hasOwn(value, 'currency'))
|
|
87
|
+
result.currency = currency(value.currency, pointer(path, 'currency'));
|
|
76
88
|
return result;
|
|
77
89
|
}
|
|
78
90
|
/** Presentation text; references to dimension/measure keys are checked with the endpoint's. */
|
|
@@ -90,7 +102,7 @@ export function annotations(input, path) {
|
|
|
90
102
|
const described = Object.create(null);
|
|
91
103
|
for (const key of keys.sort()) {
|
|
92
104
|
name(key, fieldsPath, true);
|
|
93
|
-
described[key] = annotation(entries[key], pointer(fieldsPath, key), ['label', 'description']);
|
|
105
|
+
described[key] = annotation(entries[key], pointer(fieldsPath, key), ['label', 'description', ...CLIENT_FIELD_METADATA_MEMBERS]);
|
|
94
106
|
}
|
|
95
107
|
result.fields = described;
|
|
96
108
|
}
|
|
@@ -15,5 +15,11 @@ export declare function names(input: unknown, path: string, allowed?: readonly s
|
|
|
15
15
|
export declare function route(input: unknown, path: string): string;
|
|
16
16
|
/** Deployment label/description rules: non-blank, control-free, at most 4096 UTF-8 bytes. */
|
|
17
17
|
export declare function text(input: unknown, path: string): string;
|
|
18
|
+
/** At most this many synonyms or examples per field, the deployment contract's metadata ceiling. */
|
|
19
|
+
export declare const CLIENT_ANNOTATION_LIST_ITEMS = 100;
|
|
20
|
+
/** A non-empty, duplicate-free list of annotation text, in producer order. */
|
|
21
|
+
export declare function textList(input: unknown, path: string): string[];
|
|
22
|
+
/** An ISO 4217-shaped code: three uppercase ASCII letters. */
|
|
23
|
+
export declare function currency(input: unknown, path: string): string;
|
|
18
24
|
export declare function timezone(input: unknown, path: string): string;
|
|
19
25
|
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/client-contract/primitives.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,eAAO,MAAM,kBAAkB,uDAAwD,CAAC;AACxF,eAAO,MAAM,aAAa,wEAAyE,CAAC;AACpG,eAAO,MAAM,gBAAgB,UAAmG,CAAC;AACjI,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAElE;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAGjE;AAMD,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAKjG;AACD,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAKzF;AACD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAG/F;AACD,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAG1D;AACD,wBAAgB,OAAO,CAAC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E,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7D"}
|
|
@@ -94,6 +94,27 @@ export function text(input, path) {
|
|
|
94
94
|
clientError('HQ_CLIENT_SHAPE', path);
|
|
95
95
|
return input;
|
|
96
96
|
}
|
|
97
|
+
/** At most this many synonyms or examples per field, the deployment contract's metadata ceiling. */
|
|
98
|
+
export const CLIENT_ANNOTATION_LIST_ITEMS = 100;
|
|
99
|
+
/** A non-empty, duplicate-free list of annotation text, in producer order. */
|
|
100
|
+
export function textList(input, path) {
|
|
101
|
+
if (!Array.isArray(input))
|
|
102
|
+
clientError('HQ_CLIENT_SHAPE', path);
|
|
103
|
+
if (input.length > CLIENT_ANNOTATION_LIST_ITEMS)
|
|
104
|
+
clientError('HQ_CLIENT_LIMIT', path);
|
|
105
|
+
if (input.length === 0)
|
|
106
|
+
clientError('HQ_CLIENT_SHAPE', path);
|
|
107
|
+
const result = input.map((item, index) => text(item, pointer(path, index)));
|
|
108
|
+
if (new Set(result).size !== result.length)
|
|
109
|
+
clientError('HQ_CLIENT_DUPLICATE', path);
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
/** An ISO 4217-shaped code: three uppercase ASCII letters. */
|
|
113
|
+
export function currency(input, path) {
|
|
114
|
+
if (typeof input !== 'string' || !/^[A-Z]{3}$/.test(input))
|
|
115
|
+
clientError('HQ_CLIENT_SHAPE', path);
|
|
116
|
+
return input;
|
|
117
|
+
}
|
|
97
118
|
export function timezone(input, path) {
|
|
98
119
|
if (typeof input !== 'string' || !CLIENT_TIMEZONE_NAMES.has(input))
|
|
99
120
|
clientError('HQ_CLIENT_SHAPE', path);
|
|
@@ -32,12 +32,26 @@ export interface ClientQueryLimits {
|
|
|
32
32
|
readonly maxOrderBy: number;
|
|
33
33
|
readonly maxFilterValues: number;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
/** Label and description: the presentation text an endpoint group and each field may carry. */
|
|
36
|
+
export interface ClientAnnotationText {
|
|
36
37
|
readonly label?: string;
|
|
37
38
|
readonly description?: string;
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Field presentation metadata. Besides text, a field may carry the deployment
|
|
42
|
+
* contract's agent-facing vocabulary: synonyms and example values, a display
|
|
43
|
+
* format, a unit and an ISO 4217 currency code. Producers emit the vocabulary
|
|
44
|
+
* only to consumers that ask for it (`CLIENT_CONTRACT_FIELD_METADATA_FEATURE`).
|
|
45
|
+
*/
|
|
46
|
+
export interface ClientFieldAnnotation extends ClientAnnotationText {
|
|
47
|
+
readonly synonyms?: readonly string[];
|
|
48
|
+
readonly examples?: readonly string[];
|
|
49
|
+
readonly format?: string;
|
|
50
|
+
readonly unit?: string;
|
|
51
|
+
readonly currency?: string;
|
|
52
|
+
}
|
|
39
53
|
/** Presentation text only; excluded from schemaHash and never a capability. */
|
|
40
|
-
export interface ClientEndpointAnnotations extends
|
|
54
|
+
export interface ClientEndpointAnnotations extends ClientAnnotationText {
|
|
41
55
|
readonly fields?: Readonly<Record<string, ClientFieldAnnotation>>;
|
|
42
56
|
}
|
|
43
57
|
interface ClientEndpointBase {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client-contract/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAC5E,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,kBAAkB,CAAC;AAClF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AACD,MAAM,WAAW,aAAa;IA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AAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AACD,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AACD,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC;AAClF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AACD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,9 +16,11 @@ export type { ProtocolQueryDiagnostics, ProtocolQueryDiagnosticsErrorCode, Proto
|
|
|
16
16
|
export { DEFAULT_PROTOCOL_SEMANTIC_INVOCATION_LIMITS, ProtocolSemanticInvocationError, validateProtocolSemanticInvocation, validateProtocolSemanticInvocationFailure, validateProtocolSemanticInvocationResult, validateProtocolSemanticInvocationV2, } from './invocations/index.js';
|
|
17
17
|
export type { ProtocolSemanticInvocation, ProtocolSemanticInvocationV2, ProtocolSemanticInvocationBudget, ProtocolSemanticInvocationErrorCode, ProtocolSemanticInvocationFailure, ProtocolSemanticInvocationFailureCategory, ProtocolSemanticInvocationLimits, ProtocolSemanticInvocationMeta, ProtocolSemanticInvocationOptions, ProtocolSemanticInvocationPagination, ProtocolSemanticInvocationResult, ProtocolSemanticInvocationRow, ProtocolSemanticInvocationTarget, ProtocolSemanticInvocationValue, } from './invocations/index.js';
|
|
18
18
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_BUNDLE_LIMITS, PROTOCOL_DEPLOYMENT_BUNDLE_IDENTITY_DOMAIN, ProtocolDeploymentBundleError, encodeProtocolDeploymentBundleManifest, encodeProtocolDeploymentBundleManifestToString, hashProtocolDeploymentBundleManifest, prepareProtocolDeploymentBundleManifest, validateProtocolDeploymentBundleManifest, } from './bundles/index.js';
|
|
19
|
+
export { DEFAULT_PROTOCOL_BUSINESS_CONTEXT_LIMITS, PROTOCOL_BUSINESS_CONTEXT_IDENTITY_DOMAIN, ProtocolBusinessContextError, encodeProtocolBusinessContext, encodeProtocolBusinessContextToString, hashProtocolBusinessContext, isEmptyProtocolBusinessContext, prepareProtocolBusinessContext, validateProtocolBusinessContext, } from './business-context/index.js';
|
|
20
|
+
export type { PreparedProtocolBusinessContext, ProtocolBusinessContext, ProtocolBusinessContextErrorCode, ProtocolBusinessContextGlossaryTerm, ProtocolBusinessContextKpi, ProtocolBusinessContextLimits, ProtocolBusinessContextOptions, } from './business-context/index.js';
|
|
19
21
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_RELEASE_LIMITS, PROTOCOL_DEPLOYMENT_RELEASE_IDENTITY_DOMAIN, ProtocolDeploymentReleaseError, encodeProtocolDeploymentReleaseEnvelope, encodeProtocolDeploymentReleaseEnvelopeToString, hashProtocolDeploymentReleaseEnvelope, prepareProtocolDeploymentReleaseEnvelope, validateProtocolDeploymentReleaseEnvelope, validateProtocolDeploymentReleaseTarget, } from './releases/index.js';
|
|
20
22
|
export type { PreparedProtocolDeploymentReleaseEnvelope, ProtocolDeploymentReleaseEnvelope, ProtocolDeploymentReleaseErrorCode, ProtocolDeploymentReleaseLimits, ProtocolDeploymentReleaseOptions, ProtocolDeploymentReleaseTarget, } from './releases/index.js';
|
|
21
|
-
export type { PreparedProtocolDeploymentBundleManifest, ProtocolDeploymentBundleArtifact, ProtocolDeploymentBundleDeployment, ProtocolDeploymentBundleErrorCode, ProtocolDeploymentBundleFile, ProtocolDeploymentBundleLimits, ProtocolDeploymentBundleManifest, ProtocolDeploymentBundleOptions, } from './bundles/index.js';
|
|
23
|
+
export type { PreparedProtocolDeploymentBundleManifest, ProtocolDeploymentBundleArtifact, ProtocolDeploymentBundleBusinessContext, ProtocolDeploymentBundleDeployment, ProtocolDeploymentBundleErrorCode, ProtocolDeploymentBundleFile, ProtocolDeploymentBundleLimits, ProtocolDeploymentBundleManifest, ProtocolDeploymentBundleOptions, } from './bundles/index.js';
|
|
22
24
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_LIMITS, PROTOCOL_DEPLOYMENT_IDENTITY_DOMAIN, PROTOCOL_DEPLOYMENT_V3_IDENTITY_DOMAIN, ProtocolDeploymentError, checkProtocolDatasetContract, checkProtocolDeploymentContract, checkProtocolDeploymentContractV3, encodeProtocolDeploymentContract, encodeProtocolDeploymentContractToString, hashProtocolDeploymentContract, prepareProtocolDeploymentContract, prepareProtocolDeploymentContractV3, validateProtocolDatasetContract, validateProtocolDeploymentContract, validateProtocolDeploymentContractV3, } from './deployments/index.js';
|
|
23
25
|
export type { ProtocolDatasetDerivedMeasure, ProtocolDeploymentDataset, ProtocolDeploymentMeasure, PreparedProtocolDeploymentContract, PreparedProtocolDeploymentContractV3, ProtocolAccessPolicy, ProtocolDatasetContract, ProtocolRowResolution, ProtocolDatasetDefaults, ProtocolDatasetDimension, ProtocolDatasetFieldSource, ProtocolDatasetFieldType, ProtocolDatasetFilter, ProtocolDatasetFreshness, ProtocolDatasetLimits, ProtocolDatasetMeasure, ProtocolDatasetMetric, ProtocolDatasetRelationship, ProtocolDatasetTenantPolicy, ProtocolSemanticMetadata, ProtocolSemanticSensitivity, ProtocolDeploymentContract, ProtocolDeploymentContractV3, ProtocolDeploymentDatasetV3, ProtocolDeploymentMeasureV3, ProtocolDatasetDerivedMeasureV3, ProtocolDatasetMeasureV3, ProtocolDatasetSegment, ProtocolDatasetShiftMeasure, ProtocolDatasetWindowMeasure, ProtocolTimeInterval, ProtocolDeploymentCheckResult, ProtocolDeploymentErrorCode, ProtocolDeploymentValidationError, ProtocolDeploymentLimits, ProtocolDeploymentOptions, ProtocolEndpointPolicy, ProtocolEndpointTenantPolicy, ProtocolMetricDerivation, ProtocolMetricInput, } from './deployments/index.js';
|
|
24
26
|
export type { ProtocolQueryImplementation, ProtocolQueryImplementationErrorCode, ProtocolQueryImplementationLimits, ProtocolQueryImplementationOptions, ProtocolSqlDialect, ProtocolSqlExpression, ProtocolSqlParameter, ProtocolSqlParameterSource, ProtocolSqlTenantPolicy, } from './query-implementations/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,4BAA4B,C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AAmC,EACnC,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,gCAAgC,EAChC,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EACL,kCAAkC,EAClC,oCAAoC,EACpC,0BAA0B,EAC1B,gCAAgC,EAChC,KAAK,8BAA8B,GACpC,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { DEFAULT_PROTOCOL_QUERY_IMPLEMENTATION_LIMITS, ProtocolQueryImplementati
|
|
|
8
8
|
export { DEFAULT_PROTOCOL_QUERY_EVENT_LIMITS, ProtocolQueryDiagnosticsError, ProtocolQueryEventError, validateProtocolQueryDiagnostics, validateProtocolQueryEvent, } from './events/index.js';
|
|
9
9
|
export { DEFAULT_PROTOCOL_SEMANTIC_INVOCATION_LIMITS, ProtocolSemanticInvocationError, validateProtocolSemanticInvocation, validateProtocolSemanticInvocationFailure, validateProtocolSemanticInvocationResult, validateProtocolSemanticInvocationV2, } from './invocations/index.js';
|
|
10
10
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_BUNDLE_LIMITS, PROTOCOL_DEPLOYMENT_BUNDLE_IDENTITY_DOMAIN, ProtocolDeploymentBundleError, encodeProtocolDeploymentBundleManifest, encodeProtocolDeploymentBundleManifestToString, hashProtocolDeploymentBundleManifest, prepareProtocolDeploymentBundleManifest, validateProtocolDeploymentBundleManifest, } from './bundles/index.js';
|
|
11
|
+
export { DEFAULT_PROTOCOL_BUSINESS_CONTEXT_LIMITS, PROTOCOL_BUSINESS_CONTEXT_IDENTITY_DOMAIN, ProtocolBusinessContextError, encodeProtocolBusinessContext, encodeProtocolBusinessContextToString, hashProtocolBusinessContext, isEmptyProtocolBusinessContext, prepareProtocolBusinessContext, validateProtocolBusinessContext, } from './business-context/index.js';
|
|
11
12
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_RELEASE_LIMITS, PROTOCOL_DEPLOYMENT_RELEASE_IDENTITY_DOMAIN, ProtocolDeploymentReleaseError, encodeProtocolDeploymentReleaseEnvelope, encodeProtocolDeploymentReleaseEnvelopeToString, hashProtocolDeploymentReleaseEnvelope, prepareProtocolDeploymentReleaseEnvelope, validateProtocolDeploymentReleaseEnvelope, validateProtocolDeploymentReleaseTarget, } from './releases/index.js';
|
|
12
13
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_LIMITS, PROTOCOL_DEPLOYMENT_IDENTITY_DOMAIN, PROTOCOL_DEPLOYMENT_V3_IDENTITY_DOMAIN, ProtocolDeploymentError, checkProtocolDatasetContract, checkProtocolDeploymentContract, checkProtocolDeploymentContractV3, encodeProtocolDeploymentContract, encodeProtocolDeploymentContractToString, hashProtocolDeploymentContract, prepareProtocolDeploymentContract, prepareProtocolDeploymentContractV3, validateProtocolDatasetContract, validateProtocolDeploymentContract, validateProtocolDeploymentContractV3, } from './deployments/index.js';
|
|
13
14
|
export { PROTOCOL_SEMANTIC_FAILURE_MESSAGES } from './invocations/failure-messages.js';
|