@astrale-os/kernel-dsl 1.0.0-beta.24 → 1.0.0-beta.25
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/v1/builder/lowering/policy.js +4 -24
- package/dist/v1/builder/lowering/schema/context.js +0 -3
- package/dist/v1/builder/lowering/value/compile.js +24 -21
- package/dist/v1/builder/lowering/value/zod.js +10 -4
- package/dist/v1/builder/schema/diagnostic.d.ts +1 -1
- package/dist/v1/bundle/codec.js +50 -67
- package/dist/v1/bundle/diagnostic.d.ts +1 -1
- package/dist/v1/bundle/structure.js +2 -2
- package/dist/v1/compiled/admission/accept.js +6 -6
- package/dist/v1/compiled/admission/closure.js +16 -33
- package/dist/v1/compiled/admission/diagnostic.d.ts +8 -0
- package/dist/v1/compiled/admission/diagnostic.js +33 -0
- package/dist/v1/compiled/admission/semantics/class.js +11 -7
- package/dist/v1/compiled/admission/semantics/policy/admit.js +4 -19
- package/dist/v1/compiled/admission/wire/callable.d.ts +5 -2
- package/dist/v1/compiled/admission/wire/callable.js +13 -19
- package/dist/v1/compiled/admission/wire/class.js +6 -9
- package/dist/v1/compiled/admission/wire/entry.d.ts +1 -1
- package/dist/v1/compiled/admission/wire/entry.js +8 -13
- package/dist/v1/compiled/admission/wire/policy.js +4 -3
- package/dist/v1/compiled/admission/wire/program.d.ts +13 -3
- package/dist/v1/compiled/admission/wire/program.js +39 -44
- package/dist/v1/compiled/admission/wire/property.d.ts +4 -1
- package/dist/v1/compiled/admission/wire/property.js +8 -5
- package/dist/v1/compiled/admission/wire/value.d.ts +0 -2
- package/dist/v1/compiled/admission/wire/value.js +0 -7
- package/dist/v1/compiled/codec/json.js +4 -3
- package/dist/v1/compiled/compiler/compile.js +6 -17
- package/dist/v1/compiled/diagnostic.d.ts +1 -1
- package/dist/v1/compiled/loader/load.js +2 -7
- package/dist/v1/domain/model/input.d.ts +2 -2
- package/dist/v1/domain/validation/create.d.ts +3 -1
- package/dist/v1/domain/validation/create.js +13 -8
- package/dist/v1/language/callable/resolved.d.ts +3 -3
- package/dist/v1/language/chain.d.ts +7 -0
- package/dist/v1/language/chain.js +24 -0
- package/dist/v1/language/cycle.d.ts +10 -0
- package/dist/v1/language/cycle.js +30 -0
- package/dist/v1/language/limits.d.ts +19 -0
- package/dist/v1/language/limits.js +17 -0
- package/dist/v1/language/policy/analysis/budgets.js +17 -13
- package/dist/v1/language/policy/analysis/composition.d.ts +4 -0
- package/dist/v1/language/policy/analysis/composition.js +11 -0
- package/dist/v1/language/suspended.d.ts +7 -0
- package/dist/v1/language/suspended.js +23 -0
- package/dist/v1/language/value/compile/fields.js +12 -8
- package/dist/v1/language/value/compile/load.d.ts +5 -0
- package/dist/v1/language/value/compile/load.js +13 -0
- package/dist/v1/language/value/evaluate/assertions.d.ts +5 -1
- package/dist/v1/language/value/evaluate/assertions.js +49 -8
- package/dist/v1/language/value/evaluate/evaluator.js +107 -105
- package/dist/v1/language/value/evaluate/preparation.d.ts +16 -0
- package/dist/v1/language/value/evaluate/preparation.js +100 -47
- package/dist/v1/language/value/evaluate/program.d.ts +2 -2
- package/dist/v1/language/value/evaluate/program.js +5 -5
- package/dist/v1/language/value/evaluate/validate.d.ts +3 -3
- package/dist/v1/language/value/evaluate/validate.js +9 -9
- package/dist/v1/language/value/evaluate/validity.optimization.js +4 -3
- package/dist/v1/language/value/inclusion/equivalence.js +4 -2
- package/dist/v1/language/value/inclusion/evidence.js +2 -2
- package/dist/v1/language/value/inclusion/includes.d.ts +13 -4
- package/dist/v1/language/value/inclusion/includes.js +34 -5
- package/dist/v1/language/value/inclusion/location.js +10 -7
- package/dist/v1/language/value/ordering.js +62 -70
- package/dist/v1/language/value/profile/canonicalize.d.ts +6 -1
- package/dist/v1/language/value/profile/canonicalize.js +64 -83
- package/dist/v1/language/value/profile/json.validate.d.ts +13 -3
- package/dist/v1/language/value/profile/json.validate.js +18 -6
- package/dist/v1/language/value/reference/closure.js +3 -2
- package/dist/v1/language/value/reference/recursion.js +7 -26
- package/dist/v1/language/value/reference/references.d.ts +3 -1
- package/dist/v1/language/value/reference/references.js +7 -7
- package/dist/v1/language/value/syntax/walk.d.ts +5 -0
- package/dist/v1/language/value/syntax/walk.js +14 -0
- package/dist/v1/schema/.spec/schemas/domain-schema.schema.json +1 -1
- package/dist/v1/schema/admission/accept.d.ts +3 -1
- package/dist/v1/schema/admission/accept.js +4 -1
- package/dist/v1/schema/analysis/class.d.ts +4 -0
- package/dist/v1/schema/analysis/class.js +24 -2
- package/dist/v1/schema/canonical/revision.d.ts +4 -1
- package/dist/v1/schema/canonical/revision.js +4 -1
- package/dist/v1/schema/compatibility/context.d.ts +5 -2
- package/dist/v1/schema/compatibility/context.js +8 -6
- package/dist/v1/schema/compatibility/model.d.ts +1 -1
- package/dist/v1/schema/compatibility/structure/requirements.js +2 -2
- package/dist/v1/schema/compatibility/walk.js +2 -2
- package/dist/v1/schema/diagnostic.d.ts +1 -1
- package/dist/v1/schema/normalization/domain.js +8 -4
- package/dist/v1/schema/resolution/context.js +6 -7
- package/dist/v1/schema/resolution/domain.js +3 -11
- package/dist/v1/schema/rule.js +10 -3
- package/dist/v1/schema/validation/class.js +1 -1
- package/dist/v1/schema/validation/core.js +16 -8
- package/dist/v1/schema/validation/domain.js +20 -3
- package/dist/v1/schema/validation/policy/budgets.d.ts +5 -1
- package/dist/v1/schema/validation/policy/budgets.js +8 -1
- package/dist/v1/schema/validation/policy/references.js +5 -25
- package/dist/value/accept.d.ts +3 -3
- package/dist/value/canonical.js +2 -2
- package/dist/value/equal.d.ts +9 -1
- package/dist/value/equal.js +37 -3
- package/dist/value/index.d.ts +1 -1
- package/dist/value/limits.d.ts +11 -0
- package/package.json +1 -1
- package/dist/v1/compiled/admission/wire/pattern.d.ts +0 -12
- package/dist/v1/compiled/admission/wire/pattern.js +0 -111
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { JsonSchema, ValueSchemaContext } from '../model/schema.js';
|
|
2
2
|
import type { ValueSchemaRegistry } from '../reference/registry.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Canonicalizes syntax without rewriting the schema's algebra, and judges nothing: a set repeating a
|
|
5
|
+
* value or naming something else than it declares keeps its members, for validation to refuse.
|
|
6
|
+
*/
|
|
4
7
|
export declare function canonicalizeValueSchema(schema: JsonSchema, context?: ValueSchemaContext, registry?: ValueSchemaRegistry): JsonSchema;
|
|
8
|
+
/** A schema with its members in canonical order at every depth. Arrays keep theirs: it is their meaning. */
|
|
9
|
+
export declare function canonicalizeSchemaMembers(schema: JsonSchema): JsonSchema;
|
|
@@ -5,88 +5,72 @@ import { SCHEMA_ARRAY_KEYWORDS, SCHEMA_MAP_KEYWORDS, SCHEMA_SINGLE_KEYWORDS, } f
|
|
|
5
5
|
const TYPE_ORDER = ['null', 'boolean', 'integer', 'number', 'string', 'array', 'object'];
|
|
6
6
|
const TYPE_RANK = new Map(TYPE_ORDER.map((name, index) => [name, index]));
|
|
7
7
|
const encoder = new TextEncoder();
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Canonicalizes syntax without rewriting the schema's algebra, and judges nothing: a set repeating a
|
|
10
|
+
* value or naming something else than it declares keeps its members, for validation to refuse.
|
|
11
|
+
*/
|
|
9
12
|
export function canonicalizeValueSchema(schema, context, registry) {
|
|
10
13
|
void context;
|
|
11
14
|
void registry;
|
|
12
15
|
return canonicalizeSchema(schema, true);
|
|
13
16
|
}
|
|
17
|
+
/** A schema with its members in canonical order at every depth. Arrays keep theirs: it is their meaning. */
|
|
18
|
+
export function canonicalizeSchemaMembers(schema) {
|
|
19
|
+
return canonicalizeJson(schema);
|
|
20
|
+
}
|
|
14
21
|
function canonicalizeSchema(schema, root) {
|
|
15
22
|
if (typeof schema === 'boolean')
|
|
16
23
|
return schema;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const value = schema[keyword];
|
|
22
|
-
if (keyword === 'required' && Array.isArray(value)) {
|
|
23
|
-
assertUnique(value, String, 'required');
|
|
24
|
-
result[keyword] = [...value].sort((left, right) => compareUnicode(String(left), String(right)));
|
|
25
|
-
}
|
|
26
|
-
else if (keyword === 'type' && Array.isArray(value)) {
|
|
27
|
-
assertUnique(value, String, 'type');
|
|
28
|
-
result[keyword] = [...value].sort((left, right) => (TYPE_RANK.get(String(left)) ?? Number.MAX_SAFE_INTEGER) -
|
|
29
|
-
(TYPE_RANK.get(String(right)) ?? Number.MAX_SAFE_INTEGER));
|
|
30
|
-
}
|
|
31
|
-
else if (keyword === 'enum' && Array.isArray(value)) {
|
|
32
|
-
const entries = value.map(canonicalizeJson);
|
|
33
|
-
assertUnique(entries, json.serialize, 'enum');
|
|
34
|
-
result[keyword] = entries.sort(compareCanonicalBytes);
|
|
35
|
-
}
|
|
36
|
-
else if (keyword === 'dependentRequired' && isJsonObject(value)) {
|
|
37
|
-
result[keyword] = canonicalizeDependentRequired(value);
|
|
38
|
-
}
|
|
39
|
-
else if (keyword === 'x-astrale-path' && isJsonObject(value)) {
|
|
40
|
-
result[keyword] = canonicalizePathAnnotation(value);
|
|
41
|
-
}
|
|
42
|
-
else if (SCHEMA_SINGLE_KEYWORDS.has(keyword) && isJsonSchema(value)) {
|
|
43
|
-
result[keyword] = canonicalizeSchema(value, false);
|
|
44
|
-
}
|
|
45
|
-
else if (SCHEMA_ARRAY_KEYWORDS.has(keyword) && Array.isArray(value)) {
|
|
46
|
-
result[keyword] = value.map((entry) => isJsonSchema(entry) ? canonicalizeSchema(entry, false) : canonicalizeJson(entry));
|
|
47
|
-
}
|
|
48
|
-
else if (SCHEMA_MAP_KEYWORDS.has(keyword) && isJsonObject(value)) {
|
|
49
|
-
const schemas = {};
|
|
50
|
-
for (const name of Object.keys(value).sort()) {
|
|
51
|
-
const entry = value[name];
|
|
52
|
-
schemas[name] = isJsonSchema(entry)
|
|
53
|
-
? canonicalizeSchema(entry, false)
|
|
54
|
-
: canonicalizeJson(entry);
|
|
55
|
-
}
|
|
56
|
-
result[keyword] = schemas;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
result[keyword] = canonicalizeJson(value);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return result;
|
|
24
|
+
if (!root)
|
|
25
|
+
return mapMembers(schema, canonicalizeKeyword);
|
|
26
|
+
const { $schema: _dialect, ...members } = schema;
|
|
27
|
+
return mapMembers(members, canonicalizeKeyword);
|
|
63
28
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
assertUnique(dependencies, String, `dependentRequired.${name}`);
|
|
73
|
-
result[name] = [...dependencies].sort((left, right) => compareUnicode(String(left), String(right)));
|
|
74
|
-
}
|
|
75
|
-
return result;
|
|
29
|
+
/**
|
|
30
|
+
* The members of an object in canonical order, each value mapped. A name is data: `__proto__` stays
|
|
31
|
+
* a member, for validation to judge, where an assignment would have set the prototype.
|
|
32
|
+
*/
|
|
33
|
+
function mapMembers(value, map) {
|
|
34
|
+
return Object.fromEntries(Object.keys(value)
|
|
35
|
+
.sort()
|
|
36
|
+
.map((name) => [name, map(name, value[name])]));
|
|
76
37
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
38
|
+
function canonicalizeKeyword(keyword, value) {
|
|
39
|
+
if (keyword === 'required' && isStringList(value))
|
|
40
|
+
return [...value].sort(compareUnicode);
|
|
41
|
+
if (keyword === 'type' && isStringList(value)) {
|
|
42
|
+
return [...value].sort((left, right) => (TYPE_RANK.get(left) ?? Number.MAX_SAFE_INTEGER) -
|
|
43
|
+
(TYPE_RANK.get(right) ?? Number.MAX_SAFE_INTEGER));
|
|
44
|
+
}
|
|
45
|
+
if (keyword === 'enum' && Array.isArray(value)) {
|
|
46
|
+
return value.map(canonicalizeJson).sort(compareCanonicalBytes);
|
|
47
|
+
}
|
|
48
|
+
if (keyword === 'dependentRequired' && isJsonObject(value)) {
|
|
49
|
+
return mapMembers(value, (_, dependencies) => isStringList(dependencies)
|
|
50
|
+
? [...dependencies].sort(compareUnicode)
|
|
51
|
+
: canonicalizeJson(dependencies));
|
|
52
|
+
}
|
|
53
|
+
if (keyword === 'x-astrale-path' && isJsonObject(value)) {
|
|
54
|
+
return mapMembers(value, canonicalizePathMember);
|
|
88
55
|
}
|
|
89
|
-
|
|
56
|
+
if (SCHEMA_SINGLE_KEYWORDS.has(keyword))
|
|
57
|
+
return canonicalizeNested(value);
|
|
58
|
+
if (SCHEMA_ARRAY_KEYWORDS.has(keyword) && Array.isArray(value)) {
|
|
59
|
+
return value.map(canonicalizeNested);
|
|
60
|
+
}
|
|
61
|
+
if (SCHEMA_MAP_KEYWORDS.has(keyword) && isJsonObject(value)) {
|
|
62
|
+
return mapMembers(value, (_, entry) => canonicalizeNested(entry));
|
|
63
|
+
}
|
|
64
|
+
return canonicalizeJson(value);
|
|
65
|
+
}
|
|
66
|
+
function canonicalizeNested(entry) {
|
|
67
|
+
return isJsonSchema(entry) ? canonicalizeSchema(entry, false) : canonicalizeJson(entry);
|
|
68
|
+
}
|
|
69
|
+
function canonicalizePathMember(name, member) {
|
|
70
|
+
const canonical = canonicalizeJson(member);
|
|
71
|
+
return name === 'accepts' && Array.isArray(canonical) && canonical.every(isComparableRef)
|
|
72
|
+
? canonical.sort(compareDefinitionRefs)
|
|
73
|
+
: canonical;
|
|
90
74
|
}
|
|
91
75
|
function canonicalizeJson(value) {
|
|
92
76
|
if (value === null || typeof value === 'boolean' || typeof value === 'string')
|
|
@@ -102,10 +86,7 @@ function canonicalizeJson(value) {
|
|
|
102
86
|
return value.map(canonicalizeJson);
|
|
103
87
|
if (!isJsonObject(value))
|
|
104
88
|
throw new TypeError('Cannot canonicalize a non-JSON value.');
|
|
105
|
-
|
|
106
|
-
for (const key of Object.keys(value).sort())
|
|
107
|
-
result[key] = canonicalizeJson(value[key]);
|
|
108
|
-
return result;
|
|
89
|
+
return mapMembers(value, (_, member) => canonicalizeJson(member));
|
|
109
90
|
}
|
|
110
91
|
function compareCanonicalBytes(left, right) {
|
|
111
92
|
const a = encoder.encode(json.serialize(left));
|
|
@@ -117,14 +98,14 @@ function compareCanonicalBytes(left, right) {
|
|
|
117
98
|
}
|
|
118
99
|
return a.length - b.length;
|
|
119
100
|
}
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
101
|
+
function isStringList(value) {
|
|
102
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === 'string');
|
|
103
|
+
}
|
|
104
|
+
function isComparableRef(value) {
|
|
105
|
+
return (isJsonObject(value) &&
|
|
106
|
+
typeof value.origin === 'string' &&
|
|
107
|
+
typeof value.kind === 'string' &&
|
|
108
|
+
typeof value.name === 'string');
|
|
128
109
|
}
|
|
129
110
|
function isJsonSchema(value) {
|
|
130
111
|
return typeof value === 'boolean' || isJsonObject(value);
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type StructuralOptions, type Value as JsonValue } from '@astrale-os/kernel-dsl/value';
|
|
2
2
|
import type { Diagnostic } from '../../validation/diagnostic.js';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The snapshot of `value` as a portable JSON Value, within the portable limits `options` overrides,
|
|
5
|
+
* or why it is none. What evaluates an instance reads this snapshot and never `value` again: what
|
|
6
|
+
* admission bounded is what is read, under the limits it was bounded by.
|
|
7
|
+
*/
|
|
8
|
+
export declare function acceptInstance(value: unknown, pointer: string, options?: StructuralOptions): {
|
|
9
|
+
readonly value: JsonValue;
|
|
10
|
+
} | {
|
|
11
|
+
readonly refusal: Diagnostic;
|
|
12
|
+
};
|
|
13
|
+
/** Whether `value` is a portable JSON Value. */
|
|
14
|
+
export declare function validateCanonicalJsonDomain(value: unknown, pointer: string): readonly Diagnostic[];
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { acceptForRead as acceptJsonValue, BoundaryError as JsonBoundaryError, } from '@astrale-os/kernel-dsl/value';
|
|
2
2
|
import { diagnostic } from '../../validation/diagnostic.js';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The snapshot of `value` as a portable JSON Value, within the portable limits `options` overrides,
|
|
5
|
+
* or why it is none. What evaluates an instance reads this snapshot and never `value` again: what
|
|
6
|
+
* admission bounded is what is read, under the limits it was bounded by.
|
|
7
|
+
*/
|
|
8
|
+
export function acceptInstance(value, pointer, options) {
|
|
5
9
|
try {
|
|
6
|
-
acceptJsonValue(value, options);
|
|
7
|
-
return [];
|
|
10
|
+
return { value: acceptJsonValue(value, options) };
|
|
8
11
|
}
|
|
9
12
|
catch (error) {
|
|
10
13
|
if (error instanceof JsonBoundaryError) {
|
|
11
|
-
return
|
|
14
|
+
return {
|
|
15
|
+
refusal: diagnostic('VS_NUMBER_DOMAIN', `${pointer}${error.pointer}`, error.message),
|
|
16
|
+
};
|
|
12
17
|
}
|
|
13
|
-
return
|
|
18
|
+
return {
|
|
19
|
+
refusal: diagnostic('VS_META_SCHEMA', pointer, 'Value is outside the JSON data model.'),
|
|
20
|
+
};
|
|
14
21
|
}
|
|
15
22
|
}
|
|
23
|
+
/** Whether `value` is a portable JSON Value. */
|
|
24
|
+
export function validateCanonicalJsonDomain(value, pointer) {
|
|
25
|
+
const accepted = acceptInstance(value, pointer);
|
|
26
|
+
return 'refusal' in accepted ? [accepted.refusal] : [];
|
|
27
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { diagnostic } from '../../validation/diagnostic.js';
|
|
2
2
|
import { isValueObject as isJsonObject } from '../model/object.js';
|
|
3
3
|
import { hasNodePathAnnotation } from '../syntax/node-path/schema.js';
|
|
4
|
-
import { walkSchema } from '../syntax/walk.js';
|
|
4
|
+
import { collectSchemaPointers, walkSchema } from '../syntax/walk.js';
|
|
5
5
|
import { resolveAddressReference, } from './references.js';
|
|
6
6
|
export function collectResourceClosure(schema, context, index, pointer) {
|
|
7
7
|
const diagnostics = [];
|
|
@@ -19,6 +19,7 @@ export function collectResourceClosure(schema, context, index, pointer) {
|
|
|
19
19
|
const resource = queue.shift();
|
|
20
20
|
if (resource === undefined)
|
|
21
21
|
break;
|
|
22
|
+
const pointers = collectSchemaPointers(resource.schema);
|
|
22
23
|
walkSchema(resource.schema, (location) => {
|
|
23
24
|
if (!isJsonObject(location.schema) || !Object.hasOwn(location.schema, '$ref'))
|
|
24
25
|
return;
|
|
@@ -27,7 +28,7 @@ export function collectResourceClosure(schema, context, index, pointer) {
|
|
|
27
28
|
diagnostics.push(diagnostic('VS_REFERENCE_FORM', refPointer, '$ref must be a string URI-reference.'));
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
const result = resolveAddressReference(location.schema.$ref, resource, index, refPointer, hasNodePathAnnotation(location.schema));
|
|
31
|
+
const result = resolveAddressReference(location.schema.$ref, resource, pointers, index, refPointer, hasNodePathAnnotation(location.schema));
|
|
31
32
|
if (result.diagnostic !== undefined)
|
|
32
33
|
diagnostics.push(result.diagnostic);
|
|
33
34
|
if (result.resolved === undefined)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cycleEdges } from '../../cycle.js';
|
|
1
2
|
import { diagnostic } from '../../validation/diagnostic.js';
|
|
2
3
|
import { isValueObject as isJsonObject } from '../model/object.js';
|
|
3
4
|
import { appendPointer } from '../syntax/pointer.js';
|
|
@@ -46,30 +47,10 @@ export function validateProductiveRecursion(resources, resolutions) {
|
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
diagnostic('VS_RECURSION_PRODUCTIVE', diagnosticPointers.get(cycleAt) ?? '', 'Every recursive cycle must cross an instance-consuming schema edge.'),
|
|
56
|
-
];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
function findCycle(node, adjacency, visiting, visited) {
|
|
62
|
-
if (visiting.has(node))
|
|
63
|
-
return node;
|
|
64
|
-
if (visited.has(node))
|
|
65
|
-
return undefined;
|
|
66
|
-
visiting.add(node);
|
|
67
|
-
for (const target of adjacency.get(node) ?? []) {
|
|
68
|
-
const cycleAt = findCycle(target, adjacency, visiting, visited);
|
|
69
|
-
if (cycleAt !== undefined)
|
|
70
|
-
return cycleAt;
|
|
71
|
-
}
|
|
72
|
-
visiting.delete(node);
|
|
73
|
-
visited.add(node);
|
|
74
|
-
return undefined;
|
|
50
|
+
const [cycle] = cycleEdges(adjacency.keys(), (node) => adjacency.get(node) ?? []);
|
|
51
|
+
if (cycle === undefined)
|
|
52
|
+
return [];
|
|
53
|
+
return [
|
|
54
|
+
diagnostic('VS_RECURSION_PRODUCTIVE', diagnosticPointers.get(cycle.target) ?? '', 'Every recursive cycle must cross an instance-consuming schema edge.'),
|
|
55
|
+
];
|
|
75
56
|
}
|
|
@@ -11,7 +11,9 @@ export interface ResolvedAddressReference {
|
|
|
11
11
|
readonly resource: SchemaResource;
|
|
12
12
|
readonly pointer: string;
|
|
13
13
|
}
|
|
14
|
-
export declare function resolveAddressReference(ref: string, from: SchemaResource,
|
|
14
|
+
export declare function resolveAddressReference(ref: string, from: SchemaResource,
|
|
15
|
+
/** The schema locations of `from`, the only targets a local reference has. */
|
|
16
|
+
pointers: ReadonlySet<string>, index: RegistryIndex, pointer: string, nodePathPlacement: boolean): {
|
|
15
17
|
readonly resolved?: ResolvedAddressReference;
|
|
16
18
|
readonly diagnostic?: Diagnostic;
|
|
17
19
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { diagnostic } from '../../validation/diagnostic.js';
|
|
2
2
|
import { GRAPH_NODE_PATH_SCHEMA_ID } from '../syntax/node-path/schema.js';
|
|
3
|
-
import { parseJsonPointerFragment,
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { parseJsonPointerFragment, tokensToPointer } from '../syntax/pointer.js';
|
|
4
|
+
export function resolveAddressReference(ref, from,
|
|
5
|
+
/** The schema locations of `from`, the only targets a local reference has. */
|
|
6
|
+
pointers, index, pointer, nodePathPlacement) {
|
|
6
7
|
if (ref === GRAPH_NODE_PATH_SCHEMA_ID) {
|
|
7
8
|
if (!nodePathPlacement) {
|
|
8
9
|
return {
|
|
@@ -27,16 +28,15 @@ export function resolveAddressReference(ref, from, index, pointer, nodePathPlace
|
|
|
27
28
|
diagnostic: diagnostic('VS_REFERENCE_FORM', pointer, 'A local $ref must be a JSON Pointer fragment; anchors are forbidden.', ref),
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
return resolveTarget(from, tokens, pointer, ref);
|
|
31
|
+
return resolveTarget(from, pointers, tokens, pointer, ref);
|
|
31
32
|
}
|
|
32
33
|
return {
|
|
33
34
|
diagnostic: diagnostic('VS_REFERENCE_FORM', pointer, 'A $ref must be a local JSON Pointer or the graph NodePath id at its extension site.', ref),
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
function resolveTarget(resource, tokens, diagnosticPointer, ref) {
|
|
37
|
-
const target = resolvePointer(resource.schema, tokens);
|
|
37
|
+
function resolveTarget(resource, pointers, tokens, diagnosticPointer, ref) {
|
|
38
38
|
const pointer = tokensToPointer(tokens);
|
|
39
|
-
if (
|
|
39
|
+
if (!pointers.has(pointer)) {
|
|
40
40
|
return {
|
|
41
41
|
diagnostic: diagnostic('VS_REFERENCE_RESOLUTION', diagnosticPointer, 'The $ref does not resolve to an exact schema location in the registry.', ref),
|
|
42
42
|
};
|
|
@@ -8,5 +8,10 @@ export interface SchemaLocation {
|
|
|
8
8
|
export declare function walkSchema(schema: JsonSchema, visit: (location: SchemaLocation) => void, pointer?: string): void;
|
|
9
9
|
/** Visit each subschema `keyword` holds directly, with its pointer under `pointer`. */
|
|
10
10
|
export declare function forEachSubschema(keyword: string, value: unknown, pointer: string, visit: (schema: JsonSchema, pointer: string) => void): void;
|
|
11
|
+
/**
|
|
12
|
+
* Whether `keyword`, if it holds subschemas at all, holds nothing else. `forEachSubschema` skips
|
|
13
|
+
* what the meta-schema refuses there, while a reader of an admitted schema counts on every member.
|
|
14
|
+
*/
|
|
15
|
+
export declare function holdsOnlySubschemas(keyword: string, value: unknown): boolean;
|
|
11
16
|
export declare function collectSchemaPointers(schema: JsonSchema): ReadonlySet<string>;
|
|
12
17
|
export declare function isJsonSchema(value: unknown): value is JsonSchema;
|
|
@@ -42,6 +42,20 @@ export function forEachSubschema(keyword, value, pointer, visit) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Whether `keyword`, if it holds subschemas at all, holds nothing else. `forEachSubschema` skips
|
|
47
|
+
* what the meta-schema refuses there, while a reader of an admitted schema counts on every member.
|
|
48
|
+
*/
|
|
49
|
+
export function holdsOnlySubschemas(keyword, value) {
|
|
50
|
+
if (SCHEMA_SINGLE_KEYWORDS.has(keyword))
|
|
51
|
+
return isJsonSchema(value);
|
|
52
|
+
if (SCHEMA_ARRAY_KEYWORDS.has(keyword))
|
|
53
|
+
return Array.isArray(value) && value.every(isJsonSchema);
|
|
54
|
+
if (SCHEMA_MAP_KEYWORDS.has(keyword)) {
|
|
55
|
+
return isJsonObject(value) && Object.values(value).every(isJsonSchema);
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
45
59
|
export function collectSchemaPointers(schema) {
|
|
46
60
|
const pointers = new Set();
|
|
47
61
|
walkSchema(schema, ({ pointer }) => pointers.add(pointer));
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"portable-json": {
|
|
20
20
|
"code": "DV_JSON_VALUE",
|
|
21
21
|
"stage": "structure",
|
|
22
|
-
"statement": "The document is portable JSON: as text, UTF-8 that parses, within 16,777,216 bytes, with no byte-order mark and no repeated member name; as a value, null, booleans, finite numbers other than negative zero, strings, arrays and plain objects, with no string or member name that holds U+0000 or a lone surrogate or exceeds 1,048,576 bytes of UTF-8, at most 64 nested arrays and objects, and at most 100,000 members and items in all.",
|
|
22
|
+
"statement": "The document is portable JSON: as text, UTF-8 that parses, within 16,777,216 bytes, with no byte-order mark and no repeated member name; as a value, null, booleans, finite numbers other than negative zero, strings, arrays and plain objects, with no string or member name that holds U+0000 or a lone surrogate or exceeds 1,048,576 bytes of UTF-8, at most 64 nested arrays and objects, and at most 100,000 members and items in all. A Bundle holds a closure whole, so as a whole it holds at most 1,000,000 members and items, and each Domain in it the limits above.",
|
|
23
23
|
"positions": [
|
|
24
24
|
"#/$defs/portable-json"
|
|
25
25
|
]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { DomainSchemaLookup } from '../dependency/lookup.js';
|
|
2
|
-
import type { DomainSchema } from '../model/schema.js';
|
|
2
|
+
import type { DomainSchema, DomainSchemaIR } from '../model/schema.js';
|
|
3
3
|
export declare function acceptDomainSchema(input: unknown, lookup?: DomainSchemaLookup): DomainSchema;
|
|
4
|
+
/** Hold a document `structureDomainSchema` already read to the semantics of its language. */
|
|
5
|
+
export declare function acceptStructuredDomainSchema(structured: DomainSchemaIR, lookup: DomainSchemaLookup): DomainSchema;
|
|
@@ -5,7 +5,10 @@ import { rememberDomainClosure } from '../resolution/closure.js';
|
|
|
5
5
|
import { validateDomainSchemaSemantics } from '../validation/domain.js';
|
|
6
6
|
import { structureDomainSchema } from '../validation/domain.route.js';
|
|
7
7
|
export function acceptDomainSchema(input, lookup = emptyDomainSchemaLookup()) {
|
|
8
|
-
|
|
8
|
+
return acceptStructuredDomainSchema(structureDomainSchema(input), lookup);
|
|
9
|
+
}
|
|
10
|
+
/** Hold a document `structureDomainSchema` already read to the semantics of its language. */
|
|
11
|
+
export function acceptStructuredDomainSchema(structured, lookup) {
|
|
9
12
|
const validation = validateDomainSchemaSemantics(structured, lookup);
|
|
10
13
|
if (validation.diagnostics.length > 0)
|
|
11
14
|
throw new SchemaError(validation.diagnostics);
|
|
@@ -40,6 +40,10 @@ export interface DefinitionAnalysisResult {
|
|
|
40
40
|
readonly definitions: ReadonlyMap<string, DefinitionAnalysis>;
|
|
41
41
|
readonly diagnostics: readonly SchemaDiagnostic[];
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Compose every Class from its parents, unless a chain of parents is past its limit: then nothing
|
|
45
|
+
* is composed, since composing holds each Class's ancestors and walks them on the call stack.
|
|
46
|
+
*/
|
|
43
47
|
export declare function analyzeDefinitions(environment: DomainResolutionContext): DefinitionAnalysisResult;
|
|
44
48
|
/** The exact signature required by abstract Method composition. */
|
|
45
49
|
export declare function sameMethodSignature(left: MethodDefinition, right: MethodDefinition): boolean;
|
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { equal } from '@astrale-os/kernel-dsl/value';
|
|
2
2
|
import { Key, PropertyKey } from '../../addressing/index.js';
|
|
3
3
|
import { definitionRefIndex } from '../../addressing/ordering.js';
|
|
4
4
|
import { composeMethods } from '../../language/callable/composition.js';
|
|
5
|
+
import { chainDepths } from '../../language/chain.js';
|
|
6
|
+
import { limits } from '../../language/limits.js';
|
|
5
7
|
import { canonicalizeValueSchema } from '../../language/value/profile/canonicalize.js';
|
|
6
8
|
import { escapePointerToken } from '../../language/value/syntax/pointer.js';
|
|
7
9
|
import { diagnostic } from '../diagnostic.js';
|
|
8
10
|
const formatDefinitionRef = Key.of;
|
|
11
|
+
/**
|
|
12
|
+
* A refusal at each Class past the limit. A dependency was accepted under the same limit and each
|
|
13
|
+
* of its Classes reads only its own closure, so such a Class is always one of the candidate. A
|
|
14
|
+
* direct parent is at depth 1. Every other walk of inheritance runs on the call stack, under this.
|
|
15
|
+
*/
|
|
16
|
+
function validateInheritanceDepth(environment) {
|
|
17
|
+
const depths = chainDepths(environment.definitions.values(), ({ declaration }) => declaration.extends.flatMap((parent) => environment.resolveAny(parent) ?? []));
|
|
18
|
+
return [...depths].flatMap(([{ ref }, depth]) => depth > limits.inheritance.depth
|
|
19
|
+
? [
|
|
20
|
+
diagnostic('DV_INHERITANCE_LIMITS', `/classes/${escapePointerToken(ref.name)}/extends`, `Class ${formatDefinitionRef(ref)} has ${depth} parents on its longest chain, over the maximum ${limits.inheritance.depth}.`),
|
|
21
|
+
]
|
|
22
|
+
: []);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Compose every Class from its parents, unless a chain of parents is past its limit: then nothing
|
|
26
|
+
* is composed, since composing holds each Class's ancestors and walks them on the call stack.
|
|
27
|
+
*/
|
|
9
28
|
export function analyzeDefinitions(environment) {
|
|
29
|
+
const pastLimit = validateInheritanceDepth(environment);
|
|
30
|
+
if (pastLimit.length > 0)
|
|
31
|
+
return Object.freeze({ definitions: new Map(), diagnostics: Object.freeze(pastLimit) });
|
|
10
32
|
const diagnostics = [];
|
|
11
33
|
const result = new Map();
|
|
12
34
|
const visiting = new Set();
|
|
@@ -134,7 +156,7 @@ function mergeMethods(owner, declaration, parents, report) {
|
|
|
134
156
|
}
|
|
135
157
|
/** The exact signature required by abstract Method composition. */
|
|
136
158
|
export function sameMethodSignature(left, right) {
|
|
137
|
-
return
|
|
159
|
+
return equal(methodSignature(left), methodSignature(right));
|
|
138
160
|
}
|
|
139
161
|
/**
|
|
140
162
|
* Shared canonical signature used by admission and compatibility explanations. The execution
|
|
@@ -6,7 +6,10 @@ interface CanonicalDomainSchema {
|
|
|
6
6
|
readonly revision: Revision;
|
|
7
7
|
}
|
|
8
8
|
export declare function canonicalDomainSchema(value: DomainSchema): CanonicalDomainSchema;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Internal acceptance seam. The caller must establish the structure first; canonicalization judges
|
|
11
|
+
* nothing further, so the result is an accepted Schema only once whole-Domain validity holds too.
|
|
12
|
+
*/
|
|
10
13
|
export declare function canonicalDomainSchemaAfterValidation(value: DomainSchemaIR): CanonicalDomainSchema;
|
|
11
14
|
export declare function revisionOfDomainSchema(schema: DomainSchema): Revision;
|
|
12
15
|
export {};
|
|
@@ -7,7 +7,10 @@ const revisions = new WeakMap();
|
|
|
7
7
|
export function canonicalDomainSchema(value) {
|
|
8
8
|
return canonicalDomainSchemaAfterValidation(value);
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Internal acceptance seam. The caller must establish the structure first; canonicalization judges
|
|
12
|
+
* nothing further, so the result is an accepted Schema only once whole-Domain validity holds too.
|
|
13
|
+
*/
|
|
11
14
|
export function canonicalDomainSchemaAfterValidation(value) {
|
|
12
15
|
const schema = asDomainSchema(normalizeDomainSchema(value));
|
|
13
16
|
const bytes = json.encode(schema);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ClassRef, DefinitionRef, Key as SemanticKey } from '../../addressing/index.js';
|
|
2
2
|
import type { DefinitionAnalysis, EffectiveMethod } from '../analysis/class.js';
|
|
3
3
|
import type { DomainSchema } from '../model/schema.js';
|
|
4
|
-
import { SchemaError } from '../diagnostic.js';
|
|
5
4
|
/** One accepted root with its exact closure and a memoized Definition analysis per owner. */
|
|
6
5
|
export interface Context {
|
|
7
6
|
readonly schemas: ReadonlyMap<string, DomainSchema>;
|
|
@@ -16,4 +15,8 @@ export declare function effectiveDefinition(context: Context, owner: DomainSchem
|
|
|
16
15
|
/** Effective Methods are keyed by name; a coordinate names one by its exact Method Key. */
|
|
17
16
|
export declare function effectiveMethod(analysis: DefinitionAnalysis, key: SemanticKey): EffectiveMethod | undefined;
|
|
18
17
|
export declare function requireOwner(context: Context, ref: DefinitionRef, key: SemanticKey): DomainSchema;
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Acceptance proved every reference of a Domain against the closure it retains, so what a comparison
|
|
20
|
+
* reaches from one has a meaning there. Its absence is a defect here and no answer about a document.
|
|
21
|
+
*/
|
|
22
|
+
export declare function retainedContextDefect(key: SemanticKey): TypeError;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MethodKey } from '../../addressing/index.js';
|
|
2
2
|
import { definitionRefIndex } from '../../addressing/ordering.js';
|
|
3
3
|
import { analyzeDefinitions } from '../analysis/class.js';
|
|
4
|
-
import { SchemaError, diagnostic } from '../diagnostic.js';
|
|
5
4
|
import { knownDomainClosure, lookupForDomainClosure } from '../resolution/closure.js';
|
|
6
5
|
import { buildDomainResolutionContext } from '../resolution/context.js';
|
|
7
6
|
/**
|
|
@@ -39,11 +38,14 @@ export function effectiveMethod(analysis, key) {
|
|
|
39
38
|
}
|
|
40
39
|
export function requireOwner(context, ref, key) {
|
|
41
40
|
const owner = context.schemas.get(ref.origin);
|
|
42
|
-
if (owner === undefined)
|
|
43
|
-
throw
|
|
44
|
-
}
|
|
41
|
+
if (owner === undefined)
|
|
42
|
+
throw retainedContextDefect(key);
|
|
45
43
|
return owner;
|
|
46
44
|
}
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Acceptance proved every reference of a Domain against the closure it retains, so what a comparison
|
|
47
|
+
* reaches from one has a meaning there. Its absence is a defect here and no answer about a document.
|
|
48
|
+
*/
|
|
49
|
+
export function retainedContextDefect(key) {
|
|
50
|
+
return new TypeError(`Retained acceptance context has no meaning for ${key}.`);
|
|
49
51
|
}
|
|
@@ -7,7 +7,7 @@ export type Fingerprint = `sha256:${string}`;
|
|
|
7
7
|
* The codes a comparison request is refused with: the request, not a Schema, is invalid. A
|
|
8
8
|
* `schema.Error` carries them beside the codes of a refused Schema document.
|
|
9
9
|
*/
|
|
10
|
-
export type DiagnosticCode = 'DM_CAPABILITY_INVALID' | '
|
|
10
|
+
export type DiagnosticCode = 'DM_CAPABILITY_INVALID' | 'DM_DEPENDENCY_NOT_RETAINED' | 'DM_MEMBER_ORIGIN_MISMATCH' | 'DM_MEMBER_ROOT_INVALID';
|
|
11
11
|
/** Inputs carry accepted schemas; a dependency's source is always its retained exact context. */
|
|
12
12
|
export interface ComparisonRequest {
|
|
13
13
|
readonly scope: {
|
|
@@ -2,7 +2,7 @@ import { inheritanceOf } from '../../../language/class/inheritance.js';
|
|
|
2
2
|
import { inheritanceMeaning } from '../comparators/classes.js';
|
|
3
3
|
import { compareFacet } from '../comparators/index.js';
|
|
4
4
|
import { fingerprintMeaning } from '../comparators/values.js';
|
|
5
|
-
import {
|
|
5
|
+
import { retainedContextDefect } from '../context.js';
|
|
6
6
|
import { methodCoordinate } from '../coordinate.js';
|
|
7
7
|
import { closedParents } from '../extension.js';
|
|
8
8
|
import { callableReferences, classReferences, inherits, memberReferences, usageOf, valueReferences, } from '../references.js';
|
|
@@ -55,7 +55,7 @@ function compareReliance({ context, report, }) {
|
|
|
55
55
|
for (const reference of context.reliance) {
|
|
56
56
|
const pair = context.pair(reference.coordinate);
|
|
57
57
|
if (pair.source === undefined)
|
|
58
|
-
throw
|
|
58
|
+
throw retainedContextDefect(reference.coordinate.key);
|
|
59
59
|
const facet = reference.coordinate.kind === 'method' ? 'method.object' : 'class.endpoints';
|
|
60
60
|
const { before, after } = compareFacet({ context, pair, facet });
|
|
61
61
|
if (before !== undefined &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Key } from '../../addressing/index.js';
|
|
2
2
|
import { compareAddedProperties, compareLostProperties } from './comparators/classes.js';
|
|
3
3
|
import { compareFacet } from './comparators/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { retainedContextDefect } from './context.js';
|
|
5
5
|
/**
|
|
6
6
|
* Follow the reference closure from the roots once per coordinate and usage relation. `expand`
|
|
7
7
|
* names the facet a reached subject is compared under and `reach`es what it references; a subject
|
|
@@ -23,7 +23,7 @@ export function walkReferences({ context, report }, expand, required = () => tru
|
|
|
23
23
|
const pair = context.pair(coordinate);
|
|
24
24
|
const subject = pair.source;
|
|
25
25
|
if (subject === undefined)
|
|
26
|
-
throw
|
|
26
|
+
throw retainedContextDefect(coordinate.key);
|
|
27
27
|
const facet = expand(subject, reference, reach);
|
|
28
28
|
if (Key.origin(coordinate.key) !== context.source.origin)
|
|
29
29
|
continue;
|
|
@@ -2,7 +2,7 @@ import type { DiagnosticCode as LanguageDiagnosticCode } from '../language/valid
|
|
|
2
2
|
import type { Diagnostic as LanguageDiagnostic } from '../language/validation/diagnostic.js';
|
|
3
3
|
import type { DiagnosticCode as CompatibilityDiagnosticCode } from './compatibility/model.js';
|
|
4
4
|
/** The codes a Schema document is refused with, one per rule of `RULES`. */
|
|
5
|
-
export type SchemaDiagnosticCode = 'DV_ACCEPTANCE_CONTEXT' | 'DV_CALLABLE_ADMISSION' | 'DV_CALLABLE_AUTH' | 'DV_CALLABLE_IO' | 'DV_CLASS_ABSTRACT' | 'DV_CLASS_ACYCLIC' | 'DV_CLASS_INHERITANCE' | 'DV_CLASS_KIND' | 'DV_CORE_EDGE_CLASS' | 'DV_CORE_EDGE_CONSTRAINTS' | 'DV_CORE_EDGE_KEY' | 'DV_CORE_EDGE_PROPERTIES' | 'DV_CORE_EDGE_UNIQUE' | 'DV_CORE_NODE_CLASS' | 'DV_CORE_NODE_PROPERTIES' | 'DV_CORE_NODE_UNIQUE' | 'DV_CORE_REF' | 'DV_DATA_COMPOSITION' | 'DV_DEPENDENCY_ACYCLIC' | 'DV_DEPENDENCY_DIRECT' | 'DV_DEPENDENCY_EXACT' | 'DV_DEPENDENCY_LIMITS' | 'DV_DEPENDENCY_REVISION_COHERENCE' | 'DV_DEPENDENCY_UNIQUE' | 'DV_EDGE_ACCEPTS' | 'DV_EDGE_CLASS_COMPOSITION' | 'DV_EDGE_FOREIGN_MINIMUM' | 'DV_EDGE_LIFETIME' | 'DV_EDGE_ROLE' | 'DV_EDGE_UNIQUE' | 'DV_ENTRYPOINT' | 'DV_JSON_VALUE' | 'DV_METHOD_ABSTRACT' | 'DV_METHOD_COMPOSITION' | 'DV_NODE_UNIQUE' | 'DV_PROPERTY_AUTO' | 'DV_PROPERTY_IMMUTABLE' | 'DV_PROPERTY_STATE' | 'DV_REF_RESOLVES' | 'DV_VALUE_SCHEMA' | 'PL_BUDGET' | 'PL_COMPOSITION' | 'PL_CONNECTIVITY' | 'PL_REF' | 'PL_REPEAT' | 'PL_TARGET' | 'PL_TYPING' | 'PL_USE' | 'PL_VARIABLE_SCOPE' | 'STRUCTURE_BINARY_INPUT' | 'STRUCTURE_CALLABLE_POLICY_AUTH' | 'STRUCTURE_DEPENDENCY_ALIAS' | 'STRUCTURE_DOMAIN_NAME' | 'STRUCTURE_DUPLICATE_ITEM' | 'STRUCTURE_EDGE_BLOB' | 'STRUCTURE_EDGE_ORIENTATION' | 'STRUCTURE_FORMAT' | 'STRUCTURE_KEY' | 'STRUCTURE_MAXIMUM' | 'STRUCTURE_MINIMUM' | 'STRUCTURE_PROPERTY_KEY' | 'STRUCTURE_PROTO_KEY' | 'STRUCTURE_REQUIRED' | 'STRUCTURE_STATE_TRANSITIONS' | 'STRUCTURE_TYPE' | 'STRUCTURE_UNION' | 'STRUCTURE_UNKNOWN_FIELD' | 'STRUCTURE_VALUE' | 'UNSUPPORTED_DOCUMENT_FORMAT' | 'UNSUPPORTED_DSL_VERSION';
|
|
5
|
+
export type SchemaDiagnosticCode = 'DV_ACCEPTANCE_CONTEXT' | 'DV_CALLABLE_ADMISSION' | 'DV_CALLABLE_AUTH' | 'DV_CALLABLE_IO' | 'DV_CLASS_ABSTRACT' | 'DV_CLASS_ACYCLIC' | 'DV_CLASS_INHERITANCE' | 'DV_CLASS_KIND' | 'DV_CORE_EDGE_CLASS' | 'DV_CORE_EDGE_CONSTRAINTS' | 'DV_CORE_EDGE_KEY' | 'DV_CORE_EDGE_PROPERTIES' | 'DV_CORE_EDGE_UNIQUE' | 'DV_CORE_NODE_CLASS' | 'DV_CORE_NODE_PROPERTIES' | 'DV_CORE_NODE_UNIQUE' | 'DV_CORE_REF' | 'DV_DATA_COMPOSITION' | 'DV_DEPENDENCY_ACYCLIC' | 'DV_DEPENDENCY_DIRECT' | 'DV_DEPENDENCY_EXACT' | 'DV_DEPENDENCY_LIMITS' | 'DV_DEPENDENCY_REVISION_COHERENCE' | 'DV_DEPENDENCY_UNIQUE' | 'DV_EDGE_ACCEPTS' | 'DV_EDGE_CLASS_COMPOSITION' | 'DV_EDGE_FOREIGN_MINIMUM' | 'DV_EDGE_LIFETIME' | 'DV_EDGE_ROLE' | 'DV_EDGE_UNIQUE' | 'DV_ENTRYPOINT' | 'DV_INHERITANCE_LIMITS' | 'DV_JSON_VALUE' | 'DV_METHOD_ABSTRACT' | 'DV_METHOD_COMPOSITION' | 'DV_NODE_UNIQUE' | 'DV_PROPERTY_AUTO' | 'DV_PROPERTY_IMMUTABLE' | 'DV_PROPERTY_STATE' | 'DV_REF_RESOLVES' | 'DV_VALUE_SCHEMA' | 'PL_BUDGET' | 'PL_COMPOSITION' | 'PL_CONNECTIVITY' | 'PL_REF' | 'PL_REPEAT' | 'PL_TARGET' | 'PL_TYPING' | 'PL_USE' | 'PL_VARIABLE_SCOPE' | 'STRUCTURE_BINARY_INPUT' | 'STRUCTURE_CALLABLE_POLICY_AUTH' | 'STRUCTURE_DEPENDENCY_ALIAS' | 'STRUCTURE_DOMAIN_NAME' | 'STRUCTURE_DUPLICATE_ITEM' | 'STRUCTURE_EDGE_BLOB' | 'STRUCTURE_EDGE_ORIENTATION' | 'STRUCTURE_FORMAT' | 'STRUCTURE_KEY' | 'STRUCTURE_MAXIMUM' | 'STRUCTURE_MINIMUM' | 'STRUCTURE_PROPERTY_KEY' | 'STRUCTURE_PROTO_KEY' | 'STRUCTURE_REQUIRED' | 'STRUCTURE_STATE_TRANSITIONS' | 'STRUCTURE_TYPE' | 'STRUCTURE_UNION' | 'STRUCTURE_UNKNOWN_FIELD' | 'STRUCTURE_VALUE' | 'UNSUPPORTED_DOCUMENT_FORMAT' | 'UNSUPPORTED_DSL_VERSION';
|
|
6
6
|
/**
|
|
7
7
|
* A Schema refuses a document with its own codes, and a comparison request with the
|
|
8
8
|
* compatibility codes. `pointer` names the position the refused rule applies to, in the document
|