@graview/core 0.1.28 → 0.1.30
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/README.md +17 -0
- package/dist/amount-input.d.ts +21 -0
- package/dist/amount-input.d.ts.map +1 -0
- package/dist/amount-input.js +96 -0
- package/dist/amount-input.js.map +1 -0
- package/dist/answer-seen.d.ts +38 -0
- package/dist/answer-seen.d.ts.map +1 -0
- package/dist/answer-seen.js +122 -0
- package/dist/answer-seen.js.map +1 -0
- package/dist/app-places.d.ts +56 -0
- package/dist/app-places.d.ts.map +1 -0
- package/dist/app-places.js +203 -0
- package/dist/app-places.js.map +1 -0
- package/dist/app.d.ts +16 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js.map +1 -1
- package/dist/arrange.d.ts +4 -2
- package/dist/arrange.d.ts.map +1 -1
- package/dist/arrange.js +4 -2
- package/dist/arrange.js.map +1 -1
- package/dist/arrangement-words.d.ts +3 -0
- package/dist/arrangement-words.d.ts.map +1 -0
- package/dist/arrangement-words.js +50 -0
- package/dist/arrangement-words.js.map +1 -0
- package/dist/arrangement.d.ts +43 -3
- package/dist/arrangement.d.ts.map +1 -1
- package/dist/arrangement.js +69 -31
- package/dist/arrangement.js.map +1 -1
- package/dist/arranging.d.ts.map +1 -1
- package/dist/arranging.js +36 -14
- package/dist/arranging.js.map +1 -1
- package/dist/bind.d.ts +3 -0
- package/dist/bind.d.ts.map +1 -1
- package/dist/bind.js.map +1 -1
- package/dist/blocks.d.ts +1 -1
- package/dist/blocks.d.ts.map +1 -1
- package/dist/capabilities.js +1 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/check.d.ts +3 -0
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +3 -0
- package/dist/check.js.map +1 -1
- package/dist/city.d.ts +58 -50
- package/dist/city.d.ts.map +1 -1
- package/dist/city.js +160 -147
- package/dist/city.js.map +1 -1
- package/dist/cli/check/brand.d.ts.map +1 -1
- package/dist/cli/check/brand.js +30 -2
- package/dist/cli/check/brand.js.map +1 -1
- package/dist/cli/check/clock-rules.d.ts +4 -0
- package/dist/cli/check/clock-rules.d.ts.map +1 -0
- package/dist/cli/check/clock-rules.js +26 -0
- package/dist/cli/check/clock-rules.js.map +1 -0
- package/dist/cli/check/field-sight.d.ts +11 -0
- package/dist/cli/check/field-sight.d.ts.map +1 -0
- package/dist/cli/check/field-sight.js +113 -0
- package/dist/cli/check/field-sight.js.map +1 -0
- package/dist/cli/check/index.d.ts +2 -0
- package/dist/cli/check/index.d.ts.map +1 -1
- package/dist/cli/check/index.js +2 -0
- package/dist/cli/check/index.js.map +1 -1
- package/dist/cli/check/lenses.d.ts +1 -1
- package/dist/cli/check/lenses.d.ts.map +1 -1
- package/dist/cli/check/lenses.js +48 -2
- package/dist/cli/check/lenses.js.map +1 -1
- package/dist/cli/check/relations.d.ts +23 -0
- package/dist/cli/check/relations.d.ts.map +1 -1
- package/dist/cli/check/relations.js +55 -4
- package/dist/cli/check/relations.js.map +1 -1
- package/dist/cli/check.d.ts.map +1 -1
- package/dist/cli/check.js +7 -4
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +32 -0
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/describe.d.ts.map +1 -1
- package/dist/cli/describe.js +71 -7
- package/dist/cli/describe.js.map +1 -1
- package/dist/cli/docs.d.ts.map +1 -1
- package/dist/cli/docs.js +4 -3
- package/dist/cli/docs.js.map +1 -1
- package/dist/cli/doctor.d.ts +18 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +58 -5
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/document-schema.d.ts +2 -0
- package/dist/cli/document-schema.d.ts.map +1 -1
- package/dist/cli/document-schema.js +154 -5
- package/dist/cli/document-schema.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js +16 -2
- package/dist/cli/types.js.map +1 -1
- package/dist/clock-readers.d.ts +18 -0
- package/dist/clock-readers.d.ts.map +1 -0
- package/dist/clock-readers.js +70 -0
- package/dist/clock-readers.js.map +1 -0
- package/dist/clock.d.ts +30 -0
- package/dist/clock.d.ts.map +1 -0
- package/dist/clock.js +41 -0
- package/dist/clock.js.map +1 -0
- package/dist/columns.d.ts.map +1 -1
- package/dist/columns.js +2 -1
- package/dist/columns.js.map +1 -1
- package/dist/conformance/fixtures.d.ts.map +1 -1
- package/dist/conformance/fixtures.js +491 -43
- package/dist/conformance/fixtures.js.map +1 -1
- package/dist/coverage-words.d.ts +18 -0
- package/dist/coverage-words.d.ts.map +1 -0
- package/dist/coverage-words.js +18 -0
- package/dist/coverage-words.js.map +1 -0
- package/dist/days.d.ts +53 -4
- package/dist/days.d.ts.map +1 -1
- package/dist/days.js +136 -16
- package/dist/days.js.map +1 -1
- package/dist/describe.d.ts +1 -0
- package/dist/describe.d.ts.map +1 -1
- package/dist/describe.js +1 -0
- package/dist/describe.js.map +1 -1
- package/dist/document/act-findings.d.ts.map +1 -1
- package/dist/document/act-findings.js +32 -4
- package/dist/document/act-findings.js.map +1 -1
- package/dist/document/amount.d.ts +4 -0
- package/dist/document/amount.d.ts.map +1 -0
- package/dist/document/amount.js +22 -0
- package/dist/document/amount.js.map +1 -0
- package/dist/document/block-context.d.ts.map +1 -1
- package/dist/document/block-context.js +1 -0
- package/dist/document/block-context.js.map +1 -1
- package/dist/document/blocks.d.ts +33 -10
- package/dist/document/blocks.d.ts.map +1 -1
- package/dist/document/blocks.js +139 -25
- package/dist/document/blocks.js.map +1 -1
- package/dist/document/brand-check.d.ts +5 -0
- package/dist/document/brand-check.d.ts.map +1 -1
- package/dist/document/brand-check.js +16 -2
- package/dist/document/brand-check.js.map +1 -1
- package/dist/document/compile-checked.d.ts.map +1 -1
- package/dist/document/compile-checked.js +12 -4
- package/dist/document/compile-checked.js.map +1 -1
- package/dist/document/compile.d.ts +0 -2
- package/dist/document/compile.d.ts.map +1 -1
- package/dist/document/compile.js +49 -24
- package/dist/document/compile.js.map +1 -1
- package/dist/document/compiled.d.ts +6 -2
- package/dist/document/compiled.d.ts.map +1 -1
- package/dist/document/compiled.js +94 -26
- package/dist/document/compiled.js.map +1 -1
- package/dist/document/computed-values.d.ts +3 -0
- package/dist/document/computed-values.d.ts.map +1 -1
- package/dist/document/computed-values.js +12 -2
- package/dist/document/computed-values.js.map +1 -1
- package/dist/document/describe-coverage.d.ts +3 -0
- package/dist/document/describe-coverage.d.ts.map +1 -1
- package/dist/document/describe-coverage.js +14 -6
- package/dist/document/describe-coverage.js.map +1 -1
- package/dist/document/describe-place.d.ts +6 -2
- package/dist/document/describe-place.d.ts.map +1 -1
- package/dist/document/describe-place.js +17 -9
- package/dist/document/describe-place.js.map +1 -1
- package/dist/document/diff.d.ts +2 -0
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +70 -11
- package/dist/document/diff.js.map +1 -1
- package/dist/document/durations.d.ts +8 -0
- package/dist/document/durations.d.ts.map +1 -0
- package/dist/document/durations.js +82 -0
- package/dist/document/durations.js.map +1 -0
- package/dist/document/edit.d.ts +1 -1
- package/dist/document/edit.d.ts.map +1 -1
- package/dist/document/edit.js +436 -27
- package/dist/document/edit.js.map +1 -1
- package/dist/document/expr/evaluate.d.ts +26 -1
- package/dist/document/expr/evaluate.d.ts.map +1 -1
- package/dist/document/expr/evaluate.js +55 -4
- package/dist/document/expr/evaluate.js.map +1 -1
- package/dist/document/field-spec.d.ts.map +1 -1
- package/dist/document/field-spec.js +15 -1
- package/dist/document/field-spec.js.map +1 -1
- package/dist/document/format-findings.d.ts +4 -0
- package/dist/document/format-findings.d.ts.map +1 -0
- package/dist/document/format-findings.js +39 -0
- package/dist/document/format-findings.js.map +1 -0
- package/dist/document/format-rules.d.ts +8 -0
- package/dist/document/format-rules.d.ts.map +1 -0
- package/dist/document/format-rules.js +19 -0
- package/dist/document/format-rules.js.map +1 -0
- package/dist/document/format-words.d.ts +9 -0
- package/dist/document/format-words.d.ts.map +1 -0
- package/dist/document/format-words.js +31 -0
- package/dist/document/format-words.js.map +1 -0
- package/dist/document/framework-path.d.ts +11 -0
- package/dist/document/framework-path.d.ts.map +1 -0
- package/dist/document/framework-path.js +122 -0
- package/dist/document/framework-path.js.map +1 -0
- package/dist/document/graview-template.d.ts +2 -2
- package/dist/document/index.d.ts +2 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +1 -1
- package/dist/document/index.js.map +1 -1
- package/dist/document/linked-findings.d.ts +5 -0
- package/dist/document/linked-findings.d.ts.map +1 -0
- package/dist/document/linked-findings.js +100 -0
- package/dist/document/linked-findings.js.map +1 -0
- package/dist/document/migrate.d.ts +1 -0
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +48 -1
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/money.d.ts +14 -0
- package/dist/document/money.d.ts.map +1 -0
- package/dist/document/money.js +14 -0
- package/dist/document/money.js.map +1 -0
- package/dist/document/policy-words.d.ts +4 -0
- package/dist/document/policy-words.d.ts.map +1 -1
- package/dist/document/policy-words.js +34 -4
- package/dist/document/policy-words.js.map +1 -1
- package/dist/document/right-names.d.ts +10 -0
- package/dist/document/right-names.d.ts.map +1 -0
- package/dist/document/right-names.js +57 -0
- package/dist/document/right-names.js.map +1 -0
- package/dist/document/rule-line.d.ts.map +1 -1
- package/dist/document/rule-line.js +16 -12
- package/dist/document/rule-line.js.map +1 -1
- package/dist/document/rules.d.ts.map +1 -1
- package/dist/document/rules.js +15 -6
- package/dist/document/rules.js.map +1 -1
- package/dist/document/schema.d.ts +142 -22
- package/dist/document/schema.d.ts.map +1 -1
- package/dist/document/schema.js +86 -10
- package/dist/document/schema.js.map +1 -1
- package/dist/document/template-parse.d.ts.map +1 -1
- package/dist/document/template-parse.js +45 -5
- package/dist/document/template-parse.js.map +1 -1
- package/dist/document/template.d.ts +16 -14
- package/dist/document/template.d.ts.map +1 -1
- package/dist/document/template.js +52 -30
- package/dist/document/template.js.map +1 -1
- package/dist/document/thumbnail.d.ts.map +1 -1
- package/dist/document/thumbnail.js +4 -3
- package/dist/document/thumbnail.js.map +1 -1
- package/dist/document/to-document.d.ts +0 -1
- package/dist/document/to-document.d.ts.map +1 -1
- package/dist/document/to-document.js +30 -2
- package/dist/document/to-document.js.map +1 -1
- package/dist/document/view-specs.d.ts.map +1 -1
- package/dist/document/view-specs.js +3 -0
- package/dist/document/view-specs.js.map +1 -1
- package/dist/document/views.d.ts +38 -4
- package/dist/document/views.d.ts.map +1 -1
- package/dist/document/views.js +81 -26
- package/dist/document/views.js.map +1 -1
- package/dist/document.schema.json +1184 -141
- package/dist/excerpt-of.d.ts +14 -0
- package/dist/excerpt-of.d.ts.map +1 -0
- package/dist/excerpt-of.js +120 -0
- package/dist/excerpt-of.js.map +1 -0
- package/dist/excerpt.d.ts +9 -0
- package/dist/excerpt.d.ts.map +1 -0
- package/dist/excerpt.js +43 -0
- package/dist/excerpt.js.map +1 -0
- package/dist/field-sight.d.ts +33 -0
- package/dist/field-sight.d.ts.map +1 -0
- package/dist/field-sight.js +313 -0
- package/dist/field-sight.js.map +1 -0
- package/dist/forms.d.ts +2 -0
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +3 -0
- package/dist/forms.js.map +1 -1
- package/dist/graph/archived.d.ts +34 -0
- package/dist/graph/archived.d.ts.map +1 -0
- package/dist/graph/archived.js +25 -0
- package/dist/graph/archived.js.map +1 -0
- package/dist/graph/diff.d.ts +16 -0
- package/dist/graph/diff.d.ts.map +1 -1
- package/dist/graph/diff.js +20 -1
- package/dist/graph/diff.js.map +1 -1
- package/dist/graph/graph.d.ts +37 -13
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/graph.js +84 -41
- package/dist/graph/graph.js.map +1 -1
- package/dist/graph/tracked.d.ts +8 -8
- package/dist/graph/tracked.d.ts.map +1 -1
- package/dist/graph/tracked.js +15 -20
- package/dist/graph/tracked.js.map +1 -1
- package/dist/graph/types.d.ts +16 -8
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/graph/types.js.map +1 -1
- package/dist/grid-sort.d.ts +20 -0
- package/dist/grid-sort.d.ts.map +1 -0
- package/dist/grid-sort.js +58 -0
- package/dist/grid-sort.js.map +1 -0
- package/dist/history.d.ts +88 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +146 -0
- package/dist/history.js.map +1 -0
- package/dist/import/coerce.d.ts +45 -0
- package/dist/import/coerce.d.ts.map +1 -0
- package/dist/import/coerce.js +252 -0
- package/dist/import/coerce.js.map +1 -0
- package/dist/import/csv.d.ts +16 -0
- package/dist/import/csv.d.ts.map +1 -0
- package/dist/import/csv.js +77 -0
- package/dist/import/csv.js.map +1 -0
- package/dist/import/index.d.ts +17 -0
- package/dist/import/index.d.ts.map +1 -0
- package/dist/import/index.js +13 -0
- package/dist/import/index.js.map +1 -0
- package/dist/import/mapping.d.ts +99 -0
- package/dist/import/mapping.d.ts.map +1 -0
- package/dist/import/mapping.js +182 -0
- package/dist/import/mapping.js.map +1 -0
- package/dist/import/rows.d.ts +116 -0
- package/dist/import/rows.d.ts.map +1 -0
- package/dist/import/rows.js +584 -0
- package/dist/import/rows.js.map +1 -0
- package/dist/index.d.ts +53 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -18
- package/dist/index.js.map +1 -1
- package/dist/invariants/engine.d.ts +5 -1
- package/dist/invariants/engine.d.ts.map +1 -1
- package/dist/invariants/engine.js +4 -3
- package/dist/invariants/engine.js.map +1 -1
- package/dist/invariants/types.d.ts +18 -3
- package/dist/invariants/types.d.ts.map +1 -1
- package/dist/json-schema.d.ts +1 -0
- package/dist/json-schema.d.ts.map +1 -1
- package/dist/json-schema.js +2 -0
- package/dist/json-schema.js.map +1 -1
- package/dist/kind-list.d.ts +78 -0
- package/dist/kind-list.d.ts.map +1 -0
- package/dist/kind-list.js +176 -0
- package/dist/kind-list.js.map +1 -0
- package/dist/labels.d.ts.map +1 -1
- package/dist/labels.js +2 -1
- package/dist/labels.js.map +1 -1
- package/dist/lines.d.ts +1 -0
- package/dist/lines.d.ts.map +1 -1
- package/dist/lines.js +5 -3
- package/dist/lines.js.map +1 -1
- package/dist/linked.d.ts +95 -0
- package/dist/linked.d.ts.map +1 -0
- package/dist/linked.js +181 -0
- package/dist/linked.js.map +1 -0
- package/dist/markdown.d.ts +102 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +460 -0
- package/dist/markdown.js.map +1 -0
- package/dist/mutations/arg-shape.d.ts +95 -0
- package/dist/mutations/arg-shape.d.ts.map +1 -0
- package/dist/mutations/arg-shape.js +101 -0
- package/dist/mutations/arg-shape.js.map +1 -0
- package/dist/mutations/define-mutation.d.ts +48 -2
- package/dist/mutations/define-mutation.d.ts.map +1 -1
- package/dist/mutations/define-mutation.js +103 -36
- package/dist/mutations/define-mutation.js.map +1 -1
- package/dist/mutations/derive-edits.d.ts +16 -1
- package/dist/mutations/derive-edits.d.ts.map +1 -1
- package/dist/mutations/derive-edits.js +146 -56
- package/dist/mutations/derive-edits.js.map +1 -1
- package/dist/mutations/derive-repeats.d.ts +8 -0
- package/dist/mutations/derive-repeats.d.ts.map +1 -0
- package/dist/mutations/derive-repeats.js +118 -0
- package/dist/mutations/derive-repeats.js.map +1 -0
- package/dist/mutations/derived-names.d.ts +22 -0
- package/dist/mutations/derived-names.d.ts.map +1 -0
- package/dist/mutations/derived-names.js +21 -0
- package/dist/mutations/derived-names.js.map +1 -0
- package/dist/mutations/edit-start.d.ts +28 -0
- package/dist/mutations/edit-start.d.ts.map +1 -0
- package/dist/mutations/edit-start.js +24 -0
- package/dist/mutations/edit-start.js.map +1 -0
- package/dist/mutations/form.d.ts +33 -1
- package/dist/mutations/form.d.ts.map +1 -1
- package/dist/mutations/form.js +23 -2
- package/dist/mutations/form.js.map +1 -1
- package/dist/mutations/invalid-arguments.d.ts +14 -0
- package/dist/mutations/invalid-arguments.d.ts.map +1 -0
- package/dist/mutations/invalid-arguments.js +18 -0
- package/dist/mutations/invalid-arguments.js.map +1 -0
- package/dist/mutations/keep-link.d.ts +27 -0
- package/dist/mutations/keep-link.d.ts.map +1 -0
- package/dist/mutations/keep-link.js +56 -0
- package/dist/mutations/keep-link.js.map +1 -0
- package/dist/mutations/kept-arguments.d.ts +26 -0
- package/dist/mutations/kept-arguments.d.ts.map +1 -0
- package/dist/mutations/kept-arguments.js +77 -0
- package/dist/mutations/kept-arguments.js.map +1 -0
- package/dist/mutations/node-ref.d.ts +0 -80
- package/dist/mutations/node-ref.d.ts.map +1 -1
- package/dist/mutations/node-ref.js +0 -93
- package/dist/mutations/node-ref.js.map +1 -1
- package/dist/mutations/types.d.ts +17 -1
- package/dist/mutations/types.d.ts.map +1 -1
- package/dist/mutations/words.d.ts +0 -13
- package/dist/mutations/words.d.ts.map +1 -1
- package/dist/mutations/words.js +1 -12
- package/dist/mutations/words.js.map +1 -1
- package/dist/navigate.d.ts +13 -0
- package/dist/navigate.d.ts.map +1 -0
- package/dist/navigate.js +13 -0
- package/dist/navigate.js.map +1 -0
- package/dist/ops/digest.d.ts +33 -0
- package/dist/ops/digest.d.ts.map +1 -0
- package/dist/ops/digest.js +47 -0
- package/dist/ops/digest.js.map +1 -0
- package/dist/ops/kept-fields.d.ts +7 -0
- package/dist/ops/kept-fields.d.ts.map +1 -0
- package/dist/ops/kept-fields.js +24 -0
- package/dist/ops/kept-fields.js.map +1 -0
- package/dist/ops/lineage.d.ts +43 -0
- package/dist/ops/lineage.d.ts.map +1 -0
- package/dist/ops/lineage.js +27 -0
- package/dist/ops/lineage.js.map +1 -0
- package/dist/ops/log.d.ts +6 -0
- package/dist/ops/log.d.ts.map +1 -1
- package/dist/ops/log.js +20 -12
- package/dist/ops/log.js.map +1 -1
- package/dist/ops/provenance.d.ts +68 -0
- package/dist/ops/provenance.d.ts.map +1 -0
- package/dist/ops/provenance.js +83 -0
- package/dist/ops/provenance.js.map +1 -0
- package/dist/ops/suggestions.d.ts +26 -0
- package/dist/ops/suggestions.d.ts.map +1 -0
- package/dist/ops/suggestions.js +21 -0
- package/dist/ops/suggestions.js.map +1 -0
- package/dist/ops/tidying.d.ts +48 -0
- package/dist/ops/tidying.d.ts.map +1 -0
- package/dist/ops/tidying.js +84 -0
- package/dist/ops/tidying.js.map +1 -0
- package/dist/ops/types.d.ts +42 -0
- package/dist/ops/types.d.ts.map +1 -1
- package/dist/ops/undo.d.ts.map +1 -1
- package/dist/ops/undo.js +10 -0
- package/dist/ops/undo.js.map +1 -1
- package/dist/ops/withheld.d.ts +25 -2
- package/dist/ops/withheld.d.ts.map +1 -1
- package/dist/ops/withheld.js +6 -15
- package/dist/ops/withheld.js.map +1 -1
- package/dist/past.d.ts +35 -0
- package/dist/past.d.ts.map +1 -0
- package/dist/past.js +173 -0
- package/dist/past.js.map +1 -0
- package/dist/permissions/policy.d.ts +13 -1
- package/dist/permissions/policy.d.ts.map +1 -1
- package/dist/permissions/policy.js +44 -9
- package/dist/permissions/policy.js.map +1 -1
- package/dist/permissions/sight.d.ts +40 -2
- package/dist/permissions/sight.d.ts.map +1 -1
- package/dist/permissions/sight.js +25 -2
- package/dist/permissions/sight.js.map +1 -1
- package/dist/permissions/types.d.ts +21 -0
- package/dist/permissions/types.d.ts.map +1 -1
- package/dist/permissions/types.js.map +1 -1
- package/dist/places.d.ts +6 -51
- package/dist/places.d.ts.map +1 -1
- package/dist/places.js +50 -144
- package/dist/places.js.map +1 -1
- package/dist/provenance.d.ts +14 -0
- package/dist/provenance.d.ts.map +1 -0
- package/dist/provenance.js +13 -0
- package/dist/provenance.js.map +1 -0
- package/dist/repeat-words.d.ts +13 -0
- package/dist/repeat-words.d.ts.map +1 -0
- package/dist/repeat-words.js +56 -0
- package/dist/repeat-words.js.map +1 -0
- package/dist/repeat.d.ts +59 -0
- package/dist/repeat.d.ts.map +1 -0
- package/dist/repeat.js +155 -0
- package/dist/repeat.js.map +1 -0
- package/dist/scaffold/agents.d.ts.map +1 -1
- package/dist/scaffold/agents.js +13 -0
- package/dist/scaffold/agents.js.map +1 -1
- package/dist/scaffold/project.d.ts.map +1 -1
- package/dist/scaffold/project.js +18 -0
- package/dist/scaffold/project.js.map +1 -1
- package/dist/scaffold/ui.d.ts.map +1 -1
- package/dist/scaffold/ui.js +17 -7
- package/dist/scaffold/ui.js.map +1 -1
- package/dist/scene-districts.d.ts +2 -1
- package/dist/scene-districts.d.ts.map +1 -1
- package/dist/scene-districts.js +2 -1
- package/dist/scene-districts.js.map +1 -1
- package/dist/scene.d.ts +4 -2
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +2 -1
- package/dist/scene.js.map +1 -1
- package/dist/schema/amount-mark.d.ts +13 -0
- package/dist/schema/amount-mark.d.ts.map +1 -0
- package/dist/schema/amount-mark.js +20 -0
- package/dist/schema/amount-mark.js.map +1 -0
- package/dist/schema/amount-words.d.ts +12 -0
- package/dist/schema/amount-words.d.ts.map +1 -0
- package/dist/schema/amount-words.js +31 -0
- package/dist/schema/amount-words.js.map +1 -0
- package/dist/schema/app-address.d.ts +5 -0
- package/dist/schema/app-address.d.ts.map +1 -0
- package/dist/schema/app-address.js +10 -0
- package/dist/schema/app-address.js.map +1 -0
- package/dist/schema/app-link-field.d.ts +4 -0
- package/dist/schema/app-link-field.d.ts.map +1 -0
- package/dist/schema/app-link-field.js +19 -0
- package/dist/schema/app-link-field.js.map +1 -0
- package/dist/schema/app-link.d.ts +38 -0
- package/dist/schema/app-link.d.ts.map +1 -0
- package/dist/schema/app-link.js +38 -0
- package/dist/schema/app-link.js.map +1 -0
- package/dist/schema/define-node.d.ts +39 -92
- package/dist/schema/define-node.d.ts.map +1 -1
- package/dist/schema/define-node.js +8 -246
- package/dist/schema/define-node.js.map +1 -1
- package/dist/schema/field-words.d.ts +45 -0
- package/dist/schema/field-words.d.ts.map +1 -0
- package/dist/schema/field-words.js +124 -0
- package/dist/schema/field-words.js.map +1 -0
- package/dist/schema/files.d.ts +8 -0
- package/dist/schema/files.d.ts.map +1 -1
- package/dist/schema/files.js.map +1 -1
- package/dist/schema/json-schema.d.ts +6 -1
- package/dist/schema/json-schema.d.ts.map +1 -1
- package/dist/schema/json-schema.js +101 -2
- package/dist/schema/json-schema.js.map +1 -1
- package/dist/schema/linked-field.d.ts +6 -0
- package/dist/schema/linked-field.d.ts.map +1 -0
- package/dist/schema/linked-field.js +34 -0
- package/dist/schema/linked-field.js.map +1 -0
- package/dist/schema/linked-reads.d.ts +20 -0
- package/dist/schema/linked-reads.d.ts.map +1 -0
- package/dist/schema/linked-reads.js +69 -0
- package/dist/schema/linked-reads.js.map +1 -0
- package/dist/schema/linked-schema.d.ts +5 -0
- package/dist/schema/linked-schema.d.ts.map +1 -0
- package/dist/schema/linked-schema.js +9 -0
- package/dist/schema/linked-schema.js.map +1 -0
- package/dist/schema/linked.d.ts +147 -0
- package/dist/schema/linked.d.ts.map +1 -0
- package/dist/schema/linked.js +151 -0
- package/dist/schema/linked.js.map +1 -0
- package/dist/schema/markdown-field.d.ts +4 -0
- package/dist/schema/markdown-field.d.ts.map +1 -0
- package/dist/schema/markdown-field.js +20 -0
- package/dist/schema/markdown-field.js.map +1 -0
- package/dist/schema/markdown.d.ts +6 -0
- package/dist/schema/markdown.d.ts.map +1 -0
- package/dist/schema/markdown.js +27 -0
- package/dist/schema/markdown.js.map +1 -0
- package/dist/schema/reading.d.ts +86 -0
- package/dist/schema/reading.d.ts.map +1 -0
- package/dist/schema/reading.js +325 -0
- package/dist/schema/reading.js.map +1 -0
- package/dist/schema/repeat-field.d.ts +5 -0
- package/dist/schema/repeat-field.d.ts.map +1 -0
- package/dist/schema/repeat-field.js +20 -0
- package/dist/schema/repeat-field.js.map +1 -0
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/schema/schema.js +12 -1
- package/dist/schema/schema.js.map +1 -1
- package/dist/schema/to-json-schema.d.ts +14 -0
- package/dist/schema/to-json-schema.d.ts.map +1 -0
- package/dist/schema/to-json-schema.js +616 -0
- package/dist/schema/to-json-schema.js.map +1 -0
- package/dist/schema/typed-field-builders.d.ts +8 -0
- package/dist/schema/typed-field-builders.d.ts.map +1 -0
- package/dist/schema/typed-field-builders.js +30 -0
- package/dist/schema/typed-field-builders.js.map +1 -0
- package/dist/schema/typed-field-of.d.ts +4 -0
- package/dist/schema/typed-field-of.d.ts.map +1 -0
- package/dist/schema/typed-field-of.js +14 -0
- package/dist/schema/typed-field-of.js.map +1 -0
- package/dist/schema/typed-fields.d.ts +11 -0
- package/dist/schema/typed-fields.d.ts.map +1 -0
- package/dist/schema/typed-fields.js +16 -0
- package/dist/schema/typed-fields.js.map +1 -0
- package/dist/schema/types.d.ts +31 -0
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/value-words.d.ts +21 -0
- package/dist/schema/value-words.d.ts.map +1 -0
- package/dist/schema/value-words.js +32 -0
- package/dist/schema/value-words.js.map +1 -0
- package/dist/search.d.ts +91 -4
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +317 -54
- package/dist/search.js.map +1 -1
- package/dist/seat-of.d.ts +9 -0
- package/dist/seat-of.d.ts.map +1 -0
- package/dist/seat-of.js +14 -0
- package/dist/seat-of.js.map +1 -0
- package/dist/seat.d.ts +19 -0
- package/dist/seat.d.ts.map +1 -0
- package/dist/seat.js +19 -0
- package/dist/seat.js.map +1 -0
- package/dist/seen.d.ts +15 -45
- package/dist/seen.d.ts.map +1 -1
- package/dist/seen.js +49 -135
- package/dist/seen.js.map +1 -1
- package/dist/store.d.ts +104 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +214 -30
- package/dist/store.js.map +1 -1
- package/dist/theme/derive.d.ts +16 -0
- package/dist/theme/derive.d.ts.map +1 -1
- package/dist/theme/derive.js +14 -0
- package/dist/theme/derive.js.map +1 -1
- package/dist/theme/marks.d.ts +19 -2
- package/dist/theme/marks.d.ts.map +1 -1
- package/dist/theme/marks.js +67 -2
- package/dist/theme/marks.js.map +1 -1
- package/dist/theme/types.d.ts +14 -3
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/types.js.map +1 -1
- package/dist/tidying.d.ts +62 -0
- package/dist/tidying.d.ts.map +1 -0
- package/dist/tidying.js +131 -0
- package/dist/tidying.js.map +1 -0
- package/dist/typed.d.ts +12 -3
- package/dist/typed.d.ts.map +1 -1
- package/dist/typed.js.map +1 -1
- package/dist/validate-graph.d.ts.map +1 -1
- package/dist/validate-graph.js +3 -10
- package/dist/validate-graph.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/via.d.ts.map +1 -1
- package/dist/via.js +2 -1
- package/dist/via.js.map +1 -1
- package/dist/views/address.d.ts +13 -0
- package/dist/views/address.d.ts.map +1 -0
- package/dist/views/address.js +29 -0
- package/dist/views/address.js.map +1 -0
- package/dist/views/types.d.ts +106 -8
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/types.js +24 -4
- package/dist/views/types.js.map +1 -1
- package/dist/village.d.ts +63 -0
- package/dist/village.d.ts.map +1 -0
- package/dist/village.js +143 -0
- package/dist/village.js.map +1 -0
- package/dist/watched.d.ts +12 -45
- package/dist/watched.d.ts.map +1 -1
- package/dist/watched.js +7 -119
- package/dist/watched.js.map +1 -1
- package/dist/words.d.ts +33 -0
- package/dist/words.d.ts.map +1 -0
- package/dist/words.js +36 -0
- package/dist/words.js.map +1 -0
- package/package.json +57 -2
package/dist/mutations/form.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
|
+
import { type LinkedRelation } from "../schema/linked.js";
|
|
3
|
+
import type { AmountMark } from "../schema/amount-mark.js";
|
|
2
4
|
/**
|
|
3
5
|
* A FORM, derived from a mutation's own input declaration.
|
|
4
6
|
*
|
|
@@ -13,7 +15,14 @@ import type { z } from "zod";
|
|
|
13
15
|
* Everything here is PLAIN DATA. A renderer (a page, the strip, an agent
|
|
14
16
|
* explaining itself) walks the tree; nothing downstream touches zod.
|
|
15
17
|
*/
|
|
16
|
-
export type FormField =
|
|
18
|
+
export type FormField =
|
|
19
|
+
/** How a date repeats (`repeat.ts`), asked for with the picker beside the date it repeats (`of`). */
|
|
20
|
+
{
|
|
21
|
+
readonly control: "repeat";
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly optional: boolean;
|
|
24
|
+
readonly of?: string;
|
|
25
|
+
} | ScalarField | {
|
|
17
26
|
readonly control: "node";
|
|
18
27
|
readonly name: string;
|
|
19
28
|
readonly optional: boolean;
|
|
@@ -46,6 +55,17 @@ export type FormField = ScalarField | {
|
|
|
46
55
|
readonly name: string;
|
|
47
56
|
readonly optional: boolean;
|
|
48
57
|
readonly image?: true;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A RECORD IN ANOTHER APP (FR-171): picked from what the host's
|
|
61
|
+
* `linkedRecords.find` lists for this viewer, and sent as `<kind>:<id>` —
|
|
62
|
+
* or a list of them, where the relation holds many.
|
|
63
|
+
*/
|
|
64
|
+
| {
|
|
65
|
+
readonly control: "linked";
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly optional: boolean;
|
|
68
|
+
readonly relation: LinkedRelation;
|
|
49
69
|
} | {
|
|
50
70
|
readonly control: "opaque";
|
|
51
71
|
readonly name: string;
|
|
@@ -59,11 +79,23 @@ export interface ScalarField {
|
|
|
59
79
|
readonly time?: true;
|
|
60
80
|
/** Prose (FR-147): asked for in a text area that keeps its line breaks. */
|
|
61
81
|
readonly long?: true;
|
|
82
|
+
/** Another app's address (FR-171): asked for as one — `@owner/app`, its id, or its https:// address. */
|
|
83
|
+
readonly app?: true;
|
|
84
|
+
/** Prose written in Markdown (FR-180): asked for in a text area, and said to be Markdown. */
|
|
85
|
+
readonly markdown?: true;
|
|
86
|
+
/**
|
|
87
|
+
* A phone number or a place, asked for in a text box as one; or a length
|
|
88
|
+
* of time, asked for in a text box that takes "1h 30m", "90" or "1:30"
|
|
89
|
+
* and sent as whole minutes (`formArgs`).
|
|
90
|
+
*/
|
|
91
|
+
readonly holds?: "phone" | "place" | "duration";
|
|
62
92
|
readonly options?: readonly string[];
|
|
63
93
|
readonly min?: number;
|
|
64
94
|
readonly max?: number;
|
|
65
95
|
/** What a number's values are whole multiples of (FR-114): an input's `step`. */
|
|
66
96
|
readonly step?: number;
|
|
97
|
+
/** What a number is said as — money in its currency, a percent, a measure — so it is asked for as one: "$1,250.50". */
|
|
98
|
+
readonly amount?: AmountMark;
|
|
67
99
|
}
|
|
68
100
|
/** Describes one argument as a form control tree. */
|
|
69
101
|
export declare function formField(name: string, schema: unknown): FormField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/mutations/form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/mutations/form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,SAAS;AACjB,qGAAqG;AACrG;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GACzG,WAAW,GACT;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAClH;I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CAelE;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAazH"}
|
package/dist/mutations/form.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { defOf } from "../schema/zod.js";
|
|
2
2
|
import { fileKindOf } from "../schema/files.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isAppLinkField } from "../schema/app-link.js";
|
|
4
|
+
import { linkedRelationOf } from "../schema/linked.js";
|
|
5
|
+
import { isRepeatField, repeatedBy } from "../repeat.js";
|
|
6
|
+
import { isMarkdownField } from "../schema/markdown.js";
|
|
7
|
+
import { parseDuration } from "../schema/field-words.js";
|
|
8
|
+
import { describeArg, unwrap } from "./arg-shape.js";
|
|
9
|
+
import { nodeRefKinds } from "./node-ref.js";
|
|
4
10
|
const isOptional = (schema) => schema.safeParse?.(undefined).success ?? false;
|
|
5
11
|
const shapeOf = (schema) => unwrap(schema).shape;
|
|
6
12
|
/** The single literal value of a zod literal, or undefined. */
|
|
@@ -19,6 +25,13 @@ export function formField(name, schema) {
|
|
|
19
25
|
const kinds = nodeRefKinds(schema);
|
|
20
26
|
if (kinds)
|
|
21
27
|
return { control: "node", name, optional, kinds };
|
|
28
|
+
const relation = linkedRelationOf(schema);
|
|
29
|
+
if (relation)
|
|
30
|
+
return { control: "linked", name, optional, relation };
|
|
31
|
+
if (isRepeatField(schema)) {
|
|
32
|
+
const of = repeatedBy(name);
|
|
33
|
+
return { control: "repeat", name, optional, ...(of ? { of } : {}) };
|
|
34
|
+
}
|
|
22
35
|
if (type === "boolean")
|
|
23
36
|
return { control: "boolean", name, optional };
|
|
24
37
|
const file = fileKindOf(field);
|
|
@@ -75,7 +88,10 @@ export function formField(name, schema) {
|
|
|
75
88
|
}
|
|
76
89
|
const scalar = describeArg(schema);
|
|
77
90
|
if (scalar.type === "text")
|
|
78
|
-
return { control: "text", name, optional, ...(scalar.long ? { long: true } : {}) };
|
|
91
|
+
return { control: "text", name, optional, ...(scalar.long ? { long: true } : {}), ...(isAppLinkField(field) ? { app: true } : {}), ...(isMarkdownField(field) ? { markdown: true } : {}), ...(scalar.holds ? { holds: scalar.holds } : {}) };
|
|
92
|
+
// A length of time is typed as words ("1h 30m") and sent as minutes.
|
|
93
|
+
if (scalar.type === "number" && scalar.duration)
|
|
94
|
+
return { control: "text", name, optional, holds: "duration" };
|
|
79
95
|
if (scalar.type === "date")
|
|
80
96
|
return { control: "date", name, optional, ...(scalar.time ? { time: true } : {}) };
|
|
81
97
|
if (scalar.type === "number") {
|
|
@@ -86,6 +102,7 @@ export function formField(name, schema) {
|
|
|
86
102
|
...(scalar.min === undefined ? {} : { min: scalar.min }),
|
|
87
103
|
...(scalar.max === undefined ? {} : { max: scalar.max }),
|
|
88
104
|
...(scalar.step === undefined ? {} : { step: scalar.step }),
|
|
105
|
+
...(scalar.amount ? { amount: scalar.amount } : {}),
|
|
89
106
|
};
|
|
90
107
|
}
|
|
91
108
|
if (scalar.type === "choice")
|
|
@@ -132,6 +149,10 @@ export function formArgs(fields, values) {
|
|
|
132
149
|
const held = values[field.name];
|
|
133
150
|
if (held === undefined && !field.optional && (field.control === "list" || field.control === "boolean"))
|
|
134
151
|
sent[field.name] = field.control === "list" ? [] : false;
|
|
152
|
+
// A length of time as it was typed, sent as the whole minutes the field keeps; words that are not one are sent as typed, and refused in the field's own words.
|
|
153
|
+
// A phone and a place are kept as they were entered, trimmed.
|
|
154
|
+
if (field.control === "text" && field.holds && typeof held === "string")
|
|
155
|
+
sent[field.name] = held.trim() === "" ? undefined : field.holds === "duration" ? (parseDuration(held) ?? held) : held.trim();
|
|
135
156
|
if (field.control === "group" && held !== undefined && typeof held === "object" && held !== null) {
|
|
136
157
|
sent[field.name] = formArgs(field.fields, held);
|
|
137
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/mutations/form.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/mutations/form.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAuB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA8E7C,MAAM,UAAU,GAAG,CAAC,MAAe,EAAW,EAAE,CAC7C,MAAkB,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC;AAE9D,MAAM,OAAO,GAAG,CAAC,MAAe,EAAuC,EAAE,CACtE,MAAM,CAAC,MAAM,CAAa,CAAC,KAAK,CAAC;AAEpC,+DAA+D;AAC/D,MAAM,YAAY,GAAG,CAAC,MAAe,EAAsB,EAAE;IAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAY,CAAC;IACxC,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACvD,MAAM,MAAM,GAAG,K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K,QAAQ;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACtM,IAAI,KAAK,CAAC,OAAO,KAAK,OAAO,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YACjG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,IAA+B,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GraphError } from "../graph/graph.js";
|
|
2
|
+
/** Arguments a mutation refused, each with where it was and what was wrong. */
|
|
3
|
+
export declare class InvalidArguments extends GraphError {
|
|
4
|
+
readonly mutation: string;
|
|
5
|
+
readonly issues: readonly {
|
|
6
|
+
readonly path: readonly PropertyKey[];
|
|
7
|
+
readonly message: string;
|
|
8
|
+
}[];
|
|
9
|
+
constructor(mutation: string, issues: readonly {
|
|
10
|
+
readonly path: readonly PropertyKey[];
|
|
11
|
+
readonly message: string;
|
|
12
|
+
}[]);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=invalid-arguments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-arguments.d.ts","sourceRoot":"","sources":["../../src/mutations/invalid-arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQ/C,+EAA+E;AAC/E,qBAAa,gBAAiB,SAAQ,UAAU;IAE5C,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;gBADtF,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;CAQlG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GraphError } from "../graph/graph.js";
|
|
2
|
+
/*
|
|
3
|
+
* A file of its own (FR-179): every act refuses its arguments with this, up
|
|
4
|
+
* front, and saying the refusal in a person's words (`./words.ts`) is
|
|
5
|
+
* fetched with the form or the seat that says it.
|
|
6
|
+
*/
|
|
7
|
+
/** Arguments a mutation refused, each with where it was and what was wrong. */
|
|
8
|
+
export class InvalidArguments extends GraphError {
|
|
9
|
+
mutation;
|
|
10
|
+
issues;
|
|
11
|
+
constructor(mutation, issues) {
|
|
12
|
+
super(`Invalid arguments for mutation "${mutation}"`, issues.map((issue) => `${issue.path.map(String).join(".") || "(root)"}: ${issue.message}`).join("; "));
|
|
13
|
+
this.mutation = mutation;
|
|
14
|
+
this.issues = issues;
|
|
15
|
+
this.name = "InvalidArguments";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=invalid-arguments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-arguments.js","sourceRoot":"","sources":["../../src/mutations/invalid-arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;GAIG;AAEH,+EAA+E;AAC/E,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAEnC;IACA;IAFX,YACW,QAAgB,EAChB,MAAsF;QAE/F,KAAK,CACH,mCAAmC,QAAQ,GAAG,EAC9C,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACtG,CAAC;QANO,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAgF;QAM/F,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AnySchema } from "../schema/schema.js";
|
|
2
|
+
import type { AnyMutationDefinition } from "./types.js";
|
|
3
|
+
/** The name of the act that accepts a provisional link (FR-172). */
|
|
4
|
+
export declare const KEEP_LINK = "keep-link";
|
|
5
|
+
/**
|
|
6
|
+
* "KEEP THIS LINK" (FR-172): a person accepting a link something less sure
|
|
7
|
+
* made. It takes the link away and puts it back in one op — the graph is as
|
|
8
|
+
* it was — so the log holds a person's op naming it, which is what makes a
|
|
9
|
+
* provisional link ordinary (`linkProvenances`); undone, the link is
|
|
10
|
+
* provisional again. Its arguments are the link: `{ kind, from, to }`.
|
|
11
|
+
*
|
|
12
|
+
* Every store answers to it and no list offers it: it is not one of the
|
|
13
|
+
* app's acts, and a face offers it beside the link it would keep (a line's
|
|
14
|
+
* acts, a record page's mark). It goes over the wire like any call, and is
|
|
15
|
+
* permitted to whoever may make or break links of its relation
|
|
16
|
+
* (`keepLinkVia`).
|
|
17
|
+
*/
|
|
18
|
+
export declare function keepLinkMutation<S extends AnySchema>(schema: S): AnyMutationDefinition<S>;
|
|
19
|
+
/**
|
|
20
|
+
* Who may keep a link of a relation: whoever may run a declared act that
|
|
21
|
+
* makes or breaks links of THAT relation — the policy's own grants, read
|
|
22
|
+
* again. A seat that may link a lease to its property may keep such a link,
|
|
23
|
+
* and is not thereby the judge of a link between two people; a link of a
|
|
24
|
+
* relation no act makes or breaks is kept by nobody a policy names.
|
|
25
|
+
*/
|
|
26
|
+
export declare const keepLinkVia: <S extends AnySchema>(mutations: Iterable<AnyMutationDefinition<S>>, relation: unknown) => readonly string[];
|
|
27
|
+
//# sourceMappingURL=keep-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keep-link.d.ts","sourceRoot":"","sources":["../../src/mutations/keep-link.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,oEAAoE;AACpE,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CA2BzF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,EAAE,WAAW,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,OAAO,KAAG,SAAS,MAAM,EACoE,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as z from "../schema/zod.js";
|
|
2
|
+
import { MissingRecordError } from "../graph/graph.js";
|
|
3
|
+
import { edgeId } from "../graph/types.js";
|
|
4
|
+
import { labelOf } from "../schema/define-node.js";
|
|
5
|
+
/** The name of the act that accepts a provisional link (FR-172). */
|
|
6
|
+
export const KEEP_LINK = "keep-link";
|
|
7
|
+
/**
|
|
8
|
+
* "KEEP THIS LINK" (FR-172): a person accepting a link something less sure
|
|
9
|
+
* made. It takes the link away and puts it back in one op — the graph is as
|
|
10
|
+
* it was — so the log holds a person's op naming it, which is what makes a
|
|
11
|
+
* provisional link ordinary (`linkProvenances`); undone, the link is
|
|
12
|
+
* provisional again. Its arguments are the link: `{ kind, from, to }`.
|
|
13
|
+
*
|
|
14
|
+
* Every store answers to it and no list offers it: it is not one of the
|
|
15
|
+
* app's acts, and a face offers it beside the link it would keep (a line's
|
|
16
|
+
* acts, a record page's mark). It goes over the wire like any call, and is
|
|
17
|
+
* permitted to whoever may make or break links of its relation
|
|
18
|
+
* (`keepLinkVia`).
|
|
19
|
+
*/
|
|
20
|
+
export function keepLinkMutation(schema) {
|
|
21
|
+
const name = (graph, id) => {
|
|
22
|
+
const node = graph.getNode(id);
|
|
23
|
+
return node ? labelOf(schema.tryDefinition(node.kind), node) : id;
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
name: KEEP_LINK,
|
|
27
|
+
title: "Keep this link",
|
|
28
|
+
input: z.object({ kind: z.string(), from: z.string(), to: z.string() }),
|
|
29
|
+
describe: (args, graph) => `Keep the link from ${name(graph, args.from)} to ${name(graph, args.to)}`,
|
|
30
|
+
// A link that is not there is refused by the graph itself, as missing.
|
|
31
|
+
apply(ctx, args) {
|
|
32
|
+
const { kind, from, to } = args;
|
|
33
|
+
/*
|
|
34
|
+
* AND ONE TO A RECORD THE SEAT MAY NOT SEE IS NOT THERE FOR IT (FR-55):
|
|
35
|
+
* its ends are plain ids, which a seat can guess, so it is refused in
|
|
36
|
+
* the graph's own words, alike whether the hidden record holds the
|
|
37
|
+
* link or nothing does. `ctx.graph` is what the seat is served.
|
|
38
|
+
*/
|
|
39
|
+
if (!ctx.graph.getNode(from) || !ctx.graph.getNode(to)) {
|
|
40
|
+
const id = edgeId({ kind, from, to });
|
|
41
|
+
throw new MissingRecordError(id, `Cannot remove missing edge ${id}`);
|
|
42
|
+
}
|
|
43
|
+
ctx.removeEdge({ kind, from, to });
|
|
44
|
+
ctx.addEdge({ kind, from, to });
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Who may keep a link of a relation: whoever may run a declared act that
|
|
50
|
+
* makes or breaks links of THAT relation — the policy's own grants, read
|
|
51
|
+
* again. A seat that may link a lease to its property may keep such a link,
|
|
52
|
+
* and is not thereby the judge of a link between two people; a link of a
|
|
53
|
+
* relation no act makes or breaks is kept by nobody a policy names.
|
|
54
|
+
*/
|
|
55
|
+
export const keepLinkVia = (mutations, relation) => [...mutations].filter((one) => !one.derived && one.name !== KEEP_LINK && typeof relation === "string" && (one.connects?.includes(relation) || one.severs?.includes(relation))).map((one) => one.name);
|
|
56
|
+
//# sourceMappingURL=keep-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keep-link.js","sourceRoot":"","sources":["../../src/mutations/keep-link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAInD,oEAAoE;AACpE,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AAErC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAsB,MAAS;IAC7D,MAAM,IAAI,GAAG,CAAC,KAAuC,EAAE,EAAU,EAAE,EAAE;QACnE,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAyE,CAAC;QACvG,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpE,CAAC,CAAC;IACF,OAAO;QACL,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,gBAAgB;QACvB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,E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IAAI,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Policy, Principal } from "../permissions/types.js";
|
|
2
|
+
import type { AnySchema } from "../schema/schema.js";
|
|
3
|
+
import type { Judged } from "../seen.js";
|
|
4
|
+
import type { AnyMutationDefinition } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* THE ARGUMENTS OF AN ACT A SEAT IS NOT ASKED FOR (Roadmap f-field-sight):
|
|
7
|
+
* the ones that write a field its sight keeps from it — on the record it
|
|
8
|
+
* acts on, or on one it makes (judged as its own, as the store judges it).
|
|
9
|
+
* The store refuses such a write as an argument the act does not take, so
|
|
10
|
+
* a form that offered it would offer a refusal.
|
|
11
|
+
*/
|
|
12
|
+
export declare function keptArguments<S extends AnySchema>(store: Judged & {
|
|
13
|
+
readonly schema: S;
|
|
14
|
+
}, principal: Principal, mutation: AnyMutationDefinition<S>, subject?: string): ReadonlySet<string>;
|
|
15
|
+
/**
|
|
16
|
+
* THE ARGUMENTS OF AN ACT NO RECORD WOULD LET A SEAT WRITE, read off the
|
|
17
|
+
* declaration alone (Roadmap f-field-sight): each writes a field that no
|
|
18
|
+
* sight granting the seat that kind shows — on the kind the act makes, or
|
|
19
|
+
* every kind its subject takes. An agent's tool for the act lists none of
|
|
20
|
+
* them, so its schema never names a field the seat may not see; a field
|
|
21
|
+
* the seat sees on some records (its own child's phone) stays, and the
|
|
22
|
+
* store refuses the write on the rest, as `keptArguments` says per record.
|
|
23
|
+
* Judged as the policy says it whether or not field sight is loaded.
|
|
24
|
+
*/
|
|
25
|
+
export declare function argumentsNeverShown<S extends AnySchema>(schema: S, policy: Policy | undefined, principal: Principal, mutation: AnyMutationDefinition<S>): ReadonlySet<string>;
|
|
26
|
+
//# sourceMappingURL=kept-arguments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kept-arguments.d.ts","sourceRoot":"","sources":["../../src/mutations/kept-arguments.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAC/C,KAAK,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;CAAE,EACtC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAClC,OAAO,CAAC,EAAE,MAAM,GACf,WAAW,CAAC,MAAM,CAAC,CAcrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,SAAS,EACrD,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,GACjC,WAAW,CAAC,MAAM,CAAC,CAwBrB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { MARKS } from "../graph/archived.js";
|
|
2
|
+
import { actingAs, grantsTo, isSystem } from "../permissions/policy.js";
|
|
3
|
+
import { FIELD_SIGHT, partialSight } from "../permissions/sight.js";
|
|
4
|
+
import { fieldsWrittenBy, subjectKindsOf } from "./derive-edits.js";
|
|
5
|
+
/**
|
|
6
|
+
* THE ARGUMENTS OF AN ACT A SEAT IS NOT ASKED FOR (Roadmap f-field-sight):
|
|
7
|
+
* the ones that write a field its sight keeps from it — on the record it
|
|
8
|
+
* acts on, or on one it makes (judged as its own, as the store judges it).
|
|
9
|
+
* The store refuses such a write as an argument the act does not take, so
|
|
10
|
+
* a form that offered it would offer a refusal.
|
|
11
|
+
*/
|
|
12
|
+
export function keptArguments(store, principal, mutation, subject) {
|
|
13
|
+
const kept = FIELD_SIGHT.keptFrom?.(store, principal);
|
|
14
|
+
const out = new Set();
|
|
15
|
+
if (!kept)
|
|
16
|
+
return out;
|
|
17
|
+
const shape = Object.keys(mutation.input.shape ?? {});
|
|
18
|
+
for (const kind of mutation.creates ?? []) {
|
|
19
|
+
const fields = kept({ id: "\u0000new", kind });
|
|
20
|
+
for (const name of shape)
|
|
21
|
+
if (fields?.(name))
|
|
22
|
+
out.add(name);
|
|
23
|
+
}
|
|
24
|
+
const node = subject === undefined ? undefined : store.graph.getNode(subject);
|
|
25
|
+
const definition = node && store.schema.tryDefinition(node.kind);
|
|
26
|
+
const fields = node && kept(node);
|
|
27
|
+
if (definition && fields)
|
|
28
|
+
for (const name of fieldsWrittenBy(mutation, definition))
|
|
29
|
+
if (fields(name) && shape.includes(name))
|
|
30
|
+
out.add(name);
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* THE ARGUMENTS OF AN ACT NO RECORD WOULD LET A SEAT WRITE, read off the
|
|
35
|
+
* declaration alone (Roadmap f-field-sight): each writes a field that no
|
|
36
|
+
* sight granting the seat that kind shows — on the kind the act makes, or
|
|
37
|
+
* every kind its subject takes. An agent's tool for the act lists none of
|
|
38
|
+
* them, so its schema never names a field the seat may not see; a field
|
|
39
|
+
* the seat sees on some records (its own child's phone) stays, and the
|
|
40
|
+
* store refuses the write on the rest, as `keptArguments` says per record.
|
|
41
|
+
* Judged as the policy says it whether or not field sight is loaded.
|
|
42
|
+
*/
|
|
43
|
+
export function argumentsNeverShown(schema, policy, principal, mutation) {
|
|
44
|
+
const out = new Set();
|
|
45
|
+
const sights = policy?.sees ?? [];
|
|
46
|
+
if (isSystem(principal) || !sights.some(partialSight))
|
|
47
|
+
return out;
|
|
48
|
+
const acting = actingAs(principal);
|
|
49
|
+
/** Whether a seat is shown a kind's field on some record: a sight granting it the kind shows it. */
|
|
50
|
+
const shown = (kind, field) => {
|
|
51
|
+
const granted = sights.filter((sight) => sight.kinds.includes(kind) && grantsTo(sight, acting));
|
|
52
|
+
if (!granted.some(partialSight))
|
|
53
|
+
return true;
|
|
54
|
+
return MARKS.has(field) || granted.some((sight) => !partialSight(sight) || ((sight.fields === undefined || sight.fields.includes(field)) && !sight.hide?.includes(field)));
|
|
55
|
+
};
|
|
56
|
+
const shape = Object.keys(mutation.input.shape ?? {});
|
|
57
|
+
const written = new Map();
|
|
58
|
+
const write = (field, seen) => written.set(field, written.get(field) === true || seen);
|
|
59
|
+
for (const kind of mutation.creates ?? []) {
|
|
60
|
+
const declared = Object.keys((schema.tryDefinition(kind)?.fields.shape ?? {}));
|
|
61
|
+
for (const name of shape)
|
|
62
|
+
if (declared.includes(name))
|
|
63
|
+
write(name, shown(kind, name));
|
|
64
|
+
}
|
|
65
|
+
for (const kind of subjectKindsOf(schema, mutation)) {
|
|
66
|
+
const definition = schema.tryDefinition(kind);
|
|
67
|
+
if (definition)
|
|
68
|
+
for (const name of fieldsWrittenBy(mutation, definition))
|
|
69
|
+
if (shape.includes(name))
|
|
70
|
+
write(name, shown(kind, name));
|
|
71
|
+
}
|
|
72
|
+
for (const [name, seen] of written)
|
|
73
|
+
if (!seen)
|
|
74
|
+
out.add(name);
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=kept-arguments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kept-arguments.js","sourceRoot":"","sources":["../../src/mutations/kept-arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIxE,OAAO,EAAE,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C"}
|
|
@@ -28,84 +28,4 @@ export declare function nodeRefArgs(input: unknown): {
|
|
|
28
28
|
kinds: readonly string[];
|
|
29
29
|
optional: boolean;
|
|
30
30
|
}[];
|
|
31
|
-
/**
|
|
32
|
-
* What sort of answer an argument wants, read off its own declaration.
|
|
33
|
-
*
|
|
34
|
-
* The affordance layer could already say "this needs a `label`" and offer
|
|
35
|
-
* candidate ids for a node reference — but for a plain string or a date it
|
|
36
|
-
* offered a list of nothing, so half the actions in an interface were dead
|
|
37
|
-
* ends that looked live. The mutation's schema knows perfectly well that
|
|
38
|
-
* `label` is a non-empty string and `date` is `YYYY-MM-DD`; nothing had
|
|
39
|
-
* asked it.
|
|
40
|
-
*/
|
|
41
|
-
export type ArgShape =
|
|
42
|
-
/** Words; `long` where the field allows more than 500 characters — prose, asked for in a text area (FR-147). */
|
|
43
|
-
{
|
|
44
|
-
readonly type: "text";
|
|
45
|
-
readonly long?: true;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A DATE, AND WITH `time` A TIME OF DAY IN IT. A workshop's start is
|
|
49
|
-
* `YYYY-MM-DDTHH:MM`; read as a plain date it got a date picker, whose
|
|
50
|
-
* `YYYY-MM-DD` the act's own pattern refused — on every face, so the
|
|
51
|
-
* workshop could not be made and the talk could not be given its slot.
|
|
52
|
-
*/
|
|
53
|
-
| {
|
|
54
|
-
readonly type: "date";
|
|
55
|
-
readonly time?: true;
|
|
56
|
-
}
|
|
57
|
-
/** A number, and its range where it says one: `step` is what its values are whole multiples of (FR-114), 1 for a whole number. */
|
|
58
|
-
| {
|
|
59
|
-
readonly type: "number";
|
|
60
|
-
readonly min?: number;
|
|
61
|
-
readonly max?: number;
|
|
62
|
-
readonly step?: number;
|
|
63
|
-
} | {
|
|
64
|
-
readonly type: "choice";
|
|
65
|
-
readonly options: readonly string[];
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* YES OR NO — an argument that takes a boolean.
|
|
69
|
-
*
|
|
70
|
-
* Undescribable until now, for the same reason a list was: an interface
|
|
71
|
-
* can only offer what it can ask for, so "Add a field" — whose `required`
|
|
72
|
-
* is a plain boolean — was derived NOWHERE. The studio's central act, in
|
|
73
|
-
* the studio, unreachable, because nothing could ask one question.
|
|
74
|
-
*/
|
|
75
|
-
| {
|
|
76
|
-
readonly type: "boolean";
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* SEVERAL OF A THING — an argument that takes a list.
|
|
80
|
-
*
|
|
81
|
-
* "Invite somebody as coordinator and gardener" is one act with two roles
|
|
82
|
-
* in one argument, and without this shape it described itself as `unknown`:
|
|
83
|
-
* an interface can only offer what it can ask for, so the act was offered
|
|
84
|
-
* NOWHERE. Not hidden behind a refusal — simply never derived, in every
|
|
85
|
-
* installation the framework ships.
|
|
86
|
-
*/
|
|
87
|
-
| {
|
|
88
|
-
readonly type: "several";
|
|
89
|
-
readonly of: ArgShape;
|
|
90
|
-
}
|
|
91
|
-
/** A picture or a document the host stores (FR-162), put on the record by its upload (FR-163); `image` where only a picture will do. */
|
|
92
|
-
| {
|
|
93
|
-
readonly type: "file";
|
|
94
|
-
readonly image?: true;
|
|
95
|
-
} | {
|
|
96
|
-
readonly type: "unknown";
|
|
97
|
-
};
|
|
98
|
-
/** Unwraps optional/default/nullable so a wrapped field still describes itself. */
|
|
99
|
-
export declare function unwrap(schema: unknown): unknown;
|
|
100
|
-
/**
|
|
101
|
-
* Zod 4 keeps the primitive type on `_def.type` and the refinements a UI
|
|
102
|
-
* actually needs — bounds, patterns — as the checks on its definition. Read
|
|
103
|
-
* from the checks themselves, not from `_zod.bag`, which zod 4.6 stopped
|
|
104
|
-
* filling as it builds a schema: the bounds and the date pattern read there
|
|
105
|
-
* vanished with a minor version. Reading them here, in one place, keeps
|
|
106
|
-
* every other layer free of zod internals.
|
|
107
|
-
*/
|
|
108
|
-
export declare function describeArg(schema: unknown): ArgShape;
|
|
109
|
-
/** The declared shape of one named argument of a mutation input object. */
|
|
110
|
-
export declare function argShape(input: unknown, name: string): ArgShape;
|
|
111
31
|
//# sourceMappingURL=node-ref.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-ref.d.ts","sourceRoot":"","sources":["../../src/mutations/node-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"node-ref.d.ts","sourceRoot":"","sources":["../../src/mutations/node-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAC;AAqBtC;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAC5C,KAAK,GAAE,SAAS,CAAC,EAAE,GAAG,GAAS,GAC9B,OAAO,CAAC,SAAS,CAEnB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,GAAE,SAAS,MAAM,EAAE,GAAG,GAAS,GAAG,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAEnF;AAmBD,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAW3E;AAED,kHAAkH;AAClH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,GACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,EAAE,CAUjE"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z as classic } from "zod";
|
|
2
2
|
import * as z from "../schema/zod.js";
|
|
3
3
|
import { defOf } from "../schema/zod.js";
|
|
4
|
-
import { fileKindOf } from "../schema/files.js";
|
|
5
4
|
/**
|
|
6
5
|
* WHERE A NODE REFERENCE KEEPS ITS KINDS: on the schema itself, under a
|
|
7
6
|
* registry symbol.
|
|
@@ -80,96 +79,4 @@ export function nodeRefArgs(input) {
|
|
|
80
79
|
}
|
|
81
80
|
return args;
|
|
82
81
|
}
|
|
83
|
-
/** Unwraps optional/default/nullable so a wrapped field still describes itself. */
|
|
84
|
-
export function unwrap(schema) {
|
|
85
|
-
const inner = defOf(schema)?.innerType;
|
|
86
|
-
return inner === undefined ? schema : unwrap(inner);
|
|
87
|
-
}
|
|
88
|
-
/** What a number's declared format bounds it to, as zod's own `int()`, `int32()` … say. */
|
|
89
|
-
const NUMBER_FORMAT_RANGES = {
|
|
90
|
-
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
91
|
-
int32: [-2147483648, 2147483647],
|
|
92
|
-
uint32: [0, 4294967295],
|
|
93
|
-
float32: [-3.4028234663852886e38, 3.4028234663852886e38],
|
|
94
|
-
float64: [-Number.MAX_VALUE, Number.MAX_VALUE],
|
|
95
|
-
};
|
|
96
|
-
const checksOf = (field) => ((field?._zod?.def?.checks ?? []).map((check) => check._zod?.def).filter((def) => def !== undefined));
|
|
97
|
-
/**
|
|
98
|
-
* Zod 4 keeps the primitive type on `_def.type` and the refinements a UI
|
|
99
|
-
* actually needs — bounds, patterns — as the checks on its definition. Read
|
|
100
|
-
* from the checks themselves, not from `_zod.bag`, which zod 4.6 stopped
|
|
101
|
-
* filling as it builds a schema: the bounds and the date pattern read there
|
|
102
|
-
* vanished with a minor version. Reading them here, in one place, keeps
|
|
103
|
-
* every other layer free of zod internals.
|
|
104
|
-
*/
|
|
105
|
-
export function describeArg(schema) {
|
|
106
|
-
const field = unwrap(schema);
|
|
107
|
-
const def = defOf(field);
|
|
108
|
-
const type = def?.type;
|
|
109
|
-
const checks = checksOf(field);
|
|
110
|
-
if (type === "enum")
|
|
111
|
-
return { type: "choice", options: Object.keys(def?.entries ?? {}) };
|
|
112
|
-
const file = fileKindOf(field);
|
|
113
|
-
if (file)
|
|
114
|
-
return file === "image" ? { type: "file", image: true } : { type: "file" };
|
|
115
|
-
if (type === "boolean")
|
|
116
|
-
return { type: "boolean" };
|
|
117
|
-
/*
|
|
118
|
-
* A list describes itself through what it holds. An array of something
|
|
119
|
-
* nothing can describe is still unknown — saying "several unknowns" would
|
|
120
|
-
* make an unaskable argument look askable, which is the failure this whole
|
|
121
|
-
* shape exists to prevent.
|
|
122
|
-
*/
|
|
123
|
-
if (type === "array") {
|
|
124
|
-
const of = describeArg(def?.element);
|
|
125
|
-
return of.type === "unknown" ? { type: "unknown" } : { type: "several", of };
|
|
126
|
-
}
|
|
127
|
-
if (type === "number") {
|
|
128
|
-
let min;
|
|
129
|
-
let max;
|
|
130
|
-
let step;
|
|
131
|
-
for (const check of checks) {
|
|
132
|
-
if (check.check === "multiple_of" && typeof check.value === "number")
|
|
133
|
-
step = check.value;
|
|
134
|
-
else if (check.check === "number_format" && (check.format === "safeint" || check.format === "int32" || check.format === "uint32"))
|
|
135
|
-
step ??= 1;
|
|
136
|
-
const range = check.check === "number_format" && check.format ? NUMBER_FORMAT_RANGES[check.format] : undefined;
|
|
137
|
-
const low = range ? range[0] : check.check === "greater_than" && check.inclusive && typeof check.value === "number" ? check.value : undefined;
|
|
138
|
-
const high = range ? range[1] : check.check === "less_than" && check.inclusive && typeof check.value === "number" ? check.value : undefined;
|
|
139
|
-
if (low !== undefined)
|
|
140
|
-
min = min === undefined ? low : Math.max(min, low);
|
|
141
|
-
if (high !== undefined)
|
|
142
|
-
max = max === undefined ? high : Math.min(max, high);
|
|
143
|
-
}
|
|
144
|
-
return {
|
|
145
|
-
type: "number",
|
|
146
|
-
...(min === undefined ? {} : { min }),
|
|
147
|
-
...(max === undefined ? {} : { max }),
|
|
148
|
-
...(step === undefined ? {} : { step }),
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
if (type === "string") {
|
|
152
|
-
// A date is a string with a date-shaped pattern. Recognizing it means
|
|
153
|
-
// the interface offers a date picker instead of a free text box, which
|
|
154
|
-
// is the difference between an action anyone can run and one only its
|
|
155
|
-
// author knows the format for.
|
|
156
|
-
const own = def?.pattern;
|
|
157
|
-
const sources = [own, ...checks.map((check) => check.pattern)].filter((pattern) => pattern instanceof RegExp).map((pattern) => pattern.source);
|
|
158
|
-
if (sources.some((source) => source.includes("\\d{4}"))) {
|
|
159
|
-
// A time of day in the pattern as well: `T\d{2}:\d{2}`, or a space before it.
|
|
160
|
-
return sources.some((source) => source.includes("\\d{2}:\\d{2}")) ? { type: "date", time: true } : { type: "date" };
|
|
161
|
-
}
|
|
162
|
-
// Prose: more than 500 characters allowed — a document's `text` (FR-147), asked for in a text area.
|
|
163
|
-
const long = checks.some((check) => check.check === "max_length" && typeof check.maximum === "number" && check.maximum > 500);
|
|
164
|
-
return long ? { type: "text", long: true } : { type: "text" };
|
|
165
|
-
}
|
|
166
|
-
return { type: "unknown" };
|
|
167
|
-
}
|
|
168
|
-
/** The declared shape of one named argument of a mutation input object. */
|
|
169
|
-
export function argShape(input, name) {
|
|
170
|
-
const shape = input?.shape;
|
|
171
|
-
if (!shape || !(name in shape))
|
|
172
|
-
return { type: "unknown" };
|
|
173
|
-
return describeArg(shape[name]);
|
|
174
|
-
}
|
|
175
82
|
//# sourceMappingURL=node-ref.js.map
|