@agentshouse/mdmodel 0.1.0-cd6a8e5bc7efc → 0.1.0-cdaa2262b2988
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 +108 -115
- package/README.md +15 -13
- package/dist/built-in.d.ts.map +1 -1
- package/dist/built-in.js +10 -1
- package/dist/definition.d.ts +10 -3
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +99 -21
- package/dist/document.d.ts +3 -2
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +113 -71
- package/dist/event.d.ts +4 -7
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +3 -2
- package/dist/facts.d.ts.map +1 -1
- package/dist/facts.js +8 -4
- package/dist/fields.d.ts +1 -1
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +2 -2
- package/dist/folders.d.ts +5 -0
- package/dist/folders.d.ts.map +1 -0
- package/dist/folders.js +19 -0
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +3 -2
- package/dist/house-model.d.ts +190 -24
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +99 -15
- package/dist/house-references/crockford.d.ts.map +1 -0
- package/dist/house-references/patterns.d.ts +13 -0
- package/dist/house-references/patterns.d.ts.map +1 -0
- package/dist/house-references/patterns.js +20 -0
- package/dist/index.d.ts +23 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -13
- package/dist/indexed.d.ts +10 -0
- package/dist/indexed.d.ts.map +1 -0
- package/dist/indexed.js +63 -0
- package/dist/kinds.d.ts +9 -1
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +68 -0
- package/dist/markdown.d.ts +0 -4
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +1 -34
- package/dist/media-type.d.ts +72 -0
- package/dist/media-type.d.ts.map +1 -0
- package/dist/media-type.js +157 -0
- package/dist/moment.d.ts +9 -0
- package/dist/moment.d.ts.map +1 -0
- package/dist/moment.js +40 -0
- package/dist/not-ready.d.ts +2 -0
- package/dist/not-ready.d.ts.map +1 -0
- package/dist/not-ready.js +5 -0
- package/dist/paths.d.ts +6 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +33 -3
- package/dist/query/language.d.ts +4 -1
- package/dist/query/language.d.ts.map +1 -1
- package/dist/query/language.js +8 -7
- package/dist/query/match.d.ts +1 -1
- package/dist/query/match.d.ts.map +1 -1
- package/dist/query/match.js +3 -24
- package/dist/query/rows.d.ts +6 -1
- package/dist/query/rows.d.ts.map +1 -1
- package/dist/query/rows.js +37 -8
- package/dist/query/sql.d.ts +10 -1
- package/dist/query/sql.d.ts.map +1 -1
- package/dist/query/sql.js +22 -3
- package/dist/query/walk.d.ts +73 -0
- package/dist/query/walk.d.ts.map +1 -0
- package/dist/query/walk.js +277 -0
- package/dist/references.d.ts +2 -2
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +1 -1
- package/dist/reserved.d.ts +1 -1
- package/dist/reserved.d.ts.map +1 -1
- package/dist/reserved.js +15 -6
- package/dist/room-types.d.ts +2 -1
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +19 -13
- package/dist/schema.d.ts +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +6 -7
- package/dist/types.d.ts +11 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +7 -3
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +108 -46
- package/dist/view.d.ts +5 -0
- package/dist/view.d.ts.map +1 -0
- package/dist/view.js +27 -0
- package/dist/yaml.d.ts +7 -5
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +154 -33
- package/fixtures/README.md +64 -57
- package/fixtures/cases/absent-link-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/absent-optional-field/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/absolute-link/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/attachment-reference-any-file/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/attachment-reference-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/attachment-reference-outside/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-any-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-document-collision/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-image-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-link-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-link-outside-collection/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-prototype-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-typed-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/block-scalar-frontmatter/expected.json +1 -0
- package/fixtures/cases/block-scalar-frontmatter/library/notes/literal.md +17 -0
- package/fixtures/cases/block-scalar-frontmatter/library/skills/notes/SKILL.md +10 -0
- package/fixtures/cases/boolean-field/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/{duplicate-link-definition/schema.yaml → bracketed-link-definition/schema.md} +2 -0
- package/fixtures/cases/closed-nested-object/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/composed-root-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/conditional-long-text/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/cross-room-link/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/cross-room-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/date-time-format/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/declared-binary-links/schema.md +3 -0
- package/fixtures/cases/default-unfilled/schema.md +57 -0
- package/fixtures/cases/defs-pattern/schema.md +57 -0
- package/fixtures/cases/dependent-rule/schema.md +57 -0
- package/fixtures/cases/{bracketed-link-definition/schema.yaml → duplicate-link-definition/schema.md} +2 -0
- package/fixtures/cases/email-format/schema.md +57 -0
- package/fixtures/cases/equal-labels/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/fenced-link-definition/schema.md +7 -0
- package/fixtures/cases/field-enum/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/context.json +1 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/expected.json +1 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/door.md +3 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/host.md +13 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/map.md +24 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/open.md +13 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/schema.md +9 -0
- package/fixtures/cases/folder-keeps-a-record/context.json +1 -0
- package/fixtures/cases/folder-keeps-a-record/expected.json +1 -0
- package/fixtures/cases/folder-keeps-a-record/library/tickets/2026-11-16-d_1.r.md +13 -0
- package/fixtures/cases/folder-keeps-a-record/library/tickets/door.md +3 -0
- package/fixtures/cases/folder-keeps-a-record/schema.md +9 -0
- package/fixtures/cases/folder-names-no-type-of-the-schema/context.json +1 -0
- package/fixtures/cases/folder-names-no-type-of-the-schema/expected.json +5 -0
- package/fixtures/cases/folder-names-no-type-of-the-schema/schema.md +7 -0
- package/fixtures/cases/folder-nearer-entry-types-a-document/context.json +1 -0
- package/fixtures/cases/folder-nearer-entry-types-a-document/expected.json +6 -0
- package/fixtures/cases/folder-nearer-entry-types-a-document/library/tickets/archive/2025/old.md +1 -0
- package/fixtures/cases/folder-nearer-entry-types-a-document/schema.md +15 -0
- package/fixtures/cases/folder-refuses-a-declared-any/context.json +1 -0
- package/fixtures/cases/folder-refuses-a-declared-any/expected.json +6 -0
- package/fixtures/cases/folder-refuses-a-declared-any/library/tickets/door.md +5 -0
- package/fixtures/cases/folder-refuses-a-declared-any/schema.md +9 -0
- package/fixtures/cases/folder-refuses-another-declared-type/context.json +1 -0
- package/fixtures/cases/folder-refuses-another-declared-type/expected.json +6 -0
- package/fixtures/cases/folder-refuses-another-declared-type/library/tickets/door.md +5 -0
- package/fixtures/cases/folder-refuses-another-declared-type/schema.md +12 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/context.json +1 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/expected.json +1 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/notes/plan.md +7 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/door.md +3 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/gate.md +7 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/schema.md +13 -0
- package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/context.json +1 -0
- package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/expected.json +6 -0
- package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/library/tickets/2026/gate.md +1 -0
- package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/schema.md +9 -0
- package/fixtures/cases/folder-types-a-document-that-names-no-type/context.json +1 -0
- package/fixtures/cases/folder-types-a-document-that-names-no-type/expected.json +7 -0
- package/fixtures/cases/folder-types-a-document-that-names-no-type/library/tickets/door.md +3 -0
- package/fixtures/cases/folder-types-a-document-that-names-no-type/schema.md +9 -0
- package/fixtures/cases/folder-under-a-reserved-name/context.json +1 -0
- package/fixtures/cases/folder-under-a-reserved-name/expected.json +5 -0
- package/fixtures/cases/folder-under-a-reserved-name/schema.md +7 -0
- package/fixtures/cases/folder-without-a-trailing-slash/context.json +1 -0
- package/fixtures/cases/folder-without-a-trailing-slash/expected.json +5 -0
- package/fixtures/cases/folder-without-a-trailing-slash/schema.md +7 -0
- package/fixtures/cases/frontmatter-construct/context.json +1 -0
- package/fixtures/cases/frontmatter-construct/expected.json +7 -0
- package/fixtures/cases/frontmatter-construct/library/note.md +6 -0
- package/fixtures/cases/integer-field/schema.md +57 -0
- package/fixtures/cases/interrupted-link-definition/schema.md +3 -0
- package/fixtures/cases/json-schema-constructs/schema.md +57 -0
- package/fixtures/cases/labels-in-the-rooms-language/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/lazy-list-item/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/link-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-item-enum/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-item-kind/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-items/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-of-objects-closed/schema.md +57 -0
- package/fixtures/cases/list-of-objects-item/schema.md +57 -0
- package/fixtures/cases/list-of-objects-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-reference-path/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-reference-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-size/schema.md +57 -0
- package/fixtures/cases/long-fence-link-definition/schema.md +3 -0
- package/fixtures/cases/long-value-past-six-levels/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/malformed-definition/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/malformed-list/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/member-document/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/member-on-another-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/missing-required-field/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/misspelled-key/schema.md +57 -0
- package/fixtures/cases/name-not-a-string/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/nested-defs/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/nested-object-reference/schema.md +34 -0
- package/fixtures/cases/nested-reference/schema.md +34 -0
- package/fixtures/cases/nested-required-field/schema.md +57 -0
- package/fixtures/cases/numeric-range/schema.md +57 -0
- package/fixtures/cases/one-key-two-labels/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/one-key-two-types/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/one-of-variant/schema.md +57 -0
- package/fixtures/cases/other-room-reference/schema.md +34 -0
- package/fixtures/cases/paragraph-link-definition/schema.md +3 -0
- package/fixtures/cases/prototype-field/schema.md +7 -0
- package/fixtures/cases/quoted-link-definition/schema.md +3 -0
- package/fixtures/cases/reference-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/reference-to-any-file-name/context.json +1 -0
- package/fixtures/cases/reference-to-any-file-name/expected.json +1 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/100%.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/C#.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/My notes.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/[draft].md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/c (d).md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/caf/303/251.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people//320/236/321/202/321/207/321/221/321/202.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/bracket.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/cyrillic.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/decomposed.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/hash.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/parenthesis.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/percent.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/spaced.md +9 -0
- package/fixtures/cases/{referenced-missing-file/schema.yaml → reference-to-any-file-name/schema.md} +2 -0
- package/fixtures/cases/referenced-missing-file/schema.md +12 -0
- package/fixtures/cases/referenced-missing-non-latin-file/context.json +1 -0
- package/fixtures/cases/referenced-missing-non-latin-file/expected.json +6 -0
- package/fixtures/cases/referenced-missing-non-latin-file/library/tasks/a.md +9 -0
- package/fixtures/cases/referenced-missing-non-latin-file/library/tasks/b.md +9 -0
- package/fixtures/cases/referenced-missing-non-latin-file/schema.md +12 -0
- package/fixtures/cases/remote-ref/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/schema-body-ignored/context.json +1 -0
- package/fixtures/cases/schema-body-ignored/expected.json +1 -0
- package/fixtures/cases/schema-body-ignored/schema.md +9 -0
- package/fixtures/cases/schema-type-named-folders/context.json +1 -0
- package/fixtures/cases/schema-type-named-folders/expected.json +5 -0
- package/fixtures/cases/schema-type-named-folders/schema.md +5 -0
- package/fixtures/cases/schema-type-named-type/context.json +1 -0
- package/fixtures/cases/schema-type-named-type/expected.json +5 -0
- package/fixtures/cases/{unknown-type/schema.yaml → schema-type-named-type/schema.md} +3 -1
- package/fixtures/cases/second-member-document/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/sections-keyword-refused/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/shortcut-reference-link/schema.md +7 -0
- package/fixtures/cases/string-length/schema.md +57 -0
- package/fixtures/cases/submission-keys/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/text-field-kind/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/thematic-break-ends-the-values/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/truncated-link-definition/schema.md +3 -0
- package/fixtures/cases/typed-path-names-another-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/typed-path-names-its-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/typed-path-names-no-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/types-folder-content/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/undeclared-field/schema.md +7 -0
- package/fixtures/cases/unevaluated-items-closed/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unique-in-app-schema/context.json +1 -0
- package/fixtures/cases/unique-in-app-schema/expected.json +5 -0
- package/fixtures/cases/unique-in-app-schema/schema.yaml +7 -0
- package/fixtures/cases/unique-indexed-field/context.json +1 -0
- package/fixtures/cases/unique-indexed-field/expected.json +1 -0
- package/fixtures/cases/unique-indexed-field/library/tickets/first.md +8 -0
- package/fixtures/cases/unique-indexed-field/library/tickets/second.md +8 -0
- package/fixtures/cases/unique-indexed-field/schema.md +9 -0
- package/fixtures/cases/unique-off-indexed-field/context.json +1 -0
- package/fixtures/cases/unique-off-indexed-field/expected.json +5 -0
- package/fixtures/cases/unique-off-indexed-field/schema.md +9 -0
- package/fixtures/cases/unlisted-reference-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unresolved-link/schema.md +7 -0
- package/fixtures/cases/valid-typed-document/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/wide-item-fence-link/schema.md +3 -0
- package/fixtures/forms.json +24 -0
- package/fixtures/preamble.json +4 -4
- package/fixtures/queries.json +1010 -2
- package/fixtures/references.json +15 -0
- package/package.json +2 -2
- package/dist/crockford.d.ts.map +0 -1
- package/dist/divide.d.ts +0 -3
- package/dist/divide.d.ts.map +0 -1
- package/dist/divide.js +0 -321
- package/dist/house-references.d.ts +0 -4
- package/dist/house-references.d.ts.map +0 -1
- package/dist/house-references.js +0 -7
- package/dist/project.d.ts +0 -22
- package/dist/project.d.ts.map +0 -1
- package/dist/project.js +0 -101
- package/fixtures/cases/declared-binary-links/schema.yaml +0 -1
- package/fixtures/cases/default-unfilled/schema.yaml +0 -55
- package/fixtures/cases/defs-pattern/schema.yaml +0 -55
- package/fixtures/cases/dependent-rule/schema.yaml +0 -55
- package/fixtures/cases/email-format/schema.yaml +0 -55
- package/fixtures/cases/fenced-link-definition/schema.yaml +0 -5
- package/fixtures/cases/frontmatter-schema/expected.json +0 -5
- package/fixtures/cases/integer-field/schema.yaml +0 -55
- package/fixtures/cases/interrupted-link-definition/schema.yaml +0 -1
- package/fixtures/cases/json-schema-constructs/schema.yaml +0 -55
- package/fixtures/cases/list-of-objects-closed/schema.yaml +0 -55
- package/fixtures/cases/list-of-objects-item/schema.yaml +0 -55
- package/fixtures/cases/list-size/schema.yaml +0 -55
- package/fixtures/cases/long-fence-link-definition/schema.yaml +0 -1
- package/fixtures/cases/misspelled-key/schema.yaml +0 -55
- package/fixtures/cases/nested-object-reference/schema.yaml +0 -32
- package/fixtures/cases/nested-reference/schema.yaml +0 -32
- package/fixtures/cases/nested-required-field/schema.yaml +0 -55
- package/fixtures/cases/numeric-range/schema.yaml +0 -55
- package/fixtures/cases/one-of-variant/schema.yaml +0 -55
- package/fixtures/cases/other-room-reference/schema.yaml +0 -32
- package/fixtures/cases/paragraph-link-definition/schema.yaml +0 -1
- package/fixtures/cases/prototype-field/schema.yaml +0 -5
- package/fixtures/cases/quoted-link-definition/schema.yaml +0 -1
- package/fixtures/cases/shortcut-reference-link/schema.yaml +0 -5
- package/fixtures/cases/string-length/schema.yaml +0 -55
- package/fixtures/cases/truncated-link-definition/schema.yaml +0 -1
- package/fixtures/cases/undeclared-field/schema.yaml +0 -5
- package/fixtures/cases/unresolved-link/schema.yaml +0 -5
- package/fixtures/cases/wide-item-fence-link/schema.yaml +0 -1
- package/fixtures/division.json +0 -454
- package/fixtures/projection.json +0 -358
- /package/dist/{crockford.d.ts → house-references/crockford.d.ts} +0 -0
- /package/dist/{crockford.js → house-references/crockford.js} +0 -0
- /package/fixtures/cases/{frontmatter-schema → block-scalar-frontmatter}/context.json +0 -0
- /package/fixtures/cases/{frontmatter-schema/schema.yaml → unknown-type/schema.md} +0 -0
package/dist/validate.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { ATTACHMENT, BUILT_IN_TYPE, readSchema, } from './definition.js';
|
|
2
2
|
import { linkDestinations, links, parse } from './document.js';
|
|
3
3
|
import { MEMBER_FIELD } from './fields.js';
|
|
4
|
+
import { RECORD_TYPE } from './house-model.js';
|
|
5
|
+
import { folderType, foldersFailure } from './folders.js';
|
|
4
6
|
import { formFailure } from './form.js';
|
|
7
|
+
import { indexedFailure, uniqueFailure } from './indexed.js';
|
|
5
8
|
import { hrefOccurrences, lineBreaks, lineNumber } from './markdown.js';
|
|
6
|
-
import { classifyHref, roomTarget } from './paths.js';
|
|
9
|
+
import { classifyHref, keyedLink, roomTarget } from './paths.js';
|
|
7
10
|
import { references } from './references.js';
|
|
8
11
|
import { isDocumentPath, ROOM_DESCRIPTION } from './reserved.js';
|
|
9
12
|
import { refusal } from './refuse.js';
|
|
10
|
-
import {
|
|
13
|
+
import { schemaRefusal } from './schema.js';
|
|
14
|
+
import { viewRefusal } from './view.js';
|
|
15
|
+
import { extractFrontmatter } from './yaml.js';
|
|
11
16
|
import { openPatternBudget, PatternTooCostly } from './pattern.js';
|
|
12
17
|
function refuse(file, rule, extra) {
|
|
13
18
|
return { verdict: 'refuse', ...refusal(file, rule, extra) };
|
|
@@ -36,8 +41,9 @@ function unmarkedMember(file, document, definition) {
|
|
|
36
41
|
? refuse(file, 'undeclared-field', { location: `/${MEMBER_FIELD}` })
|
|
37
42
|
: null;
|
|
38
43
|
}
|
|
39
|
-
function reservedLink(file, document, changed) {
|
|
40
|
-
return (
|
|
44
|
+
function reservedLink(file, document, typed, changed) {
|
|
45
|
+
return (typed !== undefined &&
|
|
46
|
+
typed !== RECORD_TYPE &&
|
|
41
47
|
isDocumentPath(file) &&
|
|
42
48
|
links(document, file).some((link) => !isDocumentPath(link.target) && (changed?.has(link.target) ?? true)));
|
|
43
49
|
}
|
|
@@ -70,12 +76,28 @@ function typedPathRefusal(file, document, typedPath) {
|
|
|
70
76
|
return refuse(file, 'unknown-type', { location: '/type' });
|
|
71
77
|
return typedPath.body && !HELD_TEXT.test(document.text) ? refuse(file, 'required-body') : null;
|
|
72
78
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
79
|
+
function undeclared(document) {
|
|
80
|
+
return document.fields.type === undefined || document.fields.type === null;
|
|
81
|
+
}
|
|
82
|
+
function folderRefusal(file, document, folder, model) {
|
|
83
|
+
const declared = document.type;
|
|
84
|
+
if (folder === undefined || declared === undefined || declared === folder)
|
|
85
|
+
return null;
|
|
86
|
+
return Object.hasOwn(model.types, declared) && model.types[declared].builtIn === true
|
|
87
|
+
? null
|
|
88
|
+
: refuse(file, 'folder-type', { location: '/type' });
|
|
89
|
+
}
|
|
90
|
+
function kindOf(document, typedPath, folder) {
|
|
91
|
+
if (typedPath !== undefined && !typedPath.named)
|
|
92
|
+
return typedPath.type;
|
|
93
|
+
return folder !== undefined && undeclared(document) ? folder : instanceType(document);
|
|
75
94
|
}
|
|
76
95
|
export function definitionAt(model, file, typedPaths) {
|
|
77
96
|
const typedPath = typedPathOf(file, typedPaths);
|
|
78
|
-
|
|
97
|
+
const folder = folderType(model, file);
|
|
98
|
+
return (type) => definitionOf(typedPath !== undefined && !typedPath.named
|
|
99
|
+
? typedPath.type
|
|
100
|
+
: (type ?? folder ?? BUILT_IN_TYPE), model);
|
|
79
101
|
}
|
|
80
102
|
function instanceType(document) {
|
|
81
103
|
const raw = document.fields.type;
|
|
@@ -85,23 +107,23 @@ function instanceType(document) {
|
|
|
85
107
|
return null;
|
|
86
108
|
return raw;
|
|
87
109
|
}
|
|
88
|
-
function reaches(reference, typeOf,
|
|
110
|
+
function reaches(reference, typeOf, isAttachment) {
|
|
89
111
|
if (reference.target === null)
|
|
90
112
|
return false;
|
|
91
113
|
if (reference.to.includes(ATTACHMENT))
|
|
92
114
|
return true;
|
|
93
|
-
if (
|
|
115
|
+
if (isAttachment(reference.target))
|
|
94
116
|
return false;
|
|
95
117
|
const held = typeOf(reference.target);
|
|
96
118
|
return held === undefined || reference.to.includes(held);
|
|
97
119
|
}
|
|
98
|
-
function missing(reference, typeOf,
|
|
120
|
+
function missing(reference, typeOf, isAttachment) {
|
|
99
121
|
if (reference.to.includes(ATTACHMENT) || reference.target === null)
|
|
100
122
|
return false;
|
|
101
|
-
return typeOf(reference.target) === undefined && !
|
|
123
|
+
return typeOf(reference.target) === undefined && !isAttachment(reference.target);
|
|
102
124
|
}
|
|
103
|
-
export function resolves(reference, typeOf,
|
|
104
|
-
return reaches(reference, typeOf,
|
|
125
|
+
export function resolves(reference, typeOf, isAttachment) {
|
|
126
|
+
return reaches(reference, typeOf, isAttachment) && !missing(reference, typeOf, isAttachment);
|
|
105
127
|
}
|
|
106
128
|
function schemaRefused(failure) {
|
|
107
129
|
return {
|
|
@@ -110,23 +132,50 @@ function schemaRefused(failure) {
|
|
|
110
132
|
...(failure.location === undefined ? {} : { location: failure.location }),
|
|
111
133
|
};
|
|
112
134
|
}
|
|
113
|
-
|
|
114
|
-
|
|
135
|
+
const NO_FRONTMATTER = { start: 0, end: 0 };
|
|
136
|
+
function frontmatterOf(document) {
|
|
137
|
+
const fence = extractFrontmatter(document);
|
|
138
|
+
if (fence.kind === 'none')
|
|
139
|
+
return NO_FRONTMATTER;
|
|
140
|
+
if (fence.kind === 'unclosed')
|
|
141
|
+
return { rule: 'schema-yaml', location: 'line 1' };
|
|
142
|
+
return { start: fence.yamlStart, end: fence.yamlEnd };
|
|
143
|
+
}
|
|
144
|
+
function verified(text, provided, { start, end }, document) {
|
|
145
|
+
const read = readSchema(text, provided, true, start, end);
|
|
115
146
|
if (!('types' in read))
|
|
116
147
|
return schemaRefused(read);
|
|
117
|
-
const failure = formFailure(read, provided)
|
|
148
|
+
const failure = formFailure(read, provided) ??
|
|
149
|
+
indexedFailure(read) ??
|
|
150
|
+
(document ? undefined : (uniqueFailure(read) ?? foldersFailure(read)));
|
|
118
151
|
return failure === undefined ? { verdict: 'accept', model: read } : schemaRefused(failure);
|
|
119
152
|
}
|
|
120
|
-
|
|
121
|
-
const read = readSchema(
|
|
153
|
+
function typesRead(text, provided, { start, end }) {
|
|
154
|
+
const read = readSchema(text, provided, false, start, end);
|
|
122
155
|
if ('types' in read)
|
|
123
156
|
return read;
|
|
124
157
|
throw new Error(`the schema reads as no types: ${read.rule} ${read.location ?? ''}`.trim());
|
|
125
158
|
}
|
|
126
|
-
function
|
|
159
|
+
export function verify(schema, provided) {
|
|
160
|
+
return verified(schema, provided, { start: 0, end: schema.length }, false);
|
|
161
|
+
}
|
|
162
|
+
export function readTypes(schema, provided) {
|
|
163
|
+
return typesRead(schema, provided, { start: 0, end: schema.length });
|
|
164
|
+
}
|
|
165
|
+
export function verifySchemaDocument(document, provided) {
|
|
166
|
+
const held = frontmatterOf(document);
|
|
167
|
+
return 'rule' in held ? schemaRefused(held) : verified(document, provided, held, true);
|
|
168
|
+
}
|
|
169
|
+
export function readSchemaDocument(document, provided) {
|
|
170
|
+
const held = frontmatterOf(document);
|
|
171
|
+
if ('rule' in held)
|
|
172
|
+
throw new Error(`the schema reads as no types: ${held.rule} ${held.location}`);
|
|
173
|
+
return typesRead(document, provided, held);
|
|
174
|
+
}
|
|
175
|
+
function structure(file, document, definition, model) {
|
|
127
176
|
if (definition === undefined)
|
|
128
177
|
return refuse(file, 'unknown-type', { location: '/type' });
|
|
129
|
-
const fieldFailure =
|
|
178
|
+
const fieldFailure = schemaRefusal(definition, document.fields) ?? viewRefusal(definition, document.fields, model);
|
|
130
179
|
if (fieldFailure !== undefined)
|
|
131
180
|
return placedRefusal(file, document, fieldFailure.rule, fieldFailure.location);
|
|
132
181
|
return unmarkedMember(file, document, definition);
|
|
@@ -148,7 +197,7 @@ function referred(file, href, to) {
|
|
|
148
197
|
: reference;
|
|
149
198
|
}
|
|
150
199
|
function crossing(file, href, crossRoom) {
|
|
151
|
-
return crossRoom === true && classifyHref(file, href).kind === 'room';
|
|
200
|
+
return (keyedLink(href) !== null || (crossRoom === true && classifyHref(file, href).kind === 'room'));
|
|
152
201
|
}
|
|
153
202
|
function definitionOf(kind, model) {
|
|
154
203
|
return kind === null || !Object.hasOwn(model.types, kind) ? undefined : model.types[kind];
|
|
@@ -159,19 +208,22 @@ export function checkDocument(file, content, model, context = {}) {
|
|
|
159
208
|
if (!parsed.ok)
|
|
160
209
|
return { ok: false };
|
|
161
210
|
const document = parsed.document;
|
|
162
|
-
const
|
|
211
|
+
const folder = folderType(model, file);
|
|
212
|
+
const typed = document.type ?? folder;
|
|
213
|
+
const type = typed ?? BUILT_IN_TYPE;
|
|
163
214
|
const typedPath = typedPathOf(file, context.typedPaths);
|
|
164
215
|
if (describedRoom(file, document) !== null ||
|
|
165
216
|
typedPathRefusal(file, document, typedPath) !== null ||
|
|
166
|
-
|
|
217
|
+
folderRefusal(file, document, folder, model) !== null ||
|
|
218
|
+
reservedLink(file, document, typed))
|
|
167
219
|
return { ok: false };
|
|
168
|
-
const kind = kindOf(document, typedPath);
|
|
220
|
+
const kind = kindOf(document, typedPath, folder);
|
|
169
221
|
if (kind === BUILT_IN_TYPE)
|
|
170
222
|
return unmarkedMember(file, document, undefined) === null
|
|
171
223
|
? { ok: true, type, typed: false, references: [] }
|
|
172
224
|
: { ok: false };
|
|
173
225
|
const definition = definitionOf(kind, model);
|
|
174
|
-
if (structure(file, document, definition) !== null ||
|
|
226
|
+
if (structure(file, document, definition, model) !== null ||
|
|
175
227
|
definition === undefined ||
|
|
176
228
|
!linked(file, document))
|
|
177
229
|
return { ok: false };
|
|
@@ -185,7 +237,7 @@ export function checkDocument(file, content, model, context = {}) {
|
|
|
185
237
|
function roomLinks(occurrences) {
|
|
186
238
|
const found = [];
|
|
187
239
|
for (const href of new Set(occurrences.map((occurrence) => occurrence.href))) {
|
|
188
|
-
const room = roomTarget(href);
|
|
240
|
+
const room = keyedLink(href) === null ? roomTarget(href) : null;
|
|
189
241
|
if (room !== null)
|
|
190
242
|
found.push({ kind: 'link', href, ...room });
|
|
191
243
|
}
|
|
@@ -194,12 +246,15 @@ function roomLinks(occurrences) {
|
|
|
194
246
|
export function bodyRoomLinks(body) {
|
|
195
247
|
return roomLinks(hrefOccurrences(body));
|
|
196
248
|
}
|
|
249
|
+
export function bodyKeyedLinks(body) {
|
|
250
|
+
return [...new Set(hrefOccurrences(body).map((occurrence) => occurrence.href))].flatMap((href) => keyedLink(href) ?? []);
|
|
251
|
+
}
|
|
197
252
|
export function roomReferences(document, definition) {
|
|
198
253
|
const found = roomLinks(linkDestinations(document));
|
|
199
254
|
if (definition === undefined)
|
|
200
255
|
return found;
|
|
201
256
|
for (const { pointer, value, to, crossRoom } of references(document, definition)) {
|
|
202
|
-
const room = roomTarget(value);
|
|
257
|
+
const room = keyedLink(value) === null ? roomTarget(value) : null;
|
|
203
258
|
if (room !== null)
|
|
204
259
|
found.push({
|
|
205
260
|
kind: 'field',
|
|
@@ -219,20 +274,24 @@ function placedAt(document, reference, location) {
|
|
|
219
274
|
const line = lineAt(document, location);
|
|
220
275
|
return line === undefined ? { reference, location } : { reference, location, line };
|
|
221
276
|
}
|
|
222
|
-
export function assess(file, parsed,
|
|
277
|
+
export function assess(file, parsed, attachment, model = { types: {} }, context = {}) {
|
|
223
278
|
const unread = { file, type: undefined, targets: [], structured: null, fields: [] };
|
|
224
|
-
if (
|
|
279
|
+
if (attachment)
|
|
225
280
|
return { ...unread, read: refuse(file, 'binary-target-document'), linked: true };
|
|
226
281
|
if (!parsed.ok)
|
|
227
282
|
return { ...unread, read: { verdict: 'refuse', ...parsed.refusal }, linked: true };
|
|
228
283
|
const document = parsed.document;
|
|
229
|
-
const
|
|
284
|
+
const folder = folderType(model, file);
|
|
285
|
+
const declared = document.type ?? folder;
|
|
286
|
+
const type = declared ?? BUILT_IN_TYPE;
|
|
230
287
|
const typed = { file, type, read: null, structured: null };
|
|
231
288
|
const typedPath = typedPathOf(file, context.typedPaths);
|
|
232
|
-
const described = describedRoom(file, document) ??
|
|
289
|
+
const described = describedRoom(file, document) ??
|
|
290
|
+
typedPathRefusal(file, document, typedPath) ??
|
|
291
|
+
folderRefusal(file, document, folder, model);
|
|
233
292
|
if (described !== null)
|
|
234
293
|
return { ...typed, targets: [], structured: described, fields: [], linked: true };
|
|
235
|
-
const kind = kindOf(document, typedPath);
|
|
294
|
+
const kind = kindOf(document, typedPath, folder);
|
|
236
295
|
if (kind === BUILT_IN_TYPE) {
|
|
237
296
|
const structured = unmarkedMember(file, document, undefined);
|
|
238
297
|
return {
|
|
@@ -240,12 +299,12 @@ export function assess(file, parsed, binary, model = { types: {} }, context = {}
|
|
|
240
299
|
targets: [],
|
|
241
300
|
structured,
|
|
242
301
|
fields: [],
|
|
243
|
-
linked: !reservedLink(file, document),
|
|
302
|
+
linked: !reservedLink(file, document, declared),
|
|
244
303
|
};
|
|
245
304
|
}
|
|
246
305
|
const definition = definitionOf(kind, model);
|
|
247
306
|
try {
|
|
248
|
-
return structured(file, typed, document, definition, context);
|
|
307
|
+
return structured(file, typed, document, declared, definition, model, context);
|
|
249
308
|
}
|
|
250
309
|
catch (error) {
|
|
251
310
|
if (!(error instanceof PatternTooCostly))
|
|
@@ -259,8 +318,8 @@ export function assess(file, parsed, binary, model = { types: {} }, context = {}
|
|
|
259
318
|
};
|
|
260
319
|
}
|
|
261
320
|
}
|
|
262
|
-
function structured(file, typed, document, definition, context) {
|
|
263
|
-
const refused = structure(file, document, definition);
|
|
321
|
+
function structured(file, typed, document, declared, definition, model, context) {
|
|
322
|
+
const refused = structure(file, document, definition, model);
|
|
264
323
|
if (refused !== null || definition === undefined) {
|
|
265
324
|
return { ...typed, targets: [], structured: refused, fields: [], linked: true };
|
|
266
325
|
}
|
|
@@ -277,7 +336,8 @@ function structured(file, typed, document, definition, context) {
|
|
|
277
336
|
...typed,
|
|
278
337
|
targets: [...targets],
|
|
279
338
|
fields,
|
|
280
|
-
linked:
|
|
339
|
+
linked: declared === RECORD_TYPE ||
|
|
340
|
+
(linked(file, document) && !reservedLink(file, document, declared)),
|
|
281
341
|
};
|
|
282
342
|
}
|
|
283
343
|
export function assessReferences(file, parsed, changed, model = { types: {} }, context = {}) {
|
|
@@ -293,7 +353,9 @@ export function assessReferences(file, parsed, changed, model = { types: {} }, c
|
|
|
293
353
|
if (!parsed.ok)
|
|
294
354
|
return unread;
|
|
295
355
|
const { document } = parsed;
|
|
296
|
-
const
|
|
356
|
+
const folder = folderType(model, file);
|
|
357
|
+
const declared = document.type ?? folder;
|
|
358
|
+
const definition = definitionOf(kindOf(document, typedPathOf(file, context.typedPaths), folder), model);
|
|
297
359
|
const fields = definition === undefined
|
|
298
360
|
? []
|
|
299
361
|
: references(document, definition).flatMap(({ pointer, value, to }) => {
|
|
@@ -309,10 +371,10 @@ export function assessReferences(file, parsed, changed, model = { types: {} }, c
|
|
|
309
371
|
}
|
|
310
372
|
return {
|
|
311
373
|
...unread,
|
|
312
|
-
type:
|
|
374
|
+
type: declared ?? BUILT_IN_TYPE,
|
|
313
375
|
targets: [...targets],
|
|
314
376
|
fields,
|
|
315
|
-
linked: !reservedLink(file, document, changed),
|
|
377
|
+
linked: !reservedLink(file, document, declared, changed),
|
|
316
378
|
};
|
|
317
379
|
}
|
|
318
380
|
export function verdicts() {
|
|
@@ -321,7 +383,7 @@ export function verdicts() {
|
|
|
321
383
|
let referred;
|
|
322
384
|
let missed;
|
|
323
385
|
return {
|
|
324
|
-
add(assessment, typeOf,
|
|
386
|
+
add(assessment, typeOf, isAttachment) {
|
|
325
387
|
const { file } = assessment;
|
|
326
388
|
if (assessment.read !== null) {
|
|
327
389
|
read = least(read, file, assessment.read);
|
|
@@ -331,7 +393,7 @@ export function verdicts() {
|
|
|
331
393
|
structured = least(structured, file, assessment.structured);
|
|
332
394
|
return 0;
|
|
333
395
|
}
|
|
334
|
-
const field = assessment.fields.find(({ reference }) => !reaches(reference, typeOf,
|
|
396
|
+
const field = assessment.fields.find(({ reference }) => !reaches(reference, typeOf, isAttachment));
|
|
335
397
|
if (field !== undefined) {
|
|
336
398
|
referred = least(referred, file, refuse(file, 'unresolved-reference', {
|
|
337
399
|
location: field.location,
|
|
@@ -344,7 +406,7 @@ export function verdicts() {
|
|
|
344
406
|
return 0;
|
|
345
407
|
}
|
|
346
408
|
for (const { reference } of assessment.fields) {
|
|
347
|
-
if (!missing(reference, typeOf,
|
|
409
|
+
if (!missing(reference, typeOf, isAttachment))
|
|
348
410
|
continue;
|
|
349
411
|
const path = reference.target;
|
|
350
412
|
if (missed === undefined || path < missed.path)
|
|
@@ -376,13 +438,13 @@ export function* validating(library, context = { binaryTargets: [] }, model = {
|
|
|
376
438
|
}
|
|
377
439
|
function* judging(library, context, model) {
|
|
378
440
|
const binaryTargets = new Set(context.binaryTargets);
|
|
379
|
-
const
|
|
441
|
+
const isAttachment = (path) => binaryTargets.has(path);
|
|
380
442
|
const types = new Map();
|
|
381
443
|
const assessments = [];
|
|
382
444
|
const closeBudget = openPatternBudget();
|
|
383
445
|
try {
|
|
384
446
|
for (const [file, parsed] of library) {
|
|
385
|
-
const assessment = assess(file, parsed,
|
|
447
|
+
const assessment = assess(file, parsed, isAttachment(file), model, context);
|
|
386
448
|
if (assessment.type !== undefined)
|
|
387
449
|
types.set(file, assessment.type);
|
|
388
450
|
assessments.push(assessment);
|
|
@@ -390,7 +452,7 @@ function* judging(library, context, model) {
|
|
|
390
452
|
}
|
|
391
453
|
const judged = verdicts();
|
|
392
454
|
for (const assessment of assessments) {
|
|
393
|
-
const resolved = judged.add(assessment, (path) => types.get(path),
|
|
455
|
+
const resolved = judged.add(assessment, (path) => types.get(path), isAttachment);
|
|
394
456
|
yield { path: assessment.file, resolved };
|
|
395
457
|
}
|
|
396
458
|
return judged.verdict();
|
package/dist/view.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Definition } from './definition.js';
|
|
2
|
+
import type { SchemaRefusal } from './schema.js';
|
|
3
|
+
import type { VerifiedModel } from './types.js';
|
|
4
|
+
export declare function viewRefusal(definition: Definition, fields: Readonly<Record<string, unknown>>, model: VerifiedModel): SchemaRefusal | undefined;
|
|
5
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAShD,wBAAgB,WAAW,CACzB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,KAAK,EAAE,aAAa,GACnB,aAAa,GAAG,SAAS,CAgB3B"}
|
package/dist/view.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { escapePointer } from './definition.js';
|
|
2
|
+
import { planOf, QueryError } from './query/language.js';
|
|
3
|
+
import { VIEW_TYPE } from './room-types.js';
|
|
4
|
+
import { plain } from './yaml.js';
|
|
5
|
+
const QUERY = '/query';
|
|
6
|
+
function refused(location) {
|
|
7
|
+
return { rule: 'invalid-query', location };
|
|
8
|
+
}
|
|
9
|
+
export function viewRefusal(definition, fields, model) {
|
|
10
|
+
if (definition.name !== VIEW_TYPE)
|
|
11
|
+
return undefined;
|
|
12
|
+
const { query } = fields;
|
|
13
|
+
if (plain(query) && Object.hasOwn(query, 'rooms'))
|
|
14
|
+
return refused(`${QUERY}/rooms`);
|
|
15
|
+
try {
|
|
16
|
+
planOf(query, {
|
|
17
|
+
listed: true,
|
|
18
|
+
rooms: [{ locator: '', available: true, types: Object.values(model.types) }],
|
|
19
|
+
});
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (!(error instanceof QueryError))
|
|
24
|
+
throw error;
|
|
25
|
+
return refused(`${QUERY}${error.place.map((step) => `/${escapePointer(String(step))}`).join('')}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
package/dist/yaml.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
export type YamlConstruct = 'tab' | 'multi-line-scalar' | 'escape' | 'unheld-character' | 'block-scalar-header' | 'block-scalar-in-flow' | 'flow-collection' | 'mapping-entry' | 'duplicate-key' | 'indentation' | 'nesting';
|
|
1
2
|
export declare class YamlError extends Error {
|
|
2
3
|
readonly offset: number;
|
|
3
|
-
|
|
4
|
+
readonly construct: YamlConstruct;
|
|
5
|
+
constructor(offset: number, construct: YamlConstruct);
|
|
4
6
|
}
|
|
5
7
|
export type YamlScalar = {
|
|
6
8
|
readonly kind: 'scalar';
|
|
@@ -31,12 +33,12 @@ export declare function parseYamlMapping(text: string, start: number, end: numbe
|
|
|
31
33
|
export declare function jsValue(node: YamlNode): unknown;
|
|
32
34
|
export declare function mapEntry(map: YamlMap, key: string): YamlEntry | undefined;
|
|
33
35
|
export declare function isPlainSafe(text: string): boolean;
|
|
34
|
-
export type
|
|
35
|
-
readonly [name: string]:
|
|
36
|
+
export type DocumentValue = string | number | boolean | null | readonly DocumentValue[] | {
|
|
37
|
+
readonly [name: string]: DocumentValue;
|
|
36
38
|
};
|
|
37
39
|
export declare function plain(value: unknown): value is Record<string, unknown>;
|
|
38
|
-
export declare function
|
|
39
|
-
export declare function serializeJs(value:
|
|
40
|
+
export declare function documentValue(value: unknown): value is DocumentValue;
|
|
41
|
+
export declare function serializeJs(value: DocumentValue): string;
|
|
40
42
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
41
43
|
export declare function serializeKey(name: string): string;
|
|
42
44
|
export declare function bodyStartAfterYaml(content: string, yamlEnd: number): number;
|
package/dist/yaml.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAU,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"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"}
|