@agentshouse/mdmodel 0.1.0-c3c0e116a89f8 → 0.1.0-c420026daf4fc
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 +177 -194
- package/README.md +25 -25
- package/dist/body.d.ts +85 -0
- package/dist/body.d.ts.map +1 -0
- package/dist/body.js +1083 -0
- package/dist/built-in.d.ts +4 -0
- package/dist/built-in.d.ts.map +1 -0
- package/dist/built-in.js +19 -0
- package/dist/definition.d.ts +24 -11
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +205 -123
- package/dist/document.d.ts +11 -6
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +688 -105
- package/dist/event.d.ts +1 -2
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +2 -3
- package/dist/facts.d.ts.map +1 -1
- package/dist/facts.js +3 -2
- package/dist/fields.d.ts +1 -1
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +2 -2
- package/dist/form.d.ts +4 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +153 -0
- package/dist/house-model.d.ts +912 -0
- package/dist/house-model.d.ts.map +1 -0
- package/dist/house-model.js +502 -0
- package/dist/house-references/crockford.d.ts +4 -0
- package/dist/house-references/crockford.d.ts.map +1 -0
- package/dist/house-references/crockford.js +3 -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 +29 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -10
- package/dist/indexed.d.ts +9 -0
- package/dist/indexed.d.ts.map +1 -0
- package/dist/indexed.js +55 -0
- package/dist/kinds.d.ts +3 -0
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +60 -0
- package/dist/markdown.d.ts +27 -7
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +25 -64
- 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 +7 -0
- package/dist/moment.d.ts.map +1 -0
- package/dist/moment.js +18 -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 +16 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +102 -21
- package/dist/query/language.d.ts +4 -1
- package/dist/query/language.d.ts.map +1 -1
- package/dist/query/language.js +4 -3
- 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 +5 -1
- package/dist/query/rows.d.ts.map +1 -1
- package/dist/query/rows.js +23 -5
- package/dist/query/sql.d.ts +7 -1
- package/dist/query/sql.d.ts.map +1 -1
- package/dist/query/sql.js +14 -3
- package/dist/query/walk.d.ts +69 -0
- package/dist/query/walk.d.ts.map +1 -0
- package/dist/query/walk.js +274 -0
- package/dist/references.d.ts +2 -2
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +1 -1
- package/dist/refuse.d.ts +1 -0
- package/dist/refuse.d.ts.map +1 -1
- package/dist/refuse.js +1 -0
- package/dist/reserved.d.ts +1 -0
- package/dist/reserved.d.ts.map +1 -1
- package/dist/reserved.js +15 -4
- package/dist/room-types.d.ts +8 -0
- package/dist/room-types.d.ts.map +1 -0
- package/dist/room-types.js +144 -0
- package/dist/schema.d.ts +1 -3
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +9 -73
- package/dist/types.d.ts +13 -38
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +8 -2
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +132 -160
- 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 +85 -70
- package/fixtures/cases/absent-link-dangles/library/item.md +1 -1
- package/fixtures/cases/absent-link-dangles/schema.md +7 -0
- package/fixtures/cases/absent-optional-field/library/companies/acme.md +1 -1
- package/fixtures/cases/absent-optional-field/library/deals/lead.md +3 -3
- package/fixtures/cases/absent-optional-field/{schema.yaml → schema.md} +12 -11
- package/fixtures/cases/absolute-link/library/item.md +1 -1
- package/fixtures/cases/absolute-link/schema.md +7 -0
- package/fixtures/cases/attachment-reference-any-file/library/companies/acme.md +1 -1
- package/fixtures/cases/attachment-reference-any-file/library/deals/renewal.md +13 -10
- package/fixtures/cases/attachment-reference-any-file/library/places/depot.md +1 -1
- package/fixtures/cases/attachment-reference-any-file/library/products/seats.md +1 -1
- package/fixtures/cases/attachment-reference-any-file/library/products/support.md +1 -1
- package/fixtures/cases/attachment-reference-any-file/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/attachment-reference-dangles/library/companies/acme.md +1 -1
- package/fixtures/cases/attachment-reference-dangles/library/deals/renewal.md +13 -10
- package/fixtures/cases/attachment-reference-dangles/library/places/depot.md +1 -1
- package/fixtures/cases/attachment-reference-dangles/library/products/seats.md +1 -1
- package/fixtures/cases/attachment-reference-dangles/library/products/support.md +1 -1
- package/fixtures/cases/attachment-reference-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/attachment-reference-outside/expected.json +2 -1
- package/fixtures/cases/attachment-reference-outside/library/companies/acme.md +1 -1
- package/fixtures/cases/attachment-reference-outside/library/deals/renewal.md +13 -10
- package/fixtures/cases/attachment-reference-outside/library/places/depot.md +1 -1
- package/fixtures/cases/attachment-reference-outside/library/products/seats.md +1 -1
- package/fixtures/cases/attachment-reference-outside/library/products/support.md +1 -1
- package/fixtures/cases/attachment-reference-outside/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-any-reference/expected.json +2 -1
- package/fixtures/cases/binary-any-reference/library/notes/draft.md +1 -1
- 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/expected.json +2 -1
- package/fixtures/cases/binary-prototype-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-prototype-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-typed-reference/expected.json +2 -1
- package/fixtures/cases/binary-typed-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-typed-reference/{schema.yaml → schema.md} +2 -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/expected.json +2 -1
- package/fixtures/cases/boolean-field/library/companies/acme.md +1 -1
- package/fixtures/cases/boolean-field/library/deals/renewal.md +49 -24
- package/fixtures/cases/boolean-field/{schema.yaml → schema.md} +12 -11
- package/fixtures/cases/bracketed-link-definition/library/item.md +1 -1
- package/fixtures/cases/bracketed-link-definition/schema.md +7 -0
- package/fixtures/cases/closed-nested-object/expected.json +2 -1
- package/fixtures/cases/closed-nested-object/library/companies/acme.md +1 -1
- package/fixtures/cases/closed-nested-object/library/deals/renewal.md +50 -25
- package/fixtures/cases/closed-nested-object/{schema.yaml → schema.md} +12 -11
- package/fixtures/cases/composed-root-reference/library/a.md +2 -2
- package/fixtures/cases/composed-root-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/{conditional-section → conditional-long-text}/expected.json +3 -2
- package/fixtures/cases/{conditional-section → conditional-long-text}/library/questions/hosting.md +2 -2
- package/fixtures/cases/{conditional-section → conditional-long-text}/library/questions/payments.md +2 -2
- package/fixtures/cases/conditional-long-text/schema.md +15 -0
- package/fixtures/cases/cross-room-link/library/clients/acme.md +1 -1
- package/fixtures/cases/cross-room-link/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/cross-room-reference/library/clients/acme.md +4 -4
- package/fixtures/cases/cross-room-reference/{schema.yaml → schema.md} +3 -2
- package/fixtures/cases/date-time-format/expected.json +2 -1
- package/fixtures/cases/date-time-format/library/companies/acme.md +1 -1
- package/fixtures/cases/date-time-format/library/deals/renewal.md +49 -24
- package/fixtures/cases/date-time-format/{schema.yaml → schema.md} +12 -11
- package/fixtures/cases/declared-binary-links/schema.md +3 -0
- package/fixtures/cases/default-unfilled/library/companies/acme.md +1 -1
- package/fixtures/cases/default-unfilled/library/deals/renewal.md +47 -22
- package/fixtures/cases/default-unfilled/schema.md +57 -0
- package/fixtures/cases/defs-pattern/expected.json +2 -1
- package/fixtures/cases/defs-pattern/library/companies/acme.md +1 -1
- package/fixtures/cases/defs-pattern/library/deals/renewal.md +49 -24
- package/fixtures/cases/defs-pattern/schema.md +57 -0
- package/fixtures/cases/dependent-rule/library/companies/acme.md +1 -1
- package/fixtures/cases/dependent-rule/library/deals/renewal.md +48 -23
- package/fixtures/cases/dependent-rule/schema.md +57 -0
- package/fixtures/cases/duplicate-link-definition/library/item.md +1 -1
- package/fixtures/cases/duplicate-link-definition/schema.md +7 -0
- package/fixtures/cases/email-format/expected.json +2 -1
- package/fixtures/cases/email-format/library/companies/acme.md +1 -1
- package/fixtures/cases/email-format/library/deals/renewal.md +49 -24
- package/fixtures/cases/email-format/schema.md +57 -0
- package/fixtures/cases/equal-labels/expected.json +5 -0
- package/fixtures/cases/equal-labels/schema.md +6 -0
- package/fixtures/cases/fenced-link-definition/library/item.md +1 -1
- package/fixtures/cases/fenced-link-definition/schema.md +7 -0
- package/fixtures/cases/field-enum/expected.json +2 -1
- package/fixtures/cases/field-enum/library/item.md +2 -2
- package/fixtures/cases/field-enum/schema.md +8 -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/expected.json +2 -1
- package/fixtures/cases/integer-field/library/companies/acme.md +1 -1
- package/fixtures/cases/integer-field/library/deals/renewal.md +49 -24
- 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/library/companies/acme.md +1 -1
- package/fixtures/cases/json-schema-constructs/library/deals/renewal.md +49 -24
- package/fixtures/cases/json-schema-constructs/schema.md +57 -0
- package/fixtures/cases/labels-in-the-rooms-language/expected.json +1 -0
- package/fixtures/cases/labels-in-the-rooms-language/library/deals/atlas.md +7 -0
- package/fixtures/cases/labels-in-the-rooms-language/schema.md +11 -0
- package/fixtures/cases/lazy-list-item/library/item.md +3 -1
- package/fixtures/cases/lazy-list-item/schema.md +5 -0
- package/fixtures/cases/link-into-a-reserved-name/library/notes/a.md +1 -1
- package/fixtures/cases/link-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-item-enum/expected.json +7 -0
- package/fixtures/cases/list-item-enum/library/task.md +7 -0
- package/fixtures/cases/list-item-enum/schema.md +5 -0
- package/fixtures/cases/list-item-kind/expected.json +7 -0
- package/fixtures/cases/list-item-kind/library/task.md +6 -0
- package/fixtures/cases/list-item-kind/schema.md +5 -0
- package/fixtures/cases/list-items/expected.json +1 -0
- package/fixtures/cases/list-items/library/page.md +26 -0
- package/fixtures/cases/list-items/schema.md +12 -0
- package/fixtures/cases/list-of-objects-closed/expected.json +2 -1
- package/fixtures/cases/list-of-objects-closed/library/companies/acme.md +1 -1
- package/fixtures/cases/list-of-objects-closed/library/deals/renewal.md +49 -25
- package/fixtures/cases/list-of-objects-closed/schema.md +57 -0
- package/fixtures/cases/list-of-objects-item/expected.json +2 -1
- package/fixtures/cases/list-of-objects-item/library/companies/acme.md +1 -1
- package/fixtures/cases/list-of-objects-item/library/deals/renewal.md +49 -24
- package/fixtures/cases/list-of-objects-item/schema.md +57 -0
- package/fixtures/cases/list-of-objects-reference/expected.json +2 -1
- package/fixtures/cases/list-of-objects-reference/library/companies/acme.md +1 -1
- package/fixtures/cases/list-of-objects-reference/library/deals/renewal.md +12 -9
- package/fixtures/cases/list-of-objects-reference/library/places/depot.md +1 -1
- package/fixtures/cases/list-of-objects-reference/library/products/seats.md +1 -1
- package/fixtures/cases/list-of-objects-reference/library/products/support.md +1 -1
- package/fixtures/cases/list-of-objects-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-reference-path/expected.json +7 -0
- package/fixtures/cases/list-reference-path/library/page.md +5 -0
- package/fixtures/cases/list-reference-path/schema.md +5 -0
- package/fixtures/cases/list-reference-type/expected.json +7 -0
- package/fixtures/cases/list-reference-type/library/page.md +6 -0
- package/fixtures/cases/list-reference-type/schema.md +5 -0
- package/fixtures/cases/list-size/expected.json +2 -1
- package/fixtures/cases/list-size/library/companies/acme.md +1 -1
- package/fixtures/cases/list-size/library/deals/renewal.md +51 -24
- 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/expected.json +5 -0
- package/fixtures/cases/long-value-past-six-levels/schema.md +17 -0
- package/fixtures/cases/malformed-definition/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/malformed-list/expected.json +7 -0
- package/fixtures/cases/{structured-section → malformed-list}/library/item.md +1 -1
- package/fixtures/cases/malformed-list/schema.md +8 -0
- package/fixtures/cases/member-document/library/people/ana.md +2 -2
- package/fixtures/cases/member-document/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/member-on-another-type/library/note.md +1 -1
- package/fixtures/cases/member-on-another-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/missing-required-field/library/item.md +1 -1
- package/fixtures/cases/missing-required-field/schema.md +8 -0
- package/fixtures/cases/misspelled-key/expected.json +2 -1
- package/fixtures/cases/misspelled-key/library/companies/acme.md +1 -1
- package/fixtures/cases/misspelled-key/library/deals/renewal.md +50 -25
- package/fixtures/cases/misspelled-key/schema.md +57 -0
- package/fixtures/cases/name-not-a-string/context.json +1 -0
- package/fixtures/cases/name-not-a-string/expected.json +5 -0
- package/fixtures/cases/name-not-a-string/schema.md +7 -0
- package/fixtures/cases/nested-defs/expected.json +2 -1
- package/fixtures/cases/nested-defs/library/deal.md +3 -3
- package/fixtures/cases/nested-defs/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/nested-object-reference/expected.json +2 -1
- package/fixtures/cases/nested-object-reference/library/companies/acme.md +1 -1
- package/fixtures/cases/nested-object-reference/library/deals/renewal.md +12 -9
- package/fixtures/cases/nested-object-reference/library/places/depot.md +1 -1
- package/fixtures/cases/nested-object-reference/library/products/seats.md +1 -1
- package/fixtures/cases/nested-object-reference/library/products/support.md +1 -1
- package/fixtures/cases/nested-object-reference/schema.md +34 -0
- package/fixtures/cases/nested-reference/library/companies/acme.md +1 -1
- package/fixtures/cases/nested-reference/library/deals/renewal.md +13 -10
- package/fixtures/cases/nested-reference/library/places/depot.md +1 -1
- package/fixtures/cases/nested-reference/library/products/seats.md +1 -1
- package/fixtures/cases/nested-reference/library/products/support.md +1 -1
- package/fixtures/cases/nested-reference/schema.md +34 -0
- package/fixtures/cases/nested-required-field/expected.json +2 -1
- package/fixtures/cases/nested-required-field/library/companies/acme.md +1 -1
- package/fixtures/cases/nested-required-field/library/deals/renewal.md +48 -23
- package/fixtures/cases/nested-required-field/schema.md +57 -0
- package/fixtures/cases/numeric-range/expected.json +2 -1
- package/fixtures/cases/numeric-range/library/companies/acme.md +1 -1
- package/fixtures/cases/numeric-range/library/deals/renewal.md +49 -24
- package/fixtures/cases/numeric-range/schema.md +57 -0
- package/fixtures/cases/one-key-two-labels/context.json +1 -0
- package/fixtures/cases/one-key-two-labels/expected.json +5 -0
- package/fixtures/cases/one-key-two-labels/schema.md +7 -0
- package/fixtures/cases/one-key-two-types/context.json +1 -0
- package/fixtures/cases/one-key-two-types/expected.json +5 -0
- package/fixtures/cases/one-key-two-types/schema.md +6 -0
- package/fixtures/cases/one-of-variant/expected.json +2 -1
- package/fixtures/cases/one-of-variant/library/companies/acme.md +1 -1
- package/fixtures/cases/one-of-variant/library/deals/renewal.md +49 -24
- package/fixtures/cases/one-of-variant/schema.md +57 -0
- package/fixtures/cases/other-room-reference/expected.json +2 -1
- package/fixtures/cases/other-room-reference/library/companies/acme.md +1 -1
- package/fixtures/cases/other-room-reference/library/deals/renewal.md +12 -9
- package/fixtures/cases/other-room-reference/library/places/depot.md +1 -1
- package/fixtures/cases/other-room-reference/library/products/seats.md +1 -1
- package/fixtures/cases/other-room-reference/library/products/support.md +1 -1
- 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/expected.json +2 -1
- package/fixtures/cases/prototype-field/library/item.md +2 -2
- 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/expected.json +2 -1
- package/fixtures/cases/reference-into-a-reserved-name/library/notes/a.md +1 -1
- 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/reference-to-any-file-name/schema.md +12 -0
- package/fixtures/cases/referenced-missing-file/library/a.md +2 -2
- package/fixtures/cases/referenced-missing-file/library/b.md +2 -2
- 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/context.json +1 -0
- package/fixtures/cases/sections-keyword-refused/expected.json +5 -0
- package/fixtures/cases/{structured-section/schema.yaml → sections-keyword-refused/schema.md} +3 -2
- package/fixtures/cases/shortcut-reference-link/library/item.md +1 -1
- package/fixtures/cases/shortcut-reference-link/schema.md +7 -0
- package/fixtures/cases/string-length/expected.json +2 -1
- package/fixtures/cases/string-length/library/companies/acme.md +1 -1
- package/fixtures/cases/string-length/library/deals/renewal.md +49 -24
- package/fixtures/cases/string-length/schema.md +57 -0
- package/fixtures/cases/submission-keys/library/notes/visitor.md +2 -2
- package/fixtures/cases/submission-keys/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/text-field-kind/expected.json +1 -4
- package/fixtures/cases/text-field-kind/library/page.md +1 -1
- package/fixtures/cases/text-field-kind/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/thematic-break-ends-the-values/context.json +1 -0
- package/fixtures/cases/thematic-break-ends-the-values/expected.json +1 -0
- package/fixtures/cases/thematic-break-ends-the-values/library/item.md +10 -0
- package/fixtures/cases/thematic-break-ends-the-values/schema.md +5 -0
- package/fixtures/cases/truncated-link-definition/schema.md +3 -0
- package/fixtures/cases/{typed-path-names-its-type/schema.yaml → typed-path-names-another-type/schema.md} +2 -0
- package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/one.md +1 -1
- package/fixtures/cases/{typed-path-names-no-type/schema.yaml → typed-path-names-its-type/schema.md} +2 -0
- package/fixtures/cases/{typed-path-names-another-type/schema.yaml → typed-path-names-no-type/schema.md} +2 -0
- package/fixtures/cases/types-folder-content/library/types/task.md +1 -1
- package/fixtures/cases/types-folder-content/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/undeclared-field/expected.json +2 -1
- package/fixtures/cases/undeclared-field/library/item.md +2 -2
- package/fixtures/cases/undeclared-field/schema.md +7 -0
- package/fixtures/cases/unevaluated-items-closed/expected.json +2 -1
- package/fixtures/cases/unevaluated-items-closed/library/trip.md +13 -3
- package/fixtures/cases/unevaluated-items-closed/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unlisted-reference-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/library/rooms/team/tasks/plan.md +2 -1
- package/fixtures/cases/{unnamed-typed-path-without-a-body/schema.yaml → unnamed-typed-path-checks-its-fields/schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/library/rooms/team/tasks/plan.md +3 -2
- package/fixtures/cases/{unnamed-typed-path-checks-its-fields/schema.yaml → unnamed-typed-path-names-a-type/schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/tasks/plan.md +3 -2
- package/fixtures/cases/{unnamed-typed-path-names-a-type/schema.yaml → unnamed-typed-path-reads-its-type/schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/library/rooms/team/tasks/plan.md +2 -2
- package/fixtures/cases/{unnamed-typed-path-reads-its-type/schema.yaml → unnamed-typed-path-without-a-body/schema.md} +2 -0
- package/fixtures/cases/unresolved-link/library/item.md +1 -1
- package/fixtures/cases/unresolved-link/schema.md +7 -0
- package/fixtures/cases/valid-typed-document/library/people/ada.md +1 -1
- package/fixtures/cases/valid-typed-document/library/tasks/one.md +11 -11
- package/fixtures/cases/valid-typed-document/schema.md +17 -0
- package/fixtures/cases/wide-item-fence-link/schema.md +3 -0
- package/fixtures/forms.json +371 -0
- package/fixtures/preamble.json +6 -6
- package/fixtures/queries.json +600 -2
- package/fixtures/references.json +15 -0
- package/package.json +1 -1
- package/dist/divide.d.ts +0 -3
- package/dist/divide.d.ts.map +0 -1
- package/dist/divide.js +0 -321
- package/dist/project.d.ts +0 -22
- package/dist/project.d.ts.map +0 -1
- package/dist/project.js +0 -123
- package/fixtures/cases/absent-link-dangles/schema.yaml +0 -6
- package/fixtures/cases/absolute-link/schema.yaml +0 -6
- package/fixtures/cases/bracketed-link-definition/schema.yaml +0 -6
- package/fixtures/cases/conditional-section/schema.yaml +0 -14
- package/fixtures/cases/declared-binary-links/schema.yaml +0 -1
- package/fixtures/cases/default-unfilled/schema.yaml +0 -56
- package/fixtures/cases/defs-pattern/schema.yaml +0 -56
- package/fixtures/cases/dependent-rule/schema.yaml +0 -56
- package/fixtures/cases/duplicate-link-definition/schema.yaml +0 -6
- package/fixtures/cases/email-format/schema.yaml +0 -56
- package/fixtures/cases/fenced-link-definition/schema.yaml +0 -6
- package/fixtures/cases/field-enum/schema.yaml +0 -7
- package/fixtures/cases/frontmatter-schema/expected.json +0 -5
- package/fixtures/cases/integer-field/schema.yaml +0 -56
- package/fixtures/cases/interrupted-link-definition/schema.yaml +0 -1
- package/fixtures/cases/json-schema-constructs/schema.yaml +0 -56
- package/fixtures/cases/lazy-list-item/schema.yaml +0 -3
- package/fixtures/cases/list-of-objects-closed/schema.yaml +0 -56
- package/fixtures/cases/list-of-objects-item/schema.yaml +0 -56
- package/fixtures/cases/list-size/schema.yaml +0 -56
- package/fixtures/cases/long-fence-link-definition/schema.yaml +0 -1
- package/fixtures/cases/missing-required-field/schema.yaml +0 -7
- package/fixtures/cases/missing-section-item-kind/expected.json +0 -5
- package/fixtures/cases/missing-section-item-kind/schema.yaml +0 -6
- package/fixtures/cases/misspelled-key/schema.yaml +0 -56
- 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 -56
- package/fixtures/cases/null-refused/expected.json +0 -6
- package/fixtures/cases/null-refused/library/companies/acme.md +0 -4
- package/fixtures/cases/null-refused/library/deals/renewal.md +0 -31
- package/fixtures/cases/null-refused/schema.yaml +0 -56
- package/fixtures/cases/numeric-range/schema.yaml +0 -56
- package/fixtures/cases/one-of-variant/schema.yaml +0 -56
- package/fixtures/cases/open-map-value/expected.json +0 -6
- package/fixtures/cases/open-map-value/library/companies/acme.md +0 -4
- package/fixtures/cases/open-map-value/library/deals/renewal.md +0 -31
- package/fixtures/cases/open-map-value/schema.yaml +0 -56
- 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 -6
- package/fixtures/cases/quoted-link-definition/schema.yaml +0 -1
- package/fixtures/cases/referenced-missing-file/schema.yaml +0 -11
- package/fixtures/cases/section-item-enum/expected.json +0 -6
- package/fixtures/cases/section-item-enum/library/task.md +0 -8
- package/fixtures/cases/section-item-enum/schema.yaml +0 -3
- package/fixtures/cases/section-item-kind/expected.json +0 -6
- package/fixtures/cases/section-item-kind/library/task.md +0 -8
- package/fixtures/cases/section-item-kind/schema.yaml +0 -3
- package/fixtures/cases/section-items/library/page.md +0 -42
- package/fixtures/cases/section-items/schema.yaml +0 -10
- package/fixtures/cases/section-reference-path/expected.json +0 -6
- package/fixtures/cases/section-reference-path/library/page.md +0 -7
- package/fixtures/cases/section-reference-path/schema.yaml +0 -3
- package/fixtures/cases/section-reference-type/expected.json +0 -6
- package/fixtures/cases/section-reference-type/library/page.md +0 -7
- package/fixtures/cases/section-reference-type/schema.yaml +0 -3
- package/fixtures/cases/shortcut-reference-link/schema.yaml +0 -6
- package/fixtures/cases/string-length/schema.yaml +0 -56
- package/fixtures/cases/structured-section/expected.json +0 -6
- package/fixtures/cases/thematic-break-in-a-list-section/expected.json +0 -6
- package/fixtures/cases/thematic-break-in-a-list-section/library/item.md +0 -7
- package/fixtures/cases/thematic-break-in-a-list-section/schema.yaml +0 -3
- package/fixtures/cases/truncated-link-definition/schema.yaml +0 -1
- package/fixtures/cases/undeclared-field/schema.yaml +0 -6
- package/fixtures/cases/unresolved-link/schema.yaml +0 -6
- package/fixtures/cases/valid-typed-document/schema.yaml +0 -16
- package/fixtures/cases/wide-item-fence-link/schema.yaml +0 -1
- package/fixtures/division.json +0 -454
- package/fixtures/projection.json +0 -358
- /package/fixtures/cases/{conditional-section → block-scalar-frontmatter}/context.json +0 -0
- /package/fixtures/cases/{section-items → block-scalar-frontmatter}/expected.json +0 -0
- /package/fixtures/cases/{frontmatter-schema → conditional-long-text}/context.json +0 -0
- /package/fixtures/cases/{missing-section-item-kind → equal-labels}/context.json +0 -0
- /package/fixtures/cases/{null-refused → frontmatter-construct}/context.json +0 -0
- /package/fixtures/cases/{open-map-value → labels-in-the-rooms-language}/context.json +0 -0
- /package/fixtures/cases/{section-item-enum → list-item-enum}/context.json +0 -0
- /package/fixtures/cases/{section-item-kind → list-item-kind}/context.json +0 -0
- /package/fixtures/cases/{section-items → list-items}/context.json +0 -0
- /package/fixtures/cases/{section-items → list-items}/library/other.md +0 -0
- /package/fixtures/cases/{section-reference-path → list-reference-path}/context.json +0 -0
- /package/fixtures/cases/{section-reference-path → list-reference-path}/library/other.md +0 -0
- /package/fixtures/cases/{section-reference-type → list-reference-type}/context.json +0 -0
- /package/fixtures/cases/{section-reference-type → list-reference-type}/library/note.md +0 -0
- /package/fixtures/cases/{structured-section → long-value-past-six-levels}/context.json +0 -0
- /package/fixtures/cases/{thematic-break-in-a-list-section → malformed-list}/context.json +0 -0
- /package/fixtures/cases/{frontmatter-schema/schema.yaml → unknown-type/schema.md} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
2
|
export type { Actor, DocumentEvent, DocumentFacts, Fact, ItemFacts, MessageFacts, Resolved, WriteDoor, } from './event.js';
|
|
3
|
-
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
3
|
+
export { byCodePoint, compared, dated, fitsKind, indexKey, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
4
4
|
export type { Kind, Ordering } from './kinds.js';
|
|
5
5
|
export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
|
|
6
6
|
export type { Clause, Continuation, Direction, DocumentQuery, DocumentShape, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, GroupShape, HeldRooms, Key, KeyPlan, LocalQuery, OrderOptions, Place, Predicate, QueryErrorCode, QueryPlan, Related, RoomFacts, Scope, Select, Test, Value, Where, } from './query/language.js';
|
|
7
|
+
export { countOf, countShape, hopTargets, pageOrder, walkedValue, walkOf } from './query/walk.js';
|
|
8
|
+
export type { Count, KeyBound, KeyRange, PageOrder, Walk, WalkedFacts, WalkRun, } from './query/walk.js';
|
|
9
|
+
export { verifyIndexBounds } from './indexed.js';
|
|
10
|
+
export type { IndexBounds } from './indexed.js';
|
|
7
11
|
export { heldAt, matches } from './query/match.js';
|
|
8
12
|
export type { Candidate } from './query/match.js';
|
|
9
13
|
export { heldKind, indexed } from './query/rows.js';
|
|
@@ -11,23 +15,34 @@ export type { HeldKind, HeldLink, HeldValue, Indexed, Reach } from './query/rows
|
|
|
11
15
|
export * as sql from './query/sql.js';
|
|
12
16
|
export { headingLines } from './markdown.js';
|
|
13
17
|
export type { HeadingLine } from './markdown.js';
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
18
|
+
export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
|
|
19
|
+
export { shownDay, shownMoment } from './moment.js';
|
|
20
|
+
export type { MomentReader } from './moment.js';
|
|
21
|
+
export { labelAt, NAME_FIELD } from './body.js';
|
|
22
|
+
export type { Naming } from './body.js';
|
|
23
|
+
export { apply, bodyLinks, create, links, parse, partText, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
|
|
16
24
|
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
25
|
+
export { notReadyWaitMs } from './not-ready.js';
|
|
17
26
|
export type { ReferenceTarget, SavedFacts } from './facts.js';
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
27
|
+
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './house-references/crockford.js';
|
|
28
|
+
export { HOUSE_FIELDS, MEMBER_FIELD, SITE_FIELD, SUBMITTED_FIELD, TYPE_FIELD } from './fields.js';
|
|
29
|
+
export { HOUSE_MODEL, HOUSE_ROOM_TYPES } from './built-in.js';
|
|
30
|
+
export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS } from './house-model.js';
|
|
31
|
+
export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ATTACHMENT_REFERENCE_PATTERN, ATTACHMENT_REFERENCE_PREFIX, DOCUMENT_REFERENCE_PATTERN, DOCUMENT_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
|
|
32
|
+
export type { HouseDocumentFields, HouseModelType } from './house-model.js';
|
|
33
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES, VIEW_TYPE, } from './room-types.js';
|
|
34
|
+
export type { InboxChannelKind } from './room-types.js';
|
|
35
|
+
export { keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, urlDestination, } from './paths.js';
|
|
20
36
|
export { openPatternBudget } from './pattern.js';
|
|
21
|
-
export type { RoomTarget } from './paths.js';
|
|
22
|
-
export { project } from './project.js';
|
|
37
|
+
export type { LinkedPath, RoomTarget } from './paths.js';
|
|
23
38
|
export { references } from './references.js';
|
|
24
|
-
export { CAPTURE_HOME, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
|
|
25
|
-
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
26
|
-
export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue,
|
|
27
|
-
export type { ApplyResult, BodyResult, Change,
|
|
28
|
-
export { assess, assessReferences, bodyRoomLinks, checkDocument, readTypes, resolves, roomReferences, validate, validating, verdicts, verify, } from './validate.js';
|
|
39
|
+
export { CAPTURE_HOME, foldedName, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
|
|
40
|
+
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
|
|
41
|
+
export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, Shape, Transition, ValueFacts, } from './definition.js';
|
|
42
|
+
export type { ApplyResult, BodyResult, Change, DefinitionOf, Document, DocumentCheck, Extent, Library, ModelVerification, Link, ParseResult, Reached, Reference, Refusal, RoleNeed, RoomReference, Span, TypedPath, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
|
43
|
+
export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readSchemaDocument, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, verifySchemaDocument, } from './validate.js';
|
|
29
44
|
export type { Assessment, Verdicts } from './validate.js';
|
|
30
45
|
export { VERSION } from './version.js';
|
|
31
|
-
export { bodyAfterFrontmatter,
|
|
32
|
-
export type {
|
|
46
|
+
export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
|
|
47
|
+
export type { DocumentValue } from './yaml.js';
|
|
33
48
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,KAAK,EACL,aAAa,EACb,aAAa,EACb,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,SAA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AC;AACvB,OAAO,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,eAAe,EACf,QAAQ,GACT,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,EACL,UAAU,EACV,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,IAAI,EACJ,WAAW,EACX,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAc,EACd,UAAU,EACV,QAAQ,EACR,MAAM,EACN,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACnF,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
|
-
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
2
|
+
export { byCodePoint, compared, dated, fitsKind, indexKey, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
3
3
|
export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
|
|
4
|
+
export { countOf, countShape, hopTargets, pageOrder, walkedValue, walkOf } from './query/walk.js';
|
|
5
|
+
export { verifyIndexBounds } from './indexed.js';
|
|
4
6
|
export { heldAt, matches } from './query/match.js';
|
|
5
7
|
export { heldKind, indexed } from './query/rows.js';
|
|
6
8
|
export * as sql from './query/sql.js';
|
|
7
9
|
export { headingLines } from './markdown.js';
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
+
export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
|
|
11
|
+
export { shownDay, shownMoment } from './moment.js';
|
|
12
|
+
export { labelAt, NAME_FIELD } from './body.js';
|
|
13
|
+
export { apply, bodyLinks, create, links, parse, partText, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
|
|
10
14
|
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
15
|
+
export { notReadyWaitMs } from './not-ready.js';
|
|
16
|
+
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './house-references/crockford.js';
|
|
17
|
+
export { HOUSE_FIELDS, MEMBER_FIELD, SITE_FIELD, SUBMITTED_FIELD, TYPE_FIELD } from './fields.js';
|
|
18
|
+
export { HOUSE_MODEL, HOUSE_ROOM_TYPES } from './built-in.js';
|
|
19
|
+
export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS } from './house-model.js';
|
|
20
|
+
export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ATTACHMENT_REFERENCE_PATTERN, ATTACHMENT_REFERENCE_PREFIX, DOCUMENT_REFERENCE_PATTERN, DOCUMENT_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
|
|
21
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES, VIEW_TYPE, } from './room-types.js';
|
|
22
|
+
export { keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, urlDestination, } from './paths.js';
|
|
13
23
|
export { openPatternBudget } from './pattern.js';
|
|
14
|
-
export { project } from './project.js';
|
|
15
24
|
export { references } from './references.js';
|
|
16
|
-
export { CAPTURE_HOME, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
|
|
17
|
-
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, } from './definition.js';
|
|
18
|
-
export { assess, assessReferences, bodyRoomLinks, checkDocument, readTypes, resolves, roomReferences, validate, validating, verdicts, verify, } from './validate.js';
|
|
25
|
+
export { CAPTURE_HOME, foldedName, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
|
|
26
|
+
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
|
|
27
|
+
export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readSchemaDocument, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, verifySchemaDocument, } from './validate.js';
|
|
19
28
|
export { VERSION } from './version.js';
|
|
20
|
-
export { bodyAfterFrontmatter,
|
|
29
|
+
export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Failure } from './definition.js';
|
|
2
|
+
import type { ModelVerification, VerifiedModel } from './types.js';
|
|
3
|
+
export type IndexBounds = {
|
|
4
|
+
readonly perType: number;
|
|
5
|
+
readonly longestText: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function indexedFailure(model: VerifiedModel): Failure | undefined;
|
|
8
|
+
export declare function verifyIndexBounds(model: VerifiedModel, bounds: IndexBounds): ModelVerification;
|
|
9
|
+
//# sourceMappingURL=indexed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexed.d.ts","sourceRoot":"","sources":["../src/indexed.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGnE,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AA+CrF,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,SAAS,CAQxE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,iBAAiB,CAW9F"}
|
package/dist/indexed.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { admitted, conjoined, escapePointer, refuse, UNIONS, } from './definition.js';
|
|
2
|
+
import { HOUSE_FIELDS } from './fields.js';
|
|
3
|
+
import { kindOf } from './kinds.js';
|
|
4
|
+
import { isRecord } from './yaml.js';
|
|
5
|
+
const PLAIN = ['string', 'number', 'boolean'];
|
|
6
|
+
const UNBOUNDED_KINDS = ['enum', 'date', 'date-time', 'time'];
|
|
7
|
+
function declarations(definition, field) {
|
|
8
|
+
const { schema, defs } = definition.shape;
|
|
9
|
+
return conjoined([{ node: schema, at: '' }], defs, new Set()).held.flatMap(({ node }) => isRecord(node.properties) && Object.hasOwn(node.properties, field)
|
|
10
|
+
? [node.properties[field]]
|
|
11
|
+
: []);
|
|
12
|
+
}
|
|
13
|
+
function indexable(definition, field) {
|
|
14
|
+
if (HOUSE_FIELDS.includes(field) || !Object.hasOwn(definition.fields, field))
|
|
15
|
+
return null;
|
|
16
|
+
const facts = definition.fields[field];
|
|
17
|
+
if (facts.markdown === true || facts.reference !== undefined)
|
|
18
|
+
return null;
|
|
19
|
+
const declared = declarations(definition, field);
|
|
20
|
+
const { defs } = definition.shape;
|
|
21
|
+
const held = conjoined(declared.map((node) => ({ node, at: '' })), defs, new Set()).held.map(({ node }) => node);
|
|
22
|
+
if (held.length === 0 ||
|
|
23
|
+
held.some((node) => UNIONS.some((keyword) => node[keyword] !== undefined)))
|
|
24
|
+
return null;
|
|
25
|
+
const types = admitted(declared, defs, new Set());
|
|
26
|
+
const plain = types === null ? [] : [...types].filter((type) => type !== 'null');
|
|
27
|
+
if (plain.length !== 1 || !PLAIN.includes(plain[0]))
|
|
28
|
+
return null;
|
|
29
|
+
if (plain[0] !== 'string' || UNBOUNDED_KINDS.includes(kindOf(facts) ?? ''))
|
|
30
|
+
return { text: null };
|
|
31
|
+
const lengths = held.flatMap((node) => typeof node.maxLength === 'number' ? [node.maxLength] : []);
|
|
32
|
+
return lengths.length === 0 ? null : { text: Math.min(...lengths) };
|
|
33
|
+
}
|
|
34
|
+
function at(name, index) {
|
|
35
|
+
return `/${escapePointer(name)}/indexed/${index}`;
|
|
36
|
+
}
|
|
37
|
+
export function indexedFailure(model) {
|
|
38
|
+
for (const [name, definition] of Object.entries(model.types)) {
|
|
39
|
+
const index = (definition.indexed ?? []).findIndex((field) => indexable(definition, field) === null);
|
|
40
|
+
if (index !== -1)
|
|
41
|
+
return refuse('indexed', at(name, index));
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
export function verifyIndexBounds(model, bounds) {
|
|
46
|
+
for (const [name, definition] of Object.entries(model.types)) {
|
|
47
|
+
const indexed = definition.indexed ?? [];
|
|
48
|
+
if (indexed.length > bounds.perType)
|
|
49
|
+
return { verdict: 'refuse', rule: 'indexed', location: at(name, bounds.perType) };
|
|
50
|
+
const index = indexed.findIndex((field) => (indexable(definition, field)?.text ?? 0) > bounds.longestText);
|
|
51
|
+
if (index !== -1)
|
|
52
|
+
return { verdict: 'refuse', rule: 'indexed', location: at(name, index) };
|
|
53
|
+
}
|
|
54
|
+
return { verdict: 'accept', model };
|
|
55
|
+
}
|
package/dist/kinds.d.ts
CHANGED
|
@@ -13,6 +13,9 @@ export declare function kindWords(facts: ValueFacts | undefined): readonly strin
|
|
|
13
13
|
export declare function dated(value: unknown): value is string;
|
|
14
14
|
export declare function instant(value: unknown): bigint | undefined;
|
|
15
15
|
export declare function instantKey(value: unknown): string | null;
|
|
16
|
+
export declare function instantOf(facts: ValueFacts | undefined, value: unknown): string | null;
|
|
17
|
+
export declare function indexKey(facts: ValueFacts, value: unknown): Uint8Array;
|
|
18
|
+
export declare function sortedKey(value: unknown): Uint8Array | null;
|
|
16
19
|
export declare function byCodePoint(left: string, right: string): number;
|
|
17
20
|
export declare function compared(left: unknown, right: unknown, ordering: Ordering): number;
|
|
18
21
|
//# sourceMappingURL=kinds.d.ts.map
|
package/dist/kinds.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,MAAM,IAAI,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,MAAM,GACN,W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,SAAS,MAAM,EAAE,CAe1E;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAErD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAqB1D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAGxD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAEtF;AAgCD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAUtE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAU3D;AAaD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAO/D;AA4BD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAMlF"}
|
package/dist/kinds.js
CHANGED
|
@@ -3,6 +3,10 @@ import { normalize } from './paths.js';
|
|
|
3
3
|
const DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[Tt\s](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:[Zz]|([+-])(\d{2})(?::?(\d{2}))?)$/u;
|
|
4
4
|
const BEFORE_YEAR_ZERO = 62200000000000000000n;
|
|
5
5
|
const INSTANT_DIGITS = 21;
|
|
6
|
+
const MISSING_KEY = 0;
|
|
7
|
+
const NUMBER_KEYS = 1;
|
|
8
|
+
const INSTANT_KEYS = 2;
|
|
9
|
+
const TEXT_KEYS = 3;
|
|
6
10
|
export function kindOf(facts) {
|
|
7
11
|
if (facts.reference !== undefined)
|
|
8
12
|
return 'reference';
|
|
@@ -86,6 +90,62 @@ export function instantKey(value) {
|
|
|
86
90
|
const at = instant(value);
|
|
87
91
|
return at === undefined ? null : (at + BEFORE_YEAR_ZERO).toString().padStart(INSTANT_DIGITS, '0');
|
|
88
92
|
}
|
|
93
|
+
export function instantOf(facts, value) {
|
|
94
|
+
return facts !== undefined && kindOf(facts) === 'date-time' ? instantKey(value) : null;
|
|
95
|
+
}
|
|
96
|
+
function utf8(text) {
|
|
97
|
+
const bytes = [];
|
|
98
|
+
for (const char of text) {
|
|
99
|
+
const code = char.codePointAt(0);
|
|
100
|
+
if (code < 0x80)
|
|
101
|
+
bytes.push(code);
|
|
102
|
+
else if (code < 0x800)
|
|
103
|
+
bytes.push(0xc0 | (code >> 6), 0x80 | (code & 0x3f));
|
|
104
|
+
else if (code < 0x10000)
|
|
105
|
+
bytes.push(0xe0 | (code >> 12), 0x80 | ((code >> 6) & 0x3f), 0x80 | (code & 0x3f));
|
|
106
|
+
else
|
|
107
|
+
bytes.push(0xf0 | (code >> 18), 0x80 | ((code >> 12) & 0x3f), 0x80 | ((code >> 6) & 0x3f), 0x80 | (code & 0x3f));
|
|
108
|
+
}
|
|
109
|
+
return bytes;
|
|
110
|
+
}
|
|
111
|
+
function numberKey(value) {
|
|
112
|
+
const key = new Uint8Array(9);
|
|
113
|
+
const view = new DataView(key.buffer);
|
|
114
|
+
view.setUint8(0, NUMBER_KEYS);
|
|
115
|
+
view.setFloat64(1, value === 0 ? 0 : value);
|
|
116
|
+
const sign = view.getUint8(1);
|
|
117
|
+
if (sign < 0x80)
|
|
118
|
+
view.setUint8(1, sign | 0x80);
|
|
119
|
+
else
|
|
120
|
+
for (let at = 1; at < key.length; at += 1)
|
|
121
|
+
view.setUint8(at, ~view.getUint8(at) & 0xff);
|
|
122
|
+
return key;
|
|
123
|
+
}
|
|
124
|
+
export function indexKey(facts, value) {
|
|
125
|
+
if (value === undefined || value === null)
|
|
126
|
+
return Uint8Array.of(MISSING_KEY);
|
|
127
|
+
if (typeof value === 'boolean')
|
|
128
|
+
return numberKey(value ? 1 : 0);
|
|
129
|
+
if (typeof value === 'number')
|
|
130
|
+
return numberKey(value);
|
|
131
|
+
if (typeof value !== 'string')
|
|
132
|
+
throw new Error('an indexed value is a number, a boolean or a string');
|
|
133
|
+
const at = instantOf(facts, value);
|
|
134
|
+
return at === null
|
|
135
|
+
? Uint8Array.of(TEXT_KEYS, ...utf8(value))
|
|
136
|
+
: Uint8Array.of(INSTANT_KEYS, ...utf8(at));
|
|
137
|
+
}
|
|
138
|
+
export function sortedKey(value) {
|
|
139
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
140
|
+
const { instant, ...rest } = value;
|
|
141
|
+
return typeof instant === 'string' && Object.keys(rest).length === 0
|
|
142
|
+
? Uint8Array.of(INSTANT_KEYS, ...utf8(instant))
|
|
143
|
+
: null;
|
|
144
|
+
}
|
|
145
|
+
return value === null || ['boolean', 'number', 'string'].includes(typeof value)
|
|
146
|
+
? indexKey({ prose: false }, value)
|
|
147
|
+
: null;
|
|
148
|
+
}
|
|
89
149
|
function rank(value) {
|
|
90
150
|
if (typeof value === 'boolean' || typeof value === 'number')
|
|
91
151
|
return 1;
|
package/dist/markdown.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Extent } from './types.js';
|
|
2
1
|
export type HeadingLine = {
|
|
3
2
|
readonly level: number;
|
|
4
3
|
readonly name: string;
|
|
@@ -24,17 +23,41 @@ export type DefinitionBlock = {
|
|
|
24
23
|
readonly end: number;
|
|
25
24
|
readonly destination: HrefOccurrence;
|
|
26
25
|
};
|
|
27
|
-
export type
|
|
28
|
-
readonly
|
|
26
|
+
export type Node = {
|
|
27
|
+
readonly type: string;
|
|
28
|
+
readonly position?: {
|
|
29
|
+
readonly start: {
|
|
30
|
+
readonly offset?: number;
|
|
31
|
+
};
|
|
32
|
+
readonly end: {
|
|
33
|
+
readonly offset?: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly children?: readonly Node[];
|
|
37
|
+
readonly depth?: number;
|
|
38
|
+
readonly identifier?: string;
|
|
39
|
+
readonly checked?: boolean | null;
|
|
40
|
+
readonly ordered?: boolean | null;
|
|
41
|
+
readonly lang?: string | null;
|
|
42
|
+
readonly value?: string;
|
|
29
43
|
};
|
|
30
44
|
export type Reading = {
|
|
31
45
|
readonly headings: readonly HeadingLine[];
|
|
32
|
-
readonly blocks: readonly Block[];
|
|
33
46
|
readonly uses: readonly LinkUse[];
|
|
34
47
|
readonly definitions: readonly DefinitionBlock[];
|
|
48
|
+
readonly tree: readonly Node[];
|
|
49
|
+
readonly base: number;
|
|
50
|
+
};
|
|
51
|
+
export declare function lineBreaks(text: string): readonly number[];
|
|
52
|
+
export declare function lineNumber(breaks: readonly number[], offset: number): number;
|
|
53
|
+
export declare function lineStart(text: string, index: number): number;
|
|
54
|
+
export declare function lineEnd(text: string, index: number): {
|
|
55
|
+
readonly end: number;
|
|
56
|
+
readonly next: number;
|
|
35
57
|
};
|
|
36
58
|
export declare function read(text: string, at?: number): Reading;
|
|
37
59
|
export declare function destinations(reading: Reading): readonly HrefOccurrence[];
|
|
60
|
+
export declare function linkable(text: string, from?: number): boolean;
|
|
38
61
|
export declare function hrefOccurrences(body: string): readonly HrefOccurrence[];
|
|
39
62
|
export declare function headingLines(content: string, from: number, to: number): HeadingLine[];
|
|
40
63
|
export type SectionSpan = {
|
|
@@ -45,7 +68,4 @@ export type SectionSpan = {
|
|
|
45
68
|
};
|
|
46
69
|
export declare function sectionSpans(reading: Reading, end: number): SectionSpan[];
|
|
47
70
|
export declare function sectionsRecord(spans: readonly SectionSpan[], content: string): Record<string, string>;
|
|
48
|
-
export declare function headingsIn(reading: Reading, from: number, to: number): readonly HeadingLine[];
|
|
49
|
-
export declare function listItems(reading: Reading, from: number, to: number): Extent[] | null;
|
|
50
|
-
export declare function blockRanges(reading: Reading, from: number, to: number): Extent[];
|
|
51
71
|
//# sourceMappingURL=markdown.d.ts.map
|
package/dist/markdown.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,KAAK,EAAE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AQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAKjD;AAgBD,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,SAAI,GAAG,OAAO,CAwElD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,cAAc,EAAE,CAIxE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,OAAO,CAExD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,cAAc,EAAE,CAEvE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,EAAE,CAErF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,EAAE,CAczE;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB"}
|
package/dist/markdown.js
CHANGED
|
@@ -64,20 +64,35 @@ function marking(text, shift, marks, labelled) {
|
|
|
64
64
|
case 'setextHeadingText':
|
|
65
65
|
marked(marks, top).text = { start, end };
|
|
66
66
|
return;
|
|
67
|
-
case 'listItemPrefix':
|
|
68
|
-
marked(marks, top).content = end;
|
|
69
|
-
return;
|
|
70
67
|
}
|
|
71
68
|
},
|
|
72
69
|
};
|
|
73
70
|
}
|
|
74
|
-
function
|
|
71
|
+
export function lineBreaks(text) {
|
|
72
|
+
const breaks = [];
|
|
73
|
+
for (let at = text.indexOf('\n'); at !== -1; at = text.indexOf('\n', at + 1))
|
|
74
|
+
breaks.push(at);
|
|
75
|
+
return breaks;
|
|
76
|
+
}
|
|
77
|
+
export function lineNumber(breaks, offset) {
|
|
78
|
+
let low = 0;
|
|
79
|
+
let high = breaks.length;
|
|
80
|
+
while (low < high) {
|
|
81
|
+
const middle = (low + high) >>> 1;
|
|
82
|
+
if (breaks[middle] < offset)
|
|
83
|
+
low = middle + 1;
|
|
84
|
+
else
|
|
85
|
+
high = middle;
|
|
86
|
+
}
|
|
87
|
+
return low + 1;
|
|
88
|
+
}
|
|
89
|
+
export function lineStart(text, index) {
|
|
75
90
|
let at = index;
|
|
76
91
|
while (at > 0 && text[at - 1] !== '\n' && text[at - 1] !== '\r')
|
|
77
92
|
at -= 1;
|
|
78
93
|
return at;
|
|
79
94
|
}
|
|
80
|
-
function lineEnd(text, index) {
|
|
95
|
+
export function lineEnd(text, index) {
|
|
81
96
|
let at = index;
|
|
82
97
|
while (at < text.length && text[at] !== '\n' && text[at] !== '\r')
|
|
83
98
|
at += 1;
|
|
@@ -85,15 +100,6 @@ function lineEnd(text, index) {
|
|
|
85
100
|
return { end: at, next: at };
|
|
86
101
|
return { end: at, next: text[at] === '\r' && text[at + 1] === '\n' ? at + 2 : at + 1 };
|
|
87
102
|
}
|
|
88
|
-
function trimmed(text, start, end) {
|
|
89
|
-
let from = start;
|
|
90
|
-
let to = end;
|
|
91
|
-
while (from < to && /\s/.test(text[from]))
|
|
92
|
-
from += 1;
|
|
93
|
-
while (to > from && /\s/.test(text[to - 1]))
|
|
94
|
-
to -= 1;
|
|
95
|
-
return { start: from, end: to };
|
|
96
|
-
}
|
|
97
103
|
function shifted(value, by) {
|
|
98
104
|
return { ...value, start: value.start + by, end: value.end + by };
|
|
99
105
|
}
|
|
@@ -123,7 +129,6 @@ export function read(text, at = 0) {
|
|
|
123
129
|
});
|
|
124
130
|
const local = (offset) => offset + shift;
|
|
125
131
|
const headings = [];
|
|
126
|
-
const blocks = [];
|
|
127
132
|
for (const node of root.children ?? []) {
|
|
128
133
|
let start = local(startOf(node));
|
|
129
134
|
while (start > 0 && (text[start - 1] === ' ' || text[start - 1] === '\t'))
|
|
@@ -140,13 +145,6 @@ export function read(text, at = 0) {
|
|
|
140
145
|
next: at + line.next,
|
|
141
146
|
});
|
|
142
147
|
}
|
|
143
|
-
blocks.push({
|
|
144
|
-
start: at + start,
|
|
145
|
-
end: at + end,
|
|
146
|
-
items: node.type === 'list'
|
|
147
|
-
? (node.children ?? []).map((item) => shifted(trimmed(text, marks.get(item)?.content ?? local(startOf(item)), local(endOf(item))), at))
|
|
148
|
-
: null,
|
|
149
|
-
});
|
|
150
148
|
}
|
|
151
149
|
const destinations = new Map();
|
|
152
150
|
const definitions = [];
|
|
@@ -191,7 +189,7 @@ export function read(text, at = 0) {
|
|
|
191
189
|
});
|
|
192
190
|
}
|
|
193
191
|
uses.sort((left, right) => left.start - right.start);
|
|
194
|
-
return { headings,
|
|
192
|
+
return { headings, uses, definitions, tree: root.children ?? [], base: at + shift };
|
|
195
193
|
}
|
|
196
194
|
export function destinations(reading) {
|
|
197
195
|
const byStart = new Map();
|
|
@@ -199,8 +197,11 @@ export function destinations(reading) {
|
|
|
199
197
|
byStart.set(use.destination.start, use.destination);
|
|
200
198
|
return [...byStart.values()].sort((left, right) => left.start - right.start);
|
|
201
199
|
}
|
|
200
|
+
export function linkable(text, from = 0) {
|
|
201
|
+
return text.includes('](', from) || text.includes(']:', from);
|
|
202
|
+
}
|
|
202
203
|
export function hrefOccurrences(body) {
|
|
203
|
-
return destinations(read(body));
|
|
204
|
+
return linkable(body) ? destinations(read(body)) : [];
|
|
204
205
|
}
|
|
205
206
|
export function headingLines(content, from, to) {
|
|
206
207
|
return [...read(content.slice(from, to), from).headings];
|
|
@@ -229,43 +230,3 @@ export function sectionsRecord(spans, content) {
|
|
|
229
230
|
}
|
|
230
231
|
return record;
|
|
231
232
|
}
|
|
232
|
-
function firstPast(items, at, key) {
|
|
233
|
-
let low = 0;
|
|
234
|
-
let high = items.length;
|
|
235
|
-
while (low < high) {
|
|
236
|
-
const middle = (low + high) >>> 1;
|
|
237
|
-
if (key(items[middle]) <= at)
|
|
238
|
-
low = middle + 1;
|
|
239
|
-
else
|
|
240
|
-
high = middle;
|
|
241
|
-
}
|
|
242
|
-
return low;
|
|
243
|
-
}
|
|
244
|
-
function blocksIn(reading, from, to) {
|
|
245
|
-
const blocks = reading.blocks;
|
|
246
|
-
const first = firstPast(blocks, from, (block) => block.end);
|
|
247
|
-
let end = first;
|
|
248
|
-
while (end < blocks.length && blocks[end].start < to)
|
|
249
|
-
end += 1;
|
|
250
|
-
return blocks.slice(first, end);
|
|
251
|
-
}
|
|
252
|
-
export function headingsIn(reading, from, to) {
|
|
253
|
-
const start = (heading) => heading.start;
|
|
254
|
-
return reading.headings.slice(firstPast(reading.headings, from - 1, start), firstPast(reading.headings, to - 1, start));
|
|
255
|
-
}
|
|
256
|
-
export function listItems(reading, from, to) {
|
|
257
|
-
const items = [];
|
|
258
|
-
for (const block of blocksIn(reading, from, to)) {
|
|
259
|
-
if (block.items === null)
|
|
260
|
-
return null;
|
|
261
|
-
items.push(...block.items);
|
|
262
|
-
}
|
|
263
|
-
return items;
|
|
264
|
-
}
|
|
265
|
-
export function blockRanges(reading, from, to) {
|
|
266
|
-
const starts = blocksIn(reading, from, to).map((block) => block.start);
|
|
267
|
-
return starts.map((start, index) => ({
|
|
268
|
-
start: index === 0 ? from : start,
|
|
269
|
-
end: starts[index + 1] ?? to,
|
|
270
|
-
}));
|
|
271
|
-
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare const MEDIA_TYPES: {
|
|
2
|
+
readonly html: 'text/html';
|
|
3
|
+
readonly css: 'text/css';
|
|
4
|
+
readonly javascript: 'text/javascript';
|
|
5
|
+
readonly plainText: 'text/plain';
|
|
6
|
+
readonly markdown: 'text/markdown';
|
|
7
|
+
readonly csv: 'text/csv';
|
|
8
|
+
readonly json: 'application/json';
|
|
9
|
+
readonly xml: 'application/xml';
|
|
10
|
+
readonly yaml: 'application/yaml';
|
|
11
|
+
readonly ndjson: 'application/x-ndjson';
|
|
12
|
+
readonly webManifest: 'application/manifest+json';
|
|
13
|
+
readonly reports: 'application/reports+json';
|
|
14
|
+
readonly githubJson: 'application/vnd.github+json';
|
|
15
|
+
readonly form: 'application/x-www-form-urlencoded';
|
|
16
|
+
readonly octetStream: 'application/octet-stream';
|
|
17
|
+
readonly gzip: 'application/gzip';
|
|
18
|
+
readonly tar: 'application/x-tar';
|
|
19
|
+
readonly zip: 'application/zip';
|
|
20
|
+
readonly gitBundle: 'application/x-git-bundle';
|
|
21
|
+
readonly wasm: 'application/wasm';
|
|
22
|
+
readonly pdf: 'application/pdf';
|
|
23
|
+
readonly docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
24
|
+
readonly pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
|
|
25
|
+
readonly xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
26
|
+
readonly avif: 'image/avif';
|
|
27
|
+
readonly gif: 'image/gif';
|
|
28
|
+
readonly heic: 'image/heic';
|
|
29
|
+
readonly icon: 'image/vnd.microsoft.icon';
|
|
30
|
+
readonly jpeg: 'image/jpeg';
|
|
31
|
+
readonly png: 'image/png';
|
|
32
|
+
readonly svg: 'image/svg+xml';
|
|
33
|
+
readonly webp: 'image/webp';
|
|
34
|
+
readonly aac: 'audio/aac';
|
|
35
|
+
readonly amr: 'audio/amr';
|
|
36
|
+
readonly m4a: 'audio/mp4';
|
|
37
|
+
readonly mp3: 'audio/mpeg';
|
|
38
|
+
readonly ogg: 'audio/ogg';
|
|
39
|
+
readonly wav: 'audio/wav';
|
|
40
|
+
readonly threeGpp: 'video/3gpp';
|
|
41
|
+
readonly mp4: 'video/mp4';
|
|
42
|
+
readonly quickTime: 'video/quicktime';
|
|
43
|
+
readonly webm: 'video/webm';
|
|
44
|
+
readonly otf: 'font/otf';
|
|
45
|
+
readonly ttf: 'font/ttf';
|
|
46
|
+
readonly woff: 'font/woff';
|
|
47
|
+
readonly woff2: 'font/woff2';
|
|
48
|
+
};
|
|
49
|
+
export declare function withCharset(type: string, charset: string): string;
|
|
50
|
+
export declare const UTF8_TEXT: {
|
|
51
|
+
readonly html: string;
|
|
52
|
+
readonly css: string;
|
|
53
|
+
readonly javascript: string;
|
|
54
|
+
readonly plainText: string;
|
|
55
|
+
readonly markdown: string;
|
|
56
|
+
readonly xml: string;
|
|
57
|
+
};
|
|
58
|
+
export declare const SCRIPT_MEDIA_TYPES: readonly string[];
|
|
59
|
+
export declare const FILE_MEDIA_TYPES: Readonly<Record<string, string>>;
|
|
60
|
+
export declare function servedMediaType(path: string): string;
|
|
61
|
+
export declare function fileExtension(type: string): string | null;
|
|
62
|
+
export declare function dataUrl(type: string, base64: string): string;
|
|
63
|
+
export declare function dataUrlPattern(types: readonly string[]): RegExp;
|
|
64
|
+
export declare function formDataType(boundary: string): string;
|
|
65
|
+
export declare function gitMediaType(service: string, part: 'advertisement' | 'request' | 'result'): string;
|
|
66
|
+
export declare function mediaTypeEssence(value: string): string;
|
|
67
|
+
export declare function declaresUtf8(value: string): boolean;
|
|
68
|
+
export declare function acceptsType(accept: string | undefined, type: string): boolean;
|
|
69
|
+
export declare function isImageType(value: string): boolean;
|
|
70
|
+
export declare function isVideoType(value: string): boolean;
|
|
71
|
+
export declare function isAudioType(value: string): boolean;
|
|
72
|
+
//# sourceMappingURL=media-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-type.d.ts","sourceRoot":"","sources":["../src/media-type.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;aACtB,IAAI,EAAE,WAAW;aACjB,GAAG,EAAE,UAAU;aACf,UAAU,EAAE,iBAAiB;aAC7B,SAAS,EA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