@agentshouse/mdmodel 0.1.0-cdbd463e01dc2 → 0.1.0-ce47d8f9de14a
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 +182 -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 +23 -10
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +175 -119
- package/dist/document.d.ts +15 -8
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +769 -140
- package/dist/event.d.ts +3 -4
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +17 -47
- package/dist/facts.d.ts +2 -2
- package/dist/facts.d.ts.map +1 -1
- package/dist/facts.js +4 -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 +934 -0
- package/dist/house-model.d.ts.map +1 -0
- package/dist/house-model.js +513 -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 +9 -0
- package/dist/house-references/patterns.d.ts.map +1 -0
- package/dist/house-references/patterns.js +13 -0
- package/dist/index.d.ts +34 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -12
- 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 +4 -2
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +60 -11
- package/dist/markdown.d.ts +71 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +232 -0
- 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 +107 -22
- package/dist/pattern.d.ts.map +1 -1
- package/dist/pattern.js +4 -3
- package/dist/query/language.d.ts +39 -5
- package/dist/query/language.d.ts.map +1 -1
- package/dist/query/language.js +84 -28
- package/dist/query/match.d.ts +1 -1
- package/dist/query/match.d.ts.map +1 -1
- package/dist/query/match.js +37 -8
- package/dist/query/rows.d.ts +1 -1
- package/dist/query/rows.d.ts.map +1 -1
- package/dist/query/rows.js +2 -5
- package/dist/query/sql.d.ts +7 -1
- package/dist/query/sql.d.ts.map +1 -1
- package/dist/query/sql.js +21 -4
- package/dist/query/walk.d.ts +63 -0
- package/dist/query/walk.d.ts.map +1 -0
- package/dist/query/walk.js +263 -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 +2 -0
- package/dist/reserved.d.ts.map +1 -1
- package/dist/reserved.js +17 -5
- package/dist/room-types.d.ts +7 -0
- package/dist/room-types.d.ts.map +1 -0
- package/dist/room-types.js +137 -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 +15 -38
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +9 -4
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +145 -164
- package/dist/yaml.d.ts +7 -5
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +158 -44
- package/fixtures/README.md +77 -69
- package/fixtures/cases/absent-link-dangles/library/item.md +1 -1
- package/fixtures/cases/absent-link-dangles/schema.yaml +2 -3
- 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 +10 -11
- package/fixtures/cases/absolute-link/library/item.md +1 -1
- package/fixtures/cases/absolute-link/schema.yaml +2 -3
- 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-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-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/binary-any-reference/expected.json +2 -1
- package/fixtures/cases/binary-any-reference/library/notes/draft.md +1 -1
- 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-typed-reference/expected.json +2 -1
- package/fixtures/cases/binary-typed-reference/library/notes/draft.md +1 -1
- 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 +10 -11
- package/fixtures/cases/bracketed-link-definition/library/item.md +1 -1
- package/fixtures/cases/bracketed-link-definition/schema.yaml +2 -3
- 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 +10 -11
- package/fixtures/cases/composed-root-reference/library/a.md +2 -2
- 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.yaml +13 -0
- package/fixtures/cases/cross-room-link/library/clients/acme.md +1 -1
- package/fixtures/cases/cross-room-reference/library/clients/acme.md +4 -4
- package/fixtures/cases/cross-room-reference/schema.yaml +1 -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 +10 -11
- 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.yaml +10 -11
- 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.yaml +10 -11
- 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.yaml +10 -11
- package/fixtures/cases/duplicate-link-definition/library/item.md +1 -1
- package/fixtures/cases/duplicate-link-definition/schema.yaml +2 -3
- 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.yaml +10 -11
- package/fixtures/cases/equal-labels/expected.json +5 -0
- package/fixtures/cases/equal-labels/schema.yaml +4 -0
- package/fixtures/cases/fenced-link-definition/library/item.md +1 -1
- package/fixtures/cases/fenced-link-definition/schema.yaml +2 -3
- 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.yaml +3 -4
- 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.yaml +10 -11
- 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.yaml +10 -11
- 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.yaml +9 -0
- package/fixtures/cases/lazy-list-item/expected.json +3 -0
- package/fixtures/cases/lazy-list-item/library/item.md +10 -0
- package/fixtures/cases/lazy-list-item/schema.yaml +3 -0
- package/fixtures/cases/link-into-a-reserved-name/library/notes/a.md +1 -1
- 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.yaml +3 -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.yaml +3 -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.yaml +10 -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.yaml +10 -11
- 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.yaml +10 -11
- 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-reference-path/expected.json +7 -0
- package/fixtures/cases/list-reference-path/library/page.md +5 -0
- package/fixtures/cases/list-reference-path/schema.yaml +3 -0
- package/fixtures/cases/list-reference-type/context.json +1 -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.yaml +3 -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.yaml +10 -11
- package/fixtures/cases/long-value-past-six-levels/context.json +1 -0
- package/fixtures/cases/long-value-past-six-levels/expected.json +5 -0
- package/fixtures/cases/long-value-past-six-levels/schema.yaml +15 -0
- package/fixtures/cases/malformed-list/context.json +1 -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.yaml +6 -0
- package/fixtures/cases/member-document/library/people/ana.md +2 -2
- package/fixtures/cases/member-on-another-type/library/note.md +1 -1
- package/fixtures/cases/missing-required-field/library/item.md +1 -1
- package/fixtures/cases/missing-required-field/schema.yaml +3 -4
- 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.yaml +10 -11
- 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.yaml +5 -0
- package/fixtures/cases/nested-defs/expected.json +2 -1
- package/fixtures/cases/nested-defs/library/deal.md +3 -3
- 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-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-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.yaml +10 -11
- 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.yaml +10 -11
- 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.yaml +5 -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.yaml +4 -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.yaml +10 -11
- 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/prototype-field/expected.json +2 -1
- package/fixtures/cases/prototype-field/library/item.md +2 -2
- package/fixtures/cases/prototype-field/schema.yaml +2 -3
- 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-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.yaml +10 -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.yaml +3 -4
- 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.yaml +10 -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 → sections-keyword-refused}/schema.yaml +1 -2
- package/fixtures/cases/shortcut-reference-link/library/item.md +1 -1
- package/fixtures/cases/shortcut-reference-link/schema.yaml +2 -3
- 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.yaml +10 -11
- package/fixtures/cases/submission-keys/library/notes/visitor.md +2 -2
- package/fixtures/cases/text-field-kind/expected.json +1 -4
- package/fixtures/cases/text-field-kind/library/page.md +1 -1
- 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.yaml +3 -0
- package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/one.md +1 -1
- package/fixtures/cases/types-folder-content/library/types/task.md +1 -1
- 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.yaml +2 -3
- package/fixtures/cases/unevaluated-items-closed/expected.json +2 -1
- package/fixtures/cases/unevaluated-items-closed/library/trip.md +13 -3
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/library/rooms/team/tasks/plan.md +2 -1
- package/fixtures/cases/unnamed-typed-path-names-a-type/library/rooms/team/tasks/plan.md +3 -2
- package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/tasks/plan.md +3 -2
- package/fixtures/cases/unnamed-typed-path-without-a-body/library/rooms/team/tasks/plan.md +2 -2
- package/fixtures/cases/unresolved-link/library/item.md +1 -1
- package/fixtures/cases/unresolved-link/schema.yaml +2 -3
- 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.yaml +5 -6
- package/fixtures/forms.json +371 -0
- package/fixtures/preamble.json +29 -8
- package/fixtures/queries.json +651 -2
- package/package.json +10 -1
- package/dist/blocks.d.ts +0 -11
- package/dist/blocks.d.ts.map +0 -1
- package/dist/blocks.js +0 -91
- package/dist/divide.d.ts +0 -3
- package/dist/divide.d.ts.map +0 -1
- package/dist/divide.js +0 -320
- package/dist/links.d.ts +0 -29
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js +0 -831
- package/dist/profile.d.ts +0 -6
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -5
- package/dist/project.d.ts +0 -22
- package/dist/project.d.ts.map +0 -1
- package/dist/project.js +0 -128
- package/dist/sections.d.ts +0 -11
- package/dist/sections.d.ts.map +0 -1
- package/dist/sections.js +0 -57
- package/fixtures/cases/conditional-section/schema.yaml +0 -14
- 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/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/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/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/structured-section/expected.json +0 -6
- package/fixtures/division.json +0 -409
- package/fixtures/projection.json +0 -255
- /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/{missing-section-item-kind → conditional-long-text}/context.json +0 -0
- /package/fixtures/cases/{null-refused → equal-labels}/context.json +0 -0
- /package/fixtures/cases/{open-map-value → frontmatter-construct}/context.json +0 -0
- /package/fixtures/cases/{section-item-enum → labels-in-the-rooms-language}/context.json +0 -0
- /package/fixtures/cases/{section-item-kind → lazy-list-item}/context.json +0 -0
- /package/fixtures/cases/{section-items → list-item-enum}/context.json +0 -0
- /package/fixtures/cases/{section-reference-path → list-item-kind}/context.json +0 -0
- /package/fixtures/cases/{section-reference-type → list-items}/context.json +0 -0
- /package/fixtures/cases/{section-items → list-items}/library/other.md +0 -0
- /package/fixtures/cases/{structured-section → 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}/library/note.md +0 -0
|
@@ -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,EAAE,YAAY;aACvB,QAAQ,EAAE,eAAe;aACzB,GAAG,EAAE,UAAU;aACf,IAAI,EAAE,kBAAkB;aACxB,GAAG,EAAE,iBAAiB;aACtB,IAAI,EAAE,kBAAkB;aACxB,MAAM,EAAE,sBAAsB;aAC9B,WAAW,EAAE,2BAA2B;aACxC,OAAO,EAAE,0BAA0B;aACnC,UAAU,EAAE,6BAA6B;aACzC,IAAI,EAAE,mCAAmC;aACzC,WAAW,EAAE,0BAA0B;aACvC,IAAI,EAAE,kBAAkB;aACxB,GAAG,EAAE,mBAAmB;aACxB,GAAG,EAAE,iBAAiB;aACtB,SAAS,EAAE,0BAA0B;aACrC,IAAI,EAAE,kBAAkB;aACxB,GAAG,EAAE,iBAAiB;aACtB,IAAI,EAAE,yEAAyE;aAC/E,IAAI,EAAE,2EAA2E;aACjF,IAAI,EAAE,mEAAmE;aACzE,IAAI,EAAE,YAAY;aAClB,GAAG,EAAE,WAAW;aAChB,IAAI,EAAE,YAAY;aAClB,IAAI,EAAE,0BAA0B;aAChC,IAAI,EAAE,YAAY;aAClB,GAAG,EAAE,WAAW;aAChB,GAAG,EAAE,eAAe;aACpB,IAAI,EAAE,YAAY;aAClB,GAAG,EAAE,WAAW;aAChB,GAAG,EAAE,WAAW;aAChB,GAAG,EAAE,WAAW;aAChB,GAAG,EAAE,YAAY;aACjB,GAAG,EAAE,WAAW;aAChB,GAAG,EAAE,WAAW;aAChB,QAAQ,EAAE,YAAY;aACtB,GAAG,EAAE,WAAW;aAChB,SAAS,EAAE,iBAAiB;aAC5B,IAAI,EAAE,YAAY;aAClB,GAAG,EAAE,UAAU;aACf,GAAG,EAAE,UAAU;aACf,IAAI,EAAE,WAAW;aACjB,KAAK,EAAE,YAAY;CACX,CAAC;AAIX,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjE;AAMD,eAAO,MAAM,SAAS;aACpB,IAAI;aACJ,GAAG;aACH,UAAU;aACV,SAAS;aACT,QAAQ;aACR,GAAG;CACK,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAK/C,CAAC;AAyCF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAM7D,CAAC;AAEF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOpD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5D;AAMD,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAM/D;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,eAAe,GAAG,SAAS,GAAG,QAAQ,GAC3C,MAAM,CAER;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGnD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7E;AAMD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export const MEDIA_TYPES = {
|
|
2
|
+
html: 'text/html',
|
|
3
|
+
css: 'text/css',
|
|
4
|
+
javascript: 'text/javascript',
|
|
5
|
+
plainText: 'text/plain',
|
|
6
|
+
markdown: 'text/markdown',
|
|
7
|
+
csv: 'text/csv',
|
|
8
|
+
json: 'application/json',
|
|
9
|
+
xml: 'application/xml',
|
|
10
|
+
yaml: 'application/yaml',
|
|
11
|
+
ndjson: 'application/x-ndjson',
|
|
12
|
+
webManifest: 'application/manifest+json',
|
|
13
|
+
reports: 'application/reports+json',
|
|
14
|
+
githubJson: 'application/vnd.github+json',
|
|
15
|
+
form: 'application/x-www-form-urlencoded',
|
|
16
|
+
octetStream: 'application/octet-stream',
|
|
17
|
+
gzip: 'application/gzip',
|
|
18
|
+
tar: 'application/x-tar',
|
|
19
|
+
zip: 'application/zip',
|
|
20
|
+
gitBundle: 'application/x-git-bundle',
|
|
21
|
+
wasm: 'application/wasm',
|
|
22
|
+
pdf: 'application/pdf',
|
|
23
|
+
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
24
|
+
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
25
|
+
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
26
|
+
avif: 'image/avif',
|
|
27
|
+
gif: 'image/gif',
|
|
28
|
+
heic: 'image/heic',
|
|
29
|
+
icon: 'image/vnd.microsoft.icon',
|
|
30
|
+
jpeg: 'image/jpeg',
|
|
31
|
+
png: 'image/png',
|
|
32
|
+
svg: 'image/svg+xml',
|
|
33
|
+
webp: 'image/webp',
|
|
34
|
+
aac: 'audio/aac',
|
|
35
|
+
amr: 'audio/amr',
|
|
36
|
+
m4a: 'audio/mp4',
|
|
37
|
+
mp3: 'audio/mpeg',
|
|
38
|
+
ogg: 'audio/ogg',
|
|
39
|
+
wav: 'audio/wav',
|
|
40
|
+
threeGpp: 'video/3gpp',
|
|
41
|
+
mp4: 'video/mp4',
|
|
42
|
+
quickTime: 'video/quicktime',
|
|
43
|
+
webm: 'video/webm',
|
|
44
|
+
otf: 'font/otf',
|
|
45
|
+
ttf: 'font/ttf',
|
|
46
|
+
woff: 'font/woff',
|
|
47
|
+
woff2: 'font/woff2',
|
|
48
|
+
};
|
|
49
|
+
const UTF8 = 'utf-8';
|
|
50
|
+
export function withCharset(type, charset) {
|
|
51
|
+
return `${type}; charset=${charset}`;
|
|
52
|
+
}
|
|
53
|
+
function utf8(type) {
|
|
54
|
+
return withCharset(type, UTF8);
|
|
55
|
+
}
|
|
56
|
+
export const UTF8_TEXT = {
|
|
57
|
+
html: utf8(MEDIA_TYPES.html),
|
|
58
|
+
css: utf8(MEDIA_TYPES.css),
|
|
59
|
+
javascript: utf8(MEDIA_TYPES.javascript),
|
|
60
|
+
plainText: utf8(MEDIA_TYPES.plainText),
|
|
61
|
+
markdown: utf8(MEDIA_TYPES.markdown),
|
|
62
|
+
xml: utf8(MEDIA_TYPES.xml),
|
|
63
|
+
};
|
|
64
|
+
export const SCRIPT_MEDIA_TYPES = [
|
|
65
|
+
MEDIA_TYPES.javascript,
|
|
66
|
+
'application/javascript',
|
|
67
|
+
'text/ecmascript',
|
|
68
|
+
'application/ecmascript',
|
|
69
|
+
];
|
|
70
|
+
const FILE_TYPES = [
|
|
71
|
+
[MEDIA_TYPES.aac, 'aac'],
|
|
72
|
+
[MEDIA_TYPES.amr, 'amr'],
|
|
73
|
+
[MEDIA_TYPES.avif, 'avif'],
|
|
74
|
+
[MEDIA_TYPES.css, 'css'],
|
|
75
|
+
[MEDIA_TYPES.csv, 'csv'],
|
|
76
|
+
[MEDIA_TYPES.docx, 'docx'],
|
|
77
|
+
[MEDIA_TYPES.gif, 'gif'],
|
|
78
|
+
[MEDIA_TYPES.heic, 'heic'],
|
|
79
|
+
[MEDIA_TYPES.html, 'html'],
|
|
80
|
+
[MEDIA_TYPES.icon, 'ico'],
|
|
81
|
+
[MEDIA_TYPES.javascript, 'js', 'mjs'],
|
|
82
|
+
[MEDIA_TYPES.jpeg, 'jpg', 'jpeg'],
|
|
83
|
+
[MEDIA_TYPES.json, 'json', 'map'],
|
|
84
|
+
[MEDIA_TYPES.m4a, 'm4a'],
|
|
85
|
+
[MEDIA_TYPES.markdown, 'md'],
|
|
86
|
+
[MEDIA_TYPES.mp3, 'mp3'],
|
|
87
|
+
[MEDIA_TYPES.mp4, 'mp4'],
|
|
88
|
+
[MEDIA_TYPES.ogg, 'ogg'],
|
|
89
|
+
[MEDIA_TYPES.otf, 'otf'],
|
|
90
|
+
[MEDIA_TYPES.pdf, 'pdf'],
|
|
91
|
+
[MEDIA_TYPES.plainText, 'txt'],
|
|
92
|
+
[MEDIA_TYPES.png, 'png'],
|
|
93
|
+
[MEDIA_TYPES.pptx, 'pptx'],
|
|
94
|
+
[MEDIA_TYPES.quickTime, 'mov'],
|
|
95
|
+
[MEDIA_TYPES.svg, 'svg'],
|
|
96
|
+
[MEDIA_TYPES.threeGpp, '3gp'],
|
|
97
|
+
[MEDIA_TYPES.ttf, 'ttf'],
|
|
98
|
+
[MEDIA_TYPES.wasm, 'wasm'],
|
|
99
|
+
[MEDIA_TYPES.wav, 'wav'],
|
|
100
|
+
[MEDIA_TYPES.webm, 'webm'],
|
|
101
|
+
[MEDIA_TYPES.webManifest, 'webmanifest'],
|
|
102
|
+
[MEDIA_TYPES.webp, 'webp'],
|
|
103
|
+
[MEDIA_TYPES.woff, 'woff'],
|
|
104
|
+
[MEDIA_TYPES.woff2, 'woff2'],
|
|
105
|
+
[MEDIA_TYPES.xlsx, 'xlsx'],
|
|
106
|
+
[MEDIA_TYPES.zip, 'zip'],
|
|
107
|
+
];
|
|
108
|
+
export const FILE_MEDIA_TYPES = FILE_TYPES.reduce((table, [type, ...extensions]) => extensions.reduce((named, extension) => ({ ...named, [extension]: type }), table), {});
|
|
109
|
+
export function servedMediaType(path) {
|
|
110
|
+
const dot = path.lastIndexOf('.');
|
|
111
|
+
const extension = dot === -1 ? '' : path.slice(dot + 1).toLowerCase();
|
|
112
|
+
const type = FILE_TYPES.find(([, ...extensions]) => extensions.includes(extension))?.[0] ??
|
|
113
|
+
MEDIA_TYPES.octetStream;
|
|
114
|
+
return type.startsWith('text/') ? utf8(type) : type;
|
|
115
|
+
}
|
|
116
|
+
export function fileExtension(type) {
|
|
117
|
+
const essence = mediaTypeEssence(type);
|
|
118
|
+
return FILE_TYPES.find(([named]) => named === essence)?.[1] ?? null;
|
|
119
|
+
}
|
|
120
|
+
export function dataUrl(type, base64) {
|
|
121
|
+
return `data:${type};base64,${base64}`;
|
|
122
|
+
}
|
|
123
|
+
function caseless(text) {
|
|
124
|
+
return text.replace(/[a-z]/gu, (letter) => `[${letter}${letter.toUpperCase()}]`);
|
|
125
|
+
}
|
|
126
|
+
export function dataUrlPattern(types) {
|
|
127
|
+
const named = types.map((type) => caseless(type).replace(/[+.]/gu, '\\$&')).join('|');
|
|
128
|
+
return new RegExp(`^${caseless('data:')}(${named});${caseless('base64')},([A-Za-z0-9+/]+={0,2})$`, 'u');
|
|
129
|
+
}
|
|
130
|
+
export function formDataType(boundary) {
|
|
131
|
+
return `multipart/form-data; boundary=${boundary}`;
|
|
132
|
+
}
|
|
133
|
+
export function gitMediaType(service, part) {
|
|
134
|
+
return `application/x-${service}-${part}`;
|
|
135
|
+
}
|
|
136
|
+
export function mediaTypeEssence(value) {
|
|
137
|
+
return value.split(';', 1)[0].trim().toLowerCase();
|
|
138
|
+
}
|
|
139
|
+
export function declaresUtf8(value) {
|
|
140
|
+
const match = /;\s*charset\s*=\s*(?:"([^"]*)"|([^;\s]*))/iu.exec(value);
|
|
141
|
+
return match === null || (match[1] ?? match[2]).toLowerCase() === UTF8;
|
|
142
|
+
}
|
|
143
|
+
export function acceptsType(accept, type) {
|
|
144
|
+
return (accept ?? '').split(',').some((range) => mediaTypeEssence(range) === type);
|
|
145
|
+
}
|
|
146
|
+
function ofTopLevel(value, top) {
|
|
147
|
+
return mediaTypeEssence(value).startsWith(`${top}/`);
|
|
148
|
+
}
|
|
149
|
+
export function isImageType(value) {
|
|
150
|
+
return ofTopLevel(value, 'image');
|
|
151
|
+
}
|
|
152
|
+
export function isVideoType(value) {
|
|
153
|
+
return ofTopLevel(value, 'video');
|
|
154
|
+
}
|
|
155
|
+
export function isAudioType(value) {
|
|
156
|
+
return ofTopLevel(value, 'audio');
|
|
157
|
+
}
|
package/dist/moment.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MomentReader {
|
|
2
|
+
readonly language: string;
|
|
3
|
+
readonly zone: string | null;
|
|
4
|
+
}
|
|
5
|
+
export declare function shownMoment(at: Date, reader: MomentReader): string;
|
|
6
|
+
export declare function shownDay(at: Date, reader: MomentReader): string;
|
|
7
|
+
//# sourceMappingURL=moment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moment.d.ts","sourceRoot":"","sources":["../src/moment.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAWD,wBAAgB,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAOlE;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAE/D"}
|
package/dist/moment.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const DAY = { day: 'numeric', month: 'short', year: 'numeric' };
|
|
2
|
+
function shown(at, reader, form) {
|
|
3
|
+
return new Intl.DateTimeFormat(reader.language, {
|
|
4
|
+
...form,
|
|
5
|
+
timeZone: reader.zone ?? 'UTC',
|
|
6
|
+
}).format(at);
|
|
7
|
+
}
|
|
8
|
+
export function shownMoment(at, reader) {
|
|
9
|
+
return shown(at, reader, {
|
|
10
|
+
...DAY,
|
|
11
|
+
hour: '2-digit',
|
|
12
|
+
minute: '2-digit',
|
|
13
|
+
...(reader.zone === null ? { timeZoneName: 'short' } : {}),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function shownDay(at, reader) {
|
|
17
|
+
return shown(at, reader, DAY);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-ready.d.ts","sourceRoot":"","sources":["../src/not-ready.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// A Room answered not ready is asked again after these waits, the last repeating, so a chunk build that catches up within seconds installs at once and a long one is asked every 15 seconds.
|
|
2
|
+
const NOT_READY_WAITS_MS = [1_000, 2_000, 3_000, 5_000, 8_000, 11_000, 15_000];
|
|
3
|
+
export function notReadyWaitMs(asked) {
|
|
4
|
+
return NOT_READY_WAITS_MS[Math.min(asked, NOT_READY_WAITS_MS.length - 1)];
|
|
5
|
+
}
|
package/dist/paths.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type RoomTarget = {
|
|
|
6
6
|
readonly handle: string;
|
|
7
7
|
readonly path: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type Classified = {
|
|
10
10
|
kind: 'skip';
|
|
11
11
|
} | {
|
|
12
12
|
kind: 'path';
|
|
@@ -16,11 +16,26 @@ export declare function classifyHref(from: string, href: string): {
|
|
|
16
16
|
} & RoomTarget) | {
|
|
17
17
|
kind: 'invalid';
|
|
18
18
|
};
|
|
19
|
+
export declare function classifyHref(from: string, href: string): Classified;
|
|
19
20
|
export declare function roomTarget(href: string): RoomTarget | null;
|
|
20
21
|
export declare function roomPath(href: string): string | null;
|
|
21
22
|
export declare function target(from: string, href: string): string | null;
|
|
23
|
+
export interface LinkedPath {
|
|
24
|
+
readonly handle: string | null;
|
|
25
|
+
readonly path: string;
|
|
26
|
+
readonly fragment: string | null;
|
|
27
|
+
}
|
|
28
|
+
export declare function linkedPath(from: string, href: string): LinkedPath | null;
|
|
29
|
+
export interface KeyedLink extends RoomTarget {
|
|
30
|
+
readonly key: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function keyedLink(href: string): KeyedLink | null;
|
|
33
|
+
export declare function urlDestination(url: string): string;
|
|
34
|
+
export declare function keyedDestination(path: string, key: string): string;
|
|
22
35
|
export declare function retarget(href: string, to: string): string;
|
|
23
36
|
export declare function relative(from: string, target: string): string;
|
|
24
37
|
export declare const SHELL_ROOMS = "/rooms/";
|
|
25
38
|
export declare function shellTarget(href: string, handle: string): string | null;
|
|
39
|
+
export declare function destinationText(to: string, bracketed: boolean): string | null;
|
|
40
|
+
export {};
|
|
26
41
|
//# sourceMappingURL=paths.d.ts.map
|
package/dist/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAUA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYrD;AA6DD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW3D;AAmBD,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAiB5E,KAAK,UAAU,GACX;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAAC,GAC/B;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAgBxB,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAGnE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAG1D;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGpD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGhE;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAaxE;AAID,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOxD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAgBD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAGzD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAW7D;AAED,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMvE;AAoBD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAI7E"}
|
package/dist/paths.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { decodeNamedCharacterReference } from 'decode-named-character-reference';
|
|
2
2
|
import { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';
|
|
3
|
-
|
|
3
|
+
const BACKSLASH = 0x5c;
|
|
4
|
+
const PUNCTUATION = /^[!-/:-@[-`{-~]$/;
|
|
5
|
+
function escapes(text, index) {
|
|
6
|
+
return text.charCodeAt(index) === BACKSLASH && PUNCTUATION.test(text[index + 1] ?? '');
|
|
7
|
+
}
|
|
4
8
|
export function dirname(path) {
|
|
5
9
|
const index = path.lastIndexOf('/');
|
|
6
10
|
return index === -1 ? '' : path.slice(0, index);
|
|
@@ -43,19 +47,23 @@ function referenceAt(text, at) {
|
|
|
43
47
|
end,
|
|
44
48
|
};
|
|
45
49
|
}
|
|
46
|
-
function
|
|
47
|
-
let
|
|
48
|
-
let i =
|
|
50
|
+
function spelled(written, from, stops) {
|
|
51
|
+
let text = '';
|
|
52
|
+
let i = from;
|
|
49
53
|
while (i < written.length) {
|
|
50
54
|
const escaped = escapes(written, i);
|
|
51
55
|
const reference = escaped || written[i] !== '&' ? null : referenceAt(written, i);
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
return {
|
|
55
|
-
|
|
56
|
+
const one = escaped ? written[i + 1] : (reference?.text ?? written[i]);
|
|
57
|
+
if (stops && (one.startsWith('?') || one.startsWith('#')))
|
|
58
|
+
return { text, end: i };
|
|
59
|
+
text += one;
|
|
56
60
|
i = escaped ? i + 2 : (reference?.end ?? i + 1);
|
|
57
61
|
}
|
|
58
|
-
return {
|
|
62
|
+
return { text, end: written.length };
|
|
63
|
+
}
|
|
64
|
+
function unescaped(written) {
|
|
65
|
+
const { text, end } = spelled(written, 0, true);
|
|
66
|
+
return { base: text, suffix: end };
|
|
59
67
|
}
|
|
60
68
|
function located(href) {
|
|
61
69
|
const written = href.trim();
|
|
@@ -86,16 +94,17 @@ export function destinationPath(href) {
|
|
|
86
94
|
path += base.slice(cursor, match.index) + decoded;
|
|
87
95
|
cursor = match.index + match[0].length;
|
|
88
96
|
}
|
|
89
|
-
return path + base.slice(cursor);
|
|
97
|
+
return (path + base.slice(cursor)).normalize('NFC');
|
|
90
98
|
}
|
|
99
|
+
const SPACE = /\s/u;
|
|
91
100
|
function written(path) {
|
|
92
101
|
let text = '';
|
|
93
102
|
for (let i = 0; i < path.length; i += 1) {
|
|
94
103
|
const char = path[i];
|
|
95
104
|
if (char === '?' || char === '#' || char < ' ')
|
|
96
105
|
text += encodeURIComponent(char);
|
|
97
|
-
else if (char
|
|
98
|
-
text +=
|
|
106
|
+
else if (SPACE.test(char) && (i === 0 || i === path.length - 1))
|
|
107
|
+
text += encodeURIComponent(char);
|
|
99
108
|
else if (char === '%' && PERCENT.test(path.slice(i)))
|
|
100
109
|
text += '%25';
|
|
101
110
|
else if (escapes(path, i))
|
|
@@ -107,18 +116,22 @@ function written(path) {
|
|
|
107
116
|
}
|
|
108
117
|
return text;
|
|
109
118
|
}
|
|
110
|
-
function
|
|
119
|
+
function roomAt(path) {
|
|
111
120
|
if (!path.startsWith(SHELL_ROOMS))
|
|
112
121
|
return null;
|
|
113
122
|
const rest = path.slice(SHELL_ROOMS.length);
|
|
114
123
|
const slash = rest.indexOf('/');
|
|
115
|
-
const handle = rest.slice(0, slash);
|
|
116
|
-
if (
|
|
124
|
+
const handle = slash === -1 ? rest : rest.slice(0, slash);
|
|
125
|
+
if (handle === '' || handle === '.' || handle === '..')
|
|
117
126
|
return null;
|
|
118
|
-
const within = normalize(rest.slice(slash + 1));
|
|
119
|
-
return within === null
|
|
127
|
+
const within = normalize(slash === -1 ? '' : rest.slice(slash + 1));
|
|
128
|
+
return within === null ? null : { handle, path: within };
|
|
120
129
|
}
|
|
121
|
-
|
|
130
|
+
function roomTargetOf(path) {
|
|
131
|
+
const room = roomAt(path);
|
|
132
|
+
return room === null || room.path === '' ? null : room;
|
|
133
|
+
}
|
|
134
|
+
function resolvedOf(from, href) {
|
|
122
135
|
const base = located(href).base;
|
|
123
136
|
if (base === '')
|
|
124
137
|
return { kind: 'skip' };
|
|
@@ -128,13 +141,15 @@ export function classifyHref(from, href) {
|
|
|
128
141
|
if (path === null)
|
|
129
142
|
return { kind: 'invalid' };
|
|
130
143
|
if (path.startsWith('/')) {
|
|
131
|
-
const room =
|
|
144
|
+
const room = roomAt(path);
|
|
132
145
|
return room === null ? { kind: 'invalid' } : { kind: 'room', ...room };
|
|
133
146
|
}
|
|
134
147
|
const resolved = normalize(join(dirname(from), path));
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
148
|
+
return resolved === null ? { kind: 'invalid' } : { kind: 'path', path: resolved };
|
|
149
|
+
}
|
|
150
|
+
export function classifyHref(from, href) {
|
|
151
|
+
const resolved = resolvedOf(from, href);
|
|
152
|
+
return 'path' in resolved && resolved.path === '' ? { kind: 'invalid' } : resolved;
|
|
138
153
|
}
|
|
139
154
|
export function roomTarget(href) {
|
|
140
155
|
const path = destinationPath(href);
|
|
@@ -148,6 +163,49 @@ export function target(from, href) {
|
|
|
148
163
|
const resolved = classifyHref(from, href);
|
|
149
164
|
return resolved.kind === 'path' ? resolved.path : null;
|
|
150
165
|
}
|
|
166
|
+
export function linkedPath(from, href) {
|
|
167
|
+
const resolved = located(href).base === '' ? { kind: 'path', path: from } : resolvedOf(from, href);
|
|
168
|
+
if (!('path' in resolved))
|
|
169
|
+
return null;
|
|
170
|
+
const written = href.trim();
|
|
171
|
+
const suffix = spelled(written, unescaped(written).suffix, false).text;
|
|
172
|
+
const hash = suffix.indexOf('#');
|
|
173
|
+
const fragment = hash === -1 ? '' : suffix.slice(hash + 1);
|
|
174
|
+
return {
|
|
175
|
+
handle: resolved.kind === 'room' ? resolved.handle : null,
|
|
176
|
+
path: resolved.path,
|
|
177
|
+
fragment: fragment === '' ? null : (decodedRun(fragment) ?? fragment),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
const LINK_KEY = /^\?key=([A-Za-z0-9._~-]+)(?:#|$)/u;
|
|
181
|
+
export function keyedLink(href) {
|
|
182
|
+
const written = href.trim();
|
|
183
|
+
if (!written.includes('?') && !written.includes('&'))
|
|
184
|
+
return null;
|
|
185
|
+
const key = LINK_KEY.exec(spelled(written, unescaped(written).suffix, false).text)?.[1];
|
|
186
|
+
if (key === undefined)
|
|
187
|
+
return null;
|
|
188
|
+
const room = roomTarget(href);
|
|
189
|
+
return room === null ? null : { ...room, key };
|
|
190
|
+
}
|
|
191
|
+
export function urlDestination(url) {
|
|
192
|
+
return url.replace(/[\\&]/g, '\\$&');
|
|
193
|
+
}
|
|
194
|
+
const URL_KEPT = /^[A-Za-z0-9._~-]$/u;
|
|
195
|
+
function urlSegment(name) {
|
|
196
|
+
let text = '';
|
|
197
|
+
for (const char of name) {
|
|
198
|
+
const point = char.codePointAt(0);
|
|
199
|
+
text +=
|
|
200
|
+
point >= 0x80 || URL_KEPT.test(char)
|
|
201
|
+
? char
|
|
202
|
+
: `%${point.toString(16).toUpperCase().padStart(2, '0')}`;
|
|
203
|
+
}
|
|
204
|
+
return text;
|
|
205
|
+
}
|
|
206
|
+
export function keyedDestination(path, key) {
|
|
207
|
+
return `${path.split('/').map(urlSegment).join('/')}?key=${key}`;
|
|
208
|
+
}
|
|
151
209
|
export function retarget(href, to) {
|
|
152
210
|
const trimmed = href.trim();
|
|
153
211
|
return written(to) + trimmed.slice(unescaped(trimmed).suffix);
|
|
@@ -173,3 +231,30 @@ export function shellTarget(href, handle) {
|
|
|
173
231
|
const path = normalize(decoded.slice(prefix.length));
|
|
174
232
|
return path === null || path === '' ? null : path;
|
|
175
233
|
}
|
|
234
|
+
function fitsBare(to) {
|
|
235
|
+
if (to === '' || to.startsWith('<'))
|
|
236
|
+
return false;
|
|
237
|
+
let depth = 0;
|
|
238
|
+
for (const character of to) {
|
|
239
|
+
if (/[\s\u0000-\u001f\u007f]/.test(character))
|
|
240
|
+
return false;
|
|
241
|
+
if (character === '(')
|
|
242
|
+
depth += 1;
|
|
243
|
+
else if (character === ')') {
|
|
244
|
+
if (depth === 0)
|
|
245
|
+
return false;
|
|
246
|
+
depth -= 1;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return depth === 0;
|
|
250
|
+
}
|
|
251
|
+
function fitsBrackets(to) {
|
|
252
|
+
return to !== '' && !/[<>\n\r]/.test(to);
|
|
253
|
+
}
|
|
254
|
+
export function destinationText(to, bracketed) {
|
|
255
|
+
if (fitsBare(to))
|
|
256
|
+
return bracketed && fitsBrackets(to) ? `<${to}>` : to;
|
|
257
|
+
if (fitsBrackets(to))
|
|
258
|
+
return `<${to}>`;
|
|
259
|
+
return null;
|
|
260
|
+
}
|
package/dist/pattern.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../src/pattern.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,OAAQ,CAAC;AAMpC,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AAQ9C,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../src/pattern.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,OAAQ,CAAC;AAMpC,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AAQ9C,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;CAAE,CAAC;AAkUnE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAM5D;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAkBnD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,IAAI,CAM9C"}
|
package/dist/pattern.js
CHANGED
|
@@ -262,10 +262,11 @@ class Linear {
|
|
|
262
262
|
const marks = this.marks;
|
|
263
263
|
const budget = scope ?? { left: VISIT_BUDGET };
|
|
264
264
|
let seeds = [];
|
|
265
|
-
let
|
|
265
|
+
let wordBefore = false;
|
|
266
266
|
for (let at = 0;;) {
|
|
267
267
|
const point = at < text.length ? text.codePointAt(at) : -1;
|
|
268
|
-
const
|
|
268
|
+
const wordAt = word(point);
|
|
269
|
+
const across = wordBefore !== wordAt;
|
|
269
270
|
const generation = (this.generation += 1);
|
|
270
271
|
const active = [];
|
|
271
272
|
seeds.push(this.start);
|
|
@@ -291,7 +292,7 @@ class Linear {
|
|
|
291
292
|
for (const state of active)
|
|
292
293
|
if (atoms[alternates[state]].holds(point))
|
|
293
294
|
seeds.push(outs[state]);
|
|
294
|
-
|
|
295
|
+
wordBefore = wordAt;
|
|
295
296
|
at += point > 0xffff ? 2 : 1;
|
|
296
297
|
}
|
|
297
298
|
}
|