@jini-ai/devops 0.7.3-next.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +16 -0
- package/dist/backup/site/archive-extensions.d.ts +73 -0
- package/dist/backup/site/archive-extensions.js +129 -0
- package/dist/backup/site/archive-manifest.d.ts +85 -0
- package/dist/backup/site/archive-manifest.js +176 -0
- package/dist/backup/site/archive-media.d.ts +121 -0
- package/dist/backup/site/archive-media.js +93 -0
- package/dist/backup/site/backup-service.credentials.d.ts +31 -0
- package/dist/backup/site/backup-service.credentials.js +158 -0
- package/dist/backup/site/backup-service.d.ts +336 -0
- package/dist/backup/site/backup-service.js +127 -0
- package/dist/backup/site/backup-service.plan.d.ts +64 -0
- package/dist/backup/site/backup-service.plan.js +207 -0
- package/dist/backup/site/backup-service.push.d.ts +29 -0
- package/dist/backup/site/backup-service.push.js +94 -0
- package/dist/backup/site/backup-service.shared.d.ts +40 -0
- package/dist/backup/site/backup-service.shared.js +37 -0
- package/dist/backup/site/bundled-export-file-policy.d.ts +38 -0
- package/dist/backup/site/bundled-export-file-policy.js +39 -0
- package/dist/backup/site/credential-warnings.d.ts +41 -0
- package/dist/backup/site/credential-warnings.js +50 -0
- package/dist/backup/site/import-backend-steps.d.ts +167 -0
- package/dist/backup/site/import-backend-steps.js +170 -0
- package/dist/backup/site/import-backend.d.ts +167 -0
- package/dist/backup/site/import-backend.js +298 -0
- package/dist/backup/site/import-database.d.ts +118 -0
- package/dist/backup/site/import-database.js +167 -0
- package/dist/backup/site/import-index/admission.d.ts +54 -0
- package/dist/backup/site/import-index/admission.js +46 -0
- package/dist/backup/site/import-index/backfill.d.ts +106 -0
- package/dist/backup/site/import-index/backfill.js +137 -0
- package/dist/backup/site/import-index/errors.d.ts +28 -0
- package/dist/backup/site/import-index/errors.js +38 -0
- package/dist/backup/site/import-index/migrations/checksums.d.ts +4 -0
- package/dist/backup/site/import-index/migrations/checksums.js +4 -0
- package/dist/backup/site/import-index/migrations/site-imports-v1.d.ts +2 -0
- package/dist/backup/site/import-index/migrations/site-imports-v1.js +10 -0
- package/dist/backup/site/import-index/mode.d.ts +191 -0
- package/dist/backup/site/import-index/mode.js +272 -0
- package/dist/backup/site/import-index/open.d.ts +40 -0
- package/dist/backup/site/import-index/open.js +87 -0
- package/dist/backup/site/import-index/paging.d.ts +28 -0
- package/dist/backup/site/import-index/paging.js +66 -0
- package/dist/backup/site/import-index/payload-namespace.d.ts +80 -0
- package/dist/backup/site/import-index/payload-namespace.js +156 -0
- package/dist/backup/site/import-index/rows.d.ts +32 -0
- package/dist/backup/site/import-index/rows.js +61 -0
- package/dist/backup/site/import-index/schema.d.ts +8 -0
- package/dist/backup/site/import-index/schema.js +31 -0
- package/dist/backup/site/import-index/store.d.ts +27 -0
- package/dist/backup/site/import-index/store.js +33 -0
- package/dist/backup/site/import-index/sweep.d.ts +10 -0
- package/dist/backup/site/import-index/sweep.js +26 -0
- package/dist/backup/site/import-keep-off.d.ts +128 -0
- package/dist/backup/site/import-keep-off.js +204 -0
- package/dist/backup/site/import-plugin-state.d.ts +74 -0
- package/dist/backup/site/import-plugin-state.js +67 -0
- package/dist/backup/site/import-registry.d.ts +110 -0
- package/dist/backup/site/import-registry.js +205 -0
- package/dist/backup/site/import-restore-placement.d.ts +94 -0
- package/dist/backup/site/import-restore-placement.js +158 -0
- package/dist/backup/site/import-restore.d.ts +111 -0
- package/dist/backup/site/import-restore.js +120 -0
- package/dist/backup/site/import-verifier-inventory.d.ts +137 -0
- package/dist/backup/site/import-verifier-inventory.js +236 -0
- package/dist/backup/site/import-verifier-projection.d.ts +78 -0
- package/dist/backup/site/import-verifier-projection.js +100 -0
- package/dist/backup/site/import-verifier.d.ts +126 -0
- package/dist/backup/site/import-verifier.js +53 -0
- package/dist/backup/site/owned-temp-root.d.ts +12 -0
- package/dist/backup/site/owned-temp-root.js +2 -0
- package/dist/backup/site/package-file-inventory.d.ts +63 -0
- package/dist/backup/site/package-file-inventory.js +56 -0
- package/dist/backup/site/push-content.d.ts +70 -0
- package/dist/backup/site/push-content.js +56 -0
- package/dist/backup/site/react/ShowMoreImports.d.ts +21 -0
- package/dist/backup/site/react/ShowMoreImports.js +8 -0
- package/dist/backup/site/saved-keys-port.d.ts +47 -0
- package/dist/backup/site/saved-keys-port.js +3 -0
- package/dist/backup/site/saved-keys.d.ts +25 -0
- package/dist/backup/site/saved-keys.js +38 -0
- package/dist/backup/site/share-backend.d.ts +243 -0
- package/dist/backup/site/share-backend.js +284 -0
- package/dist/backup/site/share-database/projection.d.ts +197 -0
- package/dist/backup/site/share-database/projection.js +90 -0
- package/dist/backup/site/share-database/projection.media.d.ts +38 -0
- package/dist/backup/site/share-database/projection.media.js +179 -0
- package/dist/backup/site/share-database/projection.tables.d.ts +46 -0
- package/dist/backup/site/share-database/projection.tables.js +210 -0
- package/dist/backup/site/share-expiry.d.ts +75 -0
- package/dist/backup/site/share-expiry.js +49 -0
- package/dist/backup/site/share-export-failure.d.ts +17 -0
- package/dist/backup/site/share-export-failure.js +16 -0
- package/dist/backup/site/share-file-policy.d.ts +60 -0
- package/dist/backup/site/share-file-policy.js +146 -0
- package/dist/backup/site/share-hosting.d.ts +107 -0
- package/dist/backup/site/share-hosting.js +148 -0
- package/dist/backup/site/share-preparation-steps.d.ts +180 -0
- package/dist/backup/site/share-preparation-steps.js +107 -0
- package/dist/backup/site/share-preparation.d.ts +122 -0
- package/dist/backup/site/share-preparation.js +43 -0
- package/dist/backup/site/share-refusal.d.ts +21 -0
- package/dist/backup/site/share-refusal.js +20 -0
- package/dist/backup/site/share-registry.d.ts +124 -0
- package/dist/backup/site/share-registry.js +219 -0
- package/dist/backup/site/share-retention.d.ts +62 -0
- package/dist/backup/site/share-retention.js +126 -0
- package/dist/backup/site/share-service.d.ts +128 -0
- package/dist/backup/site/share-service.js +194 -0
- package/dist/backup/site/share-zip.d.ts +115 -0
- package/dist/backup/site/share-zip.js +144 -0
- package/dist/backup/site/sources.d.ts +344 -0
- package/dist/backup/site/sources.js +595 -0
- package/dist/backup/site/static-copy.d.ts +122 -0
- package/dist/backup/site/static-copy.js +165 -0
- package/dist/backup/site/static-download-html.d.ts +76 -0
- package/dist/backup/site/static-download-html.js +149 -0
- package/dist/backup/site/static-download-landing.d.ts +52 -0
- package/dist/backup/site/static-download-landing.js +95 -0
- package/dist/backup/site/static-download-layout.d.ts +96 -0
- package/dist/backup/site/static-download-layout.js +325 -0
- package/dist/backup/site/static-export-selection.d.ts +50 -0
- package/dist/backup/site/static-export-selection.js +75 -0
- package/dist/backup/site/static-site-packager.d.ts +42 -0
- package/dist/backup/site/static-site-packager.js +32 -0
- package/dist/backup/site/tool-registrations.d.ts +74 -0
- package/dist/backup/site/tool-registrations.js +204 -0
- package/dist/checks/complexity-debt.d.ts +100 -0
- package/dist/checks/complexity-debt.js +131 -0
- package/dist/checks/coverage/diff.js +5 -1
- package/dist/checks/coverage/lcov.js +1 -1
- package/dist/checks/env-access.d.ts +14 -1
- package/dist/checks/env-access.js +92 -6
- package/dist/checks/live-verify-checks.d.ts +29 -0
- package/dist/checks/live-verify-checks.js +30 -0
- package/dist/checks/quality-gates.d.ts +137 -0
- package/dist/checks/quality-gates.js +209 -0
- package/dist/core/deploy-types.d.ts +2 -0
- package/dist/deploy/admin-http/site-update-status.d.ts +8 -0
- package/dist/deploy/admin-http/site-update-status.js +15 -0
- package/dist/deploy/host-kit.d.ts +3 -0
- package/dist/deploy/index.d.ts +6 -0
- package/dist/deploy/index.js +6 -0
- package/dist/deploy/ops-runner.js +7 -0
- package/dist/deploy/ops-tool-contracts.d.ts +10 -1
- package/dist/deploy/react/Deployment.d.ts +37 -0
- package/dist/deploy/react/Deployment.js +94 -0
- package/dist/deploy/react/DockerfileTab.d.ts +72 -0
- package/dist/deploy/react/DockerfileTab.js +131 -0
- package/dist/deploy/react/HistoryTab.d.ts +43 -0
- package/dist/deploy/react/HistoryTab.js +12 -0
- package/dist/deploy/react/OverviewTab.d.ts +60 -0
- package/dist/deploy/react/OverviewTab.js +75 -0
- package/dist/deploy/react/PublishRunResult.d.ts +5 -1
- package/dist/deploy/react/PublishRunResult.js +4 -4
- package/dist/deploy/react/SiteUpdateNotice.d.ts +22 -0
- package/dist/deploy/react/SiteUpdateNotice.js +25 -0
- package/dist/deploy/react/StaticCredentialFields.d.ts +36 -0
- package/dist/deploy/react/StaticCredentialFields.js +63 -0
- package/dist/deploy/react/StaticCredentialSteps.d.ts +23 -0
- package/dist/deploy/react/StaticCredentialSteps.js +152 -0
- package/dist/deploy/react/StaticExportCard.d.ts +11 -0
- package/dist/deploy/react/StaticExportCard.js +97 -0
- package/dist/deploy/react/StaticPublishCredentials.d.ts +50 -0
- package/dist/deploy/react/StaticPublishCredentials.js +77 -0
- package/dist/deploy/react/StaticPublishForm.d.ts +12 -0
- package/dist/deploy/react/StaticPublishForm.js +91 -0
- package/dist/deploy/react/StaticSiteTab.d.ts +207 -0
- package/dist/deploy/react/StaticSiteTab.js +117 -0
- package/dist/deploy/react/deployment-visuals.d.ts +207 -0
- package/dist/deploy/react/deployment-visuals.js +101 -0
- package/dist/deploy/react/download-dockerfile.d.ts +14 -0
- package/dist/deploy/react/download-dockerfile.js +15 -0
- package/dist/deploy/react/hooks/publish-credential-draft.d.ts +33 -0
- package/dist/deploy/react/hooks/publish-credential-draft.js +54 -0
- package/dist/deploy/react/hooks/publish-credential-selection.d.ts +13 -0
- package/dist/deploy/react/hooks/publish-credential-selection.js +34 -0
- package/dist/deploy/react/hooks/publish-credential-writes.d.ts +20 -0
- package/dist/deploy/react/hooks/publish-credential-writes.js +99 -0
- package/dist/deploy/react/hooks/static-publish-actions.d.ts +10 -0
- package/dist/deploy/react/hooks/static-publish-actions.js +62 -0
- package/dist/deploy/react/hooks/static-publish-form.hooks.d.ts +38 -0
- package/dist/deploy/react/hooks/static-publish-form.hooks.js +103 -0
- package/dist/deploy/react/hooks/static-publish-run.hooks.d.ts +28 -0
- package/dist/deploy/react/hooks/static-publish-run.hooks.js +92 -0
- package/dist/deploy/react/hooks/use-dockerfile-source.hooks.d.ts +148 -0
- package/dist/deploy/react/hooks/use-dockerfile-source.hooks.js +155 -0
- package/dist/deploy/react/hooks/use-publish-credentials.hooks.d.ts +268 -0
- package/dist/deploy/react/hooks/use-publish-credentials.hooks.js +52 -0
- package/dist/deploy/react/hooks/use-static-export.hooks.d.ts +128 -0
- package/dist/deploy/react/hooks/use-static-export.hooks.js +159 -0
- package/dist/deploy/react/hooks/use-static-publish.hooks.d.ts +208 -0
- package/dist/deploy/react/hooks/use-static-publish.hooks.js +48 -0
- package/dist/deploy/react/index.d.ts +4 -0
- package/dist/deploy/react/index.js +2 -0
- package/dist/deploy/react/rules.d.ts +363 -0
- package/dist/deploy/react/rules.js +314 -0
- package/dist/deploy/react/use-deployment-overview.hooks.d.ts +41 -0
- package/dist/deploy/react/use-deployment-overview.hooks.js +11 -0
- package/dist/deploy/site/agent-tools.d.ts +42 -0
- package/dist/deploy/site/agent-tools.js +119 -0
- package/dist/deploy/site/deploy-config-registry.d.ts +155 -0
- package/dist/deploy/site/deploy-config-registry.js +124 -0
- package/dist/deploy/site/deploy-config.d.ts +97 -0
- package/dist/deploy/site/deploy-config.js +115 -0
- package/dist/deploy/site/deploy-ops/agent-tools.d.ts +22 -0
- package/dist/deploy/site/deploy-ops/agent-tools.js +76 -0
- package/dist/deploy/site/deploy-ops/registry.d.ts +134 -0
- package/dist/deploy/site/deploy-ops/registry.js +106 -0
- package/dist/deploy/site/deploy-ops/run-ops.d.ts +66 -0
- package/dist/deploy/site/deploy-ops/run-ops.js +34 -0
- package/dist/deploy/site/deploy-ops/secret-confirm.d.ts +36 -0
- package/dist/deploy/site/deploy-ops/secret-confirm.js +27 -0
- package/dist/deploy/site/deploy-targets/host-kit.d.ts +28 -0
- package/dist/deploy/site/deploy-targets/host-kit.js +120 -0
- package/dist/deploy/site/deploy-targets/registry.d.ts +157 -0
- package/dist/deploy/site/deploy-targets/registry.js +130 -0
- package/dist/deploy/site/deploy-targets/types.d.ts +27 -0
- package/dist/deploy/site/deploy-targets/types.js +2 -0
- package/dist/deploy/site/dockerfile.d.ts +137 -0
- package/dist/deploy/site/dockerfile.js +101 -0
- package/dist/deploy/site/export-run.d.ts +137 -0
- package/dist/deploy/site/export-run.js +152 -0
- package/dist/deploy/site/ports.d.ts +115 -0
- package/dist/deploy/site/ports.js +2 -0
- package/dist/deploy/site/publish-agent-tools.d.ts +18 -0
- package/dist/deploy/site/publish-agent-tools.js +120 -0
- package/dist/deploy/site/publish-candidate.d.ts +26 -0
- package/dist/deploy/site/publish-candidate.js +37 -0
- package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.d.ts +78 -0
- package/dist/deploy/site/publish-credentials/account-label-heal-scheduler.js +88 -0
- package/dist/deploy/site/publish-credentials/compatibility-port.d.ts +38 -0
- package/dist/deploy/site/publish-credentials/compatibility-port.js +19 -0
- package/dist/deploy/site/publish-credentials/execution-mode.d.ts +43 -0
- package/dist/deploy/site/publish-credentials/execution-mode.js +19 -0
- package/dist/deploy/site/publish-credentials/store-owner.d.ts +11 -0
- package/dist/deploy/site/publish-credentials/store-owner.js +9 -0
- package/dist/deploy/site/publish-credentials/store-resolution.d.ts +55 -0
- package/dist/deploy/site/publish-credentials/store-resolution.js +100 -0
- package/dist/deploy/site/publish-credentials/store-validation.d.ts +68 -0
- package/dist/deploy/site/publish-credentials/store-validation.js +182 -0
- package/dist/deploy/site/publish-credentials/store.d.ts +321 -0
- package/dist/deploy/site/publish-credentials/store.js +367 -0
- package/dist/deploy/site/publish-credentials/types.d.ts +85 -0
- package/dist/deploy/site/publish-credentials/types.js +2 -0
- package/dist/deploy/site/publish-tool-capabilities.d.ts +123 -0
- package/dist/deploy/site/publish-tool-capabilities.js +175 -0
- package/dist/deploy/site/publish-tool-credential.d.ts +48 -0
- package/dist/deploy/site/publish-tool-credential.js +284 -0
- package/dist/deploy/site/publish-tool-deps.d.ts +205 -0
- package/dist/deploy/site/publish-tool-deps.js +15 -0
- package/dist/deploy/site/publish-tool-execution.d.ts +78 -0
- package/dist/deploy/site/publish-tool-execution.js +313 -0
- package/dist/deploy/site/publish-tool-schema.d.ts +29 -0
- package/dist/deploy/site/publish-tool-schema.js +38 -0
- package/dist/deploy/site/static-publish/adapter-export.d.ts +54 -0
- package/dist/deploy/site/static-publish/adapter-export.js +89 -0
- package/dist/deploy/site/static-publish/adapter-plan.d.ts +99 -0
- package/dist/deploy/site/static-publish/adapter-plan.js +112 -0
- package/dist/deploy/site/static-publish/adapter.d.ts +182 -0
- package/dist/deploy/site/static-publish/adapter.js +321 -0
- package/dist/deploy/site/static-publish/admin-publish-read.d.ts +209 -0
- package/dist/deploy/site/static-publish/admin-publish-read.js +118 -0
- package/dist/deploy/site/static-publish/credentials.d.ts +114 -0
- package/dist/deploy/site/static-publish/credentials.js +298 -0
- package/dist/deploy/site/static-publish/domain-publish-rows.d.ts +25 -0
- package/dist/deploy/site/static-publish/domain-publish-rows.js +43 -0
- package/dist/deploy/site/static-publish/domain-publish-tool.d.ts +19 -0
- package/dist/deploy/site/static-publish/domain-publish-tool.js +111 -0
- package/dist/deploy/site/static-publish/inspection.d.ts +24 -0
- package/dist/deploy/site/static-publish/inspection.js +69 -0
- package/dist/deploy/site/static-publish/publish-history.d.ts +197 -0
- package/dist/deploy/site/static-publish/publish-history.js +153 -0
- package/dist/deploy/site/static-publish/publish-run.d.ts +156 -0
- package/dist/deploy/site/static-publish/publish-run.js +186 -0
- package/dist/deploy/site/static-publish/types.d.ts +168 -0
- package/dist/deploy/site/static-publish/types.js +2 -0
- package/dist/deploy/site/static-publish/verify.d.ts +237 -0
- package/dist/deploy/site/static-publish/verify.js +284 -0
- package/dist/deploy/site/tool-registrations.d.ts +97 -0
- package/dist/deploy/site/tool-registrations.js +130 -0
- package/dist/deploy/site/types.d.ts +51 -0
- package/dist/deploy/site/types.js +2 -0
- package/dist/deploy/site-update/check-for-update.d.ts +19 -0
- package/dist/deploy/site-update/check-for-update.js +19 -0
- package/dist/deploy/site-update/contracts.d.ts +161 -0
- package/dist/deploy/site-update/contracts.js +94 -0
- package/dist/deploy/site-update/desktop-site-update.d.ts +66 -0
- package/dist/deploy/site-update/desktop-site-update.js +43 -0
- package/dist/deploy/site-update/fake-site-update.d.ts +39 -0
- package/dist/deploy/site-update/fake-site-update.js +52 -0
- package/dist/deploy/site-update/run-site-update.d.ts +121 -0
- package/dist/deploy/site-update/run-site-update.js +219 -0
- package/dist/deploy/site-update/self-hosted-site-update.d.ts +71 -0
- package/dist/deploy/site-update/self-hosted-site-update.js +79 -0
- package/dist/deploy/target-contracts.d.ts +3 -0
- package/dist/deploy/tool.d.ts +5 -8
- package/dist/deploy/tool.js +6 -9
- package/dist/dns/binding-sweeper.d.ts +72 -0
- package/dist/dns/binding-sweeper.js +53 -0
- package/dist/dns/index.d.ts +1 -0
- package/dist/dns/index.js +1 -0
- package/dist/dns/site/binding.repo.d.ts +71 -0
- package/dist/dns/site/binding.repo.js +45 -0
- package/dist/dns/site/dns-changes.d.ts +90 -0
- package/dist/dns/site/dns-changes.js +271 -0
- package/dist/dns/site/dns-tools.d.ts +46 -0
- package/dist/dns/site/dns-tools.js +204 -0
- package/dist/dns/site/mail-dns-status.d.ts +111 -0
- package/dist/dns/site/mail-dns-status.js +190 -0
- package/dist/dns/site/mail-dns-tools.d.ts +33 -0
- package/dist/dns/site/mail-dns-tools.js +62 -0
- package/dist/dns/site/mail-requirements.d.ts +30 -0
- package/dist/dns/site/mail-requirements.js +78 -0
- package/dist/dns/site/tool-deps.d.ts +21 -0
- package/dist/dns/site/tool-deps.js +2 -0
- package/dist/dns/site/tools.d.ts +74 -0
- package/dist/dns/site/tools.js +124 -0
- package/dist/local-dev/bind-host.d.ts +80 -0
- package/dist/local-dev/bind-host.js +90 -0
- package/dist/local-dev/dev-proxy-upstream.d.ts +69 -0
- package/dist/local-dev/dev-proxy-upstream.js +63 -0
- package/dist/local-dev/index.d.ts +28 -0
- package/dist/local-dev/index.js +25 -0
- package/dist/packaging/electron/archive.d.ts +2 -9
- package/dist/packaging/electron/asar-adapter.d.ts +2 -1
- package/dist/packaging/electron/entry.d.ts +2 -0
- package/dist/packaging/electron/move-to-applications.d.ts +165 -0
- package/dist/packaging/electron/move-to-applications.js +162 -0
- package/dist/packaging/electron/policies.d.ts +33 -4
- package/dist/packaging/electron/policies.js +29 -10
- package/dist/packaging/electron/ports.d.ts +1 -6
- package/dist/packaging/electron/staging.d.ts +11 -2
- package/dist/packaging/electron/staging.js +15 -5
- package/dist/packaging/electron/update-manifest-merge.js +0 -2
- package/dist/react/site-share-expiry/ShareExpiryControls.d.ts +29 -0
- package/dist/react/site-share-expiry/ShareExpiryControls.js +7 -0
- package/dist/react/site-share-expiry/index.d.ts +2 -0
- package/dist/react/site-share-expiry/index.js +2 -0
- package/dist/source-control/react/ProvidersTab.d.ts +98 -0
- package/dist/source-control/react/ProvidersTab.js +195 -0
- package/dist/source-control/react/SourceControl.d.ts +51 -0
- package/dist/source-control/react/SourceControl.js +61 -0
- package/dist/source-control/react/hooks/use-source-control-credentials.hooks.d.ts +128 -0
- package/dist/source-control/react/hooks/use-source-control-credentials.hooks.js +102 -0
- package/dist/source-control/react/rules.d.ts +167 -0
- package/dist/source-control/react/rules.js +125 -0
- package/dist/source-control/react/source-control-visuals.d.ts +75 -0
- package/dist/source-control/react/source-control-visuals.js +48 -0
- package/dist/source-control/site/agent-tools.d.ts +5 -0
- package/dist/source-control/site/agent-tools.js +30 -0
- package/dist/source-control/site/bundled-provider-registry.d.ts +33 -0
- package/dist/source-control/site/bundled-provider-registry.js +37 -0
- package/dist/source-control/site/commit-schema.d.ts +40 -0
- package/dist/source-control/site/commit-schema.js +29 -0
- package/dist/source-control/site/commit-target.d.ts +26 -0
- package/dist/source-control/site/commit-target.js +58 -0
- package/dist/source-control/site/credential-form.d.ts +36 -0
- package/dist/source-control/site/credential-form.js +102 -0
- package/dist/source-control/site/credential-setup.d.ts +107 -0
- package/dist/source-control/site/credential-setup.js +216 -0
- package/dist/source-control/site/provider-kit.d.ts +37 -0
- package/dist/source-control/site/provider-kit.js +35 -0
- package/dist/source-control/site/provider-module.d.ts +251 -0
- package/dist/source-control/site/provider-module.js +2 -0
- package/dist/source-control/site/saved-key-bindings.d.ts +4 -0
- package/dist/source-control/site/saved-key-bindings.js +4 -0
- package/dist/source-control/site/static-site-packager-port.d.ts +37 -0
- package/dist/source-control/site/static-site-packager-port.js +2 -0
- package/dist/source-control/site/store.d.ts +209 -0
- package/dist/source-control/site/store.js +374 -0
- package/dist/source-control/site/store.validation.d.ts +72 -0
- package/dist/source-control/site/store.validation.js +168 -0
- package/dist/source-control/site/tool-registrations.d.ts +190 -0
- package/dist/source-control/site/tool-registrations.js +379 -0
- package/dist/static-export/asset-crawl.d.ts +30 -0
- package/dist/static-export/asset-crawl.js +71 -0
- package/dist/static-export/dynamic-asset-locations.d.ts +23 -0
- package/dist/static-export/dynamic-asset-locations.js +34 -0
- package/dist/static-export/html-url-locations.d.ts +3 -1
- package/dist/static-export/html-url-locations.js +43 -9
- package/dist/static-export/runner.js +26 -27
- package/dist/static-export/site/export-preflight.d.ts +48 -0
- package/dist/static-export/site/export-preflight.js +82 -0
- package/dist/static-export/site/media-original-urls.d.ts +57 -0
- package/dist/static-export/site/media-original-urls.js +109 -0
- package/dist/static-export/site/ports.d.ts +82 -0
- package/dist/static-export/site/ports.js +29 -0
- package/dist/static-export/site/public-origin-policy.d.ts +32 -0
- package/dist/static-export/site/public-origin-policy.js +68 -0
- package/dist/static-export/site/route-manifest.d.ts +65 -0
- package/dist/static-export/site/route-manifest.js +139 -0
- package/dist/static-export/site/site-exporter.d.ts +158 -0
- package/dist/static-export/site/site-exporter.js +112 -0
- package/dist/static-export/site/static-security-headers.d.ts +39 -0
- package/dist/static-export/site/static-security-headers.js +43 -0
- package/dist/static-export/site/theme-preview-manifest.d.ts +35 -0
- package/dist/static-export/site/theme-preview-manifest.js +28 -0
- package/dist/static-export/transforms.d.ts +1 -1
- package/dist/static-export/transforms.js +3 -3
- package/package.json +911 -7
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { isUniqueViolation } from "@jini-ai/core/contracts/storage";
|
|
2
|
+
import { VaultError } from "@jini-ai/core/contracts/vault";
|
|
3
|
+
import { SourceControlCredentialValidationError, validateLabel, optionalBoolean, isEmptyTokenPatch, normalizeConnectionPatch, assertBlankPatchChangesNoField, preservedProvider, credentialRegistry, normalizeStoredToken, assertPlainField, validateConnection } from "./store.validation.js";
|
|
4
|
+
/** Source-control validation and inline identity probes remain feature policy. Jini owns
|
|
5
|
+
* sealing, persistence, hints and defaults. Plain read models require neither keys nor opens.
|
|
6
|
+
* The identity store stays separate from deployments and custom API keys; commit callers may
|
|
7
|
+
* supply the existing custom-key reader through a port when this provider has no identity row. */
|
|
8
|
+
/** A `(workspaceId, providerId, label)` collision — the route maps this to `409 DUPLICATE_LABEL`. */
|
|
9
|
+
export class SourceControlCredentialDuplicateLabelError extends Error {
|
|
10
|
+
}
|
|
11
|
+
/** Thrown when `sealer.seal()`/`keyring.activeKey()` fails while writing a connection — the
|
|
12
|
+
* realistic cause is a missing site key (`site key`), same fail-closed
|
|
13
|
+
* contract `PublishCredentialSecretStoreUnconfiguredError` documents for the sibling table. */
|
|
14
|
+
export class SourceControlCredentialSecretStoreUnconfiguredError extends Error {
|
|
15
|
+
}
|
|
16
|
+
export class SourceControlCredentialNotFoundError extends Error {
|
|
17
|
+
}
|
|
18
|
+
async function toSummary(record) {
|
|
19
|
+
return { id: record.id, providerId: record.providerId, label: record.label, configured: true,
|
|
20
|
+
tokenHint: record.tokenHint ?? null, isDefault: record.isDefault, accountLabel: record.accountLabel,
|
|
21
|
+
createdAt: record.createdAt, updatedAt: record.updatedAt };
|
|
22
|
+
}
|
|
23
|
+
function vaultSummary({ summary, hint }, _options = {}) {
|
|
24
|
+
return { id: summary.id, providerId: summary.provider, label: summary.label,
|
|
25
|
+
configured: true, tokenHint: hint({ record: summary }), isDefault: summary.isDefault,
|
|
26
|
+
accountLabel: summary.meta.accountLabel, createdAt: summary.createdAt, updatedAt: summary.updatedAt };
|
|
27
|
+
}
|
|
28
|
+
/** The repo's host-bound vault collaborator; a repo without one refuses exactly as a repo without a vault did. */
|
|
29
|
+
function bound(deps, _options = {}) {
|
|
30
|
+
if (!deps.repo.credentialVault)
|
|
31
|
+
throw new VaultError({ code: "invalid-record" });
|
|
32
|
+
return deps.repo.credentialVault;
|
|
33
|
+
}
|
|
34
|
+
function vault(deps, _options = {}) {
|
|
35
|
+
return bound(deps).open({ ...deps, storageError: () => new SourceControlCredentialSecretStoreUnconfiguredError(deps.deps.CREDENTIAL_MESSAGES.storage) });
|
|
36
|
+
}
|
|
37
|
+
/** Error names (and the transport's own wording) that mean the probe ran out of time, not that the host refused it. */
|
|
38
|
+
const TIMEOUT_ERROR_NAMES = new Set(['AbortError', 'TimeoutError', 'FetchTimeoutError']);
|
|
39
|
+
/** What one probe response says about the saved connection: rejected, reachable, or not usable. */
|
|
40
|
+
function connectionForStatus({ status }, _optional = {}) {
|
|
41
|
+
if (status === 401 || status === 403)
|
|
42
|
+
return 'auth';
|
|
43
|
+
return status >= 200 && status < 300 ? 'connected' : 'unreachable';
|
|
44
|
+
}
|
|
45
|
+
/** What a probe that never got an answer says about the saved connection. */
|
|
46
|
+
function connectionForFailure({ err }, _optional = {}) {
|
|
47
|
+
const timedOut = err instanceof Error && (TIMEOUT_ERROR_NAMES.has(err.name) || /timed out/i.test(err.message));
|
|
48
|
+
return timedOut ? 'timeout' : 'unreachable';
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Best-effort "who does this token belong to" probe, run inline at save time — see this file's own
|
|
52
|
+
* header for why THIS table's `create`/`update` may do this while `publish-credentials/store.ts`'s
|
|
53
|
+
* may not. NEVER throws: no provider, a network failure, timeout, or non-2xx response degrades to
|
|
54
|
+
* `null` (no account label learned) rather than failing the save.
|
|
55
|
+
*
|
|
56
|
+
* The host-specific read lives in the plugin that provides the host (`provider-module.ts`'s
|
|
57
|
+
* `readAccountLabel`; each provider owns its account identity read). A host no enabled
|
|
58
|
+
* plugin provides yields `null` with no request made. The request carries the saved token, so it goes
|
|
59
|
+
* out only through the guarded {@link SourceControlCredentialWriteDeps.httpClient}, never the global
|
|
60
|
+
* `fetch`; without one the provider is built over the kit's refusing stand-in (its request fails as a
|
|
61
|
+
* transport error) and the save still succeeds.
|
|
62
|
+
*
|
|
63
|
+
* @complexity One registry load plus at most one bounded HTTP request.
|
|
64
|
+
*/
|
|
65
|
+
async function probeAccountLabel({ deps, workspaceId, providerId, token }, _optional = {}) {
|
|
66
|
+
let connection = 'saved';
|
|
67
|
+
const { httpClient, loadSourceControlProviders } = deps;
|
|
68
|
+
// Write-only callers may omit account discovery; production supplies its boot-bound loader and client.
|
|
69
|
+
if (!loadSourceControlProviders)
|
|
70
|
+
return { accountLabel: null, connection };
|
|
71
|
+
const observed = httpClient && {
|
|
72
|
+
send: async (request, options) => {
|
|
73
|
+
try {
|
|
74
|
+
const response = await httpClient.send(request, options);
|
|
75
|
+
connection = connectionForStatus({ status: response.status });
|
|
76
|
+
return response;
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
connection = connectionForFailure({ err });
|
|
80
|
+
throw err;
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
try {
|
|
85
|
+
const built = await deps.buildSourceControlProvider({ load: loadSourceControlProviders, ...(observed ? { httpClient: observed } : {}), workspaceId, providerId });
|
|
86
|
+
const accountLabel = built.ok ? await built.provider.readAccountLabel(token) : null;
|
|
87
|
+
return { accountLabel, connection };
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return { accountLabel: null, connection };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** The summary's `scope`, only where a project store is attached (a site-only server's output is unchanged). */
|
|
94
|
+
const reportedScope = (deps, scoped) => deps.repo.project ? { scope: scoped.scope } : {};
|
|
95
|
+
/** The row with this id, from the first store holding it (ids are unique across both). @complexity O(scopes). */
|
|
96
|
+
async function locateById(deps, input) {
|
|
97
|
+
for (const scoped of deps.deps.credentialScopes({ deps, workspaceId: input.workspaceId })) {
|
|
98
|
+
const record = await scoped.deps.repo.findById({ workspaceId: scoped.workspaceId, id: input.id });
|
|
99
|
+
if (record)
|
|
100
|
+
return { scoped, record };
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Every row this site uses: its own rows, then project rows whose host and label no site row already
|
|
106
|
+
* claims (a site row of the same host and label is the override).
|
|
107
|
+
* @complexity O(n) in the two stores' (small) credential counts; no row is opened.
|
|
108
|
+
*/
|
|
109
|
+
async function listEffective(deps, workspaceId) {
|
|
110
|
+
const found = [];
|
|
111
|
+
const claimed = new Set();
|
|
112
|
+
for (const scoped of deps.deps.credentialScopes({ deps, workspaceId })) {
|
|
113
|
+
const records = await scoped.deps.repo.listByWorkspace({ workspaceId: scoped.workspaceId });
|
|
114
|
+
for (const record of records.filter((row) => !claimed.has(`${row.providerId}\0${row.label}`)))
|
|
115
|
+
found.push({ scoped, record });
|
|
116
|
+
for (const record of records)
|
|
117
|
+
claimed.add(`${record.providerId}\0${record.label}`);
|
|
118
|
+
}
|
|
119
|
+
return found;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The read model for ONE credential set. Pure DB read — no sealer, no keyring, cannot fail on a
|
|
123
|
+
* misconfigured site key. Returns `null` if no row exists for `(workspaceId, id)` (not an
|
|
124
|
+
* error — the caller decides whether that is a 404).
|
|
125
|
+
*
|
|
126
|
+
* @complexity O(1) — one `findById` lookup.
|
|
127
|
+
*/
|
|
128
|
+
export async function describeCredential(deps, input) {
|
|
129
|
+
const located = await locateById(deps, input);
|
|
130
|
+
if (located)
|
|
131
|
+
return { ...await toSummary(located.record), ...reportedScope(deps, located.scoped) };
|
|
132
|
+
const canonical = await deps.repo.canonical?.list({ workspaceId: input.workspaceId });
|
|
133
|
+
return canonical?.find(row => row.id === input.id) ?? null;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The read model for EVERY credential set a workspace has saved — what
|
|
137
|
+
* `GET .../source-control/credentials` returns. Same "never decrypts" contract as
|
|
138
|
+
* {@link describeCredential}.
|
|
139
|
+
*
|
|
140
|
+
* @complexity O(n) in the workspace's own (small) credential-set count. One repo read, one array
|
|
141
|
+
* map, no per-row I/O.
|
|
142
|
+
*/
|
|
143
|
+
export async function listSourceControlCredentials(deps, input) {
|
|
144
|
+
const located = await listEffective(deps, input.workspaceId);
|
|
145
|
+
const legacy = await Promise.all(located.map(async ({ scoped, record }) => ({ ...await toSummary(record), ...reportedScope(deps, scoped) })));
|
|
146
|
+
// Canonical keys live in the provider-declared key store; neither half opens a key for display.
|
|
147
|
+
const canonical = await deps.repo.canonical?.list({ workspaceId: input.workspaceId }) ?? [];
|
|
148
|
+
const seen = new Set(legacy.map(row => row.id));
|
|
149
|
+
return [...legacy, ...canonical.filter(row => !seen.has(row.id) && seen.add(row.id))];
|
|
150
|
+
}
|
|
151
|
+
/** True iff `err` is the label's UNIQUE `(workspace_id, provider_id, label)` index rejecting a
|
|
152
|
+
* duplicate, on any database (`isUniqueViolation`, storage kernel: SQLite's code/message, Postgres
|
|
153
|
+
* SQLSTATE 23505). */
|
|
154
|
+
export function isUniqueLabelViolation({ err }, _optional = {}) {
|
|
155
|
+
return isUniqueViolation({ err });
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A project row whose host and label this site already uses would be hidden here by the site row
|
|
159
|
+
* (site rows override), so the save would look lost: refused as the same duplicate as within one store.
|
|
160
|
+
*/
|
|
161
|
+
async function assertLabelFreeOnSite({ deps, target, workspaceId, providerId, label }, _options = {}) {
|
|
162
|
+
if (target.scope !== "project")
|
|
163
|
+
return;
|
|
164
|
+
if ((await deps.repo.listByProvider({ workspaceId, providerId })).some(row => row.label === label)) {
|
|
165
|
+
throw new SourceControlCredentialDuplicateLabelError(`a '${providerId}' credential labeled '${label}' already exists in this workspace`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/** A rename or host move of a project row is checked as a create is: a label this site's own row
|
|
169
|
+
* already uses would hide the moved row here. An unchanged label and host needs no check. */
|
|
170
|
+
async function assertMoveFreeOnSite({ deps, scoped, existing, workspaceId, providerId, label }, _options = {}) {
|
|
171
|
+
if (label === existing.label && providerId === existing.providerId)
|
|
172
|
+
return;
|
|
173
|
+
await assertLabelFreeOnSite({ deps, target: scoped, workspaceId, providerId, label });
|
|
174
|
+
}
|
|
175
|
+
/** Validate the loaded declaration, then make the secret durable before identity discovery.
|
|
176
|
+
* @param required Explicit store ports and create input. @returns A summary with no secret fields.
|
|
177
|
+
* @throws {SourceControlCredentialValidationError} Invalid or unavailable provider/fields.
|
|
178
|
+
* Probe failures never undo a save; Jini owns sealing, hints and atomic defaults. */
|
|
179
|
+
export async function createSourceControlCredential({ deps, input }, _options = {}) {
|
|
180
|
+
const label = validateLabel({ deps: deps.deps, raw: input.label, assertCredentialFreeField: deps.assertCredentialFreeField });
|
|
181
|
+
const connection = validateConnection({ deps: deps.deps, raw: input.connection, registry: await credentialRegistry({ deps, workspaceId: input.workspaceId }), assertCredentialFreeField: deps.assertCredentialFreeField });
|
|
182
|
+
const canonical = deps.repo.canonical;
|
|
183
|
+
if (canonical?.supports({ providerId: connection.providerId })) {
|
|
184
|
+
if (!canonical.create)
|
|
185
|
+
throw new SourceControlCredentialValidationError("Open the provider's API key card to save this shared key.");
|
|
186
|
+
return canonical.create({ workspaceId: input.workspaceId, connection });
|
|
187
|
+
}
|
|
188
|
+
const isDefault = optionalBoolean({ raw: input.isDefault, field: "isDefault" });
|
|
189
|
+
// Project-first (`@jini-ai/integrations/vendor-credentials/project-scope`); "site" = only for this site.
|
|
190
|
+
const target = deps.deps.credentialCreateTarget({ deps, input, invalid: message => new SourceControlCredentialValidationError(message) });
|
|
191
|
+
await assertLabelFreeOnSite({ deps, target, workspaceId: input.workspaceId, providerId: connection.providerId, label });
|
|
192
|
+
const id = deps.idGen.newId();
|
|
193
|
+
const summary = await saveConnection({ deps: target.deps, input: { ...bound(target.deps).scope({ workspaceId: target.workspaceId, kind: "source-control", id }),
|
|
194
|
+
id, provider: connection.providerId, label, expectedRevision: null, payload: { ...connection }, hintToken: connection.token,
|
|
195
|
+
meta: { accountLabel: null }, ...(isDefault === undefined ? {} : { isDefault }) } });
|
|
196
|
+
return { ...await probeSavedConnection({ deps: target.deps, summary, connection, workspaceId: input.workspaceId }), ...reportedScope(deps, target) };
|
|
197
|
+
}
|
|
198
|
+
/** Conflict translation is label-specific; a CAS conflict is never reported as a duplicate. */
|
|
199
|
+
async function saveConnection({ deps, input }, _options = {}) {
|
|
200
|
+
try {
|
|
201
|
+
return await vault(deps).put(input);
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
if (deps.isProjectKeyCreateConflictError(error))
|
|
205
|
+
throw new SourceControlCredentialDuplicateLabelError(error.message);
|
|
206
|
+
const duplicate = isUniqueLabelViolation({ err: error }) || error instanceof VaultError && error.code === "conflict" &&
|
|
207
|
+
(await deps.repo.listByProvider({ workspaceId: input.workspaceId, providerId: input.provider }))
|
|
208
|
+
.some(row => row.id !== input.id && row.label === input.label);
|
|
209
|
+
if (duplicate)
|
|
210
|
+
throw new SourceControlCredentialDuplicateLabelError(input.workspaceId === 'project' ? `Your project already has a key named '${input.label}'. Use it here, or pick another name.` : `a '${input.provider}' credential labeled '${input.label}' already exists in this workspace`);
|
|
211
|
+
throw error;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/** `deps` writes the store holding `summary`'s row; `workspaceId` is the site's (its provider registry). */
|
|
215
|
+
async function probeSavedConnection({ deps, summary, connection, workspaceId }, _options = {}) {
|
|
216
|
+
const probe = await probeAccountLabel({ deps, workspaceId, providerId: connection.providerId, token: connection.token });
|
|
217
|
+
try {
|
|
218
|
+
if (probe.accountLabel !== null)
|
|
219
|
+
assertPlainAccountLabel({ deps: deps.deps, value: probe.accountLabel, assertCredentialFreeField: deps.assertCredentialFreeField });
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
probe.accountLabel = null;
|
|
223
|
+
}
|
|
224
|
+
if (probe.accountLabel !== null) {
|
|
225
|
+
// This is the saved revision, not a new read's revision: an old probe must not heal a rotation.
|
|
226
|
+
try {
|
|
227
|
+
if (!deps.repo.vault)
|
|
228
|
+
throw new Error("Source control credential has no vault");
|
|
229
|
+
await deps.repo.vault.patchMeta({ workspaceId: summary.workspaceId, id: summary.id,
|
|
230
|
+
expectedRevision: summary.revision, patch: { accountLabel: assertPlainAccountLabel({ deps: deps.deps, value: probe.accountLabel, assertCredentialFreeField: deps.assertCredentialFreeField }) }, updatedAt: summary.updatedAt });
|
|
231
|
+
}
|
|
232
|
+
catch { /* A metadata failure does not undo the saved token. */ }
|
|
233
|
+
}
|
|
234
|
+
return { ...vaultSummary({ summary, hint: bound(deps).hint }), accountLabel: probe.accountLabel, connection: probe.connection };
|
|
235
|
+
}
|
|
236
|
+
function assertPlainAccountLabel({ deps, value, assertCredentialFreeField }, _options = {}) {
|
|
237
|
+
assertPlainField({ deps, value, field: "accountLabel", assertCredentialFreeField });
|
|
238
|
+
return value;
|
|
239
|
+
}
|
|
240
|
+
async function loadSourceControlCredentialUpdate({ deps, input }) {
|
|
241
|
+
// Changed where it lives: this site's own row, else the project's attached row.
|
|
242
|
+
const located = await locateById(deps, input);
|
|
243
|
+
if (!located)
|
|
244
|
+
throw new SourceControlCredentialNotFoundError(`no source control credential '${input.id}' in this workspace`);
|
|
245
|
+
const { scoped, record: existing } = located;
|
|
246
|
+
const label = input.label !== undefined ? validateLabel({ deps: deps.deps, raw: input.label, assertCredentialFreeField: deps.assertCredentialFreeField }) : existing.label;
|
|
247
|
+
const requestedDefault = optionalBoolean({ raw: input.isDefault, field: "isDefault" });
|
|
248
|
+
if (!scoped.deps.repo.vault)
|
|
249
|
+
throw new SourceControlCredentialSecretStoreUnconfiguredError(deps.deps.CREDENTIAL_MESSAGES.storage);
|
|
250
|
+
const row = await scoped.deps.repo.vault.find({ workspaceId: scoped.workspaceId, id: input.id });
|
|
251
|
+
if (!row)
|
|
252
|
+
throw new SourceControlCredentialNotFoundError(`no source control credential '${input.id}' in this workspace`);
|
|
253
|
+
const where = bound(scoped.deps).scope({ workspaceId: scoped.workspaceId, kind: "source-control" });
|
|
254
|
+
return { scoped, existing, label, requestedDefault, row, where };
|
|
255
|
+
}
|
|
256
|
+
/** Omitted/blank tokens keep the envelope; explicit rotations reset and re-probe the label.
|
|
257
|
+
* @param required Explicit store ports and update input. @returns A summary with no secret fields.
|
|
258
|
+
* @throws {SourceControlCredentialValidationError} Invalid or unavailable destination/fields.
|
|
259
|
+
* Metadata updates for an unchanged opaque id need neither a provider nor decryption. */
|
|
260
|
+
export async function updateSourceControlCredential({ deps, input }, _options = {}) {
|
|
261
|
+
// Only an id the canonical store does not own reaches the legacy path; owned refusals throw there.
|
|
262
|
+
const canonical = await deps.repo.canonical?.update({ workspaceId: input.workspaceId, id: input.id,
|
|
263
|
+
patch: { label: input.label, connection: input.connection, isDefault: input.isDefault } });
|
|
264
|
+
if (canonical?.owned)
|
|
265
|
+
return canonical.summary;
|
|
266
|
+
const { scoped, existing, label, requestedDefault, row, where } = await loadSourceControlCredentialUpdate({ deps, input });
|
|
267
|
+
const patch = await normalizeConnectionPatch({ raw: input.connection, existing: existing.providerId, registry: () => credentialRegistry({ deps, workspaceId: input.workspaceId }) });
|
|
268
|
+
if (patch !== undefined && !isEmptyTokenPatch({ value: patch })) {
|
|
269
|
+
const connection = validateConnection({ deps: deps.deps, raw: patch, registry: await credentialRegistry({ deps, workspaceId: input.workspaceId }), assertCredentialFreeField: deps.assertCredentialFreeField });
|
|
270
|
+
await assertMoveFreeOnSite({ deps, scoped, existing, workspaceId: input.workspaceId, providerId: connection.providerId, label });
|
|
271
|
+
const summary = await saveConnection({ deps: scoped.deps, input: { ...where, id: input.id,
|
|
272
|
+
expectedRevision: row.revision, provider: connection.providerId, label, payload: { ...connection }, hintToken: connection.token,
|
|
273
|
+
meta: { ...row.meta, accountLabel: null }, ...(requestedDefault === true ? { isDefault: true } : {}) } });
|
|
274
|
+
return { ...await probeSavedConnection({ deps: scoped.deps, summary, connection, workspaceId: input.workspaceId }), ...reportedScope(deps, scoped) };
|
|
275
|
+
}
|
|
276
|
+
await assertBlankPatchChangesNoField({ patch, registry: () => credentialRegistry({ deps, workspaceId: input.workspaceId }) });
|
|
277
|
+
const provider = await preservedProvider({ raw: patch, existing: existing.providerId, registry: () => credentialRegistry({ deps, workspaceId: input.workspaceId }) });
|
|
278
|
+
await assertMoveFreeOnSite({ deps, scoped, existing, workspaceId: input.workspaceId, providerId: provider, label });
|
|
279
|
+
// Omitting payload retains ciphertext/hints without a key; Jini owns both groups' defaults.
|
|
280
|
+
const summary = await saveConnection({ deps: scoped.deps, input: { ...where, id: input.id,
|
|
281
|
+
expectedRevision: row.revision, provider, label,
|
|
282
|
+
meta: { ...row.meta, accountLabel: provider === existing.providerId ? row.meta.accountLabel : null },
|
|
283
|
+
...(requestedDefault === true ? { isDefault: true } : {}) } });
|
|
284
|
+
return { ...vaultSummary({ summary, hint: bound(scoped.deps).hint }), connection: "saved", ...reportedScope(deps, scoped) };
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Deletes a credential set. No-op (not an error) if no row exists for `(workspaceId, id)` — matches
|
|
288
|
+
* `SourceControlCredentialSetRepoPort.delete`'s own idempotent contract and this feature's `DELETE`
|
|
289
|
+
* route's documented 204-always behavior. If the deleted row was its provider's default,
|
|
290
|
+
* `SourceControlCredentialSetRepoPort.delete` itself promotes the group's next candidate.
|
|
291
|
+
*
|
|
292
|
+
* @complexity O(1) at this layer (the repo's own promotion work is O(n) in the small provider
|
|
293
|
+
* group).
|
|
294
|
+
*/
|
|
295
|
+
export async function deleteSourceControlCredential(deps, input) {
|
|
296
|
+
// A canonical key is removed by the store that owns it, under its own grant and deletion rules.
|
|
297
|
+
if ((await deps.repo.canonical?.remove(input))?.owned)
|
|
298
|
+
return;
|
|
299
|
+
// A project row is removed only when no other site uses it, with its attachments.
|
|
300
|
+
const located = await locateById({ ...deps, repo: deps.repo }, input);
|
|
301
|
+
if (located)
|
|
302
|
+
await located.scoped.deps.repo.delete({ workspaceId: located.scoped.workspaceId, id: input.id });
|
|
303
|
+
}
|
|
304
|
+
/** Select from this view's inventory: a visible default wins, else exactly one eligible row.
|
|
305
|
+
* A project-wide default may belong to another site. Never mutate it or guess among nondefaults.
|
|
306
|
+
* `claimed` holds the labels an earlier (site) store already has for this host: those project rows
|
|
307
|
+
* are overridden (as {@link listEffective} hides them), so they are never the fallback. This store's
|
|
308
|
+
* labels are added to it for the next store.
|
|
309
|
+
* @complexity O(visible credentials); the attached read view enforces site eligibility.
|
|
310
|
+
*/
|
|
311
|
+
async function selectSourceControlCredential({ repo, workspaceId, providerId, claimed }, _options = {}) {
|
|
312
|
+
const all = await repo.listByProvider({ workspaceId, providerId });
|
|
313
|
+
const rows = all.filter(row => !claimed.has(row.label));
|
|
314
|
+
for (const row of all)
|
|
315
|
+
claimed.add(row.label);
|
|
316
|
+
const selected = rows.find(row => row.isDefault);
|
|
317
|
+
if (selected || rows.length !== 1)
|
|
318
|
+
return selected ?? null;
|
|
319
|
+
const only = rows[0];
|
|
320
|
+
if (only === undefined)
|
|
321
|
+
throw new Error("Source control credential inventory has no sole row");
|
|
322
|
+
return only;
|
|
323
|
+
}
|
|
324
|
+
/** The selected credential's metadata for a host, never decrypted: this site's, else the project's. */
|
|
325
|
+
export async function findDefaultSourceControlCredential(deps, input) {
|
|
326
|
+
if (deps.repo.canonical?.supports(input))
|
|
327
|
+
return deps.repo.canonical.describe(input);
|
|
328
|
+
const claimed = new Set();
|
|
329
|
+
for (const scoped of deps.deps.credentialScopes({ deps, workspaceId: input.workspaceId })) {
|
|
330
|
+
const found = await selectSourceControlCredential({ repo: scoped.deps.repo, workspaceId: scoped.workspaceId, providerId: input.providerId, claimed });
|
|
331
|
+
if (found)
|
|
332
|
+
return found;
|
|
333
|
+
}
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
/** The first store's selected credential for the host: this site's, else the attached project's.
|
|
337
|
+
* @complexity O(attached inventory); opening retains the vault's context and authentication checks. */
|
|
338
|
+
async function findDefaultOpened(deps, input) {
|
|
339
|
+
const claimed = new Set();
|
|
340
|
+
for (const scoped of deps.deps.credentialScopes({ deps, workspaceId: input.workspaceId })) {
|
|
341
|
+
const selected = await selectSourceControlCredential({ repo: scoped.deps.repo, workspaceId: scoped.workspaceId, providerId: input.providerId, claimed });
|
|
342
|
+
if (!selected)
|
|
343
|
+
continue;
|
|
344
|
+
// The attached-only inventory can select a sole nondefault without changing the project's default.
|
|
345
|
+
// Open by identity so the default-only reader does not reject that valid selection.
|
|
346
|
+
// The expected group makes Jini refuse a stale selection from another group before opening it.
|
|
347
|
+
const resolved = await vault(scoped.deps).get({ ...bound(scoped.deps).scope({ workspaceId: scoped.workspaceId, kind: "source-control" }), id: selected.id }, { provider: input.providerId });
|
|
348
|
+
if (resolved)
|
|
349
|
+
return resolved;
|
|
350
|
+
}
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
/** Resolve exactly one eligible credential through Jini's context-checked open. Genuine decrypt
|
|
354
|
+
* failures stay typed: this runs in the daemon as well as the HTTP process. */
|
|
355
|
+
export async function resolveDefaultForSourceControl(deps, input) {
|
|
356
|
+
try {
|
|
357
|
+
if (deps.repo.canonical?.supports(input))
|
|
358
|
+
return await deps.repo.canonical.resolve(input);
|
|
359
|
+
// This site's default first (a site with any row for the host has one), else the project's.
|
|
360
|
+
const resolved = await findDefaultOpened(deps, input);
|
|
361
|
+
if (!resolved)
|
|
362
|
+
return null;
|
|
363
|
+
if (!resolved.payload)
|
|
364
|
+
throw new SourceControlCredentialSecretStoreUnconfiguredError(deps.deps.CREDENTIAL_MESSAGES.storage);
|
|
365
|
+
// Reading a saved connection never requires its plugin or reinterprets its paired fields.
|
|
366
|
+
const connection = { ...resolved.payload, providerId: resolved.summary.provider,
|
|
367
|
+
token: normalizeStoredToken({ deps: deps.deps, value: resolved.payload.token }) };
|
|
368
|
+
return { id: resolved.summary.id, label: resolved.summary.label, connection };
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
throw new SourceControlCredentialSecretStoreUnconfiguredError(deps.deps.CREDENTIAL_MESSAGES.storage);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { SourceControlProviderId, SourceControlConnectionInput } from "@jini-ai/core/contracts/site/source-control-credentials";
|
|
2
|
+
import type { UUID } from "@jini-ai/core/primitives";
|
|
3
|
+
import type { SourceControlCredentialWriteDeps, SourceControlProviderRegistry } from "./store.js";
|
|
4
|
+
export declare class SourceControlCredentialValidationError extends Error {
|
|
5
|
+
}
|
|
6
|
+
/** Narrows and validates a caller-supplied `label`. Never throws a raw `TypeError` — every
|
|
7
|
+
* rejection is a {@link SourceControlCredentialValidationError} the route layer can map to its own
|
|
8
|
+
* `400`. */
|
|
9
|
+
export declare function validateLabel({ raw, assertCredentialFreeField, deps }: {
|
|
10
|
+
deps: SourceControlCredentialWriteDeps["deps"];
|
|
11
|
+
raw: unknown;
|
|
12
|
+
assertCredentialFreeField: SourceControlCredentialWriteDeps["assertCredentialFreeField"];
|
|
13
|
+
}, _optional?: {}): string;
|
|
14
|
+
/** Narrows a caller-supplied `isDefault`. `undefined` means "no default change requested"; any
|
|
15
|
+
* other non-boolean value is rejected rather than coerced. */
|
|
16
|
+
export declare function optionalBoolean({ raw, field }: {
|
|
17
|
+
raw: unknown;
|
|
18
|
+
field: string;
|
|
19
|
+
}, _optional?: {}): boolean | undefined;
|
|
20
|
+
/** Blank/omitted canonical tokens preserve the envelope after connection-shape validation. */
|
|
21
|
+
export declare function isEmptyTokenPatch({ value }: {
|
|
22
|
+
value: Record<string, unknown>;
|
|
23
|
+
}, _options?: {}): boolean;
|
|
24
|
+
/** Normalize alternate form names before deciding whether this is a rotation. Ordinary metadata
|
|
25
|
+
* patches and canonical-token patches need no registry lookup, keeping opaque saved rows editable.
|
|
26
|
+
* @complexity O(k) input keys plus at most one registry load for provider-specific fields. */
|
|
27
|
+
export declare function normalizeConnectionPatch({ raw, existing, registry }: {
|
|
28
|
+
raw: unknown;
|
|
29
|
+
existing: SourceControlProviderId;
|
|
30
|
+
registry: () => Promise<SourceControlProviderRegistry>;
|
|
31
|
+
}, _options?: {}): Promise<Record<string, unknown> | undefined>;
|
|
32
|
+
/** A blank token keeps the sealed envelope, and the envelope cannot be rewritten without the token,
|
|
33
|
+
* so a blank patch carrying any other connection field is refused rather than dropping it silently.
|
|
34
|
+
* The provider's declared token name is a blank token too. @complexity O(k) patch keys; the registry
|
|
35
|
+
* loads only when the patch names a field besides `providerId`/`token`. */
|
|
36
|
+
export declare function assertBlankPatchChangesNoField({ patch, registry }: {
|
|
37
|
+
patch: Record<string, unknown> | undefined;
|
|
38
|
+
registry: () => Promise<SourceControlProviderRegistry>;
|
|
39
|
+
}, _options?: {}): Promise<void>;
|
|
40
|
+
/** A token-only host can move without opening the secret. Entering a host with required
|
|
41
|
+
* paired fields needs a new connection; an envelope-only move cannot invent those fields.
|
|
42
|
+
* Saved, unlisted ids may keep their envelope and metadata without loading plugin code. */
|
|
43
|
+
export declare function preservedProvider({ raw, existing, registry }: {
|
|
44
|
+
raw: unknown;
|
|
45
|
+
existing: SourceControlProviderId;
|
|
46
|
+
registry: () => Promise<SourceControlProviderRegistry>;
|
|
47
|
+
}, _options?: {}): Promise<SourceControlProviderId>;
|
|
48
|
+
/** Write-only callers without a provider port cannot introduce a new credential/provider. */
|
|
49
|
+
export declare function credentialRegistry({ deps, workspaceId }: {
|
|
50
|
+
deps: SourceControlCredentialWriteDeps;
|
|
51
|
+
workspaceId: UUID;
|
|
52
|
+
}, _options?: {}): Promise<SourceControlProviderRegistry>;
|
|
53
|
+
export declare function normalizeStoredToken({ value, deps }: {
|
|
54
|
+
deps: SourceControlCredentialWriteDeps["deps"];
|
|
55
|
+
value: unknown;
|
|
56
|
+
}): string;
|
|
57
|
+
export declare function assertPlainField(required: {
|
|
58
|
+
deps: SourceControlCredentialWriteDeps["deps"];
|
|
59
|
+
value: string;
|
|
60
|
+
field: string;
|
|
61
|
+
assertCredentialFreeField: SourceControlCredentialWriteDeps["assertCredentialFreeField"];
|
|
62
|
+
}): void;
|
|
63
|
+
/** Validate declared fields before sealing. Authentication pairs stay in one ciphertext blob.
|
|
64
|
+
* Only declared fields are accepted on new writes; existing saved payloads remain opaque.
|
|
65
|
+
* @complexity O(f) time/space, f bounded by the existing credential-form parser (10 fields). */
|
|
66
|
+
export declare function validateConnection({ raw, registry, assertCredentialFreeField, deps }: {
|
|
67
|
+
deps: SourceControlCredentialWriteDeps["deps"];
|
|
68
|
+
raw: unknown;
|
|
69
|
+
registry: SourceControlProviderRegistry;
|
|
70
|
+
assertCredentialFreeField: SourceControlCredentialWriteDeps["assertCredentialFreeField"];
|
|
71
|
+
}, _options?: {}): SourceControlConnectionInput;
|
|
72
|
+
//# sourceMappingURL=store.validation.d.ts.map
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
export class SourceControlCredentialValidationError extends Error {
|
|
2
|
+
}
|
|
3
|
+
const MAX_LABEL_LENGTH = 200;
|
|
4
|
+
/** Narrows and validates a caller-supplied `label`. Never throws a raw `TypeError` — every
|
|
5
|
+
* rejection is a {@link SourceControlCredentialValidationError} the route layer can map to its own
|
|
6
|
+
* `400`. */
|
|
7
|
+
export function validateLabel({ raw, assertCredentialFreeField, deps }, _optional = {}) {
|
|
8
|
+
if (typeof raw !== "string" || raw.trim() === "") {
|
|
9
|
+
throw new SourceControlCredentialValidationError("label must be a non-empty string");
|
|
10
|
+
}
|
|
11
|
+
if (raw.length > MAX_LABEL_LENGTH) {
|
|
12
|
+
throw new SourceControlCredentialValidationError(`label must be ${MAX_LABEL_LENGTH} characters or fewer`);
|
|
13
|
+
}
|
|
14
|
+
assertPlainField({ deps, value: raw, field: "label", assertCredentialFreeField });
|
|
15
|
+
return raw;
|
|
16
|
+
}
|
|
17
|
+
function requireNonEmptyString({ raw, field, providerId }, _optional = {}) {
|
|
18
|
+
if (typeof raw !== "string" || raw.trim() === "") {
|
|
19
|
+
throw new SourceControlCredentialValidationError(`'${field}' (non-empty string) is required for provider '${providerId}'`);
|
|
20
|
+
}
|
|
21
|
+
return raw;
|
|
22
|
+
}
|
|
23
|
+
/** Narrows a caller-supplied `isDefault`. `undefined` means "no default change requested"; any
|
|
24
|
+
* other non-boolean value is rejected rather than coerced. */
|
|
25
|
+
export function optionalBoolean({ raw, field }, _optional = {}) {
|
|
26
|
+
if (raw === undefined)
|
|
27
|
+
return undefined;
|
|
28
|
+
if (typeof raw !== "boolean") {
|
|
29
|
+
throw new SourceControlCredentialValidationError(`'${field}' must be a boolean when provided`);
|
|
30
|
+
}
|
|
31
|
+
return raw;
|
|
32
|
+
}
|
|
33
|
+
/** Blank/omitted canonical tokens preserve the envelope after connection-shape validation. */
|
|
34
|
+
export function isEmptyTokenPatch({ value }, _options = {}) {
|
|
35
|
+
const token = value.token;
|
|
36
|
+
return token === '' || token === undefined;
|
|
37
|
+
}
|
|
38
|
+
/** Reject malformed connection shapes before either rotation or envelope preservation. */
|
|
39
|
+
function connectionObject({ raw }, _options = {}) {
|
|
40
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
|
|
41
|
+
throw new SourceControlCredentialValidationError('connection must be an object');
|
|
42
|
+
}
|
|
43
|
+
return raw;
|
|
44
|
+
}
|
|
45
|
+
/** Forms and vault payloads use `token`; accept a declared form name at the store boundary too.
|
|
46
|
+
* An explicitly supplied canonical value takes precedence, including blank/invalid values. */
|
|
47
|
+
function canonicalConnection({ value, descriptor }, _options = {}) {
|
|
48
|
+
if (value.token !== undefined)
|
|
49
|
+
return value;
|
|
50
|
+
const tokenField = descriptor?.credential?.tokenField ?? 'token';
|
|
51
|
+
return { ...value, token: value[tokenField] };
|
|
52
|
+
}
|
|
53
|
+
/** Normalize alternate form names before deciding whether this is a rotation. Ordinary metadata
|
|
54
|
+
* patches and canonical-token patches need no registry lookup, keeping opaque saved rows editable.
|
|
55
|
+
* @complexity O(k) input keys plus at most one registry load for provider-specific fields. */
|
|
56
|
+
export async function normalizeConnectionPatch({ raw, existing, registry }, _options = {}) {
|
|
57
|
+
if (raw === undefined)
|
|
58
|
+
return undefined;
|
|
59
|
+
// A patch that leaves out the host keeps the saved one (a token-only rotation names no provider).
|
|
60
|
+
const value = { ...connectionObject({ raw }) };
|
|
61
|
+
value.providerId ??= existing;
|
|
62
|
+
if (value.token !== undefined || Object.keys(value).every(key => key === 'providerId' || key === 'token'))
|
|
63
|
+
return value;
|
|
64
|
+
const loaded = await registry();
|
|
65
|
+
const descriptor = typeof value.providerId === 'string' ? loaded.get({ providerId: value.providerId })?.descriptor : undefined;
|
|
66
|
+
return canonicalConnection({ value, descriptor });
|
|
67
|
+
}
|
|
68
|
+
/** A blank token keeps the sealed envelope, and the envelope cannot be rewritten without the token,
|
|
69
|
+
* so a blank patch carrying any other connection field is refused rather than dropping it silently.
|
|
70
|
+
* The provider's declared token name is a blank token too. @complexity O(k) patch keys; the registry
|
|
71
|
+
* loads only when the patch names a field besides `providerId`/`token`. */
|
|
72
|
+
export async function assertBlankPatchChangesNoField({ patch, registry }, _options = {}) {
|
|
73
|
+
const named = Object.keys(patch ?? {}).filter(key => key !== 'providerId' && key !== 'token');
|
|
74
|
+
if (named.length === 0)
|
|
75
|
+
return;
|
|
76
|
+
const providerId = typeof patch?.providerId === 'string' ? patch.providerId : '';
|
|
77
|
+
const tokenField = (await registry()).get({ providerId })?.descriptor.credential?.tokenField;
|
|
78
|
+
const changed = named.filter(key => key !== tokenField);
|
|
79
|
+
if (changed.length > 0)
|
|
80
|
+
throw new SourceControlCredentialValidationError(`changing ${changed.join(', ')} requires a new token`);
|
|
81
|
+
}
|
|
82
|
+
/** A token-only host can move without opening the secret. Entering a host with required
|
|
83
|
+
* paired fields needs a new connection; an envelope-only move cannot invent those fields.
|
|
84
|
+
* Saved, unlisted ids may keep their envelope and metadata without loading plugin code. */
|
|
85
|
+
export async function preservedProvider({ raw, existing, registry }, _options = {}) {
|
|
86
|
+
if (raw === undefined)
|
|
87
|
+
return existing;
|
|
88
|
+
const providerId = raw.providerId;
|
|
89
|
+
if (providerId === undefined || providerId === existing)
|
|
90
|
+
return existing;
|
|
91
|
+
const descriptor = requireProvider({ providerId, registry: await registry() });
|
|
92
|
+
const credential = descriptor.credential;
|
|
93
|
+
const paired = credential?.fields.find(field => field.required && field.name !== credential.tokenField);
|
|
94
|
+
if (paired)
|
|
95
|
+
throw new SourceControlCredentialValidationError(`moving to ${descriptor.id} requires a new token and ${paired.name}`);
|
|
96
|
+
return descriptor.id;
|
|
97
|
+
}
|
|
98
|
+
/** Only loaded providers admit new connections; stored ids are never checked against this list. */
|
|
99
|
+
function requireProvider({ providerId, registry }, _options = {}) {
|
|
100
|
+
const loaded = typeof providerId === 'string' ? registry.get({ providerId }) : undefined;
|
|
101
|
+
if (!loaded)
|
|
102
|
+
throw new SourceControlCredentialValidationError(`connection.providerId must be one of: ${registry.list().map(provider => provider.descriptor.id).join(', ')}`);
|
|
103
|
+
return loaded.descriptor;
|
|
104
|
+
}
|
|
105
|
+
/** Write-only callers without a provider port cannot introduce a new credential/provider. */
|
|
106
|
+
export async function credentialRegistry({ deps, workspaceId }, _options = {}) {
|
|
107
|
+
if (!deps.loadSourceControlProviders)
|
|
108
|
+
return { list: () => [], get: () => undefined, refusals: [] };
|
|
109
|
+
return deps.loadSourceControlProviders({ workspaceId });
|
|
110
|
+
}
|
|
111
|
+
export function normalizeStoredToken({ value, deps }) {
|
|
112
|
+
try {
|
|
113
|
+
return deps.normalizeCredentialToken({ value });
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
if (err instanceof deps.CredentialInputError) {
|
|
117
|
+
throw new SourceControlCredentialValidationError(err.message);
|
|
118
|
+
}
|
|
119
|
+
throw err;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export function assertPlainField(required) {
|
|
123
|
+
const { deps, ...input } = required;
|
|
124
|
+
try {
|
|
125
|
+
required.assertCredentialFreeField(input);
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
if (err instanceof deps.CredentialInputError) {
|
|
129
|
+
throw new SourceControlCredentialValidationError(err.message);
|
|
130
|
+
}
|
|
131
|
+
throw err;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** Validate declared fields before sealing. Authentication pairs stay in one ciphertext blob.
|
|
135
|
+
* Only declared fields are accepted on new writes; existing saved payloads remain opaque.
|
|
136
|
+
* @complexity O(f) time/space, f bounded by the existing credential-form parser (10 fields). */
|
|
137
|
+
export function validateConnection({ raw, registry, assertCredentialFreeField, deps }, _options = {}) {
|
|
138
|
+
const value = connectionObject({ raw });
|
|
139
|
+
const descriptor = requireProvider({ providerId: value.providerId, registry });
|
|
140
|
+
const canonical = canonicalConnection({ value, descriptor });
|
|
141
|
+
const token = normalizeStoredToken({ deps, value: canonical.token });
|
|
142
|
+
return { ...collectDeclaredFields({ deps, value, descriptor, assertCredentialFreeField }), providerId: descriptor.id, token };
|
|
143
|
+
}
|
|
144
|
+
/** Collect only the provider's additional declared fields; the primary secret is stored as `token`.
|
|
145
|
+
* Authentication pairs stay in the same ciphertext blob. @complexity O(f) time/space, f <= 10. */
|
|
146
|
+
function collectDeclaredFields({ value, descriptor, assertCredentialFreeField, deps }, _options = {}) {
|
|
147
|
+
const tokenField = descriptor.credential?.tokenField ?? 'token';
|
|
148
|
+
const fields = {};
|
|
149
|
+
for (const field of descriptor.credential?.fields ?? []) {
|
|
150
|
+
if (field.name === tokenField)
|
|
151
|
+
continue;
|
|
152
|
+
const validated = validateDeclaredField({ deps, value: value[field.name], field, providerId: descriptor.id, assertCredentialFreeField });
|
|
153
|
+
if (validated !== undefined)
|
|
154
|
+
fields[field.name] = validated;
|
|
155
|
+
}
|
|
156
|
+
return fields;
|
|
157
|
+
}
|
|
158
|
+
/** Non-secret metadata uses the existing credential-free admission check; secrets use token admission. */
|
|
159
|
+
function validateDeclaredField({ value, field, providerId, assertCredentialFreeField, deps }, _options = {}) {
|
|
160
|
+
if (value === undefined && !field.required)
|
|
161
|
+
return undefined;
|
|
162
|
+
const text = requireNonEmptyString({ raw: value, field: field.name, providerId });
|
|
163
|
+
if (field.secret)
|
|
164
|
+
return normalizeStoredToken({ deps, value: text });
|
|
165
|
+
assertPlainField({ deps, value: text, field: field.name, assertCredentialFreeField });
|
|
166
|
+
return text;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=store.validation.js.map
|