@jini-ai/devops 0.7.3-next.2 → 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/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 +911 -7
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { SiteShareRefusal } from '../share-refusal.js';
|
|
2
|
+
import { ImportHistoryUnavailable } from './errors.js';
|
|
3
|
+
const UUID = '[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}';
|
|
4
|
+
const ID = new RegExp(`^${UUID}$`);
|
|
5
|
+
const PAYLOAD = new RegExp(`^(${UUID})(\\.upload\\.zip|\\.upload\\.json|\\.stage)$`);
|
|
6
|
+
const UNMOVABLE = 'Imports are paused because the app could not move its import files. Check that the app can write to its data folder, then try again.';
|
|
7
|
+
export function payloadPaths({ root }, _optional = {}) {
|
|
8
|
+
const dir = `${root}/payloads`;
|
|
9
|
+
return {
|
|
10
|
+
dir, marker: `${dir}/.namespace-v1`,
|
|
11
|
+
upload: ({ uploadId }, _optional = {}) => {
|
|
12
|
+
if (!ID.test(uploadId))
|
|
13
|
+
throw new SiteShareRefusal({ code: 'INVALID_INPUT', message: 'Invalid import or upload id.' });
|
|
14
|
+
return `${dir}/${uploadId}.upload.zip`;
|
|
15
|
+
},
|
|
16
|
+
uploadMeta: ({ uploadId }, _optional = {}) => {
|
|
17
|
+
if (!ID.test(uploadId))
|
|
18
|
+
throw new SiteShareRefusal({ code: 'INVALID_INPUT', message: 'Invalid import or upload id.' });
|
|
19
|
+
return `${dir}/${uploadId}.upload.json`;
|
|
20
|
+
},
|
|
21
|
+
stage: ({ importId }, _optional = {}) => {
|
|
22
|
+
if (!ID.test(importId))
|
|
23
|
+
throw new SiteShareRefusal({ code: 'INVALID_INPUT', message: 'Invalid import or upload id.' });
|
|
24
|
+
return `${dir}/${importId}.stage`;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function classifyPayload({ name }, _optional = {}) {
|
|
29
|
+
const match = PAYLOAD.exec(name);
|
|
30
|
+
if (!match)
|
|
31
|
+
return undefined;
|
|
32
|
+
return { id: match[1], suffix: match[2], kind: match[2] === '.stage' ? 'directory' : 'file' };
|
|
33
|
+
}
|
|
34
|
+
function movePayload({ from, to, kind, fs }, _optional = {}) {
|
|
35
|
+
const destination = fs.kind({ file: to });
|
|
36
|
+
if (destination === 'missing') {
|
|
37
|
+
// Atomic rename is same-volume; directory fsync has platform limits.
|
|
38
|
+
fs.rename({ from, to });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (destination !== kind)
|
|
42
|
+
throw new ImportHistoryUnavailable({ code: 'IMPORT_PAYLOADS_UNMOVABLE', status: 503, message: UNMOVABLE });
|
|
43
|
+
fs.rm({ file: from, recursive: kind === 'directory' });
|
|
44
|
+
}
|
|
45
|
+
function movePass({ root, paths, fs, names, suffix }, _optional = {}) {
|
|
46
|
+
for (const name of names) {
|
|
47
|
+
const entry = classifyPayload({ name });
|
|
48
|
+
if (!entry || entry.suffix !== suffix)
|
|
49
|
+
continue;
|
|
50
|
+
const from = `${root}/${name}`;
|
|
51
|
+
if (fs.kind({ file: from }) !== entry.kind)
|
|
52
|
+
continue;
|
|
53
|
+
movePayload({ from, to: `${paths.dir}/${name}`, kind: entry.kind, fs });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function writeMarker({ paths, fs }, _optional = {}) {
|
|
57
|
+
try {
|
|
58
|
+
fs.writeExclusive({ file: paths.marker, mode: 0o600 });
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error?.code !== 'EEXIST' || fs.kind({ file: paths.marker }) !== 'file')
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
fs.fsyncFile({ file: paths.marker });
|
|
65
|
+
fs.fsyncDir({ dir: paths.dir });
|
|
66
|
+
}
|
|
67
|
+
function ensurePayloadDirectory({ paths, fs }, _optional = {}) {
|
|
68
|
+
const directory = fs.kind({ file: paths.dir });
|
|
69
|
+
if (directory === 'missing')
|
|
70
|
+
fs.mkdir({ dir: paths.dir, mode: 0o700 });
|
|
71
|
+
else if (directory !== 'directory')
|
|
72
|
+
throw new ImportHistoryUnavailable({ code: 'IMPORT_PAYLOADS_UNMOVABLE', status: 503, message: UNMOVABLE });
|
|
73
|
+
fs.chmod({ file: paths.dir, mode: 0o700 });
|
|
74
|
+
}
|
|
75
|
+
// Permission and disk-full failures get plain-words, retryable errors; anything else is a real bug and passes through.
|
|
76
|
+
function namespaceFailure({ error }, _optional = {}) {
|
|
77
|
+
const code = error?.code;
|
|
78
|
+
if (code === 'EACCES' || code === 'EPERM')
|
|
79
|
+
return new ImportHistoryUnavailable({ code: 'IMPORT_PAYLOADS_UNMOVABLE', status: 503, message: UNMOVABLE }, { cause: error });
|
|
80
|
+
if (code === 'ENOSPC')
|
|
81
|
+
return new ImportHistoryUnavailable({ code: 'IMPORT_PAYLOADS_UNMOVABLE', status: 507, message: 'There is not enough free disk space to prepare imports. Free up space and try again.' }, { cause: error });
|
|
82
|
+
return error;
|
|
83
|
+
}
|
|
84
|
+
export function ensurePayloadNamespace({ root, paths, fs }, _optional = {}) {
|
|
85
|
+
try {
|
|
86
|
+
// The marker makes root enumeration a one-time migration cost.
|
|
87
|
+
const marker = fs.kind({ file: paths.marker });
|
|
88
|
+
if (marker === 'file')
|
|
89
|
+
return;
|
|
90
|
+
if (marker !== 'missing')
|
|
91
|
+
throw new ImportHistoryUnavailable({ code: 'IMPORT_PAYLOADS_UNMOVABLE', status: 503, message: UNMOVABLE });
|
|
92
|
+
ensurePayloadDirectory({ paths, fs });
|
|
93
|
+
const names = fs.readdir({ dir: root });
|
|
94
|
+
// ZIP precedes metadata on write and on migration.
|
|
95
|
+
for (const suffix of ['.upload.zip', '.upload.json', '.stage'])
|
|
96
|
+
movePass({ root, paths, fs, names, suffix });
|
|
97
|
+
fs.fsyncDir({ dir: paths.dir });
|
|
98
|
+
fs.fsyncDir({ dir: root });
|
|
99
|
+
writeMarker({ paths, fs });
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
throw namespaceFailure({ error });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Removes a stage no in-progress record owns; an unreadable record keeps its stage untouched.
|
|
106
|
+
function expireStage({ entry, paths, fs, statusOf }, _optional = {}) {
|
|
107
|
+
// An unreadable owner is not evidence that its stage is orphaned.
|
|
108
|
+
const status = statusOf({ importId: entry.id });
|
|
109
|
+
if (status === 'terminal' || status === 'absent')
|
|
110
|
+
fs.rm({ file: paths.stage({ importId: entry.id }), recursive: true });
|
|
111
|
+
}
|
|
112
|
+
// A zip whose metadata is missing or unreadable is an orphan (a crash between the two writes), so it expires at once;
|
|
113
|
+
// otherwise it expires only past its one-hour claim window. A metadata file we cannot read is kept, never guessed at.
|
|
114
|
+
function isUploadExpired({ entry, read, now }, _optional = {}) {
|
|
115
|
+
if (entry.suffix === '.upload.json' && read.state !== 'ok')
|
|
116
|
+
return false;
|
|
117
|
+
const metadata = read.state === 'ok' ? read.value : null;
|
|
118
|
+
return metadata === null || metadata.createdAt + 3_600_000 < now;
|
|
119
|
+
}
|
|
120
|
+
// Removes an upload (payload, then record) once it is past its one-hour claim window.
|
|
121
|
+
// Removes a zip whose metadata is missing or unreadable: a crash between the two writes.
|
|
122
|
+
function expireUpload({ entry, paths, fs, now, readUpload }, _optional = {}) {
|
|
123
|
+
if (!isUploadExpired({ entry, read: readUpload({ uploadId: entry.id }), now }))
|
|
124
|
+
return;
|
|
125
|
+
const zip = paths.upload({ uploadId: entry.id });
|
|
126
|
+
if (fs.kind({ file: zip }) === 'file')
|
|
127
|
+
fs.rm({ file: zip, recursive: false });
|
|
128
|
+
if (entry.suffix === '.upload.json')
|
|
129
|
+
fs.rm({ file: paths.uploadMeta({ uploadId: entry.id }), recursive: false });
|
|
130
|
+
}
|
|
131
|
+
export function expirePayloads({ paths, fs, clock, readUpload, statusOf, report }, _optional = {}) {
|
|
132
|
+
const now = clock.nowMs();
|
|
133
|
+
for (const name of fs.readdir({ dir: paths.dir })) {
|
|
134
|
+
const entry = classifyPayload({ name });
|
|
135
|
+
if (!entry)
|
|
136
|
+
continue;
|
|
137
|
+
try {
|
|
138
|
+
if (fs.kind({ file: `${paths.dir}/${name}` }) !== entry.kind)
|
|
139
|
+
continue;
|
|
140
|
+
if (entry.suffix === '.stage')
|
|
141
|
+
expireStage({ entry, paths, fs, statusOf });
|
|
142
|
+
else
|
|
143
|
+
expireUpload({ entry, paths, fs, now, readUpload });
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
report({ operation: 'expire-import-payload', error });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export function countStagedPayloads({ paths, fs }, _optional = {}) {
|
|
151
|
+
return fs.readdir({ dir: paths.dir }).filter(name => {
|
|
152
|
+
const entry = classifyPayload({ name });
|
|
153
|
+
return entry !== undefined && entry.suffix !== '.upload.json' && fs.kind({ file: `${paths.dir}/${name}` }) === entry.kind;
|
|
154
|
+
}).length;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=payload-namespace.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MinimalImportOutcome, SiteImportRecord, SiteImportStatus } from '@jini-ai/core/contracts/site/site-import-history';
|
|
2
|
+
export declare function isTerminal({ status }: {
|
|
3
|
+
status: SiteImportStatus;
|
|
4
|
+
}, _optional?: Record<string, never>): boolean;
|
|
5
|
+
export declare function assertTransition({ previous, row }: {
|
|
6
|
+
previous: SiteImportRecord | undefined;
|
|
7
|
+
row: SiteImportRecord;
|
|
8
|
+
}, _optional?: Record<string, never>): void;
|
|
9
|
+
export declare function toRowParams({ row, settledMs }: {
|
|
10
|
+
row: SiteImportRecord;
|
|
11
|
+
settledMs: number | null;
|
|
12
|
+
}, _optional?: Record<string, never>): {
|
|
13
|
+
importId: string;
|
|
14
|
+
principalId: string;
|
|
15
|
+
requestId: string | null;
|
|
16
|
+
status: SiteImportStatus;
|
|
17
|
+
createdMs: number;
|
|
18
|
+
settledMs: number | null;
|
|
19
|
+
expiresMs: number;
|
|
20
|
+
rowJson: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function minimalOutcome({ row }: {
|
|
23
|
+
row: SiteImportRecord;
|
|
24
|
+
}, _optional?: Record<string, never>): MinimalImportOutcome;
|
|
25
|
+
export declare function replayFenceFor({ source, digest }: {
|
|
26
|
+
source: SiteImportRecord['source'];
|
|
27
|
+
digest: string | undefined;
|
|
28
|
+
}, _optional?: Record<string, never>): {
|
|
29
|
+
fenceKind: 'sha256' | 'upload' | 'origin';
|
|
30
|
+
fenceValue: string;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SiteShareRefusal } from '../share-refusal.js';
|
|
2
|
+
export function isTerminal({ status }, _optional = {}) {
|
|
3
|
+
return status === 'ready' || status === 'failed';
|
|
4
|
+
}
|
|
5
|
+
const ALLOWED_NEXT = { verifying: ['verifying', 'needs-owner', 'failed'], 'needs-owner': ['creating', 'failed'], creating: ['creating', 'ready', 'failed'], ready: ['ready'], failed: [] };
|
|
6
|
+
function refuse({ message }, _optional = {}) {
|
|
7
|
+
throw new SiteShareRefusal({ code: 'INVALID_INPUT', message });
|
|
8
|
+
}
|
|
9
|
+
// Once the previous record is ready its link is trimmed to its origin, so both sides are compared by origin.
|
|
10
|
+
function sourceForCompare({ ready, source }, _optional = {}) {
|
|
11
|
+
return ready && 'url' in source ? { url: new URL(source.url).origin } : source;
|
|
12
|
+
}
|
|
13
|
+
function assertSameIdentity({ previous, row, ready }, _optional = {}) {
|
|
14
|
+
for (const key of ['importId', 'principalId', 'requestId', 'createdAt', 'sourceDigest']) {
|
|
15
|
+
if (previous[key] !== row[key])
|
|
16
|
+
refuse({ message: 'Import identity cannot change.' });
|
|
17
|
+
}
|
|
18
|
+
if (JSON.stringify(sourceForCompare({ ready, source: row.source })) !== JSON.stringify(sourceForCompare({ ready, source: previous.source })))
|
|
19
|
+
refuse({ message: 'Import identity cannot change.' });
|
|
20
|
+
}
|
|
21
|
+
function assertReadyUnchanged({ previous, row }, _optional = {}) {
|
|
22
|
+
const { adminUrl: _oldUrl, error: _oldError, ...before } = { ...previous, source: sourceForCompare({ ready: true, source: previous.source }) };
|
|
23
|
+
const { adminUrl: _newUrl, error: _newError, ...after } = { ...row, source: sourceForCompare({ ready: true, source: row.source }) };
|
|
24
|
+
if (JSON.stringify(before) !== JSON.stringify(after))
|
|
25
|
+
refuse({ message: 'Only import start results can change.' });
|
|
26
|
+
}
|
|
27
|
+
export function assertTransition({ previous, row }, _optional = {}) {
|
|
28
|
+
if (!previous) {
|
|
29
|
+
if (row.status !== 'verifying')
|
|
30
|
+
refuse({ message: 'Invalid import transition.' });
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (!ALLOWED_NEXT[previous.status].includes(row.status))
|
|
34
|
+
refuse({ message: 'Invalid import transition.' });
|
|
35
|
+
assertSameIdentity({ previous, row, ready: previous.status === 'ready' });
|
|
36
|
+
if (previous.status === 'ready')
|
|
37
|
+
assertReadyUnchanged({ previous, row });
|
|
38
|
+
}
|
|
39
|
+
export function toRowParams({ row, settledMs }, _optional = {}) {
|
|
40
|
+
const detail = isTerminal(row) && 'url' in row.source ? { ...row, source: { url: new URL(row.source.url).origin } } : row;
|
|
41
|
+
return { importId: row.importId, principalId: row.principalId, requestId: row.requestId ?? null, status: row.status, createdMs: Date.parse(row.createdAt), settledMs, expiresMs: row.expiresAt, rowJson: JSON.stringify(detail) };
|
|
42
|
+
}
|
|
43
|
+
export function minimalOutcome({ row }, _optional = {}) {
|
|
44
|
+
return {
|
|
45
|
+
importId: row.importId, status: row.status, newSiteId: row.newSiteId, newSiteName: row.newSiteName, displayName: row.displayName, createdAt: row.createdAt,
|
|
46
|
+
source: isTerminal(row) && 'url' in row.source ? { url: new URL(row.source.url).origin } : row.source,
|
|
47
|
+
...(row.adminUrl === undefined ? {} : { adminUrl: row.adminUrl }),
|
|
48
|
+
...(row.error === undefined ? {} : { error: row.error }),
|
|
49
|
+
...(row.hasEncryptedKeys === undefined ? {} : { hasEncryptedKeys: row.hasEncryptedKeys }),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// The replay fence is shared by live admission and legacy backfill so both pick the same kind and value for one source:
|
|
53
|
+
// an upload id when uploaded, else the archive digest, else (no digest known) the source's origin.
|
|
54
|
+
export function replayFenceFor({ source, digest }, _optional = {}) {
|
|
55
|
+
if ('uploadId' in source)
|
|
56
|
+
return { fenceKind: 'upload', fenceValue: source.uploadId };
|
|
57
|
+
if (digest === undefined)
|
|
58
|
+
return { fenceKind: 'origin', fenceValue: new URL(source.url).origin };
|
|
59
|
+
return { fenceKind: 'sha256', fenceValue: digest.toLowerCase() };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=rows.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SqliteSyncClient } from '@jini-ai/core/contracts/storage';
|
|
2
|
+
export declare function migrateImportIndex({ db, clock }: {
|
|
3
|
+
db: SqliteSyncClient;
|
|
4
|
+
clock: {
|
|
5
|
+
nowMs(): number;
|
|
6
|
+
};
|
|
7
|
+
}, _optional?: Record<string, never>): void;
|
|
8
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ImportHistoryUnavailable } from './errors.js';
|
|
2
|
+
import { IMPORT_INDEX_V1_DDL } from './migrations/site-imports-v1.js';
|
|
3
|
+
import { IMPORT_INDEX_MIGRATION_CHECKSUMS } from './migrations/checksums.js';
|
|
4
|
+
const steps = [{ id: 'site-imports-v1', checksum: IMPORT_INDEX_MIGRATION_CHECKSUMS['site-imports-v1'], ddl: IMPORT_INDEX_V1_DDL }];
|
|
5
|
+
export function migrateImportIndex({ db, clock }, _optional = {}) {
|
|
6
|
+
const version = Number(db.pragma('user_version', { simple: true }));
|
|
7
|
+
if (version > 1)
|
|
8
|
+
throw new ImportHistoryUnavailable({ code: 'IMPORT_HISTORY_NEWER', status: 503, message: 'Import history was written by a newer version of the app. Update the app to continue.' });
|
|
9
|
+
if (version === 0)
|
|
10
|
+
db.transaction(() => {
|
|
11
|
+
const current = Number(db.pragma('user_version', { simple: true }));
|
|
12
|
+
if (current !== 0)
|
|
13
|
+
return;
|
|
14
|
+
for (const step of steps) {
|
|
15
|
+
db.exec(step.ddl);
|
|
16
|
+
db.prepare('INSERT INTO site_import_migrations(id,checksum,applied_at) VALUES(?,?,?)').run(step.id, step.checksum, clock.nowMs());
|
|
17
|
+
}
|
|
18
|
+
db.prepare('INSERT INTO meta VALUES(?,?)').run('schema', 'site-imports-v1');
|
|
19
|
+
}).immediate();
|
|
20
|
+
const appliedVersion = Number(db.pragma('user_version', { simple: true }));
|
|
21
|
+
if (appliedVersion > 1)
|
|
22
|
+
throw new ImportHistoryUnavailable({ code: 'IMPORT_HISTORY_NEWER', status: 503, message: 'Import history was written by a newer version of the app. Update the app to continue.' });
|
|
23
|
+
if (appliedVersion !== 1)
|
|
24
|
+
throw new ImportHistoryUnavailable({ code: 'IMPORT_HISTORY_DAMAGED', status: 503, message: 'Import history could not be read. Imports are paused and nothing was changed. Contact support with this error ID.' });
|
|
25
|
+
const applied = db.prepare('SELECT id, checksum FROM site_import_migrations ORDER BY id').all();
|
|
26
|
+
const schema = db.prepare("SELECT value FROM meta WHERE key='schema'").get();
|
|
27
|
+
if (applied.length !== steps.length || applied.some((row, index) => row.id !== steps[index].id || row.checksum !== steps[index].checksum) || schema?.value !== 'site-imports-v1') {
|
|
28
|
+
throw new ImportHistoryUnavailable({ code: 'IMPORT_HISTORY_DAMAGED', status: 503, message: 'Import history could not be read. Imports are paused and nothing was changed. Contact support with this error ID.' });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ImportHistoryPolicy, SiteImportRecord, SiteImportStatus } from '@jini-ai/core/contracts/site/site-import-history';
|
|
2
|
+
import type { SqliteSyncClient } from '@jini-ai/core/contracts/storage';
|
|
3
|
+
export interface ImportIndexStore {
|
|
4
|
+
get(required: {
|
|
5
|
+
importId: string;
|
|
6
|
+
principalId: string;
|
|
7
|
+
}, optional?: Record<string, never>): SiteImportRecord | undefined;
|
|
8
|
+
statusOf(required: {
|
|
9
|
+
importId: string;
|
|
10
|
+
}, optional?: Record<string, never>): SiteImportStatus | undefined;
|
|
11
|
+
activeRows(required: Record<string, never>, optional?: Record<string, never>): SiteImportRecord[];
|
|
12
|
+
dueOwnerSetups(required: {
|
|
13
|
+
now: number;
|
|
14
|
+
}, optional?: Record<string, never>): SiteImportRecord[];
|
|
15
|
+
put(required: {
|
|
16
|
+
row: SiteImportRecord;
|
|
17
|
+
beforeWrite: (required: Record<string, never>, optional?: Record<string, never>) => void;
|
|
18
|
+
}, optional?: Record<string, never>): void;
|
|
19
|
+
}
|
|
20
|
+
export declare function createImportIndexStore({ db, clock, policy: _policy }: {
|
|
21
|
+
db: SqliteSyncClient;
|
|
22
|
+
clock: {
|
|
23
|
+
nowMs(): number;
|
|
24
|
+
};
|
|
25
|
+
policy: ImportHistoryPolicy;
|
|
26
|
+
}, _optional?: Record<string, never>): ImportIndexStore;
|
|
27
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { assertTransition, isTerminal, minimalOutcome, toRowParams } from './rows.js';
|
|
2
|
+
export function createImportIndexStore({ db, clock, policy: _policy }, _optional = {}) {
|
|
3
|
+
return {
|
|
4
|
+
get({ importId, principalId }, _optional = {}) {
|
|
5
|
+
const result = db.prepare('SELECT row_json FROM imports WHERE import_id = ? AND principal_id = ?').get(importId, principalId);
|
|
6
|
+
return result === undefined ? undefined : JSON.parse(result.row_json);
|
|
7
|
+
},
|
|
8
|
+
statusOf({ importId }, _optional = {}) {
|
|
9
|
+
return db.prepare('SELECT status FROM imports WHERE import_id = ?').get(importId)?.status;
|
|
10
|
+
},
|
|
11
|
+
activeRows(_required, _optional = {}) {
|
|
12
|
+
return db.prepare("SELECT row_json FROM imports WHERE status IN ('verifying','creating')").all().map(row => JSON.parse(row.row_json));
|
|
13
|
+
},
|
|
14
|
+
dueOwnerSetups({ now }, _optional = {}) {
|
|
15
|
+
return db.prepare("SELECT row_json FROM imports WHERE status = 'needs-owner' AND expires_ms < ?").all(now).map(row => JSON.parse(row.row_json));
|
|
16
|
+
},
|
|
17
|
+
put({ row, beforeWrite }, _optional = {}) {
|
|
18
|
+
db.transaction(() => {
|
|
19
|
+
const prior = db.prepare('SELECT row_json, settled_ms FROM imports WHERE import_id = ?').get(row.importId);
|
|
20
|
+
assertTransition({ previous: prior === undefined ? undefined : JSON.parse(prior.row_json), row });
|
|
21
|
+
beforeWrite({}, {});
|
|
22
|
+
// Settlement and acceptance are distinct clocks.
|
|
23
|
+
const settledMs = prior?.settled_ms ?? (isTerminal(row) ? clock.nowMs() : null);
|
|
24
|
+
const params = toRowParams({ row, settledMs });
|
|
25
|
+
// A ready row and its fence commit together.
|
|
26
|
+
db.prepare('INSERT INTO imports(import_id,principal_id,request_id,status,created_ms,settled_ms,expires_ms,row_json) VALUES(@importId,@principalId,@requestId,@status,@createdMs,@settledMs,@expiresMs,@rowJson) ON CONFLICT(import_id) DO UPDATE SET status=excluded.status, settled_ms=COALESCE(imports.settled_ms,excluded.settled_ms), expires_ms=excluded.expires_ms, row_json=excluded.row_json').run(params);
|
|
27
|
+
if (row.requestId !== undefined)
|
|
28
|
+
db.prepare('UPDATE replay SET outcome_json = ? WHERE principal_id = ? AND request_id = ? AND import_id = ?').run(JSON.stringify(minimalOutcome({ row })), row.principalId, row.requestId, row.importId);
|
|
29
|
+
}).immediate();
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ImportHistoryPolicy } from '@jini-ai/core/contracts/site/site-import-history';
|
|
2
|
+
import type { SqliteSyncClient } from '@jini-ai/core/contracts/storage';
|
|
3
|
+
export declare function sweepExpired({ db, clock, policy }: {
|
|
4
|
+
db: SqliteSyncClient;
|
|
5
|
+
clock: {
|
|
6
|
+
nowMs(): number;
|
|
7
|
+
};
|
|
8
|
+
policy: ImportHistoryPolicy;
|
|
9
|
+
}, _optional?: Record<string, never>): void;
|
|
10
|
+
//# sourceMappingURL=sweep.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function sweepExpired({ db, clock, policy }, _optional = {}) {
|
|
2
|
+
const now = clock.nowMs();
|
|
3
|
+
const highWater = db.prepare("SELECT value FROM meta WHERE key='last_sweep_ms'").get();
|
|
4
|
+
if (highWater !== undefined && now < Number(highWater.value))
|
|
5
|
+
return;
|
|
6
|
+
let count;
|
|
7
|
+
do {
|
|
8
|
+
count = db.transaction(() => {
|
|
9
|
+
const rows = db.prepare('SELECT import_id FROM imports WHERE settled_ms <= ? ORDER BY settled_ms LIMIT 500').all(now - policy.historyVisibleMs);
|
|
10
|
+
for (const row of rows)
|
|
11
|
+
db.prepare('DELETE FROM imports WHERE import_id = ?').run(row.import_id);
|
|
12
|
+
return rows.length;
|
|
13
|
+
}).immediate();
|
|
14
|
+
} while (count === 500);
|
|
15
|
+
do {
|
|
16
|
+
count = db.transaction(() => {
|
|
17
|
+
const rows = db.prepare('SELECT principal_id, request_id FROM replay WHERE accepted_ms <= ? ORDER BY accepted_ms LIMIT 500').all(now - policy.replayFenceMs);
|
|
18
|
+
// The composite PK is required for replay deletion.
|
|
19
|
+
for (const row of rows)
|
|
20
|
+
db.prepare('DELETE FROM replay WHERE principal_id = ? AND request_id = ?').run(row.principal_id, row.request_id);
|
|
21
|
+
return rows.length;
|
|
22
|
+
}).immediate();
|
|
23
|
+
} while (count === 500);
|
|
24
|
+
db.prepare("INSERT INTO meta(key,value) VALUES('last_sweep_ms',?) ON CONFLICT(key) DO UPDATE SET value=excluded.value").run(String(now));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=sweep.js.map
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/** One stored row's value the scans read; the host's column names stay behind {@link KeepOffStore}. */
|
|
2
|
+
type RowId = string | number;
|
|
3
|
+
/**
|
|
4
|
+
* The imported database as the host stores it: the few reads and writes this step makes, with the
|
|
5
|
+
* host's tables and columns behind them. `close` releases the connection and is always called.
|
|
6
|
+
*/
|
|
7
|
+
export interface KeepOffStore {
|
|
8
|
+
/** The active theme id of every workspace's presentation settings. */
|
|
9
|
+
activeThemeIds(): Promise<string[]>;
|
|
10
|
+
/** Moves every workspace whose active theme is `from` onto `to`. */
|
|
11
|
+
reassignActiveTheme(required: {
|
|
12
|
+
from: string;
|
|
13
|
+
to: string;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
/** Published pages whose body is HTML. */
|
|
16
|
+
publishedHtmlPages(): Promise<{
|
|
17
|
+
id: RowId;
|
|
18
|
+
title: unknown;
|
|
19
|
+
bodyHtml: string | null;
|
|
20
|
+
}[]>;
|
|
21
|
+
draftPage(required: {
|
|
22
|
+
id: RowId;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
menus(): Promise<{
|
|
25
|
+
id: RowId;
|
|
26
|
+
title: unknown;
|
|
27
|
+
docJson: string;
|
|
28
|
+
}[]>;
|
|
29
|
+
setMenuDoc(required: {
|
|
30
|
+
id: RowId;
|
|
31
|
+
docJson: string;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
forms(): Promise<{
|
|
34
|
+
id: RowId;
|
|
35
|
+
name: unknown;
|
|
36
|
+
fieldsJson: string;
|
|
37
|
+
}[]>;
|
|
38
|
+
disableForm(required: {
|
|
39
|
+
id: RowId;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
close(): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
/** The host's plain-word notice for each thing this step keeps off; every member is REQUIRED. */
|
|
44
|
+
export interface KeepOffNotices {
|
|
45
|
+
setAside(required: {
|
|
46
|
+
fallback: string;
|
|
47
|
+
}): string;
|
|
48
|
+
themeKeptOff(required: {
|
|
49
|
+
themeId: string;
|
|
50
|
+
}): string;
|
|
51
|
+
pageDrafted(required: {
|
|
52
|
+
title: string;
|
|
53
|
+
}): string;
|
|
54
|
+
morePagesDrafted: {
|
|
55
|
+
singular(required: {
|
|
56
|
+
count: number;
|
|
57
|
+
}): string;
|
|
58
|
+
plural(required: {
|
|
59
|
+
count: number;
|
|
60
|
+
}): string;
|
|
61
|
+
};
|
|
62
|
+
menuKeptOff(required: {
|
|
63
|
+
title: string;
|
|
64
|
+
id: RowId;
|
|
65
|
+
}): string;
|
|
66
|
+
moreMenusKeptOff(required: {
|
|
67
|
+
count: number;
|
|
68
|
+
}): string;
|
|
69
|
+
formDisabled(required: {
|
|
70
|
+
name: string;
|
|
71
|
+
id: RowId;
|
|
72
|
+
}): string;
|
|
73
|
+
moreFormsDisabled(required: {
|
|
74
|
+
count: number;
|
|
75
|
+
}): string;
|
|
76
|
+
}
|
|
77
|
+
/** What the host owns: the page sanitizer whose allow-list decides "code", the no-theme id and the notice copy. */
|
|
78
|
+
export interface KeepOffHost {
|
|
79
|
+
/** Runs the shared page sanitizer, reporting every element/attribute it would drop. */
|
|
80
|
+
sanitizePageHtml(required: {
|
|
81
|
+
html: string;
|
|
82
|
+
}, optional: {
|
|
83
|
+
reportDrops: (report: {
|
|
84
|
+
dropped: Readonly<Record<string, unknown>>;
|
|
85
|
+
}) => void;
|
|
86
|
+
}): unknown;
|
|
87
|
+
/** The theme id meaning "no theme"; it is never moved. */
|
|
88
|
+
readonly noThemeId: string;
|
|
89
|
+
readonly notices: KeepOffNotices;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Ids of live theme trees that are not byte-identical to the copy this new site already holds.
|
|
93
|
+
* Must run before restore replaces those trees.
|
|
94
|
+
* @complexity O(staged theme files + their bytes), bounded by the 300 MiB import cap.
|
|
95
|
+
*/
|
|
96
|
+
export declare function unrecognisedThemes(required: {
|
|
97
|
+
root: string;
|
|
98
|
+
dir: string;
|
|
99
|
+
files: readonly string[];
|
|
100
|
+
liveThemes: ReadonlySet<string>;
|
|
101
|
+
}): Set<string>;
|
|
102
|
+
/**
|
|
103
|
+
* Whether a page body counts as code: `true` unless the allow-list keeps every element and
|
|
104
|
+
* attribute and no attribute value holds markup or an escape.
|
|
105
|
+
* @complexity O(html length).
|
|
106
|
+
*/
|
|
107
|
+
export declare function pageBodyMayRunScript(required: {
|
|
108
|
+
html: string;
|
|
109
|
+
host: KeepOffHost;
|
|
110
|
+
}): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Restore's one step that decides what stays on in the new database.
|
|
113
|
+
* @returns Notices for the person importing, in plain words.
|
|
114
|
+
* @throws Whatever the database throws; the caller's restore then fails and cleans up.
|
|
115
|
+
*/
|
|
116
|
+
export declare function keepImportedCodeOff(required: {
|
|
117
|
+
dbPath: string;
|
|
118
|
+
fallback: string;
|
|
119
|
+
liveThemes: ReadonlySet<string>;
|
|
120
|
+
unrecognised: ReadonlySet<string>;
|
|
121
|
+
setAside: boolean;
|
|
122
|
+
openStore: (required: {
|
|
123
|
+
filePath: string;
|
|
124
|
+
}) => KeepOffStore;
|
|
125
|
+
host: KeepOffHost;
|
|
126
|
+
}): Promise<string[]>;
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=import-keep-off.d.ts.map
|