@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,268 @@
|
|
|
1
|
+
import type { FetchQueryAdapter } from "@jini-ai/core/fetch";
|
|
2
|
+
import type { AdminPublishCredentialProviderId, AdminPublishCredentialSummary, AdminPublishCredentialVerification, AdminPublishExecutionMode, AdminPublishConnectionInput } from "@jini-ai/core/contracts/site/api-security-api-types";
|
|
3
|
+
import type { AdminPublishTargetCredentialSpec, AdminPublishTargetDescriptor } from "../rules.js";
|
|
4
|
+
import type { Translate } from "@jini-ai/core/text";
|
|
5
|
+
/**
|
|
6
|
+
* @file The Static Site tab's credential-management section — one always-visible row per provider,
|
|
7
|
+
* each with its own token input, save action, and connected/not-connected status. See
|
|
8
|
+
* `StaticSiteTab.tsx`'s `PublishCredentialsSection` header for the UI half of this story.
|
|
9
|
+
*
|
|
10
|
+
* ## 2026-08-15 redesign — a settings form, not a collection to manage
|
|
11
|
+
*
|
|
12
|
+
* This hook used to model credentials the way a CRUD screen models any collection: a list, an
|
|
13
|
+
* "Add credential" button, a provider `<select>`, a user-invented `label`, and per-row
|
|
14
|
+
* edit/delete/make-default actions. The owner's own read: "'Add credential' should be gone. Just
|
|
15
|
+
* list the providers, labels, and access token space, and that's it" — the whole point of an
|
|
16
|
+
* "Add" flow is asking the operator to create and name an object before they can type a token, and
|
|
17
|
+
* there is nothing here to name: the deploy registry's descriptors (the `targets` this hook is
|
|
18
|
+
* given) already name every host a token can be saved for, and each host's credential fields.
|
|
19
|
+
* So this hook now exposes {@link PublishCredentialRowState}
|
|
20
|
+
* per provider instead of a form's worth of shared state — no `providerId`/`label` picker, no
|
|
21
|
+
* isFormOpen/editingId mode split, no delete or default-promotion affordance (the data model still
|
|
22
|
+
* supports more than one saved connection per provider and un-defaulting one via delete — see
|
|
23
|
+
* `rules.ts`'s `PUBLISH_CREDENTIAL_ROW_LABEL` doc — this UI just never exposes that).
|
|
24
|
+
*
|
|
25
|
+
* ## A stored credential is NEVER read back — this is why every row's inputs start blank
|
|
26
|
+
*
|
|
27
|
+
* `AdminPublishCredentialSummary` carries no token, no ciphertext, and deliberately no masked suffix
|
|
28
|
+
* (see that type's own doc in `lib/api.ts`). So a row's field draft state (`values`) can only ever
|
|
29
|
+
* start blank, connected or not — a blank `token` at save time is therefore not "the operator left it
|
|
30
|
+
* empty by mistake"; on an already-connected row it is the ONLY way to express "nothing to change
|
|
31
|
+
* here" (`credentialFormReadyToSave`, `rules.ts`, disables Save in that case rather than
|
|
32
|
+
* sending a no-op write).
|
|
33
|
+
*
|
|
34
|
+
* ## Save decides CREATE vs. UPDATE by looking at what is already there, not at UI mode
|
|
35
|
+
*
|
|
36
|
+
* {@link save} reads the provider's current DEFAULT connection via `rules.ts`'s
|
|
37
|
+
* `defaultCredentialForProvider` (the exact row a real publish would use). If one exists, save PUTs
|
|
38
|
+
* to its id, replacing the connection but leaving its own label untouched. If none exists, save
|
|
39
|
+
* POSTs a brand-new one labeled {@link PUBLISH_CREDENTIAL_ROW_LABEL} — the one fixed label this whole
|
|
40
|
+
* flat-list UI ever writes, which satisfies the server's still-live `(workspace_id, provider_id,
|
|
41
|
+
* label)` UNIQUE constraint without ever asking an operator to type one. Neither branch sends
|
|
42
|
+
* `isDefault`: a brand-new connection auto-defaults server-side as a provider's first-ever saved
|
|
43
|
+
* connection (`publish-credentials/store.ts`'s `decideCreateDefault`), and replacing an existing
|
|
44
|
+
* default's connection never changes which row is default.
|
|
45
|
+
*
|
|
46
|
+
* ## `verify` — the "hit verify on the token" button the assistant's own guidance already assumed existed
|
|
47
|
+
*
|
|
48
|
+
* 2026-08-16 (see `ADS-memory/reports/verification/2026-08-16-live-publish-through-assistant.md`):
|
|
49
|
+
* the assistant's own capability tool told a human to "go verify the GitHub token" through this admin
|
|
50
|
+
* whenever the in-process verification cache went cold (e.g. right after a restart), but no control
|
|
51
|
+
* ever called `POST .../credentials/:id/verify` — the backend route worked, nothing in this hook or
|
|
52
|
+
* `StaticSiteTab.tsx` reached it. {@link verify} closes that gap: same optimistic-local-update
|
|
53
|
+
* philosophy as {@link save} above (no unconditional refetch), but it can only ever update a row that
|
|
54
|
+
* is ALREADY connected — there is no credential id to verify before one exists.
|
|
55
|
+
*
|
|
56
|
+
* ## The row list is optimistically maintained locally, not refetched after every write
|
|
57
|
+
*
|
|
58
|
+
* `save` splices its own result into the local `credentials` array rather than re-running
|
|
59
|
+
* `listCredentials()` — one round trip per write instead of two, matching the CRUD hook this
|
|
60
|
+
* replaces. Draft field values are cleared back to blank on a successful save (there is
|
|
61
|
+
* nothing left to keep typed — the row now reads its "Connected" status from the fresh summary).
|
|
62
|
+
*/
|
|
63
|
+
export interface PublishCredentialRowState {
|
|
64
|
+
readonly providerId: AdminPublishCredentialProviderId;
|
|
65
|
+
/** The host's display label, from its descriptor — a proper noun, never translated. */
|
|
66
|
+
readonly label: string;
|
|
67
|
+
/** The host's credential form: its fields (in display order), help and token field. */
|
|
68
|
+
readonly credential: AdminPublishTargetCredentialSpec;
|
|
69
|
+
/** This provider's saved DEFAULT connection, if any (`rules.ts`'s `defaultCredentialForProvider`)
|
|
70
|
+
* — `undefined` means "not connected yet". Never carries a token or `accountId`; see this file's
|
|
71
|
+
* header for why every row's connection fields always start blank regardless of this value. */
|
|
72
|
+
readonly saved: AdminPublishCredentialSummary | undefined;
|
|
73
|
+
/** Draft values typed into {@link credential}'s fields, keyed by field name. */
|
|
74
|
+
readonly values: Readonly<Record<string, string>>;
|
|
75
|
+
readonly saving: boolean;
|
|
76
|
+
readonly error: string | null;
|
|
77
|
+
/** True while {@link PublishCredentialsController.verify} has an in-flight request for THIS
|
|
78
|
+
* provider's saved row. A no-op button click while already `true` is guarded the same way
|
|
79
|
+
* `save`'s own `row.saving` disables its button — see `CredentialStepDone`'s Verify button. */
|
|
80
|
+
readonly verifying: boolean;
|
|
81
|
+
/** The most recent explicit re-verify's result for this row, `undefined` until {@link verify} has
|
|
82
|
+
* resolved at least once this session — deliberately session-only, never seeded from the initial
|
|
83
|
+
* load: the server has no "last verification" to hand back on `GET`, only the durable
|
|
84
|
+
* `saved.accountLabel` half of it (see that field's own doc). Distinct from `error` below: a
|
|
85
|
+
* `"invalid"`/`"unreachable"` `status` here is the provider's own answer, not a failure of this
|
|
86
|
+
* UI's request — {@link error} is reserved for a genuine transport/request failure instead. */
|
|
87
|
+
readonly verification: AdminPublishCredentialVerification | undefined;
|
|
88
|
+
/** A transport/request failure from {@link verify} itself (network down, 5xx) — NOT a
|
|
89
|
+
* `"invalid"`/`"unreachable"` provider answer, which is a normal {@link verification} result, not
|
|
90
|
+
* an error. See this file's `publishCredentialVerifyErrorMessage` import for the translated text. */
|
|
91
|
+
readonly verifyError: string | null;
|
|
92
|
+
/** The credential id the picker is promoting to this provider's default right now, `null` when no
|
|
93
|
+
* promotion is in flight. The picker shows this id (not {@link saved}'s) while it is set, so the
|
|
94
|
+
* choice doesn't appear to snap back before the server has answered. */
|
|
95
|
+
readonly selectingCredentialId: string | null;
|
|
96
|
+
/** Why the last promotion for this provider failed, `null` otherwise. Cleared by the next pick. */
|
|
97
|
+
readonly selectError: string | null;
|
|
98
|
+
}
|
|
99
|
+
export interface PublishCredentialsController {
|
|
100
|
+
/** One entry per deploy target that takes a saved credential, in the registry's order —
|
|
101
|
+
* `undefined` until both the credentials and the targets have loaded, same "no data yet" convention every other hook in
|
|
102
|
+
* this panel uses (`StaticExportController.run`, `StaticPublishController.run`). */
|
|
103
|
+
rows: readonly PublishCredentialRowState[] | undefined;
|
|
104
|
+
/** The server's own execution capability for this instance — `undefined` until the same first
|
|
105
|
+
* load resolves. Never derived any other way; see `AdminPublishExecutionMode`'s doc. */
|
|
106
|
+
executionMode: AdminPublishExecutionMode | undefined;
|
|
107
|
+
loadError: string | null;
|
|
108
|
+
/** True while ANY write that changes which token a publish uses is in flight — a default-promotion
|
|
109
|
+
* ({@link selectCredential}) or a connection replacement ({@link save}). The server picks a
|
|
110
|
+
* publish's credential as whichever row is default when the publish request lands
|
|
111
|
+
* (`static-publish/adapter.ts`'s `resolvePublishCredentialForSite`; the request carries no
|
|
112
|
+
* credential id), so a Publish sent inside this window would go out on the OLD token. The Static
|
|
113
|
+
* Site tab's Publish button is disabled on this. (terra review 2026-09-20, finding 1.) */
|
|
114
|
+
credentialChangePending: boolean;
|
|
115
|
+
/** Sets one credential field's draft value on one provider's row. */
|
|
116
|
+
setField: (required: {
|
|
117
|
+
providerId: AdminPublishCredentialProviderId;
|
|
118
|
+
fieldName: string;
|
|
119
|
+
value: string;
|
|
120
|
+
}, optional?: {}) => void;
|
|
121
|
+
/** Creates or replaces one provider's saved connection from its own row's current field values
|
|
122
|
+
* — see this file's header for the create-vs-update decision. A no-op if
|
|
123
|
+
* `credentialFormReadyToSave` (`rules.ts`) says this row is not ready (the same guard the row's
|
|
124
|
+
* own Save button is disabled on, kept here too so a direct call — as this file's own tests make —
|
|
125
|
+
* cannot bypass it). Resolves either way — a failure is surfaced through that row's own `error`. */
|
|
126
|
+
save: (providerId: AdminPublishCredentialProviderId) => Promise<void>;
|
|
127
|
+
/** Every saved connection for one provider, not just its default — `rows` above only ever carries
|
|
128
|
+
* {@link defaultCredentialForProvider}'s pick, which is enough for the always-visible credential
|
|
129
|
+
* row but not for the picker `StaticSiteTab.tsx`'s "which saved token publishes" dropdown needs
|
|
130
|
+
* once a provider has more than one (the owner's own original ask: a dropdown to choose which of a
|
|
131
|
+
* provider's saved access tokens publishes). Added rather than widening `rows`
|
|
132
|
+
* itself so every existing caller of `rows` keeps reading exactly the one row it always has. */
|
|
133
|
+
credentialsForProvider: (providerId: AdminPublishCredentialProviderId) => readonly AdminPublishCredentialSummary[];
|
|
134
|
+
/** Promotes one already-saved connection to this provider's default — the same `isDefault`
|
|
135
|
+
* mechanic the Security page's own "Make default" already writes through
|
|
136
|
+
* (`use-access-tokens.hooks.ts`'s `makeDefault`), reused here rather than reinvented. Never
|
|
137
|
+
* splices optimistically: promoting one row un-defaults whichever OTHER row held it server-side,
|
|
138
|
+
* so the local list changes only once the write has resolved (`rules.ts`'s `withPromotedDefault`),
|
|
139
|
+
* then re-fetches to reconcile. A failed re-fetch keeps that confirmed local promotion rather than
|
|
140
|
+
* leaving the old default on screen after the server has already switched.
|
|
141
|
+
*
|
|
142
|
+
* A no-op if `credentialId` is already this provider's default, or while a promotion for this
|
|
143
|
+
* provider is still in flight. Never rejects — a failure lands in that row's
|
|
144
|
+
* {@link PublishCredentialRowState.selectError}. */
|
|
145
|
+
selectCredential: (required: {
|
|
146
|
+
providerId: AdminPublishCredentialProviderId;
|
|
147
|
+
credentialId: string;
|
|
148
|
+
}, optional?: {}) => Promise<void>;
|
|
149
|
+
/** Re-checks the provider's currently connected (default) row against its real provider right now
|
|
150
|
+
* — the UI half of `POST .../credentials/:id/verify` (`publish-credentials.ts`'s route doc), for
|
|
151
|
+
* when the automatic verify-on-save result is stale (a rotated token) or was lost (an in-memory
|
|
152
|
+
* cache that a server restart clears — see `AdminPublishCredentialSummary.accountLabel`'s doc for
|
|
153
|
+
* why `saved.accountLabel` survives that even though a single verify RESPONSE does not). A no-op,
|
|
154
|
+
* resolving immediately, if this provider has no saved (connected) row yet — there is nothing to
|
|
155
|
+
* verify. Never throws; a failure is surfaced through that row's own {@link
|
|
156
|
+
* PublishCredentialRowState.verifyError}. */
|
|
157
|
+
verify: (providerId: AdminPublishCredentialProviderId) => Promise<void>;
|
|
158
|
+
t: Translate;
|
|
159
|
+
}
|
|
160
|
+
/** One row's draft input + busy/error state — kept in a map keyed by provider id so each row's own
|
|
161
|
+
* typing and in-flight save/verify are fully independent of every other row's. */
|
|
162
|
+
export interface RowFormState {
|
|
163
|
+
values: Record<string, string>;
|
|
164
|
+
saving: boolean;
|
|
165
|
+
error: string | null;
|
|
166
|
+
verifying: boolean;
|
|
167
|
+
verification: AdminPublishCredentialVerification | undefined;
|
|
168
|
+
verifyError: string | null;
|
|
169
|
+
/** The saved credential `verification`/`verifyError` describe. The picker can make a different
|
|
170
|
+
* token the default after a verify, and a verdict about the old token must not be shown for the new. */
|
|
171
|
+
verifiedCredentialId: string | null;
|
|
172
|
+
}
|
|
173
|
+
/** One provider's token-picker promotion — see {@link PublishCredentialRowState.selectingCredentialId}
|
|
174
|
+
* and {@link PublishCredentialRowState.selectError}. */
|
|
175
|
+
export interface SelectionState {
|
|
176
|
+
pendingId: string | null;
|
|
177
|
+
error: string | null;
|
|
178
|
+
}
|
|
179
|
+
export declare function usePublishCredentials({ port, t, locale, targets, hooks, deps }: {
|
|
180
|
+
port: {
|
|
181
|
+
listCredentials: () => Promise<{
|
|
182
|
+
credentials: AdminPublishCredentialSummary[];
|
|
183
|
+
executionMode: AdminPublishExecutionMode;
|
|
184
|
+
}>;
|
|
185
|
+
createCredential: (required: {
|
|
186
|
+
label: string;
|
|
187
|
+
connection: AdminPublishConnectionInput;
|
|
188
|
+
isDefault?: boolean;
|
|
189
|
+
}) => Promise<AdminPublishCredentialSummary & {
|
|
190
|
+
verification?: AdminPublishCredentialVerification;
|
|
191
|
+
}>;
|
|
192
|
+
updateCredential: (required: {
|
|
193
|
+
id: string;
|
|
194
|
+
input: {
|
|
195
|
+
label?: string;
|
|
196
|
+
connection?: AdminPublishConnectionInput;
|
|
197
|
+
isDefault?: boolean;
|
|
198
|
+
};
|
|
199
|
+
}) => Promise<AdminPublishCredentialSummary & {
|
|
200
|
+
verification?: AdminPublishCredentialVerification;
|
|
201
|
+
}>;
|
|
202
|
+
deleteCredential: (required: {
|
|
203
|
+
id: string;
|
|
204
|
+
}) => Promise<void>;
|
|
205
|
+
verifyCredential: (required: {
|
|
206
|
+
id: string;
|
|
207
|
+
}) => Promise<AdminPublishCredentialVerification>;
|
|
208
|
+
};
|
|
209
|
+
t: Translate;
|
|
210
|
+
locale: string;
|
|
211
|
+
targets: readonly AdminPublishTargetDescriptor[] | undefined;
|
|
212
|
+
hooks: Pick<FetchQueryAdapter, "useFetchQuery">;
|
|
213
|
+
deps: {
|
|
214
|
+
classifyCredentialSubmitError: (required: {
|
|
215
|
+
error: unknown;
|
|
216
|
+
}) => {
|
|
217
|
+
kind: "duplicate-label";
|
|
218
|
+
} | {
|
|
219
|
+
kind: "validation";
|
|
220
|
+
detail: string;
|
|
221
|
+
} | {
|
|
222
|
+
kind: "generic";
|
|
223
|
+
};
|
|
224
|
+
credentialDraftError: (required: {
|
|
225
|
+
value: string;
|
|
226
|
+
}, optional: {
|
|
227
|
+
locale: string;
|
|
228
|
+
required?: boolean;
|
|
229
|
+
}) => string | null;
|
|
230
|
+
translateCredentialMessage: (required: {
|
|
231
|
+
message: string;
|
|
232
|
+
locale: string;
|
|
233
|
+
}) => string;
|
|
234
|
+
describeApiError: (required: {
|
|
235
|
+
e: unknown;
|
|
236
|
+
fallback: string;
|
|
237
|
+
}) => string;
|
|
238
|
+
publishCredentialSaveErrorMessage: (required: {
|
|
239
|
+
locale: string;
|
|
240
|
+
error: string;
|
|
241
|
+
}) => string;
|
|
242
|
+
publishCredentialsLoadErrorMessage: (required: {
|
|
243
|
+
locale: string;
|
|
244
|
+
error: string;
|
|
245
|
+
}) => string;
|
|
246
|
+
publishCredentialSelectErrorMessage: (required: {
|
|
247
|
+
locale: string;
|
|
248
|
+
error: string;
|
|
249
|
+
}) => string;
|
|
250
|
+
publishCredentialVerifyErrorMessage: (required: {
|
|
251
|
+
locale: string;
|
|
252
|
+
error: string;
|
|
253
|
+
}) => string;
|
|
254
|
+
};
|
|
255
|
+
}, _optional?: {}): PublishCredentialsController;
|
|
256
|
+
export declare function bindPublishCredentials({ hooks, deps }: {
|
|
257
|
+
hooks: Parameters<typeof usePublishCredentials>[0]["hooks"] & {
|
|
258
|
+
useLocaleHook: () => string;
|
|
259
|
+
};
|
|
260
|
+
deps: Parameters<typeof usePublishCredentials>[0]["deps"] & {
|
|
261
|
+
port: Parameters<typeof usePublishCredentials>[0]["port"];
|
|
262
|
+
translate: (required: {
|
|
263
|
+
locale: string;
|
|
264
|
+
key: string;
|
|
265
|
+
}) => string;
|
|
266
|
+
};
|
|
267
|
+
}, _optional?: {}): ({ targets }: Pick<Parameters<typeof usePublishCredentials>[0], "targets">, _optional?: {}) => PublishCredentialsController;
|
|
268
|
+
//# sourceMappingURL=use-publish-credentials.hooks.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { credentialsForProvider } from "../rules.js";
|
|
3
|
+
import * as draft from "./publish-credential-draft.js";
|
|
4
|
+
import * as writes from "./publish-credential-writes.js";
|
|
5
|
+
import * as selection from "./publish-credential-selection.js";
|
|
6
|
+
// Seeds local state from the query's first successful load, exactly once — same shape
|
|
7
|
+
// `use-static-publish.hooks.ts`'s own `seededRef` uses. Later changes flow through `save` below,
|
|
8
|
+
// not through the query re-resolving (see this file's header on why writes are optimistic rather
|
|
9
|
+
// than refetch-driven).
|
|
10
|
+
// The picker's promotion state, kept apart from `formStates`: a `save` that lands mid-promotion
|
|
11
|
+
// resets its row's form state to blank, which must not also clear the in-flight flag Publish waits on.
|
|
12
|
+
// Synchronous duplicate guard for `selectCredential` — a ref, not `selections`, for the same reason
|
|
13
|
+
// `use-static-publish.hooks.ts`'s `publishingRef` documents: two calls in one tick both read the
|
|
14
|
+
// same stale state, and two racing promotions would leave the default to whichever PUT lands last.
|
|
15
|
+
// Same synchronous per-row guard for `save` — a doubled create collides on the fixed row label
|
|
16
|
+
// (terra review 2026-09-20, finding 5's sibling).
|
|
17
|
+
export function usePublishCredentials({ port, t, locale, targets, hooks, deps }, _optional = {}) {
|
|
18
|
+
const query = hooks.useFetchQuery({ key: ["deployment", "publish-credentials"], fetch: () => port.listCredentials() });
|
|
19
|
+
const [credentials, setCredentials] = useState(undefined);
|
|
20
|
+
const [executionMode, setExecutionMode] = useState(undefined);
|
|
21
|
+
const seededRef = useRef(false);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (seededRef.current || query.status === "loading" || !query.data)
|
|
24
|
+
return;
|
|
25
|
+
seededRef.current = true;
|
|
26
|
+
setCredentials(query.data.credentials);
|
|
27
|
+
setExecutionMode(query.data.executionMode);
|
|
28
|
+
}, [query.status, query.data]);
|
|
29
|
+
const loadError = query.error ? deps.publishCredentialsLoadErrorMessage({ locale, error: deps.describeApiError({ e: query.error, fallback: "unknown error" }) }) : null;
|
|
30
|
+
const [formStates, setFormStates] = useState({});
|
|
31
|
+
const [selections, setSelections] = useState({});
|
|
32
|
+
const selectingRef = useRef(new Set());
|
|
33
|
+
const savingRef = useRef(new Set());
|
|
34
|
+
const state = { port, t, locale, targets, deps, credentials, setCredentials, formStates, setFormStates, selections, setSelections, selectingRef, savingRef };
|
|
35
|
+
return {
|
|
36
|
+
rows: draft.rows(state), executionMode, loadError,
|
|
37
|
+
credentialChangePending: Object.values(formStates).some((state) => state.saving) || Object.values(selections).some((selection) => (selection?.pendingId ?? null) !== null),
|
|
38
|
+
setField: input => draft.setField({ ...state, ...input }),
|
|
39
|
+
save: providerId => writes.save({ ...state, providerId }),
|
|
40
|
+
credentialsForProvider: providerId => credentialsForProvider({ credentials: credentials ?? [], providerId }),
|
|
41
|
+
selectCredential: input => selection.selectCredential({ ...state, ...input }),
|
|
42
|
+
verify: providerId => writes.verify({ ...state, providerId }), t,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function bindPublishCredentials({ hooks, deps }, _optional = {}) {
|
|
46
|
+
return function useBoundPublishCredentials({ targets }, _optional = {}) {
|
|
47
|
+
const locale = hooks.useLocaleHook();
|
|
48
|
+
const t = (key) => deps.translate({ locale: locale, key: key });
|
|
49
|
+
return usePublishCredentials({ port: deps.port, t, locale, targets, hooks, deps });
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=use-publish-credentials.hooks.js.map
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { ExportRunSnapshot as AdminExportRunSnapshot } from "@jini-ai/core/contracts/site/export-run";
|
|
2
|
+
import type { FetchQueryAdapter } from "@jini-ai/core/fetch";
|
|
3
|
+
import type { StaticExportPort } from "@jini-ai/core/contracts/site/deployment-admin";
|
|
4
|
+
import { type Translate } from '@jini-ai/core/text';
|
|
5
|
+
/**
|
|
6
|
+
* @file Everything the Static Site tab's "Build static export" action does, so `StaticSiteTab.tsx`
|
|
7
|
+
* is only markup. Wired 2026-08-15 against `POST`/`GET .../system/export`
|
|
8
|
+
* (`host src/server/inbound/admin-http/routes/system/export-site.ts`) — see that route's header for the trigger+poll
|
|
9
|
+
* shape this hook mirrors: a real export is seconds to minutes, so a click starts the run and this
|
|
10
|
+
* hook polls the status route until it settles, rather than holding one request open.
|
|
11
|
+
*
|
|
12
|
+
* `run` is seeded from a `getSiteExportStatus()` read on mount (via `useFetchQuery`, once — see
|
|
13
|
+
* `seededRef` below) so a reload mid-export, or a second browser tab, still shows the real state
|
|
14
|
+
* instead of a blank "not started". After that first paint, `run` is owned entirely by
|
|
15
|
+
* {@link trigger} and the poll loop, never by a background refetch of the query — same "no
|
|
16
|
+
* `invalidates`, set state from the write's own response" reasoning `use-dockerfile-source.hooks.ts`'s
|
|
17
|
+
* header documents, extended here to the poll (which is this hook's OWN repeated read, not the
|
|
18
|
+
* query's).
|
|
19
|
+
*
|
|
20
|
+
* `clean` defaults to `false` and is never silently flipped by this hook — `exportSite` itself
|
|
21
|
+
* refuses to overwrite a non-empty output directory, and surfacing that refusal honestly (rather
|
|
22
|
+
* than working around it here) is the point: see `StaticSiteTab.tsx`'s own reason text for the
|
|
23
|
+
* checkbox.
|
|
24
|
+
*
|
|
25
|
+
* ## `useContentRefreshSubscription` — a bespoke reload, not the usual one-liner
|
|
26
|
+
*
|
|
27
|
+
* Staleness-bug generalization pass (see that hook's own header): an assistant run that called
|
|
28
|
+
* `deployment_trigger_export` (`host src/features/deployments/agent-tools.ts`) from a
|
|
29
|
+
* DIFFERENT tab/session should not leave this tab showing "Not started" indefinitely. This can't be
|
|
30
|
+
* the usual `useInvalidate()` one-liner (`use-media.hooks.ts`'s shape) because `run` is not read
|
|
31
|
+
* from `query.data` after the FIRST load — `seededRef` above deliberately blocks a later background
|
|
32
|
+
* refetch of the SAME `useFetchQuery` from re-seeding it, so invalidating that query would silently
|
|
33
|
+
* do nothing. Instead, {@link refreshRun} calls `port.getSiteExportStatus()` directly and sets
|
|
34
|
+
* `run` from the response, bypassing the query entirely — the same "reach past the query, call the
|
|
35
|
+
* port directly" shape `use-access-tokens.hooks.ts`'s own `reloadAllStores` uses for the identical
|
|
36
|
+
* reason. This is safe unconditionally, unlike a re-seed of `use-dockerfile-source.hooks.ts`'s
|
|
37
|
+
* `draft`: `run` is a pure status snapshot the operator only ever VIEWS, never types into, so there
|
|
38
|
+
* is no in-progress edit a background refresh could clobber. If the fresh status comes back
|
|
39
|
+
* `"running"`, the poll effect below picks it up on its own next render (it re-arms whenever
|
|
40
|
+
* `isRunning` flips true) — this function does not need to start polling itself.
|
|
41
|
+
*/
|
|
42
|
+
export interface StaticExportController {
|
|
43
|
+
/** The current/most recent run this hook knows about — `undefined` until the first status read
|
|
44
|
+
* resolves (mirrors `DeploymentOverviewController.snapshot`'s own "undefined = still loading"
|
|
45
|
+
* convention). */
|
|
46
|
+
run: AdminExportRunSnapshot | undefined;
|
|
47
|
+
/** True whenever `run.status === "running"` AND polling can still reach the status endpoint —
|
|
48
|
+
* drives the poll loop and the button's disabled state (never trigger a second export while one
|
|
49
|
+
* is in flight; the server would 409 anyway, but disabling here avoids a round trip that can only
|
|
50
|
+
* fail). Also requires {@link pollError} to be `null`: once bounded polling has given up, this
|
|
51
|
+
* flips false so the button re-enables even though the server-side run may still be in progress —
|
|
52
|
+
* see {@link pollError}'s own doc. */
|
|
53
|
+
isRunning: boolean;
|
|
54
|
+
/** Already-formatted, translated error from the INITIAL status read — `null` while loading or
|
|
55
|
+
* once loaded successfully. Distinct from {@link triggerError}: a failed initial read and a
|
|
56
|
+
* failed trigger are different failures (same split `use-dockerfile-source.hooks.ts`'s
|
|
57
|
+
* `error`/`saveError` draws). */
|
|
58
|
+
loadError: string | null;
|
|
59
|
+
/** Already-formatted, translated error from the poll loop giving up after
|
|
60
|
+
* {@link StaticExportController.isRunning}'s own consecutive-failure bound — `null` while polling
|
|
61
|
+
* is healthy (or hasn't started) and reset to `null` at the start of every new {@link trigger}.
|
|
62
|
+
* Distinct from both {@link loadError} (the one-shot initial read) and {@link triggerError} (the
|
|
63
|
+
* POST that starts a run): this is the REPEATED read that keeps a `"running"` run's status
|
|
64
|
+
* current. Without a bound, an unreachable status endpoint (routine in local dev — `tsx watch`
|
|
65
|
+
* restarts kill the in-flight poll on every file save) retried forever behind a stuck spinner with
|
|
66
|
+
* the action disabled and no way out. */
|
|
67
|
+
pollError: string | null;
|
|
68
|
+
/** Already-formatted, translated error from the most recent {@link trigger} call — `null` until a
|
|
69
|
+
* trigger fails, reset to `null` at the start of every new attempt. Covers both a genuine
|
|
70
|
+
* rejection (malformed request) and the expected `409` from clicking while a run is already in
|
|
71
|
+
* flight. */
|
|
72
|
+
triggerError: string | null;
|
|
73
|
+
/** True while the trigger POST is in flight — briefer than {@link isRunning}, which stays true for
|
|
74
|
+
* the whole export, not just the initial request. */
|
|
75
|
+
triggering: boolean;
|
|
76
|
+
/** Whether the next {@link trigger} should ask the server to remove the output directory's
|
|
77
|
+
* existing contents first. See this file's header for why this is never set anywhere but by the
|
|
78
|
+
* operator's own gesture. */
|
|
79
|
+
clean: boolean;
|
|
80
|
+
setClean: (value: boolean) => void;
|
|
81
|
+
/** Starts a new export run with the current {@link clean} value. Resolves either way (a failure is
|
|
82
|
+
* surfaced through {@link triggerError}, not a thrown rejection) — callers don't need a try/catch
|
|
83
|
+
* of their own. */
|
|
84
|
+
trigger: () => Promise<void>;
|
|
85
|
+
/** Bound translator — see `use-deployment-overview.hooks.ts`'s header for this app's standing i18n
|
|
86
|
+
* rule. */
|
|
87
|
+
t: Translate;
|
|
88
|
+
}
|
|
89
|
+
export declare function useStaticExport(required: {
|
|
90
|
+
port: StaticExportPort;
|
|
91
|
+
t: Translate;
|
|
92
|
+
locale: string;
|
|
93
|
+
useFetchQuery: FetchQueryAdapter["useFetchQuery"];
|
|
94
|
+
useContentRefreshSubscription: (required: {
|
|
95
|
+
resource: string;
|
|
96
|
+
onRefresh: () => void;
|
|
97
|
+
}) => void;
|
|
98
|
+
describeApiError: (required: {
|
|
99
|
+
e: unknown;
|
|
100
|
+
fallback: string;
|
|
101
|
+
}) => string;
|
|
102
|
+
exportLoadErrorMessage: (required: {
|
|
103
|
+
locale: string;
|
|
104
|
+
error: string;
|
|
105
|
+
}) => string;
|
|
106
|
+
exportPollErrorMessage: (required: {
|
|
107
|
+
locale: string;
|
|
108
|
+
error: string;
|
|
109
|
+
}) => string;
|
|
110
|
+
exportTriggerErrorMessage: (required: {
|
|
111
|
+
locale: string;
|
|
112
|
+
error: string;
|
|
113
|
+
}) => string;
|
|
114
|
+
setTimeout: typeof globalThis.setTimeout;
|
|
115
|
+
clearTimeout: typeof globalThis.clearTimeout;
|
|
116
|
+
}, _options?: {}): StaticExportController;
|
|
117
|
+
export declare function bindStaticExport({ hooks, deps }: {
|
|
118
|
+
hooks: Pick<Parameters<typeof useStaticExport>[0], "useFetchQuery" | "useContentRefreshSubscription"> & {
|
|
119
|
+
useLocaleHook: () => string;
|
|
120
|
+
};
|
|
121
|
+
deps: Omit<Parameters<typeof useStaticExport>[0], "t" | "locale" | "useFetchQuery" | "useContentRefreshSubscription"> & {
|
|
122
|
+
translate: (required: {
|
|
123
|
+
locale: string;
|
|
124
|
+
key: string;
|
|
125
|
+
}) => string;
|
|
126
|
+
};
|
|
127
|
+
}, _optional?: {}): (_required: Record<string, never>, _optional?: {}) => StaticExportController;
|
|
128
|
+
//# sourceMappingURL=use-static-export.hooks.d.ts.map
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { DEPLOYMENT_EXPORT_RESOURCE } from "@jini-ai/devops/deploy/react/rules";
|
|
3
|
+
import {} from '@jini-ai/core/text';
|
|
4
|
+
/** How often the poll loop re-checks the run's status while it is `"running"`. Short enough that a
|
|
5
|
+
* ~1s local export (the fastest one this feature has been observed to take) still shows more than
|
|
6
|
+
* one "Exporting…" frame, long enough not to flood the server for a run documented as "seconds to
|
|
7
|
+
* minutes". */
|
|
8
|
+
const EXPORT_POLL_INTERVAL_MS = 1500;
|
|
9
|
+
/** How many CONSECUTIVE poll failures the loop below tolerates before giving up and surfacing
|
|
10
|
+
* {@link StaticExportController.pollError} instead of retrying forever. At `EXPORT_POLL_INTERVAL_MS`
|
|
11
|
+
* (1.5s) this is ~4.5s of tolerance — enough to ride out a `tsx watch` restart (the routine local-dev
|
|
12
|
+
* cause the audit finding this closes calls out, C2) without stranding a genuinely permanent failure
|
|
13
|
+
* (server crash, revoked auth) on a dead spinner indefinitely. */
|
|
14
|
+
const POLL_FAILURE_LIMIT = 3;
|
|
15
|
+
export function useStaticExport(required, _options = {}) {
|
|
16
|
+
const { port, t, locale, describeApiError, exportTriggerErrorMessage, exportPollErrorMessage, setTimeout, clearTimeout } = required;
|
|
17
|
+
const { run, setRun, clean, setClean, triggering, setTriggering, triggerError, setTriggerError, pollError, setPollError, seededRef, loadError, pollFailuresRef, isRunning, pollInputs, } = useStaticExportState(required);
|
|
18
|
+
useStaticExportPolling({ isRunning, pollInputs, pollFailuresRef, setRun, setPollError, describeApiError, exportPollErrorMessage, setTimeout, clearTimeout });
|
|
19
|
+
// Synchronous duplicate-submit guard — same reasoning as `use-static-publish.hooks.ts`'s
|
|
20
|
+
// `publishingRef` (C4): two calls in one tick both read this render's `triggering: false`
|
|
21
|
+
// (terra review 2026-09-20, finding 5).
|
|
22
|
+
const triggeringRef = useRef(false);
|
|
23
|
+
async function trigger() {
|
|
24
|
+
if (triggeringRef.current)
|
|
25
|
+
return;
|
|
26
|
+
triggeringRef.current = true;
|
|
27
|
+
// Local action supersedes any still-pending bootstrap read: mark it consumed BEFORE the request
|
|
28
|
+
// even starts, so a bootstrap GET that resolves late — after this trigger's own response already
|
|
29
|
+
// set `run` — cannot land on top of it and silently kill polling for a run the server is still
|
|
30
|
+
// actually running (C1). Ordering is what makes this safe: this write is synchronous and
|
|
31
|
+
// happens-before the `await` below, so it wins the race regardless of how late the bootstrap
|
|
32
|
+
// read resolves.
|
|
33
|
+
seededRef.current = true;
|
|
34
|
+
// A fresh trigger also clears any earlier poll-failure standoff (C2) — the operator retrying via
|
|
35
|
+
// this same button is exactly the recovery path a stalled `pollError` is meant to unblock.
|
|
36
|
+
pollFailuresRef.current = 0;
|
|
37
|
+
setPollError(null);
|
|
38
|
+
setTriggerError(null);
|
|
39
|
+
setTriggering(true);
|
|
40
|
+
try {
|
|
41
|
+
const started = await port.triggerSiteExport({}, { options: { clean } });
|
|
42
|
+
setRun(started);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
setTriggerError(exportTriggerErrorMessage({ locale, error: describeApiError({ e: err, fallback: "unknown error" }) }));
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
triggeringRef.current = false;
|
|
49
|
+
setTriggering(false);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { run, isRunning, loadError, pollError, triggerError, triggering, clean, setClean, trigger, t };
|
|
53
|
+
}
|
|
54
|
+
function useStaticExportPolling({ isRunning, pollInputs, pollFailuresRef, setRun, setPollError, describeApiError, exportPollErrorMessage, setTimeout, clearTimeout }) {
|
|
55
|
+
// Poll loop: re-armed only when `isRunning` FLIPS to true (mount-while-running counts), not on
|
|
56
|
+
// every `run` update the loop itself produces — a dependency on `run` here would re-schedule (or,
|
|
57
|
+
// worse, fail to reschedule after a transient fetch error that never touched `run`) on every tick
|
|
58
|
+
// instead of running as one self-scheduling loop. Each iteration decides whether to continue from
|
|
59
|
+
// the STATUS IT JUST FETCHED, not from the outer `isRunning` closure, which is correctly stale
|
|
60
|
+
// inside a single effect run. A fetch failure retries on the same schedule rather than silently
|
|
61
|
+
// giving up — a transient network hiccup must not strand the UI on "Exporting…" forever.
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!isRunning)
|
|
64
|
+
return undefined;
|
|
65
|
+
const { port: pollPort, locale: pollLocale } = pollInputs.current;
|
|
66
|
+
let cancelled = false;
|
|
67
|
+
let timer;
|
|
68
|
+
function scheduleNext() {
|
|
69
|
+
timer = setTimeout(poll, EXPORT_POLL_INTERVAL_MS);
|
|
70
|
+
}
|
|
71
|
+
async function poll() {
|
|
72
|
+
try {
|
|
73
|
+
const status = await pollPort.getSiteExportStatus();
|
|
74
|
+
if (cancelled)
|
|
75
|
+
return;
|
|
76
|
+
pollFailuresRef.current = 0;
|
|
77
|
+
setRun(status);
|
|
78
|
+
if (status.status === "running")
|
|
79
|
+
scheduleNext();
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
if (cancelled)
|
|
83
|
+
return;
|
|
84
|
+
pollFailuresRef.current += 1;
|
|
85
|
+
if (pollFailuresRef.current >= POLL_FAILURE_LIMIT) {
|
|
86
|
+
// Bounded (C2): give up rather than retry forever. Setting `pollError` also flips
|
|
87
|
+
// `isRunning` false on the next render, which re-arms this very effect's cleanup and
|
|
88
|
+
// re-enables the Build button — but `return` here (no `scheduleNext()`) is what actually
|
|
89
|
+
// stops the loop; it must not depend on that later render having happened yet.
|
|
90
|
+
setPollError(exportPollErrorMessage({ locale: pollLocale, error: describeApiError({ e: err, fallback: "unknown error" }) }));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
scheduleNext();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
scheduleNext();
|
|
97
|
+
return () => {
|
|
98
|
+
cancelled = true;
|
|
99
|
+
clearTimeout(timer);
|
|
100
|
+
};
|
|
101
|
+
}, [isRunning]);
|
|
102
|
+
}
|
|
103
|
+
function useStaticExportState({ port, locale, useFetchQuery, useContentRefreshSubscription, describeApiError, exportLoadErrorMessage }) {
|
|
104
|
+
const query = useFetchQuery({ key: ["deployment", "export"], fetch: () => port.getSiteExportStatus() });
|
|
105
|
+
const [run, setRun] = useState(undefined);
|
|
106
|
+
const [clean, setClean] = useState(false);
|
|
107
|
+
const [triggering, setTriggering] = useState(false);
|
|
108
|
+
const [triggerError, setTriggerError] = useState(null);
|
|
109
|
+
const [pollError, setPollError] = useState(null);
|
|
110
|
+
// Seeds `run` from the query's first successful load, exactly once — see this file's header.
|
|
111
|
+
const seededRef = useRef(false);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (seededRef.current || query.status === "loading" || !query.data)
|
|
114
|
+
return;
|
|
115
|
+
seededRef.current = true;
|
|
116
|
+
setRun(query.data);
|
|
117
|
+
}, [query.status, query.data]);
|
|
118
|
+
const loadError = query.error ? exportLoadErrorMessage({ locale, error: describeApiError({ e: query.error, fallback: "unknown error" }) }) : null;
|
|
119
|
+
// See this file's header for why this bypasses the query/`seededRef` entirely rather than being
|
|
120
|
+
// the usual `useInvalidate()` one-liner. A failed background refresh is swallowed rather than
|
|
121
|
+
// surfaced through `loadError`/`triggerError` — this is a best-effort catch-up read, not a load or
|
|
122
|
+
// trigger the operator directly asked for, and the visible `run` simply stays what it was.
|
|
123
|
+
const refreshRun = useCallback(async () => {
|
|
124
|
+
try {
|
|
125
|
+
const status = await port.getSiteExportStatus();
|
|
126
|
+
setRun(status);
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// best-effort; see comment above
|
|
130
|
+
}
|
|
131
|
+
}, [port]);
|
|
132
|
+
// `useContentRefreshSubscription`'s `onRefresh` is a synchronous `() => void` — wrapping rather
|
|
133
|
+
// than passing `refreshRun` directly, mirroring `use-access-tokens.hooks.ts`'s identical
|
|
134
|
+
// `reloadAllStores`/`triggerReload` split, so the subscription never hands the bus a dangling
|
|
135
|
+
// Promise.
|
|
136
|
+
const triggerRefresh = useCallback(() => {
|
|
137
|
+
void refreshRun();
|
|
138
|
+
}, [refreshRun]);
|
|
139
|
+
useContentRefreshSubscription({ resource: DEPLOYMENT_EXPORT_RESOURCE, onRefresh: triggerRefresh });
|
|
140
|
+
// Counts CONSECUTIVE poll failures for the `POLL_FAILURE_LIMIT` bound below — a ref, not state,
|
|
141
|
+
// because it is read and written only from inside the poll loop's own effect and must never itself
|
|
142
|
+
// trigger a render (only the `pollError` it may eventually set does that).
|
|
143
|
+
const pollFailuresRef = useRef(0);
|
|
144
|
+
const isRunning = run?.status === "running" && pollError === null;
|
|
145
|
+
const pollInputs = useRef({ port, locale });
|
|
146
|
+
pollInputs.current = { port, locale };
|
|
147
|
+
return {
|
|
148
|
+
run, setRun, clean, setClean, triggering, setTriggering, triggerError, setTriggerError, pollError, setPollError, seededRef, loadError, pollFailuresRef,
|
|
149
|
+
isRunning, pollInputs,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export function bindStaticExport({ hooks, deps }, _optional = {}) {
|
|
153
|
+
return function useBoundStaticExport(_required, _optional = {}) {
|
|
154
|
+
const locale = hooks.useLocaleHook();
|
|
155
|
+
const t = (key) => deps.translate({ locale: locale, key: key });
|
|
156
|
+
return useStaticExport({ ...deps, ...hooks, t, locale });
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=use-static-export.hooks.js.map
|