@superbee/core 0.2.0-pre.3 → 0.2.0-pre.31
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 +1084 -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/recipe-set-preflight.d.ts +139 -0
- package/dist/recipe-set-preflight.d.ts.map +1 -0
- package/dist/recipe-set-preflight.js +536 -0
- package/dist/recipe-set-preflight.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 +107 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-aliases.d.ts","sourceRoot":"","sources":["../../src/recipe-lifecycle/legacy-aliases.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAE7C,8CAA8C;AAC9C,eAAO,MAAO,cAAc,QAAmB,CAAC;AAEhD,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CAInE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI3D;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGvE;AAED;+FAC+F;AAC/F,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAMxF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// ── Legacy-alias awareness (plans/rename-page-kind-to-view, Option C+) ────────────────────────
|
|
2
|
+
// A renamed recipe keeps its id/version but renames its artifact ids (views-registry//views/ over
|
|
3
|
+
// the legacy pages-registry//pages/). Idempotency here is per-artifact expect-absent CAS, so
|
|
4
|
+
// REAPPLYING the renamed recipe onto a bundle that installed the legacy edition would otherwise
|
|
5
|
+
// create a complete SECOND set — two identical launcher cards once that bundle is migrated in
|
|
6
|
+
// place (migration keeps legacy LOCATIONS; only names change). The legacy install SATISFIES the
|
|
7
|
+
// requirement: before creating an artifact, probe its legacy-alias counterpart — the location
|
|
8
|
+
// half derived from CORE's legacy prefix constants, the retired kind name from the frozen literal
|
|
9
|
+
// below (post-removal it is deliberately absent from the live grammar) — and skip
|
|
10
|
+
// creation when the counterpart exists, reporting `legacy_present` in the receipt. An UNMIGRATED
|
|
11
|
+
// legacy install also satisfies the probe: its docs no longer register, but the remedy is the
|
|
12
|
+
// migration script (which fixes them in place, flagged loudly by `status`), never a duplicate
|
|
13
|
+
// install. General by construction: any recipe whose artifacts ride the renamed prefixes or
|
|
14
|
+
// govern the View kind benefits; for every other recipe each probe derives null and nothing
|
|
15
|
+
// changes.
|
|
16
|
+
import { query } from "../bundle-ops.js";
|
|
17
|
+
import { CONVENTIONS_PREFIX } from "../kinds.js";
|
|
18
|
+
import { PAGE_ENTRY_PREFIX, PAGE_REGISTRY_PREFIX, PAGE_TYPE_NAMES, VIEW_ENTRY_PREFIX, VIEW_REGISTRY_PREFIX, } from "../page.js";
|
|
19
|
+
/**
|
|
20
|
+
* The retired legacy kind name, frozen as a historical fact. Internal to the recipe lifecycle and
|
|
21
|
+
* not part of its public API; the CLI's diagnostics keep their own frozen copy, and
|
|
22
|
+
* `legacy-constants-tripwire.test.ts` pins the two equal.
|
|
23
|
+
*/
|
|
24
|
+
export const RETIRED_PAGE_TYPE_NAME = "Page";
|
|
25
|
+
/** Core's one accepted kind name (`View`). */
|
|
26
|
+
export const [VIEW_KIND_NAME] = PAGE_TYPE_NAMES;
|
|
27
|
+
export function legacyRegistryAlias(id) {
|
|
28
|
+
return id.startsWith(VIEW_REGISTRY_PREFIX)
|
|
29
|
+
? `${PAGE_REGISTRY_PREFIX}${id.slice(VIEW_REGISTRY_PREFIX.length)}`
|
|
30
|
+
: null;
|
|
31
|
+
}
|
|
32
|
+
export function legacyEntryAlias(key) {
|
|
33
|
+
return key.startsWith(VIEW_ENTRY_PREFIX)
|
|
34
|
+
? `${PAGE_ENTRY_PREFIX}${key.slice(VIEW_ENTRY_PREFIX.length)}`
|
|
35
|
+
: null;
|
|
36
|
+
}
|
|
37
|
+
export function governsKind(doc, kindName) {
|
|
38
|
+
const governs = doc.frontmatter["governs"];
|
|
39
|
+
return typeof governs === "string" && governs.trim() === kindName;
|
|
40
|
+
}
|
|
41
|
+
/** The id of an existing convention doc governing the LEGACY kind name, or null. Called at most
|
|
42
|
+
* once per apply, and only when the recipe carries a convention governing the current name. */
|
|
43
|
+
export async function findLegacyViewConvention(bundle) {
|
|
44
|
+
const conventions = await query(bundle, { prefix: CONVENTIONS_PREFIX, type: "Convention" });
|
|
45
|
+
for (const doc of conventions) {
|
|
46
|
+
if (governsKind(doc, RETIRED_PAGE_TYPE_NAME))
|
|
47
|
+
return doc.id;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=legacy-aliases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-aliases.js","sourceRoot":"","sources":["../../src/recipe-lifecycle/legacy-aliases.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,kGAAkG;AAClG,6FAA6F;AAC7F,gGAAgG;AAChG,8FAA8F;AAC9F,gGAAgG;AAChG,8FAA8F;AAC9F,kGAAkG;AAClG,kFAAkF;AAClF,iGAAiG;AACjG,8FAA8F;AAC9F,8FAA8F;AAC9F,4FAA4F;AAC5F,4FAA4F;AAC5F,WAAW;AACX,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,eAA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d,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { LoadedRecipe } from "../recipes.js";
|
|
2
|
+
import type { ConceptId, OkfDocument } from "../types.js";
|
|
3
|
+
/** The frontmatter key that carries a convention's recipe stamp. */
|
|
4
|
+
export declare const RECIPE_STAMP_KEY = "x_recipe";
|
|
5
|
+
/** The version of the digest rules this release writes and reads. */
|
|
6
|
+
export declare const DEFINITION_DIGEST_RULES = 1;
|
|
7
|
+
/** One convention's (or Connector's) record of the recipe that last wrote it. */
|
|
8
|
+
export interface RecipeStamp {
|
|
9
|
+
id: string;
|
|
10
|
+
version: string;
|
|
11
|
+
/** How many conventions the recipe declares. */
|
|
12
|
+
of: number;
|
|
13
|
+
/**
|
|
14
|
+
* How many Connectors the recipe declares; written only by a recipe that carries connectors, so
|
|
15
|
+
* a reader that predates the key ignores it and every other stamp keeps its bytes.
|
|
16
|
+
*/
|
|
17
|
+
connectors?: number;
|
|
18
|
+
/** {@link recipeSourceDigest} of the recipe that wrote the convention. */
|
|
19
|
+
source_digest: string;
|
|
20
|
+
/** {@link definitionDigest} of the convention as that recipe wrote it. */
|
|
21
|
+
definition: string;
|
|
22
|
+
/** The rules version that produced `definition`. */
|
|
23
|
+
digest_rules: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* How an existing convention's stamp relates to a recipe: `current` (this recipe's id, version,
|
|
27
|
+
* declared count and source digest), `stale` (this recipe's id, anything else different),
|
|
28
|
+
* `foreign` (another recipe's id) or `missing` (no well-formed stamp, or no convention).
|
|
29
|
+
*/
|
|
30
|
+
export type RecipeStampState = "current" | "stale" | "foreign" | "missing";
|
|
31
|
+
/** One stamped convention: unchanged since its recipe wrote it, changed, or unreadable rules. */
|
|
32
|
+
export type ConventionStampState = "current" | "diverged" | "unknown";
|
|
33
|
+
/** One recipe's state across the conventions that carry its stamp. */
|
|
34
|
+
export type RecipeInstallState = "installed" | "partial" | "diverged" | "unknown";
|
|
35
|
+
export interface InstalledRecipeRow {
|
|
36
|
+
id: string;
|
|
37
|
+
state: RecipeInstallState;
|
|
38
|
+
version: string | null;
|
|
39
|
+
source_digest: string | null;
|
|
40
|
+
/** How many conventions carry this recipe's stamp. */
|
|
41
|
+
conventions: number;
|
|
42
|
+
of: number | null;
|
|
43
|
+
convention_ids: ConceptId[];
|
|
44
|
+
/** Present for a recipe that carries connectors: how many Connectors carry its stamp. */
|
|
45
|
+
connectors?: number;
|
|
46
|
+
/** The declared Connector count the stamps record (the stamp's `connectors`). */
|
|
47
|
+
connectors_of?: number | null;
|
|
48
|
+
connector_ids?: ConceptId[];
|
|
49
|
+
records?: Array<{
|
|
50
|
+
version: string;
|
|
51
|
+
source_digest: string;
|
|
52
|
+
conventions: number;
|
|
53
|
+
connectors?: number;
|
|
54
|
+
}>;
|
|
55
|
+
missing?: number;
|
|
56
|
+
missing_ids?: ConceptId[];
|
|
57
|
+
diverged?: ConceptId[];
|
|
58
|
+
unknown_rules?: ConceptId[];
|
|
59
|
+
/** Retained Convention/Connector ids absent from an explicitly supplied known recipe. */
|
|
60
|
+
orphaned_ids?: ConceptId[];
|
|
61
|
+
}
|
|
62
|
+
/** The recipe-level facts every stamp a recipe writes shares; `definition` is per document. */
|
|
63
|
+
export interface RecipeStampIdentity {
|
|
64
|
+
id: string;
|
|
65
|
+
version: string;
|
|
66
|
+
of: number;
|
|
67
|
+
/** Present exactly when the recipe carries connectors. */
|
|
68
|
+
connectors?: number;
|
|
69
|
+
source_digest: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* JSON with object keys sorted at every depth, `Date` values as ISO strings and `undefined`
|
|
73
|
+
* members omitted, so equal values hash equally whatever their key order or YAML spelling.
|
|
74
|
+
*/
|
|
75
|
+
declare function canonicalJson(value: unknown): string;
|
|
76
|
+
/**
|
|
77
|
+
* The definitions-digest canon, for core's other definitions digest (the Connector pin). Named apart
|
|
78
|
+
* from `site-capabilities`' canonical JSON, whose semantics differ; the subpath entry does not
|
|
79
|
+
* re-export it.
|
|
80
|
+
*/
|
|
81
|
+
export { canonicalJson as definitionCanonicalJson };
|
|
82
|
+
/**
|
|
83
|
+
* Digest of a recipe's parsed content, taken before edition materialization: its id, version,
|
|
84
|
+
* conventions, View pairs, References and (only when it carries any) Connectors, each sorted by id,
|
|
85
|
+
* bodies with CRLF read as LF. Equal across editions, independent of how the recipe was acquired,
|
|
86
|
+
* and blind to README files. A recipe without connectors digests exactly as it did before
|
|
87
|
+
* connectors existed, so every stamp written earlier stays current.
|
|
88
|
+
*/
|
|
89
|
+
export declare function recipeSourceDigest(recipe: LoadedRecipe): string;
|
|
90
|
+
/** The body canon shared by definition stamps and recipe content comparisons; never a storage rewrite. */
|
|
91
|
+
export declare function normalizeDefinitionBody(body: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* Digest of a convention as written, rules version 1: its frontmatter without the stripped keys
|
|
94
|
+
* and its body with CRLF read as LF and the storage newline applied. The digest of a candidate
|
|
95
|
+
* before the write equals the digest of the document read back from any backend.
|
|
96
|
+
*/
|
|
97
|
+
export declare function definitionDigest(doc: Pick<OkfDocument, "frontmatter" | "body">): string;
|
|
98
|
+
/**
|
|
99
|
+
* The document's stamp, or null unless it is a mapping whose every required field has its type.
|
|
100
|
+
* The optional `connectors` count is kept when it is a non-negative integer and otherwise read as
|
|
101
|
+
* absent.
|
|
102
|
+
*/
|
|
103
|
+
export declare function readRecipeStamp(doc: Pick<OkfDocument, "frontmatter">): RecipeStamp | null;
|
|
104
|
+
/** The recipe-level stamp facts for `recipe`; `materialized` supplies the declared count. */
|
|
105
|
+
export declare function recipeStampIdentity(recipe: LoadedRecipe, materialized: LoadedRecipe): RecipeStampIdentity;
|
|
106
|
+
/** `doc` with its stamp replaced by this recipe's, whose `definition` is the digest of `doc`. */
|
|
107
|
+
export declare function withRecipeStamp<T extends Pick<OkfDocument, "frontmatter" | "body">>(doc: T, identity: RecipeStampIdentity): T;
|
|
108
|
+
/**
|
|
109
|
+
* How the stamp on `doc` (null: no document) relates to the recipe `identity` describes. The
|
|
110
|
+
* Connector count must match too: for a recipe that carries connectors a stamp without it is
|
|
111
|
+
* `stale`, and since no release writes the key for a recipe without connectors, every stamp such a
|
|
112
|
+
* recipe wrote reads as it did before the key existed.
|
|
113
|
+
*/
|
|
114
|
+
export declare function recipeStampState(doc: Pick<OkfDocument, "frontmatter"> | null, identity: RecipeStampIdentity): RecipeStampState;
|
|
115
|
+
/** The worst of `states` in the order current, stale, foreign, missing; `current` when empty. */
|
|
116
|
+
export declare function worstRecipeStampState(states: Iterable<RecipeStampState>): RecipeStampState;
|
|
117
|
+
/** One stamped document's state: rules this release reads, and whether its digest still matches. */
|
|
118
|
+
export declare function conventionStampState(doc: Pick<OkfDocument, "frontmatter" | "body">): ConventionStampState;
|
|
119
|
+
/** A retained stamped definition absent from the explicitly selected recipe's declarations. */
|
|
120
|
+
export interface RecipeOrphanedDefinition {
|
|
121
|
+
id: ConceptId;
|
|
122
|
+
type: "Convention" | "Connector" | "Reference";
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Read-only ownership reporting, not a digest proof or removal authority. Even unknown digest
|
|
126
|
+
* rules and locally changed documents retain their recorded recipe id. An unreadable stamp does
|
|
127
|
+
* not prove ownership. The caller must supply the recipe whose declarations are being compared.
|
|
128
|
+
*/
|
|
129
|
+
export declare function recipeOrphanedDefinitions(docs: Iterable<OkfDocument>, recipe: LoadedRecipe): RecipeOrphanedDefinition[];
|
|
130
|
+
/**
|
|
131
|
+
* Each recipe's install state, derived from the stamps on `docs` (conventions, and Connector
|
|
132
|
+
* documents under `connectors/`; documents of any other type are ignored), and the documents no
|
|
133
|
+
* recipe stamped. `known` recipes (their declared ids are visible to the caller) also report a
|
|
134
|
+
* declared id that does not carry their stamp, and get a row when an unstamped convention that
|
|
135
|
+
* declares something, or an unstamped Connector, sits at one of their ids: a bundle written before
|
|
136
|
+
* stamps. A declined Kind (a declaration-free record) or another recipe's stamp at their ids alone
|
|
137
|
+
* is no evidence they were installed.
|
|
138
|
+
*
|
|
139
|
+
* States, the first match winning: `unknown` when no document carries the recipe's stamp;
|
|
140
|
+
* `partial` when the stamps record more than one version or source digest, disagree on a declared
|
|
141
|
+
* count, fall short of the convention or Connector count, or (known recipes) a declared id is
|
|
142
|
+
* present without this recipe's stamp; `diverged` when a stamped document changed since the recipe
|
|
143
|
+
* wrote it; `unknown` when a stamp uses digest rules this release does not read; otherwise
|
|
144
|
+
* `installed`. A row carries the Connector keys only for a recipe whose stamps record connectors,
|
|
145
|
+
* so every other row reads as it did before connectors existed.
|
|
146
|
+
*/
|
|
147
|
+
export declare function installedRecipes(docs: Iterable<OkfDocument>, known?: readonly LoadedRecipe[]): {
|
|
148
|
+
rows: InstalledRecipeRow[];
|
|
149
|
+
unstamped: ConceptId[];
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=stamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stamp.d.ts","sourceRoot":"","sources":["../../src/recipe-lifecycle/stamp.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1D,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,M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AG,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,GAAG,MAAM,CAAC,GAAG,oBAAoB,CAIzG;AAYD,+FAA+F;AAC/F,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,SAAS,CAAC;IACd,IAAI,EAAE,YAAY,GAAG,WAAW,GAAG,WAAW,CAAC;CAChD;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC3B,MAAM,EAAE,YAAY,GACnB,wBAAwB,EAAE,CAiB5B;AAQD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC3B,KAAK,GAAE,SAAS,YAAY,EAAO,GAClC;IAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAAC,SAAS,EAAE,SAAS,EAAE,CAAA;CAAE,CA6GxD"}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
// Recipe install stamps. Every convention, Connector and Reference a recipe installs or evolves carries one
|
|
2
|
+
// `x_recipe` record, written in the same compare-and-swap write as the document, so the stamp
|
|
3
|
+
// exists exactly when the document does. A stamp holds only deterministic facts: two clones that apply
|
|
4
|
+
// the same evolve write identical stamps. The install-state read side derives convention/Connector state from their
|
|
5
|
+
// stamps alone, without the recipe source; References have separate evolution rows. Storage-neutral: no Node globals or builtins.
|
|
6
|
+
import { CONNECTOR_TYPE, CONNECTORS_PREFIX } from "../connectors.js";
|
|
7
|
+
import { normalizeDocumentBodyForStorage } from "../frontmatter.js";
|
|
8
|
+
import { CONVENTION_TYPE, CONVENTIONS_PREFIX } from "../kinds.js";
|
|
9
|
+
import { sha256Hex } from "../versioning.js";
|
|
10
|
+
/** The frontmatter key that carries a convention's recipe stamp. */
|
|
11
|
+
export const RECIPE_STAMP_KEY = "x_recipe";
|
|
12
|
+
/** The version of the digest rules this release writes and reads. */
|
|
13
|
+
export const DEFINITION_DIGEST_RULES = 1;
|
|
14
|
+
/**
|
|
15
|
+
* Keys rules version 1 leaves out of a definition digest: the stamp itself, the clocks and
|
|
16
|
+
* attribution the write policy maintains, the hosted managed fields, and bundle-local `order`.
|
|
17
|
+
*/
|
|
18
|
+
const DIGEST_STRIPPED_KEYS = [
|
|
19
|
+
RECIPE_STAMP_KEY,
|
|
20
|
+
"timestamp",
|
|
21
|
+
"actor",
|
|
22
|
+
"generated",
|
|
23
|
+
"verified",
|
|
24
|
+
"superbee_updated_by",
|
|
25
|
+
"okf_version",
|
|
26
|
+
"order",
|
|
27
|
+
];
|
|
28
|
+
const STAMP_STATE_SEVERITY = ["current", "stale", "foreign", "missing"];
|
|
29
|
+
function lf(text) {
|
|
30
|
+
return text.replaceAll("\r\n", "\n");
|
|
31
|
+
}
|
|
32
|
+
/** Code-unit order: the same on every platform and locale. */
|
|
33
|
+
function byCodeUnit(a, b) {
|
|
34
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* JSON with object keys sorted at every depth, `Date` values as ISO strings and `undefined`
|
|
38
|
+
* members omitted, so equal values hash equally whatever their key order or YAML spelling.
|
|
39
|
+
*/
|
|
40
|
+
function canonicalJson(value) {
|
|
41
|
+
if (value instanceof Date)
|
|
42
|
+
return JSON.stringify(value.toISOString());
|
|
43
|
+
if (value === null || typeof value !== "object")
|
|
44
|
+
return JSON.stringify(value) ?? "null";
|
|
45
|
+
if (Array.isArray(value))
|
|
46
|
+
return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
|
|
47
|
+
const record = value;
|
|
48
|
+
return `{${Object.keys(record)
|
|
49
|
+
.filter((key) => record[key] !== undefined)
|
|
50
|
+
.sort(byCodeUnit)
|
|
51
|
+
.map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`)
|
|
52
|
+
.join(",")}}`;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The definitions-digest canon, for core's other definitions digest (the Connector pin). Named apart
|
|
56
|
+
* from `site-capabilities`' canonical JSON, whose semantics differ; the subpath entry does not
|
|
57
|
+
* re-export it.
|
|
58
|
+
*/
|
|
59
|
+
export { canonicalJson as definitionCanonicalJson };
|
|
60
|
+
function digest(value) {
|
|
61
|
+
return `sha256:${sha256Hex(canonicalJson(value))}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Digest of a recipe's parsed content, taken before edition materialization: its id, version,
|
|
65
|
+
* conventions, View pairs, References and (only when it carries any) Connectors, each sorted by id,
|
|
66
|
+
* bodies with CRLF read as LF. Equal across editions, independent of how the recipe was acquired,
|
|
67
|
+
* and blind to README files. A recipe without connectors digests exactly as it did before
|
|
68
|
+
* connectors existed, so every stamp written earlier stays current.
|
|
69
|
+
*/
|
|
70
|
+
export function recipeSourceDigest(recipe) {
|
|
71
|
+
const docs = [...recipe.docs]
|
|
72
|
+
.sort((a, b) => byCodeUnit(a.id, b.id))
|
|
73
|
+
.map((doc) => [doc.id, doc.frontmatter, lf(doc.body)]);
|
|
74
|
+
const pages = [...recipe.pages]
|
|
75
|
+
.sort((a, b) => byCodeUnit(a.registry.id, b.registry.id))
|
|
76
|
+
.map((page) => [page.registry.id, page.registry.frontmatter, lf(page.registry.body), page.entry, lf(page.html)]);
|
|
77
|
+
const references = [...recipe.references]
|
|
78
|
+
.sort((a, b) => byCodeUnit(a.doc.id, b.doc.id))
|
|
79
|
+
.map((reference) => [reference.doc.id, reference.doc.frontmatter, lf(reference.doc.body)]);
|
|
80
|
+
const connectors = [...(recipe.connectors ?? [])]
|
|
81
|
+
.sort((a, b) => byCodeUnit(a.doc.id, b.doc.id))
|
|
82
|
+
.map((connector) => [connector.doc.id, connector.doc.frontmatter, lf(connector.doc.body)]);
|
|
83
|
+
return digest({
|
|
84
|
+
id: recipe.id,
|
|
85
|
+
version: recipe.version,
|
|
86
|
+
docs,
|
|
87
|
+
pages,
|
|
88
|
+
references,
|
|
89
|
+
...(connectors.length > 0 ? { connectors } : {}),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** The body canon shared by definition stamps and recipe content comparisons; never a storage rewrite. */
|
|
93
|
+
export function normalizeDefinitionBody(body) {
|
|
94
|
+
return normalizeDocumentBodyForStorage(lf(body));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Digest of a convention as written, rules version 1: its frontmatter without the stripped keys
|
|
98
|
+
* and its body with CRLF read as LF and the storage newline applied. The digest of a candidate
|
|
99
|
+
* before the write equals the digest of the document read back from any backend.
|
|
100
|
+
*/
|
|
101
|
+
export function definitionDigest(doc) {
|
|
102
|
+
const frontmatter = { ...doc.frontmatter };
|
|
103
|
+
for (const key of DIGEST_STRIPPED_KEYS)
|
|
104
|
+
delete frontmatter[key];
|
|
105
|
+
return digest({ frontmatter, body: normalizeDefinitionBody(doc.body ?? "") });
|
|
106
|
+
}
|
|
107
|
+
function nonNegativeInteger(value) {
|
|
108
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The document's stamp, or null unless it is a mapping whose every required field has its type.
|
|
112
|
+
* The optional `connectors` count is kept when it is a non-negative integer and otherwise read as
|
|
113
|
+
* absent.
|
|
114
|
+
*/
|
|
115
|
+
export function readRecipeStamp(doc) {
|
|
116
|
+
const value = doc.frontmatter[RECIPE_STAMP_KEY];
|
|
117
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
118
|
+
return null;
|
|
119
|
+
const stamp = value;
|
|
120
|
+
if (typeof stamp.id !== "string" || stamp.id === ""
|
|
121
|
+
|| typeof stamp.version !== "string"
|
|
122
|
+
|| !nonNegativeInteger(stamp.of)
|
|
123
|
+
|| typeof stamp.source_digest !== "string"
|
|
124
|
+
|| typeof stamp.definition !== "string"
|
|
125
|
+
|| !nonNegativeInteger(stamp.digest_rules) || stamp.digest_rules === 0)
|
|
126
|
+
return null;
|
|
127
|
+
return {
|
|
128
|
+
id: stamp.id,
|
|
129
|
+
version: stamp.version,
|
|
130
|
+
of: stamp.of,
|
|
131
|
+
...(nonNegativeInteger(stamp.connectors) ? { connectors: stamp.connectors } : {}),
|
|
132
|
+
source_digest: stamp.source_digest,
|
|
133
|
+
definition: stamp.definition,
|
|
134
|
+
digest_rules: stamp.digest_rules,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/** The recipe-level stamp facts for `recipe`; `materialized` supplies the declared count. */
|
|
138
|
+
export function recipeStampIdentity(recipe, materialized) {
|
|
139
|
+
const connectors = (recipe.connectors ?? []).length;
|
|
140
|
+
return {
|
|
141
|
+
id: recipe.id,
|
|
142
|
+
version: recipe.version,
|
|
143
|
+
of: materialized.docs.length,
|
|
144
|
+
...(connectors > 0 ? { connectors } : {}),
|
|
145
|
+
source_digest: recipeSourceDigest(recipe),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/** `doc` with its stamp replaced by this recipe's, whose `definition` is the digest of `doc`. */
|
|
149
|
+
export function withRecipeStamp(doc, identity) {
|
|
150
|
+
const { [RECIPE_STAMP_KEY]: _previous, ...frontmatter } = doc.frontmatter;
|
|
151
|
+
const stamp = {
|
|
152
|
+
id: identity.id,
|
|
153
|
+
version: identity.version,
|
|
154
|
+
of: identity.of,
|
|
155
|
+
...(identity.connectors !== undefined ? { connectors: identity.connectors } : {}),
|
|
156
|
+
source_digest: identity.source_digest,
|
|
157
|
+
definition: definitionDigest({ frontmatter: frontmatter, body: doc.body }),
|
|
158
|
+
digest_rules: DEFINITION_DIGEST_RULES,
|
|
159
|
+
};
|
|
160
|
+
return { ...doc, frontmatter: { ...frontmatter, [RECIPE_STAMP_KEY]: stamp } };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* How the stamp on `doc` (null: no document) relates to the recipe `identity` describes. The
|
|
164
|
+
* Connector count must match too: for a recipe that carries connectors a stamp without it is
|
|
165
|
+
* `stale`, and since no release writes the key for a recipe without connectors, every stamp such a
|
|
166
|
+
* recipe wrote reads as it did before the key existed.
|
|
167
|
+
*/
|
|
168
|
+
export function recipeStampState(doc, identity) {
|
|
169
|
+
const stamp = doc === null ? null : readRecipeStamp(doc);
|
|
170
|
+
if (stamp === null)
|
|
171
|
+
return "missing";
|
|
172
|
+
if (stamp.id !== identity.id)
|
|
173
|
+
return "foreign";
|
|
174
|
+
return stamp.version === identity.version
|
|
175
|
+
&& stamp.of === identity.of
|
|
176
|
+
&& stamp.source_digest === identity.source_digest
|
|
177
|
+
&& stamp.connectors === identity.connectors
|
|
178
|
+
? "current"
|
|
179
|
+
: "stale";
|
|
180
|
+
}
|
|
181
|
+
/** The worst of `states` in the order current, stale, foreign, missing; `current` when empty. */
|
|
182
|
+
export function worstRecipeStampState(states) {
|
|
183
|
+
let worst = 0;
|
|
184
|
+
for (const state of states)
|
|
185
|
+
worst = Math.max(worst, STAMP_STATE_SEVERITY.indexOf(state));
|
|
186
|
+
return STAMP_STATE_SEVERITY[worst];
|
|
187
|
+
}
|
|
188
|
+
/** One stamped document's state: rules this release reads, and whether its digest still matches. */
|
|
189
|
+
export function conventionStampState(doc) {
|
|
190
|
+
const stamp = readRecipeStamp(doc);
|
|
191
|
+
if (stamp === null || stamp.digest_rules !== DEFINITION_DIGEST_RULES)
|
|
192
|
+
return "unknown";
|
|
193
|
+
return definitionDigest(doc) === stamp.definition ? "current" : "diverged";
|
|
194
|
+
}
|
|
195
|
+
/** A convention that declares nothing a recipe would own: what `kind dismiss` writes. */
|
|
196
|
+
function declarationFree(doc) {
|
|
197
|
+
return !["fields", "sections", "links", "expects_inbound"].some((key) => Object.hasOwn(doc.frontmatter, key));
|
|
198
|
+
}
|
|
199
|
+
/** A Connector declaration: the type core's connector parser owns, at the one place it reads it. */
|
|
200
|
+
function isConnectorDoc(doc) {
|
|
201
|
+
return doc.frontmatter.type === CONNECTOR_TYPE && doc.id.startsWith(CONNECTORS_PREFIX);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Read-only ownership reporting, not a digest proof or removal authority. Even unknown digest
|
|
205
|
+
* rules and locally changed documents retain their recorded recipe id. An unreadable stamp does
|
|
206
|
+
* not prove ownership. The caller must supply the recipe whose declarations are being compared.
|
|
207
|
+
*/
|
|
208
|
+
export function recipeOrphanedDefinitions(docs, recipe) {
|
|
209
|
+
const declared = new Map([
|
|
210
|
+
["Convention", new Set(recipe.docs.map(doc => doc.id))],
|
|
211
|
+
["Connector", new Set((recipe.connectors ?? []).map(connector => connector.doc.id))],
|
|
212
|
+
["Reference", new Set(recipe.references.map(reference => reference.doc.id))],
|
|
213
|
+
]);
|
|
214
|
+
const orphans = [];
|
|
215
|
+
for (const doc of docs) {
|
|
216
|
+
let definitionType;
|
|
217
|
+
if (doc.frontmatter.type === CONVENTION_TYPE && doc.id.startsWith(CONVENTIONS_PREFIX))
|
|
218
|
+
definitionType = "Convention";
|
|
219
|
+
else if (isConnectorDoc(doc))
|
|
220
|
+
definitionType = "Connector";
|
|
221
|
+
else if (doc.frontmatter.type === "Reference" && doc.id.startsWith("references/"))
|
|
222
|
+
definitionType = "Reference";
|
|
223
|
+
else
|
|
224
|
+
continue;
|
|
225
|
+
if (readRecipeStamp(doc)?.id !== recipe.id)
|
|
226
|
+
continue;
|
|
227
|
+
if (!declared.get(definitionType).has(doc.id))
|
|
228
|
+
orphans.push({ id: doc.id, type: definitionType });
|
|
229
|
+
}
|
|
230
|
+
return orphans.sort((a, b) => byCodeUnit(a.id, b.id) || byCodeUnit(a.type, b.type));
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Each recipe's install state, derived from the stamps on `docs` (conventions, and Connector
|
|
234
|
+
* documents under `connectors/`; documents of any other type are ignored), and the documents no
|
|
235
|
+
* recipe stamped. `known` recipes (their declared ids are visible to the caller) also report a
|
|
236
|
+
* declared id that does not carry their stamp, and get a row when an unstamped convention that
|
|
237
|
+
* declares something, or an unstamped Connector, sits at one of their ids: a bundle written before
|
|
238
|
+
* stamps. A declined Kind (a declaration-free record) or another recipe's stamp at their ids alone
|
|
239
|
+
* is no evidence they were installed.
|
|
240
|
+
*
|
|
241
|
+
* States, the first match winning: `unknown` when no document carries the recipe's stamp;
|
|
242
|
+
* `partial` when the stamps record more than one version or source digest, disagree on a declared
|
|
243
|
+
* count, fall short of the convention or Connector count, or (known recipes) a declared id is
|
|
244
|
+
* present without this recipe's stamp; `diverged` when a stamped document changed since the recipe
|
|
245
|
+
* wrote it; `unknown` when a stamp uses digest rules this release does not read; otherwise
|
|
246
|
+
* `installed`. A row carries the Connector keys only for a recipe whose stamps record connectors,
|
|
247
|
+
* so every other row reads as it did before connectors existed.
|
|
248
|
+
*/
|
|
249
|
+
export function installedRecipes(docs, known = []) {
|
|
250
|
+
const present = new Map();
|
|
251
|
+
const stampedByRecipe = new Map();
|
|
252
|
+
const unstamped = [];
|
|
253
|
+
for (const doc of docs) {
|
|
254
|
+
const connector = isConnectorDoc(doc);
|
|
255
|
+
if (doc.frontmatter.type !== CONVENTION_TYPE && !connector)
|
|
256
|
+
continue;
|
|
257
|
+
present.set(doc.id, doc);
|
|
258
|
+
const stamp = readRecipeStamp(doc);
|
|
259
|
+
if (stamp === null) {
|
|
260
|
+
if (connector || !declarationFree(doc))
|
|
261
|
+
unstamped.push(doc.id);
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
const group = stampedByRecipe.get(stamp.id) ?? [];
|
|
265
|
+
group.push({ doc, stamp, connector });
|
|
266
|
+
stampedByRecipe.set(stamp.id, group);
|
|
267
|
+
}
|
|
268
|
+
const knownById = new Map(known.map((recipe) => [recipe.id, recipe]));
|
|
269
|
+
const declaredDocs = (recipe) => [...recipe.docs, ...(recipe.connectors ?? []).map((connector) => connector.doc)];
|
|
270
|
+
const ids = new Set(stampedByRecipe.keys());
|
|
271
|
+
const unstampedIds = new Set(unstamped);
|
|
272
|
+
for (const recipe of known) {
|
|
273
|
+
if (declaredDocs(recipe).some((declared) => unstampedIds.has(declared.id)))
|
|
274
|
+
ids.add(recipe.id);
|
|
275
|
+
}
|
|
276
|
+
const rows = [...ids].sort(byCodeUnit).map((id) => {
|
|
277
|
+
const all = (stampedByRecipe.get(id) ?? []).sort((a, b) => byCodeUnit(a.doc.id, b.doc.id));
|
|
278
|
+
const stamped = all.filter((entry) => !entry.connector);
|
|
279
|
+
const stampedConnectors = all.filter((entry) => entry.connector);
|
|
280
|
+
const recipe = knownById.get(id);
|
|
281
|
+
const conventionIds = stamped.map(({ doc }) => doc.id);
|
|
282
|
+
const stampedIds = new Set(all.map(({ doc }) => doc.id));
|
|
283
|
+
const records = new Map();
|
|
284
|
+
for (const { stamp, connector } of all) {
|
|
285
|
+
const key = `${stamp.version}\u0000${stamp.source_digest}`;
|
|
286
|
+
const record = records.get(key) ?? { version: stamp.version, source_digest: stamp.source_digest, conventions: 0 };
|
|
287
|
+
if (connector)
|
|
288
|
+
record.connectors = (record.connectors ?? 0) + 1;
|
|
289
|
+
else
|
|
290
|
+
record.conventions += 1;
|
|
291
|
+
records.set(key, record);
|
|
292
|
+
}
|
|
293
|
+
const recordRows = [...records.values()].sort((a, b) => byCodeUnit(a.version, b.version) || byCodeUnit(a.source_digest, b.source_digest));
|
|
294
|
+
const declaredCounts = new Set(all.map(({ stamp }) => stamp.of));
|
|
295
|
+
const of = declaredCounts.size === 1 ? [...declaredCounts][0] : recipe ? recipe.docs.length : null;
|
|
296
|
+
// A stamp without the key records no connectors; a disagreement among stamps is partial.
|
|
297
|
+
const connectorCounts = new Set(all.map(({ stamp }) => stamp.connectors));
|
|
298
|
+
const declaredConnectors = recipe && (recipe.connectors ?? []).length > 0 ? recipe.connectors.length : undefined;
|
|
299
|
+
const connectorsOf = connectorCounts.size === 1
|
|
300
|
+
? [...connectorCounts][0]
|
|
301
|
+
: connectorCounts.size === 0 ? declaredConnectors : declaredConnectors ?? null;
|
|
302
|
+
const carriesConnectors = stampedConnectors.length > 0 || connectorsOf !== undefined;
|
|
303
|
+
const diverged = all.filter(({ doc }) => conventionStampState(doc) === "diverged").map(({ doc }) => doc.id);
|
|
304
|
+
const unknownRules = all.filter(({ stamp }) => stamp.digest_rules !== DEFINITION_DIGEST_RULES).map(({ doc }) => doc.id);
|
|
305
|
+
const declaredIds = recipe ? declaredDocs(recipe).map((doc) => doc.id).sort(byCodeUnit) : [];
|
|
306
|
+
const missingIds = declaredIds.filter((declared) => !stampedIds.has(declared));
|
|
307
|
+
const presentWithoutStamp = missingIds.filter((declared) => present.has(declared));
|
|
308
|
+
let state;
|
|
309
|
+
if (all.length === 0)
|
|
310
|
+
state = "unknown";
|
|
311
|
+
else if (recordRows.length > 1
|
|
312
|
+
|| declaredCounts.size > 1
|
|
313
|
+
|| connectorCounts.size > 1
|
|
314
|
+
|| stamped.length !== of
|
|
315
|
+
|| stampedConnectors.length !== (connectorsOf ?? 0)
|
|
316
|
+
|| presentWithoutStamp.length > 0
|
|
317
|
+
|| (recipe !== undefined && missingIds.length > 0))
|
|
318
|
+
state = "partial";
|
|
319
|
+
else if (diverged.length > 0)
|
|
320
|
+
state = "diverged";
|
|
321
|
+
else if (unknownRules.length > 0)
|
|
322
|
+
state = "unknown";
|
|
323
|
+
else
|
|
324
|
+
state = "installed";
|
|
325
|
+
const single = state === "installed" || state === "diverged" ? recordRows[0] : null;
|
|
326
|
+
const row = {
|
|
327
|
+
id,
|
|
328
|
+
state,
|
|
329
|
+
version: single?.version ?? null,
|
|
330
|
+
source_digest: single?.source_digest ?? null,
|
|
331
|
+
conventions: stamped.length,
|
|
332
|
+
of,
|
|
333
|
+
convention_ids: conventionIds,
|
|
334
|
+
};
|
|
335
|
+
if (carriesConnectors) {
|
|
336
|
+
row.connectors = stampedConnectors.length;
|
|
337
|
+
row.connectors_of = connectorsOf ?? null;
|
|
338
|
+
row.connector_ids = stampedConnectors.map(({ doc }) => doc.id);
|
|
339
|
+
}
|
|
340
|
+
if (state === "partial") {
|
|
341
|
+
row.records = recordRows;
|
|
342
|
+
const missing = recipe
|
|
343
|
+
? missingIds.length
|
|
344
|
+
: (of === null ? 0 : Math.max(0, of - stamped.length))
|
|
345
|
+
+ (typeof connectorsOf === "number" ? Math.max(0, connectorsOf - stampedConnectors.length) : 0);
|
|
346
|
+
if (missing > 0)
|
|
347
|
+
row.missing = missing;
|
|
348
|
+
if (recipe && missingIds.length > 0)
|
|
349
|
+
row.missing_ids = missingIds;
|
|
350
|
+
}
|
|
351
|
+
if (recipe) {
|
|
352
|
+
const orphaned = recipeOrphanedDefinitions(all.map(({ doc }) => doc), recipe).map(({ id }) => id);
|
|
353
|
+
if (orphaned.length > 0)
|
|
354
|
+
row.orphaned_ids = orphaned;
|
|
355
|
+
}
|
|
356
|
+
if (diverged.length > 0)
|
|
357
|
+
row.diverged = diverged;
|
|
358
|
+
if (unknownRules.length > 0)
|
|
359
|
+
row.unknown_rules = unknownRules;
|
|
360
|
+
return row;
|
|
361
|
+
});
|
|
362
|
+
return { rows, unstamped: unstamped.sort(byCodeUnit) };
|
|
363
|
+
}
|
|
364
|
+
//# sourceMappingURL=stamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stamp.js","sourceRoot":"","sources":["../../src/recipe-lifecycle/stamp.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,8FAA8F;AAC9F,uGAAuG;AACvG,oHAAoH;AACpH,kIAAkI;AAClI,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,oEAAoE;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE3C,qEAAqE;AACrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAmEzC;;;GAGG;AACH,MAAM,oBAAoB,GAAsB;IAC9C,gBAAgB;IAChB,WAAW;IACX,OAAO;IACP,WAAW;IAC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