@agentshouse/mdmodel 0.1.0-c83456e1cebfb → 0.1.0-cabd61587647f
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/API.md +242 -181
- package/README.md +17 -18
- package/dist/blocks.d.ts.map +1 -1
- package/dist/blocks.js +33 -26
- package/dist/condition.d.ts +149 -0
- package/dist/condition.d.ts.map +1 -0
- package/dist/condition.js +500 -0
- package/dist/definition.d.ts +62 -24
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +703 -138
- package/dist/divide.d.ts.map +1 -1
- package/dist/divide.js +18 -8
- package/dist/document.d.ts +10 -2
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +370 -114
- package/dist/fields.d.ts +2 -0
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +7 -0
- package/dist/index.d.ts +14 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/links.d.ts +2 -0
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +23 -12
- package/dist/paths.d.ts +4 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +110 -10
- package/dist/project.d.ts +1 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +52 -30
- package/dist/references.d.ts +4 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +25 -0
- package/dist/schema.d.ts +7 -6
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +157 -31
- package/dist/types.d.ts +43 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +6 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +167 -144
- package/dist/yaml.d.ts +8 -3
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +133 -43
- package/fixtures/README.md +49 -38
- package/fixtures/cases/absent-link-dangles/context.json +1 -0
- package/fixtures/cases/absent-link-dangles/expected.json +1 -0
- package/fixtures/cases/absent-link-dangles/library/item.md +8 -0
- package/fixtures/cases/absent-link-dangles/schema.yaml +6 -0
- package/fixtures/cases/absent-optional-field/context.json +1 -0
- package/fixtures/cases/absent-optional-field/expected.json +1 -0
- package/fixtures/cases/absent-optional-field/library/companies/acme.md +4 -0
- package/fixtures/cases/absent-optional-field/library/deals/lead.md +6 -0
- package/fixtures/cases/absent-optional-field/schema.yaml +56 -0
- package/fixtures/cases/absolute-link/context.json +1 -0
- package/fixtures/cases/{missing-binary-image → absolute-link}/expected.json +1 -1
- package/fixtures/cases/absolute-link/library/item.md +8 -0
- package/fixtures/cases/absolute-link/schema.yaml +6 -0
- package/fixtures/cases/attachment-reference-any-file/context.json +1 -0
- package/fixtures/cases/attachment-reference-any-file/expected.json +1 -0
- package/fixtures/cases/attachment-reference-any-file/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/deals/renewal.md +15 -0
- package/fixtures/cases/attachment-reference-any-file/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/schema.yaml +32 -0
- package/fixtures/cases/attachment-reference-dangles/context.json +1 -0
- package/fixtures/cases/attachment-reference-dangles/expected.json +1 -0
- package/fixtures/cases/attachment-reference-dangles/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/deals/renewal.md +15 -0
- package/fixtures/cases/attachment-reference-dangles/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/schema.yaml +32 -0
- package/fixtures/cases/attachment-reference-outside/context.json +1 -0
- package/fixtures/cases/attachment-reference-outside/expected.json +6 -0
- package/fixtures/cases/attachment-reference-outside/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/deals/renewal.md +15 -0
- package/fixtures/cases/attachment-reference-outside/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-outside/schema.yaml +32 -0
- package/fixtures/cases/binary-any-reference/expected.json +1 -1
- package/fixtures/cases/binary-any-reference/schema.yaml +4 -4
- package/fixtures/cases/binary-document-collision/schema.yaml +1 -2
- package/fixtures/cases/binary-image-dangles/expected.json +1 -0
- package/fixtures/cases/binary-image-dangles/schema.yaml +1 -0
- package/fixtures/cases/binary-link-dangles/expected.json +1 -0
- package/fixtures/cases/binary-link-dangles/schema.yaml +1 -0
- package/fixtures/cases/binary-link-outside-collection/schema.yaml +1 -2
- package/fixtures/cases/binary-prototype-reference/expected.json +1 -1
- package/fixtures/cases/binary-prototype-reference/schema.yaml +4 -4
- package/fixtures/cases/binary-typed-reference/expected.json +1 -1
- package/fixtures/cases/binary-typed-reference/schema.yaml +5 -5
- package/fixtures/cases/boolean-field/context.json +1 -0
- package/fixtures/cases/boolean-field/expected.json +6 -0
- package/fixtures/cases/boolean-field/library/companies/acme.md +4 -0
- package/fixtures/cases/boolean-field/library/deals/renewal.md +31 -0
- package/fixtures/cases/boolean-field/schema.yaml +56 -0
- package/fixtures/cases/bracketed-link-definition/schema.yaml +6 -6
- package/fixtures/cases/closed-nested-object/context.json +1 -0
- package/fixtures/cases/closed-nested-object/expected.json +6 -0
- package/fixtures/cases/closed-nested-object/library/companies/acme.md +4 -0
- package/fixtures/cases/closed-nested-object/library/deals/renewal.md +32 -0
- package/fixtures/cases/closed-nested-object/schema.yaml +56 -0
- package/fixtures/cases/composed-root-reference/context.json +1 -0
- package/fixtures/cases/composed-root-reference/expected.json +6 -0
- package/fixtures/cases/composed-root-reference/library/a.md +5 -0
- package/fixtures/cases/composed-root-reference/schema.yaml +13 -0
- package/fixtures/cases/date-time-format/context.json +1 -0
- package/fixtures/cases/date-time-format/expected.json +6 -0
- package/fixtures/cases/date-time-format/library/companies/acme.md +4 -0
- package/fixtures/cases/date-time-format/library/deals/renewal.md +31 -0
- package/fixtures/cases/date-time-format/schema.yaml +56 -0
- package/fixtures/cases/declared-binary-links/schema.yaml +1 -2
- package/fixtures/cases/default-unfilled/context.json +1 -0
- package/fixtures/cases/default-unfilled/expected.json +6 -0
- package/fixtures/cases/default-unfilled/library/companies/acme.md +4 -0
- package/fixtures/cases/default-unfilled/library/deals/renewal.md +29 -0
- package/fixtures/cases/default-unfilled/schema.yaml +56 -0
- package/fixtures/cases/defs-pattern/context.json +1 -0
- package/fixtures/cases/defs-pattern/expected.json +6 -0
- package/fixtures/cases/defs-pattern/library/companies/acme.md +4 -0
- package/fixtures/cases/defs-pattern/library/deals/renewal.md +31 -0
- package/fixtures/cases/defs-pattern/schema.yaml +56 -0
- package/fixtures/cases/dependent-rule/context.json +1 -0
- package/fixtures/cases/dependent-rule/expected.json +6 -0
- package/fixtures/cases/dependent-rule/library/companies/acme.md +4 -0
- package/fixtures/cases/dependent-rule/library/deals/renewal.md +30 -0
- package/fixtures/cases/dependent-rule/schema.yaml +56 -0
- package/fixtures/cases/duplicate-link-definition/schema.yaml +6 -6
- package/fixtures/cases/email-format/context.json +1 -0
- package/fixtures/cases/email-format/expected.json +6 -0
- package/fixtures/cases/email-format/library/companies/acme.md +4 -0
- package/fixtures/cases/email-format/library/deals/renewal.md +31 -0
- package/fixtures/cases/email-format/schema.yaml +56 -0
- package/fixtures/cases/fenced-link-definition/schema.yaml +6 -6
- package/fixtures/cases/field-enum/expected.json +2 -2
- package/fixtures/cases/field-enum/schema.yaml +7 -7
- package/fixtures/cases/frontmatter-schema/schema.yaml +3 -4
- package/fixtures/cases/integer-field/context.json +1 -0
- package/fixtures/cases/integer-field/expected.json +6 -0
- package/fixtures/cases/integer-field/library/companies/acme.md +4 -0
- package/fixtures/cases/integer-field/library/deals/renewal.md +31 -0
- package/fixtures/cases/integer-field/schema.yaml +56 -0
- package/fixtures/cases/interrupted-link-definition/schema.yaml +1 -2
- package/fixtures/cases/json-schema-constructs/context.json +1 -0
- package/fixtures/cases/json-schema-constructs/expected.json +1 -0
- package/fixtures/cases/json-schema-constructs/library/companies/acme.md +4 -0
- package/fixtures/cases/json-schema-constructs/library/deals/renewal.md +31 -0
- package/fixtures/cases/json-schema-constructs/schema.yaml +56 -0
- package/fixtures/cases/list-of-objects-closed/context.json +1 -0
- package/fixtures/cases/list-of-objects-closed/expected.json +6 -0
- package/fixtures/cases/list-of-objects-closed/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-closed/library/deals/renewal.md +32 -0
- package/fixtures/cases/list-of-objects-closed/schema.yaml +56 -0
- package/fixtures/cases/list-of-objects-item/context.json +1 -0
- package/fixtures/cases/list-of-objects-item/expected.json +6 -0
- package/fixtures/cases/list-of-objects-item/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-item/library/deals/renewal.md +31 -0
- package/fixtures/cases/list-of-objects-item/schema.yaml +56 -0
- package/fixtures/cases/list-of-objects-reference/context.json +1 -0
- package/fixtures/cases/list-of-objects-reference/expected.json +6 -0
- package/fixtures/cases/list-of-objects-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/deals/renewal.md +14 -0
- package/fixtures/cases/list-of-objects-reference/library/places/depot.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/products/seats.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/products/support.md +4 -0
- package/fixtures/cases/list-of-objects-reference/schema.yaml +32 -0
- package/fixtures/cases/list-size/context.json +1 -0
- package/fixtures/cases/list-size/expected.json +6 -0
- package/fixtures/cases/list-size/library/companies/acme.md +4 -0
- package/fixtures/cases/list-size/library/deals/renewal.md +31 -0
- package/fixtures/cases/list-size/schema.yaml +56 -0
- package/fixtures/cases/long-fence-link-definition/schema.yaml +1 -2
- package/fixtures/cases/malformed-definition/expected.json +2 -2
- package/fixtures/cases/malformed-definition/schema.yaml +3 -4
- package/fixtures/cases/member-document/schema.yaml +5 -5
- package/fixtures/cases/missing-required-field/expected.json +2 -2
- package/fixtures/cases/missing-required-field/schema.yaml +7 -7
- package/fixtures/cases/missing-section-item-kind/expected.json +2 -2
- package/fixtures/cases/missing-section-item-kind/schema.yaml +6 -6
- package/fixtures/cases/misspelled-key/context.json +1 -0
- package/fixtures/cases/misspelled-key/expected.json +6 -0
- package/fixtures/cases/misspelled-key/library/companies/acme.md +4 -0
- package/fixtures/cases/misspelled-key/library/deals/renewal.md +32 -0
- package/fixtures/cases/misspelled-key/schema.yaml +56 -0
- package/fixtures/cases/nested-defs/context.json +1 -0
- package/fixtures/cases/nested-defs/expected.json +6 -0
- package/fixtures/cases/nested-defs/library/deal.md +6 -0
- package/fixtures/cases/nested-defs/schema.yaml +11 -0
- package/fixtures/cases/nested-object-reference/context.json +1 -0
- package/fixtures/cases/nested-object-reference/expected.json +6 -0
- package/fixtures/cases/nested-object-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-object-reference/library/deals/renewal.md +14 -0
- package/fixtures/cases/nested-object-reference/library/places/depot.md +4 -0
- package/fixtures/cases/nested-object-reference/library/products/seats.md +4 -0
- package/fixtures/cases/nested-object-reference/library/products/support.md +4 -0
- package/fixtures/cases/nested-object-reference/schema.yaml +32 -0
- package/fixtures/cases/nested-reference/context.json +1 -0
- package/fixtures/cases/nested-reference/expected.json +1 -0
- package/fixtures/cases/nested-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-reference/library/deals/renewal.md +15 -0
- package/fixtures/cases/nested-reference/library/places/depot.md +4 -0
- package/fixtures/cases/nested-reference/library/products/seats.md +4 -0
- package/fixtures/cases/nested-reference/library/products/support.md +4 -0
- package/fixtures/cases/nested-reference/schema.yaml +32 -0
- package/fixtures/cases/nested-required-field/context.json +1 -0
- package/fixtures/cases/nested-required-field/expected.json +6 -0
- package/fixtures/cases/nested-required-field/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-required-field/library/deals/renewal.md +30 -0
- package/fixtures/cases/nested-required-field/schema.yaml +56 -0
- package/fixtures/cases/null-refused/context.json +1 -0
- package/fixtures/cases/null-refused/expected.json +6 -0
- package/fixtures/cases/null-refused/library/companies/acme.md +4 -0
- package/fixtures/cases/null-refused/library/deals/renewal.md +31 -0
- package/fixtures/cases/null-refused/schema.yaml +56 -0
- package/fixtures/cases/numeric-range/context.json +1 -0
- package/fixtures/cases/numeric-range/expected.json +6 -0
- package/fixtures/cases/numeric-range/library/companies/acme.md +4 -0
- package/fixtures/cases/numeric-range/library/deals/renewal.md +31 -0
- package/fixtures/cases/numeric-range/schema.yaml +56 -0
- package/fixtures/cases/one-of-variant/context.json +1 -0
- package/fixtures/cases/one-of-variant/expected.json +6 -0
- package/fixtures/cases/one-of-variant/library/companies/acme.md +4 -0
- package/fixtures/cases/one-of-variant/library/deals/renewal.md +31 -0
- package/fixtures/cases/one-of-variant/schema.yaml +56 -0
- package/fixtures/cases/open-map-value/context.json +1 -0
- package/fixtures/cases/open-map-value/expected.json +6 -0
- package/fixtures/cases/open-map-value/library/companies/acme.md +4 -0
- package/fixtures/cases/open-map-value/library/deals/renewal.md +31 -0
- package/fixtures/cases/open-map-value/schema.yaml +56 -0
- package/fixtures/cases/other-room-reference/context.json +1 -0
- package/fixtures/cases/other-room-reference/expected.json +6 -0
- package/fixtures/cases/other-room-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/other-room-reference/library/deals/renewal.md +14 -0
- package/fixtures/cases/other-room-reference/library/places/depot.md +4 -0
- package/fixtures/cases/other-room-reference/library/products/seats.md +4 -0
- package/fixtures/cases/other-room-reference/library/products/support.md +4 -0
- package/fixtures/cases/other-room-reference/schema.yaml +32 -0
- package/fixtures/cases/paragraph-link-definition/schema.yaml +1 -2
- package/fixtures/cases/prototype-field/expected.json +1 -1
- package/fixtures/cases/prototype-field/schema.yaml +6 -6
- package/fixtures/cases/quoted-link-definition/library/notes/draft.md +1 -1
- package/fixtures/cases/quoted-link-definition/schema.yaml +1 -2
- package/fixtures/cases/referenced-missing-file/schema.yaml +11 -10
- package/fixtures/cases/remote-ref/context.json +1 -0
- package/fixtures/cases/remote-ref/expected.json +5 -0
- package/fixtures/cases/remote-ref/schema.yaml +3 -0
- package/fixtures/cases/second-member-document/expected.json +2 -2
- package/fixtures/cases/second-member-document/schema.yaml +4 -5
- package/fixtures/cases/section-item-enum/schema.yaml +3 -4
- package/fixtures/cases/section-item-kind/schema.yaml +3 -4
- package/fixtures/cases/section-items/library/page.md +14 -0
- package/fixtures/cases/section-items/schema.yaml +10 -8
- package/fixtures/cases/section-reference-path/schema.yaml +3 -4
- package/fixtures/cases/section-reference-type/schema.yaml +3 -4
- package/fixtures/cases/shortcut-reference-link/library/item.md +1 -1
- package/fixtures/cases/shortcut-reference-link/schema.yaml +6 -6
- package/fixtures/cases/string-length/context.json +1 -0
- package/fixtures/cases/string-length/expected.json +6 -0
- package/fixtures/cases/string-length/library/companies/acme.md +4 -0
- package/fixtures/cases/string-length/library/deals/renewal.md +31 -0
- package/fixtures/cases/string-length/schema.yaml +56 -0
- package/fixtures/cases/structured-section/schema.yaml +7 -7
- package/fixtures/cases/submission-keys/schema.yaml +4 -4
- package/fixtures/cases/text-field-kind/expected.json +2 -2
- package/fixtures/cases/text-field-kind/schema.yaml +4 -4
- package/fixtures/cases/truncated-link-definition/library/notes/draft.md +1 -1
- package/fixtures/cases/truncated-link-definition/schema.yaml +1 -2
- package/fixtures/cases/types-folder-content/schema.yaml +4 -4
- package/fixtures/cases/undeclared-field/expected.json +1 -1
- package/fixtures/cases/undeclared-field/schema.yaml +6 -6
- package/fixtures/cases/unevaluated-items-closed/context.json +1 -0
- package/fixtures/cases/unevaluated-items-closed/expected.json +6 -0
- package/fixtures/cases/unevaluated-items-closed/library/trip.md +6 -0
- package/fixtures/cases/unevaluated-items-closed/schema.yaml +10 -0
- package/fixtures/cases/unknown-type/expected.json +1 -1
- package/fixtures/cases/unknown-type/schema.yaml +3 -4
- package/fixtures/cases/unlisted-reference-type/expected.json +2 -2
- package/fixtures/cases/unlisted-reference-type/schema.yaml +3 -4
- package/fixtures/cases/unresolved-link/library/item.md +1 -1
- package/fixtures/cases/unresolved-link/schema.yaml +6 -6
- package/fixtures/cases/valid-typed-document/schema.yaml +16 -15
- package/fixtures/cases/wide-item-fence-link/schema.yaml +1 -2
- package/fixtures/division.json +1 -1
- package/fixtures/projection.json +33 -1
- package/package.json +4 -2
- package/fixtures/cases/missing-binary-image/schema.yaml +0 -2
- package/fixtures/cases/missing-binary-link/expected.json +0 -5
- package/fixtures/cases/missing-binary-link/schema.yaml +0 -2
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/library/notes/draft.md +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/library/notes/draft.md +0 -0
package/dist/schema.js
CHANGED
|
@@ -1,37 +1,163 @@
|
|
|
1
1
|
import { Validator } from '@cfworker/json-schema';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
import { escapePointer, refTarget } from './definition.js';
|
|
3
|
+
import { MEMBER_FIELD, RECEIVED_FIELD, SITE_FIELD, TYPE_FIELD } from './fields.js';
|
|
4
|
+
import { interpretPlain, isRecord } from './yaml.js';
|
|
5
|
+
const STANDING_MAPS = ['properties', 'patternProperties'];
|
|
6
|
+
const STANDING = [
|
|
7
|
+
'additionalProperties',
|
|
8
|
+
'unevaluatedProperties',
|
|
9
|
+
'items',
|
|
10
|
+
'unevaluatedItems',
|
|
11
|
+
'contains',
|
|
12
|
+
];
|
|
13
|
+
const STANDING_LISTS = ['prefixItems'];
|
|
14
|
+
const IN_PLACE = ['if', 'then', 'else'];
|
|
15
|
+
const IN_PLACE_LISTS = ['allOf', 'anyOf', 'oneOf'];
|
|
16
|
+
const IN_PLACE_MAPS = ['dependentSchemas'];
|
|
17
|
+
const PASSING = new Set([
|
|
18
|
+
'properties',
|
|
19
|
+
'patternProperties',
|
|
20
|
+
'$ref',
|
|
21
|
+
'items',
|
|
22
|
+
'prefixItems',
|
|
23
|
+
'unevaluatedItems',
|
|
24
|
+
'allOf',
|
|
25
|
+
'if',
|
|
26
|
+
'dependentSchemas',
|
|
27
|
+
]);
|
|
28
|
+
const OPENING = new Set(['additionalProperties', 'unevaluatedProperties']);
|
|
29
|
+
const REQUIRED = /required property "([\s\S]*)"\.$/u;
|
|
30
|
+
const compiled = new WeakMap();
|
|
31
|
+
function mapped(value, map) {
|
|
32
|
+
return Object.fromEntries(Object.entries(value).map(([key, held]) => [key, map(held)]));
|
|
33
|
+
}
|
|
34
|
+
function objectSchema(node) {
|
|
35
|
+
const type = node.type;
|
|
36
|
+
return (type === 'object' ||
|
|
37
|
+
(Array.isArray(type) && type.includes('object')) ||
|
|
38
|
+
node.properties !== undefined ||
|
|
39
|
+
node.patternProperties !== undefined);
|
|
40
|
+
}
|
|
41
|
+
function inPlaceChildren(node) {
|
|
42
|
+
return [
|
|
43
|
+
...IN_PLACE.map((key) => node[key]),
|
|
44
|
+
...IN_PLACE_LISTS.flatMap((key) => (Array.isArray(node[key]) ? node[key] : [])),
|
|
45
|
+
...IN_PLACE_MAPS.flatMap((key) => (isRecord(node[key]) ? Object.values(node[key]) : [])),
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
function objecty(node, defs, seen) {
|
|
49
|
+
if (!isRecord(node))
|
|
50
|
+
return false;
|
|
51
|
+
if (objectSchema(node))
|
|
52
|
+
return true;
|
|
53
|
+
if (typeof node.$ref === 'string') {
|
|
54
|
+
const target = refTarget(node.$ref, defs)?.node;
|
|
55
|
+
if (target !== undefined &&
|
|
56
|
+
!seen.has(target) &&
|
|
57
|
+
objecty(target, defs, new Set([...seen, target])))
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return inPlaceChildren(node).some((child) => objecty(child, defs, seen));
|
|
61
|
+
}
|
|
62
|
+
function closed(node, inPlace, defs, always = false) {
|
|
63
|
+
if (!isRecord(node))
|
|
64
|
+
return node;
|
|
65
|
+
const out = { ...node };
|
|
66
|
+
const standing = (held) => closed(held, false, defs);
|
|
67
|
+
const nested = (held) => closed(held, true, defs);
|
|
68
|
+
for (const key of STANDING_MAPS)
|
|
69
|
+
if (isRecord(node[key]))
|
|
70
|
+
out[key] = mapped(node[key], standing);
|
|
71
|
+
for (const key of STANDING)
|
|
72
|
+
if (node[key] !== undefined)
|
|
73
|
+
out[key] = standing(node[key]);
|
|
74
|
+
for (const key of STANDING_LISTS)
|
|
75
|
+
if (Array.isArray(node[key]))
|
|
76
|
+
out[key] = node[key].map(standing);
|
|
77
|
+
for (const key of IN_PLACE)
|
|
78
|
+
if (node[key] !== undefined)
|
|
79
|
+
out[key] = nested(node[key]);
|
|
80
|
+
for (const key of IN_PLACE_LISTS)
|
|
81
|
+
if (Array.isArray(node[key]))
|
|
82
|
+
out[key] = node[key].map(nested);
|
|
83
|
+
for (const key of IN_PLACE_MAPS)
|
|
84
|
+
if (isRecord(node[key]))
|
|
85
|
+
out[key] = mapped(node[key], nested);
|
|
86
|
+
if (isRecord(node.$defs))
|
|
87
|
+
out.$defs = mapped(node.$defs, nested);
|
|
88
|
+
if (!inPlace &&
|
|
89
|
+
node.additionalProperties === undefined &&
|
|
90
|
+
node.unevaluatedProperties === undefined &&
|
|
91
|
+
(always || objecty(node, defs, new Set())))
|
|
92
|
+
out.unevaluatedProperties = false;
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
function copied(value) {
|
|
96
|
+
return JSON.parse(JSON.stringify(value));
|
|
97
|
+
}
|
|
98
|
+
function compile(definition) {
|
|
99
|
+
const defs = copied(definition.shape.defs);
|
|
100
|
+
const { sections, member_document: _mark, ...root } = copied(definition.shape.schema);
|
|
101
|
+
const closedDefs = mapped(defs, (held) => closed(held, true, defs));
|
|
102
|
+
const declared = isRecord(root.properties) ? root.properties : {};
|
|
103
|
+
const properties = {
|
|
104
|
+
[TYPE_FIELD]: true,
|
|
105
|
+
[SITE_FIELD]: true,
|
|
106
|
+
[RECEIVED_FIELD]: true,
|
|
107
|
+
...(definition.memberDocument ? { [MEMBER_FIELD]: { type: 'string' } } : {}),
|
|
108
|
+
...declared,
|
|
109
|
+
};
|
|
110
|
+
const frontmatter = new Validator({ ...closed({ ...root, properties }, false, defs, true), $defs: closedDefs }, '2020-12', false);
|
|
111
|
+
const lists = new Map();
|
|
112
|
+
for (const [name, spec] of Object.entries(isRecord(sections) ? sections : {})) {
|
|
113
|
+
if (!isRecord(spec) || spec.kind !== 'list')
|
|
114
|
+
continue;
|
|
115
|
+
lists.set(name, new Validator({ ...closed(spec.items, false, defs), $defs: closedDefs }, '2020-12', false));
|
|
24
116
|
}
|
|
25
|
-
|
|
26
|
-
|
|
117
|
+
return { frontmatter, sections: lists };
|
|
118
|
+
}
|
|
119
|
+
function compiledOf(definition) {
|
|
120
|
+
const held = compiled.get(definition);
|
|
121
|
+
if (held !== undefined)
|
|
122
|
+
return held;
|
|
123
|
+
const made = compile(definition);
|
|
124
|
+
compiled.set(definition, made);
|
|
125
|
+
return made;
|
|
126
|
+
}
|
|
127
|
+
function pointer(location) {
|
|
128
|
+
return decodeURI(location.slice(1));
|
|
129
|
+
}
|
|
130
|
+
function refusalOf(errors) {
|
|
131
|
+
for (const [index, error] of errors.entries()) {
|
|
132
|
+
const next = errors[index + 1];
|
|
133
|
+
if (OPENING.has(error.keyword)) {
|
|
134
|
+
if (next?.keyword === 'false')
|
|
135
|
+
return { rule: 'undeclared-field', location: pointer(next.instanceLocation) };
|
|
136
|
+
if (next !== undefined)
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (PASSING.has(error.keyword) && next !== undefined)
|
|
27
140
|
continue;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return {
|
|
141
|
+
if (error.keyword === 'required') {
|
|
142
|
+
const missing = REQUIRED.exec(error.error)?.[1] ?? '';
|
|
143
|
+
return {
|
|
144
|
+
rule: 'required',
|
|
145
|
+
location: `${pointer(error.instanceLocation)}/${escapePointer(missing)}`,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
return { rule: error.keyword, location: pointer(error.instanceLocation) };
|
|
31
149
|
}
|
|
32
|
-
return
|
|
150
|
+
return { rule: 'schema', location: '' };
|
|
151
|
+
}
|
|
152
|
+
export function frontmatterRefusal(definition, fields) {
|
|
153
|
+
const result = compiledOf(definition).frontmatter.validate(fields);
|
|
154
|
+
return result.valid ? undefined : refusalOf(result.errors);
|
|
33
155
|
}
|
|
34
|
-
export function
|
|
35
|
-
const
|
|
36
|
-
|
|
156
|
+
export function fitsItem(definition, section, text) {
|
|
157
|
+
const spec = definition.sections[section];
|
|
158
|
+
const validator = compiledOf(definition).sections.get(section);
|
|
159
|
+
if (spec?.kind !== 'list' || validator === undefined)
|
|
160
|
+
return false;
|
|
161
|
+
const typed = spec.items.type === 'string' ? text : interpretPlain(text);
|
|
162
|
+
return validator.validate(typed).valid;
|
|
37
163
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -28,10 +28,12 @@ export type Extent = {
|
|
|
28
28
|
export type Span = Extent & {
|
|
29
29
|
readonly text: string;
|
|
30
30
|
};
|
|
31
|
-
export type
|
|
31
|
+
export type Frontmatter = {
|
|
32
32
|
readonly content: string;
|
|
33
33
|
readonly type: string | undefined;
|
|
34
34
|
readonly fields: Readonly<Record<string, unknown>>;
|
|
35
|
+
};
|
|
36
|
+
export type Document = Frontmatter & {
|
|
35
37
|
readonly preamble: string;
|
|
36
38
|
readonly sections: Readonly<Record<string, string>>;
|
|
37
39
|
};
|
|
@@ -41,6 +43,18 @@ export type Refusal = {
|
|
|
41
43
|
readonly location?: string;
|
|
42
44
|
readonly referrers?: readonly string[];
|
|
43
45
|
};
|
|
46
|
+
export type Reached = {
|
|
47
|
+
readonly target: string | null;
|
|
48
|
+
readonly to: readonly string[];
|
|
49
|
+
};
|
|
50
|
+
export type DocumentCheck = {
|
|
51
|
+
readonly ok: false;
|
|
52
|
+
} | {
|
|
53
|
+
readonly ok: true;
|
|
54
|
+
readonly type: string;
|
|
55
|
+
readonly typed: boolean;
|
|
56
|
+
readonly references: readonly Reached[];
|
|
57
|
+
};
|
|
44
58
|
export type Validation = {
|
|
45
59
|
readonly verdict: 'accept';
|
|
46
60
|
} | ({
|
|
@@ -60,6 +74,13 @@ export type Division = {
|
|
|
60
74
|
readonly ok: false;
|
|
61
75
|
readonly refusal: Refusal;
|
|
62
76
|
};
|
|
77
|
+
export type FrontmatterResult = {
|
|
78
|
+
readonly ok: true;
|
|
79
|
+
readonly frontmatter: Frontmatter;
|
|
80
|
+
} | {
|
|
81
|
+
readonly ok: false;
|
|
82
|
+
readonly refusal: Refusal;
|
|
83
|
+
};
|
|
63
84
|
export type ParseResult = {
|
|
64
85
|
readonly ok: true;
|
|
65
86
|
readonly document: Document;
|
|
@@ -71,6 +92,14 @@ export type Link = {
|
|
|
71
92
|
readonly href: string;
|
|
72
93
|
readonly target: string;
|
|
73
94
|
};
|
|
95
|
+
export type LinkOccurrence = Link & {
|
|
96
|
+
readonly start: number;
|
|
97
|
+
};
|
|
98
|
+
export type Reference = {
|
|
99
|
+
readonly pointer: string;
|
|
100
|
+
readonly value: string;
|
|
101
|
+
readonly to: readonly string[];
|
|
102
|
+
};
|
|
74
103
|
export type Change = {
|
|
75
104
|
readonly kind: 'field';
|
|
76
105
|
readonly name: string;
|
|
@@ -89,6 +118,11 @@ export type Change = {
|
|
|
89
118
|
readonly kind: 'link';
|
|
90
119
|
readonly href: string;
|
|
91
120
|
readonly to: string;
|
|
121
|
+
} | {
|
|
122
|
+
readonly kind: 'reference';
|
|
123
|
+
readonly pointer: string;
|
|
124
|
+
readonly value: string;
|
|
125
|
+
readonly prior: string;
|
|
92
126
|
};
|
|
93
127
|
export type ApplyResult = {
|
|
94
128
|
readonly outcome: 'applied';
|
|
@@ -96,6 +130,14 @@ export type ApplyResult = {
|
|
|
96
130
|
} | {
|
|
97
131
|
readonly outcome: 'stale';
|
|
98
132
|
readonly document: Document;
|
|
133
|
+
readonly stale: readonly number[];
|
|
134
|
+
} | {
|
|
135
|
+
readonly outcome: 'refuse';
|
|
136
|
+
readonly refusal: Refusal;
|
|
137
|
+
};
|
|
138
|
+
export type BodyResult = {
|
|
139
|
+
readonly outcome: 'applied';
|
|
140
|
+
readonly body: string;
|
|
99
141
|
} | {
|
|
100
142
|
readonly outcome: 'refuse';
|
|
101
143
|
readonly refusal: Refusal;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;CAAE,GAC7D;IACE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEN,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,aAAa,EAAE,SAAS,M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I,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEN,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,GAC5D;IACE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,GACD;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
package/dist/validate.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Definition } from './definition.js';
|
|
2
|
+
import type { DocumentCheck, Library, ModelVerification, Reached, Validation, ValidationContext, VerifiedModel } from './types.js';
|
|
3
|
+
export declare function resolves(reference: Reached, typeOf: (path: string) => string | undefined, binary: (path: string) => boolean): boolean;
|
|
2
4
|
export declare function verify(schema: string): ModelVerification;
|
|
5
|
+
export declare function checkDocument(file: string, content: string, model: VerifiedModel): DocumentCheck;
|
|
6
|
+
export declare function sectionReferences(file: string, content: string, definition: Definition): readonly Reached[];
|
|
7
|
+
export declare function validating(library: Library, context?: ValidationContext, model?: VerifiedModel): Generator<string, Validation, void>;
|
|
3
8
|
export declare function validate(library: Library, context?: ValidationContext, model?: VerifiedModel): Validation;
|
|
4
9
|
//# sourceMappingURL=validate.d.ts.map
|
package/dist/validate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAQzF,OAAO,KAAK,EAEV,aAAa,EAEb,OAAO,EACP,iBAAiB,EACjB,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,aAAa,EACd,MAAM,YAAY,CAAC;AA6CpB,wBAAgB,QAAQ,CACtB,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,EAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAChC,OAAO,CAET;AA8BD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAQxD;AA2DD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,aAAa,CAmBhG;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,GACrB,SAAS,OAAO,EAAE,CAgBpB;AAED,wBAAiB,UAAU,CACzB,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,iBAAyC,EAClD,KAAK,GAAE,aAA6B,GACnC,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAyDrC;AAED,wBAAgB,QAAQ,CACtB,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,iBAAyC,EAClD,KAAK,GAAE,aAA6B,GACnC,UAAU,CAKZ"}
|