@hypequery/protocol 0.19.0 → 0.20.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/README.md +9 -0
- package/dist/deployments/collect.d.ts +22 -0
- package/dist/deployments/collect.d.ts.map +1 -0
- package/dist/deployments/collect.js +69 -0
- package/dist/deployments/index.d.ts +2 -2
- package/dist/deployments/index.d.ts.map +1 -1
- package/dist/deployments/index.js +1 -1
- package/dist/deployments/types.d.ts +20 -1
- package/dist/deployments/types.d.ts.map +1 -1
- package/dist/deployments/validate.d.ts +22 -1
- package/dist/deployments/validate.d.ts.map +1 -1
- package/dist/deployments/validate.js +171 -79
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,6 +55,15 @@ Schema validators cover the declarative Serve/Zod features that can travel betwe
|
|
|
55
55
|
|
|
56
56
|
A deployment combines dataset definitions and endpoint policies in one strict versioned envelope. Derived measures live alongside base measures in each dataset; queries and standalone metrics are not deployment targets. Bundle manifests bind declared files by path, byte length, and hash; the deployment verifier accepts only bundles with no runtime artifacts. Release envelopes bind a verified bundle to one explicit project and environment.
|
|
57
57
|
|
|
58
|
+
`validateProtocolDeploymentContract` throws the first failure it finds. To report every failure at once, as an editor or deployment service would, use `checkProtocolDeploymentContract` (or `checkProtocolDeploymentContractV3` / `checkProtocolDatasetContract`). It accepts exactly the same contracts and returns `{ ok: true, value }` or `{ ok: false, errors, truncated }`, where each error carries a `code` and a contract `path`. Checks that depend on a part that already failed are skipped, so one mistake is reported once.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
const result = checkProtocolDeploymentContract(input);
|
|
62
|
+
if (!result.ok) {
|
|
63
|
+
for (const error of result.errors) console.error(`${error.code} at ${error.path}`);
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
58
67
|
Canonical encoders and domain-separated SHA-256 identities make these artifacts reproducible across language implementations. Filesystem-safe construction and verification live in `@hypequery/deployment` and the CLI.
|
|
59
68
|
|
|
60
69
|
## Package use
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ProtocolDeploymentCheckResult, ProtocolDeploymentValidationError } from './types.js';
|
|
2
|
+
/** Collection stops here so a hostile contract cannot make the report unbounded. */
|
|
3
|
+
export declare const MAX_COLLECTED_DEPLOYMENT_ERRORS = 100;
|
|
4
|
+
/**
|
|
5
|
+
* Records validation failures instead of stopping at the first. Each
|
|
6
|
+
* `attempt` is a recovery point: a failure inside it is recorded and the
|
|
7
|
+
* caller carries on with the next independent part of the contract.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DeploymentErrorCollector {
|
|
10
|
+
readonly errors: ProtocolDeploymentValidationError[];
|
|
11
|
+
truncated: boolean;
|
|
12
|
+
private readonly seen;
|
|
13
|
+
get count(): number;
|
|
14
|
+
record(error: ProtocolDeploymentValidationError): void;
|
|
15
|
+
/** Stop this subtree when anything failed since `since`; later checks would cascade. */
|
|
16
|
+
checkpoint(since: number): void;
|
|
17
|
+
}
|
|
18
|
+
/** Without a collector this is the action itself, so first-error behavior is unchanged. */
|
|
19
|
+
export declare function attempt<T>(issues: DeploymentErrorCollector | undefined, action: () => T): T | undefined;
|
|
20
|
+
/** Run a validator with a fresh collector and package what it found. */
|
|
21
|
+
export declare function collectErrors<T>(validate: (issues: DeploymentErrorCollector) => T): ProtocolDeploymentCheckResult<T>;
|
|
22
|
+
//# sourceMappingURL=collect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../src/deployments/collect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAEnG,oFAAoF;AACpF,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAKnD;;;;GAIG;AACH,qBAAa,wBAAwB;IACnC,QAAQ,CAAC,MAAM,EAAE,iCAAiC,EAAE,CAAM;IAC1D,SAAS,UAAS;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAE1C,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,MAAM,CAAC,KAAK,EAAE,iCAAiC,GAAG,IAAI;IAYtD,wFAAwF;IACxF,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAGhC;AAED,2FAA2F;AAC3F,wBAAgB,OAAO,CAAC,CAAC,EACvB,MAAM,EAAE,wBAAwB,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,CAAC,GACd,CAAC,GAAG,SAAS,CAaf;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,CAAC,EAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,CAAC,GAChD,6BAA6B,CAAC,CAAC,CAAC,CAWlC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ProtocolQueryImplementationError } from '../query-implementations/errors.js';
|
|
2
|
+
import { ProtocolDeploymentError } from './errors.js';
|
|
3
|
+
/** Collection stops here so a hostile contract cannot make the report unbounded. */
|
|
4
|
+
export const MAX_COLLECTED_DEPLOYMENT_ERRORS = 100;
|
|
5
|
+
/** Thrown to abandon a subtree whose later checks would only repeat its earlier failures. */
|
|
6
|
+
class CollectionAborted extends Error {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Records validation failures instead of stopping at the first. Each
|
|
10
|
+
* `attempt` is a recovery point: a failure inside it is recorded and the
|
|
11
|
+
* caller carries on with the next independent part of the contract.
|
|
12
|
+
*/
|
|
13
|
+
export class DeploymentErrorCollector {
|
|
14
|
+
errors = [];
|
|
15
|
+
truncated = false;
|
|
16
|
+
seen = new Set();
|
|
17
|
+
get count() {
|
|
18
|
+
return this.errors.length;
|
|
19
|
+
}
|
|
20
|
+
record(error) {
|
|
21
|
+
// Nested validators can re-check a field their caller already rejected.
|
|
22
|
+
const key = `${error.code}\0${error.path}`;
|
|
23
|
+
if (this.seen.has(key))
|
|
24
|
+
return;
|
|
25
|
+
if (this.errors.length >= MAX_COLLECTED_DEPLOYMENT_ERRORS) {
|
|
26
|
+
this.truncated = true;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.seen.add(key);
|
|
30
|
+
this.errors.push(error);
|
|
31
|
+
}
|
|
32
|
+
/** Stop this subtree when anything failed since `since`; later checks would cascade. */
|
|
33
|
+
checkpoint(since) {
|
|
34
|
+
if (this.errors.length > since || this.truncated)
|
|
35
|
+
throw new CollectionAborted();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** Without a collector this is the action itself, so first-error behavior is unchanged. */
|
|
39
|
+
export function attempt(issues, action) {
|
|
40
|
+
if (!issues)
|
|
41
|
+
return action();
|
|
42
|
+
if (issues.truncated)
|
|
43
|
+
return undefined;
|
|
44
|
+
try {
|
|
45
|
+
return action();
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (error instanceof CollectionAborted)
|
|
49
|
+
return undefined;
|
|
50
|
+
if (error instanceof ProtocolDeploymentError || error instanceof ProtocolQueryImplementationError) {
|
|
51
|
+
issues.record(error);
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Run a validator with a fresh collector and package what it found. */
|
|
58
|
+
export function collectErrors(validate) {
|
|
59
|
+
const issues = new DeploymentErrorCollector();
|
|
60
|
+
const value = attempt(issues, () => validate(issues));
|
|
61
|
+
if (issues.count > 0 || issues.truncated) {
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
ok: false,
|
|
64
|
+
errors: Object.freeze([...issues.errors]),
|
|
65
|
+
truncated: issues.truncated,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return Object.freeze({ ok: true, value: value });
|
|
69
|
+
}
|
|
@@ -2,6 +2,6 @@ export { ProtocolDeploymentError } from './errors.js';
|
|
|
2
2
|
export { PROTOCOL_DEPLOYMENT_IDENTITY_DOMAIN, PROTOCOL_DEPLOYMENT_V3_IDENTITY_DOMAIN, encodeProtocolDeploymentContract, encodeProtocolDeploymentContractToString, hashProtocolDeploymentContract, prepareProtocolDeploymentContract, prepareProtocolDeploymentContractV3, } from './codec.js';
|
|
3
3
|
export type { PreparedProtocolDeploymentContract, PreparedProtocolDeploymentContractV3, } from './codec.js';
|
|
4
4
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_LIMITS } from './limits.js';
|
|
5
|
-
export { validateProtocolDatasetContract, validateProtocolDeploymentContract, validateProtocolDeploymentContractV3, } from './validate.js';
|
|
6
|
-
export type { ProtocolDatasetDerivedMeasure, ProtocolDeploymentDataset, ProtocolDeploymentMeasure, ProtocolAccessPolicy, ProtocolDatasetContract, ProtocolDatasetDefaults, ProtocolDatasetDimension, ProtocolDatasetFieldSource, ProtocolDatasetFieldType, ProtocolDatasetFilter, ProtocolDatasetFreshness, ProtocolDatasetLimits, ProtocolDatasetMeasure, ProtocolDatasetMetric, ProtocolDatasetRelationship, ProtocolDatasetTenantPolicy, ProtocolSemanticMetadata, ProtocolSemanticSensitivity, ProtocolDeploymentContract, ProtocolDeploymentContractV3, ProtocolDeploymentDatasetV3, ProtocolDeploymentMeasureV3, ProtocolDatasetDerivedMeasureV3, ProtocolDatasetMeasureV3, ProtocolDatasetSegment, ProtocolDatasetShiftMeasure, ProtocolDatasetWindowMeasure, ProtocolTimeInterval, ProtocolDeploymentErrorCode, ProtocolDeploymentLimits, ProtocolDeploymentOptions, ProtocolEndpointPolicy, ProtocolEndpointTenantPolicy, ProtocolMetricDerivation, ProtocolMetricInput, } from './types.js';
|
|
5
|
+
export { checkProtocolDatasetContract, checkProtocolDeploymentContract, checkProtocolDeploymentContractV3, validateProtocolDatasetContract, validateProtocolDeploymentContract, validateProtocolDeploymentContractV3, } from './validate.js';
|
|
6
|
+
export type { ProtocolDatasetDerivedMeasure, ProtocolDeploymentDataset, ProtocolDeploymentMeasure, ProtocolAccessPolicy, ProtocolDatasetContract, 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 './types.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deployments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,mCAAmC,EACnC,sCAAsC,EACtC,gCAAgC,EAChC,wCAAwC,EACxC,8BAA8B,EAC9B,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,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,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deployments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,mCAAmC,EACnC,sCAAsC,EACtC,gCAAgC,EAChC,wCAAwC,EACxC,8BAA8B,EAC9B,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,iCAAiC,EACjC,+BAA+B,EAC/B,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,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,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ProtocolDeploymentError } from './errors.js';
|
|
2
2
|
export { PROTOCOL_DEPLOYMENT_IDENTITY_DOMAIN, PROTOCOL_DEPLOYMENT_V3_IDENTITY_DOMAIN, encodeProtocolDeploymentContract, encodeProtocolDeploymentContractToString, hashProtocolDeploymentContract, prepareProtocolDeploymentContract, prepareProtocolDeploymentContractV3, } from './codec.js';
|
|
3
3
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_LIMITS } from './limits.js';
|
|
4
|
-
export { validateProtocolDatasetContract, validateProtocolDeploymentContract, validateProtocolDeploymentContractV3, } from './validate.js';
|
|
4
|
+
export { checkProtocolDatasetContract, checkProtocolDeploymentContract, checkProtocolDeploymentContractV3, validateProtocolDatasetContract, validateProtocolDeploymentContract, validateProtocolDeploymentContractV3, } from './validate.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ProtocolExpression, ProtocolQueryTimeGrain, ProtocolTimeGrain } from '../expressions/index.js';
|
|
2
2
|
import type { ProtocolIdentifier, ProtocolQualifiedIdentifier } from '../identifiers/index.js';
|
|
3
|
-
import type { ProtocolSqlExpression } from '../query-implementations/index.js';
|
|
3
|
+
import type { ProtocolQueryImplementationError, ProtocolSqlExpression } from '../query-implementations/index.js';
|
|
4
|
+
import type { ProtocolDeploymentError } from './errors.js';
|
|
4
5
|
export type ProtocolDatasetFieldType = 'string' | 'number' | 'boolean' | 'timestamp';
|
|
5
6
|
export type ProtocolSemanticSensitivity = 'public' | 'internal' | 'confidential' | 'restricted';
|
|
6
7
|
export interface ProtocolSemanticMetadata {
|
|
@@ -274,5 +275,23 @@ export interface ProtocolDeploymentOptions {
|
|
|
274
275
|
readonly limits?: Partial<ProtocolDeploymentLimits>;
|
|
275
276
|
}
|
|
276
277
|
export type ProtocolDeploymentErrorCode = 'HQ_DEPLOYMENT_TYPE' | 'HQ_DEPLOYMENT_UNKNOWN_FIELD' | 'HQ_DEPLOYMENT_INVALID_VERSION' | 'HQ_DEPLOYMENT_INVALID_IDENTIFIER' | 'HQ_DEPLOYMENT_INVALID_VALUE' | 'HQ_DEPLOYMENT_INVALID_REFERENCE' | 'HQ_DEPLOYMENT_TOO_MANY_ITEMS' | 'HQ_DEPLOYMENT_TOO_LARGE' | 'HQ_DEPLOYMENT_UNSAFE_OBJECT';
|
|
278
|
+
/**
|
|
279
|
+
* A failure reported by a deployment check. Embedded SQL expressions keep
|
|
280
|
+
* their RFC 0005 error type; its `path` is still a location in the contract.
|
|
281
|
+
*/
|
|
282
|
+
export type ProtocolDeploymentValidationError = ProtocolDeploymentError | ProtocolQueryImplementationError;
|
|
283
|
+
/**
|
|
284
|
+
* Outcome of checking a contract without stopping at the first failure.
|
|
285
|
+
* `errors` is in contract order and holds at most 100 entries; `truncated`
|
|
286
|
+
* says more failures were found than reported.
|
|
287
|
+
*/
|
|
288
|
+
export type ProtocolDeploymentCheckResult<T> = {
|
|
289
|
+
readonly ok: true;
|
|
290
|
+
readonly value: T;
|
|
291
|
+
} | {
|
|
292
|
+
readonly ok: false;
|
|
293
|
+
readonly errors: readonly ProtocolDeploymentValidationError[];
|
|
294
|
+
readonly truncated: boolean;
|
|
295
|
+
};
|
|
277
296
|
export {};
|
|
278
297
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/deployments/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACrD;AAED,MAAM,MAAM,2BAA2B,GACnC,oBAAoB,GACpB,6BAA6B,GAC7B,+BAA+B,GAC/B,kCAAkC,GAClC,6BAA6B,GAC7B,iCAAiC,GACjC,8BAA8B,GAC9B,yBAAyB,GACzB,6BAA6B,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GACzC,uBAAuB,GACvB,gCAAgC,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,CAAC,CAAC,IACvC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACxC;IACA,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,SAAS,iCAAiC,EAAE,CAAC;IAC9D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,CAAC"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import type { ProtocolDatasetContract, ProtocolDeploymentContract, ProtocolDeploymentContractV3, ProtocolDeploymentOptions } from './types.js';
|
|
1
|
+
import type { ProtocolDatasetContract, ProtocolDeploymentCheckResult, ProtocolDeploymentContract, ProtocolDeploymentContractV3, ProtocolDeploymentOptions } from './types.js';
|
|
2
2
|
export declare function validateProtocolDatasetContract(input: unknown, options?: ProtocolDeploymentOptions): ProtocolDatasetContract;
|
|
3
|
+
/**
|
|
4
|
+
* Check a dataset contract and report every failure found, instead of
|
|
5
|
+
* throwing the first. Accepts exactly what `validateProtocolDatasetContract` accepts.
|
|
6
|
+
*/
|
|
7
|
+
export declare function checkProtocolDatasetContract(input: unknown, options?: ProtocolDeploymentOptions): ProtocolDeploymentCheckResult<ProtocolDatasetContract>;
|
|
3
8
|
/** Validate the deployment contract. Unsupported fields are forbidden, even when empty. */
|
|
4
9
|
export declare function validateProtocolDeploymentContract(input: unknown, options?: ProtocolDeploymentOptions): ProtocolDeploymentContract;
|
|
10
|
+
/**
|
|
11
|
+
* Check a deployment contract and report every failure found, instead of
|
|
12
|
+
* throwing the first. Accepts exactly what `validateProtocolDeploymentContract`
|
|
13
|
+
* accepts, and returns the same value when it does.
|
|
14
|
+
*
|
|
15
|
+
* Failures are reported per independent part of the contract (each dataset,
|
|
16
|
+
* collection item and dataset field). Checks that depend on a part that
|
|
17
|
+
* already failed are skipped so one mistake is not reported several times.
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkProtocolDeploymentContract(input: unknown, options?: ProtocolDeploymentOptions): ProtocolDeploymentCheckResult<ProtocolDeploymentContract>;
|
|
5
20
|
/**
|
|
6
21
|
* Validate a deployment contract 3 (RFC 0015). Contract 3 renames the dataset
|
|
7
22
|
* filter allow-list to `allowedFilters` and adds segments, `approxCountDistinct`,
|
|
@@ -12,4 +27,10 @@ export declare function validateProtocolDeploymentContract(input: unknown, optio
|
|
|
12
27
|
* function of its content rather than of which producer emitted it.
|
|
13
28
|
*/
|
|
14
29
|
export declare function validateProtocolDeploymentContractV3(input: unknown, options?: ProtocolDeploymentOptions): ProtocolDeploymentContractV3;
|
|
30
|
+
/**
|
|
31
|
+
* Check a deployment contract 3 and report every failure found, instead of
|
|
32
|
+
* throwing the first. Accepts exactly what `validateProtocolDeploymentContractV3`
|
|
33
|
+
* accepts; see `checkProtocolDeploymentContract` for how failures are grouped.
|
|
34
|
+
*/
|
|
35
|
+
export declare function checkProtocolDeploymentContractV3(input: unknown, options?: ProtocolDeploymentOptions): ProtocolDeploymentCheckResult<ProtocolDeploymentContractV3>;
|
|
15
36
|
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/deployments/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/deployments/validate.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAEV,uBAAuB,EAEvB,6BAA6B,EAC7B,0BAA0B,EAC1B,4BAA4B,EAgB5B,yBAAyB,EAG1B,MAAM,YAAY,CAAC;AAk4BpB,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,yBAA8B,GACtC,uBAAuB,CAEzB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,yBAA8B,GACtC,6BAA6B,CAAC,uBAAuB,CAAC,CAGxD;AAsTD,2FAA2F;AAC3F,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,yBAA8B,GACtC,0BAA0B,CAE5B;AAMD;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,yBAA8B,GACtC,6BAA6B,CAAC,0BAA0B,CAAC,CAG3D;AAYD;;;;;;;;GAQG;AACH,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,yBAA8B,GACtC,4BAA4B,CAE9B;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,yBAA8B,GACtC,6BAA6B,CAAC,4BAA4B,CAAC,CAG7D"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ProtocolExpressionError, validateProtocolExpression } from '../expressions/index.js';
|
|
2
2
|
import { ProtocolIdentifierError, parseProtocolIdentifier, parseProtocolQualifiedIdentifier, } from '../identifiers/index.js';
|
|
3
|
+
import { ProtocolQueryImplementationError } from '../query-implementations/errors.js';
|
|
3
4
|
import { validateProtocolSqlExpression } from '../sql-expressions/validate.js';
|
|
5
|
+
import { attempt, collectErrors } from './collect.js';
|
|
4
6
|
import { deploymentError } from './errors.js';
|
|
5
7
|
import { expressionReferences, isSegmentPredicate, isSegmentReference } from './segments.js';
|
|
6
8
|
import { resolveDeploymentLimits } from './limits.js';
|
|
@@ -62,15 +64,15 @@ function requireArray(input, path, maxItems) {
|
|
|
62
64
|
}
|
|
63
65
|
return input;
|
|
64
66
|
}
|
|
65
|
-
function exactFields(value, required, optional, path) {
|
|
67
|
+
function exactFields(value, required, optional, path, issues) {
|
|
66
68
|
const allowed = new Set([...required, ...optional]);
|
|
67
69
|
for (const key of Object.keys(value)) {
|
|
68
70
|
if (!allowed.has(key))
|
|
69
|
-
deploymentError('HQ_DEPLOYMENT_UNKNOWN_FIELD', `${path}.${key}`);
|
|
71
|
+
attempt(issues, () => deploymentError('HQ_DEPLOYMENT_UNKNOWN_FIELD', `${path}.${key}`));
|
|
70
72
|
}
|
|
71
73
|
for (const key of required) {
|
|
72
74
|
if (!Object.hasOwn(value, key))
|
|
73
|
-
deploymentError('HQ_DEPLOYMENT_TYPE', `${path}.${key}`);
|
|
75
|
+
attempt(issues, () => deploymentError('HQ_DEPLOYMENT_TYPE', `${path}.${key}`));
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
function freezeRecord(entries) {
|
|
@@ -119,28 +121,35 @@ function uniqueStrings(input, path, maxItems, parse) {
|
|
|
119
121
|
deploymentError('HQ_DEPLOYMENT_INVALID_VALUE', path);
|
|
120
122
|
return Object.freeze(result);
|
|
121
123
|
}
|
|
122
|
-
function validateSemanticMetadata(value, result, path, limits) {
|
|
124
|
+
function validateSemanticMetadata(value, result, path, limits, issues) {
|
|
123
125
|
const parseText = (item, itemPath) => (boundedText(item, itemPath, limits.maxTextBytes));
|
|
126
|
+
// Each metadata field is independent, so each is its own recovery point.
|
|
124
127
|
for (const key of ['examples', 'synonyms']) {
|
|
125
128
|
if (value[key] !== undefined) {
|
|
126
|
-
|
|
129
|
+
attempt(issues, () => {
|
|
130
|
+
result[key] = uniqueStrings(value[key], `${path}.${key}`, limits.maxSemanticMetadataItems, parseText);
|
|
131
|
+
});
|
|
127
132
|
}
|
|
128
133
|
}
|
|
129
134
|
for (const key of ['format', 'unit', 'timezone']) {
|
|
130
|
-
optionalText(value[key], key, result, path, limits);
|
|
135
|
+
attempt(issues, () => optionalText(value[key], key, result, path, limits));
|
|
131
136
|
}
|
|
132
137
|
if (value.currency !== undefined) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
attempt(issues, () => {
|
|
139
|
+
const currency = boundedText(value.currency, `${path}.currency`, limits.maxTextBytes);
|
|
140
|
+
if (!/^[A-Z]{3}$/.test(currency)) {
|
|
141
|
+
deploymentError('HQ_DEPLOYMENT_INVALID_VALUE', `${path}.currency`);
|
|
142
|
+
}
|
|
143
|
+
result.currency = currency;
|
|
144
|
+
});
|
|
138
145
|
}
|
|
139
146
|
if (value.sensitivity !== undefined) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
147
|
+
attempt(issues, () => {
|
|
148
|
+
if (typeof value.sensitivity !== 'string' || !SENSITIVITIES.has(value.sensitivity)) {
|
|
149
|
+
deploymentError('HQ_DEPLOYMENT_INVALID_VALUE', `${path}.sensitivity`);
|
|
150
|
+
}
|
|
151
|
+
result.sensitivity = value.sensitivity;
|
|
152
|
+
});
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
155
|
function validateAccess(input, path, limits) {
|
|
@@ -230,6 +239,11 @@ function nested(action, path) {
|
|
|
230
239
|
if (error instanceof ProtocolExpressionError) {
|
|
231
240
|
deploymentError('HQ_DEPLOYMENT_INVALID_VALUE', path);
|
|
232
241
|
}
|
|
242
|
+
// RFC 0006 keeps the SQL envelope's own code; only the location is rebased
|
|
243
|
+
// from the envelope root onto the contract.
|
|
244
|
+
if (error instanceof ProtocolQueryImplementationError) {
|
|
245
|
+
throw new ProtocolQueryImplementationError(error.code, `${path}${error.path.slice(1)}`);
|
|
246
|
+
}
|
|
233
247
|
throw error;
|
|
234
248
|
}
|
|
235
249
|
}
|
|
@@ -601,8 +615,12 @@ function validateDefaults(input, path, limits, version) {
|
|
|
601
615
|
}
|
|
602
616
|
return freezeRecord(result);
|
|
603
617
|
}
|
|
604
|
-
function namedItems(input, path, maxItems, validate) {
|
|
605
|
-
const
|
|
618
|
+
function namedItems(input, path, maxItems, validate, issues) {
|
|
619
|
+
const since = issues?.count ?? 0;
|
|
620
|
+
const items = requireArray(input, path, maxItems)
|
|
621
|
+
.map((value, index) => attempt(issues, () => validate(value, `${path}[${index}]`, index)));
|
|
622
|
+
// Name checks over a partial list would report the failed items again.
|
|
623
|
+
issues?.checkpoint(since);
|
|
606
624
|
if (new Set(items.map(item => item.name)).size !== items.length) {
|
|
607
625
|
deploymentError('HQ_DEPLOYMENT_INVALID_REFERENCE', path);
|
|
608
626
|
}
|
|
@@ -623,7 +641,9 @@ function validateSegment(input, path, limits, dimensions, tenant) {
|
|
|
623
641
|
validateSemanticMetadata(value, result, path, limits);
|
|
624
642
|
return freezeRecord(result);
|
|
625
643
|
}
|
|
626
|
-
function validateDataset(input, path, limits, measureIndices, version = 2) {
|
|
644
|
+
function validateDataset(input, path, limits, measureIndices, version = 2, issues) {
|
|
645
|
+
const since = issues?.count ?? 0;
|
|
646
|
+
const field = (action) => attempt(issues, action);
|
|
627
647
|
const value = requireRecord(input, path);
|
|
628
648
|
// Contract 3 renames the allow-list; the old name is then an unknown field.
|
|
629
649
|
const filtersKey = version === 3 ? 'allowedFilters' : 'filters';
|
|
@@ -634,57 +654,73 @@ function validateDataset(input, path, limits, measureIndices, version = 2) {
|
|
|
634
654
|
...SEMANTIC_METADATA_FIELDS,
|
|
635
655
|
'timeField', 'limits', 'endpoint',
|
|
636
656
|
...(version === 3 ? ['segments'] : []),
|
|
637
|
-
], path);
|
|
657
|
+
], path, issues);
|
|
658
|
+
// Each field is a recovery point when collecting; without a collector
|
|
659
|
+
// `field` is a plain call and the first failure throws.
|
|
638
660
|
const result = {
|
|
639
|
-
name: identifier(value.name, `${path}.name`),
|
|
640
|
-
source: boundedText(value.source, `${path}.source`, limits.maxSourceBytes),
|
|
641
|
-
tenant: validateTenant(value.tenant, `${path}.tenant`, limits),
|
|
642
|
-
dimensions: namedItems(value.dimensions, `${path}.dimensions`, limits.maxDatasetItems, (item, itemPath) => validateDimension(item, itemPath, limits)),
|
|
643
|
-
measures: namedItems(value.measures, `${path}.measures`, limits.maxDatasetItems, (item, itemPath, index) => validateMeasure(item, measureIndices === undefined ? itemPath : `${path}.measures[${measureIndices[index]}]`, limits, version)),
|
|
644
|
-
[filtersKey]: namedItems(value[filtersKey], `${path}.${filtersKey}`, limits.maxDatasetItems, (item, itemPath) => validateFilter(item, itemPath, limits)),
|
|
645
|
-
metrics: namedItems(value.metrics, `${path}.metrics`, limits.maxDatasetItems, (item, itemPath) => validateMetric(item, itemPath, limits)),
|
|
646
|
-
relationships: namedItems(value.relationships, `${path}.relationships`, limits.maxDatasetItems, (item, itemPath) => validateRelationship(item, itemPath, limits)),
|
|
661
|
+
name: field(() => identifier(value.name, `${path}.name`)),
|
|
662
|
+
source: field(() => boundedText(value.source, `${path}.source`, limits.maxSourceBytes)),
|
|
663
|
+
tenant: field(() => validateTenant(value.tenant, `${path}.tenant`, limits)),
|
|
664
|
+
dimensions: field(() => namedItems(value.dimensions, `${path}.dimensions`, limits.maxDatasetItems, (item, itemPath) => validateDimension(item, itemPath, limits), issues)),
|
|
665
|
+
measures: field(() => namedItems(value.measures, `${path}.measures`, limits.maxDatasetItems, (item, itemPath, index) => validateMeasure(item, measureIndices === undefined ? itemPath : `${path}.measures[${measureIndices[index]}]`, limits, version), issues)),
|
|
666
|
+
[filtersKey]: field(() => namedItems(value[filtersKey], `${path}.${filtersKey}`, limits.maxDatasetItems, (item, itemPath) => validateFilter(item, itemPath, limits), issues)),
|
|
667
|
+
metrics: field(() => namedItems(value.metrics, `${path}.metrics`, limits.maxDatasetItems, (item, itemPath) => validateMetric(item, itemPath, limits), issues)),
|
|
668
|
+
relationships: field(() => namedItems(value.relationships, `${path}.relationships`, limits.maxDatasetItems, (item, itemPath) => validateRelationship(item, itemPath, limits), issues)),
|
|
647
669
|
};
|
|
648
|
-
|
|
649
|
-
|
|
670
|
+
// Segments resolve against the dimensions and tenant, so they wait for both.
|
|
671
|
+
if (version === 3 && value.segments !== undefined
|
|
672
|
+
&& result.dimensions !== undefined && result.tenant !== undefined) {
|
|
673
|
+
result.segments = field(() => namedItems(value.segments, `${path}.segments`, limits.maxDatasetItems, (item, itemPath) => validateSegment(item, itemPath, limits, result.dimensions, result.tenant), issues));
|
|
650
674
|
}
|
|
651
|
-
if (value.timeField !== undefined)
|
|
652
|
-
result.timeField = identifier(value.timeField, `${path}.timeField`, true);
|
|
653
|
-
|
|
654
|
-
optionalText(value.
|
|
655
|
-
|
|
675
|
+
if (value.timeField !== undefined) {
|
|
676
|
+
result.timeField = field(() => identifier(value.timeField, `${path}.timeField`, true));
|
|
677
|
+
}
|
|
678
|
+
field(() => optionalText(value.description, 'description', result, path, limits));
|
|
679
|
+
field(() => optionalText(value.owner, 'owner', result, path, limits));
|
|
680
|
+
validateSemanticMetadata(value, result, path, limits, issues);
|
|
656
681
|
if (value.freshness !== undefined) {
|
|
657
|
-
result.freshness = validateFreshness(value.freshness, `${path}.freshness`);
|
|
682
|
+
result.freshness = field(() => validateFreshness(value.freshness, `${path}.freshness`));
|
|
658
683
|
}
|
|
659
684
|
if (value.defaults !== undefined) {
|
|
660
|
-
result.defaults = validateDefaults(value.defaults, `${path}.defaults`, limits, version);
|
|
685
|
+
result.defaults = field(() => validateDefaults(value.defaults, `${path}.defaults`, limits, version));
|
|
661
686
|
}
|
|
662
687
|
if (value.limits !== undefined)
|
|
663
|
-
result.limits = validateLimits(value.limits, `${path}.limits`);
|
|
664
|
-
if (value.endpoint !== undefined)
|
|
665
|
-
result.endpoint = validateEndpoint(value.endpoint, `${path}.endpoint`, limits);
|
|
688
|
+
result.limits = field(() => validateLimits(value.limits, `${path}.limits`));
|
|
689
|
+
if (value.endpoint !== undefined) {
|
|
690
|
+
result.endpoint = field(() => validateEndpoint(value.endpoint, `${path}.endpoint`, limits));
|
|
691
|
+
}
|
|
692
|
+
issues?.checkpoint(since);
|
|
666
693
|
return freezeRecord(result);
|
|
667
694
|
}
|
|
668
695
|
export function validateProtocolDatasetContract(input, options = {}) {
|
|
669
696
|
return validateDataset(input, '$', resolveDeploymentLimits(options));
|
|
670
697
|
}
|
|
671
|
-
|
|
698
|
+
/**
|
|
699
|
+
* Check a dataset contract and report every failure found, instead of
|
|
700
|
+
* throwing the first. Accepts exactly what `validateProtocolDatasetContract` accepts.
|
|
701
|
+
*/
|
|
702
|
+
export function checkProtocolDatasetContract(input, options = {}) {
|
|
703
|
+
const limits = resolveDeploymentLimits(options);
|
|
704
|
+
return collectErrors(issues => validateDataset(input, '$', limits, undefined, 2, issues));
|
|
705
|
+
}
|
|
706
|
+
function validateDatasetReferences(datasets, issues) {
|
|
672
707
|
const names = new Set(datasets.map(dataset => dataset.name));
|
|
708
|
+
const reference = (path) => attempt(issues, () => deploymentError('HQ_DEPLOYMENT_INVALID_REFERENCE', path));
|
|
673
709
|
for (const [index, dataset] of datasets.entries()) {
|
|
674
710
|
if (dataset.defaults?.dimensions?.some(name => (!dataset.dimensions.some(dimension => dimension.name === name && dimension.groupable)))) {
|
|
675
|
-
|
|
711
|
+
reference(`$.datasets[${index}].defaults.dimensions`);
|
|
676
712
|
}
|
|
677
713
|
if (dataset.defaults?.timeGrain !== undefined && dataset.timeField === undefined) {
|
|
678
|
-
|
|
714
|
+
reference(`$.datasets[${index}].defaults.timeGrain`);
|
|
679
715
|
}
|
|
680
716
|
for (const [relationshipIndex, relationship] of dataset.relationships.entries()) {
|
|
681
717
|
if (!names.has(relationship.target)) {
|
|
682
|
-
|
|
718
|
+
reference(`$.datasets[${index}].relationships[${relationshipIndex}].target`);
|
|
683
719
|
}
|
|
684
720
|
}
|
|
685
721
|
if (dataset.endpoint !== undefined
|
|
686
722
|
&& (dataset.tenant.kind === 'required') !== (dataset.endpoint.tenant.kind === 'required')) {
|
|
687
|
-
|
|
723
|
+
reference(`$.datasets[${index}].endpoint.tenant`);
|
|
688
724
|
}
|
|
689
725
|
}
|
|
690
726
|
}
|
|
@@ -817,7 +853,8 @@ function validateTimeMeasure(value, path, limits) {
|
|
|
817
853
|
validateSemanticMetadata(value, result, path, limits);
|
|
818
854
|
return freezeRecord(result);
|
|
819
855
|
}
|
|
820
|
-
function validateDeploymentDataset(input, path, limits, version = 2) {
|
|
856
|
+
function validateDeploymentDataset(input, path, limits, version = 2, issues) {
|
|
857
|
+
const since = issues?.count ?? 0;
|
|
821
858
|
const value = requireRecord(input, path);
|
|
822
859
|
exactFields(value, [
|
|
823
860
|
'name', 'source', 'tenant', 'dimensions', 'measures',
|
|
@@ -826,80 +863,131 @@ function validateDeploymentDataset(input, path, limits, version = 2) {
|
|
|
826
863
|
'description', 'freshness', 'owner', 'defaults',
|
|
827
864
|
...SEMANTIC_METADATA_FIELDS, 'timeField', 'limits', 'endpoint',
|
|
828
865
|
...(version === 3 ? ['segments'] : []),
|
|
829
|
-
], path);
|
|
830
|
-
|
|
831
|
-
|
|
866
|
+
], path, issues);
|
|
867
|
+
// When collecting, a malformed measure list is reported and the rest of the
|
|
868
|
+
// dataset is still checked as if it had no measures; a malformed measure is
|
|
869
|
+
// reported and its siblings are still checked.
|
|
870
|
+
const records = attempt(issues, () => requireArray(value.measures, `${path}.measures`, limits.maxDatasetItems)) ?? [];
|
|
871
|
+
const checked = records.map((measure, index) => (attempt(issues, () => requireRecord(measure, `${path}.measures[${index}]`))));
|
|
832
872
|
// Base measures are validated by the dataset; composite ones (derived, and in
|
|
833
873
|
// contract 3 window and shift) reference them and are validated here.
|
|
834
874
|
const isComposite = (measure) => measure.kind === 'derived'
|
|
835
875
|
|| (version === 3 && (measure.kind === 'window' || measure.kind === 'shift'));
|
|
836
876
|
// Preserve original indices when validating base measures separately.
|
|
837
|
-
const baseEntries =
|
|
838
|
-
const validated = validateDataset({ ...value, measures: baseEntries.map(entry => entry.measure), metrics: [] }, path, limits, baseEntries.map(entry => entry.index), version);
|
|
839
|
-
const composite =
|
|
877
|
+
const baseEntries = checked.flatMap((measure, index) => (measure === undefined || isComposite(measure) ? [] : [{ measure, index }]));
|
|
878
|
+
const validated = attempt(issues, () => validateDataset({ ...value, measures: baseEntries.map(entry => entry.measure), metrics: [] }, path, limits, baseEntries.map(entry => entry.index), version, issues));
|
|
879
|
+
const composite = checked.map((measure, index) => measure && attempt(issues, () => {
|
|
840
880
|
const measurePath = `${path}.measures[${index}]`;
|
|
841
881
|
if (measure.kind === 'derived') {
|
|
842
882
|
return validateDatasetDerivedMeasure(measure, measurePath, limits, version);
|
|
843
883
|
}
|
|
844
884
|
return isComposite(measure) ? validateTimeMeasure(measure, measurePath, limits) : undefined;
|
|
845
|
-
});
|
|
885
|
+
}));
|
|
886
|
+
// Cross-measure checks below assume every measure validated.
|
|
887
|
+
issues?.checkpoint(since);
|
|
888
|
+
const measures = checked;
|
|
889
|
+
// Independent cross-measure checks each recover; a check that needs a
|
|
890
|
+
// reference that failed is skipped rather than reported again.
|
|
891
|
+
const fail = (code, at) => attempt(issues, () => deploymentError(code, at));
|
|
846
892
|
const derived = composite.map(item => (item?.kind === 'derived' ? item : undefined));
|
|
847
893
|
const baseByName = new Map(validated.measures.map(measure => [measure.name, measure]));
|
|
848
894
|
let baseIndex = 0;
|
|
849
895
|
const ordered = measures.map((_, index) => (composite[index] ?? validated.measures[baseIndex++]));
|
|
850
896
|
if (new Set(ordered.map(measure => measure.name)).size !== measures.length) {
|
|
851
|
-
|
|
897
|
+
fail('HQ_DEPLOYMENT_INVALID_REFERENCE', `${path}.measures`);
|
|
852
898
|
}
|
|
899
|
+
// Checks by name are ambiguous while names repeat.
|
|
900
|
+
issues?.checkpoint(since);
|
|
853
901
|
const isApproximate = (measure) => measure?.approximate === true;
|
|
854
902
|
// A time measure wraps exactly one base measure and needs the dataset's time axis.
|
|
855
903
|
const timeByName = new Map();
|
|
904
|
+
// Time measures that failed a check still resolve by name, but checks that
|
|
905
|
+
// read their properties would only repeat that failure.
|
|
906
|
+
const failedTime = new Set();
|
|
856
907
|
for (const [index, item] of composite.entries()) {
|
|
857
908
|
if (!item || item.kind === 'derived')
|
|
858
909
|
continue;
|
|
859
910
|
const timeMeasure = item;
|
|
911
|
+
const before = issues?.count ?? 0;
|
|
860
912
|
const measurePath = `${path}.measures[${index}]`;
|
|
861
913
|
const wrapped = baseByName.get(timeMeasure.measure);
|
|
862
914
|
if (!wrapped)
|
|
863
|
-
|
|
915
|
+
fail('HQ_DEPLOYMENT_INVALID_REFERENCE', `${measurePath}.measure`);
|
|
864
916
|
if (validated.timeField === undefined)
|
|
865
|
-
|
|
866
|
-
if (
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
917
|
+
fail('HQ_DEPLOYMENT_INVALID_REFERENCE', `${measurePath}.kind`);
|
|
918
|
+
if (wrapped) {
|
|
919
|
+
if (timeMeasure.cumulative === true && !CUMULATIVE_AGGREGATIONS.has(wrapped.aggregation)) {
|
|
920
|
+
fail('HQ_DEPLOYMENT_INVALID_VALUE', `${measurePath}.cumulative`);
|
|
921
|
+
}
|
|
922
|
+
if (isApproximate(wrapped) !== isApproximate(timeMeasure)) {
|
|
923
|
+
fail('HQ_DEPLOYMENT_INVALID_VALUE', `${measurePath}.approximate`);
|
|
924
|
+
}
|
|
871
925
|
}
|
|
872
926
|
timeByName.set(timeMeasure.name, timeMeasure);
|
|
927
|
+
if ((issues?.count ?? 0) > before)
|
|
928
|
+
failedTime.add(timeMeasure.name);
|
|
873
929
|
}
|
|
874
930
|
for (const [index, item] of derived.entries()) {
|
|
875
931
|
if (!item)
|
|
876
932
|
continue;
|
|
933
|
+
let resolved = true;
|
|
877
934
|
for (const [useIndex, use] of item.uses.entries()) {
|
|
878
935
|
if (!baseByName.has(use.measure) && !timeByName.has(use.measure)) {
|
|
879
|
-
|
|
936
|
+
resolved = false;
|
|
937
|
+
fail('HQ_DEPLOYMENT_INVALID_REFERENCE', `${path}.measures[${index}].uses[${useIndex}].measure`);
|
|
880
938
|
}
|
|
881
939
|
}
|
|
940
|
+
if (!resolved || item.uses.some(use => failedTime.has(use.measure)))
|
|
941
|
+
continue;
|
|
882
942
|
const approximate = item.uses.some(use => (isApproximate(baseByName.get(use.measure) ?? timeByName.get(use.measure))));
|
|
883
943
|
if (approximate !== isApproximate(item)) {
|
|
884
|
-
|
|
944
|
+
fail('HQ_DEPLOYMENT_INVALID_VALUE', `${path}.measures[${index}].approximate`);
|
|
885
945
|
}
|
|
886
946
|
}
|
|
947
|
+
issues?.checkpoint(since);
|
|
887
948
|
const { metrics: _metrics, ...dataset } = validated;
|
|
888
949
|
return freezeRecord({ ...dataset, measures: Object.freeze(ordered) });
|
|
889
950
|
}
|
|
951
|
+
function validateContract(input, limits, version, issues) {
|
|
952
|
+
const value = requireRecord(input, '$');
|
|
953
|
+
exactFields(value, ['kind', 'version', 'datasets'], [], '$', issues);
|
|
954
|
+
attempt(issues, () => {
|
|
955
|
+
if (value.kind !== 'hypequery-deployment')
|
|
956
|
+
deploymentError('HQ_DEPLOYMENT_INVALID_VALUE', '$.kind');
|
|
957
|
+
});
|
|
958
|
+
// Another version's rules do not apply, so its datasets are not worth checking.
|
|
959
|
+
const since = issues?.count ?? 0;
|
|
960
|
+
attempt(issues, () => {
|
|
961
|
+
if (value.version !== version)
|
|
962
|
+
deploymentError('HQ_DEPLOYMENT_INVALID_VERSION', '$.version');
|
|
963
|
+
});
|
|
964
|
+
issues?.checkpoint(since);
|
|
965
|
+
const datasets = attempt(issues, () => namedItems(value.datasets, '$.datasets', limits.maxDatasets, (item, path) => validateDeploymentDataset(item, path, limits, version, issues), issues));
|
|
966
|
+
// References between datasets need every dataset validated first.
|
|
967
|
+
issues?.checkpoint(0);
|
|
968
|
+
validateDatasetReferences(datasets, issues);
|
|
969
|
+
return datasets;
|
|
970
|
+
}
|
|
890
971
|
/** Validate the deployment contract. Unsupported fields are forbidden, even when empty. */
|
|
891
972
|
export function validateProtocolDeploymentContract(input, options = {}) {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
if (value.kind !== 'hypequery-deployment')
|
|
896
|
-
deploymentError('HQ_DEPLOYMENT_INVALID_VALUE', '$.kind');
|
|
897
|
-
if (value.version !== 2)
|
|
898
|
-
deploymentError('HQ_DEPLOYMENT_INVALID_VERSION', '$.version');
|
|
899
|
-
const datasets = namedItems(value.datasets, '$.datasets', limits.maxDatasets, (item, path) => validateDeploymentDataset(item, path, limits));
|
|
900
|
-
validateDatasetReferences(datasets);
|
|
973
|
+
return deploymentContract(validateContract(input, resolveDeploymentLimits(options), 2));
|
|
974
|
+
}
|
|
975
|
+
function deploymentContract(datasets) {
|
|
901
976
|
return freezeRecord({ kind: 'hypequery-deployment', version: 2, datasets });
|
|
902
977
|
}
|
|
978
|
+
/**
|
|
979
|
+
* Check a deployment contract and report every failure found, instead of
|
|
980
|
+
* throwing the first. Accepts exactly what `validateProtocolDeploymentContract`
|
|
981
|
+
* accepts, and returns the same value when it does.
|
|
982
|
+
*
|
|
983
|
+
* Failures are reported per independent part of the contract (each dataset,
|
|
984
|
+
* collection item and dataset field). Checks that depend on a part that
|
|
985
|
+
* already failed are skipped so one mistake is not reported several times.
|
|
986
|
+
*/
|
|
987
|
+
export function checkProtocolDeploymentContract(input, options = {}) {
|
|
988
|
+
const limits = resolveDeploymentLimits(options);
|
|
989
|
+
return collectErrors(issues => deploymentContract(validateContract(input, limits, 2, issues)));
|
|
990
|
+
}
|
|
903
991
|
/** True when a contract 3 dataset uses anything contract 2 cannot express. */
|
|
904
992
|
function usesContract3Feature(dataset) {
|
|
905
993
|
return (dataset.segments?.length ?? 0) > 0
|
|
@@ -917,15 +1005,19 @@ function usesContract3Feature(dataset) {
|
|
|
917
1005
|
* function of its content rather than of which producer emitted it.
|
|
918
1006
|
*/
|
|
919
1007
|
export function validateProtocolDeploymentContractV3(input, options = {}) {
|
|
1008
|
+
return deploymentContractV3(validateContract(input, resolveDeploymentLimits(options), 3));
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Check a deployment contract 3 and report every failure found, instead of
|
|
1012
|
+
* throwing the first. Accepts exactly what `validateProtocolDeploymentContractV3`
|
|
1013
|
+
* accepts; see `checkProtocolDeploymentContract` for how failures are grouped.
|
|
1014
|
+
*/
|
|
1015
|
+
export function checkProtocolDeploymentContractV3(input, options = {}) {
|
|
920
1016
|
const limits = resolveDeploymentLimits(options);
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
if (value.version !== 3)
|
|
926
|
-
deploymentError('HQ_DEPLOYMENT_INVALID_VERSION', '$.version');
|
|
927
|
-
const datasets = namedItems(value.datasets, '$.datasets', limits.maxDatasets, (item, path) => validateDeploymentDataset(item, path, limits, 3));
|
|
928
|
-
validateDatasetReferences(datasets);
|
|
1017
|
+
return collectErrors(issues => deploymentContractV3(validateContract(input, limits, 3, issues)));
|
|
1018
|
+
}
|
|
1019
|
+
function deploymentContractV3(validated) {
|
|
1020
|
+
const datasets = validated;
|
|
929
1021
|
if (!datasets.some(usesContract3Feature)) {
|
|
930
1022
|
deploymentError('HQ_DEPLOYMENT_INVALID_VERSION', '$.version');
|
|
931
1023
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ export { DEFAULT_PROTOCOL_DEPLOYMENT_BUNDLE_LIMITS, PROTOCOL_DEPLOYMENT_BUNDLE_I
|
|
|
19
19
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_RELEASE_LIMITS, PROTOCOL_DEPLOYMENT_RELEASE_IDENTITY_DOMAIN, ProtocolDeploymentReleaseError, encodeProtocolDeploymentReleaseEnvelope, encodeProtocolDeploymentReleaseEnvelopeToString, hashProtocolDeploymentReleaseEnvelope, prepareProtocolDeploymentReleaseEnvelope, validateProtocolDeploymentReleaseEnvelope, validateProtocolDeploymentReleaseTarget, } from './releases/index.js';
|
|
20
20
|
export type { PreparedProtocolDeploymentReleaseEnvelope, ProtocolDeploymentReleaseEnvelope, ProtocolDeploymentReleaseErrorCode, ProtocolDeploymentReleaseLimits, ProtocolDeploymentReleaseOptions, ProtocolDeploymentReleaseTarget, } from './releases/index.js';
|
|
21
21
|
export type { PreparedProtocolDeploymentBundleManifest, ProtocolDeploymentBundleArtifact, ProtocolDeploymentBundleDeployment, ProtocolDeploymentBundleErrorCode, ProtocolDeploymentBundleFile, ProtocolDeploymentBundleLimits, ProtocolDeploymentBundleManifest, ProtocolDeploymentBundleOptions, } from './bundles/index.js';
|
|
22
|
-
export { DEFAULT_PROTOCOL_DEPLOYMENT_LIMITS, PROTOCOL_DEPLOYMENT_IDENTITY_DOMAIN, PROTOCOL_DEPLOYMENT_V3_IDENTITY_DOMAIN, ProtocolDeploymentError, encodeProtocolDeploymentContract, encodeProtocolDeploymentContractToString, hashProtocolDeploymentContract, prepareProtocolDeploymentContract, prepareProtocolDeploymentContractV3, validateProtocolDatasetContract, validateProtocolDeploymentContract, validateProtocolDeploymentContractV3, } from './deployments/index.js';
|
|
23
|
-
export type { ProtocolDatasetDerivedMeasure, ProtocolDeploymentDataset, ProtocolDeploymentMeasure, PreparedProtocolDeploymentContract, PreparedProtocolDeploymentContractV3, ProtocolAccessPolicy, ProtocolDatasetContract, ProtocolDatasetDefaults, ProtocolDatasetDimension, ProtocolDatasetFieldSource, ProtocolDatasetFieldType, ProtocolDatasetFilter, ProtocolDatasetFreshness, ProtocolDatasetLimits, ProtocolDatasetMeasure, ProtocolDatasetMetric, ProtocolDatasetRelationship, ProtocolDatasetTenantPolicy, ProtocolSemanticMetadata, ProtocolSemanticSensitivity, ProtocolDeploymentContract, ProtocolDeploymentContractV3, ProtocolDeploymentDatasetV3, ProtocolDeploymentMeasureV3, ProtocolDatasetDerivedMeasureV3, ProtocolDatasetMeasureV3, ProtocolDatasetSegment, ProtocolDatasetShiftMeasure, ProtocolDatasetWindowMeasure, ProtocolTimeInterval, ProtocolDeploymentErrorCode, ProtocolDeploymentLimits, ProtocolDeploymentOptions, ProtocolEndpointPolicy, ProtocolEndpointTenantPolicy, ProtocolMetricDerivation, ProtocolMetricInput, } from './deployments/index.js';
|
|
22
|
+
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
|
+
export type { ProtocolDatasetDerivedMeasure, ProtocolDeploymentDataset, ProtocolDeploymentMeasure, PreparedProtocolDeploymentContract, PreparedProtocolDeploymentContractV3, ProtocolAccessPolicy, ProtocolDatasetContract, 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
24
|
export type { ProtocolQueryImplementation, ProtocolQueryImplementationErrorCode, ProtocolQueryImplementationLimits, ProtocolQueryImplementationOptions, ProtocolSqlDialect, ProtocolSqlExpression, ProtocolSqlParameter, ProtocolSqlParameterSource, ProtocolSqlTenantPolicy, } from './query-implementations/index.js';
|
|
25
25
|
export { PROTOCOL_SEMANTIC_FAILURE_MESSAGES } from './invocations/failure-messages.js';
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
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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,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
|
@@ -9,5 +9,5 @@ export { DEFAULT_PROTOCOL_QUERY_EVENT_LIMITS, ProtocolQueryDiagnosticsError, Pro
|
|
|
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
11
|
export { DEFAULT_PROTOCOL_DEPLOYMENT_RELEASE_LIMITS, PROTOCOL_DEPLOYMENT_RELEASE_IDENTITY_DOMAIN, ProtocolDeploymentReleaseError, encodeProtocolDeploymentReleaseEnvelope, encodeProtocolDeploymentReleaseEnvelopeToString, hashProtocolDeploymentReleaseEnvelope, prepareProtocolDeploymentReleaseEnvelope, validateProtocolDeploymentReleaseEnvelope, validateProtocolDeploymentReleaseTarget, } from './releases/index.js';
|
|
12
|
-
export { DEFAULT_PROTOCOL_DEPLOYMENT_LIMITS, PROTOCOL_DEPLOYMENT_IDENTITY_DOMAIN, PROTOCOL_DEPLOYMENT_V3_IDENTITY_DOMAIN, ProtocolDeploymentError, encodeProtocolDeploymentContract, encodeProtocolDeploymentContractToString, hashProtocolDeploymentContract, prepareProtocolDeploymentContract, prepareProtocolDeploymentContractV3, validateProtocolDatasetContract, validateProtocolDeploymentContract, validateProtocolDeploymentContractV3, } from './deployments/index.js';
|
|
12
|
+
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
13
|
export { PROTOCOL_SEMANTIC_FAILURE_MESSAGES } from './invocations/failure-messages.js';
|