@jini-ai/devops 0.7.3-next.2 → 0.7.4
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/CHANGELOG.md +7 -0
- package/README.md +16 -0
- package/dist/backup/site/archive-extensions.d.ts +73 -0
- package/dist/backup/site/archive-extensions.js +129 -0
- package/dist/backup/site/archive-manifest.d.ts +85 -0
- package/dist/backup/site/archive-manifest.js +176 -0
- package/dist/backup/site/archive-media.d.ts +121 -0
- package/dist/backup/site/archive-media.js +93 -0
- package/dist/backup/site/backup-service.credentials.d.ts +31 -0
- package/dist/backup/site/backup-service.credentials.js +158 -0
- package/dist/backup/site/backup-service.d.ts +336 -0
- package/dist/backup/site/backup-service.js +127 -0
- package/dist/backup/site/backup-service.plan.d.ts +64 -0
- package/dist/backup/site/backup-service.plan.js +207 -0
- package/dist/backup/site/backup-service.push.d.ts +29 -0
- package/dist/backup/site/backup-service.push.js +94 -0
- package/dist/backup/site/backup-service.shared.d.ts +40 -0
- package/dist/backup/site/backup-service.shared.js +37 -0
- package/dist/backup/site/bundled-export-file-policy.d.ts +38 -0
- package/dist/backup/site/bundled-export-file-policy.js +39 -0
- package/dist/backup/site/credential-warnings.d.ts +41 -0
- package/dist/backup/site/credential-warnings.js +50 -0
- package/dist/backup/site/import-backend-steps.d.ts +167 -0
- package/dist/backup/site/import-backend-steps.js +170 -0
- package/dist/backup/site/import-backend.d.ts +167 -0
- package/dist/backup/site/import-backend.js +298 -0
- package/dist/backup/site/import-database.d.ts +118 -0
- package/dist/backup/site/import-database.js +167 -0
- package/dist/backup/site/import-index/admission.d.ts +54 -0
- package/dist/backup/site/import-index/admission.js +46 -0
- package/dist/backup/site/import-index/backfill.d.ts +106 -0
- package/dist/backup/site/import-index/backfill.js +137 -0
- package/dist/backup/site/import-index/errors.d.ts +28 -0
- package/dist/backup/site/import-index/errors.js +38 -0
- package/dist/backup/site/import-index/migrations/checksums.d.ts +4 -0
- package/dist/backup/site/import-index/migrations/checksums.js +4 -0
- package/dist/backup/site/import-index/migrations/site-imports-v1.d.ts +2 -0
- package/dist/backup/site/import-index/migrations/site-imports-v1.js +10 -0
- package/dist/backup/site/import-index/mode.d.ts +191 -0
- package/dist/backup/site/import-index/mode.js +272 -0
- package/dist/backup/site/import-index/open.d.ts +40 -0
- package/dist/backup/site/import-index/open.js +87 -0
- package/dist/backup/site/import-index/paging.d.ts +28 -0
- package/dist/backup/site/import-index/paging.js +66 -0
- package/dist/backup/site/import-index/payload-namespace.d.ts +80 -0
- package/dist/backup/site/import-index/payload-namespace.js +156 -0
- package/dist/backup/site/import-index/rows.d.ts +32 -0
- package/dist/backup/site/import-index/rows.js +61 -0
- package/dist/backup/site/import-index/schema.d.ts +8 -0
- package/dist/backup/site/import-index/schema.js +31 -0
- package/dist/backup/site/import-index/store.d.ts +27 -0
- package/dist/backup/site/import-index/store.js +33 -0
- package/dist/backup/site/import-index/sweep.d.ts +10 -0
- package/dist/backup/site/import-index/sweep.js +26 -0
- package/dist/backup/site/import-keep-off.d.ts +128 -0
- package/dist/backup/site/import-keep-off.js +204 -0
- package/dist/backup/site/import-plugin-state.d.ts +74 -0
- package/dist/backup/site/import-plugin-state.js +67 -0
- package/dist/backup/site/import-registry.d.ts +110 -0
- package/dist/backup/site/import-registry.js +205 -0
- package/dist/backup/site/import-restore-placement.d.ts +94 -0
- package/dist/backup/site/import-restore-placement.js +158 -0
- package/dist/backup/site/import-restore.d.ts +111 -0
- package/dist/backup/site/import-restore.js +120 -0
- package/dist/backup/site/import-verifier-inventory.d.ts +137 -0
- package/dist/backup/site/import-verifier-inventory.js +236 -0
- package/dist/backup/site/import-verifier-projection.d.ts +78 -0
- package/dist/backup/site/import-verifier-projection.js +100 -0
- package/dist/backup/site/import-verifier.d.ts +126 -0
- package/dist/backup/site/import-verifier.js +53 -0
- package/dist/backup/site/owned-temp-root.d.ts +12 -0
- package/dist/backup/site/owned-temp-root.js +2 -0
- package/dist/backup/site/package-file-inventory.d.ts +63 -0
- package/dist/backup/site/package-file-inventory.js +56 -0
- package/dist/backup/site/push-content.d.ts +70 -0
- package/dist/backup/site/push-content.js +56 -0
- package/dist/backup/site/react/ShowMoreImports.d.ts +21 -0
- package/dist/backup/site/react/ShowMoreImports.js +8 -0
- package/dist/backup/site/saved-keys-port.d.ts +47 -0
- package/dist/backup/site/saved-keys-port.js +3 -0
- package/dist/backup/site/saved-keys.d.ts +25 -0
- package/dist/backup/site/saved-keys.js +38 -0
- package/dist/backup/site/share-backend.d.ts +243 -0
- package/dist/backup/site/share-backend.js +284 -0
- package/dist/backup/site/share-database/projection.d.ts +197 -0
- package/dist/backup/site/share-database/projection.js +90 -0
- package/dist/backup/site/share-database/projection.media.d.ts +38 -0
- package/dist/backup/site/share-database/projection.media.js +179 -0
- package/dist/backup/site/share-database/projection.tables.d.ts +46 -0
- package/dist/backup/site/share-database/projection.tables.js +210 -0
- package/dist/backup/site/share-expiry.d.ts +75 -0
- package/dist/backup/site/share-expiry.js +49 -0
- package/dist/backup/site/share-export-failure.d.ts +17 -0
- package/dist/backup/site/share-export-failure.js +16 -0
- package/dist/backup/site/share-file-policy.d.ts +60 -0
- package/dist/backup/site/share-file-policy.js +146 -0
- package/dist/backup/site/share-hosting.d.ts +107 -0
- package/dist/backup/site/share-hosting.js +148 -0
- package/dist/backup/site/share-preparation-steps.d.ts +180 -0
- package/dist/backup/site/share-preparation-steps.js +107 -0
- package/dist/backup/site/share-preparation.d.ts +122 -0
- package/dist/backup/site/share-preparation.js +43 -0
- package/dist/backup/site/share-refusal.d.ts +21 -0
- package/dist/backup/site/share-refusal.js +20 -0
- package/dist/backup/site/share-registry.d.ts +124 -0
- package/dist/backup/site/share-registry.js +219 -0
- package/dist/backup/site/share-retention.d.ts +62 -0
- package/dist/backup/site/share-retention.js +126 -0
- package/dist/backup/site/share-service.d.ts +128 -0
- package/dist/backup/site/share-service.js +194 -0
- package/dist/backup/site/share-zip.d.ts +115 -0
- package/dist/backup/site/share-zip.js +144 -0
- package/dist/backup/site/sources.d.ts +344 -0
- package/dist/backup/site/sources.js +595 -0
- package/dist/backup/site/static-copy.d.ts +122 -0
- package/dist/backup/site/static-copy.js +165 -0
- package/dist/backup/site/static-download-html.d.ts +76 -0
- package/dist/backup/site/static-download-html.js +149 -0
- package/dist/backup/site/static-download-landing.d.ts +52 -0
- package/dist/backup/site/static-download-landing.js +95 -0
- package/dist/backup/site/static-download-layout.d.ts +96 -0
- package/dist/backup/site/static-download-layout.js +325 -0
- package/dist/backup/site/static-export-selection.d.ts +50 -0
- package/dist/backup/site/static-export-selection.js +75 -0
- package/dist/backup/site/static-site-packager.d.ts +42 -0
- package/dist/backup/site/static-site-packager.js +32 -0
- package/dist/backup/site/tool-registrations.d.ts +74 -0
- package/dist/backup/site/tool-registrations.js +204 -0
- package/dist/checks/complexity-debt.d.ts +100 -0
- package/dist/checks/complexity-debt.js +131 -0
- package/dist/checks/coverage/diff.js +5 -1
- package/dist/checks/coverage/lcov.js +1 -1
- package/dist/checks/env-access.d.ts +14 -1
- package/dist/checks/env-access.js +92 -6
- package/dist/checks/live-verify-checks.d.ts +29 -0
- package/dist/checks/live-verify-checks.js +30 -0
- package/dist/checks/quality-gates.d.ts +137 -0
- package/dist/checks/quality-gates.js +209 -0
- package/dist/core/deploy-types.d.ts +2 -0
- package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
- package/dist/deploy/admin-http/site-update-status.js +15 -0
- package/dist/deploy/host-kit.d.ts +3 -0
- package/dist/deploy/index.d.ts +6 -0
- package/dist/deploy/index.js +6 -0
- package/dist/deploy/ops-runner.js +7 -0
- package/dist/deploy/ops-tool-contracts.d.ts +10 -1
- package/dist/deploy/react/Deployment.d.ts +37 -0
- package/dist/deploy/react/Deployment.js +94 -0
- package/dist/deploy/react/DockerfileTab.d.ts +72 -0
- package/dist/deploy/react/DockerfileTab.js +131 -0
- package/dist/deploy/react/HistoryTab.d.ts +43 -0
- package/dist/deploy/react/HistoryTab.js +12 -0
- package/dist/deploy/react/OverviewTab.d.ts +60 -0
- package/dist/deploy/react/OverviewTab.js +75 -0
- package/dist/deploy/react/PublishRunResult.d.ts +5 -1
- package/dist/deploy/react/PublishRunResult.js +4 -4
- package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
- package/dist/deploy/react/SiteUpdateNotice.js +25 -0
- package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
- package/dist/deploy/react/StaticCredentialFields.js +63 -0
- package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
- package/dist/deploy/react/StaticCredentialSteps.js +152 -0
- package/dist/deploy/react/StaticExportCard.d.ts +11 -0
- package/dist/deploy/react/StaticExportCard.js +97 -0
- package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
- package/dist/deploy/react/StaticPublishCredentials.js +77 -0
- package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
- package/dist/deploy/react/StaticPublishForm.js +91 -0
- package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
- package/dist/deploy/react/StaticSiteTab.js +117 -0
- package/dist/deploy/react/deployment-visuals.d.ts +207 -0
- package/dist/deploy/react/deployment-visuals.js +101 -0
- package/dist/deploy/react/download-dockerfile.d.ts +14 -0
- package/dist/deploy/react/download-dockerfile.js +15 -0
- package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
- package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
- package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
- package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
- package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
- package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
- package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
- package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
- package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
- package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
- package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
- package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
- package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
- package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
- package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
- package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
- package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
- package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
- package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
- package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
- package/dist/deploy/react/index.d.ts +4 -0
- package/dist/deploy/react/index.js +2 -0
- package/dist/deploy/react/rules.d.ts +363 -0
- package/dist/deploy/react/rules.js +314 -0
- package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
- package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
- package/dist/deploy/site/agent-tools.d.ts +42 -0
- package/dist/deploy/site/agent-tools.js +119 -0
- package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
- package/dist/deploy/site/deploy-config-registry.js +124 -0
- package/dist/deploy/site/deploy-config.d.ts +97 -0
- package/dist/deploy/site/deploy-config.js +115 -0
- package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
- package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
- package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
- package/dist/deploy/site/deploy-ops/registry.js +106 -0
- package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
- package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
- package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
- package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
- package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
- package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
- package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
- package/dist/deploy/site/deploy-targets/registry.js +130 -0
- package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
- package/dist/deploy/site/deploy-targets/types.js +2 -0
- package/dist/deploy/site/dockerfile.d.ts +137 -0
- package/dist/deploy/site/dockerfile.js +101 -0
- package/dist/deploy/site/export-run.d.ts +137 -0
- package/dist/deploy/site/export-run.js +152 -0
- package/dist/deploy/site/ports.d.ts +115 -0
- package/dist/deploy/site/ports.js +2 -0
- package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
- package/dist/deploy/site/publish-agent-tools.js +120 -0
- package/dist/deploy/site/publish-candidate.d.ts +26 -0
- package/dist/deploy/site/publish-candidate.js +37 -0
- package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
- package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
- package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
- package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
- package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
- package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
- package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
- package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
- package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
- package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
- package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
- package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
- package/dist/deploy/site/publish-credentials/store.d.ts +321 -0
- package/dist/deploy/site/publish-credentials/store.js +367 -0
- package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
- package/dist/deploy/site/publish-credentials/types.js +2 -0
- package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
- package/dist/deploy/site/publish-tool-capabilities.js +175 -0
- package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
- package/dist/deploy/site/publish-tool-credential.js +284 -0
- package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
- package/dist/deploy/site/publish-tool-deps.js +15 -0
- package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
- package/dist/deploy/site/publish-tool-execution.js +313 -0
- package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
- package/dist/deploy/site/publish-tool-schema.js +38 -0
- package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
- package/dist/deploy/site/static-publish/adapter-export.js +89 -0
- package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
- package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
- package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
- package/dist/deploy/site/static-publish/adapter.js +321 -0
- package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
- package/dist/deploy/site/static-publish/admin-publish-read.js +118 -0
- package/dist/deploy/site/static-publish/credentials.d.ts +114 -0
- package/dist/deploy/site/static-publish/credentials.js +298 -0
- package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
- package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
- package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
- package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
- package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
- package/dist/deploy/site/static-publish/inspection.js +69 -0
- package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
- package/dist/deploy/site/static-publish/publish-history.js +153 -0
- package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
- package/dist/deploy/site/static-publish/publish-run.js +186 -0
- package/dist/deploy/site/static-publish/types.d.ts +168 -0
- package/dist/deploy/site/static-publish/types.js +2 -0
- package/dist/deploy/site/static-publish/verify.d.ts +237 -0
- package/dist/deploy/site/static-publish/verify.js +284 -0
- package/dist/deploy/site/tool-registrations.d.ts +97 -0
- package/dist/deploy/site/tool-registrations.js +130 -0
- package/dist/deploy/site/types.d.ts +51 -0
- package/dist/deploy/site/types.js +2 -0
- package/dist/deploy/site-update/check-for-update.d.ts +19 -0
- package/dist/deploy/site-update/check-for-update.js +19 -0
- package/dist/deploy/site-update/contracts.d.ts +161 -0
- package/dist/deploy/site-update/contracts.js +94 -0
- package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
- package/dist/deploy/site-update/desktop-site-update.js +43 -0
- package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
- package/dist/deploy/site-update/fake-site-update.js +52 -0
- package/dist/deploy/site-update/run-site-update.d.ts +121 -0
- package/dist/deploy/site-update/run-site-update.js +219 -0
- package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
- package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
- package/dist/deploy/target-contracts.d.ts +3 -0
- package/dist/deploy/tool.d.ts +5 -8
- package/dist/deploy/tool.js +6 -9
- package/dist/dns/binding-sweeper.d.ts +72 -0
- package/dist/dns/binding-sweeper.js +53 -0
- package/dist/dns/index.d.ts +1 -0
- package/dist/dns/index.js +1 -0
- package/dist/dns/site/binding.repo.d.ts +71 -0
- package/dist/dns/site/binding.repo.js +45 -0
- package/dist/dns/site/dns-changes.d.ts +90 -0
- package/dist/dns/site/dns-changes.js +271 -0
- package/dist/dns/site/dns-tools.d.ts +46 -0
- package/dist/dns/site/dns-tools.js +204 -0
- package/dist/dns/site/mail-dns-status.d.ts +111 -0
- package/dist/dns/site/mail-dns-status.js +190 -0
- package/dist/dns/site/mail-dns-tools.d.ts +33 -0
- package/dist/dns/site/mail-dns-tools.js +62 -0
- package/dist/dns/site/mail-requirements.d.ts +30 -0
- package/dist/dns/site/mail-requirements.js +78 -0
- package/dist/dns/site/tool-deps.d.ts +21 -0
- package/dist/dns/site/tool-deps.js +2 -0
- package/dist/dns/site/tools.d.ts +74 -0
- package/dist/dns/site/tools.js +124 -0
- package/dist/local-dev/bind-host.d.ts +80 -0
- package/dist/local-dev/bind-host.js +90 -0
- package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
- package/dist/local-dev/dev-proxy-upstream.js +63 -0
- package/dist/local-dev/index.d.ts +28 -0
- package/dist/local-dev/index.js +25 -0
- package/dist/packaging/electron/archive.d.ts +2 -9
- package/dist/packaging/electron/asar-adapter.d.ts +2 -1
- package/dist/packaging/electron/entry.d.ts +2 -0
- package/dist/packaging/electron/move-to-applications.d.ts +165 -0
- package/dist/packaging/electron/move-to-applications.js +162 -0
- package/dist/packaging/electron/policies.d.ts +33 -4
- package/dist/packaging/electron/policies.js +29 -10
- package/dist/packaging/electron/ports.d.ts +1 -6
- package/dist/packaging/electron/staging.d.ts +11 -2
- package/dist/packaging/electron/staging.js +15 -5
- package/dist/packaging/electron/update-manifest-merge.js +0 -2
- package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
- package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
- package/dist/react/site-share-expiry/index.d.ts +2 -0
- package/dist/react/site-share-expiry/index.js +2 -0
- package/dist/source-control/react/ProvidersTab.d.ts +98 -0
- package/dist/source-control/react/ProvidersTab.js +195 -0
- package/dist/source-control/react/SourceControl.d.ts +51 -0
- package/dist/source-control/react/SourceControl.js +61 -0
- package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
- package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
- package/dist/source-control/react/rules.d.ts +167 -0
- package/dist/source-control/react/rules.js +125 -0
- package/dist/source-control/react/source-control-visuals.d.ts +75 -0
- package/dist/source-control/react/source-control-visuals.js +48 -0
- package/dist/source-control/site/agent-tools.d.ts +5 -0
- package/dist/source-control/site/agent-tools.js +30 -0
- package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
- package/dist/source-control/site/bundled-provider-registry.js +37 -0
- package/dist/source-control/site/commit-schema.d.ts +40 -0
- package/dist/source-control/site/commit-schema.js +29 -0
- package/dist/source-control/site/commit-target.d.ts +26 -0
- package/dist/source-control/site/commit-target.js +58 -0
- package/dist/source-control/site/credential-form.d.ts +36 -0
- package/dist/source-control/site/credential-form.js +102 -0
- package/dist/source-control/site/credential-setup.d.ts +107 -0
- package/dist/source-control/site/credential-setup.js +216 -0
- package/dist/source-control/site/provider-kit.d.ts +37 -0
- package/dist/source-control/site/provider-kit.js +35 -0
- package/dist/source-control/site/provider-module.d.ts +251 -0
- package/dist/source-control/site/provider-module.js +2 -0
- package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
- package/dist/source-control/site/saved-key-bindings.js +4 -0
- package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
- package/dist/source-control/site/static-site-packager-port.js +2 -0
- package/dist/source-control/site/store.d.ts +209 -0
- package/dist/source-control/site/store.js +374 -0
- package/dist/source-control/site/store.validation.d.ts +72 -0
- package/dist/source-control/site/store.validation.js +168 -0
- package/dist/source-control/site/tool-registrations.d.ts +190 -0
- package/dist/source-control/site/tool-registrations.js +379 -0
- package/dist/static-export/asset-crawl.d.ts +30 -0
- package/dist/static-export/asset-crawl.js +71 -0
- package/dist/static-export/dynamic-asset-locations.d.ts +23 -0
- package/dist/static-export/dynamic-asset-locations.js +34 -0
- package/dist/static-export/html-url-locations.d.ts +3 -1
- package/dist/static-export/html-url-locations.js +43 -9
- package/dist/static-export/runner.js +26 -27
- package/dist/static-export/site/export-preflight.d.ts +48 -0
- package/dist/static-export/site/export-preflight.js +82 -0
- package/dist/static-export/site/media-original-urls.d.ts +57 -0
- package/dist/static-export/site/media-original-urls.js +109 -0
- package/dist/static-export/site/ports.d.ts +82 -0
- package/dist/static-export/site/ports.js +29 -0
- package/dist/static-export/site/public-origin-policy.d.ts +32 -0
- package/dist/static-export/site/public-origin-policy.js +68 -0
- package/dist/static-export/site/route-manifest.d.ts +65 -0
- package/dist/static-export/site/route-manifest.js +139 -0
- package/dist/static-export/site/site-exporter.d.ts +158 -0
- package/dist/static-export/site/site-exporter.js +112 -0
- package/dist/static-export/site/static-security-headers.d.ts +39 -0
- package/dist/static-export/site/static-security-headers.js +43 -0
- package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
- package/dist/static-export/site/theme-preview-manifest.js +28 -0
- package/dist/static-export/transforms.d.ts +1 -1
- package/dist/static-export/transforms.js +3 -3
- package/package.json +911 -7
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Contracts for the static-site exporter's route enumeration step (2026-08-15).
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* `buildRouteManifest` owns "what URLs does this workspace's public site actually serve" —
|
|
6
|
+
* separately from the HTTP-driving writer, so export and preview callers share enumeration
|
|
7
|
+
* rather than maintaining hand-rolled route lists inside the exporter engine.
|
|
8
|
+
*
|
|
9
|
+
* `Jini/packages/cms/src/seo/sitemap.ts`'s `buildSitemap` is NOT this enumerator and must never be mistaken for it: it
|
|
10
|
+
* enumerates only published, indexable posts, silently omitting home, products, theme-owned static
|
|
11
|
+
* pages, redirects, and 404 — an SEO index and a deployable manifest answer different questions
|
|
12
|
+
* (the host's deployment-constraints doc, §3).
|
|
13
|
+
*
|
|
14
|
+
* Architectural role:
|
|
15
|
+
* Tier-2 library, mirroring `src/redirects`/`src/seo`'s own `ports.ts` + implementation-file split.
|
|
16
|
+
* The concrete reader (`route-manifest.ts`) reuses the exact selection logic real routes use — never
|
|
17
|
+
* re-derives it — so the manifest can never enumerate a route the live server would not actually
|
|
18
|
+
* serve, or miss one it would. `resolveActiveTheme` is a direct import from feature-owned
|
|
19
|
+
* the host's theme feature (see `route-manifest.ts`'s header for why this library now lives in
|
|
20
|
+
* `features/`).
|
|
21
|
+
* `resolveActiveThemeId`/`listPublishedPosts`/`resolveStorefrontProducts` are all reached via
|
|
22
|
+
* `RouteDeps` injection (`deps.resolveActiveThemeId()` etc.) rather than a direct import — see
|
|
23
|
+
* `route-manifest.ts`'s own file header for why (2026-09-03: the first two moved from direct import
|
|
24
|
+
* to injection specifically to close a `platform <-> features/presentation`/`platform <->
|
|
25
|
+
* features/post` module cycle; `resolveStorefrontProducts` was injected earlier, 2026-08-16, for an
|
|
26
|
+
* unrelated `SiteProduct` type-boundary reason).
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* What kind of thing a route is, for reporting only — the exporter's writer does not branch on
|
|
30
|
+
* this to decide HOW to fetch a route (every non-redirect, non-404 entry is fetched identically);
|
|
31
|
+
* it exists so a human-facing export report can say "12 posts, 3 pages, 8 theme pages, 4 products"
|
|
32
|
+
* instead of an undifferentiated route count.
|
|
33
|
+
*/
|
|
34
|
+
export type ManifestRouteKind = "home" | "post" | "page" | "theme-page" | "product-list" | "product" | "redirect" | "not-found" | "well-known";
|
|
35
|
+
/**
|
|
36
|
+
* One publicly reachable URL. `redirectTarget`/`redirectStatusCode` are populated ONLY for
|
|
37
|
+
* `kind: "redirect"` — they are the rule's DECLARED destination, carried as a cross-check hint for
|
|
38
|
+
* the writer's own report, never as the source of truth for exported bytes: the writer re-requests
|
|
39
|
+
* the path with `redirect: "manual"` and writes whatever the live server actually answers with, the
|
|
40
|
+
* same "boot the real app, trust its real response" rule every other route follows.
|
|
41
|
+
*/
|
|
42
|
+
export interface ManifestRoute {
|
|
43
|
+
/** Site-relative request path, e.g. `"/"`, `"/about"`, `"/products/mug-01"`. Always a leading
|
|
44
|
+
* slash; `"/"` is the only entry with no further segments. For `kind: "not-found"` this is a
|
|
45
|
+
* collision-checked SENTINEL path chosen to trigger the live 404 branch, not a real content URL —
|
|
46
|
+
* the writer maps its response to `404.html` at the export root rather than to this literal path. */
|
|
47
|
+
path: string;
|
|
48
|
+
kind: ManifestRouteKind;
|
|
49
|
+
/** Human-readable label for reporting only (slug/title/product name) — never used for lookup. */
|
|
50
|
+
label: string;
|
|
51
|
+
redirectTarget?: string;
|
|
52
|
+
redirectStatusCode?: number;
|
|
53
|
+
}
|
|
54
|
+
/** Identifies the active theme a built manifest resolved against, so a caller (the exporter's
|
|
55
|
+
* unreferenced-file diff) can locate its on-disk folder without re-resolving "which theme is
|
|
56
|
+
* active" a third time (`route-manifest.ts` and `pages.ts`'s live route are the other two). Not
|
|
57
|
+
* the full `DiscoveredTheme` — only the fields a caller outside this port's own module needs. */
|
|
58
|
+
export interface ManifestActiveTheme {
|
|
59
|
+
id: string;
|
|
60
|
+
/** Absolute path of the theme's own folder on disk (`DiscoveredTheme.dir`). */
|
|
61
|
+
dir: string;
|
|
62
|
+
/** `DiscoveredTheme.manifest.apiVersion` — `2` nests a static theme's files under `render/`
|
|
63
|
+
* (`theme-authoring-guide-v2.md` §3), `undefined` keeps the v1 theme-root layout. Threaded
|
|
64
|
+
* through so a caller outside this port's own module (the exporter's unreferenced-file diff)
|
|
65
|
+
* never has to re-derive schema version from disk layout — same reasoning as `dir` itself. */
|
|
66
|
+
apiVersion?: 2;
|
|
67
|
+
}
|
|
68
|
+
/** A publicly reachable URL the manifest could NOT enumerate, recorded so the export report names
|
|
69
|
+
* the gap instead of silently under-counting routes (the brief's "never a silently missing file"
|
|
70
|
+
* rule, applied one step upstream of the writer). Today's only known source: `prefix`/`wildcard`/
|
|
71
|
+
* `regex` redirect rules, which match a family of paths rather than one enumerable path. */
|
|
72
|
+
export interface ManifestSkip {
|
|
73
|
+
reason: string;
|
|
74
|
+
detail: string;
|
|
75
|
+
}
|
|
76
|
+
export interface RouteManifest {
|
|
77
|
+
routes: ManifestRoute[];
|
|
78
|
+
skipped: ManifestSkip[];
|
|
79
|
+
/** Set only when a valid theme was resolved (absent in the `no-theme` `skipped` case). */
|
|
80
|
+
activeTheme?: ManifestActiveTheme;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Contracts for the static-site exporter's route enumeration step (2026-08-15).
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* `buildRouteManifest` owns "what URLs does this workspace's public site actually serve" —
|
|
6
|
+
* separately from the HTTP-driving writer, so export and preview callers share enumeration
|
|
7
|
+
* rather than maintaining hand-rolled route lists inside the exporter engine.
|
|
8
|
+
*
|
|
9
|
+
* `Jini/packages/cms/src/seo/sitemap.ts`'s `buildSitemap` is NOT this enumerator and must never be mistaken for it: it
|
|
10
|
+
* enumerates only published, indexable posts, silently omitting home, products, theme-owned static
|
|
11
|
+
* pages, redirects, and 404 — an SEO index and a deployable manifest answer different questions
|
|
12
|
+
* (the host's deployment-constraints doc, §3).
|
|
13
|
+
*
|
|
14
|
+
* Architectural role:
|
|
15
|
+
* Tier-2 library, mirroring `src/redirects`/`src/seo`'s own `ports.ts` + implementation-file split.
|
|
16
|
+
* The concrete reader (`route-manifest.ts`) reuses the exact selection logic real routes use — never
|
|
17
|
+
* re-derives it — so the manifest can never enumerate a route the live server would not actually
|
|
18
|
+
* serve, or miss one it would. `resolveActiveTheme` is a direct import from feature-owned
|
|
19
|
+
* the host's theme feature (see `route-manifest.ts`'s header for why this library now lives in
|
|
20
|
+
* `features/`).
|
|
21
|
+
* `resolveActiveThemeId`/`listPublishedPosts`/`resolveStorefrontProducts` are all reached via
|
|
22
|
+
* `RouteDeps` injection (`deps.resolveActiveThemeId()` etc.) rather than a direct import — see
|
|
23
|
+
* `route-manifest.ts`'s own file header for why (2026-09-03: the first two moved from direct import
|
|
24
|
+
* to injection specifically to close a `platform <-> features/presentation`/`platform <->
|
|
25
|
+
* features/post` module cycle; `resolveStorefrontProducts` was injected earlier, 2026-08-16, for an
|
|
26
|
+
* unrelated `SiteProduct` type-boundary reason).
|
|
27
|
+
*/
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=ports.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type OriginRegistryPort } from "@jini-ai/core/contracts/server/verified-origin";
|
|
2
|
+
/** Only the registry's public evidence counts; a dev seed must never become export identity.
|
|
3
|
+
* Reuse the configured-origin owner's validation, including loopback and credential refusal.
|
|
4
|
+
* Registry absence degrades the export to a copy without public identity, as it does live SEO.
|
|
5
|
+
* @complexity One registry read; O(origin length) validation, no network access.
|
|
6
|
+
*/
|
|
7
|
+
export declare function exportPublicOrigin({ registry, workspaceId }: {
|
|
8
|
+
registry: OriginRegistryPort;
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
}, _options?: {}): Promise<string | undefined>;
|
|
11
|
+
/** Replace render authority everywhere, including JSON-LD and plain-text discovery files.
|
|
12
|
+
* Root-relative paths and external URLs retain their exact bytes. A JSON escaped slash retains
|
|
13
|
+
* its encoding. The ephemeral crawl origin and persisted dev origins need the same treatment.
|
|
14
|
+
* @complexity O(body bytes), no requests or path/layout changes.
|
|
15
|
+
*/
|
|
16
|
+
export declare function rewriteRenderOrigins({ body, renderOrigin, publicOrigin, sourceOrigin }: {
|
|
17
|
+
body: string;
|
|
18
|
+
renderOrigin: string;
|
|
19
|
+
publicOrigin?: string | undefined;
|
|
20
|
+
sourceOrigin?: string | undefined;
|
|
21
|
+
}, _options?: {}): string;
|
|
22
|
+
/** Transform every textual response before the owner crawls/writes it; binary media streams through.
|
|
23
|
+
* The copied response has no stale length/encoding headers after decoding and editing its body.
|
|
24
|
+
* @complexity O(response text bytes), one buffered response and no additional fetch.
|
|
25
|
+
*/
|
|
26
|
+
export declare function rewriteExportOriginResponse({ response, url, publicOrigin, sourceOrigin }: {
|
|
27
|
+
response: Response;
|
|
28
|
+
url: string;
|
|
29
|
+
publicOrigin?: string | undefined;
|
|
30
|
+
sourceOrigin?: string | undefined;
|
|
31
|
+
}, _options?: {}): Promise<Response>;
|
|
32
|
+
//# sourceMappingURL=public-origin-policy.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { resolveConfiguredOrigin, } from "@jini-ai/core/contracts/server/verified-origin";
|
|
2
|
+
import { orFallback } from "@jini-ai/core/errors/idioms";
|
|
3
|
+
/** Same loopback spellings URL normalizes from IPv4/IPv6 literals, including mapped IPv4. */
|
|
4
|
+
function isRenderHost({ hostname }, _options = {}) {
|
|
5
|
+
const host = hostname.toLowerCase().replace(/\.$/, "");
|
|
6
|
+
return /^(?:localhost|.*\.localhost|127\.\d+\.\d+\.\d+|0\.0\.0\.0|\[(?:::1|::|::ffff:7f[\da-f]{2}:[\da-f]+)\])$/.test(host);
|
|
7
|
+
}
|
|
8
|
+
/** Only the registry's public evidence counts; a dev seed must never become export identity.
|
|
9
|
+
* Reuse the configured-origin owner's validation, including loopback and credential refusal.
|
|
10
|
+
* Registry absence degrades the export to a copy without public identity, as it does live SEO.
|
|
11
|
+
* @complexity One registry read; O(origin length) validation, no network access.
|
|
12
|
+
*/
|
|
13
|
+
export async function exportPublicOrigin({ registry, workspaceId }, _options = {}) {
|
|
14
|
+
const evidence = await orFallback({ work: () => registry.canonicalOrigin({ workspaceId }), fallback: undefined, step: "Read configured export origin" });
|
|
15
|
+
if (evidence === undefined)
|
|
16
|
+
return undefined;
|
|
17
|
+
if (evidence.source !== "workspace-setting")
|
|
18
|
+
return undefined;
|
|
19
|
+
const raw = `${evidence.scheme}://${evidence.host}${evidence.port === undefined ? "" : `:${evidence.port}`}`;
|
|
20
|
+
const accepted = resolveConfiguredOrigin({ env: { origin: raw }, envVarName: "origin", clock: { nowIso: () => evidence.verifiedAt }, warn: () => { } });
|
|
21
|
+
if (!accepted)
|
|
22
|
+
return undefined;
|
|
23
|
+
const parsed = new URL(raw);
|
|
24
|
+
return isRenderHost({ hostname: parsed.hostname }) ? undefined : parsed.origin;
|
|
25
|
+
}
|
|
26
|
+
/** Replace render authority everywhere, including JSON-LD and plain-text discovery files.
|
|
27
|
+
* Root-relative paths and external URLs retain their exact bytes. A JSON escaped slash retains
|
|
28
|
+
* its encoding. The ephemeral crawl origin and persisted dev origins need the same treatment.
|
|
29
|
+
* @complexity O(body bytes), no requests or path/layout changes.
|
|
30
|
+
*/
|
|
31
|
+
export function rewriteRenderOrigins({ body, renderOrigin, publicOrigin, sourceOrigin }, _options = {}) {
|
|
32
|
+
return body.replace(/(?:\bhttps?:|(?<![:\w]))(?:\/\/|\\\/\\\/)(?:[^\s/"'<>\\()?#@]+@)?(?:\[[\da-f:.]+\]|[\w.-]+)(?::\d+)?/gi, (raw, offset) => {
|
|
33
|
+
let parsed;
|
|
34
|
+
try {
|
|
35
|
+
parsed = new URL(raw.replaceAll("\\/", "/"), renderOrigin);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return raw;
|
|
39
|
+
}
|
|
40
|
+
if (parsed.origin !== renderOrigin && parsed.origin !== sourceOrigin && !isRenderHost({ hostname: parsed.hostname }))
|
|
41
|
+
return raw;
|
|
42
|
+
const tail = body.slice(offset + raw.length, offset + raw.length + 2);
|
|
43
|
+
const replacement = publicOrigin ?? (/^(?:\/|\\\/)/.test(tail) ? "" : "/");
|
|
44
|
+
return raw.includes("\\/") ? replacement.replaceAll("/", "\\/") : replacement;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Transform every textual response before the owner crawls/writes it; binary media streams through.
|
|
48
|
+
* The copied response has no stale length/encoding headers after decoding and editing its body.
|
|
49
|
+
* @complexity O(response text bytes), one buffered response and no additional fetch.
|
|
50
|
+
*/
|
|
51
|
+
export async function rewriteExportOriginResponse({ response, url, publicOrigin, sourceOrigin }, _options = {}) {
|
|
52
|
+
const headers = new Headers(response.headers);
|
|
53
|
+
const location = headers.get("location");
|
|
54
|
+
const renderOrigin = new URL(url).origin;
|
|
55
|
+
if (location)
|
|
56
|
+
headers.set("location", rewriteRenderOrigins({ body: location, renderOrigin, publicOrigin, sourceOrigin }));
|
|
57
|
+
if (response.body === null)
|
|
58
|
+
return new Response(null, { status: response.status, statusText: response.statusText, headers });
|
|
59
|
+
if (!/^(?:text\/|image\/svg\+xml\b|application\/(?:[\w.+-]*\+)?(?:json|xml|javascript)\b)/i.test(headers.get("content-type") ?? ""))
|
|
60
|
+
return response;
|
|
61
|
+
let body = rewriteRenderOrigins({ body: await response.text(), renderOrigin, publicOrigin, sourceOrigin });
|
|
62
|
+
if (!publicOrigin && new URL(url).pathname === "/robots.txt")
|
|
63
|
+
body = body.replace(/^[\t ]*Sitemap:[^\r\n]*(?:\r?\n|$)/gim, "");
|
|
64
|
+
headers.delete("content-length");
|
|
65
|
+
headers.delete("content-encoding");
|
|
66
|
+
return new Response(body, { status: response.status, statusText: response.statusText, headers });
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=public-origin-policy.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ManifestActiveTheme, ManifestRoute, ManifestSkip, RouteManifest } from "./ports.js";
|
|
2
|
+
type Empty = Record<string, never>;
|
|
3
|
+
export interface RouteManifestSources {
|
|
4
|
+
readThemeAndPosts: () => Promise<{
|
|
5
|
+
theme: {
|
|
6
|
+
kind: "absent";
|
|
7
|
+
} | {
|
|
8
|
+
kind: "deliberately-off";
|
|
9
|
+
} | {
|
|
10
|
+
kind: "selected";
|
|
11
|
+
identity: ManifestActiveTheme;
|
|
12
|
+
tier: string;
|
|
13
|
+
pages: readonly string[];
|
|
14
|
+
};
|
|
15
|
+
posts: readonly {
|
|
16
|
+
slug: string;
|
|
17
|
+
title: string;
|
|
18
|
+
kind: string;
|
|
19
|
+
overridesThemePage?: boolean | undefined;
|
|
20
|
+
}[];
|
|
21
|
+
}>;
|
|
22
|
+
listProducts: () => Promise<readonly {
|
|
23
|
+
slug: string;
|
|
24
|
+
title: string;
|
|
25
|
+
}[]>;
|
|
26
|
+
listActiveRedirects: () => Promise<readonly {
|
|
27
|
+
matchType: string;
|
|
28
|
+
fromPattern: string;
|
|
29
|
+
toTarget: string;
|
|
30
|
+
statusCode: number;
|
|
31
|
+
}[]>;
|
|
32
|
+
}
|
|
33
|
+
export interface RouteManifestPolicy {
|
|
34
|
+
initialRoutes: readonly ManifestRoute[];
|
|
35
|
+
initialSkips: readonly ManifestSkip[];
|
|
36
|
+
probeBase: string;
|
|
37
|
+
probeSuffix: () => string;
|
|
38
|
+
postPath: (required: {
|
|
39
|
+
slug: string;
|
|
40
|
+
}) => string;
|
|
41
|
+
productPaths: {
|
|
42
|
+
list: string;
|
|
43
|
+
detail: (required: {
|
|
44
|
+
slug: string;
|
|
45
|
+
}) => string;
|
|
46
|
+
};
|
|
47
|
+
isStandaloneThemePage: (required: {
|
|
48
|
+
pageId: string;
|
|
49
|
+
}) => boolean;
|
|
50
|
+
skipCopy: {
|
|
51
|
+
absent: string;
|
|
52
|
+
deliberatelyOff: string;
|
|
53
|
+
nonExactRedirect: (required: {
|
|
54
|
+
matchType: string;
|
|
55
|
+
fromPattern: string;
|
|
56
|
+
toTarget: string;
|
|
57
|
+
}) => string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export declare function buildRouteManifest({ sources, policy }: {
|
|
61
|
+
sources: RouteManifestSources;
|
|
62
|
+
policy: RouteManifestPolicy;
|
|
63
|
+
}, _optional?: Empty): Promise<RouteManifest>;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=route-manifest.d.ts.map
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picks a request path guaranteed not to collide with any route already in the manifest, so the
|
|
3
|
+
* 404 probe (below) cannot accidentally hit real content. Collision is vanishingly unlikely for the
|
|
4
|
+
* base slug alone (a genuine post/page would need that exact, deliberately-unusual title-shaped
|
|
5
|
+
* slug), but a random suffix costs nothing and turns "vanishingly unlikely" into "cannot happen"
|
|
6
|
+
* without the caller needing to reason about the odds.
|
|
7
|
+
*
|
|
8
|
+
* @complexity O(n) in the number of already-claimed paths for the (typical) zero-collision case;
|
|
9
|
+
* each retry is another O(n) membership check against the same fixed set, bounded in practice by
|
|
10
|
+
* collision probability rather than by any loop guard — a `Set` lookup is O(1) amortized, so this
|
|
11
|
+
* is not a hot path even for a large route count.
|
|
12
|
+
*/
|
|
13
|
+
function chooseNotFoundProbePath(claimedPaths, policy) {
|
|
14
|
+
let candidate = `/${policy.probeBase}`;
|
|
15
|
+
while (claimedPaths.has(candidate)) {
|
|
16
|
+
candidate = `/${policy.probeBase}-${policy.probeSuffix()}`;
|
|
17
|
+
}
|
|
18
|
+
return candidate;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Enumerates a static theme's own pages as routes, skipping `index`/`404` (handled elsewhere) and
|
|
22
|
+
* template shells (see file header), and skipping any page whose slug a post has claimed (per the
|
|
23
|
+
* same `overridesThemePage` tri-state the live resolver uses). Non-static themes contribute none.
|
|
24
|
+
*/
|
|
25
|
+
function buildThemePageRoutes(theme, postBySlug, policy) {
|
|
26
|
+
const routes = [];
|
|
27
|
+
const shadowedSlugs = new Set();
|
|
28
|
+
if (theme.tier !== "static")
|
|
29
|
+
return { routes, shadowedSlugs };
|
|
30
|
+
for (const pageId of theme.pages) {
|
|
31
|
+
// `index`/`404`/template-shell exclusion, shared with the live `GET /:slug` resolver rather
|
|
32
|
+
// than respelled here — see `isStandaloneThemePage`'s own doc (`features/theme/theme.ts`).
|
|
33
|
+
if (!policy.isStandaloneThemePage({ pageId }))
|
|
34
|
+
continue;
|
|
35
|
+
const collidingPost = postBySlug.get(pageId);
|
|
36
|
+
// An overriding post is added by the post loop instead.
|
|
37
|
+
if (!collidingPost || collidingPost.overridesThemePage === false) {
|
|
38
|
+
routes.push({ path: `/${pageId}`, kind: "theme-page", label: pageId });
|
|
39
|
+
shadowedSlugs.add(pageId);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { routes, shadowedSlugs };
|
|
43
|
+
}
|
|
44
|
+
/** Every published post/page not shadowed by a theme-owned static page at the same slug. */
|
|
45
|
+
function buildPostRoutes(posts, shadowedSlugs, policy) {
|
|
46
|
+
const routes = [];
|
|
47
|
+
for (const post of posts) {
|
|
48
|
+
if (shadowedSlugs.has(post.slug))
|
|
49
|
+
continue;
|
|
50
|
+
routes.push({ path: policy.postPath({ slug: post.slug }), kind: post.kind === "page" ? "page" : "post", label: post.title });
|
|
51
|
+
}
|
|
52
|
+
return routes;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolves theme + post routes together (the post loop needs the theme's shadowed-slug set). When
|
|
56
|
+
* there is no theme to render with, records the `no-theme` skip and returns no routes/`activeTheme`
|
|
57
|
+
* — a real, reportable state rather than a crash (see file header).
|
|
58
|
+
*
|
|
59
|
+
* TWO states share that skip `reason`, with deliberately different `detail` text. `undefined` means
|
|
60
|
+
* discovery found no valid theme: something is broken and the operator should reinstall one.
|
|
61
|
+
* `"deliberate"` means the operator turned the theme off themselves — nothing is broken and there
|
|
62
|
+
* is nothing to fix, so telling them "no valid theme discovered" would be simply false. The
|
|
63
|
+
* `reason` is kept identical so every existing consumer of the skip list is unaffected; only the
|
|
64
|
+
* human-readable sentence distinguishes them.
|
|
65
|
+
*/
|
|
66
|
+
function resolveThemeAndPostRoutes({ theme, posts, skipped, policy }, _optional = {}) {
|
|
67
|
+
if (theme.kind !== "selected") {
|
|
68
|
+
skipped.push({
|
|
69
|
+
reason: "no-theme",
|
|
70
|
+
detail: theme.kind === "deliberately-off"
|
|
71
|
+
? policy.skipCopy.deliberatelyOff
|
|
72
|
+
: policy.skipCopy.absent,
|
|
73
|
+
});
|
|
74
|
+
return { routes: [] };
|
|
75
|
+
}
|
|
76
|
+
const activeTheme = theme.identity;
|
|
77
|
+
const postBySlug = new Map(posts.map((post) => [post.slug, post]));
|
|
78
|
+
const { routes: themeRoutes, shadowedSlugs } = buildThemePageRoutes(theme, postBySlug, policy);
|
|
79
|
+
return { activeTheme, routes: [...themeRoutes, ...buildPostRoutes(posts, shadowedSlugs, policy)] };
|
|
80
|
+
}
|
|
81
|
+
/** The product grid + one detail route per storefront product — omitted entirely when there are none. */
|
|
82
|
+
function buildProductRoutes(products, policy) {
|
|
83
|
+
if (products.length === 0)
|
|
84
|
+
return [];
|
|
85
|
+
const routes = [{ path: policy.productPaths.list, kind: "product-list", label: "products" }];
|
|
86
|
+
for (const product of products) {
|
|
87
|
+
routes.push({ path: policy.productPaths.detail({ slug: product.slug }), kind: "product", label: product.title });
|
|
88
|
+
}
|
|
89
|
+
return routes;
|
|
90
|
+
}
|
|
91
|
+
/** `exact` redirect rules become routes; every other match type is recorded in `skipped` (see file header). */
|
|
92
|
+
function buildRedirectRoutes({ redirectRules, skipped, policy }, _optional = {}) {
|
|
93
|
+
const routes = [];
|
|
94
|
+
for (const rule of redirectRules) {
|
|
95
|
+
if (rule.matchType !== "exact") {
|
|
96
|
+
skipped.push({
|
|
97
|
+
reason: "non-exact-redirect",
|
|
98
|
+
detail: policy.skipCopy.nonExactRedirect(rule),
|
|
99
|
+
});
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
routes.push({
|
|
103
|
+
path: rule.fromPattern,
|
|
104
|
+
kind: "redirect",
|
|
105
|
+
label: rule.fromPattern,
|
|
106
|
+
redirectTarget: rule.toTarget,
|
|
107
|
+
redirectStatusCode: rule.statusCode,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return routes;
|
|
111
|
+
}
|
|
112
|
+
export async function buildRouteManifest({ sources, policy }, _optional = {}) {
|
|
113
|
+
const routes = [...policy.initialRoutes];
|
|
114
|
+
const skipped = [...policy.initialSkips];
|
|
115
|
+
const { theme, posts } = await sources.readThemeAndPosts();
|
|
116
|
+
const { activeTheme, routes: themeAndPostRoutes } = resolveThemeAndPostRoutes({ theme, posts, skipped, policy });
|
|
117
|
+
// Content-owned homepage (SPEC-0XX): a `kind: "page"` row may claim the reserved "/" slug and
|
|
118
|
+
// `buildPostRoutes` above already resolves its path through the same `postPublicPath` the live
|
|
119
|
+
// `GET /` handler uses, so it can appear in `themeAndPostRoutes` at path "/" too. The seeded
|
|
120
|
+
// `{ path: "/", kind: "home" }` entry above is what the live site serves ONLY when no such page
|
|
121
|
+
// exists — replace it with the real page's route instead of pushing a second, duplicate "/" entry,
|
|
122
|
+
// the same "post wins over what the manifest would otherwise show at this path" shape
|
|
123
|
+
// `buildThemePageRoutes`'s own `shadowedSlugs` already applies for a theme-owned static page.
|
|
124
|
+
const homePageRouteIndex = themeAndPostRoutes.findIndex((route) => route.path === "/");
|
|
125
|
+
if (homePageRouteIndex !== -1) {
|
|
126
|
+
const [homePageRoute] = themeAndPostRoutes.splice(homePageRouteIndex, 1);
|
|
127
|
+
if (homePageRoute)
|
|
128
|
+
routes[0] = homePageRoute;
|
|
129
|
+
}
|
|
130
|
+
routes.push(...themeAndPostRoutes);
|
|
131
|
+
const products = await sources.listProducts();
|
|
132
|
+
routes.push(...buildProductRoutes(products, policy));
|
|
133
|
+
const redirectRules = await sources.listActiveRedirects();
|
|
134
|
+
routes.push(...buildRedirectRoutes({ redirectRules, skipped, policy }));
|
|
135
|
+
const claimedPaths = new Set(routes.map((route) => route.path));
|
|
136
|
+
routes.push({ path: chooseNotFoundProbePath(claimedPaths, policy), kind: "not-found", label: "404" });
|
|
137
|
+
return { routes, skipped, ...(activeTheme === undefined ? {} : { activeTheme }) };
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=route-manifest.js.map
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { RequestListener } from "node:http";
|
|
2
|
+
import { type OriginRegistryPort } from "@jini-ai/core/contracts/server/verified-origin";
|
|
3
|
+
import type { SiteCookieConsentDeps } from "@jini-ai/core/contracts/headless/site-cookie-consent";
|
|
4
|
+
import type { ObservabilityPort } from "@jini-ai/core/contracts/observability";
|
|
5
|
+
import type { SecurityHeaderSet } from "@jini-ai/core/contracts/server/security-headers";
|
|
6
|
+
import type { ExportReport as BaseExportReport, ExportSiteArgs, RouteManifest } from "../contracts.js";
|
|
7
|
+
import { type ExportPreflightCopy } from "./export-preflight.js";
|
|
8
|
+
import { type ExportMediaUrlDeps } from "./media-original-urls.js";
|
|
9
|
+
export declare function selectDeclaredThemeScripts({ themes, activeThemeId }: {
|
|
10
|
+
themes: readonly {
|
|
11
|
+
manifest: {
|
|
12
|
+
id: string;
|
|
13
|
+
scripts?: readonly {
|
|
14
|
+
src: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
18
|
+
activeThemeId: string | undefined;
|
|
19
|
+
}, _optional?: Record<string, never>): string[];
|
|
20
|
+
export interface ExportSiteRouteDeps {
|
|
21
|
+
readonly workspaceId: string;
|
|
22
|
+
readonly clock: {
|
|
23
|
+
nowIso(): string;
|
|
24
|
+
};
|
|
25
|
+
readonly originRegistry: OriginRegistryPort;
|
|
26
|
+
readonly cookieConsent?: SiteCookieConsentDeps;
|
|
27
|
+
readonly createSiteApp: (optional?: {
|
|
28
|
+
themeId?: string;
|
|
29
|
+
}) => RequestListener;
|
|
30
|
+
readonly observability: ObservabilityPort;
|
|
31
|
+
readonly fetch: typeof globalThis.fetch;
|
|
32
|
+
readonly trackFetch: (required: {
|
|
33
|
+
fetch: typeof globalThis.fetch;
|
|
34
|
+
observability: ObservabilityPort;
|
|
35
|
+
}) => typeof globalThis.fetch;
|
|
36
|
+
readonly preflightCopy: ExportPreflightCopy;
|
|
37
|
+
readonly buildPreviewExportManifest: (required: {
|
|
38
|
+
routeDeps: ExportSiteRouteDeps & {
|
|
39
|
+
resolveActiveThemeId?: () => Promise<string>;
|
|
40
|
+
};
|
|
41
|
+
}, optional: Pick<ExportSiteOptions, "includeThemePreviews">) => Promise<{
|
|
42
|
+
manifest: RouteManifest;
|
|
43
|
+
themeCount: number;
|
|
44
|
+
}>;
|
|
45
|
+
readonly bindExportMediaUrls: (required: {
|
|
46
|
+
deps: ExportSiteRouteDeps;
|
|
47
|
+
}) => ExportMediaUrlDeps<{
|
|
48
|
+
status: string;
|
|
49
|
+
kind?: string;
|
|
50
|
+
source: {
|
|
51
|
+
sha256: string;
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
54
|
+
readonly themeLayout: ExportSiteArgs["themeLayout"];
|
|
55
|
+
readonly assetUrlPrefixes: ExportSiteArgs["assetUrlPrefixes"];
|
|
56
|
+
readonly declaredThemeAssets: (required: {
|
|
57
|
+
routeDeps: ExportSiteRouteDeps;
|
|
58
|
+
activeThemeId: string | undefined;
|
|
59
|
+
}) => string[];
|
|
60
|
+
readonly requestHeaders: ExportSiteArgs["requestHeaders"];
|
|
61
|
+
readonly exportHtml: (required: {
|
|
62
|
+
html: string;
|
|
63
|
+
publicOrigin?: string;
|
|
64
|
+
stripNativeFormTools: ExportSiteRouteDeps["withoutNativeFormTools"];
|
|
65
|
+
}) => string;
|
|
66
|
+
readonly withoutNativeFormTools: (required: {
|
|
67
|
+
html: string;
|
|
68
|
+
}, optional?: Record<string, never>) => string;
|
|
69
|
+
readonly publicPageSecurityHeaders: (required: Record<string, never>) => SecurityHeaderSet;
|
|
70
|
+
readonly extractListingMoreHrefs: (required: {
|
|
71
|
+
html: string;
|
|
72
|
+
}) => readonly string[];
|
|
73
|
+
readonly extractListingPageHrefs: (required: {
|
|
74
|
+
html: string;
|
|
75
|
+
}) => readonly string[];
|
|
76
|
+
readonly listingJsonNextPath: (required: {
|
|
77
|
+
path: string;
|
|
78
|
+
body: string;
|
|
79
|
+
}) => string | undefined;
|
|
80
|
+
readonly themePreviewExportSize: (required: {
|
|
81
|
+
report: BaseExportReport;
|
|
82
|
+
themeCount: number;
|
|
83
|
+
}) => {
|
|
84
|
+
themeCount: number;
|
|
85
|
+
htmlSizeMultiplier: number;
|
|
86
|
+
sizeMultiplier: number;
|
|
87
|
+
additionalPages: number;
|
|
88
|
+
};
|
|
89
|
+
readonly reportInfo: (message: string) => void;
|
|
90
|
+
}
|
|
91
|
+
export interface ExportSiteOptions {
|
|
92
|
+
/** The same composition-root object `createApp`/`host src/server/runtime/composition/deps.ts` already build — the exporter
|
|
93
|
+
* boots the real app with this, exactly like `cli/commands/serve.ts` does. */
|
|
94
|
+
routeDeps: ExportSiteRouteDeps;
|
|
95
|
+
outputDir: string;
|
|
96
|
+
/** By default, replace this export's files and keep unrelated files (removing files this process
|
|
97
|
+
* did not write is destructive — see `cli/commands/export.ts` for the `--clean` flag).
|
|
98
|
+
* Pass `true` to remove the directory's existing contents before writing. */
|
|
99
|
+
clean?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* When set (e.g. `"/my-repo"` for a host that serves the site under a repository subpath), every root-relative reference this
|
|
102
|
+
* exporter writes — HTML `href`/`src`/`srcset`/`poster`, `sitemap.xml`'s `<loc>`, `robots.txt`'s `Sitemap:` line, a
|
|
103
|
+
* redirect stub's target — is rewritten to carry this prefix. Omitted/empty (the default) leaves
|
|
104
|
+
* every byte this exporter writes IDENTICAL to a pre-`--base-path` export — proven by
|
|
105
|
+
* `site-exporter.test.ts`'s own "unset is inert" regression test, not just asserted in this
|
|
106
|
+
* comment.
|
|
107
|
+
*/
|
|
108
|
+
basePath?: string;
|
|
109
|
+
/** Destination URL supplied by this export request or deploy target; never saved as site identity. */
|
|
110
|
+
publicUrl?: string;
|
|
111
|
+
/** Request-local theme override for a selected static capture; never activates it. */
|
|
112
|
+
themeId?: string;
|
|
113
|
+
/** Portable static copies render one theme; deployment builds retain previews. */
|
|
114
|
+
includeThemePreviews?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/** Compose the real CMS manifest/theme/security policy with Jini's export engine. */
|
|
117
|
+
export declare function exportHostSite({ routeDeps, outputDir, clean, basePath, includeThemePreviews, themeId, publicUrl }: ExportSiteOptions, _options?: {}): Promise<{
|
|
118
|
+
basePathRewriteWarning?: string;
|
|
119
|
+
publicOrigin?: string;
|
|
120
|
+
outputDir: string;
|
|
121
|
+
droppedReferences: never[];
|
|
122
|
+
consentWarning?: string;
|
|
123
|
+
routes: {
|
|
124
|
+
succeeded: import("../contracts.js").ExportedRoute[];
|
|
125
|
+
failed: import("../contracts.js").FailedRoute[];
|
|
126
|
+
};
|
|
127
|
+
assets: {
|
|
128
|
+
succeeded: import("../contracts.js").ExportedAsset[];
|
|
129
|
+
failed: import("../contracts.js").FailedAsset[];
|
|
130
|
+
};
|
|
131
|
+
skippedManifestEntries: import("../contracts.js").ManifestSkip[];
|
|
132
|
+
unreferencedThemeFiles: string[];
|
|
133
|
+
basePath?: string;
|
|
134
|
+
} | {
|
|
135
|
+
themePreview: {
|
|
136
|
+
themeCount: number;
|
|
137
|
+
htmlSizeMultiplier: number;
|
|
138
|
+
sizeMultiplier: number;
|
|
139
|
+
additionalPages: number;
|
|
140
|
+
};
|
|
141
|
+
basePathRewriteWarning?: string;
|
|
142
|
+
publicOrigin?: string;
|
|
143
|
+
outputDir: string;
|
|
144
|
+
droppedReferences: never[];
|
|
145
|
+
consentWarning?: string;
|
|
146
|
+
routes: {
|
|
147
|
+
succeeded: import("../contracts.js").ExportedRoute[];
|
|
148
|
+
failed: import("../contracts.js").FailedRoute[];
|
|
149
|
+
};
|
|
150
|
+
assets: {
|
|
151
|
+
succeeded: import("../contracts.js").ExportedAsset[];
|
|
152
|
+
failed: import("../contracts.js").FailedAsset[];
|
|
153
|
+
};
|
|
154
|
+
skippedManifestEntries: import("../contracts.js").ManifestSkip[];
|
|
155
|
+
unreferencedThemeFiles: string[];
|
|
156
|
+
basePath?: string;
|
|
157
|
+
}>;
|
|
158
|
+
//# sourceMappingURL=site-exporter.d.ts.map
|