@agentshouse/mdmodel 0.1.0-ce4af152f38d8 → 0.1.0-ce60fddcab8ff
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 +193 -196
- 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 +25 -11
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +219 -125
- package/dist/document.d.ts +15 -8
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +764 -137
- 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 +6 -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 +31 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -11
- package/dist/indexed.d.ts +10 -0
- package/dist/indexed.d.ts.map +1 -0
- package/dist/indexed.js +63 -0
- package/dist/kinds.d.ts +9 -1
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +68 -0
- package/dist/markdown.d.ts +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/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 +21 -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 +143 -181
- 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 +90 -71
- 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/{date-time-format/schema.yaml → absent-optional-field/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/{absent-optional-field/schema.yaml → boolean-field/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/{boolean-field/schema.yaml → date-time-format/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/expected.json +3 -0
- package/fixtures/cases/lazy-list-item/library/item.md +10 -0
- 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/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.md +17 -0
- package/fixtures/cases/malformed-definition/{schema.yaml → schema.md} +2 -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.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/unique-in-app-schema/context.json +1 -0
- package/fixtures/cases/unique-in-app-schema/expected.json +5 -0
- package/fixtures/cases/unique-in-app-schema/schema.yaml +7 -0
- package/fixtures/cases/unique-indexed-field/context.json +1 -0
- package/fixtures/cases/unique-indexed-field/expected.json +1 -0
- package/fixtures/cases/unique-indexed-field/library/tickets/first.md +8 -0
- package/fixtures/cases/unique-indexed-field/library/tickets/second.md +8 -0
- package/fixtures/cases/unique-indexed-field/schema.md +9 -0
- package/fixtures/cases/unique-off-indexed-field/context.json +1 -0
- package/fixtures/cases/unique-off-indexed-field/expected.json +5 -0
- package/fixtures/cases/unique-off-indexed-field/schema.md +9 -0
- package/fixtures/cases/unlisted-reference-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/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 +29 -8
- package/fixtures/queries.json +600 -2
- package/fixtures/references.json +15 -0
- 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 -87
- 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 -821
- package/dist/project.d.ts +0 -22
- package/dist/project.d.ts.map +0 -1
- package/dist/project.js +0 -126
- package/dist/sections.d.ts +0 -11
- package/dist/sections.d.ts.map +0 -1
- package/dist/sections.js +0 -57
- 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/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/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 -408
- package/fixtures/projection.json +0 -254
- /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 → lazy-list-item}/context.json +0 -0
- /package/fixtures/cases/{section-item-kind → list-item-enum}/context.json +0 -0
- /package/fixtures/cases/{section-items → list-item-kind}/context.json +0 -0
- /package/fixtures/cases/{section-reference-path → list-items}/context.json +0 -0
- /package/fixtures/cases/{section-items → list-items}/library/other.md +0 -0
- /package/fixtures/cases/{section-reference-type → list-reference-path}/context.json +0 -0
- /package/fixtures/cases/{section-reference-path → list-reference-path}/library/other.md +0 -0
- /package/fixtures/cases/{structured-section → list-reference-type}/context.json +0 -0
- /package/fixtures/cases/{section-reference-type → list-reference-type}/library/note.md +0 -0
- /package/fixtures/cases/{frontmatter-schema/schema.yaml → unknown-type/schema.md} +0 -0
package/dist/query/match.js
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
import { byCodePoint, instantKey } from '../kinds.js';
|
|
2
2
|
import { dirname } from '../paths.js';
|
|
3
3
|
import { invalid, } from './language.js';
|
|
4
|
-
import { indexed,
|
|
4
|
+
import { indexed, placedIn } from './rows.js';
|
|
5
5
|
const BOUNDS = { gt: '>', gte: '>=', lt: '<', lte: '<=' };
|
|
6
|
-
function globbed(pattern) {
|
|
7
|
-
let source = '';
|
|
8
|
-
for (let at = 0; at < pattern.length; at += 1) {
|
|
9
|
-
const char = pattern[at];
|
|
10
|
-
if (char === '*')
|
|
11
|
-
source += '.*';
|
|
12
|
-
else if (char === '[') {
|
|
13
|
-
const end = pattern.indexOf(']', at);
|
|
14
|
-
source += pattern.slice(at, end + 1);
|
|
15
|
-
at = end;
|
|
16
|
-
}
|
|
17
|
-
else
|
|
18
|
-
source += char.replace(/[.\\^$+?()|{}/]/gu, '\\$&');
|
|
19
|
-
}
|
|
20
|
-
return new RegExp(`^${source}$`, 'u');
|
|
21
|
-
}
|
|
22
|
-
function reached(values, field) {
|
|
23
|
-
const { keys, places, glob } = placedOf(field, 'value');
|
|
24
|
-
const matched = glob ? globbed(places) : null;
|
|
25
|
-
return values.filter((row) => row.keys === keys && (matched === null ? row.places === places : matched.test(row.places)));
|
|
26
|
-
}
|
|
27
6
|
function holds(sign, operator) {
|
|
28
7
|
if (operator === '=')
|
|
29
8
|
return sign === 0;
|
|
@@ -59,7 +38,7 @@ function matching(values, held, wanted) {
|
|
|
59
38
|
(held.kind === 'array' && itemsOf(values, held).some((item) => same(item, value))));
|
|
60
39
|
}
|
|
61
40
|
function tested(values, field, test) {
|
|
62
|
-
const rows =
|
|
41
|
+
const rows = placedIn(values, field, 'value');
|
|
63
42
|
const present = rows.some((row) => row.item === -1);
|
|
64
43
|
if (test.op === 'exists')
|
|
65
44
|
return test.exists === present;
|
|
@@ -104,7 +83,7 @@ function scoped(candidate, scope) {
|
|
|
104
83
|
conditioned(indexed(candidate.path, candidate.fields, candidate.definition).values, scope.where)));
|
|
105
84
|
}
|
|
106
85
|
export function heldAt(candidate, field) {
|
|
107
|
-
return
|
|
86
|
+
return placedIn(indexed(candidate.path, candidate.fields, candidate.definition).values, field, 'value');
|
|
108
87
|
}
|
|
109
88
|
const UNHELD = ['size', 'created', 'updated', 'greatest'];
|
|
110
89
|
function answerable(plan) {
|
package/dist/query/rows.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ export type Placed = {
|
|
|
27
27
|
readonly glob: boolean;
|
|
28
28
|
};
|
|
29
29
|
export declare function placedOf(pointer: string, reach: Reach): Placed;
|
|
30
|
+
export declare function placedIn<Row extends {
|
|
31
|
+
readonly keys: string;
|
|
32
|
+
readonly places: string;
|
|
33
|
+
}>(rows: readonly Row[], pointer: string, reach: Reach): readonly Row[];
|
|
30
34
|
export declare function heldKind(value: unknown): HeldKind;
|
|
31
|
-
export declare function indexed(path: string, fields: Readonly<Record<string, unknown>>, definition: Pick<Definition, '
|
|
35
|
+
export declare function indexed(path: string, fields: Readonly<Record<string, unknown>>, definition: Pick<Definition, 'root'> | undefined): Indexed;
|
|
32
36
|
//# sourceMappingURL=rows.d.ts.map
|
package/dist/query/rows.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/query/rows.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,UAAU,EAEhB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEnG,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,Q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,KAAK,EAAE,OAAO,GAAG,QAAQ,CAMjD;AAgGD,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,SAAS,GAC/C,OAAO,CAcT"}
|
package/dist/query/rows.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ARRAY_INDEX, escapePointer, itemFacts, memberFacts, } from '../definition.js';
|
|
2
|
-
import {
|
|
2
|
+
import { instantOf } from '../kinds.js';
|
|
3
3
|
import { target } from '../paths.js';
|
|
4
4
|
export function placedOf(pointer, reach) {
|
|
5
5
|
const [first = '', ...rest] = pointer.split('/').slice(1);
|
|
@@ -25,6 +25,27 @@ export function placedOf(pointer, reach) {
|
|
|
25
25
|
glob: /[[*]/u.test(places),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
function globbed(pattern) {
|
|
29
|
+
let source = '';
|
|
30
|
+
for (let at = 0; at < pattern.length; at += 1) {
|
|
31
|
+
const char = pattern[at];
|
|
32
|
+
if (char === '*')
|
|
33
|
+
source += '.*';
|
|
34
|
+
else if (char === '[') {
|
|
35
|
+
const end = pattern.indexOf(']', at);
|
|
36
|
+
source += pattern.slice(at, end + 1);
|
|
37
|
+
at = end;
|
|
38
|
+
}
|
|
39
|
+
else
|
|
40
|
+
source += char.replace(/[.\\^$+?()|{}/]/gu, '\\$&');
|
|
41
|
+
}
|
|
42
|
+
return new RegExp(`^${source}$`, 'u');
|
|
43
|
+
}
|
|
44
|
+
export function placedIn(rows, pointer, reach) {
|
|
45
|
+
const { keys, places, glob } = placedOf(pointer, reach);
|
|
46
|
+
const matched = glob ? globbed(places) : null;
|
|
47
|
+
return rows.filter((row) => row.keys === keys && (matched === null ? row.places === places : matched.test(row.places)));
|
|
48
|
+
}
|
|
28
49
|
function placesOf({ done, head, tail }) {
|
|
29
50
|
return `${done}/${head}${tail}.`;
|
|
30
51
|
}
|
|
@@ -67,9 +88,6 @@ function scalarOf(value) {
|
|
|
67
88
|
return JSON.stringify(value);
|
|
68
89
|
return null;
|
|
69
90
|
}
|
|
70
|
-
function instantOf(facts, value) {
|
|
71
|
-
return facts !== undefined && kindOf(facts) === 'date-time' ? instantKey(value) : null;
|
|
72
|
-
}
|
|
73
91
|
function held(reading, at, places, value, items) {
|
|
74
92
|
reading.values.push({
|
|
75
93
|
keys: at.keys,
|
|
@@ -154,7 +172,7 @@ export function indexed(path, fields, definition) {
|
|
|
154
172
|
head: '',
|
|
155
173
|
tail: '',
|
|
156
174
|
exact: `/${segment}`,
|
|
157
|
-
facts: definition === undefined ? undefined : memberFacts(definition.
|
|
175
|
+
facts: definition === undefined ? undefined : memberFacts(definition.root, name),
|
|
158
176
|
});
|
|
159
177
|
}
|
|
160
178
|
return { values: reading.values, links: reading.links };
|
package/dist/query/sql.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type Following = {
|
|
|
19
19
|
readonly equal: Fragment;
|
|
20
20
|
};
|
|
21
21
|
export declare const VALUE_TABLE = "CREATE TABLE replica_values (doc INTEGER NOT NULL, keys TEXT NOT NULL, places TEXT NOT NULL, item INTEGER NOT NULL, kind TEXT NOT NULL, value, size INTEGER, instant TEXT, PRIMARY KEY (doc, keys, places, item)) WITHOUT ROWID";
|
|
22
|
+
export type Targets = (link: string, document: string) => Fragment;
|
|
22
23
|
export declare const HOLDS_PHRASE = "holds_phrase";
|
|
23
24
|
export declare function holdsPhrase(_context: number, text: unknown, phrase: unknown): number;
|
|
24
25
|
export declare function fragment(sql: string, bind?: readonly SqlValue[]): Fragment;
|
|
@@ -28,10 +29,15 @@ export declare function any(parts: readonly Fragment[]): Fragment;
|
|
|
28
29
|
export declare function grouped(part: Fragment): Fragment;
|
|
29
30
|
export declare function listed(values: readonly SqlValue[]): Fragment;
|
|
30
31
|
export declare function exists(part: Fragment): Fragment;
|
|
31
|
-
export
|
|
32
|
+
export type HeldValues = {
|
|
33
|
+
readonly doc: number;
|
|
34
|
+
readonly values: readonly HeldValue[];
|
|
35
|
+
};
|
|
36
|
+
export declare function insertedValues(held: readonly HeldValues[]): Fragment;
|
|
32
37
|
export declare function placed(alias: string, field: string, reach: Reach): Fragment;
|
|
33
38
|
export declare function scoped(alias: string, scope: Scope, byPaths?: boolean): Fragment;
|
|
34
39
|
export declare function tests(alias: string, plan: QueryPlan): Fragment;
|
|
40
|
+
export declare function hopped(alias: string, hop: NonNullable<QueryPlan['hop']>, targets: Targets): Fragment;
|
|
35
41
|
export declare function sortValue(kind: SqlValue | undefined, value: unknown, instant: SqlValue | undefined): unknown;
|
|
36
42
|
export declare function sorted(collate: Collate, term: Term): Fragment;
|
|
37
43
|
export declare function beyond(collate: Collate, term: Term, value: unknown): Following;
|
package/dist/query/sql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../src/query/sql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAU,SAAS,EAAE,KAAK,EAAe,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;AAEpE,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,CAAC;AAE5F,MAAM,M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K,CAAC,CAAC,EAClC,OAAO,EAAE,OAAO,GACf,QAAQ,CAeV;AAUD,wBAAgB,SAAS,CACvB,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,QAAQ,GAAG,SAAS,WAG9B;AAsDD,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,CAc7D;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,CAgC9E;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAM9E"}
|
package/dist/query/sql.js
CHANGED
|
@@ -54,9 +54,9 @@ function scalarText(value) {
|
|
|
54
54
|
return '-Infinity';
|
|
55
55
|
return JSON.stringify(value);
|
|
56
56
|
}
|
|
57
|
-
export function insertedValues(
|
|
58
|
-
const rows = values.map((value) => `[${JSON.stringify(value.keys)},${JSON.stringify(value.places)},${value.item},${JSON.stringify(value.kind)},${scalarText(value.value)},${JSON.stringify(value.size)},${JSON.stringify(value.instant)}]`);
|
|
59
|
-
return fragment('INSERT INTO replica_values (doc, keys, places, item, kind, value, size, instant) SELECT
|
|
57
|
+
export function insertedValues(held) {
|
|
58
|
+
const rows = held.flatMap(({ doc, values }) => values.map((value) => `[${doc},${JSON.stringify(value.keys)},${JSON.stringify(value.places)},${value.item},${JSON.stringify(value.kind)},${scalarText(value.value)},${JSON.stringify(value.size)},${JSON.stringify(value.instant)}]`));
|
|
59
|
+
return fragment('INSERT INTO replica_values (doc, keys, places, item, kind, value, size, instant) SELECT value ->> 0, value ->> 1, value ->> 2, value ->> 3, value ->> 4, value ->> 5, value ->> 6, value ->> 7 FROM json_each(?)', [`[${rows.join(',')}]`]);
|
|
60
60
|
}
|
|
61
61
|
export function placed(alias, field, reach) {
|
|
62
62
|
const { keys, places, glob } = placedOf(field, reach);
|
|
@@ -182,6 +182,17 @@ export function tests(alias, plan) {
|
|
|
182
182
|
: [fragment(`${HOLDS_PHRASE}(${alias}.content, ?)`, [plan.text.toLowerCase()])]),
|
|
183
183
|
]);
|
|
184
184
|
}
|
|
185
|
+
export function hopped(alias, hop, targets) {
|
|
186
|
+
const linked = exists(joined([
|
|
187
|
+
fragment('SELECT 1 FROM replica_links l JOIN '),
|
|
188
|
+
targets('l', 'm'),
|
|
189
|
+
fragment(` WHERE l.doc = ${alias}.id AND l.kind = 'field' AND `),
|
|
190
|
+
grouped(placed('l', hop.field, 'link')),
|
|
191
|
+
fragment(' AND '),
|
|
192
|
+
grouped(scoped('m', hop)),
|
|
193
|
+
], ''));
|
|
194
|
+
return hop.none ? not(linked) : linked;
|
|
195
|
+
}
|
|
185
196
|
function instantMark(value) {
|
|
186
197
|
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
187
198
|
return null;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type Definition } from '../definition.js';
|
|
2
|
+
import type { VerifiedModel } from '../types.js';
|
|
3
|
+
import { type Direction, type QueryPlan } from './language.js';
|
|
4
|
+
export type KeyBound = {
|
|
5
|
+
readonly key: Uint8Array;
|
|
6
|
+
readonly inclusive: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type KeyRange = {
|
|
9
|
+
readonly lower: KeyBound;
|
|
10
|
+
readonly upper: KeyBound | null;
|
|
11
|
+
};
|
|
12
|
+
export type WalkRun = {
|
|
13
|
+
readonly by: 'key';
|
|
14
|
+
readonly key: Uint8Array;
|
|
15
|
+
readonly after: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
readonly by: 'range';
|
|
18
|
+
readonly range: KeyRange;
|
|
19
|
+
};
|
|
20
|
+
export type PageOrder = {
|
|
21
|
+
readonly by: 'path';
|
|
22
|
+
readonly direction: Direction;
|
|
23
|
+
} | {
|
|
24
|
+
readonly by: 'field';
|
|
25
|
+
readonly field: string;
|
|
26
|
+
readonly direction: Direction;
|
|
27
|
+
readonly nulls: 'first' | 'last';
|
|
28
|
+
readonly lexical: boolean;
|
|
29
|
+
readonly after: {
|
|
30
|
+
readonly key: Uint8Array;
|
|
31
|
+
readonly tie: unknown;
|
|
32
|
+
} | null;
|
|
33
|
+
};
|
|
34
|
+
export type Walk = {
|
|
35
|
+
readonly by: 'path';
|
|
36
|
+
readonly direction: Direction;
|
|
37
|
+
} | {
|
|
38
|
+
readonly by: 'keys';
|
|
39
|
+
readonly field: string;
|
|
40
|
+
readonly direction: Direction;
|
|
41
|
+
readonly types: readonly {
|
|
42
|
+
readonly type: string;
|
|
43
|
+
readonly keys: readonly Uint8Array[];
|
|
44
|
+
}[];
|
|
45
|
+
} | {
|
|
46
|
+
readonly by: 'order';
|
|
47
|
+
readonly field: string;
|
|
48
|
+
readonly direction: Direction;
|
|
49
|
+
readonly types: readonly {
|
|
50
|
+
readonly type: string;
|
|
51
|
+
readonly runs: readonly WalkRun[];
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
export type Count = {
|
|
55
|
+
readonly walk: Walk;
|
|
56
|
+
readonly fields: readonly string[];
|
|
57
|
+
};
|
|
58
|
+
export type WalkedFacts = {
|
|
59
|
+
readonly path: string;
|
|
60
|
+
readonly type: string | null;
|
|
61
|
+
readonly fields: Readonly<Record<string, unknown>> | null;
|
|
62
|
+
};
|
|
63
|
+
export declare function pageOrder(plan: QueryPlan): PageOrder;
|
|
64
|
+
export declare function walkOf(plan: QueryPlan, model: VerifiedModel): Walk;
|
|
65
|
+
export declare function countShape(plan: QueryPlan): boolean;
|
|
66
|
+
export declare function countOf(plan: QueryPlan, model: VerifiedModel, where: unknown): Count | null;
|
|
67
|
+
export declare function walkedValue(definition: Definition, field: string, value: unknown): unknown;
|
|
68
|
+
export declare function hopTargets(plan: QueryPlan, model: VerifiedModel, row: WalkedFacts): string[];
|
|
69
|
+
//# sourceMappingURL=walk.d.ts.map
|
|
@@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BAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAwBpD;AA2ED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CA6BlE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAoBnD;AAwCD,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,GAAG,IAAI,CAqB3F;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAG1F;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,EAAE,CAO5F"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { escapePointer, pointerSegments } from '../definition.js';
|
|
2
|
+
import { byCodePoint, indexKey, instantOf, sortedKey } from '../kinds.js';
|
|
3
|
+
import { definitionAt } from '../validate.js';
|
|
4
|
+
import { plain } from '../yaml.js';
|
|
5
|
+
import { invalid, textless, } from './language.js';
|
|
6
|
+
import { indexed, placedIn } from './rows.js';
|
|
7
|
+
function keyOrder(left, right) {
|
|
8
|
+
for (let at = 0; at < Math.min(left.length, right.length); at += 1) {
|
|
9
|
+
if (left[at] !== right[at])
|
|
10
|
+
return left[at] - right[at];
|
|
11
|
+
}
|
|
12
|
+
return left.length - right.length;
|
|
13
|
+
}
|
|
14
|
+
function tighter(held, bound, sign) {
|
|
15
|
+
if (held === null)
|
|
16
|
+
return bound;
|
|
17
|
+
const order = sign * keyOrder(bound.key, held.key);
|
|
18
|
+
return order > 0 || (order === 0 && !bound.inclusive) ? bound : held;
|
|
19
|
+
}
|
|
20
|
+
function everyValue(facts) {
|
|
21
|
+
return { lower: { key: indexKey(facts, null), inclusive: false }, upper: null };
|
|
22
|
+
}
|
|
23
|
+
function rangeOf(facts, bounds) {
|
|
24
|
+
let { lower } = everyValue(facts);
|
|
25
|
+
let upper = null;
|
|
26
|
+
for (const [operator, value] of bounds) {
|
|
27
|
+
const bound = { key: indexKey(facts, value), inclusive: operator.endsWith('e') };
|
|
28
|
+
if (operator.startsWith('g'))
|
|
29
|
+
lower = tighter(lower, bound, 1);
|
|
30
|
+
else
|
|
31
|
+
upper = tighter(upper, bound, -1);
|
|
32
|
+
}
|
|
33
|
+
return { lower, upper };
|
|
34
|
+
}
|
|
35
|
+
function distinct(keys) {
|
|
36
|
+
return [...new Map(keys.map((key) => [key.join(','), key])).values()];
|
|
37
|
+
}
|
|
38
|
+
function testedKeys(facts, test) {
|
|
39
|
+
if (test.op === 'eq')
|
|
40
|
+
return { keys: [indexKey(facts, test.value)] };
|
|
41
|
+
if (test.op === 'in')
|
|
42
|
+
return { keys: distinct(test.values.map((value) => indexKey(facts, value))) };
|
|
43
|
+
if (test.op === 'range')
|
|
44
|
+
return { range: rangeOf(facts, test.bounds) };
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
function conjuncts(where) {
|
|
48
|
+
if (where === null || 'some' in where)
|
|
49
|
+
return [];
|
|
50
|
+
return 'every' in where ? where.every.flatMap(conjuncts) : [where];
|
|
51
|
+
}
|
|
52
|
+
function named(pointer) {
|
|
53
|
+
const segments = pointerSegments(pointer);
|
|
54
|
+
return segments.length === 1 ? segments[0] : null;
|
|
55
|
+
}
|
|
56
|
+
function indexing(model, types, field) {
|
|
57
|
+
const definitions = types.map((type) => Object.hasOwn(model.types, type) ? model.types[type] : null);
|
|
58
|
+
return definitions.every((definition) => definition?.indexed?.includes(field) === true)
|
|
59
|
+
? definitions
|
|
60
|
+
: null;
|
|
61
|
+
}
|
|
62
|
+
function afterOf(plan) {
|
|
63
|
+
const values = plan.after?.values ?? null;
|
|
64
|
+
if (values === null)
|
|
65
|
+
return null;
|
|
66
|
+
const key = sortedKey(values[0]);
|
|
67
|
+
if (key === null)
|
|
68
|
+
invalid('after', 'expects the next an earlier result of this query returned');
|
|
69
|
+
return { key, tie: values[1] };
|
|
70
|
+
}
|
|
71
|
+
export function pageOrder(plan) {
|
|
72
|
+
if (plan.shape.kind !== 'documents')
|
|
73
|
+
return invalid('groupBy', 'a page answers Documents');
|
|
74
|
+
const [term, second] = plan.shape.orderBy;
|
|
75
|
+
if (second !== undefined)
|
|
76
|
+
invalid(['orderBy', 1], 'a page orders by one term');
|
|
77
|
+
if (term === undefined)
|
|
78
|
+
return { by: 'path', direction: 'asc' };
|
|
79
|
+
const { key, options } = term;
|
|
80
|
+
if (key.of === 'path') {
|
|
81
|
+
if (options.stringSort !== 'lexical')
|
|
82
|
+
invalid(['orderBy', 0, 'stringSort'], 'a page orders Paths by code point, as lexical');
|
|
83
|
+
return { by: 'path', direction: options.direction };
|
|
84
|
+
}
|
|
85
|
+
const field = key.of === 'field' ? named(key.field) : null;
|
|
86
|
+
if (field === null)
|
|
87
|
+
return invalid(['orderBy', 0, 'by'], 'a page orders by Path or by a field its types index');
|
|
88
|
+
if (plan.root.types === null)
|
|
89
|
+
invalid('types', 'an order by a field names the types whose index it walks');
|
|
90
|
+
return {
|
|
91
|
+
by: 'field',
|
|
92
|
+
field,
|
|
93
|
+
direction: options.direction,
|
|
94
|
+
nulls: options.nulls ?? 'first',
|
|
95
|
+
lexical: options.stringSort === 'lexical',
|
|
96
|
+
after: afterOf(plan),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function keysWalk(plan, model, direction) {
|
|
100
|
+
const types = plan.root.types;
|
|
101
|
+
for (const { field: pointer, test } of conjuncts(plan.root.where)) {
|
|
102
|
+
const field = named(pointer);
|
|
103
|
+
if (types === null || field === null || (test.op !== 'eq' && test.op !== 'in'))
|
|
104
|
+
continue;
|
|
105
|
+
const definitions = indexing(model, types, field);
|
|
106
|
+
if (definitions === null)
|
|
107
|
+
continue;
|
|
108
|
+
return {
|
|
109
|
+
by: 'keys',
|
|
110
|
+
field,
|
|
111
|
+
direction,
|
|
112
|
+
types: definitions.map((definition) => ({
|
|
113
|
+
type: definition.name,
|
|
114
|
+
keys: testedKeys(definition.fields[field], test).keys,
|
|
115
|
+
})),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return { by: 'path', direction };
|
|
119
|
+
}
|
|
120
|
+
function common(types) {
|
|
121
|
+
const [first, ...rest] = types;
|
|
122
|
+
return (first?.indexed ?? [])
|
|
123
|
+
.filter((field) => rest.every((definition) => definition.indexed?.includes(field)))
|
|
124
|
+
.map((field) => `/${escapePointer(field)}`);
|
|
125
|
+
}
|
|
126
|
+
function ranged(facts, tests) {
|
|
127
|
+
if (tests.length === 0)
|
|
128
|
+
return null;
|
|
129
|
+
return tests
|
|
130
|
+
.map(({ test }) => testedKeys(facts, test).range)
|
|
131
|
+
.reduce((held, range) => ({
|
|
132
|
+
lower: tighter(held.lower, range.lower, 1),
|
|
133
|
+
upper: range.upper === null ? held.upper : tighter(held.upper, range.upper, -1),
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
function past(range, key, direction) {
|
|
137
|
+
const beyond = { key, inclusive: false };
|
|
138
|
+
return direction === 'asc'
|
|
139
|
+
? { ...range, lower: tighter(range.lower, beyond, 1) }
|
|
140
|
+
: { ...range, upper: tighter(range.upper, beyond, -1) };
|
|
141
|
+
}
|
|
142
|
+
function runsOf(facts, order, range) {
|
|
143
|
+
const missing = indexKey(facts, null);
|
|
144
|
+
const cursor = order.after?.key ?? null;
|
|
145
|
+
const amongNulls = cursor !== null && keyOrder(cursor, missing) === 0;
|
|
146
|
+
const nulls = range === null ? [{ by: 'key', key: missing, after: amongNulls }] : [];
|
|
147
|
+
const span = range ?? everyValue(facts);
|
|
148
|
+
if (cursor === null || amongNulls) {
|
|
149
|
+
if (order.nulls === 'first')
|
|
150
|
+
return [...nulls, { by: 'range', range: span }];
|
|
151
|
+
return amongNulls ? nulls : [{ by: 'range', range: span }, ...nulls];
|
|
152
|
+
}
|
|
153
|
+
const values = [
|
|
154
|
+
{ by: 'key', key: cursor, after: true },
|
|
155
|
+
{ by: 'range', range: past(span, cursor, order.direction) },
|
|
156
|
+
];
|
|
157
|
+
return order.nulls === 'first' ? values : [...values, ...nulls];
|
|
158
|
+
}
|
|
159
|
+
function unindexed(model, types, at, problem) {
|
|
160
|
+
const declared = types.flatMap((type) => Object.hasOwn(model.types, type) ? [model.types[type]] : []);
|
|
161
|
+
return invalid(at, problem, declared.length === types.length ? common(declared) : []);
|
|
162
|
+
}
|
|
163
|
+
export function walkOf(plan, model) {
|
|
164
|
+
const order = pageOrder(plan);
|
|
165
|
+
if (order.by === 'path')
|
|
166
|
+
return keysWalk(plan, model, order.direction);
|
|
167
|
+
const types = plan.root.types;
|
|
168
|
+
const definitions = indexing(model, types, order.field);
|
|
169
|
+
if (definitions === null)
|
|
170
|
+
return unindexed(model, types, ['orderBy', 0, 'by'], 'orders by a field every type it names indexes');
|
|
171
|
+
if (!order.lexical &&
|
|
172
|
+
definitions.some((definition) => !textless(definition.fields[order.field])))
|
|
173
|
+
invalid(['orderBy', 0, 'stringSort'], 'a page orders text by code point, as lexical');
|
|
174
|
+
const bounding = conjuncts(plan.root.where).filter(({ field, test }) => test.op === 'range' && named(field) === order.field);
|
|
175
|
+
return {
|
|
176
|
+
by: 'order',
|
|
177
|
+
field: order.field,
|
|
178
|
+
direction: order.direction,
|
|
179
|
+
types: definitions.map((definition) => {
|
|
180
|
+
const facts = definition.fields[order.field];
|
|
181
|
+
return { type: definition.name, runs: runsOf(facts, order, ranged(facts, bounding)) };
|
|
182
|
+
}),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export function countShape(plan) {
|
|
186
|
+
const { shape } = plan;
|
|
187
|
+
if (shape.kind === 'documents' && !plan.total)
|
|
188
|
+
return false;
|
|
189
|
+
if (plan.root.types === null)
|
|
190
|
+
invalid('types', 'a count names the types whose index it reads');
|
|
191
|
+
if (plan.text !== null)
|
|
192
|
+
invalid('text', 'a count tests no text');
|
|
193
|
+
if (plan.hop !== null)
|
|
194
|
+
invalid('hop', 'a count tests no hop');
|
|
195
|
+
if (shape.kind === 'documents')
|
|
196
|
+
return true;
|
|
197
|
+
if (plan.total)
|
|
198
|
+
invalid('total', 'a page of groups answers no total');
|
|
199
|
+
const key = shape.groupBy[0];
|
|
200
|
+
if (shape.groupBy.length > 1)
|
|
201
|
+
invalid(['groupBy', 1], 'a page groups by one field');
|
|
202
|
+
if (key.of !== 'field' || named(key.field) === null)
|
|
203
|
+
invalid(['groupBy', 0], 'a page groups by a field its types index');
|
|
204
|
+
for (const part of ['size', 'updated', 'greatest'])
|
|
205
|
+
if (shape[part] !== false && shape[part] !== null)
|
|
206
|
+
invalid(['select', part], 'a group selects only its count');
|
|
207
|
+
shape.orderBy.forEach(({ by }, index) => {
|
|
208
|
+
if (typeof by === 'string' && by !== 'count')
|
|
209
|
+
invalid(['orderBy', index, 'by'], 'a page of groups orders by its count or its key');
|
|
210
|
+
});
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
function testedPlaces(where, at) {
|
|
214
|
+
if (!plain(where))
|
|
215
|
+
return [];
|
|
216
|
+
return Object.keys(where)
|
|
217
|
+
.sort()
|
|
218
|
+
.flatMap((name) => name === '$and' || name === '$or'
|
|
219
|
+
? where[name].flatMap((part, index) => testedPlaces(part, [...at, name, index]))
|
|
220
|
+
: [{ pointer: name, place: [...at, name] }]);
|
|
221
|
+
}
|
|
222
|
+
function countWalk(plan, model) {
|
|
223
|
+
const keyed = keysWalk(plan, model, 'asc');
|
|
224
|
+
if (keyed.by !== 'path')
|
|
225
|
+
return keyed;
|
|
226
|
+
const tests = conjuncts(plan.root.where);
|
|
227
|
+
for (const { field: pointer, test } of tests) {
|
|
228
|
+
const field = named(pointer);
|
|
229
|
+
if (test.op !== 'range' || field === null)
|
|
230
|
+
continue;
|
|
231
|
+
const definitions = indexing(model, plan.root.types, field);
|
|
232
|
+
if (definitions === null)
|
|
233
|
+
continue;
|
|
234
|
+
const bounding = tests.filter((bounded) => bounded.test.op === 'range' && bounded.field === pointer);
|
|
235
|
+
return {
|
|
236
|
+
by: 'order',
|
|
237
|
+
field,
|
|
238
|
+
direction: 'asc',
|
|
239
|
+
types: definitions.map((definition) => ({
|
|
240
|
+
type: definition.name,
|
|
241
|
+
runs: [{ by: 'range', range: ranged(definition.fields[field], bounding) }],
|
|
242
|
+
})),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
return keyed;
|
|
246
|
+
}
|
|
247
|
+
export function countOf(plan, model, where) {
|
|
248
|
+
if (!countShape(plan))
|
|
249
|
+
return null;
|
|
250
|
+
const types = plan.root.types;
|
|
251
|
+
const grouped = plan.shape.kind === 'groups'
|
|
252
|
+
? [{ pointer: plan.shape.groupBy[0].field, place: ['groupBy', 0] }]
|
|
253
|
+
: [];
|
|
254
|
+
const fields = [...grouped, ...testedPlaces(where, ['where'])].map(({ pointer, place }) => {
|
|
255
|
+
const field = named(pointer);
|
|
256
|
+
if (field === null || indexing(model, types, field) === null)
|
|
257
|
+
return unindexed(model, types, place, place[0] === 'groupBy'
|
|
258
|
+
? 'groups by a field every type it names indexes'
|
|
259
|
+
: 'a count tests only fields every type it names indexes');
|
|
260
|
+
return field;
|
|
261
|
+
});
|
|
262
|
+
return { walk: countWalk(plan, model), fields: [...new Set(fields)].sort() };
|
|
263
|
+
}
|
|
264
|
+
export function walkedValue(definition, field, value) {
|
|
265
|
+
const instant = instantOf(definition.fields[field], value);
|
|
266
|
+
return instant === null ? (value ?? null) : { instant };
|
|
267
|
+
}
|
|
268
|
+
export function hopTargets(plan, model, row) {
|
|
269
|
+
if (plan.hop === null || row.type === null || row.fields === null)
|
|
270
|
+
return [];
|
|
271
|
+
const definition = definitionAt(model, row.path)(row.type);
|
|
272
|
+
const { links } = indexed(row.path, row.fields, definition);
|
|
273
|
+
return [...new Set(placedIn(links, plan.hop.field, 'link').map(({ target }) => target))].sort(byCodePoint);
|
|
274
|
+
}
|
package/dist/references.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Definition } from './definition.js';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function references(document: Pick<
|
|
2
|
+
import type { Document, Reference } from './types.js';
|
|
3
|
+
export declare function references(document: Pick<Document, 'fields'>, definition: Definition): readonly Reference[];
|
|
4
4
|
//# sourceMappingURL=references.d.ts.map
|
package/dist/references.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,UAAU,EAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA8BtD,wBAAgB,UAAU,CACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAClC,UAAU,EAAE,UAAU,GACrB,SAAS,SAAS,EAAE,CAItB"}
|
package/dist/references.js
CHANGED
|
@@ -25,6 +25,6 @@ function collect(value, facts, pointer, found) {
|
|
|
25
25
|
}
|
|
26
26
|
export function references(document, definition) {
|
|
27
27
|
const found = [];
|
|
28
|
-
collect(document.fields, definition.
|
|
28
|
+
collect(document.fields, definition.root, '', found);
|
|
29
29
|
return found;
|
|
30
30
|
}
|
package/dist/refuse.d.ts
CHANGED
package/dist/refuse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refuse.d.ts","sourceRoot":"","sources":["../src/refuse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"refuse.d.ts","sourceRoot":"","sources":["../src/refuse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC1E,OAAO,CAQT"}
|
package/dist/refuse.js
CHANGED
|
@@ -3,6 +3,7 @@ export function refusal(file, rule, extra) {
|
|
|
3
3
|
file,
|
|
4
4
|
rule,
|
|
5
5
|
...(extra?.location === undefined ? {} : { location: extra.location }),
|
|
6
|
+
...(extra?.line === undefined ? {} : { line: extra.line }),
|
|
6
7
|
...(extra?.referrers === undefined ? {} : { referrers: extra.referrers }),
|
|
7
8
|
};
|
|
8
9
|
}
|
package/dist/reserved.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const ROOM_DESCRIPTION = "ROOM.md";
|
|
2
2
|
export declare const CAPTURE_HOME = "capture";
|
|
3
3
|
export declare const RESERVED_NAMES: readonly string[];
|
|
4
|
+
export declare function foldedName(name: string): string;
|
|
4
5
|
export declare function isReservedName(name: string): boolean;
|
|
5
6
|
export declare function isDocumentPath(path: string): boolean;
|
|
6
7
|
//# sourceMappingURL=reserved.d.ts.map
|
package/dist/reserved.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reserved.d.ts","sourceRoot":"","sources":["../src/reserved.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAO3C,CAAC;
|
|
1
|
+
{"version":3,"file":"reserved.d.ts","sourceRoot":"","sources":["../src/reserved.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAO3C,CAAC;AAYF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAID,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGpD"}
|
package/dist/reserved.js
CHANGED
|
@@ -8,12 +8,23 @@ export const RESERVED_NAMES = [
|
|
|
8
8
|
'agents',
|
|
9
9
|
'house',
|
|
10
10
|
];
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const DOTLESS_I = 'ı';
|
|
12
|
+
const CHEROKEE_SMALL = /[\u13F8-\u13FD\uAB70-\uABBF]/u;
|
|
13
|
+
function foldedPoint(point) {
|
|
14
|
+
if (point === DOTLESS_I)
|
|
15
|
+
return point;
|
|
16
|
+
const folded = point.toLowerCase().toUpperCase().toLowerCase();
|
|
17
|
+
return CHEROKEE_SMALL.test(folded) ? folded.toUpperCase() : folded;
|
|
13
18
|
}
|
|
14
|
-
|
|
19
|
+
export function foldedName(name) {
|
|
20
|
+
let folded = '';
|
|
21
|
+
for (const point of name.normalize('NFC'))
|
|
22
|
+
folded += foldedPoint(point);
|
|
23
|
+
return folded.normalize('NFC');
|
|
24
|
+
}
|
|
25
|
+
const FOLDED_RESERVED_NAMES = new Set(RESERVED_NAMES.map(foldedName));
|
|
15
26
|
export function isReservedName(name) {
|
|
16
|
-
return FOLDED_RESERVED_NAMES.has(
|
|
27
|
+
return FOLDED_RESERVED_NAMES.has(foldedName(name));
|
|
17
28
|
}
|
|
18
29
|
export function isDocumentPath(path) {
|
|
19
30
|
const first = path.split('/', 1)[0];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const CHAT_TYPE = "chat";
|
|
2
|
+
export declare const CHAT_MESSAGE_TYPE = "chat-message";
|
|
3
|
+
export declare const INBOX_TYPES: readonly string[];
|
|
4
|
+
export declare const INBOX_CHANNEL_KINDS: readonly ['telegram-bot', 'telegram-business', 'whatsapp', 'messenger', 'instagram', 'tiktok', 'viber'];
|
|
5
|
+
export type InboxChannelKind = (typeof INBOX_CHANNEL_KINDS)[number];
|
|
6
|
+
export declare const VIEW_TYPE = "view";
|
|
7
|
+
export declare const ROOM_TYPES_TEXT: string;
|
|
8
|
+
//# sourceMappingURL=room-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room-types.d.ts","sourceRoot":"","sources":["../src/room-types.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EAAmC,CAAC;AAE7E,eAAO,MAAM,mBAAmB,YAC9B,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,OAAO,CACC,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAMpE,eAAO,MAAM,SAAS,SAAS,CAAC;AA8BhC,eAAO,MAAM,eAAe,QAuGhB,CAAC"}
|