@contractspec/lib.contracts-spec 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/app-config/app-config.capability.d.ts +1 -0
- package/dist/app-config/app-config.capability.js +730 -0
- package/dist/app-config/app-config.contracts.d.ts +239 -0
- package/dist/app-config/app-config.contracts.js +713 -0
- package/dist/app-config/app-config.contracts.test.d.ts +1 -0
- package/dist/app-config/app-config.feature.d.ts +5 -0
- package/dist/app-config/app-config.feature.js +255 -0
- package/dist/app-config/branding.d.ts +52 -0
- package/dist/app-config/branding.js +1 -0
- package/dist/app-config/branding.test.d.ts +1 -0
- package/dist/app-config/docs/app-config.docblock.d.ts +2 -0
- package/dist/app-config/docs/app-config.docblock.js +383 -0
- package/dist/app-config/events.d.ts +115 -0
- package/dist/app-config/events.js +386 -0
- package/dist/app-config/events.test.d.ts +1 -0
- package/dist/app-config/index.d.ts +9 -0
- package/dist/app-config/index.js +2899 -0
- package/dist/app-config/lifecycle-contracts.d.ts +265 -0
- package/dist/app-config/lifecycle-contracts.js +870 -0
- package/dist/app-config/lifecycle-contracts.test.d.ts +1 -0
- package/dist/app-config/lifecycle.d.ts +23 -0
- package/dist/app-config/lifecycle.js +1 -0
- package/dist/app-config/lifecycle.test.d.ts +1 -0
- package/dist/app-config/runtime.d.ts +111 -0
- package/dist/app-config/runtime.js +734 -0
- package/dist/app-config/runtime.test.d.ts +1 -0
- package/dist/app-config/spec.d.ts +169 -0
- package/dist/app-config/spec.js +229 -0
- package/dist/app-config/spec.test.d.ts +1 -0
- package/dist/app-config/validation.d.ts +43 -0
- package/dist/app-config/validation.js +650 -0
- package/dist/app-config/validation.test.d.ts +1 -0
- package/dist/capabilities/capabilities.d.ts +96 -0
- package/dist/capabilities/capabilities.js +217 -0
- package/dist/capabilities/capabilities.test.d.ts +1 -0
- package/dist/capabilities/context.d.ts +110 -0
- package/dist/capabilities/context.js +101 -0
- package/dist/capabilities/context.test.d.ts +1 -0
- package/dist/capabilities/docs/capabilities.docblock.d.ts +2 -0
- package/dist/capabilities/docs/capabilities.docblock.js +353 -0
- package/dist/capabilities/guards.d.ts +121 -0
- package/dist/capabilities/guards.js +177 -0
- package/dist/capabilities/index.d.ts +6 -0
- package/dist/capabilities/index.js +739 -0
- package/dist/capabilities/meeting-recorder.d.ts +5 -0
- package/dist/capabilities/meeting-recorder.js +154 -0
- package/dist/capabilities/openbanking.d.ts +5 -0
- package/dist/capabilities/openbanking.js +166 -0
- package/dist/capabilities/validation.d.ts +79 -0
- package/dist/capabilities/validation.js +185 -0
- package/dist/capabilities/validation.test.d.ts +1 -0
- package/dist/contract-registry/index.d.ts +3 -0
- package/dist/contract-registry/index.js +129 -0
- package/dist/contract-registry/schemas.d.ts +120 -0
- package/dist/contract-registry/schemas.js +129 -0
- package/dist/contract-registry/schemas.test.d.ts +1 -0
- package/dist/contract-registry/types.d.ts +42 -0
- package/dist/contract-registry/types.js +1 -0
- package/dist/data-views/data-views.d.ts +4 -0
- package/dist/data-views/data-views.js +232 -0
- package/dist/data-views/data-views.test.d.ts +1 -0
- package/dist/data-views/docs/data-views.docblock.d.ts +2 -0
- package/dist/data-views/docs/data-views.docblock.js +164 -0
- package/dist/data-views/index.d.ts +4 -0
- package/dist/data-views/index.js +232 -0
- package/dist/data-views/query-generator.d.ts +35 -0
- package/dist/data-views/query-generator.js +89 -0
- package/dist/data-views/registry.d.ts +12 -0
- package/dist/data-views/registry.js +226 -0
- package/dist/data-views/registry.test.d.ts +1 -0
- package/dist/data-views/report/contractVerificationTable.d.ts +4 -0
- package/dist/data-views/report/contractVerificationTable.js +240 -0
- package/dist/data-views/report/contractVerificationTable.test.d.ts +1 -0
- package/dist/data-views/runtime.d.ts +25 -0
- package/dist/data-views/runtime.js +108 -0
- package/dist/data-views/runtime.test.d.ts +1 -0
- package/dist/data-views/spec.d.ts +22 -0
- package/dist/data-views/spec.js +38 -0
- package/dist/data-views/spec.test.d.ts +1 -0
- package/dist/data-views/types.d.ts +152 -0
- package/dist/data-views/types.js +1 -0
- package/dist/data-views/types.test.d.ts +1 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts +2 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +513 -0
- package/dist/docs/capabilities/documentationSystem.capability.d.ts +1 -0
- package/dist/docs/capabilities/documentationSystem.capability.js +784 -0
- package/dist/docs/capabilities/index.d.ts +1 -0
- package/dist/docs/capabilities/index.js +784 -0
- package/dist/docs/commands/docsGenerate.command.d.ts +88 -0
- package/dist/docs/commands/docsGenerate.command.js +802 -0
- package/dist/docs/commands/docsPublish.command.d.ts +57 -0
- package/dist/docs/commands/docsPublish.command.js +781 -0
- package/dist/docs/commands/index.d.ts +2 -0
- package/dist/docs/commands/index.js +906 -0
- package/dist/docs/constants.d.ts +4 -0
- package/dist/docs/constants.js +78 -0
- package/dist/docs/contracts.d.ts +430 -0
- package/dist/docs/contracts.js +1611 -0
- package/dist/docs/ensure-docblocks.d.ts +1 -0
- package/dist/docs/ensure-docblocks.js +264 -0
- package/dist/docs/events/docsGenerated.event.d.ts +56 -0
- package/dist/docs/events/docsGenerated.event.js +533 -0
- package/dist/docs/events/docsPublished.event.d.ts +64 -0
- package/dist/docs/events/docsPublished.event.js +534 -0
- package/dist/docs/events/index.d.ts +2 -0
- package/dist/docs/events/index.js +567 -0
- package/dist/docs/forms/docsSearch.form.d.ts +16 -0
- package/dist/docs/forms/docsSearch.form.js +676 -0
- package/dist/docs/forms/index.d.ts +1 -0
- package/dist/docs/forms/index.js +676 -0
- package/dist/docs/index.d.ts +40 -0
- package/dist/docs/index.js +4719 -0
- package/dist/docs/meta.docs.d.ts +2 -0
- package/dist/docs/meta.docs.js +176 -0
- package/dist/docs/presentations/docsLayout.presentation.d.ts +2 -0
- package/dist/docs/presentations/docsLayout.presentation.js +527 -0
- package/dist/docs/presentations/docsReferencePage.presentation.d.ts +2 -0
- package/dist/docs/presentations/docsReferencePage.presentation.js +527 -0
- package/dist/docs/presentations/index.d.ts +2 -0
- package/dist/docs/presentations/index.js +555 -0
- package/dist/docs/presentations.d.ts +27 -0
- package/dist/docs/presentations.js +97 -0
- package/dist/docs/presentations.test.d.ts +1 -0
- package/dist/docs/queries/contractReference.query.d.ts +211 -0
- package/dist/docs/queries/contractReference.query.js +752 -0
- package/dist/docs/queries/docsIndex.query.d.ts +266 -0
- package/dist/docs/queries/docsIndex.query.js +752 -0
- package/dist/docs/queries/index.d.ts +2 -0
- package/dist/docs/queries/index.js +827 -0
- package/dist/docs/registry.d.ts +19 -0
- package/dist/docs/registry.js +153 -0
- package/dist/docs/registry.test.d.ts +1 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts +2 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +221 -0
- package/dist/docs/tech/cli.docblock.d.ts +2 -0
- package/dist/docs/tech/cli.docblock.js +291 -0
- package/dist/docs/tech/contracts/README.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/README.docblock.js +164 -0
- package/dist/docs/tech/contracts/migrations.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/migrations.docblock.js +164 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.js +201 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.js +207 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +225 -0
- package/dist/docs/tech/contracts/overlays.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/overlays.docblock.js +231 -0
- package/dist/docs/tech/contracts/tests.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/tests.docblock.js +164 -0
- package/dist/docs/tech/contracts/themes.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/themes.docblock.js +257 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts +2 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +269 -0
- package/dist/docs/tech/docs-system.docblock.d.ts +1 -0
- package/dist/docs/tech/docs-system.docblock.js +264 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts +2 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +376 -0
- package/dist/docs/tech/llm/llm-integration.docblock.d.ts +7 -0
- package/dist/docs/tech/llm/llm-integration.docblock.js +482 -0
- package/dist/docs/tech/mcp-endpoints.docblock.d.ts +2 -0
- package/dist/docs/tech/mcp-endpoints.docblock.js +185 -0
- package/dist/docs/tech/presentation-runtime.docblock.d.ts +2 -0
- package/dist/docs/tech/presentation-runtime.docblock.js +221 -0
- package/dist/docs/tech/report-verification-table.docblock.d.ts +1 -0
- package/dist/docs/tech/report-verification-table.docblock.js +191 -0
- package/dist/docs/tech/report-verification-table.test.d.ts +1 -0
- package/dist/docs/tech/schema/README.docblock.d.ts +2 -0
- package/dist/docs/tech/schema/README.docblock.js +164 -0
- package/dist/docs/tech/studio/learning-events.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/learning-events.docblock.js +190 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.js +227 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +226 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.js +200 -0
- package/dist/docs/tech/studio/project-routing.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/project-routing.docblock.js +209 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +183 -0
- package/dist/docs/tech/studio/team-invitations.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/team-invitations.docblock.js +228 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.js +189 -0
- package/dist/docs/tech/studio/workspaces.docblock.d.ts +2 -0
- package/dist/docs/tech/studio/workspaces.docblock.js +204 -0
- package/dist/docs/tech/telemetry-ingest.docblock.d.ts +2 -0
- package/dist/docs/tech/telemetry-ingest.docblock.js +305 -0
- package/dist/docs/tech/vscode-extension.docblock.d.ts +2 -0
- package/dist/docs/tech/vscode-extension.docblock.js +241 -0
- package/dist/docs/tech-contracts.docs.d.ts +2 -0
- package/dist/docs/tech-contracts.docs.js +239 -0
- package/dist/docs/types.d.ts +37 -0
- package/dist/docs/types.js +1 -0
- package/dist/docs/views/contractReference.dataView.d.ts +2 -0
- package/dist/docs/views/contractReference.dataView.js +838 -0
- package/dist/docs/views/docsIndex.dataView.d.ts +2 -0
- package/dist/docs/views/docsIndex.dataView.js +832 -0
- package/dist/docs/views/exampleCatalog.dataView.d.ts +2 -0
- package/dist/docs/views/exampleCatalog.dataView.js +816 -0
- package/dist/docs/views/index.d.ts +3 -0
- package/dist/docs/views/index.js +1031 -0
- package/dist/events.d.ts +142 -0
- package/dist/events.js +228 -0
- package/dist/events.test.d.ts +1 -0
- package/dist/examples/define.d.ts +5 -0
- package/dist/examples/define.js +36 -0
- package/dist/examples/docs/examples.docblock.d.ts +2 -0
- package/dist/examples/docs/examples.docblock.js +307 -0
- package/dist/examples/index.d.ts +7 -0
- package/dist/examples/index.js +604 -0
- package/dist/examples/registry.d.ts +38 -0
- package/dist/examples/registry.js +286 -0
- package/dist/examples/registry.test.d.ts +1 -0
- package/dist/examples/schema.d.ts +278 -0
- package/dist/examples/schema.js +166 -0
- package/dist/examples/schema.test.d.ts +1 -0
- package/dist/examples/types.d.ts +162 -0
- package/dist/examples/types.js +77 -0
- package/dist/examples/types.test.d.ts +1 -0
- package/dist/examples/validation.d.ts +61 -0
- package/dist/examples/validation.js +287 -0
- package/dist/examples/validation.test.d.ts +1 -0
- package/dist/experiments/docs/experiments.docblock.d.ts +2 -0
- package/dist/experiments/docs/experiments.docblock.js +291 -0
- package/dist/experiments/evaluator.d.ts +33 -0
- package/dist/experiments/evaluator.js +155 -0
- package/dist/experiments/evaluator.test.d.ts +1 -0
- package/dist/experiments/spec-resolver.d.ts +12 -0
- package/dist/experiments/spec-resolver.js +1 -0
- package/dist/experiments/spec.d.ts +79 -0
- package/dist/experiments/spec.js +227 -0
- package/dist/experiments/spec.test.d.ts +1 -0
- package/dist/features/index.d.ts +5 -0
- package/dist/features/index.js +275 -0
- package/dist/features/install.d.ts +14 -0
- package/dist/features/install.js +95 -0
- package/dist/features/install.test.d.ts +1 -0
- package/dist/features/registry.d.ts +21 -0
- package/dist/features/registry.js +192 -0
- package/dist/features/registry.test.d.ts +1 -0
- package/dist/features/types.d.ts +82 -0
- package/dist/features/types.js +36 -0
- package/dist/features/types.test.d.ts +1 -0
- package/dist/features/validation.d.ts +4 -0
- package/dist/features/validation.js +48 -0
- package/dist/features/validation.test.d.ts +1 -0
- package/dist/features.capabilities.test.d.ts +1 -0
- package/dist/forms/docs/forms.docblock.d.ts +2 -0
- package/dist/forms/docs/forms.docblock.js +164 -0
- package/dist/forms/forms.d.ts +264 -0
- package/dist/forms/forms.js +332 -0
- package/dist/forms/index.d.ts +1 -0
- package/dist/forms/index.js +332 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +2195 -0
- package/dist/install.d.ts +75 -0
- package/dist/install.js +60 -0
- package/dist/integrations/binding.d.ts +14 -0
- package/dist/integrations/binding.js +1 -0
- package/dist/integrations/connection.d.ts +47 -0
- package/dist/integrations/connection.js +1 -0
- package/dist/integrations/docs/integrations.docblock.d.ts +2 -0
- package/dist/integrations/docs/integrations.docblock.js +140 -0
- package/dist/integrations/health.d.ts +17 -0
- package/dist/integrations/health.js +103 -0
- package/dist/integrations/health.test.d.ts +1 -0
- package/dist/integrations/index.d.ts +11 -0
- package/dist/integrations/index.js +3293 -0
- package/dist/integrations/integrations.capability.d.ts +1 -0
- package/dist/integrations/integrations.capability.js +48 -0
- package/dist/integrations/integrations.feature.d.ts +5 -0
- package/dist/integrations/integrations.feature.js +63 -0
- package/dist/integrations/meeting-recorder/contracts/index.d.ts +7 -0
- package/dist/integrations/meeting-recorder/contracts/index.js +504 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.d.ts +451 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.js +249 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.d.ts +166 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.js +317 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.d.ts +85 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.js +202 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.d.ts +1 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.js +48 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.d.ts +5 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.js +63 -0
- package/dist/integrations/meeting-recorder/models.d.ts +402 -0
- package/dist/integrations/meeting-recorder/models.js +152 -0
- package/dist/integrations/meeting-recorder/telemetry.d.ts +13 -0
- package/dist/integrations/meeting-recorder/telemetry.js +84 -0
- package/dist/integrations/openbanking/contracts/accounts.d.ts +282 -0
- package/dist/integrations/openbanking/contracts/accounts.js +358 -0
- package/dist/integrations/openbanking/contracts/balances.d.ts +158 -0
- package/dist/integrations/openbanking/contracts/balances.js +322 -0
- package/dist/integrations/openbanking/contracts/index.d.ts +7 -0
- package/dist/integrations/openbanking/contracts/index.js +674 -0
- package/dist/integrations/openbanking/contracts/transactions.d.ts +206 -0
- package/dist/integrations/openbanking/contracts/transactions.js +328 -0
- package/dist/integrations/openbanking/guards.d.ts +8 -0
- package/dist/integrations/openbanking/guards.js +72 -0
- package/dist/integrations/openbanking/guards.test.d.ts +1 -0
- package/dist/integrations/openbanking/models.d.ts +223 -0
- package/dist/integrations/openbanking/models.js +140 -0
- package/dist/integrations/openbanking/openbanking.capability.d.ts +1 -0
- package/dist/integrations/openbanking/openbanking.capability.js +48 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +5 -0
- package/dist/integrations/openbanking/openbanking.feature.js +65 -0
- package/dist/integrations/openbanking/telemetry.d.ts +12 -0
- package/dist/integrations/openbanking/telemetry.js +81 -0
- package/dist/integrations/operations.d.ts +430 -0
- package/dist/integrations/operations.js +327 -0
- package/dist/integrations/operations.test.d.ts +1 -0
- package/dist/integrations/providers/analytics-reader.d.ts +103 -0
- package/dist/integrations/providers/analytics-reader.js +1 -0
- package/dist/integrations/providers/analytics-writer.d.ts +6 -0
- package/dist/integrations/providers/analytics-writer.js +1 -0
- package/dist/integrations/providers/analytics.d.ts +47 -0
- package/dist/integrations/providers/analytics.js +1 -0
- package/dist/integrations/providers/calendar.d.ts +75 -0
- package/dist/integrations/providers/calendar.js +1 -0
- package/dist/integrations/providers/database.d.ts +12 -0
- package/dist/integrations/providers/database.js +1 -0
- package/dist/integrations/providers/elevenlabs.d.ts +3 -0
- package/dist/integrations/providers/elevenlabs.js +116 -0
- package/dist/integrations/providers/email.d.ts +83 -0
- package/dist/integrations/providers/email.js +1 -0
- package/dist/integrations/providers/embedding.d.ts +21 -0
- package/dist/integrations/providers/embedding.js +1 -0
- package/dist/integrations/providers/fal.d.ts +3 -0
- package/dist/integrations/providers/fal.js +142 -0
- package/dist/integrations/providers/fathom.d.ts +3 -0
- package/dist/integrations/providers/fathom.js +156 -0
- package/dist/integrations/providers/fireflies.d.ts +3 -0
- package/dist/integrations/providers/fireflies.js +136 -0
- package/dist/integrations/providers/gcs-storage.d.ts +3 -0
- package/dist/integrations/providers/gcs-storage.js +127 -0
- package/dist/integrations/providers/gmail.d.ts +3 -0
- package/dist/integrations/providers/gmail.js +139 -0
- package/dist/integrations/providers/google-calendar.d.ts +3 -0
- package/dist/integrations/providers/google-calendar.js +122 -0
- package/dist/integrations/providers/gradium.d.ts +3 -0
- package/dist/integrations/providers/gradium.js +140 -0
- package/dist/integrations/providers/granola.d.ts +3 -0
- package/dist/integrations/providers/granola.js +137 -0
- package/dist/integrations/providers/index.d.ts +38 -0
- package/dist/integrations/providers/index.js +2124 -0
- package/dist/integrations/providers/jira.d.ts +3 -0
- package/dist/integrations/providers/jira.js +138 -0
- package/dist/integrations/providers/linear.d.ts +3 -0
- package/dist/integrations/providers/linear.js +137 -0
- package/dist/integrations/providers/llm.d.ts +79 -0
- package/dist/integrations/providers/llm.js +1 -0
- package/dist/integrations/providers/meeting-recorder.d.ts +129 -0
- package/dist/integrations/providers/meeting-recorder.js +1 -0
- package/dist/integrations/providers/mistral.d.ts +3 -0
- package/dist/integrations/providers/mistral.js +124 -0
- package/dist/integrations/providers/notion.d.ts +3 -0
- package/dist/integrations/providers/notion.js +143 -0
- package/dist/integrations/providers/openbanking.d.ts +125 -0
- package/dist/integrations/providers/openbanking.js +1 -0
- package/dist/integrations/providers/payments.d.ts +106 -0
- package/dist/integrations/providers/payments.js +1 -0
- package/dist/integrations/providers/posthog-llm-telemetry.d.ts +51 -0
- package/dist/integrations/providers/posthog-llm-telemetry.js +206 -0
- package/dist/integrations/providers/posthog.d.ts +3 -0
- package/dist/integrations/providers/posthog.js +136 -0
- package/dist/integrations/providers/postmark.d.ts +3 -0
- package/dist/integrations/providers/postmark.js +128 -0
- package/dist/integrations/providers/powens.d.ts +3 -0
- package/dist/integrations/providers/powens.js +154 -0
- package/dist/integrations/providers/project-management.d.ts +32 -0
- package/dist/integrations/providers/project-management.js +1 -0
- package/dist/integrations/providers/providers.test.d.ts +1 -0
- package/dist/integrations/providers/qdrant.d.ts +3 -0
- package/dist/integrations/providers/qdrant.js +131 -0
- package/dist/integrations/providers/registry.d.ts +6 -0
- package/dist/integrations/providers/registry.js +1908 -0
- package/dist/integrations/providers/sms.d.ts +31 -0
- package/dist/integrations/providers/sms.js +1 -0
- package/dist/integrations/providers/storage.d.ts +57 -0
- package/dist/integrations/providers/storage.js +1 -0
- package/dist/integrations/providers/stripe.d.ts +3 -0
- package/dist/integrations/providers/stripe.js +135 -0
- package/dist/integrations/providers/supabase-postgres.d.ts +3 -0
- package/dist/integrations/providers/supabase-postgres.js +117 -0
- package/dist/integrations/providers/supabase-vector.d.ts +3 -0
- package/dist/integrations/providers/supabase-vector.js +137 -0
- package/dist/integrations/providers/tldv.d.ts +3 -0
- package/dist/integrations/providers/tldv.js +136 -0
- package/dist/integrations/providers/twilio-sms.d.ts +3 -0
- package/dist/integrations/providers/twilio-sms.js +121 -0
- package/dist/integrations/providers/vector-store.d.ts +39 -0
- package/dist/integrations/providers/vector-store.js +1 -0
- package/dist/integrations/providers/voice.d.ts +31 -0
- package/dist/integrations/providers/voice.js +1 -0
- package/dist/integrations/runtime.d.ts +95 -0
- package/dist/integrations/runtime.js +239 -0
- package/dist/integrations/runtime.test.d.ts +1 -0
- package/dist/integrations/secrets/aws-secret-manager.d.ts +28 -0
- package/dist/integrations/secrets/aws-secret-manager.js +376 -0
- package/dist/integrations/secrets/env-secret-provider.d.ts +28 -0
- package/dist/integrations/secrets/env-secret-provider.js +189 -0
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +29 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +377 -0
- package/dist/integrations/secrets/index.d.ts +6 -0
- package/dist/integrations/secrets/index.js +1159 -0
- package/dist/integrations/secrets/manager.d.ts +44 -0
- package/dist/integrations/secrets/manager.js +213 -0
- package/dist/integrations/secrets/provider.d.ts +49 -0
- package/dist/integrations/secrets/provider.js +104 -0
- package/dist/integrations/secrets/provider.test.d.ts +1 -0
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts +35 -0
- package/dist/integrations/secrets/scaleway-secret-manager.js +405 -0
- package/dist/integrations/secrets-types.d.ts +14 -0
- package/dist/integrations/secrets-types.js +1 -0
- package/dist/integrations/spec.d.ts +72 -0
- package/dist/integrations/spec.js +52 -0
- package/dist/integrations/spec.test.d.ts +1 -0
- package/dist/jobs/define-job.d.ts +15 -0
- package/dist/jobs/define-job.js +41 -0
- package/dist/jobs/gcp-cloud-tasks.d.ts +38 -0
- package/dist/jobs/gcp-cloud-tasks.js +103 -0
- package/dist/jobs/gcp-pubsub.d.ts +22 -0
- package/dist/jobs/gcp-pubsub.js +91 -0
- package/dist/jobs/handlers/gmail-sync-handler.d.ts +5 -0
- package/dist/jobs/handlers/gmail-sync-handler.js +40 -0
- package/dist/jobs/handlers/handlers.test.d.ts +1 -0
- package/dist/jobs/handlers/index.d.ts +5 -0
- package/dist/jobs/handlers/index.js +83 -0
- package/dist/jobs/handlers/ping-handler.d.ts +6 -0
- package/dist/jobs/handlers/ping-handler.js +47 -0
- package/dist/jobs/handlers/storage-document-handler.d.ts +8 -0
- package/dist/jobs/handlers/storage-document-handler.js +47 -0
- package/dist/jobs/index.d.ts +2 -0
- package/dist/jobs/index.js +64 -0
- package/dist/jobs/memory-queue.d.ts +14 -0
- package/dist/jobs/memory-queue.js +129 -0
- package/dist/jobs/queue.d.ts +126 -0
- package/dist/jobs/queue.js +55 -0
- package/dist/jobs/queue.test.d.ts +1 -0
- package/dist/jobs/scaleway-sqs-queue.d.ts +27 -0
- package/dist/jobs/scaleway-sqs-queue.js +222 -0
- package/dist/jsonschema.d.ts +39 -0
- package/dist/jsonschema.js +73 -0
- package/dist/jsonschema.test.d.ts +1 -0
- package/dist/knowledge/binding.d.ts +22 -0
- package/dist/knowledge/binding.js +1 -0
- package/dist/knowledge/docs/knowledge.docblock.d.ts +2 -0
- package/dist/knowledge/docs/knowledge.docblock.js +301 -0
- package/dist/knowledge/index.d.ts +4 -0
- package/dist/knowledge/index.js +467 -0
- package/dist/knowledge/ingestion/document-processor.d.ts +22 -0
- package/dist/knowledge/ingestion/document-processor.js +95 -0
- package/dist/knowledge/ingestion/embedding-service.d.ts +8 -0
- package/dist/knowledge/ingestion/embedding-service.js +57 -0
- package/dist/knowledge/ingestion/gmail-adapter.d.ts +14 -0
- package/dist/knowledge/ingestion/gmail-adapter.js +103 -0
- package/dist/knowledge/ingestion/index.d.ts +5 -0
- package/dist/knowledge/ingestion/index.js +252 -0
- package/dist/knowledge/ingestion/ingestion.test.d.ts +1 -0
- package/dist/knowledge/ingestion/storage-adapter.d.ts +11 -0
- package/dist/knowledge/ingestion/storage-adapter.js +62 -0
- package/dist/knowledge/ingestion/vector-indexer.d.ts +14 -0
- package/dist/knowledge/ingestion/vector-indexer.js +63 -0
- package/dist/knowledge/knowledge.capability.d.ts +1 -0
- package/dist/knowledge/knowledge.capability.js +726 -0
- package/dist/knowledge/knowledge.feature.d.ts +5 -0
- package/dist/knowledge/knowledge.feature.js +300 -0
- package/dist/knowledge/operations.d.ts +311 -0
- package/dist/knowledge/operations.js +619 -0
- package/dist/knowledge/operations.test.d.ts +1 -0
- package/dist/knowledge/query/index.d.ts +1 -0
- package/dist/knowledge/query/index.js +110 -0
- package/dist/knowledge/query/service.d.ts +25 -0
- package/dist/knowledge/query/service.js +110 -0
- package/dist/knowledge/query/service.test.d.ts +1 -0
- package/dist/knowledge/runtime.d.ts +28 -0
- package/dist/knowledge/runtime.js +91 -0
- package/dist/knowledge/runtime.test.d.ts +1 -0
- package/dist/knowledge/source.d.ts +29 -0
- package/dist/knowledge/source.js +1 -0
- package/dist/knowledge/spaces/email-threads.d.ts +3 -0
- package/dist/knowledge/spaces/email-threads.js +102 -0
- package/dist/knowledge/spaces/financial-docs.d.ts +3 -0
- package/dist/knowledge/spaces/financial-docs.js +102 -0
- package/dist/knowledge/spaces/financial-overview.d.ts +3 -0
- package/dist/knowledge/spaces/financial-overview.js +102 -0
- package/dist/knowledge/spaces/index.d.ts +6 -0
- package/dist/knowledge/spaces/index.js +273 -0
- package/dist/knowledge/spaces/product-canon.d.ts +3 -0
- package/dist/knowledge/spaces/product-canon.js +102 -0
- package/dist/knowledge/spaces/spaces.test.d.ts +1 -0
- package/dist/knowledge/spaces/support-faq.d.ts +3 -0
- package/dist/knowledge/spaces/support-faq.js +103 -0
- package/dist/knowledge/spaces/uploaded-docs.d.ts +3 -0
- package/dist/knowledge/spaces/uploaded-docs.js +102 -0
- package/dist/knowledge/spec.d.ts +42 -0
- package/dist/knowledge/spec.js +228 -0
- package/dist/knowledge/spec.test.d.ts +1 -0
- package/dist/llm/exporters.d.ts +68 -0
- package/dist/llm/exporters.js +1011 -0
- package/dist/llm/index.d.ts +12 -0
- package/dist/llm/index.js +1465 -0
- package/dist/llm/prompts.d.ts +53 -0
- package/dist/llm/prompts.js +1456 -0
- package/dist/llm/types.d.ts +212 -0
- package/dist/llm/types.js +1 -0
- package/dist/markdown.d.ts +16 -0
- package/dist/markdown.js +529 -0
- package/dist/migrations.d.ts +48 -0
- package/dist/migrations.js +67 -0
- package/dist/migrations.test.d.ts +1 -0
- package/dist/model-registry.d.ts +9 -0
- package/dist/model-registry.js +64 -0
- package/dist/model-registry.test.d.ts +1 -0
- package/dist/node/app-config/app-config.capability.js +730 -0
- package/dist/node/app-config/app-config.contracts.js +713 -0
- package/dist/node/app-config/app-config.feature.js +255 -0
- package/dist/node/app-config/branding.js +0 -0
- package/dist/node/app-config/docs/app-config.docblock.js +383 -0
- package/dist/node/app-config/events.js +386 -0
- package/dist/node/app-config/index.js +2899 -0
- package/dist/node/app-config/lifecycle-contracts.js +870 -0
- package/dist/node/app-config/lifecycle.js +0 -0
- package/dist/node/app-config/runtime.js +734 -0
- package/dist/node/app-config/spec.js +229 -0
- package/dist/node/app-config/validation.js +650 -0
- package/dist/node/capabilities/capabilities.js +217 -0
- package/dist/node/capabilities/context.js +101 -0
- package/dist/node/capabilities/docs/capabilities.docblock.js +353 -0
- package/dist/node/capabilities/guards.js +177 -0
- package/dist/node/capabilities/index.js +739 -0
- package/dist/node/capabilities/meeting-recorder.js +154 -0
- package/dist/node/capabilities/openbanking.js +166 -0
- package/dist/node/capabilities/validation.js +185 -0
- package/dist/node/contract-registry/index.js +129 -0
- package/dist/node/contract-registry/schemas.js +129 -0
- package/dist/node/contract-registry/types.js +0 -0
- package/dist/node/data-views/data-views.js +232 -0
- package/dist/node/data-views/docs/data-views.docblock.js +164 -0
- package/dist/node/data-views/index.js +232 -0
- package/dist/node/data-views/query-generator.js +89 -0
- package/dist/node/data-views/registry.js +226 -0
- package/dist/node/data-views/report/contractVerificationTable.js +240 -0
- package/dist/node/data-views/runtime.js +108 -0
- package/dist/node/data-views/spec.js +38 -0
- package/dist/node/data-views/types.js +0 -0
- package/dist/node/docs/accessibility_wcag_compliance_specs.docblock.js +513 -0
- package/dist/node/docs/capabilities/documentationSystem.capability.js +784 -0
- package/dist/node/docs/capabilities/index.js +784 -0
- package/dist/node/docs/commands/docsGenerate.command.js +802 -0
- package/dist/node/docs/commands/docsPublish.command.js +781 -0
- package/dist/node/docs/commands/index.js +906 -0
- package/dist/node/docs/constants.js +78 -0
- package/dist/node/docs/contracts.js +1611 -0
- package/dist/node/docs/ensure-docblocks.js +264 -0
- package/dist/node/docs/events/docsGenerated.event.js +533 -0
- package/dist/node/docs/events/docsPublished.event.js +534 -0
- package/dist/node/docs/events/index.js +567 -0
- package/dist/node/docs/forms/docsSearch.form.js +676 -0
- package/dist/node/docs/forms/index.js +676 -0
- package/dist/node/docs/index.js +4719 -0
- package/dist/node/docs/meta.docs.js +176 -0
- package/dist/node/docs/presentations/docsLayout.presentation.js +527 -0
- package/dist/node/docs/presentations/docsReferencePage.presentation.js +527 -0
- package/dist/node/docs/presentations/index.js +555 -0
- package/dist/node/docs/presentations.js +97 -0
- package/dist/node/docs/queries/contractReference.query.js +752 -0
- package/dist/node/docs/queries/docsIndex.query.js +752 -0
- package/dist/node/docs/queries/index.js +827 -0
- package/dist/node/docs/registry.js +153 -0
- package/dist/node/docs/tech/auth/better-auth-nextjs.docblock.js +221 -0
- package/dist/node/docs/tech/cli.docblock.js +291 -0
- package/dist/node/docs/tech/contracts/README.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/migrations.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/openapi-export.docblock.js +201 -0
- package/dist/node/docs/tech/contracts/openapi-import.docblock.js +207 -0
- package/dist/node/docs/tech/contracts/ops-to-presentation-linking.docblock.js +225 -0
- package/dist/node/docs/tech/contracts/overlays.docblock.js +231 -0
- package/dist/node/docs/tech/contracts/tests.docblock.js +164 -0
- package/dist/node/docs/tech/contracts/themes.docblock.js +257 -0
- package/dist/node/docs/tech/contracts/vertical-pocket-family-office.docblock.js +269 -0
- package/dist/node/docs/tech/docs-system.docblock.js +264 -0
- package/dist/node/docs/tech/lifecycle-stage-system.docblock.js +376 -0
- package/dist/node/docs/tech/llm/llm-integration.docblock.js +482 -0
- package/dist/node/docs/tech/mcp-endpoints.docblock.js +185 -0
- package/dist/node/docs/tech/presentation-runtime.docblock.js +221 -0
- package/dist/node/docs/tech/report-verification-table.docblock.js +191 -0
- package/dist/node/docs/tech/schema/README.docblock.js +164 -0
- package/dist/node/docs/tech/studio/learning-events.docblock.js +190 -0
- package/dist/node/docs/tech/studio/learning-journeys.docblock.js +227 -0
- package/dist/node/docs/tech/studio/platform-admin-panel.docblock.js +226 -0
- package/dist/node/docs/tech/studio/project-access-teams.docblock.js +200 -0
- package/dist/node/docs/tech/studio/project-routing.docblock.js +209 -0
- package/dist/node/docs/tech/studio/sandbox-unlogged.docblock.js +183 -0
- package/dist/node/docs/tech/studio/team-invitations.docblock.js +228 -0
- package/dist/node/docs/tech/studio/workspace-ops.docblock.js +189 -0
- package/dist/node/docs/tech/studio/workspaces.docblock.js +204 -0
- package/dist/node/docs/tech/telemetry-ingest.docblock.js +305 -0
- package/dist/node/docs/tech/vscode-extension.docblock.js +241 -0
- package/dist/node/docs/tech-contracts.docs.js +239 -0
- package/dist/node/docs/types.js +0 -0
- package/dist/node/docs/views/contractReference.dataView.js +838 -0
- package/dist/node/docs/views/docsIndex.dataView.js +832 -0
- package/dist/node/docs/views/exampleCatalog.dataView.js +816 -0
- package/dist/node/docs/views/index.js +1031 -0
- package/dist/node/events.js +228 -0
- package/dist/node/examples/define.js +36 -0
- package/dist/node/examples/docs/examples.docblock.js +307 -0
- package/dist/node/examples/index.js +604 -0
- package/dist/node/examples/registry.js +286 -0
- package/dist/node/examples/schema.js +166 -0
- package/dist/node/examples/types.js +77 -0
- package/dist/node/examples/validation.js +287 -0
- package/dist/node/experiments/docs/experiments.docblock.js +291 -0
- package/dist/node/experiments/evaluator.js +155 -0
- package/dist/node/experiments/spec-resolver.js +0 -0
- package/dist/node/experiments/spec.js +227 -0
- package/dist/node/features/index.js +275 -0
- package/dist/node/features/install.js +95 -0
- package/dist/node/features/registry.js +192 -0
- package/dist/node/features/types.js +36 -0
- package/dist/node/features/validation.js +48 -0
- package/dist/node/forms/docs/forms.docblock.js +164 -0
- package/dist/node/forms/forms.js +332 -0
- package/dist/node/forms/index.js +332 -0
- package/dist/node/index.js +2195 -0
- package/dist/node/install.js +60 -0
- package/dist/node/integrations/binding.js +0 -0
- package/dist/node/integrations/connection.js +0 -0
- package/dist/node/integrations/docs/integrations.docblock.js +140 -0
- package/dist/node/integrations/health.js +103 -0
- package/dist/node/integrations/index.js +3293 -0
- package/dist/node/integrations/integrations.capability.js +48 -0
- package/dist/node/integrations/integrations.feature.js +63 -0
- package/dist/node/integrations/meeting-recorder/contracts/index.js +504 -0
- package/dist/node/integrations/meeting-recorder/contracts/meetings.js +249 -0
- package/dist/node/integrations/meeting-recorder/contracts/transcripts.js +317 -0
- package/dist/node/integrations/meeting-recorder/contracts/webhooks.js +202 -0
- package/dist/node/integrations/meeting-recorder/meeting-recorder.capability.js +48 -0
- package/dist/node/integrations/meeting-recorder/meeting-recorder.feature.js +63 -0
- package/dist/node/integrations/meeting-recorder/models.js +152 -0
- package/dist/node/integrations/meeting-recorder/telemetry.js +84 -0
- package/dist/node/integrations/openbanking/contracts/accounts.js +358 -0
- package/dist/node/integrations/openbanking/contracts/balances.js +322 -0
- package/dist/node/integrations/openbanking/contracts/index.js +674 -0
- package/dist/node/integrations/openbanking/contracts/transactions.js +328 -0
- package/dist/node/integrations/openbanking/guards.js +72 -0
- package/dist/node/integrations/openbanking/models.js +140 -0
- package/dist/node/integrations/openbanking/openbanking.capability.js +48 -0
- package/dist/node/integrations/openbanking/openbanking.feature.js +65 -0
- package/dist/node/integrations/openbanking/telemetry.js +81 -0
- package/dist/node/integrations/operations.js +327 -0
- package/dist/node/integrations/providers/analytics-reader.js +0 -0
- package/dist/node/integrations/providers/analytics-writer.js +0 -0
- package/dist/node/integrations/providers/analytics.js +0 -0
- package/dist/node/integrations/providers/calendar.js +0 -0
- package/dist/node/integrations/providers/database.js +0 -0
- package/dist/node/integrations/providers/elevenlabs.js +116 -0
- package/dist/node/integrations/providers/email.js +0 -0
- package/dist/node/integrations/providers/embedding.js +0 -0
- package/dist/node/integrations/providers/fal.js +142 -0
- package/dist/node/integrations/providers/fathom.js +156 -0
- package/dist/node/integrations/providers/fireflies.js +136 -0
- package/dist/node/integrations/providers/gcs-storage.js +127 -0
- package/dist/node/integrations/providers/gmail.js +139 -0
- package/dist/node/integrations/providers/google-calendar.js +122 -0
- package/dist/node/integrations/providers/gradium.js +140 -0
- package/dist/node/integrations/providers/granola.js +137 -0
- package/dist/node/integrations/providers/index.js +2124 -0
- package/dist/node/integrations/providers/jira.js +138 -0
- package/dist/node/integrations/providers/linear.js +137 -0
- package/dist/node/integrations/providers/llm.js +0 -0
- package/dist/node/integrations/providers/meeting-recorder.js +0 -0
- package/dist/node/integrations/providers/mistral.js +124 -0
- package/dist/node/integrations/providers/notion.js +143 -0
- package/dist/node/integrations/providers/openbanking.js +0 -0
- package/dist/node/integrations/providers/payments.js +0 -0
- package/dist/node/integrations/providers/posthog-llm-telemetry.js +206 -0
- package/dist/node/integrations/providers/posthog.js +136 -0
- package/dist/node/integrations/providers/postmark.js +128 -0
- package/dist/node/integrations/providers/powens.js +154 -0
- package/dist/node/integrations/providers/project-management.js +0 -0
- package/dist/node/integrations/providers/qdrant.js +131 -0
- package/dist/node/integrations/providers/registry.js +1908 -0
- package/dist/node/integrations/providers/sms.js +0 -0
- package/dist/node/integrations/providers/storage.js +0 -0
- package/dist/node/integrations/providers/stripe.js +135 -0
- package/dist/node/integrations/providers/supabase-postgres.js +117 -0
- package/dist/node/integrations/providers/supabase-vector.js +137 -0
- package/dist/node/integrations/providers/tldv.js +136 -0
- package/dist/node/integrations/providers/twilio-sms.js +121 -0
- package/dist/node/integrations/providers/vector-store.js +0 -0
- package/dist/node/integrations/providers/voice.js +0 -0
- package/dist/node/integrations/runtime.js +239 -0
- package/dist/node/integrations/secrets/aws-secret-manager.js +376 -0
- package/dist/node/integrations/secrets/env-secret-provider.js +189 -0
- package/dist/node/integrations/secrets/gcp-secret-manager.js +377 -0
- package/dist/node/integrations/secrets/index.js +1159 -0
- package/dist/node/integrations/secrets/manager.js +213 -0
- package/dist/node/integrations/secrets/provider.js +104 -0
- package/dist/node/integrations/secrets/scaleway-secret-manager.js +405 -0
- package/dist/node/integrations/secrets-types.js +0 -0
- package/dist/node/integrations/spec.js +52 -0
- package/dist/node/jobs/define-job.js +41 -0
- package/dist/node/jobs/gcp-cloud-tasks.js +103 -0
- package/dist/node/jobs/gcp-pubsub.js +91 -0
- package/dist/node/jobs/handlers/gmail-sync-handler.js +40 -0
- package/dist/node/jobs/handlers/index.js +83 -0
- package/dist/node/jobs/handlers/ping-handler.js +47 -0
- package/dist/node/jobs/handlers/storage-document-handler.js +47 -0
- package/dist/node/jobs/index.js +64 -0
- package/dist/node/jobs/memory-queue.js +129 -0
- package/dist/node/jobs/queue.js +55 -0
- package/dist/node/jobs/scaleway-sqs-queue.js +222 -0
- package/dist/node/jsonschema.js +73 -0
- package/dist/node/knowledge/binding.js +0 -0
- package/dist/node/knowledge/docs/knowledge.docblock.js +301 -0
- package/dist/node/knowledge/index.js +467 -0
- package/dist/node/knowledge/ingestion/document-processor.js +95 -0
- package/dist/node/knowledge/ingestion/embedding-service.js +57 -0
- package/dist/node/knowledge/ingestion/gmail-adapter.js +103 -0
- package/dist/node/knowledge/ingestion/index.js +252 -0
- package/dist/node/knowledge/ingestion/storage-adapter.js +62 -0
- package/dist/node/knowledge/ingestion/vector-indexer.js +63 -0
- package/dist/node/knowledge/knowledge.capability.js +726 -0
- package/dist/node/knowledge/knowledge.feature.js +300 -0
- package/dist/node/knowledge/operations.js +619 -0
- package/dist/node/knowledge/query/index.js +110 -0
- package/dist/node/knowledge/query/service.js +110 -0
- package/dist/node/knowledge/runtime.js +91 -0
- package/dist/node/knowledge/source.js +0 -0
- package/dist/node/knowledge/spaces/email-threads.js +102 -0
- package/dist/node/knowledge/spaces/financial-docs.js +102 -0
- package/dist/node/knowledge/spaces/financial-overview.js +102 -0
- package/dist/node/knowledge/spaces/index.js +273 -0
- package/dist/node/knowledge/spaces/product-canon.js +102 -0
- package/dist/node/knowledge/spaces/support-faq.js +103 -0
- package/dist/node/knowledge/spaces/uploaded-docs.js +102 -0
- package/dist/node/knowledge/spec.js +228 -0
- package/dist/node/llm/exporters.js +1011 -0
- package/dist/node/llm/index.js +1465 -0
- package/dist/node/llm/prompts.js +1456 -0
- package/dist/node/llm/types.js +0 -0
- package/dist/node/markdown.js +529 -0
- package/dist/node/migrations.js +67 -0
- package/dist/node/model-registry.js +64 -0
- package/dist/node/onboarding-base.js +597 -0
- package/dist/node/openapi.js +151 -0
- package/dist/node/operations/index.js +408 -0
- package/dist/node/operations/operation.js +51 -0
- package/dist/node/operations/registry.js +405 -0
- package/dist/node/operations/report/getContractVerificationStatus.js +170 -0
- package/dist/node/operations/report/index.js +305 -0
- package/dist/node/ownership.js +73 -0
- package/dist/node/policy/context.js +206 -0
- package/dist/node/policy/docs/policy.docblock.js +313 -0
- package/dist/node/policy/engine.js +325 -0
- package/dist/node/policy/guards.js +387 -0
- package/dist/node/policy/index.js +1313 -0
- package/dist/node/policy/opa-adapter.js +110 -0
- package/dist/node/policy/registry.js +221 -0
- package/dist/node/policy/spec.js +0 -0
- package/dist/node/policy/validation.js +391 -0
- package/dist/node/presentations/docs/presentations-conventions.docblock.js +171 -0
- package/dist/node/presentations/index.js +227 -0
- package/dist/node/presentations/presentations.js +38 -0
- package/dist/node/presentations/registry.js +221 -0
- package/dist/node/presentations/transform-engine.js +600 -0
- package/dist/node/product-intent/contract-patch-intent.js +68 -0
- package/dist/node/product-intent/contract-spec-patch.js +75 -0
- package/dist/node/product-intent/evidence.js +45 -0
- package/dist/node/product-intent/findings.js +81 -0
- package/dist/node/product-intent/impact-report.js +62 -0
- package/dist/node/product-intent/index.js +742 -0
- package/dist/node/product-intent/insights.js +63 -0
- package/dist/node/product-intent/opportunity-brief.js +106 -0
- package/dist/node/product-intent/problems.js +55 -0
- package/dist/node/product-intent/registry.js +242 -0
- package/dist/node/product-intent/runtime.js +320 -0
- package/dist/node/product-intent/spec.js +425 -0
- package/dist/node/product-intent/task-pack.js +69 -0
- package/dist/node/product-intent/tickets.js +57 -0
- package/dist/node/product-intent/types.js +378 -0
- package/dist/node/product-intent/ui-wireframe.js +73 -0
- package/dist/node/prompt.js +38 -0
- package/dist/node/promptRegistry.js +63 -0
- package/dist/node/regenerator/adapters.js +0 -0
- package/dist/node/regenerator/docs/regenerator.docblock.js +164 -0
- package/dist/node/regenerator/executor.js +157 -0
- package/dist/node/regenerator/index.js +341 -0
- package/dist/node/regenerator/service.js +183 -0
- package/dist/node/regenerator/sinks.js +64 -0
- package/dist/node/regenerator/types.js +0 -0
- package/dist/node/regenerator/utils.js +87 -0
- package/dist/node/registry-utils.js +163 -0
- package/dist/node/registry.js +215 -0
- package/dist/node/resources.js +83 -0
- package/dist/node/schema-to-markdown.js +278 -0
- package/dist/node/serialization/index.js +179 -0
- package/dist/node/serialization/serializers.js +180 -0
- package/dist/node/serialization/types.js +0 -0
- package/dist/node/telemetry/anomaly.js +91 -0
- package/dist/node/telemetry/docs/telemetry.docblock.js +164 -0
- package/dist/node/telemetry/index.js +417 -0
- package/dist/node/telemetry/spec.js +261 -0
- package/dist/node/telemetry/tracker.js +129 -0
- package/dist/node/tests/index.js +231 -0
- package/dist/node/tests/runner.js +189 -0
- package/dist/node/tests/spec.js +74 -0
- package/dist/node/themes.js +225 -0
- package/dist/node/translations/catalog.js +0 -0
- package/dist/node/translations/index.js +533 -0
- package/dist/node/translations/registry.js +170 -0
- package/dist/node/translations/spec.js +36 -0
- package/dist/node/translations/tenant.js +0 -0
- package/dist/node/translations/validation.js +392 -0
- package/dist/node/types.js +0 -0
- package/dist/node/versioning/index.js +274 -0
- package/dist/node/versioning/refs.js +99 -0
- package/dist/node/versioning/types.js +55 -0
- package/dist/node/versioning/utils.js +184 -0
- package/dist/node/workflow/adapters/db-adapter.js +127 -0
- package/dist/node/workflow/adapters/file-adapter.js +38 -0
- package/dist/node/workflow/adapters/index.js +194 -0
- package/dist/node/workflow/adapters/memory-store.js +93 -0
- package/dist/node/workflow/context.js +247 -0
- package/dist/node/workflow/expression.js +157 -0
- package/dist/node/workflow/index.js +1546 -0
- package/dist/node/workflow/overview.docblock.js +164 -0
- package/dist/node/workflow/runner.js +532 -0
- package/dist/node/workflow/sla-monitor.js +84 -0
- package/dist/node/workflow/spec.js +221 -0
- package/dist/node/workflow/state.js +0 -0
- package/dist/node/workflow/validation.js +425 -0
- package/dist/node/workspace-config/contractsrc-schema.js +344 -0
- package/dist/node/workspace-config/contractsrc-types.js +0 -0
- package/dist/node/workspace-config/index.js +325 -0
- package/dist/node/workspace-config/workspace-config.docblock.js +188 -0
- package/dist/onboarding-base.d.ts +131 -0
- package/dist/onboarding-base.js +597 -0
- package/dist/openapi.d.ts +33 -0
- package/dist/openapi.js +151 -0
- package/dist/operations/index.d.ts +2 -0
- package/dist/operations/index.js +408 -0
- package/dist/operations/operation.d.ts +191 -0
- package/dist/operations/operation.js +51 -0
- package/dist/operations/registry.d.ts +58 -0
- package/dist/operations/registry.js +405 -0
- package/dist/operations/report/getContractVerificationStatus.d.ts +68 -0
- package/dist/operations/report/getContractVerificationStatus.js +170 -0
- package/dist/operations/report/getContractVerificationStatus.test.d.ts +1 -0
- package/dist/operations/report/index.d.ts +10 -0
- package/dist/operations/report/index.js +305 -0
- package/dist/operations/report/index.test.d.ts +1 -0
- package/dist/ownership.d.ts +211 -0
- package/dist/ownership.js +73 -0
- package/dist/ownership.test.d.ts +1 -0
- package/dist/policy/context.d.ts +234 -0
- package/dist/policy/context.js +206 -0
- package/dist/policy/context.test.d.ts +1 -0
- package/dist/policy/docs/policy.docblock.d.ts +2 -0
- package/dist/policy/docs/policy.docblock.js +313 -0
- package/dist/policy/engine.d.ts +36 -0
- package/dist/policy/engine.js +325 -0
- package/dist/policy/engine.test.d.ts +1 -0
- package/dist/policy/guards.d.ts +156 -0
- package/dist/policy/guards.js +387 -0
- package/dist/policy/guards.test.d.ts +1 -0
- package/dist/policy/index.d.ts +12 -0
- package/dist/policy/index.js +1313 -0
- package/dist/policy/opa-adapter.d.ts +41 -0
- package/dist/policy/opa-adapter.js +110 -0
- package/dist/policy/opa-adapter.test.d.ts +1 -0
- package/dist/policy/registry.d.ts +5 -0
- package/dist/policy/registry.js +221 -0
- package/dist/policy/spec.d.ts +102 -0
- package/dist/policy/spec.js +1 -0
- package/dist/policy/validation.d.ts +84 -0
- package/dist/policy/validation.js +391 -0
- package/dist/policy/validation.test.d.ts +1 -0
- package/dist/presentations/docs/presentations-conventions.docblock.d.ts +2 -0
- package/dist/presentations/docs/presentations-conventions.docblock.js +171 -0
- package/dist/presentations/index.d.ts +2 -0
- package/dist/presentations/index.js +227 -0
- package/dist/presentations/presentations.d.ts +52 -0
- package/dist/presentations/presentations.js +38 -0
- package/dist/presentations/registry.d.ts +6 -0
- package/dist/presentations/registry.js +221 -0
- package/dist/presentations/transform-engine.d.ts +62 -0
- package/dist/presentations/transform-engine.js +600 -0
- package/dist/presentations/transform-engine.test.d.ts +1 -0
- package/dist/product-intent/contract-patch-intent.d.ts +100 -0
- package/dist/product-intent/contract-patch-intent.js +68 -0
- package/dist/product-intent/contract-spec-patch.d.ts +86 -0
- package/dist/product-intent/contract-spec-patch.js +75 -0
- package/dist/product-intent/evidence.d.ts +14 -0
- package/dist/product-intent/evidence.js +45 -0
- package/dist/product-intent/findings.d.ts +57 -0
- package/dist/product-intent/findings.js +81 -0
- package/dist/product-intent/impact-report.d.ts +57 -0
- package/dist/product-intent/impact-report.js +62 -0
- package/dist/product-intent/index.d.ts +13 -0
- package/dist/product-intent/index.js +742 -0
- package/dist/product-intent/insights.d.ts +62 -0
- package/dist/product-intent/insights.js +63 -0
- package/dist/product-intent/opportunity-brief.d.ts +192 -0
- package/dist/product-intent/opportunity-brief.js +106 -0
- package/dist/product-intent/problems.d.ts +59 -0
- package/dist/product-intent/problems.js +55 -0
- package/dist/product-intent/registry.d.ts +28 -0
- package/dist/product-intent/registry.js +242 -0
- package/dist/product-intent/registry.test.d.ts +1 -0
- package/dist/product-intent/runtime.d.ts +92 -0
- package/dist/product-intent/runtime.js +320 -0
- package/dist/product-intent/runtime.test.d.ts +1 -0
- package/dist/product-intent/spec.d.ts +664 -0
- package/dist/product-intent/spec.js +425 -0
- package/dist/product-intent/task-pack.d.ts +98 -0
- package/dist/product-intent/task-pack.js +69 -0
- package/dist/product-intent/tickets.d.ts +67 -0
- package/dist/product-intent/tickets.js +57 -0
- package/dist/product-intent/types.d.ts +11 -0
- package/dist/product-intent/types.js +378 -0
- package/dist/product-intent/ui-wireframe.d.ts +100 -0
- package/dist/product-intent/ui-wireframe.js +73 -0
- package/dist/prompt.d.ts +49 -0
- package/dist/prompt.js +38 -0
- package/dist/prompt.test.d.ts +1 -0
- package/dist/promptRegistry.d.ts +11 -0
- package/dist/promptRegistry.js +63 -0
- package/dist/promptRegistry.test.d.ts +1 -0
- package/dist/regenerator/adapters.d.ts +15 -0
- package/dist/regenerator/adapters.js +1 -0
- package/dist/regenerator/docs/regenerator.docblock.d.ts +2 -0
- package/dist/regenerator/docs/regenerator.docblock.js +164 -0
- package/dist/regenerator/executor.d.ts +66 -0
- package/dist/regenerator/executor.js +157 -0
- package/dist/regenerator/executor.test.d.ts +1 -0
- package/dist/regenerator/index.d.ts +6 -0
- package/dist/regenerator/index.js +341 -0
- package/dist/regenerator/service.d.ts +29 -0
- package/dist/regenerator/service.js +183 -0
- package/dist/regenerator/service.test.d.ts +1 -0
- package/dist/regenerator/sinks.d.ts +23 -0
- package/dist/regenerator/sinks.js +64 -0
- package/dist/regenerator/sinks.test.d.ts +1 -0
- package/dist/regenerator/types.d.ts +103 -0
- package/dist/regenerator/types.js +1 -0
- package/dist/regenerator/utils.d.ts +6 -0
- package/dist/regenerator/utils.js +87 -0
- package/dist/registry-utils.d.ts +105 -0
- package/dist/registry-utils.js +163 -0
- package/dist/registry-utils.test.d.ts +1 -0
- package/dist/registry.d.ts +27 -0
- package/dist/registry.js +215 -0
- package/dist/resources.d.ts +60 -0
- package/dist/resources.js +83 -0
- package/dist/schema-to-markdown.d.ts +56 -0
- package/dist/schema-to-markdown.js +278 -0
- package/dist/serialization/index.d.ts +10 -0
- package/dist/serialization/index.js +179 -0
- package/dist/serialization/serializers.d.ts +35 -0
- package/dist/serialization/serializers.js +180 -0
- package/dist/serialization/types.d.ts +100 -0
- package/dist/serialization/types.js +1 -0
- package/dist/telemetry/anomaly.d.ts +23 -0
- package/dist/telemetry/anomaly.js +91 -0
- package/dist/telemetry/anomaly.test.d.ts +1 -0
- package/dist/telemetry/docs/telemetry.docblock.d.ts +2 -0
- package/dist/telemetry/docs/telemetry.docblock.js +164 -0
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.js +417 -0
- package/dist/telemetry/spec.d.ts +87 -0
- package/dist/telemetry/spec.js +261 -0
- package/dist/telemetry/spec.test.d.ts +1 -0
- package/dist/telemetry/tracker.d.ts +48 -0
- package/dist/telemetry/tracker.js +129 -0
- package/dist/telemetry/tracker.test.d.ts +1 -0
- package/dist/tests/index.d.ts +2 -0
- package/dist/tests/index.js +231 -0
- package/dist/tests/runner.d.ts +38 -0
- package/dist/tests/runner.js +189 -0
- package/dist/tests/runner.test.d.ts +1 -0
- package/dist/tests/spec.d.ts +82 -0
- package/dist/tests/spec.js +74 -0
- package/dist/tests/spec.test.d.ts +1 -0
- package/dist/themes.d.ts +50 -0
- package/dist/themes.js +225 -0
- package/dist/themes.test.d.ts +1 -0
- package/dist/translations/catalog.d.ts +25 -0
- package/dist/translations/catalog.js +1 -0
- package/dist/translations/index.d.ts +44 -0
- package/dist/translations/index.js +533 -0
- package/dist/translations/registry.d.ts +172 -0
- package/dist/translations/registry.js +170 -0
- package/dist/translations/registry.test.d.ts +1 -0
- package/dist/translations/spec.d.ts +153 -0
- package/dist/translations/spec.js +36 -0
- package/dist/translations/spec.test.d.ts +1 -0
- package/dist/translations/tenant.d.ts +11 -0
- package/dist/translations/tenant.js +1 -0
- package/dist/translations/validation.d.ts +106 -0
- package/dist/translations/validation.js +392 -0
- package/dist/translations/validation.test.d.ts +1 -0
- package/dist/types.d.ts +212 -0
- package/dist/types.js +1 -0
- package/dist/versioning/index.d.ts +9 -0
- package/dist/versioning/index.js +274 -0
- package/dist/versioning/refs.d.ts +176 -0
- package/dist/versioning/refs.js +99 -0
- package/dist/versioning/refs.test.d.ts +4 -0
- package/dist/versioning/types.d.ts +130 -0
- package/dist/versioning/types.js +55 -0
- package/dist/versioning/utils.d.ts +93 -0
- package/dist/versioning/utils.js +184 -0
- package/dist/versioning/utils.test.d.ts +4 -0
- package/dist/workflow/adapters/db-adapter.d.ts +43 -0
- package/dist/workflow/adapters/db-adapter.js +127 -0
- package/dist/workflow/adapters/file-adapter.d.ts +10 -0
- package/dist/workflow/adapters/file-adapter.js +38 -0
- package/dist/workflow/adapters/index.d.ts +3 -0
- package/dist/workflow/adapters/index.js +194 -0
- package/dist/workflow/adapters/memory-store.d.ts +13 -0
- package/dist/workflow/adapters/memory-store.js +93 -0
- package/dist/workflow/context.d.ts +217 -0
- package/dist/workflow/context.js +247 -0
- package/dist/workflow/context.test.d.ts +1 -0
- package/dist/workflow/expression.d.ts +6 -0
- package/dist/workflow/expression.js +157 -0
- package/dist/workflow/expression.test.d.ts +1 -0
- package/dist/workflow/index.d.ts +13 -0
- package/dist/workflow/index.js +1546 -0
- package/dist/workflow/overview.docblock.d.ts +2 -0
- package/dist/workflow/overview.docblock.js +164 -0
- package/dist/workflow/runner.d.ts +71 -0
- package/dist/workflow/runner.js +532 -0
- package/dist/workflow/runner.test.d.ts +1 -0
- package/dist/workflow/sla-monitor.d.ts +16 -0
- package/dist/workflow/sla-monitor.js +84 -0
- package/dist/workflow/spec.d.ts +81 -0
- package/dist/workflow/spec.js +221 -0
- package/dist/workflow/state.d.ts +31 -0
- package/dist/workflow/state.js +1 -0
- package/dist/workflow/validation.d.ts +87 -0
- package/dist/workflow/validation.js +425 -0
- package/dist/workflow/validation.test.d.ts +1 -0
- package/dist/workspace-config/contractsrc-schema.d.ts +144 -0
- package/dist/workspace-config/contractsrc-schema.js +344 -0
- package/dist/workspace-config/contractsrc-schema.test.d.ts +1 -0
- package/dist/workspace-config/contractsrc-types.d.ts +342 -0
- package/dist/workspace-config/contractsrc-types.js +1 -0
- package/dist/workspace-config/index.d.ts +5 -0
- package/dist/workspace-config/index.js +325 -0
- package/dist/workspace-config/workspace-config.docblock.d.ts +2 -0
- package/dist/workspace-config/workspace-config.docblock.js +188 -0
- package/package.json +4426 -0
|
@@ -0,0 +1,1159 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
7
|
+
var __toCommonJS = (from) => {
|
|
8
|
+
var entry = __moduleCache.get(from), desc;
|
|
9
|
+
if (entry)
|
|
10
|
+
return entry;
|
|
11
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
13
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
}));
|
|
17
|
+
__moduleCache.set(from, entry);
|
|
18
|
+
return entry;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, {
|
|
23
|
+
get: all[name],
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
set: (newValue) => all[name] = () => newValue
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
|
+
var __require = import.meta.require;
|
|
31
|
+
|
|
32
|
+
// src/integrations/secrets/provider.ts
|
|
33
|
+
import { Buffer as Buffer2 } from "buffer";
|
|
34
|
+
|
|
35
|
+
class SecretProviderError extends Error {
|
|
36
|
+
provider;
|
|
37
|
+
reference;
|
|
38
|
+
code;
|
|
39
|
+
cause;
|
|
40
|
+
constructor(params) {
|
|
41
|
+
super(params.message);
|
|
42
|
+
this.name = "SecretProviderError";
|
|
43
|
+
this.provider = params.provider;
|
|
44
|
+
this.reference = params.reference;
|
|
45
|
+
this.code = params.code ?? "UNKNOWN";
|
|
46
|
+
this.cause = params.cause;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function parseSecretUri(reference) {
|
|
50
|
+
if (!reference) {
|
|
51
|
+
throw new SecretProviderError({
|
|
52
|
+
message: "Secret reference cannot be empty",
|
|
53
|
+
provider: "unknown",
|
|
54
|
+
reference,
|
|
55
|
+
code: "INVALID"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const [scheme, rest] = reference.split("://");
|
|
59
|
+
if (!scheme || !rest) {
|
|
60
|
+
throw new SecretProviderError({
|
|
61
|
+
message: `Invalid secret reference: ${reference}`,
|
|
62
|
+
provider: "unknown",
|
|
63
|
+
reference,
|
|
64
|
+
code: "INVALID"
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const queryIndex = rest.indexOf("?");
|
|
68
|
+
if (queryIndex === -1) {
|
|
69
|
+
return {
|
|
70
|
+
provider: scheme,
|
|
71
|
+
path: rest
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const path = rest.slice(0, queryIndex);
|
|
75
|
+
const query = rest.slice(queryIndex + 1);
|
|
76
|
+
const extras = Object.fromEntries(query.split("&").filter(Boolean).map((pair) => {
|
|
77
|
+
const [keyRaw, valueRaw] = pair.split("=");
|
|
78
|
+
const key = keyRaw ?? "";
|
|
79
|
+
const value = valueRaw ?? "";
|
|
80
|
+
return [decodeURIComponent(key), decodeURIComponent(value)];
|
|
81
|
+
}));
|
|
82
|
+
return {
|
|
83
|
+
provider: scheme,
|
|
84
|
+
path,
|
|
85
|
+
extras
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function normalizeSecretPayload(payload) {
|
|
89
|
+
if (payload.data instanceof Uint8Array) {
|
|
90
|
+
return payload.data;
|
|
91
|
+
}
|
|
92
|
+
if (payload.encoding === "base64") {
|
|
93
|
+
return Buffer2.from(payload.data, "base64");
|
|
94
|
+
}
|
|
95
|
+
if (payload.encoding === "binary") {
|
|
96
|
+
return Buffer2.from(payload.data, "binary");
|
|
97
|
+
}
|
|
98
|
+
return Buffer2.from(payload.data, "utf-8");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/integrations/secrets/aws-secret-manager.ts
|
|
102
|
+
import { Buffer as Buffer3 } from "buffer";
|
|
103
|
+
import {
|
|
104
|
+
CreateSecretCommand,
|
|
105
|
+
DeleteSecretCommand,
|
|
106
|
+
GetSecretValueCommand,
|
|
107
|
+
PutSecretValueCommand,
|
|
108
|
+
SecretsManagerClient
|
|
109
|
+
} from "@aws-sdk/client-secrets-manager";
|
|
110
|
+
var DEFAULT_DELETE_RECOVERY_DAYS = 7;
|
|
111
|
+
|
|
112
|
+
class AwsSecretsManagerProvider {
|
|
113
|
+
id = "aws-secrets-manager";
|
|
114
|
+
explicitRegion;
|
|
115
|
+
injectedClient;
|
|
116
|
+
clientConfig;
|
|
117
|
+
clientsByRegion = new Map;
|
|
118
|
+
constructor(options = {}) {
|
|
119
|
+
this.explicitRegion = options.region;
|
|
120
|
+
this.injectedClient = options.client;
|
|
121
|
+
this.clientConfig = options.clientConfig;
|
|
122
|
+
}
|
|
123
|
+
canHandle(reference) {
|
|
124
|
+
try {
|
|
125
|
+
const parsed = parseSecretUri(reference);
|
|
126
|
+
return parsed.provider === "aws" && (parsed.path === "secretsmanager" || parsed.path.startsWith("secretsmanager/"));
|
|
127
|
+
} catch {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async getSecret(reference, options) {
|
|
132
|
+
const location = this.parseReference(reference);
|
|
133
|
+
const client = this.getClient(location.region);
|
|
134
|
+
const requestedVersion = options?.version ?? location.stage ?? location.version;
|
|
135
|
+
const input = {
|
|
136
|
+
SecretId: location.secretId,
|
|
137
|
+
...this.buildVersionSelector(requestedVersion)
|
|
138
|
+
};
|
|
139
|
+
try {
|
|
140
|
+
const result = await client.send(new GetSecretValueCommand(input));
|
|
141
|
+
const data = extractAwsSecretBytes(result, reference, this.id);
|
|
142
|
+
return {
|
|
143
|
+
data,
|
|
144
|
+
version: typeof result.VersionId === "string" && result.VersionId ? result.VersionId : requestedVersion,
|
|
145
|
+
metadata: {
|
|
146
|
+
region: location.region,
|
|
147
|
+
secretId: location.secretId,
|
|
148
|
+
...requestedVersion ? { requestedVersion } : {}
|
|
149
|
+
},
|
|
150
|
+
retrievedAt: new Date
|
|
151
|
+
};
|
|
152
|
+
} catch (error) {
|
|
153
|
+
throw toAwsSecretProviderError({
|
|
154
|
+
error,
|
|
155
|
+
provider: this.id,
|
|
156
|
+
reference,
|
|
157
|
+
operation: "getSecret"
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
async setSecret(reference, payload) {
|
|
162
|
+
const location = this.parseReference(reference);
|
|
163
|
+
const client = this.getClient(location.region);
|
|
164
|
+
const bytes = normalizeSecretPayload(payload);
|
|
165
|
+
try {
|
|
166
|
+
const result = await client.send(new PutSecretValueCommand({
|
|
167
|
+
SecretId: location.secretId,
|
|
168
|
+
SecretBinary: bytes
|
|
169
|
+
}));
|
|
170
|
+
const versionId = typeof result.VersionId === "string" && result.VersionId ? result.VersionId : "latest";
|
|
171
|
+
return {
|
|
172
|
+
reference: this.buildReference(location.region, location.secretId, {
|
|
173
|
+
version: versionId
|
|
174
|
+
}),
|
|
175
|
+
version: versionId
|
|
176
|
+
};
|
|
177
|
+
} catch (error) {
|
|
178
|
+
if (!isAwsNotFound(error)) {
|
|
179
|
+
throw toAwsSecretProviderError({
|
|
180
|
+
error,
|
|
181
|
+
provider: this.id,
|
|
182
|
+
reference,
|
|
183
|
+
operation: "putSecretValue"
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (looksLikeAwsArn(location.secretId)) {
|
|
187
|
+
throw new SecretProviderError({
|
|
188
|
+
message: `Secret not found: ${location.secretId}`,
|
|
189
|
+
provider: this.id,
|
|
190
|
+
reference,
|
|
191
|
+
code: "NOT_FOUND",
|
|
192
|
+
cause: error
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
const created = await client.send(new CreateSecretCommand({
|
|
197
|
+
Name: location.secretId,
|
|
198
|
+
SecretBinary: bytes
|
|
199
|
+
}));
|
|
200
|
+
const versionId = typeof created.VersionId === "string" && created.VersionId ? created.VersionId : "latest";
|
|
201
|
+
return {
|
|
202
|
+
reference: this.buildReference(location.region, location.secretId, {
|
|
203
|
+
version: versionId
|
|
204
|
+
}),
|
|
205
|
+
version: versionId
|
|
206
|
+
};
|
|
207
|
+
} catch (creationError) {
|
|
208
|
+
throw toAwsSecretProviderError({
|
|
209
|
+
error: creationError,
|
|
210
|
+
provider: this.id,
|
|
211
|
+
reference,
|
|
212
|
+
operation: "createSecret"
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async rotateSecret(reference, payload) {
|
|
218
|
+
return this.setSecret(reference, payload);
|
|
219
|
+
}
|
|
220
|
+
async deleteSecret(reference) {
|
|
221
|
+
const location = this.parseReference(reference);
|
|
222
|
+
const client = this.getClient(location.region);
|
|
223
|
+
try {
|
|
224
|
+
await client.send(new DeleteSecretCommand({
|
|
225
|
+
SecretId: location.secretId,
|
|
226
|
+
RecoveryWindowInDays: DEFAULT_DELETE_RECOVERY_DAYS
|
|
227
|
+
}));
|
|
228
|
+
} catch (error) {
|
|
229
|
+
throw toAwsSecretProviderError({
|
|
230
|
+
error,
|
|
231
|
+
provider: this.id,
|
|
232
|
+
reference,
|
|
233
|
+
operation: "deleteSecret"
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
getClient(region) {
|
|
238
|
+
if (this.injectedClient) {
|
|
239
|
+
return this.injectedClient;
|
|
240
|
+
}
|
|
241
|
+
const cached = this.clientsByRegion.get(region);
|
|
242
|
+
if (cached) {
|
|
243
|
+
return cached;
|
|
244
|
+
}
|
|
245
|
+
const client = new SecretsManagerClient({
|
|
246
|
+
...this.clientConfig ?? {},
|
|
247
|
+
region
|
|
248
|
+
});
|
|
249
|
+
this.clientsByRegion.set(region, client);
|
|
250
|
+
return client;
|
|
251
|
+
}
|
|
252
|
+
parseReference(reference) {
|
|
253
|
+
const parsed = parseSecretUri(reference);
|
|
254
|
+
if (parsed.provider !== "aws") {
|
|
255
|
+
throw new SecretProviderError({
|
|
256
|
+
message: `Unsupported secret provider: ${parsed.provider}`,
|
|
257
|
+
provider: this.id,
|
|
258
|
+
reference,
|
|
259
|
+
code: "INVALID"
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
const segments = parsed.path.split("/").filter(Boolean);
|
|
263
|
+
if (segments.length < 3 || segments[0] !== "secretsmanager") {
|
|
264
|
+
throw new SecretProviderError({
|
|
265
|
+
message: "Expected secret reference format aws://secretsmanager/{region}/{secretIdOrArn}[?version=...]",
|
|
266
|
+
provider: this.id,
|
|
267
|
+
reference,
|
|
268
|
+
code: "INVALID"
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
const regionCandidate = segments[1];
|
|
272
|
+
const region = this.resolveRegion(regionCandidate);
|
|
273
|
+
const secretId = segments.slice(2).join("/");
|
|
274
|
+
if (!secretId) {
|
|
275
|
+
throw new SecretProviderError({
|
|
276
|
+
message: `Unable to resolve secret id from reference "${parsed.path}"`,
|
|
277
|
+
provider: this.id,
|
|
278
|
+
reference,
|
|
279
|
+
code: "INVALID"
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
region,
|
|
284
|
+
secretId,
|
|
285
|
+
version: parsed.extras?.version,
|
|
286
|
+
stage: parsed.extras?.stage
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
resolveRegion(regionCandidate) {
|
|
290
|
+
const region = regionCandidate ?? this.explicitRegion ?? process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION;
|
|
291
|
+
if (!region) {
|
|
292
|
+
throw new SecretProviderError({
|
|
293
|
+
message: "AWS region must be provided either in reference (aws://secretsmanager/{region}/...) or via AWS_REGION/AWS_DEFAULT_REGION.",
|
|
294
|
+
provider: this.id,
|
|
295
|
+
reference: "aws://secretsmanager//",
|
|
296
|
+
code: "INVALID"
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return region;
|
|
300
|
+
}
|
|
301
|
+
buildVersionSelector(version) {
|
|
302
|
+
if (!version)
|
|
303
|
+
return {};
|
|
304
|
+
if (version === "latest" || version === "current") {
|
|
305
|
+
return { VersionStage: "AWSCURRENT" };
|
|
306
|
+
}
|
|
307
|
+
if (version.startsWith("AWS")) {
|
|
308
|
+
return { VersionStage: version };
|
|
309
|
+
}
|
|
310
|
+
return { VersionId: version };
|
|
311
|
+
}
|
|
312
|
+
buildReference(region, secretId, extras) {
|
|
313
|
+
const base = `aws://secretsmanager/${region}/${secretId}`;
|
|
314
|
+
const query = extras ? Object.entries(extras).filter(([, value]) => Boolean(value)).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&") : "";
|
|
315
|
+
return query ? `${base}?${query}` : base;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
function extractAwsSecretBytes(result, reference, provider) {
|
|
319
|
+
if (!result || typeof result !== "object") {
|
|
320
|
+
throw new SecretProviderError({
|
|
321
|
+
message: "Invalid AWS Secrets Manager response",
|
|
322
|
+
provider,
|
|
323
|
+
reference,
|
|
324
|
+
code: "UNKNOWN",
|
|
325
|
+
cause: result
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
const record = result;
|
|
329
|
+
if (record.SecretBinary instanceof Uint8Array) {
|
|
330
|
+
return record.SecretBinary;
|
|
331
|
+
}
|
|
332
|
+
if (typeof record.SecretBinary === "string") {
|
|
333
|
+
return Buffer3.from(record.SecretBinary, "base64");
|
|
334
|
+
}
|
|
335
|
+
if (typeof record.SecretString === "string") {
|
|
336
|
+
return Buffer3.from(record.SecretString, "utf-8");
|
|
337
|
+
}
|
|
338
|
+
throw new SecretProviderError({
|
|
339
|
+
message: "AWS secret value is empty",
|
|
340
|
+
provider,
|
|
341
|
+
reference,
|
|
342
|
+
code: "NOT_FOUND",
|
|
343
|
+
cause: result
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function looksLikeAwsArn(secretId) {
|
|
347
|
+
return secretId.startsWith("arn:aws:secretsmanager:");
|
|
348
|
+
}
|
|
349
|
+
function isAwsNotFound(error) {
|
|
350
|
+
if (!error || typeof error !== "object")
|
|
351
|
+
return false;
|
|
352
|
+
const err = error;
|
|
353
|
+
if (typeof err.$metadata?.httpStatusCode === "number") {
|
|
354
|
+
return err.$metadata.httpStatusCode === 404;
|
|
355
|
+
}
|
|
356
|
+
return err.name === "ResourceNotFoundException";
|
|
357
|
+
}
|
|
358
|
+
function toAwsSecretProviderError(params) {
|
|
359
|
+
const { error, provider, reference, operation } = params;
|
|
360
|
+
if (error instanceof SecretProviderError) {
|
|
361
|
+
return error;
|
|
362
|
+
}
|
|
363
|
+
const httpStatusCode = typeof error === "object" && error !== null && "$metadata" in error && typeof error.$metadata === "object" && error.$metadata?.httpStatusCode;
|
|
364
|
+
const code = httpStatusCode === 404 ? "NOT_FOUND" : httpStatusCode === 401 || httpStatusCode === 403 ? "FORBIDDEN" : httpStatusCode === 400 ? "INVALID" : "UNKNOWN";
|
|
365
|
+
const message = error instanceof Error ? error.message : `Unknown error during ${operation}`;
|
|
366
|
+
return new SecretProviderError({
|
|
367
|
+
message,
|
|
368
|
+
provider,
|
|
369
|
+
reference,
|
|
370
|
+
code,
|
|
371
|
+
cause: error
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// src/integrations/secrets/env-secret-provider.ts
|
|
376
|
+
class EnvSecretProvider {
|
|
377
|
+
id = "env";
|
|
378
|
+
aliases;
|
|
379
|
+
constructor(options = {}) {
|
|
380
|
+
this.aliases = options.aliases ?? {};
|
|
381
|
+
}
|
|
382
|
+
canHandle(reference) {
|
|
383
|
+
const envKey = this.resolveEnvKey(reference);
|
|
384
|
+
return envKey !== undefined && process.env[envKey] !== undefined;
|
|
385
|
+
}
|
|
386
|
+
async getSecret(reference) {
|
|
387
|
+
const envKey = this.resolveEnvKey(reference);
|
|
388
|
+
if (!envKey) {
|
|
389
|
+
throw new SecretProviderError({
|
|
390
|
+
message: `Unable to resolve environment variable for reference "${reference}".`,
|
|
391
|
+
provider: this.id,
|
|
392
|
+
reference,
|
|
393
|
+
code: "INVALID"
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
const value = process.env[envKey];
|
|
397
|
+
if (value === undefined) {
|
|
398
|
+
throw new SecretProviderError({
|
|
399
|
+
message: `Environment variable "${envKey}" not found for reference "${reference}".`,
|
|
400
|
+
provider: this.id,
|
|
401
|
+
reference,
|
|
402
|
+
code: "NOT_FOUND"
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
return {
|
|
406
|
+
data: Buffer.from(value, "utf-8"),
|
|
407
|
+
version: "current",
|
|
408
|
+
metadata: {
|
|
409
|
+
source: "env",
|
|
410
|
+
envKey
|
|
411
|
+
},
|
|
412
|
+
retrievedAt: new Date
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
async setSecret(reference, _payload) {
|
|
416
|
+
throw this.forbiddenError("setSecret", reference);
|
|
417
|
+
}
|
|
418
|
+
async rotateSecret(reference, _payload) {
|
|
419
|
+
throw this.forbiddenError("rotateSecret", reference);
|
|
420
|
+
}
|
|
421
|
+
async deleteSecret(reference) {
|
|
422
|
+
throw this.forbiddenError("deleteSecret", reference);
|
|
423
|
+
}
|
|
424
|
+
resolveEnvKey(reference) {
|
|
425
|
+
if (!reference) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
if (this.aliases[reference]) {
|
|
429
|
+
return this.aliases[reference];
|
|
430
|
+
}
|
|
431
|
+
if (!reference.includes("://")) {
|
|
432
|
+
return reference;
|
|
433
|
+
}
|
|
434
|
+
try {
|
|
435
|
+
const parsed = parseSecretUri(reference);
|
|
436
|
+
if (parsed.provider === "env") {
|
|
437
|
+
return parsed.path;
|
|
438
|
+
}
|
|
439
|
+
if (parsed.extras?.env) {
|
|
440
|
+
return parsed.extras.env;
|
|
441
|
+
}
|
|
442
|
+
return this.deriveEnvKey(parsed.path);
|
|
443
|
+
} catch {
|
|
444
|
+
return reference;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
deriveEnvKey(path) {
|
|
448
|
+
if (!path)
|
|
449
|
+
return;
|
|
450
|
+
return path.split(/[\/:\-\.]/).filter(Boolean).map((segment) => segment.replace(/[^a-zA-Z0-9]/g, "_").replace(/_{2,}/g, "_").toUpperCase()).join("_");
|
|
451
|
+
}
|
|
452
|
+
forbiddenError(operation, reference) {
|
|
453
|
+
return new SecretProviderError({
|
|
454
|
+
message: `EnvSecretProvider is read-only. "${operation}" is not allowed for ${reference}.`,
|
|
455
|
+
provider: this.id,
|
|
456
|
+
reference,
|
|
457
|
+
code: "FORBIDDEN"
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// src/integrations/secrets/gcp-secret-manager.ts
|
|
463
|
+
import {
|
|
464
|
+
SecretManagerServiceClient
|
|
465
|
+
} from "@google-cloud/secret-manager";
|
|
466
|
+
var DEFAULT_REPLICATION = {
|
|
467
|
+
automatic: {}
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
class GcpSecretManagerProvider {
|
|
471
|
+
id = "gcp-secret-manager";
|
|
472
|
+
client;
|
|
473
|
+
explicitProjectId;
|
|
474
|
+
replication;
|
|
475
|
+
constructor(options = {}) {
|
|
476
|
+
this.client = options.client ?? new SecretManagerServiceClient(options.clientOptions ?? {});
|
|
477
|
+
this.explicitProjectId = options.projectId;
|
|
478
|
+
this.replication = options.defaultReplication ?? DEFAULT_REPLICATION;
|
|
479
|
+
}
|
|
480
|
+
canHandle(reference) {
|
|
481
|
+
try {
|
|
482
|
+
const parsed = parseSecretUri(reference);
|
|
483
|
+
return parsed.provider === "gcp";
|
|
484
|
+
} catch {
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
async getSecret(reference, options, callOptions) {
|
|
489
|
+
const location = this.parseReference(reference);
|
|
490
|
+
const secretVersionName = this.buildVersionName(location, options?.version);
|
|
491
|
+
try {
|
|
492
|
+
const response = await this.client.accessSecretVersion({
|
|
493
|
+
name: secretVersionName
|
|
494
|
+
}, callOptions ?? {});
|
|
495
|
+
const [result] = response;
|
|
496
|
+
const payload = result.payload;
|
|
497
|
+
if (!payload?.data) {
|
|
498
|
+
throw new SecretProviderError({
|
|
499
|
+
message: `Secret payload empty for ${secretVersionName}`,
|
|
500
|
+
provider: this.id,
|
|
501
|
+
reference,
|
|
502
|
+
code: "UNKNOWN"
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
const version = extractVersionFromName(result.name ?? secretVersionName);
|
|
506
|
+
return {
|
|
507
|
+
data: payload.data,
|
|
508
|
+
version,
|
|
509
|
+
metadata: payload.dataCrc32c ? { crc32c: payload.dataCrc32c.toString() } : undefined,
|
|
510
|
+
retrievedAt: new Date
|
|
511
|
+
};
|
|
512
|
+
} catch (error) {
|
|
513
|
+
throw toSecretProviderError({
|
|
514
|
+
error,
|
|
515
|
+
provider: this.id,
|
|
516
|
+
reference,
|
|
517
|
+
operation: "access"
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
async setSecret(reference, payload) {
|
|
522
|
+
const location = this.parseReference(reference);
|
|
523
|
+
const { secretName } = this.buildNames(location);
|
|
524
|
+
const data = normalizeSecretPayload(payload);
|
|
525
|
+
await this.ensureSecretExists(location, payload);
|
|
526
|
+
try {
|
|
527
|
+
const response = await this.client.addSecretVersion({
|
|
528
|
+
parent: secretName,
|
|
529
|
+
payload: {
|
|
530
|
+
data
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
if (!response) {
|
|
534
|
+
throw new SecretProviderError({
|
|
535
|
+
message: `No version returned when adding secret version for ${secretName}`,
|
|
536
|
+
provider: this.id,
|
|
537
|
+
reference,
|
|
538
|
+
code: "UNKNOWN"
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
const [version] = response;
|
|
542
|
+
const versionName = version?.name ?? `${secretName}/versions/latest`;
|
|
543
|
+
return {
|
|
544
|
+
reference: `gcp://${versionName}`,
|
|
545
|
+
version: extractVersionFromName(versionName) ?? "latest"
|
|
546
|
+
};
|
|
547
|
+
} catch (error) {
|
|
548
|
+
throw toSecretProviderError({
|
|
549
|
+
error,
|
|
550
|
+
provider: this.id,
|
|
551
|
+
reference,
|
|
552
|
+
operation: "addSecretVersion"
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
async rotateSecret(reference, payload) {
|
|
557
|
+
return this.setSecret(reference, payload);
|
|
558
|
+
}
|
|
559
|
+
async deleteSecret(reference) {
|
|
560
|
+
const location = this.parseReference(reference);
|
|
561
|
+
const { secretName } = this.buildNames(location);
|
|
562
|
+
try {
|
|
563
|
+
await this.client.deleteSecret({
|
|
564
|
+
name: secretName
|
|
565
|
+
});
|
|
566
|
+
} catch (error) {
|
|
567
|
+
throw toSecretProviderError({
|
|
568
|
+
error,
|
|
569
|
+
provider: this.id,
|
|
570
|
+
reference,
|
|
571
|
+
operation: "delete"
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
parseReference(reference) {
|
|
576
|
+
const parsed = parseSecretUri(reference);
|
|
577
|
+
if (parsed.provider !== "gcp") {
|
|
578
|
+
throw new SecretProviderError({
|
|
579
|
+
message: `Unsupported secret provider: ${parsed.provider}`,
|
|
580
|
+
provider: this.id,
|
|
581
|
+
reference,
|
|
582
|
+
code: "INVALID"
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
const segments = parsed.path.split("/").filter(Boolean);
|
|
586
|
+
if (segments.length < 4 || segments[0] !== "projects") {
|
|
587
|
+
throw new SecretProviderError({
|
|
588
|
+
message: `Expected secret reference format gcp://projects/{project}/secrets/{secret}[(/versions/{version})] but received "${parsed.path}"`,
|
|
589
|
+
provider: this.id,
|
|
590
|
+
reference,
|
|
591
|
+
code: "INVALID"
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
const projectIdCandidate = segments[1] ?? this.explicitProjectId;
|
|
595
|
+
if (!projectIdCandidate) {
|
|
596
|
+
throw new SecretProviderError({
|
|
597
|
+
message: `Unable to resolve project or secret from reference "${parsed.path}"`,
|
|
598
|
+
provider: this.id,
|
|
599
|
+
reference,
|
|
600
|
+
code: "INVALID"
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
const indexOfSecrets = segments.indexOf("secrets");
|
|
604
|
+
if (indexOfSecrets === -1 || indexOfSecrets + 1 >= segments.length) {
|
|
605
|
+
throw new SecretProviderError({
|
|
606
|
+
message: `Unable to resolve project or secret from reference "${parsed.path}"`,
|
|
607
|
+
provider: this.id,
|
|
608
|
+
reference,
|
|
609
|
+
code: "INVALID"
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
const resolvedProjectId = projectIdCandidate;
|
|
613
|
+
const secretIdCandidate = segments[indexOfSecrets + 1];
|
|
614
|
+
if (!secretIdCandidate) {
|
|
615
|
+
throw new SecretProviderError({
|
|
616
|
+
message: `Unable to resolve secret ID from reference "${parsed.path}"`,
|
|
617
|
+
provider: this.id,
|
|
618
|
+
reference,
|
|
619
|
+
code: "INVALID"
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
const secretId = secretIdCandidate;
|
|
623
|
+
const indexOfVersions = segments.indexOf("versions");
|
|
624
|
+
const version = parsed.extras?.version ?? (indexOfVersions !== -1 && indexOfVersions + 1 < segments.length ? segments[indexOfVersions + 1] : undefined);
|
|
625
|
+
return {
|
|
626
|
+
projectId: resolvedProjectId,
|
|
627
|
+
secretId,
|
|
628
|
+
version
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
buildNames(location) {
|
|
632
|
+
const projectId = location.projectId ?? this.explicitProjectId;
|
|
633
|
+
if (!projectId) {
|
|
634
|
+
throw new SecretProviderError({
|
|
635
|
+
message: "Project ID must be provided either in reference or provider configuration",
|
|
636
|
+
provider: this.id,
|
|
637
|
+
reference: `gcp://projects//secrets/${location.secretId}`,
|
|
638
|
+
code: "INVALID"
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
const projectParent = `projects/${projectId}`;
|
|
642
|
+
const secretName = `${projectParent}/secrets/${location.secretId}`;
|
|
643
|
+
return {
|
|
644
|
+
projectParent,
|
|
645
|
+
secretName
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
buildVersionName(location, explicitVersion) {
|
|
649
|
+
const { secretName } = this.buildNames(location);
|
|
650
|
+
const version = explicitVersion ?? location.version ?? "latest";
|
|
651
|
+
return `${secretName}/versions/${version}`;
|
|
652
|
+
}
|
|
653
|
+
async ensureSecretExists(location, payload) {
|
|
654
|
+
const { secretName, projectParent } = this.buildNames(location);
|
|
655
|
+
try {
|
|
656
|
+
await this.client.getSecret({ name: secretName });
|
|
657
|
+
} catch (error) {
|
|
658
|
+
const providerError = toSecretProviderError({
|
|
659
|
+
error,
|
|
660
|
+
provider: this.id,
|
|
661
|
+
reference: `gcp://${secretName}`,
|
|
662
|
+
operation: "getSecret",
|
|
663
|
+
suppressThrow: true
|
|
664
|
+
});
|
|
665
|
+
if (!providerError || providerError.code !== "NOT_FOUND") {
|
|
666
|
+
if (providerError) {
|
|
667
|
+
throw providerError;
|
|
668
|
+
}
|
|
669
|
+
throw error;
|
|
670
|
+
}
|
|
671
|
+
try {
|
|
672
|
+
await this.client.createSecret({
|
|
673
|
+
parent: projectParent,
|
|
674
|
+
secretId: location.secretId,
|
|
675
|
+
secret: {
|
|
676
|
+
replication: this.replication,
|
|
677
|
+
labels: payload.labels
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
} catch (creationError) {
|
|
681
|
+
const creationProviderError = toSecretProviderError({
|
|
682
|
+
error: creationError,
|
|
683
|
+
provider: this.id,
|
|
684
|
+
reference: `gcp://${secretName}`,
|
|
685
|
+
operation: "createSecret"
|
|
686
|
+
});
|
|
687
|
+
throw creationProviderError;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
function extractVersionFromName(name) {
|
|
693
|
+
const segments = name.split("/").filter(Boolean);
|
|
694
|
+
const index = segments.indexOf("versions");
|
|
695
|
+
if (index === -1 || index + 1 >= segments.length) {
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
return segments[index + 1];
|
|
699
|
+
}
|
|
700
|
+
function toSecretProviderError(params) {
|
|
701
|
+
const { error, provider, reference, operation, suppressThrow } = params;
|
|
702
|
+
if (error instanceof SecretProviderError) {
|
|
703
|
+
return error;
|
|
704
|
+
}
|
|
705
|
+
const code = deriveErrorCode(error);
|
|
706
|
+
const message = error instanceof Error ? error.message : `Unknown error during ${operation}`;
|
|
707
|
+
const providerError = new SecretProviderError({
|
|
708
|
+
message,
|
|
709
|
+
provider,
|
|
710
|
+
reference,
|
|
711
|
+
code,
|
|
712
|
+
cause: error
|
|
713
|
+
});
|
|
714
|
+
if (suppressThrow) {
|
|
715
|
+
return providerError;
|
|
716
|
+
}
|
|
717
|
+
throw providerError;
|
|
718
|
+
}
|
|
719
|
+
function deriveErrorCode(error) {
|
|
720
|
+
if (typeof error !== "object" || error === null) {
|
|
721
|
+
return "UNKNOWN";
|
|
722
|
+
}
|
|
723
|
+
const errorAny = error;
|
|
724
|
+
const code = errorAny.code;
|
|
725
|
+
if (code === 5 || code === "NOT_FOUND")
|
|
726
|
+
return "NOT_FOUND";
|
|
727
|
+
if (code === 6 || code === "ALREADY_EXISTS")
|
|
728
|
+
return "INVALID";
|
|
729
|
+
if (code === 7 || code === "PERMISSION_DENIED" || code === 403) {
|
|
730
|
+
return "FORBIDDEN";
|
|
731
|
+
}
|
|
732
|
+
if (code === 3 || code === "INVALID_ARGUMENT")
|
|
733
|
+
return "INVALID";
|
|
734
|
+
return "UNKNOWN";
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// src/integrations/secrets/scaleway-secret-manager.ts
|
|
738
|
+
import { Buffer as Buffer4 } from "buffer";
|
|
739
|
+
var UUID_V4_LIKE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
740
|
+
|
|
741
|
+
class ScalewaySecretManagerProvider {
|
|
742
|
+
id = "scaleway-secret-manager";
|
|
743
|
+
token;
|
|
744
|
+
defaultRegion;
|
|
745
|
+
defaultProjectId;
|
|
746
|
+
baseUrl;
|
|
747
|
+
fetchFn;
|
|
748
|
+
constructor(options = {}) {
|
|
749
|
+
this.token = options.token ?? process.env.SCW_SECRET_KEY ?? process.env.SCALEWAY_SECRET_KEY ?? "";
|
|
750
|
+
this.defaultRegion = options.defaultRegion ?? process.env.SCW_DEFAULT_REGION ?? process.env.SCW_REGION;
|
|
751
|
+
this.defaultProjectId = options.defaultProjectId ?? process.env.SCW_DEFAULT_PROJECT_ID ?? process.env.SCW_PROJECT_ID;
|
|
752
|
+
this.baseUrl = options.baseUrl ?? "https://api.scaleway.com";
|
|
753
|
+
this.fetchFn = options.fetch ?? fetch;
|
|
754
|
+
}
|
|
755
|
+
canHandle(reference) {
|
|
756
|
+
try {
|
|
757
|
+
const parsed = parseSecretUri(reference);
|
|
758
|
+
return parsed.provider === "scw" && (parsed.path === "secret-manager" || parsed.path.startsWith("secret-manager/"));
|
|
759
|
+
} catch {
|
|
760
|
+
return false;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
async getSecret(reference, options) {
|
|
764
|
+
const location = this.parseReference(reference);
|
|
765
|
+
if (!this.token) {
|
|
766
|
+
throw new SecretProviderError({
|
|
767
|
+
message: "Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).",
|
|
768
|
+
provider: this.id,
|
|
769
|
+
reference,
|
|
770
|
+
code: "FORBIDDEN"
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
if (!UUID_V4_LIKE.test(location.secretIdOrName)) {
|
|
774
|
+
throw new SecretProviderError({
|
|
775
|
+
message: "Scaleway getSecret requires a secretId (uuid) reference, not a secret name.",
|
|
776
|
+
provider: this.id,
|
|
777
|
+
reference,
|
|
778
|
+
code: "INVALID"
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
const revision = options?.version ?? location.revision ?? "latest";
|
|
782
|
+
const url = `${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(location.region)}/secrets/${encodeURIComponent(location.secretIdOrName)}/versions/${encodeURIComponent(revision)}/access`;
|
|
783
|
+
const response = await this.fetchFn(url, {
|
|
784
|
+
method: "GET",
|
|
785
|
+
headers: {
|
|
786
|
+
"X-Auth-Token": this.token
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
if (!response.ok) {
|
|
790
|
+
throw await toScalewayError({
|
|
791
|
+
response,
|
|
792
|
+
provider: this.id,
|
|
793
|
+
reference,
|
|
794
|
+
operation: "getSecret"
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
const payload = await response.json();
|
|
798
|
+
const dataB64 = extractScalewayData(payload);
|
|
799
|
+
return {
|
|
800
|
+
data: Buffer4.from(dataB64, "base64"),
|
|
801
|
+
version: revision,
|
|
802
|
+
metadata: {
|
|
803
|
+
region: location.region,
|
|
804
|
+
secretId: location.secretIdOrName
|
|
805
|
+
},
|
|
806
|
+
retrievedAt: new Date
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
async setSecret(reference, payload) {
|
|
810
|
+
const location = this.parseReference(reference);
|
|
811
|
+
if (!this.token) {
|
|
812
|
+
throw new SecretProviderError({
|
|
813
|
+
message: "Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).",
|
|
814
|
+
provider: this.id,
|
|
815
|
+
reference,
|
|
816
|
+
code: "FORBIDDEN"
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
const bytes = normalizeSecretPayload(payload);
|
|
820
|
+
const encoded = Buffer4.from(bytes).toString("base64");
|
|
821
|
+
const secretId = UUID_V4_LIKE.test(location.secretIdOrName) ? location.secretIdOrName : await this.createSecret({
|
|
822
|
+
region: location.region,
|
|
823
|
+
name: location.secretIdOrName,
|
|
824
|
+
reference
|
|
825
|
+
});
|
|
826
|
+
const version = await this.createSecretVersion({
|
|
827
|
+
region: location.region,
|
|
828
|
+
secretId,
|
|
829
|
+
dataB64: encoded,
|
|
830
|
+
reference
|
|
831
|
+
});
|
|
832
|
+
return {
|
|
833
|
+
reference: this.buildReference(location.region, secretId, {
|
|
834
|
+
version
|
|
835
|
+
}),
|
|
836
|
+
version
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
async rotateSecret(reference, payload) {
|
|
840
|
+
return this.setSecret(reference, payload);
|
|
841
|
+
}
|
|
842
|
+
async deleteSecret(reference) {
|
|
843
|
+
const location = this.parseReference(reference);
|
|
844
|
+
if (!this.token) {
|
|
845
|
+
throw new SecretProviderError({
|
|
846
|
+
message: "Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).",
|
|
847
|
+
provider: this.id,
|
|
848
|
+
reference,
|
|
849
|
+
code: "FORBIDDEN"
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
if (!UUID_V4_LIKE.test(location.secretIdOrName)) {
|
|
853
|
+
throw new SecretProviderError({
|
|
854
|
+
message: "Scaleway deleteSecret requires a secretId (uuid) reference, not a secret name.",
|
|
855
|
+
provider: this.id,
|
|
856
|
+
reference,
|
|
857
|
+
code: "INVALID"
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
const url = `${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(location.region)}/secrets/${encodeURIComponent(location.secretIdOrName)}`;
|
|
861
|
+
const response = await this.fetchFn(url, {
|
|
862
|
+
method: "DELETE",
|
|
863
|
+
headers: {
|
|
864
|
+
"X-Auth-Token": this.token
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
if (!response.ok) {
|
|
868
|
+
throw await toScalewayError({
|
|
869
|
+
response,
|
|
870
|
+
provider: this.id,
|
|
871
|
+
reference,
|
|
872
|
+
operation: "deleteSecret"
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
parseReference(reference) {
|
|
877
|
+
const parsed = parseSecretUri(reference);
|
|
878
|
+
if (parsed.provider !== "scw") {
|
|
879
|
+
throw new SecretProviderError({
|
|
880
|
+
message: `Unsupported secret provider: ${parsed.provider}`,
|
|
881
|
+
provider: this.id,
|
|
882
|
+
reference,
|
|
883
|
+
code: "INVALID"
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
const segments = parsed.path.split("/").filter(Boolean);
|
|
887
|
+
if (segments.length < 2 || segments[0] !== "secret-manager") {
|
|
888
|
+
throw new SecretProviderError({
|
|
889
|
+
message: "Expected secret reference format scw://secret-manager/{region}/{secretIdOrName}[?version=...]",
|
|
890
|
+
provider: this.id,
|
|
891
|
+
reference,
|
|
892
|
+
code: "INVALID"
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
const region = segments[1] ?? this.defaultRegion;
|
|
896
|
+
if (!region) {
|
|
897
|
+
throw new SecretProviderError({
|
|
898
|
+
message: "Scaleway region must be provided either in reference (scw://secret-manager/{region}/...) or via SCW_DEFAULT_REGION/SCW_REGION.",
|
|
899
|
+
provider: this.id,
|
|
900
|
+
reference,
|
|
901
|
+
code: "INVALID"
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
const secretIdOrName = segments.slice(2).join("/");
|
|
905
|
+
if (!secretIdOrName) {
|
|
906
|
+
throw new SecretProviderError({
|
|
907
|
+
message: `Unable to resolve secret id/name from reference "${parsed.path}"`,
|
|
908
|
+
provider: this.id,
|
|
909
|
+
reference,
|
|
910
|
+
code: "INVALID"
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
return {
|
|
914
|
+
region,
|
|
915
|
+
secretIdOrName,
|
|
916
|
+
revision: parsed.extras?.version
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
async createSecret(params) {
|
|
920
|
+
const projectId = this.defaultProjectId;
|
|
921
|
+
if (!projectId) {
|
|
922
|
+
throw new SecretProviderError({
|
|
923
|
+
message: "Scaleway project id is required to create secrets by name (set SCW_DEFAULT_PROJECT_ID/SCW_PROJECT_ID).",
|
|
924
|
+
provider: this.id,
|
|
925
|
+
reference: params.reference,
|
|
926
|
+
code: "INVALID"
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
const url = `${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(params.region)}/secrets`;
|
|
930
|
+
const response = await this.fetchFn(url, {
|
|
931
|
+
method: "POST",
|
|
932
|
+
headers: {
|
|
933
|
+
"Content-Type": "application/json",
|
|
934
|
+
"X-Auth-Token": this.token
|
|
935
|
+
},
|
|
936
|
+
body: JSON.stringify({
|
|
937
|
+
name: params.name,
|
|
938
|
+
project_id: projectId
|
|
939
|
+
})
|
|
940
|
+
});
|
|
941
|
+
if (!response.ok) {
|
|
942
|
+
throw await toScalewayError({
|
|
943
|
+
response,
|
|
944
|
+
provider: this.id,
|
|
945
|
+
reference: params.reference,
|
|
946
|
+
operation: "createSecret"
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
const payload = await response.json();
|
|
950
|
+
const secretId = extractScalewaySecretId(payload);
|
|
951
|
+
return secretId;
|
|
952
|
+
}
|
|
953
|
+
async createSecretVersion(params) {
|
|
954
|
+
const url = `${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(params.region)}/secrets/${encodeURIComponent(params.secretId)}/versions`;
|
|
955
|
+
const response = await this.fetchFn(url, {
|
|
956
|
+
method: "POST",
|
|
957
|
+
headers: {
|
|
958
|
+
"Content-Type": "application/json",
|
|
959
|
+
"X-Auth-Token": this.token
|
|
960
|
+
},
|
|
961
|
+
body: JSON.stringify({
|
|
962
|
+
data: params.dataB64
|
|
963
|
+
})
|
|
964
|
+
});
|
|
965
|
+
if (!response.ok) {
|
|
966
|
+
throw await toScalewayError({
|
|
967
|
+
response,
|
|
968
|
+
provider: this.id,
|
|
969
|
+
reference: params.reference,
|
|
970
|
+
operation: "createSecretVersion"
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
const payload = await response.json();
|
|
974
|
+
return extractScalewayRevision(payload) ?? "latest";
|
|
975
|
+
}
|
|
976
|
+
buildReference(region, secretId, extras) {
|
|
977
|
+
const base = `scw://secret-manager/${region}/${secretId}`;
|
|
978
|
+
const query = extras ? Object.entries(extras).filter(([, value]) => Boolean(value)).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&") : "";
|
|
979
|
+
return query ? `${base}?${query}` : base;
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
function extractScalewayData(payload) {
|
|
983
|
+
if (!payload || typeof payload !== "object") {
|
|
984
|
+
throw new Error("Invalid scaleway secret payload");
|
|
985
|
+
}
|
|
986
|
+
const record = payload;
|
|
987
|
+
if (typeof record.data === "string" && record.data) {
|
|
988
|
+
return record.data;
|
|
989
|
+
}
|
|
990
|
+
throw new Error("Scaleway secret payload is missing data");
|
|
991
|
+
}
|
|
992
|
+
function extractScalewaySecretId(payload) {
|
|
993
|
+
if (!payload || typeof payload !== "object") {
|
|
994
|
+
throw new Error("Invalid scaleway createSecret payload");
|
|
995
|
+
}
|
|
996
|
+
const record = payload;
|
|
997
|
+
if (typeof record.id === "string" && record.id) {
|
|
998
|
+
return record.id;
|
|
999
|
+
}
|
|
1000
|
+
throw new Error("Scaleway createSecret response is missing id");
|
|
1001
|
+
}
|
|
1002
|
+
function extractScalewayRevision(payload) {
|
|
1003
|
+
if (!payload || typeof payload !== "object") {
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
const record = payload;
|
|
1007
|
+
if (typeof record.revision === "number") {
|
|
1008
|
+
return String(record.revision);
|
|
1009
|
+
}
|
|
1010
|
+
if (typeof record.revision === "string" && record.revision) {
|
|
1011
|
+
return record.revision;
|
|
1012
|
+
}
|
|
1013
|
+
if (typeof record.id === "string" && record.id) {
|
|
1014
|
+
return record.id;
|
|
1015
|
+
}
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
async function toScalewayError(params) {
|
|
1019
|
+
const { response, provider, reference, operation } = params;
|
|
1020
|
+
const code = response.status === 404 ? "NOT_FOUND" : response.status === 401 || response.status === 403 ? "FORBIDDEN" : response.status >= 400 && response.status < 500 ? "INVALID" : "UNKNOWN";
|
|
1021
|
+
const bodyText = await safeReadBody(response);
|
|
1022
|
+
const message = bodyText ? `Scaleway Secret Manager ${operation} failed (${response.status}): ${bodyText}` : `Scaleway Secret Manager ${operation} failed (${response.status})`;
|
|
1023
|
+
return new SecretProviderError({
|
|
1024
|
+
message,
|
|
1025
|
+
provider,
|
|
1026
|
+
reference,
|
|
1027
|
+
code
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
async function safeReadBody(response) {
|
|
1031
|
+
try {
|
|
1032
|
+
const text = await response.text();
|
|
1033
|
+
const trimmed = text.trim();
|
|
1034
|
+
return trimmed.length ? trimmed : undefined;
|
|
1035
|
+
} catch {
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
// src/integrations/secrets/manager.ts
|
|
1041
|
+
class SecretProviderManager {
|
|
1042
|
+
id;
|
|
1043
|
+
providers = [];
|
|
1044
|
+
registrationCounter = 0;
|
|
1045
|
+
constructor(options = {}) {
|
|
1046
|
+
this.id = options.id ?? "secret-provider-manager";
|
|
1047
|
+
const initialProviders = options.providers ?? [];
|
|
1048
|
+
for (const entry of initialProviders) {
|
|
1049
|
+
this.register(entry.provider, { priority: entry.priority });
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
register(provider, options = {}) {
|
|
1053
|
+
this.providers.push({
|
|
1054
|
+
provider,
|
|
1055
|
+
priority: options.priority ?? 0,
|
|
1056
|
+
order: this.registrationCounter++
|
|
1057
|
+
});
|
|
1058
|
+
this.providers.sort((a, b) => {
|
|
1059
|
+
if (a.priority !== b.priority) {
|
|
1060
|
+
return b.priority - a.priority;
|
|
1061
|
+
}
|
|
1062
|
+
return a.order - b.order;
|
|
1063
|
+
});
|
|
1064
|
+
return this;
|
|
1065
|
+
}
|
|
1066
|
+
canHandle(reference) {
|
|
1067
|
+
return this.providers.some(({ provider }) => safeCanHandle(provider, reference));
|
|
1068
|
+
}
|
|
1069
|
+
async getSecret(reference, options) {
|
|
1070
|
+
const errors = [];
|
|
1071
|
+
for (const { provider } of this.providers) {
|
|
1072
|
+
if (!safeCanHandle(provider, reference)) {
|
|
1073
|
+
continue;
|
|
1074
|
+
}
|
|
1075
|
+
try {
|
|
1076
|
+
return await provider.getSecret(reference, options);
|
|
1077
|
+
} catch (error) {
|
|
1078
|
+
if (error instanceof SecretProviderError) {
|
|
1079
|
+
errors.push(error);
|
|
1080
|
+
if (error.code !== "NOT_FOUND") {
|
|
1081
|
+
break;
|
|
1082
|
+
}
|
|
1083
|
+
continue;
|
|
1084
|
+
}
|
|
1085
|
+
throw error;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
throw this.composeError("getSecret", reference, errors, options?.version);
|
|
1089
|
+
}
|
|
1090
|
+
async setSecret(reference, payload) {
|
|
1091
|
+
return this.delegateToFirst("setSecret", reference, (provider) => provider.setSecret(reference, payload));
|
|
1092
|
+
}
|
|
1093
|
+
async rotateSecret(reference, payload) {
|
|
1094
|
+
return this.delegateToFirst("rotateSecret", reference, (provider) => provider.rotateSecret(reference, payload));
|
|
1095
|
+
}
|
|
1096
|
+
async deleteSecret(reference) {
|
|
1097
|
+
await this.delegateToFirst("deleteSecret", reference, (provider) => provider.deleteSecret(reference));
|
|
1098
|
+
}
|
|
1099
|
+
async delegateToFirst(operation, reference, invoker) {
|
|
1100
|
+
const errors = [];
|
|
1101
|
+
for (const { provider } of this.providers) {
|
|
1102
|
+
if (!safeCanHandle(provider, reference)) {
|
|
1103
|
+
continue;
|
|
1104
|
+
}
|
|
1105
|
+
try {
|
|
1106
|
+
return await invoker(provider);
|
|
1107
|
+
} catch (error) {
|
|
1108
|
+
if (error instanceof SecretProviderError) {
|
|
1109
|
+
errors.push(error);
|
|
1110
|
+
continue;
|
|
1111
|
+
}
|
|
1112
|
+
throw error;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
throw this.composeError(operation, reference, errors);
|
|
1116
|
+
}
|
|
1117
|
+
composeError(operation, reference, errors, version) {
|
|
1118
|
+
if (errors.length === 1) {
|
|
1119
|
+
const [singleError] = errors;
|
|
1120
|
+
if (singleError) {
|
|
1121
|
+
return singleError;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
const messageParts = [
|
|
1125
|
+
`No registered secret provider could ${operation}`,
|
|
1126
|
+
`reference "${reference}"`
|
|
1127
|
+
];
|
|
1128
|
+
if (version) {
|
|
1129
|
+
messageParts.push(`(version: ${version})`);
|
|
1130
|
+
}
|
|
1131
|
+
if (errors.length > 1) {
|
|
1132
|
+
messageParts.push(`Attempts: ${errors.map((error) => `${error.provider}:${error.code}`).join(", ")}`);
|
|
1133
|
+
}
|
|
1134
|
+
return new SecretProviderError({
|
|
1135
|
+
message: messageParts.join(" "),
|
|
1136
|
+
provider: this.id,
|
|
1137
|
+
reference,
|
|
1138
|
+
code: errors.length > 0 ? errors[errors.length - 1]?.code ?? "UNKNOWN" : "UNKNOWN",
|
|
1139
|
+
cause: errors
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
function safeCanHandle(provider, reference) {
|
|
1144
|
+
try {
|
|
1145
|
+
return provider.canHandle(reference);
|
|
1146
|
+
} catch {
|
|
1147
|
+
return false;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
export {
|
|
1151
|
+
parseSecretUri,
|
|
1152
|
+
normalizeSecretPayload,
|
|
1153
|
+
SecretProviderManager,
|
|
1154
|
+
SecretProviderError,
|
|
1155
|
+
ScalewaySecretManagerProvider,
|
|
1156
|
+
GcpSecretManagerProvider,
|
|
1157
|
+
EnvSecretProvider,
|
|
1158
|
+
AwsSecretsManagerProvider
|
|
1159
|
+
};
|