@hypequery/protocol 0.1.0 → 0.2.1
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 +50 -9
- package/dist/deployments/errors.d.ts +8 -0
- package/dist/deployments/errors.d.ts.map +1 -0
- package/dist/deployments/errors.js +13 -0
- package/dist/deployments/index.d.ts +5 -0
- package/dist/deployments/index.d.ts.map +1 -0
- package/dist/deployments/index.js +3 -0
- package/dist/deployments/limits.d.ts +4 -0
- package/dist/deployments/limits.d.ts.map +1 -0
- package/dist/deployments/limits.js +23 -0
- package/dist/deployments/types.d.ts +148 -0
- package/dist/deployments/types.d.ts.map +1 -0
- package/dist/deployments/types.js +1 -0
- package/dist/deployments/validate.d.ts +4 -0
- package/dist/deployments/validate.d.ts.map +1 -0
- package/dist/deployments/validate.js +537 -0
- package/dist/expressions/errors.d.ts +8 -0
- package/dist/expressions/errors.d.ts.map +1 -0
- package/dist/expressions/errors.js +13 -0
- package/dist/expressions/index.d.ts +5 -0
- package/dist/expressions/index.d.ts.map +1 -0
- package/dist/expressions/index.js +3 -0
- package/dist/expressions/limits.d.ts +4 -0
- package/dist/expressions/limits.d.ts.map +1 -0
- package/dist/expressions/limits.js +17 -0
- package/dist/expressions/types.d.ts +77 -0
- package/dist/expressions/types.d.ts.map +1 -0
- package/dist/expressions/types.js +1 -0
- package/dist/expressions/validate.d.ts +4 -0
- package/dist/expressions/validate.d.ts.map +1 -0
- package/dist/expressions/validate.js +338 -0
- package/dist/identifiers/identifiers.d.ts +14 -0
- package/dist/identifiers/identifiers.d.ts.map +1 -0
- package/dist/identifiers/identifiers.js +87 -0
- package/dist/identifiers/index.d.ts +4 -0
- package/dist/identifiers/index.d.ts.map +1 -0
- package/dist/identifiers/index.js +2 -0
- package/dist/identifiers/types.d.ts +16 -0
- package/dist/identifiers/types.d.ts.map +1 -0
- package/dist/identifiers/types.js +5 -0
- package/dist/index.d.ts +12 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/query-implementations/errors.d.ts +8 -0
- package/dist/query-implementations/errors.d.ts.map +1 -0
- package/dist/query-implementations/errors.js +13 -0
- package/dist/query-implementations/index.d.ts +5 -0
- package/dist/query-implementations/index.d.ts.map +1 -0
- package/dist/query-implementations/index.js +3 -0
- package/dist/query-implementations/limits.d.ts +4 -0
- package/dist/query-implementations/limits.d.ts.map +1 -0
- package/dist/query-implementations/limits.js +22 -0
- package/dist/query-implementations/types.d.ts +57 -0
- package/dist/query-implementations/types.d.ts.map +1 -0
- package/dist/query-implementations/types.js +1 -0
- package/dist/query-implementations/validate.d.ts +4 -0
- package/dist/query-implementations/validate.d.ts.map +1 -0
- package/dist/query-implementations/validate.js +248 -0
- package/dist/schemas/errors.d.ts +8 -0
- package/dist/schemas/errors.d.ts.map +1 -0
- package/dist/schemas/errors.js +13 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/limits.d.ts +4 -0
- package/dist/schemas/limits.d.ts.map +1 -0
- package/dist/schemas/limits.js +20 -0
- package/dist/schemas/types.d.ts +60 -0
- package/dist/schemas/types.d.ts.map +1 -0
- package/dist/schemas/types.js +1 -0
- package/dist/schemas/validate.d.ts +3 -0
- package/dist/schemas/validate.d.ts.map +1 -0
- package/dist/schemas/validate.js +391 -0
- package/dist/values/codec.d.ts +13 -0
- package/dist/values/codec.d.ts.map +1 -0
- package/dist/values/codec.js +39 -0
- package/dist/values/errors.d.ts +8 -0
- package/dist/values/errors.d.ts.map +1 -0
- package/dist/values/errors.js +13 -0
- package/dist/values/index.d.ts +7 -0
- package/dist/values/index.d.ts.map +1 -0
- package/dist/values/index.js +4 -0
- package/dist/values/jcs.d.ts +2 -0
- package/dist/values/jcs.d.ts.map +1 -0
- package/dist/values/jcs.js +23 -0
- package/dist/values/limits.d.ts +4 -0
- package/dist/values/limits.d.ts.map +1 -0
- package/dist/values/limits.js +26 -0
- package/dist/values/parser.d.ts +3 -0
- package/dist/values/parser.d.ts.map +1 -0
- package/dist/values/parser.js +254 -0
- package/dist/values/snapshot.d.ts +3 -0
- package/dist/values/snapshot.d.ts.map +1 -0
- package/dist/values/snapshot.js +96 -0
- package/dist/values/types.d.ts +78 -0
- package/dist/values/types.d.ts.map +1 -0
- package/dist/values/types.js +1 -0
- package/dist/values/validate.d.ts +7 -0
- package/dist/values/validate.d.ts.map +1 -0
- package/dist/values/validate.js +332 -0
- package/package.json +4 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class ProtocolQueryImplementationError extends TypeError {
|
|
2
|
+
code;
|
|
3
|
+
path;
|
|
4
|
+
constructor(code, path = '$') {
|
|
5
|
+
super(`${code} at ${path}`);
|
|
6
|
+
this.name = 'ProtocolQueryImplementationError';
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.path = path;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function queryImplementationError(code, path = '$') {
|
|
12
|
+
throw new ProtocolQueryImplementationError(code, path);
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ProtocolQueryImplementationError } from './errors.js';
|
|
2
|
+
export { DEFAULT_PROTOCOL_QUERY_IMPLEMENTATION_LIMITS } from './limits.js';
|
|
3
|
+
export { validateProtocolQueryImplementation, validateProtocolSqlExpression, } from './validate.js';
|
|
4
|
+
export type { ProtocolQueryImplementation, ProtocolQueryImplementationErrorCode, ProtocolQueryImplementationLimits, ProtocolQueryImplementationOptions, ProtocolSqlDialect, ProtocolSqlExpression, ProtocolSqlParameter, ProtocolSqlParameterSource, ProtocolSqlTenantPolicy, } from './types.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query-implementations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,4CAA4C,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EACL,mCAAmC,EACnC,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,2BAA2B,EAC3B,oCAAoC,EACpC,iCAAiC,EACjC,kCAAkC,EAClC,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProtocolQueryImplementationLimits, ProtocolQueryImplementationOptions } from './types.js';
|
|
2
|
+
export declare const DEFAULT_PROTOCOL_QUERY_IMPLEMENTATION_LIMITS: Readonly<ProtocolQueryImplementationLimits>;
|
|
3
|
+
export declare function resolveQueryImplementationLimits(options: ProtocolQueryImplementationOptions): Readonly<ProtocolQueryImplementationLimits>;
|
|
4
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/query-implementations/limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,4CAA4C,EAAE,QAAQ,CAAC,iCAAiC,CAMnG,CAAC;AAEH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,kCAAkC,GAC1C,QAAQ,CAAC,iCAAiC,CAAC,CAa7C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const DEFAULT_PROTOCOL_QUERY_IMPLEMENTATION_LIMITS = Object.freeze({
|
|
2
|
+
maxStatementBytes: 1_048_576,
|
|
3
|
+
maxExpressionBytes: 65_536,
|
|
4
|
+
maxTypeBytes: 256,
|
|
5
|
+
maxSourceBytes: 1_024,
|
|
6
|
+
maxCollectionItems: 100,
|
|
7
|
+
});
|
|
8
|
+
export function resolveQueryImplementationLimits(options) {
|
|
9
|
+
const configured = options.limits ?? {};
|
|
10
|
+
const result = { ...DEFAULT_PROTOCOL_QUERY_IMPLEMENTATION_LIMITS };
|
|
11
|
+
for (const key of Object.keys(result)) {
|
|
12
|
+
const value = configured[key];
|
|
13
|
+
if (value === undefined)
|
|
14
|
+
continue;
|
|
15
|
+
if (!Number.isSafeInteger(value) || value < 1
|
|
16
|
+
|| value > DEFAULT_PROTOCOL_QUERY_IMPLEMENTATION_LIMITS[key]) {
|
|
17
|
+
throw new RangeError(`Invalid query implementation limit: ${key}`);
|
|
18
|
+
}
|
|
19
|
+
result[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return Object.freeze(result);
|
|
22
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ProtocolSemanticQuery } from '../expressions/index.js';
|
|
2
|
+
import type { ProtocolIdentifier, ProtocolQualifiedIdentifier } from '../identifiers/index.js';
|
|
3
|
+
import type { ProtocolSchema } from '../schemas/index.js';
|
|
4
|
+
export type ProtocolSqlDialect = 'clickhouse';
|
|
5
|
+
export interface ProtocolSqlExpression {
|
|
6
|
+
readonly kind: 'sql-expression';
|
|
7
|
+
readonly dialect: ProtocolSqlDialect;
|
|
8
|
+
readonly sql: string;
|
|
9
|
+
readonly output: ProtocolSchema;
|
|
10
|
+
readonly dependencies: readonly ProtocolQualifiedIdentifier[];
|
|
11
|
+
}
|
|
12
|
+
export type ProtocolSqlParameterSource = {
|
|
13
|
+
readonly kind: 'input';
|
|
14
|
+
readonly path: ProtocolQualifiedIdentifier;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'tenant';
|
|
17
|
+
};
|
|
18
|
+
export interface ProtocolSqlParameter {
|
|
19
|
+
readonly name: ProtocolIdentifier;
|
|
20
|
+
readonly source: ProtocolSqlParameterSource;
|
|
21
|
+
readonly clickHouseType: string;
|
|
22
|
+
}
|
|
23
|
+
export type ProtocolSqlTenantPolicy = {
|
|
24
|
+
readonly kind: 'required';
|
|
25
|
+
readonly parameter: ProtocolIdentifier;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: 'not-required';
|
|
28
|
+
};
|
|
29
|
+
export type ProtocolQueryImplementation = {
|
|
30
|
+
readonly kind: 'semantic-plan';
|
|
31
|
+
readonly query: ProtocolSemanticQuery;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: 'compiled-sql';
|
|
34
|
+
readonly dialect: ProtocolSqlDialect;
|
|
35
|
+
readonly operation: 'select';
|
|
36
|
+
readonly statement: string;
|
|
37
|
+
readonly parameters: readonly ProtocolSqlParameter[];
|
|
38
|
+
readonly readSources: readonly string[];
|
|
39
|
+
readonly tenant: ProtocolSqlTenantPolicy;
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: 'runtime-reference';
|
|
42
|
+
readonly runtime: 'node' | 'python';
|
|
43
|
+
readonly artifactSha256: string;
|
|
44
|
+
readonly entrypoint: ProtocolQualifiedIdentifier;
|
|
45
|
+
};
|
|
46
|
+
export interface ProtocolQueryImplementationLimits {
|
|
47
|
+
readonly maxStatementBytes: number;
|
|
48
|
+
readonly maxExpressionBytes: number;
|
|
49
|
+
readonly maxTypeBytes: number;
|
|
50
|
+
readonly maxSourceBytes: number;
|
|
51
|
+
readonly maxCollectionItems: number;
|
|
52
|
+
}
|
|
53
|
+
export interface ProtocolQueryImplementationOptions {
|
|
54
|
+
readonly limits?: Partial<ProtocolQueryImplementationLimits>;
|
|
55
|
+
}
|
|
56
|
+
export type ProtocolQueryImplementationErrorCode = 'HQ_QUERY_IMPLEMENTATION_TYPE' | 'HQ_QUERY_IMPLEMENTATION_UNKNOWN_FIELD' | 'HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND' | 'HQ_QUERY_IMPLEMENTATION_INVALID_IDENTIFIER' | 'HQ_QUERY_IMPLEMENTATION_INVALID_VALUE' | 'HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE' | 'HQ_QUERY_IMPLEMENTATION_TOO_MANY_ITEMS' | 'HQ_QUERY_IMPLEMENTATION_TOO_LARGE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0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProtocolQueryImplementation, ProtocolQueryImplementationOptions, ProtocolSqlExpression } from './types.js';
|
|
2
|
+
export declare function validateProtocolSqlExpression(input: unknown, options?: ProtocolQueryImplementationOptions): ProtocolSqlExpression;
|
|
3
|
+
export declare function validateProtocolQueryImplementation(input: unknown, options?: ProtocolQueryImplementationOptions): ProtocolQueryImplementation;
|
|
4
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/query-implementations/validate.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,2BAA2B,EAE3B,kCAAkC,EAClC,qBAAqB,EAItB,MAAM,YAAY,CAAC;AAqLpB,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,kCAAuC,GAC/C,qBAAqB,CA6BvB;AAED,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,kCAAuC,GAC/C,2BAA2B,CAsD7B"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { ProtocolExpressionError, validateProtocolSemanticQuery } from '../expressions/index.js';
|
|
2
|
+
import { ProtocolIdentifierError, parseProtocolIdentifier, parseProtocolQualifiedIdentifier, } from '../identifiers/index.js';
|
|
3
|
+
import { ProtocolSchemaError, validateProtocolSchema } from '../schemas/index.js';
|
|
4
|
+
import { queryImplementationError } from './errors.js';
|
|
5
|
+
import { resolveQueryImplementationLimits } from './limits.js';
|
|
6
|
+
const textEncoder = new TextEncoder();
|
|
7
|
+
const SHA256_PATTERN = /^[0-9a-f]{64}$/;
|
|
8
|
+
function requireRecord(input, path) {
|
|
9
|
+
if (typeof input !== 'object' || input === null || Array.isArray(input)) {
|
|
10
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TYPE', path);
|
|
11
|
+
}
|
|
12
|
+
const prototype = Object.getPrototypeOf(input);
|
|
13
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
14
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNSAFE_OBJECT', path);
|
|
15
|
+
}
|
|
16
|
+
if (Object.getOwnPropertySymbols(input).length > 0) {
|
|
17
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNSAFE_OBJECT', path);
|
|
18
|
+
}
|
|
19
|
+
for (const descriptor of Object.values(Object.getOwnPropertyDescriptors(input))) {
|
|
20
|
+
if (!descriptor.enumerable || !('value' in descriptor)) {
|
|
21
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNSAFE_OBJECT', path);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return input;
|
|
25
|
+
}
|
|
26
|
+
function requireArray(input, path, maxItems) {
|
|
27
|
+
if (!Array.isArray(input))
|
|
28
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TYPE', path);
|
|
29
|
+
if (Object.getPrototypeOf(input) !== Array.prototype || Object.getOwnPropertySymbols(input).length > 0) {
|
|
30
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNSAFE_OBJECT', path);
|
|
31
|
+
}
|
|
32
|
+
if (input.length > maxItems)
|
|
33
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TOO_MANY_ITEMS', path);
|
|
34
|
+
const descriptors = Object.getOwnPropertyDescriptors(input);
|
|
35
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
36
|
+
const descriptor = descriptors[String(index)];
|
|
37
|
+
if (!descriptor || !descriptor.enumerable || !('value' in descriptor)) {
|
|
38
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNSAFE_OBJECT', `${path}[${index}]`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (Object.keys(input).length !== input.length) {
|
|
42
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNSAFE_OBJECT', path);
|
|
43
|
+
}
|
|
44
|
+
return input;
|
|
45
|
+
}
|
|
46
|
+
function exactFields(value, required, optional, path) {
|
|
47
|
+
const allowed = new Set([...required, ...optional]);
|
|
48
|
+
for (const key of Object.keys(value)) {
|
|
49
|
+
if (!allowed.has(key))
|
|
50
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNKNOWN_FIELD', `${path}.${key}`);
|
|
51
|
+
}
|
|
52
|
+
for (const key of required) {
|
|
53
|
+
if (!Object.hasOwn(value, key))
|
|
54
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TYPE', `${path}.${key}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function freezeRecord(entries) {
|
|
58
|
+
return Object.freeze(Object.assign(Object.create(null), entries));
|
|
59
|
+
}
|
|
60
|
+
function identifier(value, path, qualified = false) {
|
|
61
|
+
try {
|
|
62
|
+
return qualified ? parseProtocolQualifiedIdentifier(value) : parseProtocolIdentifier(value);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (error instanceof ProtocolIdentifierError) {
|
|
66
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_IDENTIFIER', path);
|
|
67
|
+
}
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function boundedText(value, path, maxBytes, allowSqlWhitespace = false) {
|
|
72
|
+
if (typeof value !== 'string')
|
|
73
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TYPE', path);
|
|
74
|
+
if (value.trim().length === 0)
|
|
75
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', path);
|
|
76
|
+
for (const character of value) {
|
|
77
|
+
const code = character.codePointAt(0);
|
|
78
|
+
if ((code <= 0x1f && !(allowSqlWhitespace && (code === 0x09 || code === 0x0a || code === 0x0d)))
|
|
79
|
+
|| code === 0x7f || (code >= 0x80 && code <= 0x9f)) {
|
|
80
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', path);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (value.length > maxBytes || textEncoder.encode(value).byteLength > maxBytes) {
|
|
84
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TOO_LARGE', path);
|
|
85
|
+
}
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
function dialect(value, path) {
|
|
89
|
+
if (value !== 'clickhouse')
|
|
90
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', path);
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
function validateParameterSource(input, path) {
|
|
94
|
+
const value = requireRecord(input, path);
|
|
95
|
+
if (value.kind === 'input') {
|
|
96
|
+
exactFields(value, ['kind', 'path'], [], path);
|
|
97
|
+
return freezeRecord({
|
|
98
|
+
kind: 'input', path: identifier(value.path, `${path}.path`, true),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (value.kind === 'tenant') {
|
|
102
|
+
exactFields(value, ['kind'], [], path);
|
|
103
|
+
return freezeRecord({ kind: 'tenant' });
|
|
104
|
+
}
|
|
105
|
+
if (typeof value.kind !== 'string')
|
|
106
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TYPE', `${path}.kind`);
|
|
107
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND', `${path}.kind`);
|
|
108
|
+
}
|
|
109
|
+
function validateParameters(input, path, limits) {
|
|
110
|
+
const values = requireArray(input, path, limits.maxCollectionItems);
|
|
111
|
+
const names = new Set();
|
|
112
|
+
const result = values.map((inputValue, index) => {
|
|
113
|
+
const itemPath = `${path}[${index}]`;
|
|
114
|
+
const value = requireRecord(inputValue, itemPath);
|
|
115
|
+
exactFields(value, ['name', 'source', 'clickHouseType'], [], itemPath);
|
|
116
|
+
const name = identifier(value.name, `${itemPath}.name`);
|
|
117
|
+
if (names.has(name))
|
|
118
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE', `${itemPath}.name`);
|
|
119
|
+
names.add(name);
|
|
120
|
+
return freezeRecord({
|
|
121
|
+
name,
|
|
122
|
+
source: validateParameterSource(value.source, `${itemPath}.source`),
|
|
123
|
+
clickHouseType: boundedText(value.clickHouseType, `${itemPath}.clickHouseType`, limits.maxTypeBytes),
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
return Object.freeze(result);
|
|
127
|
+
}
|
|
128
|
+
function validateTenant(input, path, parameters) {
|
|
129
|
+
const value = requireRecord(input, path);
|
|
130
|
+
if (value.kind === 'not-required') {
|
|
131
|
+
exactFields(value, ['kind'], [], path);
|
|
132
|
+
if (parameters.some(parameter => parameter.source.kind === 'tenant')) {
|
|
133
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE', path);
|
|
134
|
+
}
|
|
135
|
+
return freezeRecord({ kind: 'not-required' });
|
|
136
|
+
}
|
|
137
|
+
if (value.kind === 'required') {
|
|
138
|
+
exactFields(value, ['kind', 'parameter'], [], path);
|
|
139
|
+
const parameter = identifier(value.parameter, `${path}.parameter`);
|
|
140
|
+
if (!parameters.some(candidate => candidate.name === parameter && candidate.source.kind === 'tenant')) {
|
|
141
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE', `${path}.parameter`);
|
|
142
|
+
}
|
|
143
|
+
if (parameters.filter(candidate => candidate.source.kind === 'tenant').length !== 1) {
|
|
144
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_REFERENCE', path);
|
|
145
|
+
}
|
|
146
|
+
return freezeRecord({ kind: 'required', parameter });
|
|
147
|
+
}
|
|
148
|
+
if (typeof value.kind !== 'string')
|
|
149
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TYPE', `${path}.kind`);
|
|
150
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND', `${path}.kind`);
|
|
151
|
+
}
|
|
152
|
+
function validateReadSources(input, path, limits) {
|
|
153
|
+
const values = requireArray(input, path, limits.maxCollectionItems);
|
|
154
|
+
const result = values.map((value, index) => boundedText(value, `${path}[${index}]`, limits.maxSourceBytes));
|
|
155
|
+
if (new Set(result).size !== result.length) {
|
|
156
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', path);
|
|
157
|
+
}
|
|
158
|
+
return Object.freeze(result);
|
|
159
|
+
}
|
|
160
|
+
export function validateProtocolSqlExpression(input, options = {}) {
|
|
161
|
+
const limits = resolveQueryImplementationLimits(options);
|
|
162
|
+
const value = requireRecord(input, '$');
|
|
163
|
+
exactFields(value, ['kind', 'dialect', 'sql', 'output', 'dependencies'], [], '$');
|
|
164
|
+
if (value.kind !== 'sql-expression') {
|
|
165
|
+
if (typeof value.kind !== 'string')
|
|
166
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TYPE', '$.kind');
|
|
167
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND', '$.kind');
|
|
168
|
+
}
|
|
169
|
+
const dependencies = requireArray(value.dependencies, '$.dependencies', limits.maxCollectionItems)
|
|
170
|
+
.map((dependency, index) => identifier(dependency, `$.dependencies[${index}]`, true));
|
|
171
|
+
if (new Set(dependencies).size !== dependencies.length) {
|
|
172
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', '$.dependencies');
|
|
173
|
+
}
|
|
174
|
+
let output;
|
|
175
|
+
try {
|
|
176
|
+
output = validateProtocolSchema(value.output);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
if (error instanceof ProtocolSchemaError) {
|
|
180
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', '$.output');
|
|
181
|
+
}
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
184
|
+
return freezeRecord({
|
|
185
|
+
kind: 'sql-expression',
|
|
186
|
+
dialect: dialect(value.dialect, '$.dialect'),
|
|
187
|
+
sql: boundedText(value.sql, '$.sql', limits.maxExpressionBytes, true),
|
|
188
|
+
output,
|
|
189
|
+
dependencies: Object.freeze(dependencies),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
export function validateProtocolQueryImplementation(input, options = {}) {
|
|
193
|
+
const limits = resolveQueryImplementationLimits(options);
|
|
194
|
+
const value = requireRecord(input, '$');
|
|
195
|
+
if (typeof value.kind !== 'string')
|
|
196
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_TYPE', '$.kind');
|
|
197
|
+
switch (value.kind) {
|
|
198
|
+
case 'semantic-plan': {
|
|
199
|
+
exactFields(value, ['kind', 'query'], [], '$');
|
|
200
|
+
try {
|
|
201
|
+
return freezeRecord({
|
|
202
|
+
kind: 'semantic-plan', query: validateProtocolSemanticQuery(value.query),
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
if (error instanceof ProtocolExpressionError) {
|
|
207
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', '$.query');
|
|
208
|
+
}
|
|
209
|
+
throw error;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
case 'compiled-sql': {
|
|
213
|
+
exactFields(value, [
|
|
214
|
+
'kind', 'dialect', 'operation', 'statement', 'parameters', 'readSources', 'tenant',
|
|
215
|
+
], [], '$');
|
|
216
|
+
if (value.operation !== 'select') {
|
|
217
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', '$.operation');
|
|
218
|
+
}
|
|
219
|
+
const parameters = validateParameters(value.parameters, '$.parameters', limits);
|
|
220
|
+
return freezeRecord({
|
|
221
|
+
kind: 'compiled-sql',
|
|
222
|
+
dialect: dialect(value.dialect, '$.dialect'),
|
|
223
|
+
operation: 'select',
|
|
224
|
+
statement: boundedText(value.statement, '$.statement', limits.maxStatementBytes, true),
|
|
225
|
+
parameters,
|
|
226
|
+
readSources: validateReadSources(value.readSources, '$.readSources', limits),
|
|
227
|
+
tenant: validateTenant(value.tenant, '$.tenant', parameters),
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
case 'runtime-reference': {
|
|
231
|
+
exactFields(value, ['kind', 'runtime', 'artifactSha256', 'entrypoint'], [], '$');
|
|
232
|
+
if (value.runtime !== 'node' && value.runtime !== 'python') {
|
|
233
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', '$.runtime');
|
|
234
|
+
}
|
|
235
|
+
if (typeof value.artifactSha256 !== 'string' || !SHA256_PATTERN.test(value.artifactSha256)) {
|
|
236
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_INVALID_VALUE', '$.artifactSha256');
|
|
237
|
+
}
|
|
238
|
+
return freezeRecord({
|
|
239
|
+
kind: 'runtime-reference',
|
|
240
|
+
runtime: value.runtime,
|
|
241
|
+
artifactSha256: value.artifactSha256,
|
|
242
|
+
entrypoint: identifier(value.entrypoint, '$.entrypoint', true),
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
default:
|
|
246
|
+
queryImplementationError('HQ_QUERY_IMPLEMENTATION_UNKNOWN_KIND', '$.kind');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProtocolSchemaErrorCode } from './types.js';
|
|
2
|
+
export declare class ProtocolSchemaError extends TypeError {
|
|
3
|
+
readonly code: ProtocolSchemaErrorCode;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
constructor(code: ProtocolSchemaErrorCode, path?: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function schemaError(code: ProtocolSchemaErrorCode, path?: string): never;
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/schemas/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,qBAAa,mBAAoB,SAAQ,SAAS;IAChD,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,uBAAuB,EAAE,IAAI,SAAM;CAMtD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,uBAAuB,EAAE,IAAI,SAAM,GAAG,KAAK,CAE5E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class ProtocolSchemaError extends TypeError {
|
|
2
|
+
code;
|
|
3
|
+
path;
|
|
4
|
+
constructor(code, path = '$') {
|
|
5
|
+
super(`${code} at ${path}`);
|
|
6
|
+
this.name = 'ProtocolSchemaError';
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.path = path;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function schemaError(code, path = '$') {
|
|
12
|
+
throw new ProtocolSchemaError(code, path);
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ProtocolSchemaError } from './errors.js';
|
|
2
|
+
export { DEFAULT_PROTOCOL_SCHEMA_LIMITS } from './limits.js';
|
|
3
|
+
export { validateProtocolSchema } from './validate.js';
|
|
4
|
+
export type { ProtocolSchema, ProtocolSchemaErrorCode, ProtocolSchemaLimits, ProtocolSchemaOptions, } from './types.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProtocolSchemaLimits, ProtocolSchemaOptions } from './types.js';
|
|
2
|
+
export declare const DEFAULT_PROTOCOL_SCHEMA_LIMITS: Readonly<ProtocolSchemaLimits>;
|
|
3
|
+
export declare function resolveSchemaLimits(options?: ProtocolSchemaOptions): Readonly<ProtocolSchemaLimits>;
|
|
4
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/schemas/limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE9E,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,oBAAoB,CAKxE,CAAC;AAEH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,qBAA0B,GAClC,QAAQ,CAAC,oBAAoB,CAAC,CAYhC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const DEFAULT_PROTOCOL_SCHEMA_LIMITS = Object.freeze({
|
|
2
|
+
maxDepth: 16,
|
|
3
|
+
maxNodes: 1_000,
|
|
4
|
+
maxCollectionItems: 100,
|
|
5
|
+
maxDescriptionBytes: 4_096,
|
|
6
|
+
});
|
|
7
|
+
export function resolveSchemaLimits(options = {}) {
|
|
8
|
+
const limits = { ...DEFAULT_PROTOCOL_SCHEMA_LIMITS };
|
|
9
|
+
for (const key of Object.keys(options.limits ?? {})) {
|
|
10
|
+
const value = options.limits?.[key];
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
continue;
|
|
13
|
+
if (!Number.isSafeInteger(value) || value < 1
|
|
14
|
+
|| value > DEFAULT_PROTOCOL_SCHEMA_LIMITS[key]) {
|
|
15
|
+
throw new RangeError(`${key} must be a positive integer no greater than the protocol v1 maximum`);
|
|
16
|
+
}
|
|
17
|
+
limits[key] = value;
|
|
18
|
+
}
|
|
19
|
+
return Object.freeze(limits);
|
|
20
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ProtocolIdentifier } from '../identifiers/index.js';
|
|
2
|
+
import type { CanonicalValue } from '../values/index.js';
|
|
3
|
+
interface ProtocolSchemaAnnotations {
|
|
4
|
+
readonly description?: string;
|
|
5
|
+
readonly default?: CanonicalValue;
|
|
6
|
+
}
|
|
7
|
+
export type ProtocolSchema = (ProtocolSchemaAnnotations & {
|
|
8
|
+
readonly kind: 'any';
|
|
9
|
+
}) | {
|
|
10
|
+
readonly kind: 'void';
|
|
11
|
+
readonly description?: string;
|
|
12
|
+
} | (ProtocolSchemaAnnotations & {
|
|
13
|
+
readonly kind: 'null';
|
|
14
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
15
|
+
readonly kind: 'boolean';
|
|
16
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
17
|
+
readonly kind: 'string';
|
|
18
|
+
readonly minLength?: number;
|
|
19
|
+
readonly maxLength?: number;
|
|
20
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
21
|
+
readonly kind: 'number' | 'integer';
|
|
22
|
+
readonly minimum?: number;
|
|
23
|
+
readonly exclusiveMinimum?: number;
|
|
24
|
+
readonly maximum?: number;
|
|
25
|
+
readonly exclusiveMaximum?: number;
|
|
26
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
27
|
+
readonly kind: 'literal';
|
|
28
|
+
readonly value: CanonicalValue;
|
|
29
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
30
|
+
readonly kind: 'enum';
|
|
31
|
+
readonly values: readonly CanonicalValue[];
|
|
32
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
33
|
+
readonly kind: 'array';
|
|
34
|
+
readonly items: ProtocolSchema;
|
|
35
|
+
readonly minItems?: number;
|
|
36
|
+
readonly maxItems?: number;
|
|
37
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
38
|
+
readonly kind: 'object';
|
|
39
|
+
readonly properties: Readonly<Record<ProtocolIdentifier, ProtocolSchema>>;
|
|
40
|
+
readonly required: readonly ProtocolIdentifier[];
|
|
41
|
+
readonly unknownProperties: 'reject' | 'strip' | 'preserve';
|
|
42
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
43
|
+
readonly kind: 'record';
|
|
44
|
+
readonly values: ProtocolSchema;
|
|
45
|
+
}) | (ProtocolSchemaAnnotations & {
|
|
46
|
+
readonly kind: 'union';
|
|
47
|
+
readonly variants: readonly ProtocolSchema[];
|
|
48
|
+
});
|
|
49
|
+
export interface ProtocolSchemaLimits {
|
|
50
|
+
readonly maxDepth: number;
|
|
51
|
+
readonly maxNodes: number;
|
|
52
|
+
readonly maxCollectionItems: number;
|
|
53
|
+
readonly maxDescriptionBytes: number;
|
|
54
|
+
}
|
|
55
|
+
export interface ProtocolSchemaOptions {
|
|
56
|
+
readonly limits?: Partial<ProtocolSchemaLimits>;
|
|
57
|
+
}
|
|
58
|
+
export type ProtocolSchemaErrorCode = 'HQ_SCHEMA_TYPE' | 'HQ_SCHEMA_UNKNOWN_FIELD' | 'HQ_SCHEMA_UNKNOWN_KIND' | 'HQ_SCHEMA_INVALID_IDENTIFIER' | 'HQ_SCHEMA_INVALID_VALUE' | 'HQ_SCHEMA_INVALID_CONSTRAINT' | 'HQ_SCHEMA_INVALID_REQUIRED' | 'HQ_SCHEMA_DUPLICATE_VALUE' | 'HQ_SCHEMA_TOO_DEEP' | 'HQ_SCHEMA_TOO_MANY_NODES' | 'HQ_SCHEMA_TOO_MANY_ITEMS' | 'HQ_SCHEMA_TOO_LARGE' | 'HQ_SCHEMA_UNSAFE_OBJECT';
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schemas/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA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