@agentshouse/mdmodel 0.1.0-alpha.8 → 0.1.0-c03f6cf931ca0
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 +424 -0
- package/README.md +41 -183
- 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 +86 -31
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +850 -135
- package/dist/divide.d.ts +3 -0
- package/dist/divide.d.ts.map +1 -0
- package/dist/divide.js +321 -0
- package/dist/document.d.ts +19 -3
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +1007 -188
- package/dist/event.d.ts +77 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +200 -0
- package/dist/facts.d.ts +15 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/facts.js +41 -0
- package/dist/fields.d.ts +6 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +10 -0
- 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 +836 -0
- package/dist/house-model.d.ts.map +1 -0
- package/dist/house-model.js +463 -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 +41 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -5
- package/dist/kinds.d.ts +18 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/kinds.js +150 -0
- package/dist/markdown.d.ts +75 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +265 -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/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 +25 -5
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +206 -35
- package/dist/pattern.d.ts +10 -0
- package/dist/pattern.d.ts.map +1 -0
- package/dist/pattern.js +356 -0
- package/dist/project.d.ts +20 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +83 -78
- package/dist/query/language.d.ts +254 -0
- package/dist/query/language.d.ts.map +1 -0
- package/dist/query/language.js +620 -0
- package/dist/query/match.d.ts +14 -0
- package/dist/query/match.d.ts.map +1 -0
- package/dist/query/match.js +150 -0
- package/dist/query/rows.d.ts +32 -0
- package/dist/query/rows.d.ts.map +1 -0
- package/dist/query/rows.js +161 -0
- package/dist/query/sql.d.ts +39 -0
- package/dist/query/sql.d.ts.map +1 -0
- package/dist/query/sql.js +285 -0
- package/dist/references.d.ts +4 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +30 -0
- package/dist/refuse.d.ts +1 -0
- package/dist/refuse.d.ts.map +1 -1
- package/dist/refuse.js +3 -10
- package/dist/reserved.d.ts +6 -0
- package/dist/reserved.d.ts.map +1 -0
- package/dist/reserved.js +21 -0
- package/dist/room-types.d.ts +7 -0
- package/dist/room-types.d.ts.map +1 -0
- package/dist/room-types.js +136 -0
- package/dist/schema.d.ts +6 -5
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +143 -41
- package/dist/types.d.ts +101 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -3
- package/dist/validate.d.ts +35 -2
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +388 -153
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -3
- package/dist/yaml.d.ts +9 -3
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +327 -202
- package/fixtures/README.md +128 -55
- package/fixtures/cases/absent-link-dangles/library/item.md +8 -0
- package/fixtures/cases/absent-link-dangles/schema.yaml +5 -0
- package/fixtures/cases/absent-optional-field/expected.json +1 -0
- package/fixtures/cases/absent-optional-field/library/companies/acme.md +4 -0
- package/fixtures/cases/absent-optional-field/library/deals/lead.md +6 -0
- package/fixtures/cases/absent-optional-field/schema.yaml +55 -0
- package/fixtures/cases/absolute-link/context.json +1 -0
- package/fixtures/cases/absolute-link/expected.json +5 -0
- package/fixtures/cases/absolute-link/library/item.md +8 -0
- package/fixtures/cases/absolute-link/schema.yaml +5 -0
- package/fixtures/cases/attachment-reference-any-file/context.json +1 -0
- package/fixtures/cases/attachment-reference-any-file/expected.json +1 -0
- package/fixtures/cases/attachment-reference-any-file/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/deals/renewal.md +18 -0
- package/fixtures/cases/attachment-reference-any-file/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-any-file/schema.yaml +32 -0
- package/fixtures/cases/attachment-reference-dangles/context.json +1 -0
- package/fixtures/cases/attachment-reference-dangles/expected.json +1 -0
- package/fixtures/cases/attachment-reference-dangles/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/deals/renewal.md +18 -0
- package/fixtures/cases/attachment-reference-dangles/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-dangles/schema.yaml +32 -0
- package/fixtures/cases/attachment-reference-outside/context.json +1 -0
- package/fixtures/cases/attachment-reference-outside/expected.json +7 -0
- package/fixtures/cases/attachment-reference-outside/library/companies/acme.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/deals/renewal.md +18 -0
- package/fixtures/cases/attachment-reference-outside/library/places/depot.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/products/seats.md +4 -0
- package/fixtures/cases/attachment-reference-outside/library/products/support.md +4 -0
- package/fixtures/cases/attachment-reference-outside/schema.yaml +32 -0
- package/fixtures/cases/binary-any-reference/expected.json +2 -2
- package/fixtures/cases/binary-any-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-any-reference/schema.yaml +4 -0
- package/fixtures/cases/binary-document-collision/expected.json +1 -2
- package/fixtures/cases/binary-document-collision/schema.yaml +1 -0
- package/fixtures/cases/binary-image-dangles/expected.json +1 -0
- package/fixtures/cases/binary-image-dangles/schema.yaml +1 -0
- package/fixtures/cases/binary-link-dangles/expected.json +1 -0
- package/fixtures/cases/binary-link-dangles/schema.yaml +1 -0
- package/fixtures/cases/binary-link-outside-collection/expected.json +1 -2
- package/fixtures/cases/binary-link-outside-collection/schema.yaml +1 -0
- package/fixtures/cases/binary-prototype-reference/expected.json +2 -2
- package/fixtures/cases/binary-prototype-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-prototype-reference/schema.yaml +4 -0
- package/fixtures/cases/binary-typed-reference/expected.json +2 -2
- package/fixtures/cases/binary-typed-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-typed-reference/schema.yaml +5 -0
- package/fixtures/cases/boolean-field/context.json +1 -0
- package/fixtures/cases/boolean-field/expected.json +7 -0
- package/fixtures/cases/boolean-field/library/companies/acme.md +4 -0
- package/fixtures/cases/boolean-field/library/deals/renewal.md +56 -0
- package/fixtures/cases/boolean-field/schema.yaml +55 -0
- package/fixtures/cases/bracketed-link-definition/library/item.md +1 -1
- package/fixtures/cases/bracketed-link-definition/schema.yaml +5 -0
- package/fixtures/cases/closed-nested-object/context.json +1 -0
- package/fixtures/cases/closed-nested-object/expected.json +7 -0
- package/fixtures/cases/closed-nested-object/library/companies/acme.md +4 -0
- package/fixtures/cases/closed-nested-object/library/deals/renewal.md +57 -0
- package/fixtures/cases/closed-nested-object/schema.yaml +55 -0
- package/fixtures/cases/composed-root-reference/context.json +1 -0
- package/fixtures/cases/composed-root-reference/expected.json +6 -0
- package/fixtures/cases/composed-root-reference/library/a.md +5 -0
- package/fixtures/cases/composed-root-reference/schema.yaml +13 -0
- package/fixtures/cases/conditional-long-text/context.json +1 -0
- package/fixtures/cases/conditional-long-text/expected.json +7 -0
- package/fixtures/cases/conditional-long-text/library/questions/hosting.md +9 -0
- package/fixtures/cases/conditional-long-text/library/questions/payments.md +12 -0
- package/fixtures/cases/conditional-long-text/schema.yaml +13 -0
- package/fixtures/cases/cross-room-link/context.json +1 -0
- package/fixtures/cases/cross-room-link/expected.json +1 -0
- package/fixtures/cases/cross-room-link/library/clients/acme.md +6 -0
- package/fixtures/cases/cross-room-link/schema.yaml +3 -0
- package/fixtures/cases/cross-room-reference/context.json +1 -0
- package/fixtures/cases/cross-room-reference/expected.json +1 -0
- package/fixtures/cases/cross-room-reference/library/clients/acme.md +9 -0
- package/fixtures/cases/cross-room-reference/schema.yaml +8 -0
- package/fixtures/cases/date-time-format/context.json +1 -0
- package/fixtures/cases/date-time-format/expected.json +7 -0
- package/fixtures/cases/date-time-format/library/companies/acme.md +4 -0
- package/fixtures/cases/date-time-format/library/deals/renewal.md +56 -0
- package/fixtures/cases/date-time-format/schema.yaml +55 -0
- package/fixtures/cases/declared-binary-links/schema.yaml +1 -0
- package/fixtures/cases/default-unfilled/context.json +1 -0
- package/fixtures/cases/default-unfilled/expected.json +6 -0
- package/fixtures/cases/default-unfilled/library/companies/acme.md +4 -0
- package/fixtures/cases/default-unfilled/library/deals/renewal.md +54 -0
- package/fixtures/cases/default-unfilled/schema.yaml +55 -0
- package/fixtures/cases/defs-pattern/context.json +1 -0
- package/fixtures/cases/defs-pattern/expected.json +7 -0
- package/fixtures/cases/defs-pattern/library/companies/acme.md +4 -0
- package/fixtures/cases/defs-pattern/library/deals/renewal.md +56 -0
- package/fixtures/cases/defs-pattern/schema.yaml +55 -0
- package/fixtures/cases/dependent-rule/context.json +1 -0
- package/fixtures/cases/dependent-rule/expected.json +6 -0
- package/fixtures/cases/dependent-rule/library/companies/acme.md +4 -0
- package/fixtures/cases/dependent-rule/library/deals/renewal.md +55 -0
- package/fixtures/cases/dependent-rule/schema.yaml +55 -0
- package/fixtures/cases/duplicate-link-definition/library/item.md +1 -1
- package/fixtures/cases/duplicate-link-definition/schema.yaml +5 -0
- package/fixtures/cases/email-format/context.json +1 -0
- package/fixtures/cases/email-format/expected.json +7 -0
- package/fixtures/cases/email-format/library/companies/acme.md +4 -0
- package/fixtures/cases/email-format/library/deals/renewal.md +56 -0
- package/fixtures/cases/email-format/schema.yaml +55 -0
- package/fixtures/cases/equal-labels/context.json +1 -0
- 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 +5 -0
- package/fixtures/cases/field-enum/expected.json +3 -3
- package/fixtures/cases/field-enum/library/item.md +2 -2
- package/fixtures/cases/field-enum/schema.yaml +6 -0
- package/fixtures/cases/frontmatter-schema/context.json +1 -0
- package/fixtures/cases/frontmatter-schema/expected.json +5 -0
- package/fixtures/cases/frontmatter-schema/schema.yaml +5 -0
- package/fixtures/cases/integer-field/context.json +1 -0
- package/fixtures/cases/integer-field/expected.json +7 -0
- package/fixtures/cases/integer-field/library/companies/acme.md +4 -0
- package/fixtures/cases/integer-field/library/deals/renewal.md +56 -0
- package/fixtures/cases/integer-field/schema.yaml +55 -0
- package/fixtures/cases/interrupted-link-definition/schema.yaml +1 -0
- package/fixtures/cases/json-schema-constructs/context.json +1 -0
- package/fixtures/cases/json-schema-constructs/expected.json +1 -0
- package/fixtures/cases/json-schema-constructs/library/companies/acme.md +4 -0
- package/fixtures/cases/json-schema-constructs/library/deals/renewal.md +56 -0
- package/fixtures/cases/json-schema-constructs/schema.yaml +55 -0
- package/fixtures/cases/labels-in-the-rooms-language/context.json +1 -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.yaml +9 -0
- package/fixtures/cases/lazy-list-item/context.json +1 -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/context.json +1 -0
- package/fixtures/cases/link-into-a-reserved-name/expected.json +5 -0
- package/fixtures/cases/link-into-a-reserved-name/library/notes/a.md +6 -0
- package/fixtures/cases/link-into-a-reserved-name/schema.yaml +3 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/context.json +1 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/expected.json +5 -0
- package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/library/notes/b.md +5 -0
- package/fixtures/cases/list-item-enum/context.json +1 -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.yaml +3 -0
- package/fixtures/cases/list-item-kind/context.json +1 -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/context.json +1 -0
- package/fixtures/cases/list-items/expected.json +1 -0
- package/fixtures/cases/list-items/library/other.md +3 -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/context.json +1 -0
- package/fixtures/cases/list-of-objects-closed/expected.json +7 -0
- package/fixtures/cases/list-of-objects-closed/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-closed/library/deals/renewal.md +56 -0
- package/fixtures/cases/list-of-objects-closed/schema.yaml +55 -0
- package/fixtures/cases/list-of-objects-item/context.json +1 -0
- package/fixtures/cases/list-of-objects-item/expected.json +7 -0
- package/fixtures/cases/list-of-objects-item/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-item/library/deals/renewal.md +56 -0
- package/fixtures/cases/list-of-objects-item/schema.yaml +55 -0
- package/fixtures/cases/list-of-objects-reference/context.json +1 -0
- package/fixtures/cases/list-of-objects-reference/expected.json +7 -0
- package/fixtures/cases/list-of-objects-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/deals/renewal.md +17 -0
- package/fixtures/cases/list-of-objects-reference/library/places/depot.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/products/seats.md +4 -0
- package/fixtures/cases/list-of-objects-reference/library/products/support.md +4 -0
- package/fixtures/cases/list-of-objects-reference/schema.yaml +32 -0
- package/fixtures/cases/list-reference-path/context.json +1 -0
- package/fixtures/cases/list-reference-path/expected.json +7 -0
- package/fixtures/cases/list-reference-path/library/other.md +3 -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/note.md +1 -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/context.json +1 -0
- package/fixtures/cases/list-size/expected.json +7 -0
- package/fixtures/cases/list-size/library/companies/acme.md +4 -0
- package/fixtures/cases/list-size/library/deals/renewal.md +58 -0
- package/fixtures/cases/list-size/schema.yaml +55 -0
- package/fixtures/cases/long-fence-link-definition/schema.yaml +1 -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.yaml +15 -0
- package/fixtures/cases/malformed-definition/expected.json +2 -4
- package/fixtures/cases/malformed-definition/schema.yaml +3 -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/context.json +1 -0
- package/fixtures/cases/member-document/expected.json +1 -0
- package/fixtures/cases/member-document/library/people/ana.md +5 -0
- package/fixtures/cases/member-document/schema.yaml +5 -0
- package/fixtures/cases/member-on-an-untyped-document/context.json +1 -0
- package/fixtures/cases/member-on-an-untyped-document/expected.json +6 -0
- package/fixtures/cases/member-on-an-untyped-document/library/note.md +4 -0
- package/fixtures/cases/member-on-another-type/context.json +1 -0
- package/fixtures/cases/member-on-another-type/expected.json +6 -0
- package/fixtures/cases/member-on-another-type/library/note.md +4 -0
- package/fixtures/cases/member-on-another-type/schema.yaml +7 -0
- package/fixtures/cases/missing-required-field/expected.json +2 -3
- package/fixtures/cases/missing-required-field/library/item.md +1 -1
- package/fixtures/cases/missing-required-field/schema.yaml +6 -0
- package/fixtures/cases/misspelled-key/context.json +1 -0
- package/fixtures/cases/misspelled-key/expected.json +7 -0
- package/fixtures/cases/misspelled-key/library/companies/acme.md +4 -0
- package/fixtures/cases/misspelled-key/library/deals/renewal.md +57 -0
- package/fixtures/cases/misspelled-key/schema.yaml +55 -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.yaml +5 -0
- package/fixtures/cases/nested-defs/context.json +1 -0
- package/fixtures/cases/nested-defs/expected.json +7 -0
- package/fixtures/cases/nested-defs/library/deal.md +6 -0
- package/fixtures/cases/nested-defs/schema.yaml +11 -0
- package/fixtures/cases/nested-object-reference/context.json +1 -0
- package/fixtures/cases/nested-object-reference/expected.json +7 -0
- package/fixtures/cases/nested-object-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-object-reference/library/deals/renewal.md +17 -0
- package/fixtures/cases/nested-object-reference/library/places/depot.md +4 -0
- package/fixtures/cases/nested-object-reference/library/products/seats.md +4 -0
- package/fixtures/cases/nested-object-reference/library/products/support.md +4 -0
- package/fixtures/cases/nested-object-reference/schema.yaml +32 -0
- package/fixtures/cases/nested-reference/context.json +1 -0
- package/fixtures/cases/nested-reference/expected.json +1 -0
- package/fixtures/cases/nested-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-reference/library/deals/renewal.md +18 -0
- package/fixtures/cases/nested-reference/library/places/depot.md +4 -0
- package/fixtures/cases/nested-reference/library/products/seats.md +4 -0
- package/fixtures/cases/nested-reference/library/products/support.md +4 -0
- package/fixtures/cases/nested-reference/schema.yaml +32 -0
- package/fixtures/cases/nested-required-field/context.json +1 -0
- package/fixtures/cases/nested-required-field/expected.json +7 -0
- package/fixtures/cases/nested-required-field/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-required-field/library/deals/renewal.md +55 -0
- package/fixtures/cases/nested-required-field/schema.yaml +55 -0
- package/fixtures/cases/numeric-range/context.json +1 -0
- package/fixtures/cases/numeric-range/expected.json +7 -0
- package/fixtures/cases/numeric-range/library/companies/acme.md +4 -0
- package/fixtures/cases/numeric-range/library/deals/renewal.md +56 -0
- package/fixtures/cases/numeric-range/schema.yaml +55 -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.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/context.json +1 -0
- package/fixtures/cases/one-of-variant/expected.json +7 -0
- package/fixtures/cases/one-of-variant/library/companies/acme.md +4 -0
- package/fixtures/cases/one-of-variant/library/deals/renewal.md +56 -0
- package/fixtures/cases/one-of-variant/schema.yaml +55 -0
- package/fixtures/cases/other-room-reference/context.json +1 -0
- package/fixtures/cases/other-room-reference/expected.json +7 -0
- package/fixtures/cases/other-room-reference/library/companies/acme.md +4 -0
- package/fixtures/cases/other-room-reference/library/deals/renewal.md +17 -0
- package/fixtures/cases/other-room-reference/library/places/depot.md +4 -0
- package/fixtures/cases/other-room-reference/library/products/seats.md +4 -0
- package/fixtures/cases/other-room-reference/library/products/support.md +4 -0
- package/fixtures/cases/other-room-reference/schema.yaml +32 -0
- package/fixtures/cases/paragraph-link-definition/schema.yaml +1 -0
- package/fixtures/cases/prototype-field/context.json +1 -0
- package/fixtures/cases/prototype-field/expected.json +7 -0
- package/fixtures/cases/prototype-field/library/item.md +9 -0
- package/fixtures/cases/prototype-field/schema.yaml +5 -0
- package/fixtures/cases/quoted-link-definition/expected.json +1 -2
- package/fixtures/cases/quoted-link-definition/library/notes/draft.md +1 -1
- package/fixtures/cases/quoted-link-definition/schema.yaml +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/context.json +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/expected.json +7 -0
- package/fixtures/cases/reference-into-a-reserved-name/library/notes/a.md +4 -0
- package/fixtures/cases/reference-into-a-reserved-name/library/settings/brief.md +1 -0
- package/fixtures/cases/reference-into-a-reserved-name/schema.yaml +3 -0
- package/fixtures/cases/referenced-missing-file/expected.json +0 -1
- 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 +10 -0
- package/fixtures/cases/remote-ref/context.json +1 -0
- package/fixtures/cases/remote-ref/expected.json +5 -0
- package/fixtures/cases/remote-ref/schema.yaml +3 -0
- package/fixtures/cases/room-md-declares-a-type/context.json +1 -0
- package/fixtures/cases/room-md-declares-a-type/expected.json +6 -0
- package/fixtures/cases/room-md-declares-a-type/library/ROOM.md +5 -0
- package/fixtures/cases/second-member-document/context.json +1 -0
- package/fixtures/cases/second-member-document/expected.json +5 -0
- package/fixtures/cases/second-member-document/schema.yaml +4 -0
- package/fixtures/cases/sections-keyword-refused/context.json +1 -0
- package/fixtures/cases/sections-keyword-refused/expected.json +5 -0
- package/fixtures/cases/sections-keyword-refused/schema.yaml +6 -0
- package/fixtures/cases/shortcut-reference-link/context.json +1 -0
- package/fixtures/cases/shortcut-reference-link/expected.json +5 -0
- package/fixtures/cases/shortcut-reference-link/library/item.md +10 -0
- package/fixtures/cases/shortcut-reference-link/schema.yaml +5 -0
- package/fixtures/cases/string-length/context.json +1 -0
- package/fixtures/cases/string-length/expected.json +7 -0
- package/fixtures/cases/string-length/library/companies/acme.md +4 -0
- package/fixtures/cases/string-length/library/deals/renewal.md +56 -0
- package/fixtures/cases/string-length/schema.yaml +55 -0
- package/fixtures/cases/submission-keys/context.json +1 -0
- package/fixtures/cases/submission-keys/expected.json +1 -0
- package/fixtures/cases/submission-keys/library/notes/visitor.md +8 -0
- package/fixtures/cases/submission-keys/schema.yaml +4 -0
- package/fixtures/cases/text-field-kind/context.json +1 -0
- package/fixtures/cases/text-field-kind/expected.json +3 -0
- package/fixtures/cases/text-field-kind/library/page.md +4 -0
- package/fixtures/cases/text-field-kind/schema.yaml +4 -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.yaml +3 -0
- package/fixtures/cases/truncated-link-definition/expected.json +1 -2
- package/fixtures/cases/truncated-link-definition/library/notes/draft.md +1 -1
- package/fixtures/cases/truncated-link-definition/schema.yaml +1 -0
- package/fixtures/cases/typed-path-names-another-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-another-type/expected.json +6 -0
- package/fixtures/cases/typed-path-names-another-type/library/settings/prefs/one.md +3 -0
- package/fixtures/cases/typed-path-names-another-type/schema.yaml +6 -0
- package/fixtures/cases/typed-path-names-its-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-its-type/expected.json +3 -0
- package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/deeper/two.md +1 -0
- package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/one.md +4 -0
- package/fixtures/cases/typed-path-names-its-type/schema.yaml +6 -0
- package/fixtures/cases/typed-path-names-no-type/context.json +11 -0
- package/fixtures/cases/typed-path-names-no-type/expected.json +6 -0
- package/fixtures/cases/typed-path-names-no-type/library/settings/prefs/one.md +1 -0
- package/fixtures/cases/typed-path-names-no-type/schema.yaml +6 -0
- package/fixtures/cases/types-folder-content/context.json +1 -0
- package/fixtures/cases/types-folder-content/expected.json +1 -0
- package/fixtures/cases/types-folder-content/library/types/task.md +4 -0
- package/fixtures/cases/types-folder-content/schema.yaml +4 -0
- package/fixtures/cases/unclosed-frontmatter/expected.json +1 -2
- package/fixtures/cases/undeclared-field/context.json +1 -0
- package/fixtures/cases/undeclared-field/expected.json +7 -0
- package/fixtures/cases/undeclared-field/library/item.md +9 -0
- package/fixtures/cases/undeclared-field/schema.yaml +5 -0
- package/fixtures/cases/unevaluated-items-closed/context.json +1 -0
- package/fixtures/cases/unevaluated-items-closed/expected.json +7 -0
- package/fixtures/cases/unevaluated-items-closed/library/trip.md +16 -0
- package/fixtures/cases/unevaluated-items-closed/schema.yaml +10 -0
- package/fixtures/cases/unknown-type/context.json +1 -0
- package/fixtures/cases/unknown-type/expected.json +6 -0
- package/fixtures/cases/unknown-type/library/item.md +3 -0
- package/fixtures/cases/unknown-type/schema.yaml +3 -0
- package/fixtures/cases/unlisted-reference-type/context.json +1 -0
- package/fixtures/cases/unlisted-reference-type/expected.json +5 -0
- package/fixtures/cases/unlisted-reference-type/schema.yaml +3 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/expected.json +6 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/library/rooms/team/tasks/plan.md +5 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/expected.json +6 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/library/rooms/team/tasks/plan.md +7 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/expected.json +3 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/plan.md +1 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/tasks/plan.md +6 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/schema.yaml +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/context.json +11 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/expected.json +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/library/rooms/team/tasks/plan.md +5 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/schema.yaml +5 -0
- package/fixtures/cases/unresolved-link/expected.json +1 -2
- package/fixtures/cases/unresolved-link/library/item.md +2 -2
- package/fixtures/cases/unresolved-link/schema.yaml +5 -0
- package/fixtures/cases/valid-typed-document/library/people/ada.md +1 -1
- package/fixtures/cases/valid-typed-document/library/tasks/one.md +11 -10
- package/fixtures/cases/valid-typed-document/schema.yaml +15 -0
- package/fixtures/cases/wide-item-fence-link/schema.yaml +1 -0
- package/fixtures/division.json +454 -0
- package/fixtures/forms.json +347 -0
- package/fixtures/preamble.json +26 -5
- package/fixtures/projection.json +216 -32
- package/fixtures/queries.json +964 -0
- package/package.json +20 -13
- package/dist/definition.js.map +0 -1
- package/dist/document.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/links.d.ts +0 -25
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js +0 -380
- package/dist/links.js.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/profile.d.ts +0 -6
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -7
- package/dist/profile.js.map +0 -1
- package/dist/project.js.map +0 -1
- package/dist/refuse.js.map +0 -1
- package/dist/schema.js.map +0 -1
- package/dist/sections.d.ts +0 -10
- package/dist/sections.d.ts.map +0 -1
- package/dist/sections.js +0 -79
- package/dist/sections.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validate.js.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/yaml.js.map +0 -1
- package/fixtures/cases/binary-any-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-document-collision/library/types/note.md +0 -3
- package/fixtures/cases/binary-link-outside-collection/library/types/note.md +0 -3
- package/fixtures/cases/binary-prototype-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-typed-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-typed-reference/library/types/person.md +0 -3
- package/fixtures/cases/bracketed-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/declared-binary-links/library/types/note.md +0 -3
- package/fixtures/cases/duplicate-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/fenced-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/field-enum/library/types/task.md +0 -8
- package/fixtures/cases/interrupted-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/long-fence-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/malformed-definition/library/types/task.md +0 -5
- package/fixtures/cases/missing-binary-image/expected.json +0 -6
- package/fixtures/cases/missing-binary-image/library/types/note.md +0 -3
- package/fixtures/cases/missing-binary-link/expected.json +0 -6
- package/fixtures/cases/missing-binary-link/library/types/note.md +0 -3
- package/fixtures/cases/missing-required-field/library/types/task.md +0 -8
- package/fixtures/cases/paragraph-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/prd-definition/library/types/task.md +0 -15
- package/fixtures/cases/quoted-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/referenced-missing-file/library/types/person.md +0 -5
- package/fixtures/cases/referenced-missing-file/library/types/task.md +0 -8
- package/fixtures/cases/structured-section/expected.json +0 -7
- package/fixtures/cases/structured-section/library/types/task.md +0 -8
- package/fixtures/cases/truncated-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/unresolved-link/library/types/task.md +0 -7
- package/fixtures/cases/valid-typed-document/library/types/person.md +0 -5
- package/fixtures/cases/valid-typed-document/library/types/task.md +0 -12
- package/fixtures/cases/wide-item-fence-link/library/types/note.md +0 -3
- package/markdown-syntax-profile.md +0 -9
- /package/fixtures/cases/{prd-definition → absent-link-dangles}/context.json +0 -0
- /package/fixtures/cases/{prd-definition → absent-link-dangles}/expected.json +0 -0
- /package/fixtures/cases/{structured-section → absent-optional-field}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/library/notes/draft.md +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/context.json +0 -0
- /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/library/notes/draft.md +0 -0
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
import { crossedFacts, escapePointer, pointerFacts, pointerSegments, } from '../definition.js';
|
|
2
|
+
import { fitsKind, kindOf, kindWords } from '../kinds.js';
|
|
3
|
+
import { normalize } from '../paths.js';
|
|
4
|
+
import { plain } from '../yaml.js';
|
|
5
|
+
export class QueryError extends Error {
|
|
6
|
+
code;
|
|
7
|
+
place;
|
|
8
|
+
accepts;
|
|
9
|
+
retryable = false;
|
|
10
|
+
constructor(code, at, problem, accepts = []) {
|
|
11
|
+
super(`${code} at ${placeText(placed(at))}: ${problem}`);
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.place = placed(at);
|
|
14
|
+
this.accepts = accepts;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const RANGE = ['$gt', '$gte', '$lt', '$lte'];
|
|
18
|
+
const SINGLE = ['$eq', '$ne', '$in', '$nin', '$all', '$size', '$exists', '$prefix'];
|
|
19
|
+
const FILTER = [
|
|
20
|
+
'rooms',
|
|
21
|
+
'types',
|
|
22
|
+
'where',
|
|
23
|
+
'pathPrefix',
|
|
24
|
+
'outside',
|
|
25
|
+
'folder',
|
|
26
|
+
'paths',
|
|
27
|
+
'fileIds',
|
|
28
|
+
'hop',
|
|
29
|
+
'backlinks',
|
|
30
|
+
'text',
|
|
31
|
+
];
|
|
32
|
+
const RELATED = ['types', 'where', 'pathPrefix', 'field'];
|
|
33
|
+
const PARTS = [
|
|
34
|
+
'fields',
|
|
35
|
+
'sections',
|
|
36
|
+
'preamble',
|
|
37
|
+
'markdown',
|
|
38
|
+
'backlinks',
|
|
39
|
+
'change',
|
|
40
|
+
'fileId',
|
|
41
|
+
'revision',
|
|
42
|
+
'size',
|
|
43
|
+
'created',
|
|
44
|
+
];
|
|
45
|
+
const GROUP_PARTS = ['size', 'updated', 'greatest'];
|
|
46
|
+
const DOCUMENT_KEYS = ['room', 'path', 'type', 'folder', 'size', 'created', 'updated'];
|
|
47
|
+
const GROUP_KEYS = ['room', 'type', 'folder', 'subfolder'];
|
|
48
|
+
const GROUP_ORDERS = ['count', 'size', 'updated', 'greatest'];
|
|
49
|
+
const ORDER = ['by', 'direction', 'nulls', 'stringSort', 'locale', 'localeOptions'];
|
|
50
|
+
const STRAY_ESCAPE = /~(?![01])/u;
|
|
51
|
+
export function bodied(shape) {
|
|
52
|
+
return shape.sections !== null || shape.preamble || shape.markdown;
|
|
53
|
+
}
|
|
54
|
+
export function invalid(at, problem, accepts = []) {
|
|
55
|
+
throw new QueryError('invalid-query', at, problem, accepts);
|
|
56
|
+
}
|
|
57
|
+
function placed(at) {
|
|
58
|
+
if (typeof at !== 'string')
|
|
59
|
+
return at;
|
|
60
|
+
return at === '' ? [] : [at];
|
|
61
|
+
}
|
|
62
|
+
export function placeText(at) {
|
|
63
|
+
return at.reduce((text, step) => {
|
|
64
|
+
if (typeof step === 'number')
|
|
65
|
+
return `${text}[${step}]`;
|
|
66
|
+
if (step.startsWith('/') || text === '')
|
|
67
|
+
return `${text}${step}`;
|
|
68
|
+
return `${text}.${step}`;
|
|
69
|
+
}, '');
|
|
70
|
+
}
|
|
71
|
+
function place(at, step) {
|
|
72
|
+
return [...placed(at), step];
|
|
73
|
+
}
|
|
74
|
+
export function known(value, allowed, at) {
|
|
75
|
+
for (const name of Object.keys(value)) {
|
|
76
|
+
if (!allowed.includes(name))
|
|
77
|
+
invalid(place(at, name), 'unknown part', allowed);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function list(input, at) {
|
|
81
|
+
if (!Array.isArray(input))
|
|
82
|
+
invalid(at, 'expects a list');
|
|
83
|
+
return input;
|
|
84
|
+
}
|
|
85
|
+
function value(input, at) {
|
|
86
|
+
if (Array.isArray(input))
|
|
87
|
+
invalid(at, 'a list is not a value');
|
|
88
|
+
if (input !== null &&
|
|
89
|
+
typeof input !== 'string' &&
|
|
90
|
+
typeof input !== 'boolean' &&
|
|
91
|
+
!(typeof input === 'number' && Number.isFinite(input))) {
|
|
92
|
+
invalid(at, 'not a value');
|
|
93
|
+
}
|
|
94
|
+
return input;
|
|
95
|
+
}
|
|
96
|
+
function values(input, at) {
|
|
97
|
+
return list(input, at).map((item, index) => value(item, place(at, index)));
|
|
98
|
+
}
|
|
99
|
+
function names(input, at) {
|
|
100
|
+
const listed = list(input, at);
|
|
101
|
+
if (listed.some((item) => typeof item !== 'string'))
|
|
102
|
+
invalid(at, 'expects a list of names');
|
|
103
|
+
return [...new Set(listed)].sort();
|
|
104
|
+
}
|
|
105
|
+
function pathsOf(input) {
|
|
106
|
+
const listed = list(input, 'paths');
|
|
107
|
+
if (listed.some((item) => typeof item !== 'string' || item === '' || normalize(item) !== item)) {
|
|
108
|
+
invalid('paths', 'expects a list of Paths');
|
|
109
|
+
}
|
|
110
|
+
return [...new Set(listed)].sort();
|
|
111
|
+
}
|
|
112
|
+
function fileIdsOf(input) {
|
|
113
|
+
const listed = list(input, 'fileIds');
|
|
114
|
+
if (listed.some((item) => typeof item !== 'string' || item === '')) {
|
|
115
|
+
invalid('fileIds', 'expects a list of file IDs');
|
|
116
|
+
}
|
|
117
|
+
return [...new Set(listed)].sort();
|
|
118
|
+
}
|
|
119
|
+
function phrase(input) {
|
|
120
|
+
if (typeof input !== 'string' || input === '')
|
|
121
|
+
invalid('text', 'expects a phrase');
|
|
122
|
+
return input;
|
|
123
|
+
}
|
|
124
|
+
function directory(input, at) {
|
|
125
|
+
if (typeof input !== 'string' || normalize(input) !== input) {
|
|
126
|
+
invalid(at, 'expects a normalized directory');
|
|
127
|
+
}
|
|
128
|
+
return input;
|
|
129
|
+
}
|
|
130
|
+
function itemOf(facts) {
|
|
131
|
+
return facts.type === 'array' ? facts.items : facts;
|
|
132
|
+
}
|
|
133
|
+
function fits(facts, value) {
|
|
134
|
+
const item = itemOf(facts);
|
|
135
|
+
if (item === undefined || (item.type === undefined && item.values === undefined))
|
|
136
|
+
return true;
|
|
137
|
+
const kind = kindOf(item);
|
|
138
|
+
return kind !== null && fitsKind(kind, item, value);
|
|
139
|
+
}
|
|
140
|
+
function textless(facts) {
|
|
141
|
+
const item = itemOf(facts);
|
|
142
|
+
if (item?.values !== undefined)
|
|
143
|
+
return !item.values.some((held) => typeof held === 'string');
|
|
144
|
+
return item?.type !== undefined && item.type !== 'string';
|
|
145
|
+
}
|
|
146
|
+
function typing(facts, rooms, types, at) {
|
|
147
|
+
const read = rooms === null ? facts.rooms : facts.rooms.filter((room) => rooms.includes(room.locator));
|
|
148
|
+
const acquiring = !facts.listed &&
|
|
149
|
+
(rooms === null ||
|
|
150
|
+
rooms.some((locator) => !facts.rooms.some((room) => room.locator === locator)));
|
|
151
|
+
const available = !acquiring && read.every((room) => room.available);
|
|
152
|
+
const declared = read.flatMap((room) => room.types);
|
|
153
|
+
for (const name of types ?? []) {
|
|
154
|
+
if (name === 'any' || !available || declared.some((type) => type.name === name))
|
|
155
|
+
continue;
|
|
156
|
+
throw new QueryError('unknown-type', place(at, 'types'), `no model it reads declares ${name}`, [...new Set(declared.map((type) => type.name))].sort());
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
untyped: types === null || types.includes('any') || !available,
|
|
160
|
+
types: types === null ? declared : declared.filter((type) => types.includes(type.name)),
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function pointer(input, at) {
|
|
164
|
+
if (typeof input !== 'string' || !input.startsWith('/') || STRAY_ESCAPE.test(input)) {
|
|
165
|
+
invalid(at, 'expects a JSON Pointer');
|
|
166
|
+
}
|
|
167
|
+
return input;
|
|
168
|
+
}
|
|
169
|
+
function specs(typed, input, at) {
|
|
170
|
+
const field = pointer(input, at);
|
|
171
|
+
const declared = typed.types.flatMap((type) => {
|
|
172
|
+
const spec = pointerFacts(type, field);
|
|
173
|
+
return spec === undefined ? [] : [spec];
|
|
174
|
+
});
|
|
175
|
+
if (declared.length === 0 && !typed.untyped) {
|
|
176
|
+
throw new QueryError('unknown-field', at, `no MD Type it reads declares ${field}`, nearby(typed.types, field));
|
|
177
|
+
}
|
|
178
|
+
if (!declared.some((spec) => spec.conditional))
|
|
179
|
+
return declared;
|
|
180
|
+
return declared.map((spec) => ({
|
|
181
|
+
facts: { prose: false },
|
|
182
|
+
through: several(spec),
|
|
183
|
+
conditional: true,
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
function nearby(types, field) {
|
|
187
|
+
const segments = pointerSegments(field);
|
|
188
|
+
for (let length = segments.length - 1; length > 0; length -= 1) {
|
|
189
|
+
const prefix = segments
|
|
190
|
+
.slice(0, length)
|
|
191
|
+
.map((segment) => `/${escapePointer(segment)}`)
|
|
192
|
+
.join('');
|
|
193
|
+
const children = types.flatMap((type) => {
|
|
194
|
+
const reached = pointerFacts(type, prefix);
|
|
195
|
+
return (reached === undefined ? [] : crossedFacts(reached.facts)).flatMap((crossed) => Object.keys(crossed.properties ?? {}).map((key) => `${prefix}/${escapePointer(key)}`));
|
|
196
|
+
});
|
|
197
|
+
if (children.length > 0)
|
|
198
|
+
return [...new Set(children)].sort();
|
|
199
|
+
}
|
|
200
|
+
return [
|
|
201
|
+
...new Set(types.flatMap((type) => Object.keys(type.fields).map((name) => `/${escapePointer(name)}`))),
|
|
202
|
+
].sort();
|
|
203
|
+
}
|
|
204
|
+
function several(spec) {
|
|
205
|
+
return spec.through || spec.facts.type === 'array';
|
|
206
|
+
}
|
|
207
|
+
function single(spec) {
|
|
208
|
+
return spec.facts.type !== undefined && spec.facts.type !== 'array';
|
|
209
|
+
}
|
|
210
|
+
function every(declared, holds) {
|
|
211
|
+
return declared.length > 0 && declared.every(holds);
|
|
212
|
+
}
|
|
213
|
+
function kind(declared, checked, at) {
|
|
214
|
+
if (checked === null ||
|
|
215
|
+
declared.length === 0 ||
|
|
216
|
+
declared.some((spec) => fits(spec.facts, checked))) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
throw new QueryError('wrong-kind', at, `${JSON.stringify(checked)} is not of its field's kind`, [
|
|
220
|
+
...new Set(declared.flatMap((spec) => kindWords(itemOf(spec.facts)))),
|
|
221
|
+
]);
|
|
222
|
+
}
|
|
223
|
+
function test(declared, input, at) {
|
|
224
|
+
if (!plain(input)) {
|
|
225
|
+
const equal = value(input, at);
|
|
226
|
+
kind(declared, equal, at);
|
|
227
|
+
return { op: 'eq', value: equal };
|
|
228
|
+
}
|
|
229
|
+
const operators = Object.keys(input);
|
|
230
|
+
if (operators.length === 0)
|
|
231
|
+
invalid(at, 'names no operator');
|
|
232
|
+
if (operators.some((operator) => RANGE.includes(operator))) {
|
|
233
|
+
const stray = operators.find((operator) => !RANGE.includes(operator));
|
|
234
|
+
if (stray !== undefined)
|
|
235
|
+
invalid(place(at, stray), 'cannot join a range');
|
|
236
|
+
if (every(declared, (spec) => spec.facts.type === 'array'))
|
|
237
|
+
invalid(at, 'a range on a list');
|
|
238
|
+
if (every(declared, (spec) => spec.facts.type === 'boolean' || spec.facts.type === 'object')) {
|
|
239
|
+
throw new QueryError('wrong-kind', at, 'its field does not compare in order');
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
op: 'range',
|
|
243
|
+
bounds: RANGE.filter((operator) => operators.includes(operator)).map((operator) => {
|
|
244
|
+
const bound = value(input[operator], place(at, operator));
|
|
245
|
+
if (bound === null)
|
|
246
|
+
invalid(place(at, operator), 'a range bound is never null');
|
|
247
|
+
kind(declared, bound, place(at, operator));
|
|
248
|
+
return [operator.slice(1), bound];
|
|
249
|
+
}),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
if (operators.length > 1)
|
|
253
|
+
invalid(place(at, operators[1]), 'names a second operator');
|
|
254
|
+
const [operator] = operators;
|
|
255
|
+
const where = place(at, operator);
|
|
256
|
+
if (!SINGLE.includes(operator)) {
|
|
257
|
+
invalid(where, 'unknown operator', [...SINGLE, ...RANGE]);
|
|
258
|
+
}
|
|
259
|
+
const operand = input[operator];
|
|
260
|
+
if (operator === '$eq' || operator === '$ne') {
|
|
261
|
+
const compared = value(operand, where);
|
|
262
|
+
kind(declared, compared, where);
|
|
263
|
+
return operator === '$eq' ? { op: 'eq', value: compared } : { op: 'ne', value: compared };
|
|
264
|
+
}
|
|
265
|
+
if (operator === '$in' || operator === '$nin' || operator === '$all') {
|
|
266
|
+
const compared = values(operand, where);
|
|
267
|
+
compared.forEach((item, index) => kind(declared, item, place(where, index)));
|
|
268
|
+
if (operator === '$in')
|
|
269
|
+
return { op: 'in', values: compared };
|
|
270
|
+
if (operator === '$nin')
|
|
271
|
+
return { op: 'nin', values: compared };
|
|
272
|
+
if (compared.includes(null))
|
|
273
|
+
invalid(where, 'a list holds no null');
|
|
274
|
+
if (every(declared, single))
|
|
275
|
+
invalid(where, 'the field is not a list');
|
|
276
|
+
return { op: 'all', values: compared };
|
|
277
|
+
}
|
|
278
|
+
if (operator === '$size') {
|
|
279
|
+
if (!Number.isSafeInteger(operand) || operand < 0) {
|
|
280
|
+
invalid(where, 'expects a nonnegative integer');
|
|
281
|
+
}
|
|
282
|
+
if (every(declared, single))
|
|
283
|
+
invalid(where, 'the field is not a list');
|
|
284
|
+
return { op: 'size', size: operand };
|
|
285
|
+
}
|
|
286
|
+
if (operator === '$prefix') {
|
|
287
|
+
if (typeof operand !== 'string')
|
|
288
|
+
invalid(where, 'expects a string');
|
|
289
|
+
if (every(declared, (spec) => textless(spec.facts))) {
|
|
290
|
+
throw new QueryError('wrong-kind', where, 'its field holds no text');
|
|
291
|
+
}
|
|
292
|
+
return { op: 'prefix', prefix: operand };
|
|
293
|
+
}
|
|
294
|
+
if (typeof operand !== 'boolean')
|
|
295
|
+
invalid(where, 'expects true or false');
|
|
296
|
+
return { op: 'exists', exists: operand };
|
|
297
|
+
}
|
|
298
|
+
function condition(typed, input, at) {
|
|
299
|
+
if (!plain(input))
|
|
300
|
+
invalid(at, 'expects an object of field predicates');
|
|
301
|
+
const conditions = [];
|
|
302
|
+
for (const name of Object.keys(input).sort()) {
|
|
303
|
+
const where = place(at, name);
|
|
304
|
+
const entry = input[name];
|
|
305
|
+
if (name === '$and' || name === '$or') {
|
|
306
|
+
const nested = list(entry, where).map((item, index) => condition(typed, item, place(where, index)));
|
|
307
|
+
if (nested.length === 0)
|
|
308
|
+
invalid(where, 'expects a nonempty list');
|
|
309
|
+
conditions.push(name === '$and' ? { every: nested } : { some: nested });
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
if (name.startsWith('$'))
|
|
313
|
+
invalid(where, 'unknown operator');
|
|
314
|
+
conditions.push({ field: name, test: test(specs(typed, name, where), entry, where) });
|
|
315
|
+
}
|
|
316
|
+
if (conditions.length === 0)
|
|
317
|
+
invalid(at, 'names no field');
|
|
318
|
+
return conditions.length === 1 ? conditions[0] : { every: conditions };
|
|
319
|
+
}
|
|
320
|
+
function scope(facts, rooms, input, at) {
|
|
321
|
+
const types = input.types === undefined ? null : names(input.types, place(at, 'types'));
|
|
322
|
+
const typed = typing(facts, rooms, types, at);
|
|
323
|
+
return {
|
|
324
|
+
typed,
|
|
325
|
+
types,
|
|
326
|
+
where: input.where === undefined || (plain(input.where) && Object.keys(input.where).length === 0)
|
|
327
|
+
? null
|
|
328
|
+
: condition(typed, input.where, place(at, 'where')),
|
|
329
|
+
pathPrefix: input.pathPrefix === undefined ? null : directory(input.pathPrefix, place(at, 'pathPrefix')),
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
function referenceName(typed, field, at) {
|
|
333
|
+
const declared = specs(typed, field, at);
|
|
334
|
+
if (declared.length > 0 &&
|
|
335
|
+
!declared.some((spec) => spec.conditional ||
|
|
336
|
+
spec.facts.reference !== undefined ||
|
|
337
|
+
spec.facts.items?.reference !== undefined)) {
|
|
338
|
+
invalid(at, 'not a reference field');
|
|
339
|
+
}
|
|
340
|
+
return field;
|
|
341
|
+
}
|
|
342
|
+
function hopOf(facts, rooms, root, input) {
|
|
343
|
+
if (!plain(input))
|
|
344
|
+
invalid('hop', 'expects an object');
|
|
345
|
+
known(input, RELATED, 'hop');
|
|
346
|
+
const field = referenceName(root, input.field, ['hop', 'field']);
|
|
347
|
+
const { types, where, pathPrefix } = scope(facts, rooms, input, 'hop');
|
|
348
|
+
return { types, where, pathPrefix, field };
|
|
349
|
+
}
|
|
350
|
+
function backlinksOf(facts, rooms, input) {
|
|
351
|
+
if (!plain(input))
|
|
352
|
+
invalid('backlinks', 'expects an object');
|
|
353
|
+
known(input, RELATED, 'backlinks');
|
|
354
|
+
const { typed, types, where, pathPrefix } = scope(facts, rooms, input, 'backlinks');
|
|
355
|
+
const field = input.field === undefined ? null : referenceName(typed, input.field, ['backlinks', 'field']);
|
|
356
|
+
return { types, where, pathPrefix, field };
|
|
357
|
+
}
|
|
358
|
+
function oneField(typed, input, at) {
|
|
359
|
+
if (specs(typed, input.field, place(at, 'field')).some(several)) {
|
|
360
|
+
invalid(place(at, 'field'), 'a path that can hold several values');
|
|
361
|
+
}
|
|
362
|
+
return input.field;
|
|
363
|
+
}
|
|
364
|
+
function keyPlan(typed, input, at, keys) {
|
|
365
|
+
if (typeof input === 'string' && keys.includes(input))
|
|
366
|
+
return { of: input };
|
|
367
|
+
if (plain(input) && Object.hasOwn(input, 'field') && Object.keys(input).length === 1) {
|
|
368
|
+
return { of: 'field', field: oneField(typed, input, at) };
|
|
369
|
+
}
|
|
370
|
+
return invalid(at, `expects ${keys.join(', ')} or a field`);
|
|
371
|
+
}
|
|
372
|
+
function direction(input, at) {
|
|
373
|
+
if (input === undefined)
|
|
374
|
+
return 'asc';
|
|
375
|
+
if (input !== 'asc' && input !== 'desc')
|
|
376
|
+
invalid(at, 'expects asc or desc');
|
|
377
|
+
return input;
|
|
378
|
+
}
|
|
379
|
+
function nulls(input, at) {
|
|
380
|
+
if (input === undefined)
|
|
381
|
+
return null;
|
|
382
|
+
if (input !== 'first' && input !== 'last')
|
|
383
|
+
invalid(at, 'expects first or last');
|
|
384
|
+
return input;
|
|
385
|
+
}
|
|
386
|
+
function orderOptions(input, at) {
|
|
387
|
+
const options = {
|
|
388
|
+
direction: direction(input.direction, place(at, 'direction')),
|
|
389
|
+
};
|
|
390
|
+
const placed = nulls(input.nulls, place(at, 'nulls'));
|
|
391
|
+
if (placed !== null)
|
|
392
|
+
options.nulls = placed;
|
|
393
|
+
if (input.stringSort !== undefined) {
|
|
394
|
+
if (input.stringSort !== 'lexical' && input.stringSort !== 'locale') {
|
|
395
|
+
invalid(place(at, 'stringSort'), 'expects lexical or locale');
|
|
396
|
+
}
|
|
397
|
+
options.stringSort = input.stringSort;
|
|
398
|
+
}
|
|
399
|
+
if (input.locale !== undefined) {
|
|
400
|
+
if (typeof input.locale !== 'string' || !collates(input.locale, undefined)) {
|
|
401
|
+
invalid(place(at, 'locale'), 'expects a locale name');
|
|
402
|
+
}
|
|
403
|
+
options.locale = input.locale;
|
|
404
|
+
}
|
|
405
|
+
if (input.localeOptions !== undefined) {
|
|
406
|
+
if (!plain(input.localeOptions) || !collates(options.locale, input.localeOptions)) {
|
|
407
|
+
invalid(place(at, 'localeOptions'), 'expects collation options');
|
|
408
|
+
}
|
|
409
|
+
options.localeOptions = input.localeOptions;
|
|
410
|
+
}
|
|
411
|
+
return options;
|
|
412
|
+
}
|
|
413
|
+
function collates(locale, options) {
|
|
414
|
+
try {
|
|
415
|
+
''.localeCompare('', locale, options);
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
catch {
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
function parts(typed, input, at, fields) {
|
|
423
|
+
if (input === undefined)
|
|
424
|
+
return null;
|
|
425
|
+
if (input === 'all')
|
|
426
|
+
return 'all';
|
|
427
|
+
const named = list(input, at);
|
|
428
|
+
named.forEach((name, index) => {
|
|
429
|
+
if (fields)
|
|
430
|
+
specs(typed, name, place(at, index));
|
|
431
|
+
else if (typeof name !== 'string')
|
|
432
|
+
invalid(place(at, index), 'expects a name');
|
|
433
|
+
});
|
|
434
|
+
return named;
|
|
435
|
+
}
|
|
436
|
+
function flag(input, at) {
|
|
437
|
+
if (input === undefined)
|
|
438
|
+
return false;
|
|
439
|
+
if (input !== true)
|
|
440
|
+
invalid(at, 'expects true');
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
function documentShape(typed, input) {
|
|
444
|
+
const orderBy = (input.orderBy === undefined ? [] : list(input.orderBy, 'orderBy')).map((clause, index) => {
|
|
445
|
+
const at = place('orderBy', index);
|
|
446
|
+
if (!plain(clause))
|
|
447
|
+
invalid(at, 'expects an order clause');
|
|
448
|
+
known(clause, ORDER, at);
|
|
449
|
+
return {
|
|
450
|
+
key: keyPlan(typed, clause.by, place(at, 'by'), DOCUMENT_KEYS),
|
|
451
|
+
options: orderOptions(clause, at),
|
|
452
|
+
};
|
|
453
|
+
});
|
|
454
|
+
const select = input.select;
|
|
455
|
+
if (select === 'all') {
|
|
456
|
+
return {
|
|
457
|
+
kind: 'documents',
|
|
458
|
+
fields: 'all',
|
|
459
|
+
sections: 'all',
|
|
460
|
+
preamble: true,
|
|
461
|
+
markdown: true,
|
|
462
|
+
backlinks: true,
|
|
463
|
+
change: true,
|
|
464
|
+
fileId: true,
|
|
465
|
+
revision: true,
|
|
466
|
+
size: true,
|
|
467
|
+
created: true,
|
|
468
|
+
orderBy,
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
if (!plain(select))
|
|
472
|
+
invalid('select', "expects 'all' or the parts to return");
|
|
473
|
+
known(select, PARTS, 'select');
|
|
474
|
+
return {
|
|
475
|
+
kind: 'documents',
|
|
476
|
+
fields: parts(typed, select.fields, ['select', 'fields'], true),
|
|
477
|
+
sections: parts(typed, select.sections, ['select', 'sections'], false),
|
|
478
|
+
preamble: flag(select.preamble, ['select', 'preamble']),
|
|
479
|
+
markdown: flag(select.markdown, ['select', 'markdown']),
|
|
480
|
+
backlinks: flag(select.backlinks, ['select', 'backlinks']),
|
|
481
|
+
change: flag(select.change, ['select', 'change']),
|
|
482
|
+
fileId: flag(select.fileId, ['select', 'fileId']),
|
|
483
|
+
revision: flag(select.revision, ['select', 'revision']),
|
|
484
|
+
size: flag(select.size, ['select', 'size']),
|
|
485
|
+
created: flag(select.created, ['select', 'created']),
|
|
486
|
+
orderBy,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function greatestOf(typed, input) {
|
|
490
|
+
if (input === undefined)
|
|
491
|
+
return null;
|
|
492
|
+
const at = ['select', 'greatest'];
|
|
493
|
+
if (!plain(input))
|
|
494
|
+
invalid(at, 'expects the field whose greatest value each group answers');
|
|
495
|
+
known(input, ['field'], at);
|
|
496
|
+
if (!Object.hasOwn(input, 'field'))
|
|
497
|
+
invalid(at, 'names no field');
|
|
498
|
+
return oneField(typed, input, at);
|
|
499
|
+
}
|
|
500
|
+
function groupShape(typed, input) {
|
|
501
|
+
const groupBy = list(input.groupBy, 'groupBy').map((key, index) => keyPlan(typed, key, place('groupBy', index), GROUP_KEYS));
|
|
502
|
+
if (groupBy.length === 0)
|
|
503
|
+
invalid('groupBy', 'names no key');
|
|
504
|
+
const select = input.select ?? {};
|
|
505
|
+
if (!plain(select))
|
|
506
|
+
invalid('select', 'expects the totals each group answers');
|
|
507
|
+
known(select, GROUP_PARTS, 'select');
|
|
508
|
+
const greatest = greatestOf(typed, select.greatest);
|
|
509
|
+
const grouped = groupBy.map((key) => JSON.stringify(key));
|
|
510
|
+
const orderBy = (input.orderBy === undefined ? [] : list(input.orderBy, 'orderBy')).map((clause, index) => {
|
|
511
|
+
const at = place('orderBy', index);
|
|
512
|
+
if (!plain(clause))
|
|
513
|
+
invalid(at, 'expects an order clause');
|
|
514
|
+
known(clause, ['by', 'direction', 'nulls'], at);
|
|
515
|
+
const by = typeof clause.by === 'string' && GROUP_ORDERS.includes(clause.by)
|
|
516
|
+
? clause.by
|
|
517
|
+
: grouped.indexOf(JSON.stringify(keyPlan(typed, clause.by, place(at, 'by'), [...GROUP_ORDERS, ...GROUP_KEYS])));
|
|
518
|
+
if (by === -1)
|
|
519
|
+
invalid(place(at, 'by'), 'orders by a key the query does not group by');
|
|
520
|
+
if (by === 'greatest' && greatest === null) {
|
|
521
|
+
invalid(place(at, 'by'), 'orders by a greatest value the query does not select');
|
|
522
|
+
}
|
|
523
|
+
return {
|
|
524
|
+
by,
|
|
525
|
+
direction: direction(clause.direction, place(at, 'direction')),
|
|
526
|
+
nulls: nulls(clause.nulls, place(at, 'nulls')),
|
|
527
|
+
};
|
|
528
|
+
});
|
|
529
|
+
return {
|
|
530
|
+
kind: 'groups',
|
|
531
|
+
groupBy,
|
|
532
|
+
size: flag(select.size, ['select', 'size']),
|
|
533
|
+
updated: flag(select.updated, ['select', 'updated']),
|
|
534
|
+
greatest,
|
|
535
|
+
orderBy,
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
function outsideOf(input) {
|
|
539
|
+
const listed = list(input, 'outside');
|
|
540
|
+
listed.forEach((item, index) => {
|
|
541
|
+
if (directory(item, place('outside', index)) === '') {
|
|
542
|
+
invalid(place('outside', index), 'names no directory');
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
return [...new Set(listed)].sort();
|
|
546
|
+
}
|
|
547
|
+
export function planOf(input, facts) {
|
|
548
|
+
if (!plain(input))
|
|
549
|
+
invalid('query', 'expects a query object');
|
|
550
|
+
const grouped = input.groupBy !== undefined;
|
|
551
|
+
if (!grouped && input.select === undefined)
|
|
552
|
+
invalid('select', 'a Document query must select');
|
|
553
|
+
known(input, [...FILTER, 'orderBy', 'limit', 'after', 'total', 'select', 'groupBy'], '');
|
|
554
|
+
const limit = limitOf(input.limit);
|
|
555
|
+
const rooms = input.rooms === undefined ? null : names(input.rooms, 'rooms');
|
|
556
|
+
const { typed, ...root } = scope(facts, rooms, input, '');
|
|
557
|
+
const shape = grouped ? groupShape(typed, input) : documentShape(typed, input);
|
|
558
|
+
return {
|
|
559
|
+
key: queryKey(input),
|
|
560
|
+
rooms,
|
|
561
|
+
root,
|
|
562
|
+
outside: input.outside === undefined ? null : outsideOf(input.outside),
|
|
563
|
+
folder: input.folder === undefined ? null : directory(input.folder, 'folder'),
|
|
564
|
+
paths: input.paths === undefined ? null : pathsOf(input.paths),
|
|
565
|
+
fileIds: input.fileIds === undefined ? null : fileIdsOf(input.fileIds),
|
|
566
|
+
hop: input.hop === undefined ? null : hopOf(facts, rooms, typed, input.hop),
|
|
567
|
+
backlinks: input.backlinks === undefined ? null : backlinksOf(facts, rooms, input.backlinks),
|
|
568
|
+
text: input.text === undefined ? null : phrase(input.text),
|
|
569
|
+
shape,
|
|
570
|
+
limit,
|
|
571
|
+
after: continuationOf(input.after, shape.orderBy.length + 1),
|
|
572
|
+
total: flag(input.total, 'total'),
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
function continuationOf(input, arity) {
|
|
576
|
+
if (input === undefined)
|
|
577
|
+
return null;
|
|
578
|
+
const values = typeof input === 'string' ? decodedCursor(input) : null;
|
|
579
|
+
if (values === null || (values.length !== 0 && values.length !== arity)) {
|
|
580
|
+
invalid('after', 'expects the next an earlier result of this query returned');
|
|
581
|
+
}
|
|
582
|
+
return { text: input, values: values.length === 0 ? null : values };
|
|
583
|
+
}
|
|
584
|
+
function limitOf(input) {
|
|
585
|
+
if (input === undefined)
|
|
586
|
+
return null;
|
|
587
|
+
if (!Number.isSafeInteger(input) || input < 0) {
|
|
588
|
+
invalid('limit', 'expects a nonnegative integer');
|
|
589
|
+
}
|
|
590
|
+
return input;
|
|
591
|
+
}
|
|
592
|
+
export function cursorOf(values) {
|
|
593
|
+
return JSON.stringify(values);
|
|
594
|
+
}
|
|
595
|
+
export function decodedCursor(text) {
|
|
596
|
+
try {
|
|
597
|
+
const decoded = JSON.parse(text);
|
|
598
|
+
return Array.isArray(decoded) ? decoded : null;
|
|
599
|
+
}
|
|
600
|
+
catch {
|
|
601
|
+
return null;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
export function queryKey(query) {
|
|
605
|
+
return canonical(query);
|
|
606
|
+
}
|
|
607
|
+
function canonical(value) {
|
|
608
|
+
if (Array.isArray(value))
|
|
609
|
+
return `[${value.map(canonical).join(',')}]`;
|
|
610
|
+
if (typeof value === 'object' && value !== null) {
|
|
611
|
+
return `{${Object.keys(value)
|
|
612
|
+
.sort()
|
|
613
|
+
.map((name) => `${JSON.stringify(name)}:${canonical(value[name])}`)
|
|
614
|
+
.join(',')}}`;
|
|
615
|
+
}
|
|
616
|
+
return JSON.stringify(value);
|
|
617
|
+
}
|
|
618
|
+
export function identityOf(plan) {
|
|
619
|
+
return canonical(plan);
|
|
620
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Definition } from '../definition.js';
|
|
2
|
+
import { type QueryPlan } from './language.js';
|
|
3
|
+
import { type HeldValue } from './rows.js';
|
|
4
|
+
export type Candidate = {
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly type: string | null;
|
|
7
|
+
readonly fileId: string | null;
|
|
8
|
+
readonly fields: Readonly<Record<string, unknown>>;
|
|
9
|
+
readonly definition?: Pick<Definition, 'root'>;
|
|
10
|
+
readonly text: string | null;
|
|
11
|
+
};
|
|
12
|
+
export declare function heldAt(candidate: Candidate, field: string): readonly HeldValue[];
|
|
13
|
+
export declare function matches(plan: QueryPlan, candidate: Candidate): boolean;
|
|
14
|
+
//# sourceMappingURL=match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/query/match.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAE9D,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AA4HF,wBAAgB,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,SAAS,EAAE,CAEhF;AAiCD,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAYtE"}
|