@superbee/core 0.2.0-pre.3 → 0.2.0-pre.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 +1082 -0
- package/dist/artifact-contract.d.ts +90 -0
- package/dist/artifact-contract.d.ts.map +1 -0
- package/dist/artifact-contract.js +205 -0
- package/dist/artifact-contract.js.map +1 -0
- package/dist/backend.d.ts +19 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +83 -36
- package/dist/backend.js.map +1 -1
- package/dist/blob-contract.d.ts +80 -0
- package/dist/blob-contract.d.ts.map +1 -0
- package/dist/blob-contract.js +131 -0
- package/dist/blob-contract.js.map +1 -0
- package/dist/blob-journal.d.ts +302 -0
- package/dist/blob-journal.d.ts.map +1 -0
- package/dist/blob-journal.js +540 -0
- package/dist/blob-journal.js.map +1 -0
- package/dist/body-replace-guards.d.ts +52 -0
- package/dist/body-replace-guards.d.ts.map +1 -0
- package/dist/body-replace-guards.js +176 -0
- package/dist/body-replace-guards.js.map +1 -0
- package/dist/builtin-recipes/content.d.ts +93 -0
- package/dist/builtin-recipes/content.d.ts.map +1 -0
- package/dist/builtin-recipes/content.js +288 -0
- package/dist/builtin-recipes/content.js.map +1 -0
- package/dist/builtin-recipes.d.ts +10 -0
- package/dist/builtin-recipes.d.ts.map +1 -0
- package/dist/builtin-recipes.js +97 -0
- package/dist/builtin-recipes.js.map +1 -0
- package/dist/bundle-health/index.d.ts +14 -0
- package/dist/bundle-health/index.d.ts.map +1 -0
- package/dist/bundle-health/index.js +12 -0
- package/dist/bundle-health/index.js.map +1 -0
- package/dist/bundle-health/kind-findings.d.ts +44 -0
- package/dist/bundle-health/kind-findings.d.ts.map +1 -0
- package/dist/bundle-health/kind-findings.js +68 -0
- package/dist/bundle-health/kind-findings.js.map +1 -0
- package/dist/bundle-health/legacy-page.d.ts +39 -0
- package/dist/bundle-health/legacy-page.d.ts.map +1 -0
- package/dist/bundle-health/legacy-page.js +50 -0
- package/dist/bundle-health/legacy-page.js.map +1 -0
- package/dist/bundle-health/report.d.ts +202 -0
- package/dist/bundle-health/report.d.ts.map +1 -0
- package/dist/bundle-health/report.js +438 -0
- package/dist/bundle-health/report.js.map +1 -0
- package/dist/bundle-ops.d.ts +1 -1
- package/dist/bundle-ops.d.ts.map +1 -1
- package/dist/bundle-ops.js +2 -2
- package/dist/bundle-ops.js.map +1 -1
- package/dist/bundle.d.ts +2 -1
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +3 -3
- package/dist/bundle.js.map +1 -1
- package/dist/code-point-order.d.ts +8 -0
- package/dist/code-point-order.d.ts.map +1 -0
- package/dist/code-point-order.js +20 -0
- package/dist/code-point-order.js.map +1 -0
- package/dist/connector-request.d.ts +87 -0
- package/dist/connector-request.d.ts.map +1 -0
- package/dist/connector-request.js +370 -0
- package/dist/connector-request.js.map +1 -0
- package/dist/connectors.d.ts +262 -0
- package/dist/connectors.d.ts.map +1 -0
- package/dist/connectors.js +1179 -0
- package/dist/connectors.js.map +1 -0
- package/dist/cross-bundle.d.ts +135 -0
- package/dist/cross-bundle.d.ts.map +1 -0
- package/dist/cross-bundle.js +186 -0
- package/dist/cross-bundle.js.map +1 -0
- package/dist/dependencies.d.ts +94 -0
- package/dist/dependencies.d.ts.map +1 -0
- package/dist/dependencies.js +180 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/document-codec.d.ts +5 -1
- package/dist/document-codec.d.ts.map +1 -1
- package/dist/document-codec.js +7 -4
- package/dist/document-codec.js.map +1 -1
- package/dist/document-field-actions.d.ts +31 -1
- package/dist/document-field-actions.d.ts.map +1 -1
- package/dist/document-field-actions.js +137 -34
- package/dist/document-field-actions.js.map +1 -1
- package/dist/document-mutation.d.ts +22 -10
- package/dist/document-mutation.d.ts.map +1 -1
- package/dist/document-mutation.js +61 -27
- package/dist/document-mutation.js.map +1 -1
- package/dist/document-write-policy.d.ts.map +1 -1
- package/dist/document-write-policy.js +4 -2
- package/dist/document-write-policy.js.map +1 -1
- package/dist/domain-model.d.ts +73 -0
- package/dist/domain-model.d.ts.map +1 -0
- package/dist/domain-model.js +169 -0
- package/dist/domain-model.js.map +1 -0
- package/dist/engine.d.ts +16 -8
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +42 -4
- package/dist/engine.js.map +1 -1
- package/dist/file-journaled-backend-internal.d.ts +21 -0
- package/dist/file-journaled-backend-internal.d.ts.map +1 -0
- package/dist/file-journaled-backend-internal.js +12 -0
- package/dist/file-journaled-backend-internal.js.map +1 -0
- package/dist/file-journaled-backend.d.ts +160 -0
- package/dist/file-journaled-backend.d.ts.map +1 -0
- package/dist/file-journaled-backend.js +1345 -0
- package/dist/file-journaled-backend.js.map +1 -0
- package/dist/filesystem-host.d.ts +15 -0
- package/dist/filesystem-host.d.ts.map +1 -0
- package/dist/filesystem-host.js +20 -0
- package/dist/filesystem-host.js.map +1 -0
- package/dist/filesystem-identity.d.ts +86 -4
- package/dist/filesystem-identity.d.ts.map +1 -1
- package/dist/filesystem-identity.js +338 -102
- package/dist/filesystem-identity.js.map +1 -1
- package/dist/filesystem-lock.d.ts +16 -3
- package/dist/filesystem-lock.d.ts.map +1 -1
- package/dist/filesystem-lock.js +323 -77
- package/dist/filesystem-lock.js.map +1 -1
- package/dist/filesystem-push-role.d.ts +77 -0
- package/dist/filesystem-push-role.d.ts.map +1 -0
- package/dist/filesystem-push-role.js +165 -0
- package/dist/filesystem-push-role.js.map +1 -0
- package/dist/filesystem.d.ts +17 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +18 -0
- package/dist/filesystem.js.map +1 -0
- package/dist/governed-body-write.d.ts +106 -0
- package/dist/governed-body-write.d.ts.map +1 -0
- package/dist/governed-body-write.js +251 -0
- package/dist/governed-body-write.js.map +1 -0
- package/dist/host-policy-snapshot.d.ts +9 -0
- package/dist/host-policy-snapshot.d.ts.map +1 -0
- package/dist/host-policy-snapshot.js +33 -0
- package/dist/host-policy-snapshot.js.map +1 -0
- package/dist/host-text.d.ts +31 -0
- package/dist/host-text.d.ts.map +1 -0
- package/dist/host-text.js +77 -0
- package/dist/host-text.js.map +1 -0
- package/dist/hosted-client/binding.d.ts +7 -0
- package/dist/hosted-client/binding.d.ts.map +1 -0
- package/dist/hosted-client/binding.js +10 -0
- package/dist/hosted-client/binding.js.map +1 -0
- package/dist/hosted-client/blob-delivery.d.ts +67 -0
- package/dist/hosted-client/blob-delivery.d.ts.map +1 -0
- package/dist/hosted-client/blob-delivery.js +169 -0
- package/dist/hosted-client/blob-delivery.js.map +1 -0
- package/dist/hosted-client/blob-write.d.ts +386 -0
- package/dist/hosted-client/blob-write.d.ts.map +1 -0
- package/dist/hosted-client/blob-write.js +770 -0
- package/dist/hosted-client/blob-write.js.map +1 -0
- package/dist/hosted-client/bundle-listing.d.ts +46 -0
- package/dist/hosted-client/bundle-listing.d.ts.map +1 -0
- package/dist/hosted-client/bundle-listing.js +36 -0
- package/dist/hosted-client/bundle-listing.js.map +1 -0
- package/dist/hosted-client/client.d.ts +219 -0
- package/dist/hosted-client/client.d.ts.map +1 -0
- package/dist/hosted-client/client.js +309 -0
- package/dist/hosted-client/client.js.map +1 -0
- package/dist/hosted-client/directory.d.ts +46 -0
- package/dist/hosted-client/directory.d.ts.map +1 -0
- package/dist/hosted-client/directory.js +74 -0
- package/dist/hosted-client/directory.js.map +1 -0
- package/dist/hosted-client/errors.d.ts +26 -0
- package/dist/hosted-client/errors.d.ts.map +1 -0
- package/dist/hosted-client/errors.js +35 -0
- package/dist/hosted-client/errors.js.map +1 -0
- package/dist/hosted-client/inbox.d.ts +320 -0
- package/dist/hosted-client/inbox.d.ts.map +1 -0
- package/dist/hosted-client/inbox.js +379 -0
- package/dist/hosted-client/inbox.js.map +1 -0
- package/dist/hosted-client/index.d.ts +30 -0
- package/dist/hosted-client/index.d.ts.map +1 -0
- package/dist/hosted-client/index.js +32 -0
- package/dist/hosted-client/index.js.map +1 -0
- package/dist/hosted-client/journal.d.ts +103 -0
- package/dist/hosted-client/journal.d.ts.map +1 -0
- package/dist/hosted-client/journal.js +464 -0
- package/dist/hosted-client/journal.js.map +1 -0
- package/dist/hosted-client/node.d.ts +74 -0
- package/dist/hosted-client/node.d.ts.map +1 -0
- package/dist/hosted-client/node.js +219 -0
- package/dist/hosted-client/node.js.map +1 -0
- package/dist/hosted-client/reference.d.ts +12 -0
- package/dist/hosted-client/reference.d.ts.map +1 -0
- package/dist/hosted-client/reference.js +29 -0
- package/dist/hosted-client/reference.js.map +1 -0
- package/dist/hosted-client/write.d.ts +217 -0
- package/dist/hosted-client/write.d.ts.map +1 -0
- package/dist/hosted-client/write.js +418 -0
- package/dist/hosted-client/write.js.map +1 -0
- package/dist/hosted-transport/answer-rows.d.ts +243 -0
- package/dist/hosted-transport/answer-rows.d.ts.map +1 -0
- package/dist/hosted-transport/answer-rows.js +454 -0
- package/dist/hosted-transport/answer-rows.js.map +1 -0
- package/dist/hosted-transport/blob-reads.d.ts +35 -0
- package/dist/hosted-transport/blob-reads.d.ts.map +1 -0
- package/dist/hosted-transport/blob-reads.js +179 -0
- package/dist/hosted-transport/blob-reads.js.map +1 -0
- package/dist/hosted-transport/blob-write.d.ts +34 -0
- package/dist/hosted-transport/blob-write.d.ts.map +1 -0
- package/dist/hosted-transport/blob-write.js +115 -0
- package/dist/hosted-transport/blob-write.js.map +1 -0
- package/dist/hosted-transport/carrier.d.ts +151 -0
- package/dist/hosted-transport/carrier.d.ts.map +1 -0
- package/dist/hosted-transport/carrier.js +260 -0
- package/dist/hosted-transport/carrier.js.map +1 -0
- package/dist/hosted-transport/history-pages.d.ts +55 -0
- package/dist/hosted-transport/history-pages.d.ts.map +1 -0
- package/dist/hosted-transport/history-pages.js +69 -0
- package/dist/hosted-transport/history-pages.js.map +1 -0
- package/dist/hosted-transport/index.d.ts +18 -0
- package/dist/hosted-transport/index.d.ts.map +1 -0
- package/dist/hosted-transport/index.js +18 -0
- package/dist/hosted-transport/index.js.map +1 -0
- package/dist/hosted-transport/operations.d.ts +85 -0
- package/dist/hosted-transport/operations.d.ts.map +1 -0
- package/dist/hosted-transport/operations.js +128 -0
- package/dist/hosted-transport/operations.js.map +1 -0
- package/dist/hosted-transport/paged-reads.d.ts +87 -0
- package/dist/hosted-transport/paged-reads.d.ts.map +1 -0
- package/dist/hosted-transport/paged-reads.js +238 -0
- package/dist/hosted-transport/paged-reads.js.map +1 -0
- package/dist/hosted-transport/read-adapter.d.ts +256 -0
- package/dist/hosted-transport/read-adapter.d.ts.map +1 -0
- package/dist/hosted-transport/read-adapter.js +568 -0
- package/dist/hosted-transport/read-adapter.js.map +1 -0
- package/dist/hosted-transport/root-write.d.ts +114 -0
- package/dist/hosted-transport/root-write.d.ts.map +1 -0
- package/dist/hosted-transport/root-write.js +171 -0
- package/dist/hosted-transport/root-write.js.map +1 -0
- package/dist/hosted-transport/whole-document-transport.d.ts +204 -0
- package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -0
- package/dist/hosted-transport/whole-document-transport.js +447 -0
- package/dist/hosted-transport/whole-document-transport.js.map +1 -0
- package/dist/index.d.ts +34 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -8
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-backend.d.ts +28 -37
- package/dist/indexeddb-backend.d.ts.map +1 -1
- package/dist/indexeddb-backend.js +467 -113
- package/dist/indexeddb-backend.js.map +1 -1
- package/dist/journaled-backend.d.ts +232 -15
- package/dist/journaled-backend.d.ts.map +1 -1
- package/dist/journaled-backend.js +254 -55
- package/dist/journaled-backend.js.map +1 -1
- package/dist/kind-authoring.d.ts +170 -0
- package/dist/kind-authoring.d.ts.map +1 -0
- package/dist/kind-authoring.js +451 -0
- package/dist/kind-authoring.js.map +1 -0
- package/dist/kind-conformance-error.d.ts +15 -0
- package/dist/kind-conformance-error.d.ts.map +1 -0
- package/dist/kind-conformance-error.js +20 -0
- package/dist/kind-conformance-error.js.map +1 -0
- package/dist/kind-coverage.d.ts +99 -0
- package/dist/kind-coverage.d.ts.map +1 -0
- package/dist/kind-coverage.js +186 -0
- package/dist/kind-coverage.js.map +1 -0
- package/dist/kind-field-mutation.d.ts +4 -0
- package/dist/kind-field-mutation.d.ts.map +1 -1
- package/dist/kind-field-mutation.js +28 -3
- package/dist/kind-field-mutation.js.map +1 -1
- package/dist/kinds-load.js +4 -4
- package/dist/kinds-load.js.map +1 -1
- package/dist/kinds.d.ts +65 -2
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +341 -21
- package/dist/kinds.js.map +1 -1
- package/dist/link-types.d.ts +26 -0
- package/dist/link-types.d.ts.map +1 -0
- package/dist/link-types.js +57 -0
- package/dist/link-types.js.map +1 -0
- package/dist/links.d.ts +21 -3
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +213 -14
- package/dist/links.js.map +1 -1
- package/dist/managed-document-metadata.d.ts +2 -0
- package/dist/managed-document-metadata.d.ts.map +1 -0
- package/dist/managed-document-metadata.js +9 -0
- package/dist/managed-document-metadata.js.map +1 -0
- package/dist/memory-backend.d.ts.map +1 -1
- package/dist/memory-backend.js +6 -2
- package/dist/memory-backend.js.map +1 -1
- package/dist/paths.d.ts +16 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +25 -0
- package/dist/paths.js.map +1 -1
- package/dist/platform.d.ts +13 -2
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +16 -0
- package/dist/platform.js.map +1 -1
- package/dist/portable-export.d.ts +119 -0
- package/dist/portable-export.d.ts.map +1 -0
- package/dist/portable-export.js +501 -0
- package/dist/portable-export.js.map +1 -0
- package/dist/publication-filesystem.d.ts +1 -1
- package/dist/publication-filesystem.d.ts.map +1 -1
- package/dist/publication-filesystem.js +1 -1
- package/dist/publication-filesystem.js.map +1 -1
- package/dist/qualified-links.d.ts +67 -0
- package/dist/qualified-links.d.ts.map +1 -0
- package/dist/qualified-links.js +117 -0
- package/dist/qualified-links.js.map +1 -0
- package/dist/query-filter.d.ts +16 -2
- package/dist/query-filter.d.ts.map +1 -1
- package/dist/query-filter.js +40 -1
- package/dist/query-filter.js.map +1 -1
- package/dist/query-order.d.ts +22 -0
- package/dist/query-order.d.ts.map +1 -0
- package/dist/query-order.js +42 -0
- package/dist/query-order.js.map +1 -0
- package/dist/recipe-lifecycle/errors.d.ts +96 -0
- package/dist/recipe-lifecycle/errors.d.ts.map +1 -0
- package/dist/recipe-lifecycle/errors.js +122 -0
- package/dist/recipe-lifecycle/errors.js.map +1 -0
- package/dist/recipe-lifecycle/evolution.d.ts +112 -0
- package/dist/recipe-lifecycle/evolution.d.ts.map +1 -0
- package/dist/recipe-lifecycle/evolution.js +941 -0
- package/dist/recipe-lifecycle/evolution.js.map +1 -0
- package/dist/recipe-lifecycle/index.d.ts +30 -0
- package/dist/recipe-lifecycle/index.d.ts.map +1 -0
- package/dist/recipe-lifecycle/index.js +26 -0
- package/dist/recipe-lifecycle/index.js.map +1 -0
- package/dist/recipe-lifecycle/install.d.ts +155 -0
- package/dist/recipe-lifecycle/install.d.ts.map +1 -0
- package/dist/recipe-lifecycle/install.js +594 -0
- package/dist/recipe-lifecycle/install.js.map +1 -0
- package/dist/recipe-lifecycle/legacy-aliases.d.ts +16 -0
- package/dist/recipe-lifecycle/legacy-aliases.d.ts.map +1 -0
- package/dist/recipe-lifecycle/legacy-aliases.js +51 -0
- package/dist/recipe-lifecycle/legacy-aliases.js.map +1 -0
- package/dist/recipe-lifecycle/stamp.d.ts +151 -0
- package/dist/recipe-lifecycle/stamp.d.ts.map +1 -0
- package/dist/recipe-lifecycle/stamp.js +364 -0
- package/dist/recipe-lifecycle/stamp.js.map +1 -0
- package/dist/recipes.d.ts +29 -1
- package/dist/recipes.d.ts.map +1 -1
- package/dist/recipes.js +137 -1
- package/dist/recipes.js.map +1 -1
- package/dist/record-overlay/apply.d.ts +43 -0
- package/dist/record-overlay/apply.d.ts.map +1 -0
- package/dist/record-overlay/apply.js +527 -0
- package/dist/record-overlay/apply.js.map +1 -0
- package/dist/record-overlay/canonical.d.ts +22 -0
- package/dist/record-overlay/canonical.d.ts.map +1 -0
- package/dist/record-overlay/canonical.js +47 -0
- package/dist/record-overlay/canonical.js.map +1 -0
- package/dist/record-overlay/digest.d.ts +4 -0
- package/dist/record-overlay/digest.d.ts.map +1 -0
- package/dist/record-overlay/digest.js +11 -0
- package/dist/record-overlay/digest.js.map +1 -0
- package/dist/record-overlay/errors.d.ts +44 -0
- package/dist/record-overlay/errors.d.ts.map +1 -0
- package/dist/record-overlay/errors.js +55 -0
- package/dist/record-overlay/errors.js.map +1 -0
- package/dist/record-overlay/findings.d.ts +5 -0
- package/dist/record-overlay/findings.d.ts.map +1 -0
- package/dist/record-overlay/findings.js +83 -0
- package/dist/record-overlay/findings.js.map +1 -0
- package/dist/record-overlay/index.d.ts +23 -0
- package/dist/record-overlay/index.d.ts.map +1 -0
- package/dist/record-overlay/index.js +21 -0
- package/dist/record-overlay/index.js.map +1 -0
- package/dist/record-overlay/plan.d.ts +12 -0
- package/dist/record-overlay/plan.d.ts.map +1 -0
- package/dist/record-overlay/plan.js +285 -0
- package/dist/record-overlay/plan.js.map +1 -0
- package/dist/record-overlay/policy.d.ts +69 -0
- package/dist/record-overlay/policy.d.ts.map +1 -0
- package/dist/record-overlay/policy.js +228 -0
- package/dist/record-overlay/policy.js.map +1 -0
- package/dist/record-overlay/redact.d.ts +3 -0
- package/dist/record-overlay/redact.d.ts.map +1 -0
- package/dist/record-overlay/redact.js +27 -0
- package/dist/record-overlay/redact.js.map +1 -0
- package/dist/record-overlay/signal-kind.d.ts +30 -0
- package/dist/record-overlay/signal-kind.d.ts.map +1 -0
- package/dist/record-overlay/signal-kind.js +38 -0
- package/dist/record-overlay/signal-kind.js.map +1 -0
- package/dist/record-overlay/signal-text.d.ts +45 -0
- package/dist/record-overlay/signal-text.d.ts.map +1 -0
- package/dist/record-overlay/signal-text.js +116 -0
- package/dist/record-overlay/signal-text.js.map +1 -0
- package/dist/record-overlay/source-index.d.ts +19 -0
- package/dist/record-overlay/source-index.d.ts.map +1 -0
- package/dist/record-overlay/source-index.js +102 -0
- package/dist/record-overlay/source-index.js.map +1 -0
- package/dist/record-overlay/types.d.ts +291 -0
- package/dist/record-overlay/types.d.ts.map +1 -0
- package/dist/record-overlay/types.js +2 -0
- package/dist/record-overlay/types.js.map +1 -0
- package/dist/remote-backend.d.ts +67 -67
- package/dist/remote-backend.d.ts.map +1 -1
- package/dist/remote-backend.js +168 -201
- package/dist/remote-backend.js.map +1 -1
- package/dist/remote-document-codec.d.ts +2 -1
- package/dist/remote-document-codec.d.ts.map +1 -1
- package/dist/remote-document-codec.js +3 -2
- package/dist/remote-document-codec.js.map +1 -1
- package/dist/remote-error.d.ts +38 -0
- package/dist/remote-error.d.ts.map +1 -0
- package/dist/remote-error.js +59 -0
- package/dist/remote-error.js.map +1 -0
- package/dist/remote-operations.d.ts +0 -40
- package/dist/remote-operations.d.ts.map +1 -1
- package/dist/remote-operations.js +26 -6
- package/dist/remote-operations.js.map +1 -1
- package/dist/remote-parsers.d.ts +86 -0
- package/dist/remote-parsers.d.ts.map +1 -0
- package/dist/remote-parsers.js +181 -0
- package/dist/remote-parsers.js.map +1 -0
- package/dist/remote.d.ts +5 -2
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +5 -1
- package/dist/remote.js.map +1 -1
- package/dist/search/backend-source.d.ts +6 -0
- package/dist/search/backend-source.d.ts.map +1 -0
- package/dist/search/backend-source.js +33 -0
- package/dist/search/backend-source.js.map +1 -0
- package/dist/search/contract.d.ts +151 -0
- package/dist/search/contract.d.ts.map +1 -0
- package/dist/search/contract.js +78 -0
- package/dist/search/contract.js.map +1 -0
- package/dist/search/errors.d.ts +30 -0
- package/dist/search/errors.d.ts.map +1 -0
- package/dist/search/errors.js +50 -0
- package/dist/search/errors.js.map +1 -0
- package/dist/search/identity.d.ts +12 -0
- package/dist/search/identity.d.ts.map +1 -0
- package/dist/search/identity.js +90 -0
- package/dist/search/identity.js.map +1 -0
- package/dist/search/index.d.ts +16 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +15 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/memory-source.d.ts +36 -0
- package/dist/search/memory-source.d.ts.map +1 -0
- package/dist/search/memory-source.js +235 -0
- package/dist/search/memory-source.js.map +1 -0
- package/dist/search/rank.d.ts +34 -0
- package/dist/search/rank.d.ts.map +1 -0
- package/dist/search/rank.js +129 -0
- package/dist/search/rank.js.map +1 -0
- package/dist/search/row-text.d.ts +38 -0
- package/dist/search/row-text.d.ts.map +1 -0
- package/dist/search/row-text.js +88 -0
- package/dist/search/row-text.js.map +1 -0
- package/dist/search/search.d.ts +28 -0
- package/dist/search/search.d.ts.map +1 -0
- package/dist/search/search.js +257 -0
- package/dist/search/search.js.map +1 -0
- package/dist/search/source.d.ts +67 -0
- package/dist/search/source.d.ts.map +1 -0
- package/dist/search/source.js +2 -0
- package/dist/search/source.js.map +1 -0
- package/dist/search/text.d.ts +47 -0
- package/dist/search/text.d.ts.map +1 -0
- package/dist/search/text.js +150 -0
- package/dist/search/text.js.map +1 -0
- package/dist/site-capabilities.d.ts +345 -0
- package/dist/site-capabilities.d.ts.map +1 -0
- package/dist/site-capabilities.js +724 -0
- package/dist/site-capabilities.js.map +1 -0
- package/dist/source-engine/guard.d.ts +78 -0
- package/dist/source-engine/guard.d.ts.map +1 -0
- package/dist/source-engine/guard.js +423 -0
- package/dist/source-engine/guard.js.map +1 -0
- package/dist/source-engine/index.d.ts +26 -0
- package/dist/source-engine/index.d.ts.map +1 -0
- package/dist/source-engine/index.js +21 -0
- package/dist/source-engine/index.js.map +1 -0
- package/dist/source-engine/machine-state.d.ts +74 -0
- package/dist/source-engine/machine-state.d.ts.map +1 -0
- package/dist/source-engine/machine-state.js +48 -0
- package/dist/source-engine/machine-state.js.map +1 -0
- package/dist/source-engine/observe.d.ts +18 -0
- package/dist/source-engine/observe.d.ts.map +1 -0
- package/dist/source-engine/observe.js +620 -0
- package/dist/source-engine/observe.js.map +1 -0
- package/dist/source-engine/overlay.d.ts +49 -0
- package/dist/source-engine/overlay.d.ts.map +1 -0
- package/dist/source-engine/overlay.js +114 -0
- package/dist/source-engine/overlay.js.map +1 -0
- package/dist/source-engine/robots.d.ts +53 -0
- package/dist/source-engine/robots.d.ts.map +1 -0
- package/dist/source-engine/robots.js +158 -0
- package/dist/source-engine/robots.js.map +1 -0
- package/dist/source-engine/types.d.ts +287 -0
- package/dist/source-engine/types.d.ts.map +1 -0
- package/dist/source-engine/types.js +2 -0
- package/dist/source-engine/types.js.map +1 -0
- package/dist/source-harness/conformance.d.ts +16 -0
- package/dist/source-harness/conformance.d.ts.map +1 -0
- package/dist/source-harness/conformance.js +266 -0
- package/dist/source-harness/conformance.js.map +1 -0
- package/dist/source-harness/fixture.d.ts +95 -0
- package/dist/source-harness/fixture.d.ts.map +1 -0
- package/dist/source-harness/fixture.js +273 -0
- package/dist/source-harness/fixture.js.map +1 -0
- package/dist/source-harness/index.d.ts +22 -0
- package/dist/source-harness/index.d.ts.map +1 -0
- package/dist/source-harness/index.js +19 -0
- package/dist/source-harness/index.js.map +1 -0
- package/dist/source-harness/peer.d.ts +74 -0
- package/dist/source-harness/peer.d.ts.map +1 -0
- package/dist/source-harness/peer.js +106 -0
- package/dist/source-harness/peer.js.map +1 -0
- package/dist/source-profiles/index.d.ts +31 -0
- package/dist/source-profiles/index.d.ts.map +1 -0
- package/dist/source-profiles/index.js +206 -0
- package/dist/source-profiles/index.js.map +1 -0
- package/dist/source-profiles/link-header.d.ts +6 -0
- package/dist/source-profiles/link-header.d.ts.map +1 -0
- package/dist/source-profiles/link-header.js +131 -0
- package/dist/source-profiles/link-header.js.map +1 -0
- package/dist/storage.d.ts +6 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +4 -1
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +38 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -10
- package/dist/types.js.map +1 -1
- package/dist/uncertain-write.d.ts +161 -19
- package/dist/uncertain-write.d.ts.map +1 -1
- package/dist/uncertain-write.js +90 -31
- package/dist/uncertain-write.js.map +1 -1
- package/dist/versioning.d.ts +9 -4
- package/dist/versioning.d.ts.map +1 -1
- package/dist/versioning.js +9 -4
- package/dist/versioning.js.map +1 -1
- package/dist/write-identity.d.ts +5 -0
- package/dist/write-identity.d.ts.map +1 -0
- package/dist/write-identity.js +9 -0
- package/dist/write-identity.js.map +1 -0
- package/package.json +103 -2
package/dist/kinds.js
CHANGED
|
@@ -20,22 +20,58 @@
|
|
|
20
20
|
* convention-doc (de)serialization) is dependency-free — this module carries ONLY that, and is
|
|
21
21
|
* exported as the browser-safe `@superbee/core/kinds` subpath (the ui shell's bridge
|
|
22
22
|
* `open` filter consumes `isTerminal` there; a browser bundler must never be dragged through the
|
|
23
|
-
* engine's node built-ins for a pure predicate). The
|
|
24
|
-
* `
|
|
23
|
+
* engine's node built-ins for a pure predicate). The bundle read, `loadKinds`, lives in
|
|
24
|
+
* `kinds-load.ts`, which reads through `bundle-ops.ts` and is browser-safe too: the split is
|
|
25
|
+
* between pure parsing and the bundle read, over the same ONE registry.
|
|
25
26
|
*/
|
|
26
27
|
import { isOkfLifecycleStatus, OKF_LIFECYCLE_STATUSES } from "./okf-lifecycle.js";
|
|
27
28
|
import { isUsableTimestamp } from "./frontmatter.js";
|
|
29
|
+
import { parseIsoInstant } from "./verification.js";
|
|
28
30
|
/** The bundle-relative prefix a kind convention doc MUST live under to be discovered. */
|
|
29
31
|
export const CONVENTIONS_PREFIX = "conventions/";
|
|
32
|
+
/**
|
|
33
|
+
* True for an id `loadKinds` reads a convention from: under {@link CONVENTIONS_PREFIX} exactly as
|
|
34
|
+
* spelled (case-sensitive). A case variant is not a convention id; a host that fences folded ids
|
|
35
|
+
* refuses it rather than let it govern after a case-insensitive checkout.
|
|
36
|
+
*/
|
|
37
|
+
export function isConventionId(id) {
|
|
38
|
+
return id.startsWith(CONVENTIONS_PREFIX);
|
|
39
|
+
}
|
|
30
40
|
/** The OKF `type` value a kind convention doc itself carries. */
|
|
31
41
|
export const CONVENTION_TYPE = "Convention";
|
|
42
|
+
/**
|
|
43
|
+
* The closed, domain-neutral value-type vocabulary a convention may declare in `fields.types`.
|
|
44
|
+
* Each type constrains a value's shape only; presence stays governed by `fields.required`.
|
|
45
|
+
* Domain composites (opening hours, money, addresses) belong to recipe tooling, not core.
|
|
46
|
+
*/
|
|
47
|
+
export const KIND_FIELD_TYPES = [
|
|
48
|
+
"date",
|
|
49
|
+
"datetime",
|
|
50
|
+
"https-url",
|
|
51
|
+
"https-url-list",
|
|
52
|
+
"integer",
|
|
53
|
+
"number",
|
|
54
|
+
"boolean",
|
|
55
|
+
"slug",
|
|
56
|
+
"string-list",
|
|
57
|
+
"latitude",
|
|
58
|
+
"longitude",
|
|
59
|
+
];
|
|
60
|
+
const KIND_FIELD_TYPE_SET = new Set(KIND_FIELD_TYPES);
|
|
61
|
+
/** True when `value` names a {@link KIND_FIELD_TYPES} member. */
|
|
62
|
+
export function isKindFieldType(value) {
|
|
63
|
+
return typeof value === "string" && KIND_FIELD_TYPE_SET.has(value);
|
|
64
|
+
}
|
|
32
65
|
/**
|
|
33
66
|
* Build the one authoritative Kind registry from already-selected convention documents.
|
|
34
67
|
* Callers own discovery; this pure half owns parsing, warnings, and first-by-id duplicate
|
|
35
68
|
* resolution so prospective registries cannot drift from {@link loadKinds} semantics.
|
|
36
69
|
*/
|
|
37
70
|
export function buildKindRegistry(docs, initialWarnings = [], options = {}) {
|
|
38
|
-
|
|
71
|
+
// Duplicate resolution walks conventions by id so a declared `order` can never steal a
|
|
72
|
+
// `governs` from the first-by-id declaration; the accepted set is then laid into the Map in
|
|
73
|
+
// reading order.
|
|
74
|
+
const accepted = new Map();
|
|
39
75
|
const warnings = [...initialWarnings];
|
|
40
76
|
for (const doc of [...docs].sort((a, b) => a.id.localeCompare(b.id))) {
|
|
41
77
|
const parsed = parseConventionDoc(doc, options);
|
|
@@ -58,10 +94,10 @@ export function buildKindRegistry(docs, initialWarnings = [], options = {}) {
|
|
|
58
94
|
severity: "warning",
|
|
59
95
|
});
|
|
60
96
|
}
|
|
61
|
-
if (
|
|
97
|
+
if (accepted.has(kind.governs)) {
|
|
62
98
|
warnings.push({
|
|
63
99
|
code: "KIND_DUPLICATE_GOVERNS",
|
|
64
|
-
message: `duplicate kind convention for '${kind.governs}': '${doc.id}' ignored, keeping the first-declared '${
|
|
100
|
+
message: `duplicate kind convention for '${kind.governs}': '${doc.id}' ignored, keeping the first-declared '${accepted.get(kind.governs).id}'.`,
|
|
65
101
|
field: kind.governs,
|
|
66
102
|
severity: "warning",
|
|
67
103
|
});
|
|
@@ -75,10 +111,27 @@ export function buildKindRegistry(docs, initialWarnings = [], options = {}) {
|
|
|
75
111
|
severity: "warning",
|
|
76
112
|
});
|
|
77
113
|
}
|
|
78
|
-
|
|
114
|
+
accepted.set(kind.governs, kind);
|
|
79
115
|
}
|
|
116
|
+
const kinds = new Map();
|
|
117
|
+
for (const kind of [...accepted.values()].sort(compareReadingOrder))
|
|
118
|
+
kinds.set(kind.governs, kind);
|
|
80
119
|
return { kinds, warnings };
|
|
81
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* The bundle's reading order over kinds: conventions with a declared `order` first, ascending,
|
|
123
|
+
* ties by id; then conventions without one, by id. A bundle that declares no `order` anywhere
|
|
124
|
+
* therefore iterates by id exactly as it did before the field existed.
|
|
125
|
+
*/
|
|
126
|
+
export function compareReadingOrder(a, b) {
|
|
127
|
+
if (a.order !== undefined && b.order !== undefined && a.order !== b.order)
|
|
128
|
+
return a.order - b.order;
|
|
129
|
+
if (a.order !== undefined && b.order === undefined)
|
|
130
|
+
return -1;
|
|
131
|
+
if (a.order === undefined && b.order !== undefined)
|
|
132
|
+
return 1;
|
|
133
|
+
return a.id.localeCompare(b.id);
|
|
134
|
+
}
|
|
82
135
|
/** Stable product-level name for a Kind's workflow progress field. */
|
|
83
136
|
export const PROGRESS_STATUS_FIELD = "progress_status";
|
|
84
137
|
/** Producer-qualified v0.2 storage coordinate for Superbee workflow progress. */
|
|
@@ -202,25 +255,48 @@ export function projectKindForAuthoring(okfVersion, kind) {
|
|
|
202
255
|
: undefined,
|
|
203
256
|
terminal: projectRecord(kind.fields.terminal),
|
|
204
257
|
descriptions: projectRecord(kind.fields.descriptions),
|
|
258
|
+
...(kind.fields.types ? { types: projectRecord(kind.fields.types) } : {}),
|
|
205
259
|
},
|
|
206
260
|
};
|
|
207
261
|
}
|
|
262
|
+
/** Whether a Kind finding names a frontmatter coordinate rather than a body heading. */
|
|
263
|
+
export function isKindFieldValidationWarning(warning) {
|
|
264
|
+
return warning.code === "KIND_FIELD_MISSING"
|
|
265
|
+
|| warning.code === "KIND_FIELD_VALUE"
|
|
266
|
+
|| warning.code === "KIND_FIELD_ARITY"
|
|
267
|
+
|| warning.code === "KIND_FIELD_TYPE";
|
|
268
|
+
}
|
|
269
|
+
/** The owning message grammar separates the field coordinate from Kind labels and value suffixes. */
|
|
270
|
+
function kindFieldWarningPrefix(code, kind, field) {
|
|
271
|
+
switch (code) {
|
|
272
|
+
case "KIND_FIELD_MISSING":
|
|
273
|
+
return `'${kind.governs}' requires a non-empty '${field}' field `;
|
|
274
|
+
case "KIND_FIELD_VALUE":
|
|
275
|
+
return `'${field}' value `;
|
|
276
|
+
case "KIND_FIELD_ARITY":
|
|
277
|
+
return `'${field}' is enum-restricted and takes exactly ONE value for '${kind.governs}'; `;
|
|
278
|
+
case "KIND_FIELD_TYPE":
|
|
279
|
+
return `'${field}' must be `;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
208
282
|
/** Project Kind-validation findings into the same authoring vocabulary as the Kind schema. */
|
|
209
283
|
export function projectKindValidationWarnings(okfVersion, kind, warnings) {
|
|
210
284
|
const progress = progressStatusCoordinate(okfVersion, kind);
|
|
211
285
|
if (!progress)
|
|
212
286
|
return warnings;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
287
|
+
return warnings.map((warning) => {
|
|
288
|
+
if (!isKindFieldValidationWarning(warning) || warning.field !== progress.storageField)
|
|
289
|
+
return warning;
|
|
290
|
+
const storedPrefix = kindFieldWarningPrefix(warning.code, kind, progress.storageField);
|
|
291
|
+
const logicalPrefix = kindFieldWarningPrefix(warning.code, kind, progress.logicalField);
|
|
292
|
+
return {
|
|
217
293
|
...warning,
|
|
218
294
|
field: progress.logicalField,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
295
|
+
message: warning.message.startsWith(storedPrefix)
|
|
296
|
+
? logicalPrefix + warning.message.slice(storedPrefix.length)
|
|
297
|
+
: warning.message,
|
|
298
|
+
};
|
|
299
|
+
});
|
|
224
300
|
}
|
|
225
301
|
/** True for a plain YAML/JSON map (excludes arrays, `null`, dates, and other object instances). */
|
|
226
302
|
function isPlainObject(value) {
|
|
@@ -307,6 +383,7 @@ const VALID_FIELDS_KEYS = new Set([
|
|
|
307
383
|
"value_descriptions",
|
|
308
384
|
"terminal",
|
|
309
385
|
"descriptions",
|
|
386
|
+
"types",
|
|
310
387
|
]);
|
|
311
388
|
/**
|
|
312
389
|
* Top-level convention-doc keys that are near-misses for the ONE correct enum-constraint shape
|
|
@@ -381,7 +458,7 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
381
458
|
if (!VALID_FIELDS_KEYS.has(key)) {
|
|
382
459
|
warnings.push({
|
|
383
460
|
code: "KIND_CONVENTION_UNKNOWN_FIELDS_KEY",
|
|
384
|
-
message: `kind convention '${doc.id}' declares an unrecognized key 'fields.${key}' (valid keys: fields.required, fields.optional, fields.values, fields.value_descriptions, fields.terminal, fields.descriptions); ignoring it.`,
|
|
461
|
+
message: `kind convention '${doc.id}' declares an unrecognized key 'fields.${key}' (valid keys: fields.required, fields.optional, fields.values, fields.value_descriptions, fields.terminal, fields.descriptions, fields.types); ignoring it.`,
|
|
385
462
|
field: `fields.${key}`,
|
|
386
463
|
severity: "warning",
|
|
387
464
|
});
|
|
@@ -441,6 +518,60 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
441
518
|
});
|
|
442
519
|
}
|
|
443
520
|
}
|
|
521
|
+
// `fields.types` — declared value types from the closed KIND_FIELD_TYPES vocabulary. Same lenient
|
|
522
|
+
// posture as `fields.values`: a non-map shape warns and is ignored, an unknown type or a typed
|
|
523
|
+
// field the kind does not declare warns and is skipped. A definitions-only recipe therefore
|
|
524
|
+
// refuses a misspelled type instead of installing a constraint that can never fire.
|
|
525
|
+
const typesSource = fieldsRaw.types;
|
|
526
|
+
const types = {};
|
|
527
|
+
if (typesSource !== undefined) {
|
|
528
|
+
if (!isPlainObject(typesSource)) {
|
|
529
|
+
warnings.push({
|
|
530
|
+
code: "KIND_CONVENTION_BAD_SHAPE",
|
|
531
|
+
message: `kind convention '${doc.id}' has a non-map 'fields.types' (${describeShape(typesSource)}; expected a map of field name -> type); ignoring it.`,
|
|
532
|
+
field: "fields.types",
|
|
533
|
+
severity: "warning",
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
for (const [field, declared] of Object.entries(typesSource)) {
|
|
538
|
+
if (dropReserved(field, `fields.types.${field}`))
|
|
539
|
+
continue;
|
|
540
|
+
if (!isKindFieldType(declared)) {
|
|
541
|
+
warnings.push({
|
|
542
|
+
code: "KIND_CONVENTION_UNKNOWN_FIELD_TYPE",
|
|
543
|
+
message: `kind convention '${doc.id}' declares 'fields.types.${field}' as ${isScalar(declared) ? `'${String(declared)}'` : describeShape(declared)}, which is not a field type (valid types: ${KIND_FIELD_TYPES.join(", ")}); ignoring it.`,
|
|
544
|
+
field: `fields.types.${field}`,
|
|
545
|
+
severity: "warning",
|
|
546
|
+
});
|
|
547
|
+
continue;
|
|
548
|
+
}
|
|
549
|
+
if (!declaredFieldNames.has(field)) {
|
|
550
|
+
warnings.push({
|
|
551
|
+
code: "KIND_CONVENTION_UNDECLARED_TYPES_FIELD",
|
|
552
|
+
message: `kind convention '${doc.id}' declares 'fields.types.${field}' but '${field}' is not in fields.required or fields.optional; ignoring it.`,
|
|
553
|
+
field: `fields.types.${field}`,
|
|
554
|
+
severity: "warning",
|
|
555
|
+
});
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
setOwn(types, field, declared);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
// An enum over URLs is never meaningful, so values on an `https-url-list` field are skipped. Every
|
|
563
|
+
// other typed field may carry `fields.values`: a scalar picks one, a `string-list` checks each item.
|
|
564
|
+
for (const field of Object.keys(values)) {
|
|
565
|
+
if (types[field] !== "https-url-list")
|
|
566
|
+
continue;
|
|
567
|
+
warnings.push({
|
|
568
|
+
code: "KIND_CONVENTION_VALUES_TYPE_MISMATCH",
|
|
569
|
+
message: `kind convention '${doc.id}' declares 'fields.values.${field}' on a field of type 'https-url-list', which cannot carry an enum; ignoring the values.`,
|
|
570
|
+
field: `fields.values.${field}`,
|
|
571
|
+
severity: "warning",
|
|
572
|
+
});
|
|
573
|
+
delete values[field];
|
|
574
|
+
}
|
|
444
575
|
const valueDescriptionsSource = fieldsRaw.value_descriptions;
|
|
445
576
|
const valueDescriptions = {};
|
|
446
577
|
if (valueDescriptionsSource !== undefined) {
|
|
@@ -758,12 +889,30 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
758
889
|
: undefined;
|
|
759
890
|
// Strict boolean `true` only — an absent, false, or non-boolean value means "expanded" (the default).
|
|
760
891
|
const browseCollapsed = fm.browse_collapsed === true ? true : undefined;
|
|
892
|
+
// `order:` is a finite number or nothing. Anything else warns and the kind registers without an
|
|
893
|
+
// order (it sorts with the undeclared), never a skipped convention.
|
|
894
|
+
let order;
|
|
895
|
+
if (fm.order !== undefined) {
|
|
896
|
+
if (typeof fm.order === "number" && Number.isFinite(fm.order)) {
|
|
897
|
+
order = fm.order;
|
|
898
|
+
}
|
|
899
|
+
else {
|
|
900
|
+
warnings.push({
|
|
901
|
+
code: "KIND_CONVENTION_BAD_SHAPE",
|
|
902
|
+
message: `kind convention '${doc.id}' has an invalid 'order' (${describeShape(fm.order)}; expected a finite number such as 10); ignoring it.`,
|
|
903
|
+
field: "order",
|
|
904
|
+
severity: "warning",
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
}
|
|
761
908
|
const kind = {
|
|
762
909
|
id: doc.id,
|
|
763
910
|
title,
|
|
764
911
|
governs,
|
|
765
912
|
fields: { required, optional, values, valueDescriptions, terminal, descriptions },
|
|
766
913
|
};
|
|
914
|
+
if (Object.keys(types).length > 0)
|
|
915
|
+
kind.fields.types = types;
|
|
767
916
|
if (description !== undefined)
|
|
768
917
|
kind.description = description;
|
|
769
918
|
if (path !== undefined)
|
|
@@ -780,6 +929,8 @@ export function parseConventionDoc(doc, options = {}) {
|
|
|
780
929
|
kind.freshnessHorizon = freshnessHorizon;
|
|
781
930
|
if (browseCollapsed !== undefined)
|
|
782
931
|
kind.browseCollapsed = browseCollapsed;
|
|
932
|
+
if (order !== undefined)
|
|
933
|
+
kind.order = order;
|
|
783
934
|
if (claim !== undefined)
|
|
784
935
|
kind.claim = claim;
|
|
785
936
|
return {
|
|
@@ -826,9 +977,155 @@ export function isPresent(value) {
|
|
|
826
977
|
return value.length > 0;
|
|
827
978
|
return true;
|
|
828
979
|
}
|
|
980
|
+
/** Human phrase for each field type, used in warnings and authoring help. */
|
|
981
|
+
export const KIND_FIELD_TYPE_DESCRIPTIONS = {
|
|
982
|
+
date: "a YYYY-MM-DD calendar date",
|
|
983
|
+
datetime: "an ISO-8601 date and time with an explicit UTC offset (Z or +/-HH:MM)",
|
|
984
|
+
"https-url": "an absolute https URL of at most 2048 characters, without credentials",
|
|
985
|
+
"https-url-list": "a list of distinct https URLs",
|
|
986
|
+
integer: "a safe integer",
|
|
987
|
+
number: "a finite number",
|
|
988
|
+
boolean: "true or false",
|
|
989
|
+
slug: "a lowercase slug (a-z, 0-9 and single hyphens) of at most 200 characters",
|
|
990
|
+
"string-list": "a list of distinct non-empty strings",
|
|
991
|
+
latitude: "a number from -90 to 90",
|
|
992
|
+
longitude: "a number from -180 to 180",
|
|
993
|
+
};
|
|
994
|
+
const DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
995
|
+
const SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
996
|
+
const SLUG_MAX_LENGTH = 200;
|
|
997
|
+
const HTTPS_URL_MAX_LENGTH = 2048;
|
|
998
|
+
const HTTPS_PREFIX_RE = /^https:\/\//i;
|
|
999
|
+
const CONTROL_CHARACTER_RE = /[\u0000-\u001F\u007F]/;
|
|
1000
|
+
function describeValue(value) {
|
|
1001
|
+
if (typeof value === "string")
|
|
1002
|
+
return `got the string ${JSON.stringify(value.length > 60 ? `${value.slice(0, 57)}...` : value)}`;
|
|
1003
|
+
if (typeof value === "number")
|
|
1004
|
+
return `got the number ${Object.is(value, -0) ? "-0" : String(value)}`;
|
|
1005
|
+
if (typeof value === "boolean")
|
|
1006
|
+
return `got boolean ${String(value)}`;
|
|
1007
|
+
return `got ${describeShape(value)}`;
|
|
1008
|
+
}
|
|
1009
|
+
function httpsUrlProblem(value) {
|
|
1010
|
+
if (typeof value !== "string" || value.length > HTTPS_URL_MAX_LENGTH || /\s/.test(value))
|
|
1011
|
+
return describeValue(value);
|
|
1012
|
+
// WHATWG strips control characters and repairs `https:x`, `https:/x` and `https:\\x` into a host,
|
|
1013
|
+
// so the authored text must already be an absolute `https://` URL with no control characters.
|
|
1014
|
+
if (!HTTPS_PREFIX_RE.test(value) || CONTROL_CHARACTER_RE.test(value))
|
|
1015
|
+
return describeValue(value);
|
|
1016
|
+
// The WHATWG parser is the authority for the rest, so scheme case is irrelevant (`HTTPS://` is https).
|
|
1017
|
+
let parsed;
|
|
1018
|
+
try {
|
|
1019
|
+
parsed = new URL(value);
|
|
1020
|
+
}
|
|
1021
|
+
catch {
|
|
1022
|
+
return describeValue(value);
|
|
1023
|
+
}
|
|
1024
|
+
if (parsed.protocol !== "https:" || parsed.hostname === "")
|
|
1025
|
+
return describeValue(value);
|
|
1026
|
+
if (parsed.username !== "" || parsed.password !== "")
|
|
1027
|
+
return `${describeValue(value)} (credentials are not allowed)`;
|
|
1028
|
+
return undefined;
|
|
1029
|
+
}
|
|
1030
|
+
function listProblem(value, itemProblem) {
|
|
1031
|
+
if (!Array.isArray(value))
|
|
1032
|
+
return describeValue(value);
|
|
1033
|
+
const seen = new Set();
|
|
1034
|
+
for (const [index, item] of value.entries()) {
|
|
1035
|
+
const problem = itemProblem(item);
|
|
1036
|
+
if (problem !== undefined)
|
|
1037
|
+
return `item ${index} ${problem}`;
|
|
1038
|
+
if (seen.has(item))
|
|
1039
|
+
return `item ${index} repeats ${JSON.stringify(item)}`;
|
|
1040
|
+
seen.add(item);
|
|
1041
|
+
}
|
|
1042
|
+
return undefined;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Why `value` does not satisfy `type`, or `undefined` when it does. Values are judged as decoded:
|
|
1046
|
+
* YAML numbers and booleans, and strings exactly as authored (core's decoder keeps dates and
|
|
1047
|
+
* instants as their source strings). `null` never satisfies a type. The ONE type predicate;
|
|
1048
|
+
* callers never re-implement it.
|
|
1049
|
+
*/
|
|
1050
|
+
export function kindFieldTypeProblem(type, value) {
|
|
1051
|
+
switch (type) {
|
|
1052
|
+
case "date": {
|
|
1053
|
+
const match = typeof value === "string" ? DATE_RE.exec(value) : null;
|
|
1054
|
+
if (!match)
|
|
1055
|
+
return describeValue(value);
|
|
1056
|
+
const probe = new Date(0);
|
|
1057
|
+
probe.setUTCFullYear(Number(match[1]), Number(match[2]), 0); // day 0 of the next month
|
|
1058
|
+
const month = Number(match[2]);
|
|
1059
|
+
const day = Number(match[3]);
|
|
1060
|
+
return month >= 1 && month <= 12 && day >= 1 && day <= probe.getUTCDate() ? undefined : describeValue(value);
|
|
1061
|
+
}
|
|
1062
|
+
case "datetime":
|
|
1063
|
+
// Exactly the OKF standard-timestamp instant grammar.
|
|
1064
|
+
return typeof value === "string" && parseIsoInstant(value) !== null ? undefined : describeValue(value);
|
|
1065
|
+
case "https-url":
|
|
1066
|
+
return httpsUrlProblem(value);
|
|
1067
|
+
case "https-url-list":
|
|
1068
|
+
return listProblem(value, httpsUrlProblem);
|
|
1069
|
+
case "integer":
|
|
1070
|
+
return Number.isSafeInteger(value) && !Object.is(value, -0) ? undefined : describeValue(value);
|
|
1071
|
+
case "number":
|
|
1072
|
+
return typeof value === "number" && Number.isFinite(value) ? undefined : describeValue(value);
|
|
1073
|
+
case "boolean":
|
|
1074
|
+
return typeof value === "boolean" ? undefined : describeValue(value);
|
|
1075
|
+
case "slug":
|
|
1076
|
+
return typeof value === "string" && value.length <= SLUG_MAX_LENGTH && SLUG_RE.test(value)
|
|
1077
|
+
? undefined
|
|
1078
|
+
: describeValue(value);
|
|
1079
|
+
case "string-list":
|
|
1080
|
+
return listProblem(value, (item) => (typeof item === "string" && item !== "" ? undefined : describeValue(item)));
|
|
1081
|
+
case "latitude":
|
|
1082
|
+
case "longitude": {
|
|
1083
|
+
const limit = type === "latitude" ? 90 : 180;
|
|
1084
|
+
return typeof value === "number" && Number.isFinite(value) && value >= -limit && value <= limit
|
|
1085
|
+
? undefined
|
|
1086
|
+
: describeValue(value);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
/** Whether a Kind declares `field` (a storage name) as one of the two list types, `string-list` or `https-url-list`. */
|
|
1091
|
+
export function isKindListField(kind, field) {
|
|
1092
|
+
const types = kind?.fields.types;
|
|
1093
|
+
if (!types || !hasOwn(types, field))
|
|
1094
|
+
return false;
|
|
1095
|
+
return types[field] === "string-list" || types[field] === "https-url-list";
|
|
1096
|
+
}
|
|
1097
|
+
const NUMBER_INPUT_RE = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
1098
|
+
const INTEGER_INPUT_RE = /^[+-]?\d+$/;
|
|
1099
|
+
/**
|
|
1100
|
+
* Convert command-line flag text for a declared field into its typed value: numeric types become
|
|
1101
|
+
* numbers, `boolean` accepts exactly `true`/`false`, and both list types are always a list. Text that
|
|
1102
|
+
* does not parse is returned unchanged so {@link validateAgainstKind} reports it, never guessed.
|
|
1103
|
+
* Undeclared or untyped fields keep the historical one-value-scalar, repeated-flag-list shape.
|
|
1104
|
+
*/
|
|
1105
|
+
export function kindFieldInputValue(kind, field, inputs) {
|
|
1106
|
+
const type = kind.fields.types && hasOwn(kind.fields.types, field) ? kind.fields.types[field] : undefined;
|
|
1107
|
+
if (type === "string-list" || type === "https-url-list")
|
|
1108
|
+
return [...inputs];
|
|
1109
|
+
if (inputs.length !== 1)
|
|
1110
|
+
return [...inputs];
|
|
1111
|
+
const text = inputs[0];
|
|
1112
|
+
switch (type) {
|
|
1113
|
+
case "number":
|
|
1114
|
+
case "latitude":
|
|
1115
|
+
case "longitude":
|
|
1116
|
+
return NUMBER_INPUT_RE.test(text.trim()) ? Number(text.trim()) : text;
|
|
1117
|
+
case "integer":
|
|
1118
|
+
return INTEGER_INPUT_RE.test(text.trim()) ? Number(text.trim()) : text;
|
|
1119
|
+
case "boolean":
|
|
1120
|
+
return text === "true" ? true : text === "false" ? false : text;
|
|
1121
|
+
default:
|
|
1122
|
+
return text;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
829
1125
|
/**
|
|
830
1126
|
* Validate `doc` against `kind`: required fields present + non-empty, enum-restricted
|
|
831
|
-
* field values within the declared allowed set,
|
|
1127
|
+
* field values within the declared allowed set, typed field values of their declared
|
|
1128
|
+
* `fields.types` type, and declared body `sections` present
|
|
832
1129
|
* (reusing the ONE heading splitter, {@link splitSections} — no second heading parser).
|
|
833
1130
|
* Returns core's EXISTING {@link ValidationWarning} shape; never throws. Purely
|
|
834
1131
|
* additive derivation — callers (the CLI) decide whether a warning blocks a write.
|
|
@@ -840,7 +1137,7 @@ export function validateAgainstKind(doc, kind) {
|
|
|
840
1137
|
if (!hasOwn(fm, field) || !isPresent(fm[field])) {
|
|
841
1138
|
warnings.push({
|
|
842
1139
|
code: "KIND_FIELD_MISSING",
|
|
843
|
-
message:
|
|
1140
|
+
message: kindFieldWarningPrefix("KIND_FIELD_MISSING", kind, field) + `(declared by ${kind.id}).`,
|
|
844
1141
|
field,
|
|
845
1142
|
severity: "warning",
|
|
846
1143
|
});
|
|
@@ -861,10 +1158,11 @@ export function validateAgainstKind(doc, kind) {
|
|
|
861
1158
|
// validation locus, every consumer inherits: `new`, `doc update`, `doc write
|
|
862
1159
|
// --strict`, `status`'s bundle lint). A future kind wanting a multi-select enum
|
|
863
1160
|
// needs declared arity in the convention schema — not silently via arrays.
|
|
864
|
-
|
|
1161
|
+
// A `string-list` field declares its arity, so its enum checks each item instead.
|
|
1162
|
+
if (Array.isArray(raw) && kind.fields.types?.[field] !== "string-list") {
|
|
865
1163
|
warnings.push({
|
|
866
1164
|
code: "KIND_FIELD_ARITY",
|
|
867
|
-
message:
|
|
1165
|
+
message: kindFieldWarningPrefix("KIND_FIELD_ARITY", kind, field) +
|
|
868
1166
|
`got ${raw.length} (${raw.map((v) => String(v)).join(", ")}).`,
|
|
869
1167
|
field,
|
|
870
1168
|
severity: "warning",
|
|
@@ -876,13 +1174,30 @@ export function validateAgainstKind(doc, kind) {
|
|
|
876
1174
|
if (!allowedStrs.includes(v)) {
|
|
877
1175
|
warnings.push({
|
|
878
1176
|
code: "KIND_FIELD_VALUE",
|
|
879
|
-
message:
|
|
1177
|
+
message: kindFieldWarningPrefix("KIND_FIELD_VALUE", kind, field) + `'${v}' is not one of the allowed values for '${kind.governs}': ${allowedStrs.join(", ")}.`,
|
|
880
1178
|
field,
|
|
881
1179
|
severity: "warning",
|
|
882
1180
|
});
|
|
883
1181
|
}
|
|
884
1182
|
}
|
|
885
1183
|
}
|
|
1184
|
+
for (const [field, type] of Object.entries(kind.fields.types ?? {})) {
|
|
1185
|
+
if (!hasOwn(fm, field))
|
|
1186
|
+
continue;
|
|
1187
|
+
const raw = fm[field];
|
|
1188
|
+
// An absent field is presence, owned by `fields.required`; an explicit `null` is a wrong type.
|
|
1189
|
+
if (raw === undefined)
|
|
1190
|
+
continue;
|
|
1191
|
+
const problem = kindFieldTypeProblem(type, raw);
|
|
1192
|
+
if (problem !== undefined) {
|
|
1193
|
+
warnings.push({
|
|
1194
|
+
code: "KIND_FIELD_TYPE",
|
|
1195
|
+
message: kindFieldWarningPrefix("KIND_FIELD_TYPE", kind, field) + `${KIND_FIELD_TYPE_DESCRIPTIONS[type]} for '${kind.governs}'; ${problem}.`,
|
|
1196
|
+
field,
|
|
1197
|
+
severity: "warning",
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
886
1201
|
if (kind.sections && kind.sections.length > 0) {
|
|
887
1202
|
const sections = splitSections(doc.body ?? "");
|
|
888
1203
|
for (const heading of kind.sections) {
|
|
@@ -974,6 +1289,9 @@ export function kindConventionDoc(kind, prose, timestamp) {
|
|
|
974
1289
|
.map(([field, description]) => [field, description.trim()]));
|
|
975
1290
|
if (Object.keys(descriptions).length > 0)
|
|
976
1291
|
fields.descriptions = descriptions;
|
|
1292
|
+
const types = Object.fromEntries(Object.entries(kind.fields.types ?? {}).filter(([, type]) => isKindFieldType(type)));
|
|
1293
|
+
if (Object.keys(types).length > 0)
|
|
1294
|
+
fields.types = types;
|
|
977
1295
|
const frontmatter = { type: CONVENTION_TYPE, title: kind.title, governs: kind.governs, timestamp };
|
|
978
1296
|
if (typeof kind.description === "string" && kind.description.trim() !== "") {
|
|
979
1297
|
frontmatter.description = kind.description.trim();
|
|
@@ -1009,6 +1327,8 @@ export function kindConventionDoc(kind, prose, timestamp) {
|
|
|
1009
1327
|
frontmatter.freshness_horizon = kind.freshnessHorizon;
|
|
1010
1328
|
if (kind.browseCollapsed)
|
|
1011
1329
|
frontmatter.browse_collapsed = true;
|
|
1330
|
+
if (typeof kind.order === "number" && Number.isFinite(kind.order))
|
|
1331
|
+
frontmatter.order = kind.order;
|
|
1012
1332
|
return { id: kind.id, frontmatter, body: prose };
|
|
1013
1333
|
}
|
|
1014
1334
|
//# sourceMappingURL=kinds.js.map
|