@agentshouse/mdmodel 0.1.0-cbce4f1da228f → 0.1.0-cbe9e36156a2a
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 +295 -233
- package/README.md +28 -29
- 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 +22 -11
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +223 -88
- package/dist/divide.d.ts.map +1 -1
- package/dist/divide.js +14 -13
- package/dist/document.d.ts +15 -9
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +961 -254
- 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 +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 +831 -0
- package/dist/house-model.d.ts.map +1 -0
- package/dist/house-model.js +462 -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 +38 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -9
- 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/paths.d.ts +19 -2
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +96 -15
- 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.map +1 -1
- package/dist/project.js +33 -60
- 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 +2 -2
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +7 -2
- 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 +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 +1 -2
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +10 -23
- package/dist/types.d.ts +44 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +32 -5
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +340 -151
- package/dist/yaml.d.ts +4 -4
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +41 -15
- package/fixtures/README.md +61 -24
- package/fixtures/cases/absent-link-dangles/library/item.md +1 -1
- package/fixtures/cases/absent-link-dangles/schema.yaml +2 -3
- package/fixtures/cases/absent-optional-field/library/companies/acme.md +1 -1
- package/fixtures/cases/absent-optional-field/library/deals/lead.md +3 -3
- package/fixtures/cases/absent-optional-field/schema.yaml +10 -11
- package/fixtures/cases/absolute-link/library/item.md +1 -1
- package/fixtures/cases/absolute-link/schema.yaml +2 -3
- package/fixtures/cases/attachment-reference-any-file/library/companies/acme.md +1 -1
- package/fixtures/cases/attachment-reference-any-file/library/deals/renewal.md +13 -10
- package/fixtures/cases/attachment-reference-any-file/library/places/depot.md +1 -1
- package/fixtures/cases/attachment-reference-any-file/library/products/seats.md +1 -1
- package/fixtures/cases/attachment-reference-any-file/library/products/support.md +1 -1
- package/fixtures/cases/attachment-reference-dangles/library/companies/acme.md +1 -1
- package/fixtures/cases/attachment-reference-dangles/library/deals/renewal.md +13 -10
- package/fixtures/cases/attachment-reference-dangles/library/places/depot.md +1 -1
- package/fixtures/cases/attachment-reference-dangles/library/products/seats.md +1 -1
- package/fixtures/cases/attachment-reference-dangles/library/products/support.md +1 -1
- package/fixtures/cases/attachment-reference-outside/expected.json +2 -1
- package/fixtures/cases/attachment-reference-outside/library/companies/acme.md +1 -1
- package/fixtures/cases/attachment-reference-outside/library/deals/renewal.md +13 -10
- package/fixtures/cases/attachment-reference-outside/library/places/depot.md +1 -1
- package/fixtures/cases/attachment-reference-outside/library/products/seats.md +1 -1
- package/fixtures/cases/attachment-reference-outside/library/products/support.md +1 -1
- package/fixtures/cases/binary-any-reference/expected.json +2 -1
- package/fixtures/cases/binary-any-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-prototype-reference/expected.json +2 -1
- package/fixtures/cases/binary-prototype-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/binary-typed-reference/expected.json +2 -1
- package/fixtures/cases/binary-typed-reference/library/notes/draft.md +1 -1
- package/fixtures/cases/boolean-field/expected.json +2 -1
- package/fixtures/cases/boolean-field/library/companies/acme.md +1 -1
- package/fixtures/cases/boolean-field/library/deals/renewal.md +49 -24
- package/fixtures/cases/boolean-field/schema.yaml +10 -11
- package/fixtures/cases/bracketed-link-definition/library/item.md +1 -1
- package/fixtures/cases/bracketed-link-definition/schema.yaml +2 -3
- package/fixtures/cases/closed-nested-object/expected.json +2 -1
- package/fixtures/cases/closed-nested-object/library/companies/acme.md +1 -1
- package/fixtures/cases/closed-nested-object/library/deals/renewal.md +50 -25
- package/fixtures/cases/closed-nested-object/schema.yaml +10 -11
- package/fixtures/cases/composed-root-reference/library/a.md +2 -2
- package/fixtures/cases/conditional-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/library/clients/acme.md +6 -0
- package/fixtures/cases/cross-room-link/schema.yaml +3 -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/expected.json +2 -1
- package/fixtures/cases/date-time-format/library/companies/acme.md +1 -1
- package/fixtures/cases/date-time-format/library/deals/renewal.md +49 -24
- package/fixtures/cases/date-time-format/schema.yaml +10 -11
- package/fixtures/cases/default-unfilled/library/companies/acme.md +1 -1
- package/fixtures/cases/default-unfilled/library/deals/renewal.md +47 -22
- package/fixtures/cases/default-unfilled/schema.yaml +10 -11
- package/fixtures/cases/defs-pattern/expected.json +2 -1
- package/fixtures/cases/defs-pattern/library/companies/acme.md +1 -1
- package/fixtures/cases/defs-pattern/library/deals/renewal.md +49 -24
- package/fixtures/cases/defs-pattern/schema.yaml +10 -11
- package/fixtures/cases/dependent-rule/library/companies/acme.md +1 -1
- package/fixtures/cases/dependent-rule/library/deals/renewal.md +48 -23
- package/fixtures/cases/dependent-rule/schema.yaml +10 -11
- package/fixtures/cases/duplicate-link-definition/library/item.md +1 -1
- package/fixtures/cases/duplicate-link-definition/schema.yaml +2 -3
- package/fixtures/cases/email-format/expected.json +2 -1
- package/fixtures/cases/email-format/library/companies/acme.md +1 -1
- package/fixtures/cases/email-format/library/deals/renewal.md +49 -24
- package/fixtures/cases/email-format/schema.yaml +10 -11
- package/fixtures/cases/equal-labels/expected.json +5 -0
- package/fixtures/cases/equal-labels/schema.yaml +4 -0
- package/fixtures/cases/fenced-link-definition/library/item.md +1 -1
- package/fixtures/cases/fenced-link-definition/schema.yaml +2 -3
- package/fixtures/cases/field-enum/expected.json +2 -1
- package/fixtures/cases/field-enum/library/item.md +2 -2
- package/fixtures/cases/field-enum/schema.yaml +3 -4
- package/fixtures/cases/integer-field/expected.json +2 -1
- package/fixtures/cases/integer-field/library/companies/acme.md +1 -1
- package/fixtures/cases/integer-field/library/deals/renewal.md +49 -24
- package/fixtures/cases/integer-field/schema.yaml +10 -11
- package/fixtures/cases/json-schema-constructs/library/companies/acme.md +1 -1
- package/fixtures/cases/json-schema-constructs/library/deals/renewal.md +49 -24
- package/fixtures/cases/json-schema-constructs/schema.yaml +10 -11
- package/fixtures/cases/labels-in-the-rooms-language/expected.json +1 -0
- package/fixtures/cases/labels-in-the-rooms-language/library/deals/atlas.md +7 -0
- package/fixtures/cases/labels-in-the-rooms-language/schema.yaml +9 -0
- package/fixtures/cases/lazy-list-item/expected.json +3 -0
- package/fixtures/cases/lazy-list-item/library/item.md +10 -0
- package/fixtures/cases/lazy-list-item/schema.yaml +3 -0
- package/fixtures/cases/link-into-a-reserved-name/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/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/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/page.md +26 -0
- package/fixtures/cases/list-items/schema.yaml +10 -0
- package/fixtures/cases/list-of-objects-closed/expected.json +2 -1
- package/fixtures/cases/list-of-objects-closed/library/companies/acme.md +1 -1
- package/fixtures/cases/list-of-objects-closed/library/deals/renewal.md +49 -25
- package/fixtures/cases/list-of-objects-closed/schema.yaml +10 -11
- package/fixtures/cases/list-of-objects-item/expected.json +2 -1
- package/fixtures/cases/list-of-objects-item/library/companies/acme.md +1 -1
- package/fixtures/cases/list-of-objects-item/library/deals/renewal.md +49 -24
- package/fixtures/cases/list-of-objects-item/schema.yaml +10 -11
- package/fixtures/cases/list-of-objects-reference/expected.json +2 -1
- package/fixtures/cases/list-of-objects-reference/library/companies/acme.md +1 -1
- package/fixtures/cases/list-of-objects-reference/library/deals/renewal.md +12 -9
- package/fixtures/cases/list-of-objects-reference/library/places/depot.md +1 -1
- package/fixtures/cases/list-of-objects-reference/library/products/seats.md +1 -1
- package/fixtures/cases/list-of-objects-reference/library/products/support.md +1 -1
- package/fixtures/cases/list-reference-path/context.json +1 -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.yaml +3 -0
- package/fixtures/cases/list-reference-type/context.json +1 -0
- package/fixtures/cases/list-reference-type/expected.json +7 -0
- package/fixtures/cases/list-reference-type/library/page.md +6 -0
- package/fixtures/cases/list-reference-type/schema.yaml +3 -0
- package/fixtures/cases/list-size/expected.json +2 -1
- package/fixtures/cases/list-size/library/companies/acme.md +1 -1
- package/fixtures/cases/list-size/library/deals/renewal.md +51 -24
- package/fixtures/cases/list-size/schema.yaml +10 -11
- package/fixtures/cases/long-value-past-six-levels/context.json +1 -0
- package/fixtures/cases/long-value-past-six-levels/expected.json +5 -0
- package/fixtures/cases/long-value-past-six-levels/schema.yaml +15 -0
- package/fixtures/cases/malformed-list/context.json +1 -0
- package/fixtures/cases/malformed-list/expected.json +7 -0
- package/fixtures/cases/{structured-section → malformed-list}/library/item.md +1 -1
- package/fixtures/cases/malformed-list/schema.yaml +6 -0
- package/fixtures/cases/member-document/library/people/ana.md +2 -2
- package/fixtures/cases/member-on-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/library/item.md +1 -1
- package/fixtures/cases/missing-required-field/schema.yaml +3 -4
- package/fixtures/cases/misspelled-key/expected.json +2 -1
- package/fixtures/cases/misspelled-key/library/companies/acme.md +1 -1
- package/fixtures/cases/misspelled-key/library/deals/renewal.md +50 -25
- package/fixtures/cases/misspelled-key/schema.yaml +10 -11
- package/fixtures/cases/name-not-a-string/context.json +1 -0
- package/fixtures/cases/name-not-a-string/expected.json +5 -0
- package/fixtures/cases/name-not-a-string/schema.yaml +5 -0
- package/fixtures/cases/nested-defs/expected.json +2 -1
- package/fixtures/cases/nested-defs/library/deal.md +3 -3
- package/fixtures/cases/nested-object-reference/expected.json +2 -1
- package/fixtures/cases/nested-object-reference/library/companies/acme.md +1 -1
- package/fixtures/cases/nested-object-reference/library/deals/renewal.md +12 -9
- package/fixtures/cases/nested-object-reference/library/places/depot.md +1 -1
- package/fixtures/cases/nested-object-reference/library/products/seats.md +1 -1
- package/fixtures/cases/nested-object-reference/library/products/support.md +1 -1
- package/fixtures/cases/nested-reference/library/companies/acme.md +1 -1
- package/fixtures/cases/nested-reference/library/deals/renewal.md +13 -10
- package/fixtures/cases/nested-reference/library/places/depot.md +1 -1
- package/fixtures/cases/nested-reference/library/products/seats.md +1 -1
- package/fixtures/cases/nested-reference/library/products/support.md +1 -1
- package/fixtures/cases/nested-required-field/expected.json +2 -1
- package/fixtures/cases/nested-required-field/library/companies/acme.md +1 -1
- package/fixtures/cases/nested-required-field/library/deals/renewal.md +48 -23
- package/fixtures/cases/nested-required-field/schema.yaml +10 -11
- package/fixtures/cases/numeric-range/expected.json +2 -1
- package/fixtures/cases/numeric-range/library/companies/acme.md +1 -1
- package/fixtures/cases/numeric-range/library/deals/renewal.md +49 -24
- package/fixtures/cases/numeric-range/schema.yaml +10 -11
- package/fixtures/cases/one-key-two-labels/context.json +1 -0
- package/fixtures/cases/one-key-two-labels/expected.json +5 -0
- package/fixtures/cases/one-key-two-labels/schema.yaml +5 -0
- package/fixtures/cases/one-key-two-types/context.json +1 -0
- package/fixtures/cases/one-key-two-types/expected.json +5 -0
- package/fixtures/cases/one-key-two-types/schema.yaml +4 -0
- package/fixtures/cases/one-of-variant/expected.json +2 -1
- package/fixtures/cases/one-of-variant/library/companies/acme.md +1 -1
- package/fixtures/cases/one-of-variant/library/deals/renewal.md +49 -24
- package/fixtures/cases/one-of-variant/schema.yaml +10 -11
- package/fixtures/cases/other-room-reference/expected.json +2 -1
- package/fixtures/cases/other-room-reference/library/companies/acme.md +1 -1
- package/fixtures/cases/other-room-reference/library/deals/renewal.md +12 -9
- package/fixtures/cases/other-room-reference/library/places/depot.md +1 -1
- package/fixtures/cases/other-room-reference/library/products/seats.md +1 -1
- package/fixtures/cases/other-room-reference/library/products/support.md +1 -1
- package/fixtures/cases/prototype-field/expected.json +2 -1
- package/fixtures/cases/prototype-field/library/item.md +2 -2
- package/fixtures/cases/prototype-field/schema.yaml +2 -3
- package/fixtures/cases/reference-into-a-reserved-name/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/library/a.md +2 -2
- package/fixtures/cases/referenced-missing-file/library/b.md +2 -2
- package/fixtures/cases/referenced-missing-file/schema.yaml +3 -4
- package/fixtures/cases/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/sections-keyword-refused/context.json +1 -0
- package/fixtures/cases/sections-keyword-refused/expected.json +5 -0
- package/fixtures/cases/{structured-section → sections-keyword-refused}/schema.yaml +1 -2
- package/fixtures/cases/shortcut-reference-link/library/item.md +1 -1
- package/fixtures/cases/shortcut-reference-link/schema.yaml +2 -3
- package/fixtures/cases/string-length/expected.json +2 -1
- package/fixtures/cases/string-length/library/companies/acme.md +1 -1
- package/fixtures/cases/string-length/library/deals/renewal.md +49 -24
- package/fixtures/cases/string-length/schema.yaml +10 -11
- package/fixtures/cases/submission-keys/library/notes/visitor.md +2 -2
- package/fixtures/cases/text-field-kind/expected.json +1 -4
- package/fixtures/cases/text-field-kind/library/page.md +1 -1
- package/fixtures/cases/thematic-break-ends-the-values/context.json +1 -0
- package/fixtures/cases/thematic-break-ends-the-values/expected.json +1 -0
- package/fixtures/cases/thematic-break-ends-the-values/library/item.md +10 -0
- package/fixtures/cases/thematic-break-ends-the-values/schema.yaml +3 -0
- package/fixtures/cases/typed-path-names-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/library/types/task.md +1 -1
- package/fixtures/cases/undeclared-field/expected.json +2 -1
- package/fixtures/cases/undeclared-field/library/item.md +2 -2
- package/fixtures/cases/undeclared-field/schema.yaml +2 -3
- package/fixtures/cases/unevaluated-items-closed/expected.json +2 -1
- package/fixtures/cases/unevaluated-items-closed/library/trip.md +13 -3
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/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/library/item.md +1 -1
- package/fixtures/cases/unresolved-link/schema.yaml +2 -3
- package/fixtures/cases/valid-typed-document/library/people/ada.md +1 -1
- package/fixtures/cases/valid-typed-document/library/tasks/one.md +11 -11
- package/fixtures/cases/valid-typed-document/schema.yaml +5 -6
- package/fixtures/division.json +111 -66
- package/fixtures/forms.json +347 -0
- package/fixtures/preamble.json +26 -5
- package/fixtures/projection.json +121 -18
- package/fixtures/queries.json +964 -0
- package/package.json +16 -2
- package/dist/blocks.d.ts +0 -11
- package/dist/blocks.d.ts.map +0 -1
- package/dist/blocks.js +0 -69
- package/dist/condition.d.ts +0 -149
- package/dist/condition.d.ts.map +0 -1
- package/dist/condition.js +0 -500
- package/dist/links.d.ts +0 -28
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js +0 -785
- package/dist/profile.d.ts +0 -6
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -5
- package/dist/sections.d.ts +0 -11
- package/dist/sections.d.ts.map +0 -1
- package/dist/sections.js +0 -57
- package/fixtures/cases/missing-section-item-kind/expected.json +0 -5
- package/fixtures/cases/missing-section-item-kind/schema.yaml +0 -6
- package/fixtures/cases/null-refused/expected.json +0 -6
- package/fixtures/cases/null-refused/library/companies/acme.md +0 -4
- package/fixtures/cases/null-refused/library/deals/renewal.md +0 -31
- package/fixtures/cases/null-refused/schema.yaml +0 -56
- package/fixtures/cases/open-map-value/expected.json +0 -6
- package/fixtures/cases/open-map-value/library/companies/acme.md +0 -4
- package/fixtures/cases/open-map-value/library/deals/renewal.md +0 -31
- package/fixtures/cases/open-map-value/schema.yaml +0 -56
- package/fixtures/cases/section-item-enum/expected.json +0 -6
- package/fixtures/cases/section-item-enum/library/task.md +0 -8
- package/fixtures/cases/section-item-enum/schema.yaml +0 -3
- package/fixtures/cases/section-item-kind/expected.json +0 -6
- package/fixtures/cases/section-item-kind/library/task.md +0 -8
- package/fixtures/cases/section-item-kind/schema.yaml +0 -3
- package/fixtures/cases/section-items/library/page.md +0 -42
- package/fixtures/cases/section-items/schema.yaml +0 -10
- package/fixtures/cases/section-reference-path/expected.json +0 -6
- package/fixtures/cases/section-reference-path/library/page.md +0 -7
- package/fixtures/cases/section-reference-path/schema.yaml +0 -3
- package/fixtures/cases/section-reference-type/expected.json +0 -6
- package/fixtures/cases/section-reference-type/library/page.md +0 -7
- package/fixtures/cases/section-reference-type/schema.yaml +0 -3
- package/fixtures/cases/structured-section/expected.json +0 -6
- /package/fixtures/cases/{missing-section-item-kind → conditional-long-text}/context.json +0 -0
- /package/fixtures/cases/{null-refused → cross-room-link}/context.json +0 -0
- /package/fixtures/cases/{section-items → cross-room-link}/expected.json +0 -0
- /package/fixtures/cases/{open-map-value → cross-room-reference}/context.json +0 -0
- /package/fixtures/cases/{section-item-enum → equal-labels}/context.json +0 -0
- /package/fixtures/cases/{section-item-kind → labels-in-the-rooms-language}/context.json +0 -0
- /package/fixtures/cases/{section-items → lazy-list-item}/context.json +0 -0
- /package/fixtures/cases/{section-reference-type → link-into-a-reserved-name}/context.json +0 -0
- /package/fixtures/cases/{section-reference-path → link-into-a-reserved-name-from-an-untyped-document}/context.json +0 -0
- /package/fixtures/cases/{structured-section → list-item-enum}/context.json +0 -0
- /package/fixtures/cases/{section-items → list-items}/library/other.md +0 -0
- /package/fixtures/cases/{section-reference-path → list-reference-path}/library/other.md +0 -0
- /package/fixtures/cases/{section-reference-type → list-reference-type}/library/note.md +0 -0
package/dist/yaml.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
export class YamlError extends Error {
|
|
2
2
|
offset;
|
|
3
3
|
constructor(offset) {
|
|
4
|
-
super(
|
|
4
|
+
super();
|
|
5
5
|
this.offset = offset;
|
|
6
6
|
this.name = 'YamlError';
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
const YAML_DEPTH_MAX = 64;
|
|
10
|
+
function nested(c, parse) {
|
|
11
|
+
if (c.depth >= YAML_DEPTH_MAX)
|
|
12
|
+
throw new YamlError(c.i);
|
|
13
|
+
c.depth += 1;
|
|
14
|
+
try {
|
|
15
|
+
return parse();
|
|
16
|
+
}
|
|
17
|
+
finally {
|
|
18
|
+
c.depth -= 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
9
21
|
function peek(c) {
|
|
10
22
|
return c.i < c.end ? c.text[c.i] : '';
|
|
11
23
|
}
|
|
@@ -70,7 +82,10 @@ function indentAt(c) {
|
|
|
70
82
|
}
|
|
71
83
|
return n;
|
|
72
84
|
}
|
|
85
|
+
const UNHELD_TEXT = /[\0\ud800-\udfff]/u;
|
|
73
86
|
function scalar(value, start, end) {
|
|
87
|
+
if (typeof value === 'string' && UNHELD_TEXT.test(value))
|
|
88
|
+
throw new YamlError(start);
|
|
74
89
|
return { kind: 'scalar', value, start, end };
|
|
75
90
|
}
|
|
76
91
|
export function interpretPlain(text) {
|
|
@@ -202,9 +217,10 @@ function parseFlowValue(c) {
|
|
|
202
217
|
return parseScalar(c, true);
|
|
203
218
|
}
|
|
204
219
|
function parseFlowMap(c) {
|
|
220
|
+
return nested(c, () => flowMap(c));
|
|
221
|
+
}
|
|
222
|
+
function flowMap(c) {
|
|
205
223
|
const start = c.i;
|
|
206
|
-
if (peek(c) !== '{')
|
|
207
|
-
throw new YamlError(c.i);
|
|
208
224
|
c.i += 1;
|
|
209
225
|
skipFlowSpace(c);
|
|
210
226
|
const entries = [];
|
|
@@ -240,9 +256,10 @@ function parseFlowMap(c) {
|
|
|
240
256
|
throw new YamlError(c.i);
|
|
241
257
|
}
|
|
242
258
|
function parseFlowSeq(c) {
|
|
259
|
+
return nested(c, () => flowSeq(c));
|
|
260
|
+
}
|
|
261
|
+
function flowSeq(c) {
|
|
243
262
|
const start = c.i;
|
|
244
|
-
if (peek(c) !== '[')
|
|
245
|
-
throw new YamlError(c.i);
|
|
246
263
|
c.i += 1;
|
|
247
264
|
skipFlowSpace(c);
|
|
248
265
|
const items = [];
|
|
@@ -314,10 +331,8 @@ function mappingAhead(c) {
|
|
|
314
331
|
const next = c.text[c.i + 1];
|
|
315
332
|
return next === ' ' || next === '\n' || next === '\r' || c.i + 1 >= c.end;
|
|
316
333
|
}
|
|
317
|
-
catch
|
|
318
|
-
|
|
319
|
-
return false;
|
|
320
|
-
throw error;
|
|
334
|
+
catch {
|
|
335
|
+
return false;
|
|
321
336
|
}
|
|
322
337
|
finally {
|
|
323
338
|
c.i = start;
|
|
@@ -336,6 +351,9 @@ function parseSeqItem(c, indent) {
|
|
|
336
351
|
return parseValue(c, indent);
|
|
337
352
|
}
|
|
338
353
|
function parseBlockSeq(c, indent) {
|
|
354
|
+
return nested(c, () => blockSeq(c, indent));
|
|
355
|
+
}
|
|
356
|
+
function blockSeq(c, indent) {
|
|
339
357
|
const start = c.i;
|
|
340
358
|
const items = [];
|
|
341
359
|
let end = start;
|
|
@@ -355,6 +373,9 @@ function parseBlockSeq(c, indent) {
|
|
|
355
373
|
return { kind: 'seq', items, start, end };
|
|
356
374
|
}
|
|
357
375
|
function parseBlockMap(c, indent, inline = false) {
|
|
376
|
+
return nested(c, () => blockMap(c, indent, inline));
|
|
377
|
+
}
|
|
378
|
+
function blockMap(c, indent, inline) {
|
|
358
379
|
const start = c.i;
|
|
359
380
|
const entries = [];
|
|
360
381
|
const seen = new Set();
|
|
@@ -387,7 +408,7 @@ function parseBlockMap(c, indent, inline = false) {
|
|
|
387
408
|
return { kind: 'map', entries, start, end };
|
|
388
409
|
}
|
|
389
410
|
export function parseYamlMapping(text, start, end) {
|
|
390
|
-
const c = { text, i: start, end };
|
|
411
|
+
const c = { text, i: start, end, depth: 0 };
|
|
391
412
|
skipBlankAndComments(c);
|
|
392
413
|
if (c.i >= end)
|
|
393
414
|
return { kind: 'map', entries: [], start, end };
|
|
@@ -439,19 +460,25 @@ function listed(value) {
|
|
|
439
460
|
return keys.length === value.length && keys.every((key, index) => key === String(index));
|
|
440
461
|
}
|
|
441
462
|
function heldWithin(value, within) {
|
|
442
|
-
if (
|
|
463
|
+
if (typeof value === 'string')
|
|
464
|
+
return !UNHELD_TEXT.test(value);
|
|
465
|
+
if (value === null || typeof value === 'boolean')
|
|
443
466
|
return true;
|
|
444
467
|
if (typeof value === 'number')
|
|
445
468
|
return Number.isFinite(value);
|
|
446
469
|
if (typeof value !== 'object' || within.includes(value))
|
|
447
470
|
return false;
|
|
471
|
+
if (within.length + 1 >= YAML_DEPTH_MAX)
|
|
472
|
+
return false;
|
|
448
473
|
const path = [...within, value];
|
|
449
474
|
const held = (item) => heldWithin(item, path);
|
|
450
475
|
if (Array.isArray(value))
|
|
451
476
|
return listed(value) && value.every(held);
|
|
452
|
-
return plain(value) &&
|
|
477
|
+
return (plain(value) &&
|
|
478
|
+
Object.keys(value).every((key) => !UNHELD_TEXT.test(key)) &&
|
|
479
|
+
Object.values(value).every(held));
|
|
453
480
|
}
|
|
454
|
-
export function
|
|
481
|
+
export function documentValue(value) {
|
|
455
482
|
return heldWithin(value, []);
|
|
456
483
|
}
|
|
457
484
|
export function serializeJs(value) {
|
|
@@ -495,7 +522,7 @@ export function extractFrontmatter(content) {
|
|
|
495
522
|
return { kind: 'unclosed' };
|
|
496
523
|
const yamlStart = firstNl + 1;
|
|
497
524
|
let i = yamlStart;
|
|
498
|
-
|
|
525
|
+
for (;;) {
|
|
499
526
|
const nl = content.indexOf('\n', i);
|
|
500
527
|
const lineEnd = nl === -1 ? content.length : nl;
|
|
501
528
|
let line = content.slice(i, lineEnd);
|
|
@@ -507,7 +534,6 @@ export function extractFrontmatter(content) {
|
|
|
507
534
|
return { kind: 'unclosed' };
|
|
508
535
|
i = nl + 1;
|
|
509
536
|
}
|
|
510
|
-
return { kind: 'unclosed' };
|
|
511
537
|
}
|
|
512
538
|
export function equalValue(left, right) {
|
|
513
539
|
if (left === right)
|
package/fixtures/README.md
CHANGED
|
@@ -10,6 +10,20 @@ cases compare `validate(library, context)` directly. Text-only cases carry
|
|
|
10
10
|
`{ "binaryTargets": [] }`. Binary targets are membership declarations; the
|
|
11
11
|
corpus supplies no binary bytes or placeholder Documents.
|
|
12
12
|
|
|
13
|
+
## Forms
|
|
14
|
+
|
|
15
|
+
`forms.json` exercises how a typed Document writes its values in its body. It carries `schema`,
|
|
16
|
+
one schema text, `names`, the name each reference value's target shows, and three lists. Each of
|
|
17
|
+
`cases` carries `name`, the `type` its source declares, exact `source` and the `value` `parse`
|
|
18
|
+
reads with that type's definition, and optionally `ranges`, the exact source text of each listed
|
|
19
|
+
pointer's `Document.ranges` entry, `after`, the text `Document.listEnd` is followed by, the
|
|
20
|
+
`preamble`, `sections` and `text` it reads, `written: true` where `create(type)` with one `field`
|
|
21
|
+
change per value but `type` and a `text` change of the case's `text`, applied with the definition
|
|
22
|
+
and a `nameOf` reading `names`, serializes to `source` exactly, and `rendered`, each pointer's
|
|
23
|
+
exact text as GitHub Flavored Markdown renders it. Each of `refused` carries `name`, `type`,
|
|
24
|
+
`source` and the `refusal` `parse` answers, its `rule`, `location` and `line`. Each of `applied`
|
|
25
|
+
carries `name`, `type`, `source`, `changes` and the exact source `apply` writes.
|
|
26
|
+
|
|
13
27
|
## Preamble operations
|
|
14
28
|
|
|
15
29
|
`preamble.json` exercises the public parse/apply/serialize seam separately from
|
|
@@ -18,7 +32,9 @@ the validation Libraries. Each row carries `name`, exact `source`, expected
|
|
|
18
32
|
the source, compare `Document.preamble`, apply
|
|
19
33
|
`{ kind: 'preamble', prior: preamble, value }`, and compare the serialized result.
|
|
20
34
|
These cases cover empty and heading-free Documents, frontmatter boundaries,
|
|
21
|
-
fenced headings
|
|
35
|
+
fenced headings and a heading an HTML block holds, setext, indented and empty
|
|
36
|
+
headings that open a section, newline/source preservation, and a moved-export
|
|
37
|
+
link rewrite.
|
|
22
38
|
|
|
23
39
|
## Projection
|
|
24
40
|
|
|
@@ -31,8 +47,8 @@ optional `relabel`, an optional `filtered`, and `expected`.
|
|
|
31
47
|
A case carrying a `move` lists both the Path its target sits at and the Path the
|
|
32
48
|
move takes it to, because the collection holds that target either way.
|
|
33
49
|
|
|
34
|
-
Verify the schema, parse the source
|
|
35
|
-
with `documentTargets` and
|
|
50
|
+
Verify the schema, parse the source with the verified type `definition` names, call
|
|
51
|
+
`project(document, file, context)` with `documentTargets` and that definition, and compare against `expected`. Where
|
|
36
52
|
`links` is present, compare `links(document, file)` against it. Then check
|
|
37
53
|
that the source is unchanged. Where `move` is present, apply
|
|
38
54
|
`{ kind: 'link', href, to }`, confirm the serialized Document changed, and
|
|
@@ -43,7 +59,7 @@ exactly once, join the pieces with its `to`, parse the result, and confirm its
|
|
|
43
59
|
projection is exactly the relabel's own `expected` and differs from the case's:
|
|
44
60
|
a changed visible label changes the projection. Where `filtered` is present,
|
|
45
61
|
apply `{ kind: 'field', name: field, value, prior }` with its `field` and
|
|
46
|
-
`value` and the Document's current value as `prior
|
|
62
|
+
`value` and the Document's current value as `prior` with the definition, confirm the serialized
|
|
47
63
|
Document changed, and confirm its projection is still exactly `expected`: a
|
|
48
64
|
change to a value that is not prose leaves the projection alone.
|
|
49
65
|
|
|
@@ -51,20 +67,31 @@ change to a value that is not prose leaves the projection alone.
|
|
|
51
67
|
|
|
52
68
|
`division.json` exercises the public `divide` seam separately from the
|
|
53
69
|
validation Libraries. It carries `schema` and `cases` like `projection.json`,
|
|
54
|
-
and each case adds the `
|
|
55
|
-
`divide(document, file, context)` with `{ documentTargets, definition,
|
|
70
|
+
and each case adds the `bound` the division runs under. Parse the source, call
|
|
71
|
+
`divide(document, file, context)` with `{ documentTargets, definition, bound }`,
|
|
56
72
|
and compare against `expected`: either `{ "ok": true, "spans": [...] }`, where
|
|
57
73
|
each span carries the exact `text` to embed and the exact `source` the returned
|
|
58
74
|
`start` and `end` address in that case's source, or `{ "ok": false, "refusal": ... }`. Then
|
|
59
75
|
check that the source is unchanged. A span's `text` and `source` differ where
|
|
60
76
|
the embedded text repeats a continuation's own heading, carries an internal
|
|
61
|
-
link's visible label
|
|
62
|
-
|
|
63
|
-
section between two pieces one span packs together or the whole of a free-text
|
|
64
|
-
value one span carries part of. `start` and `end` are UTF-8 byte offsets into the case's
|
|
77
|
+
link's visible label or carries a value without the escape the author wrote, and where the
|
|
78
|
+
addressed extent encloses a value list or a label between two pieces one span packs together. `start` and `end` are UTF-8 byte offsets into the case's
|
|
65
79
|
source; every source in this corpus is ASCII, so a consumer compares the
|
|
66
80
|
addressed `source` with an ordinary string slice.
|
|
67
81
|
|
|
82
|
+
## Queries
|
|
83
|
+
|
|
84
|
+
`queries.json` is the one table of cases both query evaluators answer. It carries `schema`,
|
|
85
|
+
one schema text; `documents`, each named and carrying its `path`, the `type` a collection
|
|
86
|
+
stores for it (`any` for an untyped Markdown Document, `null` for one that is not Markdown),
|
|
87
|
+
its `fileId`, the `text` the device holds or `null`, and its `fields`; and `cases`, each with a
|
|
88
|
+
`name`, a `query` of filter parts, the `document` it names and whether it `matches`. Verify
|
|
89
|
+
the schema and plan `{ ...query, select: {} }` with `planOf` against its types. Then
|
|
90
|
+
`matches(plan, candidate)` over the named Document, given its type's definition, and the
|
|
91
|
+
condition `sql.tests` writes over a collection holding every Document of the table with the
|
|
92
|
+
values `indexed` derives from it must both answer `matches`. A new operator adds its cases
|
|
93
|
+
here first.
|
|
94
|
+
|
|
68
95
|
## Verdict format
|
|
69
96
|
|
|
70
97
|
Acceptance:
|
|
@@ -79,22 +106,23 @@ Refusal:
|
|
|
79
106
|
{
|
|
80
107
|
"verdict": "refuse",
|
|
81
108
|
"file": "<library path>",
|
|
82
|
-
"location": "<JSON Pointer
|
|
109
|
+
"location": "<JSON Pointer>",
|
|
83
110
|
"rule": "<rule id>",
|
|
111
|
+
"line": 5,
|
|
84
112
|
"referrers": ["<library path>"]
|
|
85
113
|
}
|
|
86
114
|
```
|
|
87
115
|
|
|
88
|
-
`location` is the JSON Pointer of the
|
|
89
|
-
|
|
90
|
-
the
|
|
116
|
+
`location` is the JSON Pointer of the value a rule concerns, such as `/shipping/city`, and is
|
|
117
|
+
omitted when the rule concerns none. `line` is the line, from 1, of the Document's source the value
|
|
118
|
+
is written on, present when the value is written; a missing one has none. `referrers` is present only for
|
|
91
119
|
`referenced-missing-file`. A schema refusal carries no `file`; its `location`
|
|
92
120
|
is the JSON Pointer of the schema part it concerns, such as
|
|
93
121
|
`/task/properties/title/type`, or `line <n>` for `schema-yaml`.
|
|
94
122
|
|
|
95
123
|
## Rule ids
|
|
96
124
|
|
|
97
|
-
A
|
|
125
|
+
A value that fails a JSON Schema keyword is refused under that
|
|
98
126
|
keyword's name, such as `required`, `type`, `enum`, `format`, `pattern`,
|
|
99
127
|
`minimum`, `maxLength`, `maxItems` or `oneOf`, at the value's JSON Pointer; a
|
|
100
128
|
missing required key is named by the Pointer it would sit at. A malformed
|
|
@@ -107,25 +135,34 @@ schema text. The model's own rules:
|
|
|
107
135
|
| `frontmatter-fence` | A present frontmatter fence does not parse as the accepted YAML subset |
|
|
108
136
|
| `schema-yaml` | A schema text is not a mapping in the accepted YAML subset |
|
|
109
137
|
| `schema-type-name` | A type name is empty, starts with `$`, or is `any` or `attachment` |
|
|
138
|
+
| `provided-type` | A schema names a type its caller provides with a key but its two role keywords |
|
|
110
139
|
| `schema` | A type or subschema is neither a mapping nor a boolean |
|
|
111
140
|
| `schema-keyword` | A schema carries a key that is no JSON Schema 2020-12 keyword the model admits |
|
|
112
141
|
| `$defs` | `$defs` is not a mapping |
|
|
113
142
|
| `$ref` | A `$ref` reaches no subschema under `#/$defs/` of the same file |
|
|
114
143
|
| `reference` | `reference` is not on a string or names something but a type, `any`, `attachment` |
|
|
115
|
-
| `sections` | A section is not `{ kind: text }` or `{ kind: list, items }` over one scalar |
|
|
116
144
|
| `member_document` | The mark is not a boolean, or a second type carries it |
|
|
117
|
-
| `
|
|
145
|
+
| `duplicate-label` | Two fields of one object show one label: a field's `title`, else its key |
|
|
146
|
+
| `conflicting-label` | Declarations of one key in `anyOf`, `oneOf`, `then`, `else` or a composed shape give it two `title`s |
|
|
147
|
+
| `conflicting-type` | Such declarations give one key two JSON types, integer and number counting as one |
|
|
148
|
+
| `name-type` | A type's top-level `name` is not a string |
|
|
149
|
+
| `heading-depth` | A value written under a heading sits past `######`: `##` at the top, a level deeper per property or list item, none inside a `json` block |
|
|
150
|
+
| `unknown-type` | A file declares a type absent from the governing schema, or other than its typed path requires it to name |
|
|
118
151
|
| `undeclared-field` | A closed object carries a key it does not declare |
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
152
|
+
| `malformed-value` | A value is not written in its form, or a typed Document's frontmatter holds a key that is not House's |
|
|
153
|
+
| `repeated-value` | A value is written twice: two lines, a line and a heading, or two headings |
|
|
154
|
+
| `unknown-label` | A line, heading or column of a closed object names no field |
|
|
155
|
+
| `unresolved-reference` | A reference at any depth reaches no member it admits |
|
|
156
|
+
| `unresolved-link` | A body link is an absolute path, leaves the collection or, from a typed Document at a document path, reaches a reserved name |
|
|
157
|
+
| `room-md-type` | `ROOM.md` declares a type |
|
|
158
|
+
| `required-body` | A file at a typed path that requires a body has a body holding no text |
|
|
123
159
|
| `referenced-missing-file` | Remaining files still reference an absent path |
|
|
124
160
|
| `unwritable-link` | No Markdown destination form can carry a new link destination |
|
|
125
|
-
| `
|
|
161
|
+
| `required-section` | A section change names no free section of the Document |
|
|
162
|
+
| `division-bound` | A division bound is not a whole number of at least 2 |
|
|
126
163
|
|
|
127
|
-
`unwritable-link`
|
|
128
|
-
by `validate`, so no case under `cases/` carries
|
|
164
|
+
`unwritable-link` and `required-section` are refused by `apply` and `division-bound` by
|
|
165
|
+
`divide`, not by `validate`, so no case under `cases/` carries them.
|
|
129
166
|
|
|
130
167
|
A reference that admits `attachment` reaches any path in the same Library, so
|
|
131
168
|
neither `unresolved-reference` for an absent target nor
|
|
@@ -4,7 +4,7 @@ $defs:
|
|
|
4
4
|
properties:
|
|
5
5
|
city: { type: string }
|
|
6
6
|
country: { type: string, pattern: '^[A-Z]{2}$' }
|
|
7
|
-
required: [city]
|
|
7
|
+
required: [ city ]
|
|
8
8
|
company:
|
|
9
9
|
properties:
|
|
10
10
|
name: { type: string }
|
|
@@ -13,13 +13,13 @@ deal:
|
|
|
13
13
|
properties:
|
|
14
14
|
title: { type: string, minLength: 1, maxLength: 40 }
|
|
15
15
|
company: { type: string, reference: company }
|
|
16
|
-
stage: { enum: [lead, proposal, won, lost], default: lead }
|
|
16
|
+
stage: { enum: [ lead, proposal, won, lost ], default: lead }
|
|
17
17
|
amount: { type: integer, minimum: 0 }
|
|
18
18
|
probability: { type: number, minimum: 0, maximum: 1 }
|
|
19
19
|
open: { type: boolean }
|
|
20
20
|
closes_at: { type: string, format: date-time }
|
|
21
21
|
contact_email: { type: string, format: email }
|
|
22
|
-
note: { type: [string, 'null'] }
|
|
22
|
+
note: { type: [ string, 'null' ] }
|
|
23
23
|
shipping: { $ref: '#/$defs/address' }
|
|
24
24
|
tags: { type: array, items: { type: string }, maxItems: 3 }
|
|
25
25
|
lines:
|
|
@@ -29,7 +29,7 @@ deal:
|
|
|
29
29
|
properties:
|
|
30
30
|
product: { type: string }
|
|
31
31
|
quantity: { type: integer, minimum: 1 }
|
|
32
|
-
required: [product, quantity]
|
|
32
|
+
required: [ product, quantity ]
|
|
33
33
|
blocks:
|
|
34
34
|
type: array
|
|
35
35
|
items:
|
|
@@ -37,20 +37,19 @@ deal:
|
|
|
37
37
|
- properties:
|
|
38
38
|
kind: { const: paragraph }
|
|
39
39
|
text: { type: string }
|
|
40
|
-
required: [kind, text]
|
|
40
|
+
required: [ kind, text ]
|
|
41
41
|
- properties:
|
|
42
42
|
kind: { const: quiz }
|
|
43
43
|
question: { type: string }
|
|
44
|
-
required: [kind, question]
|
|
44
|
+
required: [ kind, question ]
|
|
45
45
|
attributes:
|
|
46
46
|
type: object
|
|
47
47
|
additionalProperties: { type: string }
|
|
48
|
-
|
|
48
|
+
description: { type: string, contentMediaType: text/markdown, title: Description }
|
|
49
|
+
required: [ title, company, stage ]
|
|
49
50
|
if:
|
|
50
51
|
properties:
|
|
51
52
|
stage: { const: won }
|
|
52
|
-
required: [stage]
|
|
53
|
+
required: [ stage ]
|
|
53
54
|
then:
|
|
54
|
-
required: [amount]
|
|
55
|
-
sections:
|
|
56
|
-
Description: { kind: text }
|
|
55
|
+
required: [ amount ]
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: deal
|
|
3
|
-
title: Renewal
|
|
4
|
-
company: ../companies/acme.md
|
|
5
|
-
shipping:
|
|
6
|
-
city: Paris
|
|
7
|
-
depot: ../places/depot.md
|
|
8
|
-
lines:
|
|
9
|
-
- product: ../products/seats.md
|
|
10
|
-
quantity: 10
|
|
11
|
-
- { product: ../products/support.md, quantity: 1 }
|
|
12
|
-
contract: ../products/seats.md
|
|
13
3
|
---
|
|
4
|
+
- **title**: Renewal
|
|
5
|
+
- **company**: [Acme](../companies/acme.md)
|
|
6
|
+
- **shipping**:
|
|
7
|
+
- **city**: Paris
|
|
8
|
+
- **depot**: [Depot](../places/depot.md)
|
|
9
|
+
- **contract**: [Seats](../products/seats.md)
|
|
14
10
|
|
|
15
11
|
The yearly renewal.
|
|
12
|
+
|
|
13
|
+
## lines
|
|
14
|
+
|
|
15
|
+
| product | quantity |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| [Seats](../products/seats.md) | 10 |
|
|
18
|
+
| [Support](../products/support.md) | 1 |
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: deal
|
|
3
|
-
title: Renewal
|
|
4
|
-
company: ../companies/acme.md
|
|
5
|
-
shipping:
|
|
6
|
-
city: Paris
|
|
7
|
-
depot: ../places/depot.md
|
|
8
|
-
lines:
|
|
9
|
-
- product: ../products/seats.md
|
|
10
|
-
quantity: 10
|
|
11
|
-
- { product: ../products/support.md, quantity: 1 }
|
|
12
|
-
contract: ../assets/contract.pdf
|
|
13
3
|
---
|
|
4
|
+
- **title**: Renewal
|
|
5
|
+
- **company**: [Acme](../companies/acme.md)
|
|
6
|
+
- **shipping**:
|
|
7
|
+
- **city**: Paris
|
|
8
|
+
- **depot**: [Depot](../places/depot.md)
|
|
9
|
+
- **contract**: [contract.pdf](../assets/contract.pdf)
|
|
14
10
|
|
|
15
11
|
The yearly renewal.
|
|
12
|
+
|
|
13
|
+
## lines
|
|
14
|
+
|
|
15
|
+
| product | quantity |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| [Seats](../products/seats.md) | 10 |
|
|
18
|
+
| [Support](../products/support.md) | 1 |
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: deal
|
|
3
|
-
title: Renewal
|
|
4
|
-
company: ../companies/acme.md
|
|
5
|
-
shipping:
|
|
6
|
-
city: Paris
|
|
7
|
-
depot: ../places/depot.md
|
|
8
|
-
lines:
|
|
9
|
-
- product: ../products/seats.md
|
|
10
|
-
quantity: 10
|
|
11
|
-
- { product: ../products/support.md, quantity: 1 }
|
|
12
|
-
contract: /rooms/other/assets/contract.pdf
|
|
13
3
|
---
|
|
4
|
+
- **title**: Renewal
|
|
5
|
+
- **company**: [Acme](../companies/acme.md)
|
|
6
|
+
- **shipping**:
|
|
7
|
+
- **city**: Paris
|
|
8
|
+
- **depot**: [Depot](../places/depot.md)
|
|
9
|
+
- **contract**: [contract.pdf](/rooms/other/assets/contract.pdf)
|
|
14
10
|
|
|
15
11
|
The yearly renewal.
|
|
12
|
+
|
|
13
|
+
## lines
|
|
14
|
+
|
|
15
|
+
| product | quantity |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| [Seats](../products/seats.md) | 10 |
|
|
18
|
+
| [Support](../products/support.md) | 1 |
|