@jini-ai/devops 0.7.3-next.1 → 0.7.3-next.3
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 +6 -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 +161 -0
- package/dist/backup/site/backup-service.d.ts +331 -0
- package/dist/backup/site/backup-service.js +125 -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 +82 -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 +40 -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 +195 -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 +193 -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 +109 -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 +76 -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 +201 -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/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 +155 -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 +132 -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 +322 -0
- package/dist/deploy/site/publish-credentials/store.js +372 -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 +116 -0
- package/dist/deploy/site/static-publish/credentials.d.ts +110 -0
- package/dist/deploy/site/static-publish/credentials.js +290 -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 +165 -0
- package/dist/deploy/site/static-publish/types.js +2 -0
- package/dist/deploy/site/static-publish/verify.d.ts +217 -0
- package/dist/deploy/site/static-publish/verify.js +248 -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/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/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/package.json +912 -8
|
@@ -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
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { rm } from "node:fs/promises";
|
|
3
|
+
import { resolveConfiguredOrigin } from "@jini-ai/core/contracts/server/verified-origin";
|
|
4
|
+
import { exportSite as runExport } from "../entry.js";
|
|
5
|
+
import { createNodeAppFactory, createNodeArtifactWriter, createNodeAssetSource } from "../node-adapters.js";
|
|
6
|
+
import { createExportPreflight } from "./export-preflight.js";
|
|
7
|
+
import { withSecurityMeta } from "./static-security-headers.js";
|
|
8
|
+
import { rewriteExportMediaResponse } from "./media-original-urls.js";
|
|
9
|
+
import { exportPublicOrigin, rewriteExportOriginResponse } from "./public-origin-policy.js";
|
|
10
|
+
export function selectDeclaredThemeScripts({ themes, activeThemeId }, _optional = {}) {
|
|
11
|
+
const theme = themes.find(item => item.manifest.id === activeThemeId);
|
|
12
|
+
return (theme?.manifest.scripts ?? []).map(script => script.src).filter(src => src.startsWith('/') && !src.startsWith('//'));
|
|
13
|
+
}
|
|
14
|
+
function listingRoutes({ hrefs, kind }, _optional = {}) {
|
|
15
|
+
return hrefs.filter((href) => href.startsWith("/") && !href.startsWith("//")).map((href) => ({ path: href, kind, label: href }));
|
|
16
|
+
}
|
|
17
|
+
/** Keep precedence visible to result consumers and the CLI through the existing warning field:
|
|
18
|
+
* a public URL owns the output prefix, so an explicit base path beside it is reported as ignored. */
|
|
19
|
+
function ignoredBasePathNotice({ publicUrl, basePath, warning }) {
|
|
20
|
+
if (publicUrl === undefined || basePath === undefined)
|
|
21
|
+
return {};
|
|
22
|
+
return { basePathRewriteWarning: ["The base path was ignored because the public URL sets the path.", warning].filter(Boolean).join(" ") };
|
|
23
|
+
}
|
|
24
|
+
/** Validate the destination through Jini's origin owner; scope every rewrite to this copy.
|
|
25
|
+
* No registration or mutation of the live site's origin. A destination overrides its old public URL.
|
|
26
|
+
* @complexity One bounded registry read plus O(URL bytes); invalid destinations throw before export.
|
|
27
|
+
*/
|
|
28
|
+
async function resolveExportIdentity({ routeDeps, publicUrl }, _options = {}) {
|
|
29
|
+
// The configured-origin owner refuses non-HTTPS, loopback, userinfo, query and fragment URLs.
|
|
30
|
+
const destination = publicUrl === undefined ? undefined : resolveConfiguredOrigin({ env: { destination: publicUrl }, envVarName: "destination", clock: routeDeps.clock, warn: () => { } });
|
|
31
|
+
if (publicUrl !== undefined && !destination)
|
|
32
|
+
throw new Error("The public URL must be a public HTTPS address.");
|
|
33
|
+
// A publish renders against its own destination, without changing the local site's trust root.
|
|
34
|
+
const publicOrigin = destination && `https://${destination.host}${destination.port === undefined ? "" : `:${destination.port}`}`;
|
|
35
|
+
const publicBaseUrl = publicOrigin && publicOrigin + (destination.basePath ?? "");
|
|
36
|
+
const sourceOrigin = await exportPublicOrigin({ registry: routeDeps.originRegistry, workspaceId: routeDeps.workspaceId });
|
|
37
|
+
return { publicOrigin, publicBaseUrl, sourceOrigin };
|
|
38
|
+
}
|
|
39
|
+
/** Compose the real CMS manifest/theme/security policy with Jini's export engine. */
|
|
40
|
+
export async function exportHostSite({ routeDeps, outputDir, clean, basePath, includeThemePreviews, themeId, publicUrl }, _options = {}) {
|
|
41
|
+
const tracedFetch = routeDeps.trackFetch({ fetch: (input, init) => routeDeps.fetch(input, init), observability: routeDeps.observability });
|
|
42
|
+
const { manifest, themeCount } = await exportManifestForTheme({ routeDeps }, { themeId, includeThemePreviews });
|
|
43
|
+
const { publicOrigin, publicBaseUrl, sourceOrigin } = await resolveExportIdentity({ routeDeps, publicUrl });
|
|
44
|
+
// The resolved destination owns its prefix: custom domains and user Pages sites can be at root.
|
|
45
|
+
const outputBasePath = publicBaseUrl ? new URL(publicBaseUrl).pathname : basePath;
|
|
46
|
+
const writer = createNodeArtifactWriter({}, {});
|
|
47
|
+
// Sitemaps require absolute loc values; RSS requires an absolute channel link. With no public
|
|
48
|
+
// identity omit both, including stale copies in a reused output directory (the CLI default).
|
|
49
|
+
const omitted = publicOrigin ? [] : ["/sitemap.xml", "/feed.xml"];
|
|
50
|
+
const siteApp = themeId === undefined ? routeDeps.createSiteApp() : routeDeps.createSiteApp({ themeId });
|
|
51
|
+
const consentWarning = await routeDeps.cookieConsent?.exportWarning?.();
|
|
52
|
+
// Pre-flight warnings (A421 placeholder, A400 third-party scripts) ride the same report field as the consent warning.
|
|
53
|
+
const preflight = createExportPreflight({ ownOrigins: [publicBaseUrl, sourceOrigin], copy: routeDeps.preflightCopy });
|
|
54
|
+
const report = await runExport({
|
|
55
|
+
outputDir: path.resolve(outputDir),
|
|
56
|
+
manifest: { build: async () => ({ ...manifest, routes: manifest.routes.filter(route => !omitted.includes(route.path)) }) },
|
|
57
|
+
app: createNodeAppFactory({ createApp: () => siteApp }, {}),
|
|
58
|
+
writer: { ...writer, prepare: async (required, optional) => {
|
|
59
|
+
await writer.prepare(required, optional);
|
|
60
|
+
for (const file of omitted)
|
|
61
|
+
await rm(path.join(required.outputDir, file.slice(1)), { force: true });
|
|
62
|
+
} },
|
|
63
|
+
fetch: async ({ url }, options) => rewriteExportMediaResponse({
|
|
64
|
+
response: await rewriteExportOriginResponse({ response: await tracedFetch(url, options?.init), url, publicOrigin: publicBaseUrl, sourceOrigin }), deps: routeDeps.bindExportMediaUrls({ deps: routeDeps }),
|
|
65
|
+
}),
|
|
66
|
+
assetSource: createNodeAssetSource({}, {}),
|
|
67
|
+
themeLayout: routeDeps.themeLayout,
|
|
68
|
+
assetUrlPrefixes: routeDeps.assetUrlPrefixes,
|
|
69
|
+
assetUrls: async () => {
|
|
70
|
+
const consentAssets = await routeDeps.cookieConsent?.exportAssets?.() ?? [];
|
|
71
|
+
preflight.setConsentConfigured({ configured: consentAssets.length > 0 });
|
|
72
|
+
return [...routeDeps.declaredThemeAssets({ routeDeps, activeThemeId: manifest.activeTheme?.id }), ...consentAssets];
|
|
73
|
+
},
|
|
74
|
+
requestHeaders: routeDeps.requestHeaders,
|
|
75
|
+
security: { transformHtml: ({ html }) => {
|
|
76
|
+
preflight.observePage({ html });
|
|
77
|
+
const exported = routeDeps.exportHtml({ html, stripNativeFormTools: routeDeps.withoutNativeFormTools, ...(publicBaseUrl === undefined ? {} : { publicOrigin: publicBaseUrl }) });
|
|
78
|
+
return withSecurityMeta({ html: exported, headers: routeDeps.publicPageSecurityHeaders({}) });
|
|
79
|
+
} },
|
|
80
|
+
errorPage: { outputFile: "404.html", acceptStatus: ({ status }) => status >= 400 && status < 500,
|
|
81
|
+
rejectionReason: ({ status }) => `expected a 4xx response for the 404 probe, got ${status}` },
|
|
82
|
+
assetPathFailureReason: "asset URL resolved outside the output directory — refused",
|
|
83
|
+
describeError: ({ error }) => error instanceof Error ? error.message : String(error),
|
|
84
|
+
// See-more batches (`<page>/_more/<key>/<after>`): each exported page's next-batch link is
|
|
85
|
+
// exported too, and that batch's own link after it, so the button works on a static host.
|
|
86
|
+
// A JSON batch's next batch comes from its `nextCursor`; a page or HTML batch names it in its button.
|
|
87
|
+
// Numbered listing pages (`<page>/page/<n>`, Bug C): each page's prev/next links are followed
|
|
88
|
+
// the same way, so every page is written as `.../page/<n>/index.html`.
|
|
89
|
+
discoverRoutes: ({ path, html }) => [
|
|
90
|
+
...listingRoutes({ hrefs: [...routeDeps.extractListingMoreHrefs({ html }), ...[routeDeps.listingJsonNextPath({ path, body: html })].filter((next) => next !== undefined)], kind: "listing-batch" }),
|
|
91
|
+
...listingRoutes({ hrefs: routeDeps.extractListingPageHrefs({ html }), kind: "listing-page" }),
|
|
92
|
+
],
|
|
93
|
+
}, { ...(clean !== undefined ? { clean } : {}), ...(outputBasePath !== undefined ? { basePath: outputBasePath } : {}) });
|
|
94
|
+
return finishExportReport({ report, outputDir, publicOrigin, publicUrl, basePath, themeCount, consentWarning: preflight.joinWarnings({ existing: consentWarning }), themePreviewExportSize: routeDeps.themePreviewExportSize, reportInfo: routeDeps.reportInfo });
|
|
95
|
+
}
|
|
96
|
+
/** The site's manifest for its active theme, or for one chosen theme rendered as if active (then without previews). */
|
|
97
|
+
function exportManifestForTheme({ routeDeps }, { themeId, includeThemePreviews } = {}) {
|
|
98
|
+
return routeDeps.buildPreviewExportManifest({ routeDeps: themeId === undefined ? routeDeps : { ...routeDeps, resolveActiveThemeId: async () => themeId } }, themeId !== undefined ? { includeThemePreviews: false } : includeThemePreviews === undefined ? {} : { includeThemePreviews });
|
|
99
|
+
}
|
|
100
|
+
/** Return publication diagnostics after the exporter has closed its fresh app session. */
|
|
101
|
+
function finishExportReport({ report, outputDir, publicOrigin, publicUrl, basePath, themeCount, consentWarning, themePreviewExportSize, reportInfo }) {
|
|
102
|
+
// Jini's reference scan diagnoses retained broken links; it does not remove them. A dropped
|
|
103
|
+
// reference must be backed by an actual removal. Download-only removals are recorded by static-copy.
|
|
104
|
+
const result = { ...report, ...(consentWarning ? { consentWarning } : {}), outputDir, droppedReferences: [], ...(publicOrigin ? { publicOrigin } : {}),
|
|
105
|
+
...ignoredBasePathNotice({ publicUrl, basePath, warning: report.basePathRewriteWarning }) };
|
|
106
|
+
if (themeCount === 1)
|
|
107
|
+
return result;
|
|
108
|
+
const themePreview = themePreviewExportSize({ report, themeCount });
|
|
109
|
+
reportInfo(`[export] Theme previews: ${themeCount} themes, ${themePreview.additionalPages} additional pages, ${themePreview.sizeMultiplier.toFixed(2)}x export bytes (${themePreview.htmlSizeMultiplier.toFixed(2)}x HTML); shared assets are deduplicated.`);
|
|
110
|
+
return { ...result, themePreview };
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=site-exporter.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SecurityHeaderSet } from "@jini-ai/core/contracts/server/security-headers";
|
|
2
|
+
/**
|
|
3
|
+
* @file Carries the live server's public-page security headers into a static export, which is
|
|
4
|
+
* plain files served by someone else's host. Every value comes from the ONE shared set in
|
|
5
|
+
* `@jini-ai/cms/public-http/middleware/public-page-security-headers`; nothing here retypes a header.
|
|
6
|
+
*
|
|
7
|
+
* - A host that reads a `_headers` file ({@link renderHeadersFile}'s format), applied to every
|
|
8
|
+
* path. How the file must reach that host (e.g. as its own upload field, never a public asset)
|
|
9
|
+
* is the host plugin's concern, documented in its deploy module.
|
|
10
|
+
* - A host with its own header config format renders it in its plugin's deploy module from the
|
|
11
|
+
* publish's `responseHeaders`.
|
|
12
|
+
* - Everywhere else (a host with no header config, a hand-copied folder): only what HTML
|
|
13
|
+
* itself can say, via {@link withSecurityMeta}.
|
|
14
|
+
*
|
|
15
|
+
* What a `<meta>` CANNOT carry, so those hosts go without it:
|
|
16
|
+
* - `X-Content-Type-Options`: a response header only; no HTML equivalent exists.
|
|
17
|
+
* - `Content-Security-Policy-Report-Only`: browsers ignore report-only in `<meta http-equiv>`. An
|
|
18
|
+
* ENFORCED meta CSP is deliberately not emitted instead: the live server does not enforce one
|
|
19
|
+
* (it would break html-format Pages and vendor embeds, see the live middleware's doc), and a static
|
|
20
|
+
* copy must not break where the live site works.
|
|
21
|
+
* `Referrer-Policy` has an exact HTML equivalent (`<meta name="referrer">`) and is written into every
|
|
22
|
+
* exported HTML page for every host, so it holds even where a header file is not applied.
|
|
23
|
+
*/
|
|
24
|
+
/** The `_headers` file format some static hosts read: a path pattern, then two-space-indented `Name: value` lines. */
|
|
25
|
+
export declare function renderHeadersFile({ headers }: {
|
|
26
|
+
headers: SecurityHeaderSet;
|
|
27
|
+
}, _optional?: Record<string, never>): string;
|
|
28
|
+
/**
|
|
29
|
+
* Inserts `<meta name="referrer">` as the first child of `<head>`, so a page's own later referrer
|
|
30
|
+
* meta (if any) still wins, exactly as it would over the live header. Unchanged when the HTML has no
|
|
31
|
+
* `<head>` or the set has no `Referrer-Policy`.
|
|
32
|
+
*
|
|
33
|
+
* @complexity O(n) in the length of `html` (one regex scan).
|
|
34
|
+
*/
|
|
35
|
+
export declare function withSecurityMeta({ html, headers }: {
|
|
36
|
+
html: string;
|
|
37
|
+
headers: SecurityHeaderSet;
|
|
38
|
+
}, _optional?: Record<string, never>): string;
|
|
39
|
+
//# sourceMappingURL=static-security-headers.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { escapeHtml } from "@jini-ai/core/text";
|
|
2
|
+
/**
|
|
3
|
+
* @file Carries the live server's public-page security headers into a static export, which is
|
|
4
|
+
* plain files served by someone else's host. Every value comes from the ONE shared set in
|
|
5
|
+
* `@jini-ai/cms/public-http/middleware/public-page-security-headers`; nothing here retypes a header.
|
|
6
|
+
*
|
|
7
|
+
* - A host that reads a `_headers` file ({@link renderHeadersFile}'s format), applied to every
|
|
8
|
+
* path. How the file must reach that host (e.g. as its own upload field, never a public asset)
|
|
9
|
+
* is the host plugin's concern, documented in its deploy module.
|
|
10
|
+
* - A host with its own header config format renders it in its plugin's deploy module from the
|
|
11
|
+
* publish's `responseHeaders`.
|
|
12
|
+
* - Everywhere else (a host with no header config, a hand-copied folder): only what HTML
|
|
13
|
+
* itself can say, via {@link withSecurityMeta}.
|
|
14
|
+
*
|
|
15
|
+
* What a `<meta>` CANNOT carry, so those hosts go without it:
|
|
16
|
+
* - `X-Content-Type-Options`: a response header only; no HTML equivalent exists.
|
|
17
|
+
* - `Content-Security-Policy-Report-Only`: browsers ignore report-only in `<meta http-equiv>`. An
|
|
18
|
+
* ENFORCED meta CSP is deliberately not emitted instead: the live server does not enforce one
|
|
19
|
+
* (it would break html-format Pages and vendor embeds, see the live middleware's doc), and a static
|
|
20
|
+
* copy must not break where the live site works.
|
|
21
|
+
* `Referrer-Policy` has an exact HTML equivalent (`<meta name="referrer">`) and is written into every
|
|
22
|
+
* exported HTML page for every host, so it holds even where a header file is not applied.
|
|
23
|
+
*/
|
|
24
|
+
/** The `_headers` file format some static hosts read: a path pattern, then two-space-indented `Name: value` lines. */
|
|
25
|
+
export function renderHeadersFile({ headers }, _optional = {}) {
|
|
26
|
+
const lines = Object.entries(headers).map(([name, value]) => ` ${name}: ${value}`);
|
|
27
|
+
return `/*\n${lines.join("\n")}\n`;
|
|
28
|
+
}
|
|
29
|
+
const HEAD_OPEN_TAG = /<head(\s[^>]*)?>/i;
|
|
30
|
+
/**
|
|
31
|
+
* Inserts `<meta name="referrer">` as the first child of `<head>`, so a page's own later referrer
|
|
32
|
+
* meta (if any) still wins, exactly as it would over the live header. Unchanged when the HTML has no
|
|
33
|
+
* `<head>` or the set has no `Referrer-Policy`.
|
|
34
|
+
*
|
|
35
|
+
* @complexity O(n) in the length of `html` (one regex scan).
|
|
36
|
+
*/
|
|
37
|
+
export function withSecurityMeta({ html, headers }, _optional = {}) {
|
|
38
|
+
const referrerPolicy = headers["Referrer-Policy"];
|
|
39
|
+
if (referrerPolicy === undefined)
|
|
40
|
+
return html;
|
|
41
|
+
return html.replace(HEAD_OPEN_TAG, (tag) => `${tag}<meta name="referrer" content="${escapeHtml({ text: referrerPolicy })}">`);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=static-security-headers.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RouteManifest } from "./ports.js";
|
|
2
|
+
export interface PreviewExportManifestPorts<Deps> {
|
|
3
|
+
readonly buildManifest: (required: {
|
|
4
|
+
routeDeps: Deps;
|
|
5
|
+
themeId?: string;
|
|
6
|
+
}, optional?: Record<string, never>) => Promise<RouteManifest>;
|
|
7
|
+
readonly readPreviewConfig: (required: {
|
|
8
|
+
routeDeps: Deps;
|
|
9
|
+
activeThemeId: string;
|
|
10
|
+
}, optional?: Record<string, never>) => Promise<{
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
themes: readonly {
|
|
13
|
+
themeId: string;
|
|
14
|
+
}[];
|
|
15
|
+
} | null>;
|
|
16
|
+
readonly previewThemePath: (required: {
|
|
17
|
+
themeId: string;
|
|
18
|
+
activeThemeId: string;
|
|
19
|
+
path: string;
|
|
20
|
+
}, optional?: Record<string, never>) => string;
|
|
21
|
+
}
|
|
22
|
+
/** Extend the existing route enumerator for each theme; the exporter still fetches the real app.
|
|
23
|
+
* O(themes × routes), at most 8 themes. Only normal routes own sitemap/feed/robots/404 outputs. */
|
|
24
|
+
export declare function buildPreviewExportManifest<Deps extends {
|
|
25
|
+
readonly siteTitleReady?: Promise<void> | undefined;
|
|
26
|
+
}>({ routeDeps, ports }: {
|
|
27
|
+
routeDeps: Deps;
|
|
28
|
+
ports: PreviewExportManifestPorts<Deps>;
|
|
29
|
+
}, options?: {
|
|
30
|
+
includeThemePreviews?: boolean;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
manifest: RouteManifest;
|
|
33
|
+
themeCount: number;
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=theme-preview-manifest.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function isHtmlPage({ route }, _options = {}) {
|
|
2
|
+
return !["well-known", "redirect", "not-found"].includes(route.kind);
|
|
3
|
+
}
|
|
4
|
+
/** Extend the existing route enumerator for each theme; the exporter still fetches the real app.
|
|
5
|
+
* O(themes × routes), at most 8 themes. Only normal routes own sitemap/feed/robots/404 outputs. */
|
|
6
|
+
export async function buildPreviewExportManifest({ routeDeps, ports }, options = {}) {
|
|
7
|
+
await routeDeps.siteTitleReady;
|
|
8
|
+
const manifest = await ports.buildManifest({ routeDeps });
|
|
9
|
+
// A portable static copy represents the active theme, even when the live preview switcher is on.
|
|
10
|
+
if (options.includeThemePreviews === false)
|
|
11
|
+
return { manifest, themeCount: 1 };
|
|
12
|
+
if (!manifest.activeTheme)
|
|
13
|
+
return { manifest, themeCount: 1 };
|
|
14
|
+
const activeThemeId = manifest.activeTheme.id;
|
|
15
|
+
const config = await ports.readPreviewConfig({ routeDeps, activeThemeId });
|
|
16
|
+
if (config === null || !config.enabled)
|
|
17
|
+
return { manifest, themeCount: 1 };
|
|
18
|
+
const normalPages = manifest.routes.filter(route => isHtmlPage({ route }));
|
|
19
|
+
for (const { themeId } of config.themes) {
|
|
20
|
+
if (themeId === activeThemeId)
|
|
21
|
+
continue;
|
|
22
|
+
const variant = await ports.buildManifest({ routeDeps, themeId });
|
|
23
|
+
const pages = new Map([...normalPages, ...variant.routes.filter(route => isHtmlPage({ route }))].map(route => [route.path, route]));
|
|
24
|
+
manifest.routes.push(...[...pages.values()].map(route => ({ ...route, path: ports.previewThemePath({ themeId, activeThemeId, path: route.path }) })));
|
|
25
|
+
}
|
|
26
|
+
return { manifest, themeCount: config.themes.length };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=theme-preview-manifest.js.map
|