@contractspec/lib.contracts 1.44.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/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/_virtual/rolldown_runtime.js +37 -0
- package/dist/app-config/app-config.feature.d.ts +12 -0
- package/dist/app-config/app-config.feature.js +54 -0
- package/dist/app-config/branding.d.ts +55 -0
- package/dist/app-config/branding.js +0 -0
- package/dist/app-config/contracts.d.ts +245 -0
- package/dist/app-config/contracts.js +395 -0
- package/dist/app-config/docs/app-config.docblock.d.ts +6 -0
- package/dist/app-config/docs/app-config.docblock.js +21 -0
- package/dist/app-config/events.d.ts +122 -0
- package/dist/app-config/events.js +174 -0
- package/dist/app-config/index.d.ts +9 -0
- package/dist/app-config/index.js +8 -0
- package/dist/app-config/lifecycle-contracts.d.ts +273 -0
- package/dist/app-config/lifecycle-contracts.js +440 -0
- package/dist/app-config/lifecycle.d.ts +27 -0
- package/dist/app-config/lifecycle.js +0 -0
- package/dist/app-config/runtime.d.ts +120 -0
- package/dist/app-config/runtime.js +617 -0
- package/dist/app-config/spec.d.ts +173 -0
- package/dist/app-config/spec.js +36 -0
- package/dist/app-config/validation.d.ts +49 -0
- package/dist/app-config/validation.js +538 -0
- package/dist/capabilities/capabilities.d.ts +48 -0
- package/dist/capabilities/capabilities.js +50 -0
- package/dist/capabilities/docs/capabilities.docblock.d.ts +6 -0
- package/dist/capabilities/docs/capabilities.docblock.js +21 -0
- package/dist/capabilities/index.d.ts +3 -0
- package/dist/capabilities/index.js +4 -0
- package/dist/capabilities/openbanking.d.ts +10 -0
- package/dist/capabilities/openbanking.js +92 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +9 -0
- package/dist/client/react/drivers/rn-reusables.d.ts +22 -0
- package/dist/client/react/drivers/rn-reusables.js +21 -0
- package/dist/client/react/drivers/shadcn.d.ts +12 -0
- package/dist/client/react/drivers/shadcn.js +11 -0
- package/dist/client/react/feature-render.d.ts +23 -0
- package/dist/client/react/feature-render.js +44 -0
- package/dist/client/react/form-render.d.ts +92 -0
- package/dist/client/react/form-render.js +298 -0
- package/dist/client/react/index.d.ts +5 -0
- package/dist/client/react/index.js +8 -0
- package/dist/contract-registry/index.d.ts +3 -0
- package/dist/contract-registry/index.js +3 -0
- package/dist/contract-registry/schemas.d.ts +124 -0
- package/dist/contract-registry/schemas.js +61 -0
- package/dist/contract-registry/types.d.ts +46 -0
- package/dist/contract-registry/types.js +0 -0
- package/dist/data-views/data-views.d.ts +5 -0
- package/dist/data-views/data-views.js +4 -0
- package/dist/data-views/docs/data-views.docblock.d.ts +6 -0
- package/dist/data-views/docs/data-views.docblock.js +21 -0
- package/dist/data-views/index.d.ts +4 -0
- package/dist/data-views/index.js +4 -0
- package/dist/data-views/query-generator.d.ts +40 -0
- package/dist/data-views/query-generator.js +48 -0
- package/dist/data-views/registry.d.ts +51 -0
- package/dist/data-views/registry.js +82 -0
- package/dist/data-views/runtime.d.ts +28 -0
- package/dist/data-views/runtime.js +39 -0
- package/dist/data-views/spec.d.ts +32 -0
- package/dist/data-views/spec.js +10 -0
- package/dist/data-views/types.d.ts +157 -0
- package/dist/data-views/types.js +0 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts +6 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +17 -0
- package/dist/docs/index.d.ts +6 -0
- package/dist/docs/index.js +29 -0
- package/dist/docs/meta.docs.d.ts +6 -0
- package/dist/docs/meta.docs.js +29 -0
- package/dist/docs/presentations.d.ts +33 -0
- package/dist/docs/presentations.js +64 -0
- package/dist/docs/registry.d.ts +23 -0
- package/dist/docs/registry.js +51 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts +6 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +81 -0
- package/dist/docs/tech/contracts/README.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/README.docblock.js +21 -0
- package/dist/docs/tech/contracts/create-subscription.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/create-subscription.docblock.js +21 -0
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.js +21 -0
- package/dist/docs/tech/contracts/migrations.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/migrations.docblock.js +21 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.js +58 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/openapi-import.docblock.js +65 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +21 -0
- package/dist/docs/tech/contracts/overlays.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/overlays.docblock.js +21 -0
- package/dist/docs/tech/contracts/tests.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/tests.docblock.js +21 -0
- package/dist/docs/tech/contracts/themes.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/themes.docblock.js +21 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +21 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts +6 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +17 -0
- package/dist/docs/tech/llm/llm-integration.docblock.d.ts +7 -0
- package/dist/docs/tech/llm/llm-integration.docblock.js +358 -0
- package/dist/docs/tech/mcp-endpoints.docblock.d.ts +6 -0
- package/dist/docs/tech/mcp-endpoints.docblock.js +38 -0
- package/dist/docs/tech/presentation-runtime.docblock.d.ts +6 -0
- package/dist/docs/tech/presentation-runtime.docblock.js +17 -0
- package/dist/docs/tech/schema/README.docblock.d.ts +6 -0
- package/dist/docs/tech/schema/README.docblock.js +21 -0
- package/dist/docs/tech/studio/learning-events.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/learning-events.docblock.js +49 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.js +80 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +85 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.js +46 -0
- package/dist/docs/tech/studio/project-routing.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/project-routing.docblock.js +68 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +41 -0
- package/dist/docs/tech/studio/team-invitations.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/team-invitations.docblock.js +70 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.js +48 -0
- package/dist/docs/tech/studio/workspaces.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/workspaces.docblock.js +63 -0
- package/dist/docs/tech/telemetry-ingest.docblock.d.ts +6 -0
- package/dist/docs/tech/telemetry-ingest.docblock.js +156 -0
- package/dist/docs/tech/templates/runtime.docblock.d.ts +6 -0
- package/dist/docs/tech/templates/runtime.docblock.js +21 -0
- package/dist/docs/tech/vscode-extension.docblock.d.ts +6 -0
- package/dist/docs/tech/vscode-extension.docblock.js +102 -0
- package/dist/docs/tech-contracts.docs.d.ts +6 -0
- package/dist/docs/tech-contracts.docs.js +96 -0
- package/dist/docs/types.d.ts +41 -0
- package/dist/docs/types.js +0 -0
- package/dist/events.d.ts +47 -0
- package/dist/events.js +19 -0
- package/dist/experiments/docs/experiments.docblock.d.ts +6 -0
- package/dist/experiments/docs/experiments.docblock.js +21 -0
- package/dist/experiments/evaluator.d.ts +37 -0
- package/dist/experiments/evaluator.js +101 -0
- package/dist/experiments/spec-resolver.d.ts +17 -0
- package/dist/experiments/spec-resolver.js +0 -0
- package/dist/experiments/spec.d.ts +82 -0
- package/dist/experiments/spec.js +33 -0
- package/dist/features/index.d.ts +5 -0
- package/dist/features/index.js +5 -0
- package/dist/features/install.d.ts +22 -0
- package/dist/features/install.js +36 -0
- package/dist/features/registry.d.ts +26 -0
- package/dist/features/registry.js +49 -0
- package/dist/features/types.d.ts +88 -0
- package/dist/features/types.js +0 -0
- package/dist/features/validation.d.ts +8 -0
- package/dist/features/validation.js +14 -0
- package/dist/forms/docs/forms.docblock.d.ts +6 -0
- package/dist/forms/docs/forms.docblock.js +21 -0
- package/dist/forms/forms.d.ts +266 -0
- package/dist/forms/forms.js +146 -0
- package/dist/forms/index.d.ts +2 -0
- package/dist/forms/index.js +3 -0
- package/dist/index.d.ts +147 -0
- package/dist/index.js +121 -0
- package/dist/install.d.ts +77 -0
- package/dist/install.js +40 -0
- package/dist/integrations/binding.d.ts +17 -0
- package/dist/integrations/binding.js +0 -0
- package/dist/integrations/connection.d.ts +51 -0
- package/dist/integrations/connection.js +0 -0
- package/dist/integrations/docs/integrations.docblock.d.ts +6 -0
- package/dist/integrations/docs/integrations.docblock.js +94 -0
- package/dist/integrations/health.d.ts +21 -0
- package/dist/integrations/health.js +69 -0
- package/dist/integrations/index.d.ts +34 -0
- package/dist/integrations/index.js +23 -0
- package/dist/integrations/integrations.feature.d.ts +12 -0
- package/dist/integrations/integrations.feature.js +60 -0
- package/dist/integrations/openbanking/contracts/accounts.d.ts +289 -0
- package/dist/integrations/openbanking/contracts/accounts.js +236 -0
- package/dist/integrations/openbanking/contracts/balances.d.ts +165 -0
- package/dist/integrations/openbanking/contracts/balances.js +166 -0
- package/dist/integrations/openbanking/contracts/index.d.ts +10 -0
- package/dist/integrations/openbanking/contracts/index.js +12 -0
- package/dist/integrations/openbanking/contracts/transactions.d.ts +213 -0
- package/dist/integrations/openbanking/contracts/transactions.js +217 -0
- package/dist/integrations/openbanking/guards.d.ts +12 -0
- package/dist/integrations/openbanking/guards.js +33 -0
- package/dist/integrations/openbanking/models.d.ts +228 -0
- package/dist/integrations/openbanking/models.js +240 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +12 -0
- package/dist/integrations/openbanking/openbanking.feature.js +69 -0
- package/dist/integrations/openbanking/telemetry.d.ts +15 -0
- package/dist/integrations/openbanking/telemetry.js +39 -0
- package/dist/integrations/operations.d.ts +437 -0
- package/dist/integrations/operations.js +392 -0
- package/dist/integrations/providers/calendar.d.ts +78 -0
- package/dist/integrations/providers/calendar.js +0 -0
- package/dist/integrations/providers/elevenlabs.d.ts +7 -0
- package/dist/integrations/providers/elevenlabs.js +55 -0
- package/dist/integrations/providers/email.d.ts +86 -0
- package/dist/integrations/providers/email.js +0 -0
- package/dist/integrations/providers/embedding.d.ts +24 -0
- package/dist/integrations/providers/embedding.js +0 -0
- package/dist/integrations/providers/gcs-storage.d.ts +7 -0
- package/dist/integrations/providers/gcs-storage.js +78 -0
- package/dist/integrations/providers/gmail.d.ts +7 -0
- package/dist/integrations/providers/gmail.js +90 -0
- package/dist/integrations/providers/google-calendar.d.ts +7 -0
- package/dist/integrations/providers/google-calendar.js +69 -0
- package/dist/integrations/providers/impls/elevenlabs-voice.d.ts +20 -0
- package/dist/integrations/providers/impls/elevenlabs-voice.js +95 -0
- package/dist/integrations/providers/impls/gcs-storage.d.ts +24 -0
- package/dist/integrations/providers/impls/gcs-storage.js +88 -0
- package/dist/integrations/providers/impls/gmail-inbound.d.ts +26 -0
- package/dist/integrations/providers/impls/gmail-inbound.js +200 -0
- package/dist/integrations/providers/impls/gmail-outbound.d.ts +18 -0
- package/dist/integrations/providers/impls/gmail-outbound.js +105 -0
- package/dist/integrations/providers/impls/google-calendar.d.ts +23 -0
- package/dist/integrations/providers/impls/google-calendar.js +154 -0
- package/dist/integrations/providers/impls/index.d.ts +15 -0
- package/dist/integrations/providers/impls/index.js +16 -0
- package/dist/integrations/providers/impls/mistral-embedding.d.ts +23 -0
- package/dist/integrations/providers/impls/mistral-embedding.js +41 -0
- package/dist/integrations/providers/impls/mistral-llm.d.ts +31 -0
- package/dist/integrations/providers/impls/mistral-llm.js +247 -0
- package/dist/integrations/providers/impls/postmark-email.d.ts +19 -0
- package/dist/integrations/providers/impls/postmark-email.js +55 -0
- package/dist/integrations/providers/impls/powens-client.d.ts +124 -0
- package/dist/integrations/providers/impls/powens-client.js +171 -0
- package/dist/integrations/providers/impls/powens-openbanking.d.ts +27 -0
- package/dist/integrations/providers/impls/powens-openbanking.js +218 -0
- package/dist/integrations/providers/impls/provider-factory.d.ts +26 -0
- package/dist/integrations/providers/impls/provider-factory.js +145 -0
- package/dist/integrations/providers/impls/qdrant-vector.d.ts +24 -0
- package/dist/integrations/providers/impls/qdrant-vector.js +69 -0
- package/dist/integrations/providers/impls/stripe-payments.d.ts +28 -0
- package/dist/integrations/providers/impls/stripe-payments.js +202 -0
- package/dist/integrations/providers/impls/twilio-sms.d.ts +20 -0
- package/dist/integrations/providers/impls/twilio-sms.js +58 -0
- package/dist/integrations/providers/index.d.ts +22 -0
- package/dist/integrations/providers/index.js +13 -0
- package/dist/integrations/providers/llm.d.ts +82 -0
- package/dist/integrations/providers/llm.js +0 -0
- package/dist/integrations/providers/mistral.d.ts +7 -0
- package/dist/integrations/providers/mistral.js +71 -0
- package/dist/integrations/providers/openbanking.d.ts +128 -0
- package/dist/integrations/providers/openbanking.js +0 -0
- package/dist/integrations/providers/payments.d.ts +109 -0
- package/dist/integrations/providers/payments.js +0 -0
- package/dist/integrations/providers/postmark.d.ts +7 -0
- package/dist/integrations/providers/postmark.js +71 -0
- package/dist/integrations/providers/powens.d.ts +7 -0
- package/dist/integrations/providers/powens.js +119 -0
- package/dist/integrations/providers/qdrant.d.ts +7 -0
- package/dist/integrations/providers/qdrant.js +76 -0
- package/dist/integrations/providers/registry.d.ts +11 -0
- package/dist/integrations/providers/registry.js +34 -0
- package/dist/integrations/providers/sms.d.ts +34 -0
- package/dist/integrations/providers/sms.js +0 -0
- package/dist/integrations/providers/storage.d.ts +60 -0
- package/dist/integrations/providers/storage.js +0 -0
- package/dist/integrations/providers/stripe.d.ts +7 -0
- package/dist/integrations/providers/stripe.js +86 -0
- package/dist/integrations/providers/twilio-sms.d.ts +7 -0
- package/dist/integrations/providers/twilio-sms.js +64 -0
- package/dist/integrations/providers/vector-store.d.ts +43 -0
- package/dist/integrations/providers/vector-store.js +0 -0
- package/dist/integrations/providers/voice.d.ts +34 -0
- package/dist/integrations/providers/voice.js +0 -0
- package/dist/integrations/runtime.d.ts +99 -0
- package/dist/integrations/runtime.js +186 -0
- package/dist/integrations/secrets/aws-secret-manager.d.ts +31 -0
- package/dist/integrations/secrets/aws-secret-manager.js +231 -0
- package/dist/integrations/secrets/env-secret-provider.d.ts +31 -0
- package/dist/integrations/secrets/env-secret-provider.js +81 -0
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +32 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +229 -0
- package/dist/integrations/secrets/index.d.ts +7 -0
- package/dist/integrations/secrets/index.js +8 -0
- package/dist/integrations/secrets/manager.d.ts +47 -0
- package/dist/integrations/secrets/manager.js +103 -0
- package/dist/integrations/secrets/provider.d.ts +52 -0
- package/dist/integrations/secrets/provider.js +58 -0
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts +38 -0
- package/dist/integrations/secrets/scaleway-secret-manager.js +247 -0
- package/dist/integrations/secrets-types.d.ts +17 -0
- package/dist/integrations/secrets-types.js +0 -0
- package/dist/integrations/spec.d.ts +75 -0
- package/dist/integrations/spec.js +39 -0
- package/dist/jobs/define-job.d.ts +18 -0
- package/dist/jobs/define-job.js +16 -0
- package/dist/jobs/gcp-cloud-tasks.d.ts +41 -0
- package/dist/jobs/gcp-cloud-tasks.js +53 -0
- package/dist/jobs/gcp-pubsub.d.ts +25 -0
- package/dist/jobs/gcp-pubsub.js +39 -0
- package/dist/jobs/handlers/gmail-sync-handler.d.ts +9 -0
- package/dist/jobs/handlers/gmail-sync-handler.js +9 -0
- package/dist/jobs/handlers/index.d.ts +9 -0
- package/dist/jobs/handlers/index.js +12 -0
- package/dist/jobs/handlers/ping-handler.d.ts +10 -0
- package/dist/jobs/handlers/ping-handler.js +15 -0
- package/dist/jobs/handlers/storage-document-handler.d.ts +12 -0
- package/dist/jobs/handlers/storage-document-handler.js +14 -0
- package/dist/jobs/index.d.ts +3 -0
- package/dist/jobs/index.js +4 -0
- package/dist/jobs/memory-queue.d.ts +18 -0
- package/dist/jobs/memory-queue.js +71 -0
- package/dist/jobs/queue.d.ts +131 -0
- package/dist/jobs/queue.js +33 -0
- package/dist/jobs/scaleway-sqs-queue.d.ts +30 -0
- package/dist/jobs/scaleway-sqs-queue.js +153 -0
- package/dist/jsonschema.d.ts +27 -0
- package/dist/jsonschema.js +32 -0
- package/dist/knowledge/binding.d.ts +25 -0
- package/dist/knowledge/binding.js +0 -0
- package/dist/knowledge/docs/knowledge.docblock.d.ts +6 -0
- package/dist/knowledge/docs/knowledge.docblock.js +21 -0
- package/dist/knowledge/index.d.ts +11 -0
- package/dist/knowledge/index.js +10 -0
- package/dist/knowledge/ingestion/document-processor.d.ts +24 -0
- package/dist/knowledge/ingestion/document-processor.js +54 -0
- package/dist/knowledge/ingestion/embedding-service.d.ts +12 -0
- package/dist/knowledge/ingestion/embedding-service.js +25 -0
- package/dist/knowledge/ingestion/gmail-adapter.d.ts +18 -0
- package/dist/knowledge/ingestion/gmail-adapter.js +51 -0
- package/dist/knowledge/ingestion/index.d.ts +6 -0
- package/dist/knowledge/ingestion/index.js +7 -0
- package/dist/knowledge/ingestion/storage-adapter.d.ts +15 -0
- package/dist/knowledge/ingestion/storage-adapter.js +26 -0
- package/dist/knowledge/ingestion/vector-indexer.d.ts +18 -0
- package/dist/knowledge/ingestion/vector-indexer.js +32 -0
- package/dist/knowledge/knowledge.feature.d.ts +12 -0
- package/dist/knowledge/knowledge.feature.js +61 -0
- package/dist/knowledge/operations.d.ts +318 -0
- package/dist/knowledge/operations.js +321 -0
- package/dist/knowledge/query/index.d.ts +2 -0
- package/dist/knowledge/query/index.js +3 -0
- package/dist/knowledge/query/service.d.ts +29 -0
- package/dist/knowledge/query/service.js +65 -0
- package/dist/knowledge/runtime.d.ts +32 -0
- package/dist/knowledge/runtime.js +49 -0
- package/dist/knowledge/source.d.ts +32 -0
- package/dist/knowledge/source.js +0 -0
- package/dist/knowledge/spaces/email-threads.d.ts +7 -0
- package/dist/knowledge/spaces/email-threads.js +37 -0
- package/dist/knowledge/spaces/financial-docs.d.ts +7 -0
- package/dist/knowledge/spaces/financial-docs.js +37 -0
- package/dist/knowledge/spaces/financial-overview.d.ts +7 -0
- package/dist/knowledge/spaces/financial-overview.js +41 -0
- package/dist/knowledge/spaces/index.d.ts +7 -0
- package/dist/knowledge/spaces/index.js +8 -0
- package/dist/knowledge/spaces/product-canon.d.ts +7 -0
- package/dist/knowledge/spaces/product-canon.js +37 -0
- package/dist/knowledge/spaces/support-faq.d.ts +7 -0
- package/dist/knowledge/spaces/support-faq.js +40 -0
- package/dist/knowledge/spaces/uploaded-docs.d.ts +7 -0
- package/dist/knowledge/spaces/uploaded-docs.js +37 -0
- package/dist/knowledge/spec.d.ts +48 -0
- package/dist/knowledge/spec.js +39 -0
- package/dist/llm/exporters.d.ts +70 -0
- package/dist/llm/exporters.js +542 -0
- package/dist/llm/index.d.ts +4 -0
- package/dist/llm/index.js +4 -0
- package/dist/llm/prompts.d.ts +52 -0
- package/dist/llm/prompts.js +410 -0
- package/dist/llm/types.d.ts +215 -0
- package/dist/llm/types.js +0 -0
- package/dist/markdown.d.ts +22 -0
- package/dist/markdown.js +119 -0
- package/dist/migrations.d.ts +52 -0
- package/dist/migrations.js +33 -0
- package/dist/model-registry.d.ts +13 -0
- package/dist/model-registry.js +33 -0
- package/dist/onboarding-base.d.ts +138 -0
- package/dist/onboarding-base.js +195 -0
- package/dist/openapi.d.ts +31 -0
- package/dist/openapi.js +75 -0
- package/dist/operations/index.d.ts +3 -0
- package/dist/operations/index.js +4 -0
- package/dist/operations/operation.d.ts +186 -0
- package/dist/operations/operation.js +35 -0
- package/dist/operations/registry.d.ts +103 -0
- package/dist/operations/registry.js +252 -0
- package/dist/ownership.d.ts +84 -0
- package/dist/ownership.js +38 -0
- package/dist/policy/docs/policy.docblock.d.ts +6 -0
- package/dist/policy/docs/policy.docblock.js +21 -0
- package/dist/policy/engine.d.ts +40 -0
- package/dist/policy/engine.js +223 -0
- package/dist/policy/index.d.ts +5 -0
- package/dist/policy/index.js +5 -0
- package/dist/policy/opa-adapter.d.ts +45 -0
- package/dist/policy/opa-adapter.js +71 -0
- package/dist/policy/registry.d.ts +9 -0
- package/dist/policy/registry.js +11 -0
- package/dist/policy/spec.d.ts +103 -0
- package/dist/policy/spec.js +0 -0
- package/dist/presentations/docs/presentations-conventions.docblock.d.ts +6 -0
- package/dist/presentations/docs/presentations-conventions.docblock.js +21 -0
- package/dist/presentations/index.d.ts +4 -0
- package/dist/presentations/index.js +5 -0
- package/dist/presentations/presentations.d.ts +50 -0
- package/dist/presentations/presentations.js +7 -0
- package/dist/presentations/registry.d.ts +10 -0
- package/dist/presentations/registry.js +12 -0
- package/dist/presentations/transform-engine.d.ts +66 -0
- package/dist/presentations/transform-engine.js +282 -0
- package/dist/prompt.d.ts +60 -0
- package/dist/prompt.js +10 -0
- package/dist/promptRegistry.d.ts +15 -0
- package/dist/promptRegistry.js +34 -0
- package/dist/regenerator/adapters.d.ts +19 -0
- package/dist/regenerator/adapters.js +0 -0
- package/dist/regenerator/docs/regenerator.docblock.d.ts +6 -0
- package/dist/regenerator/docs/regenerator.docblock.js +21 -0
- package/dist/regenerator/executor.d.ts +70 -0
- package/dist/regenerator/executor.js +86 -0
- package/dist/regenerator/index.d.ts +7 -0
- package/dist/regenerator/index.js +6 -0
- package/dist/regenerator/service.d.ts +33 -0
- package/dist/regenerator/service.js +93 -0
- package/dist/regenerator/sinks.d.ts +26 -0
- package/dist/regenerator/sinks.js +32 -0
- package/dist/regenerator/types.d.ts +107 -0
- package/dist/regenerator/types.js +0 -0
- package/dist/regenerator/utils.d.ts +9 -0
- package/dist/regenerator/utils.js +51 -0
- package/dist/registry-utils.d.ts +106 -0
- package/dist/registry-utils.js +122 -0
- package/dist/registry.d.ts +31 -0
- package/dist/registry.js +61 -0
- package/dist/resources.d.ts +64 -0
- package/dist/resources.js +50 -0
- package/dist/schema-to-markdown.d.ts +54 -0
- package/dist/schema-to-markdown.js +217 -0
- package/dist/server/contracts-adapter-hydration.d.ts +15 -0
- package/dist/server/contracts-adapter-hydration.js +41 -0
- package/dist/server/contracts-adapter-input.d.ts +9 -0
- package/dist/server/contracts-adapter-input.js +83 -0
- package/dist/server/graphql-pothos.d.ts +31 -0
- package/dist/server/graphql-pothos.js +134 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +10 -0
- package/dist/server/mcp/createMcpServer.d.ts +15 -0
- package/dist/server/mcp/createMcpServer.js +27 -0
- package/dist/server/mcp/mcpTypes.d.ts +27 -0
- package/dist/server/mcp/mcpTypes.js +0 -0
- package/dist/server/mcp/registerPresentations.d.ts +7 -0
- package/dist/server/mcp/registerPresentations.js +63 -0
- package/dist/server/mcp/registerPrompts.d.ts +8 -0
- package/dist/server/mcp/registerPrompts.js +37 -0
- package/dist/server/mcp/registerResources.d.ts +8 -0
- package/dist/server/mcp/registerResources.js +35 -0
- package/dist/server/mcp/registerTools.d.ts +8 -0
- package/dist/server/mcp/registerTools.js +22 -0
- package/dist/server/provider-mcp.d.ts +2 -0
- package/dist/server/provider-mcp.js +3 -0
- package/dist/server/rest-elysia.d.ts +40 -0
- package/dist/server/rest-elysia.js +20 -0
- package/dist/server/rest-express.d.ts +16 -0
- package/dist/server/rest-express.js +36 -0
- package/dist/server/rest-generic.d.ts +32 -0
- package/dist/server/rest-generic.js +124 -0
- package/dist/server/rest-next-app.d.ts +35 -0
- package/dist/server/rest-next-app.js +38 -0
- package/dist/server/rest-next-mcp.d.ts +11 -0
- package/dist/server/rest-next-mcp.js +45 -0
- package/dist/server/rest-next-pages.d.ts +9 -0
- package/dist/server/rest-next-pages.js +22 -0
- package/dist/telemetry/anomaly.d.ts +27 -0
- package/dist/telemetry/anomaly.js +48 -0
- package/dist/telemetry/docs/telemetry.docblock.d.ts +6 -0
- package/dist/telemetry/docs/telemetry.docblock.js +21 -0
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/telemetry/index.js +5 -0
- package/dist/telemetry/spec.d.ts +91 -0
- package/dist/telemetry/spec.js +69 -0
- package/dist/telemetry/tracker.d.ts +51 -0
- package/dist/telemetry/tracker.js +76 -0
- package/dist/tests/index.d.ts +3 -0
- package/dist/tests/index.js +4 -0
- package/dist/tests/runner.d.ts +43 -0
- package/dist/tests/runner.js +150 -0
- package/dist/tests/spec.d.ts +81 -0
- package/dist/tests/spec.js +33 -0
- package/dist/themes.d.ts +53 -0
- package/dist/themes.js +39 -0
- package/dist/translations/catalog.d.ts +28 -0
- package/dist/translations/catalog.js +0 -0
- package/dist/translations/tenant.d.ts +15 -0
- package/dist/translations/tenant.js +0 -0
- package/dist/types.d.ts +92 -0
- package/dist/types.js +0 -0
- package/dist/workflow/adapters/db-adapter.d.ts +46 -0
- package/dist/workflow/adapters/db-adapter.js +83 -0
- package/dist/workflow/adapters/file-adapter.d.ts +14 -0
- package/dist/workflow/adapters/file-adapter.js +11 -0
- package/dist/workflow/adapters/index.d.ts +4 -0
- package/dist/workflow/adapters/index.js +5 -0
- package/dist/workflow/adapters/memory-store.d.ts +18 -0
- package/dist/workflow/adapters/memory-store.js +58 -0
- package/dist/workflow/expression.d.ts +9 -0
- package/dist/workflow/expression.js +99 -0
- package/dist/workflow/index.d.ts +10 -0
- package/dist/workflow/index.js +9 -0
- package/dist/workflow/overview.docblock.d.ts +6 -0
- package/dist/workflow/overview.docblock.js +21 -0
- package/dist/workflow/runner.d.ts +75 -0
- package/dist/workflow/runner.js +337 -0
- package/dist/workflow/sla-monitor.d.ts +20 -0
- package/dist/workflow/sla-monitor.js +47 -0
- package/dist/workflow/spec.d.ts +106 -0
- package/dist/workflow/spec.js +55 -0
- package/dist/workflow/state.d.ts +35 -0
- package/dist/workflow/state.js +0 -0
- package/dist/workflow/validation.d.ts +29 -0
- package/dist/workflow/validation.js +176 -0
- package/dist/workspace-config/contractsrc-schema.d.ts +862 -0
- package/dist/workspace-config/contractsrc-schema.js +281 -0
- package/dist/workspace-config/index.d.ts +2 -0
- package/dist/workspace-config/index.js +3 -0
- package/dist/workspace-config/workspace-config.docblock.d.ts +6 -0
- package/dist/workspace-config/workspace-config.docblock.js +45 -0
- package/package.json +598 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SecretFetchOptions, SecretProvider, SecretReference, SecretRotationResult, SecretValue, SecretWritePayload } from "./provider.js";
|
|
2
|
+
|
|
3
|
+
//#region src/integrations/secrets/scaleway-secret-manager.d.ts
|
|
4
|
+
interface ScalewaySecretManagerProviderOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Scaleway API token (SCW secret key). If omitted, uses env vars.
|
|
7
|
+
* Header: X-Auth-Token
|
|
8
|
+
*/
|
|
9
|
+
token?: string;
|
|
10
|
+
/** Default region when not present in reference (e.g. fr-par). */
|
|
11
|
+
defaultRegion?: string;
|
|
12
|
+
/** Default project id used when creating secrets by name. */
|
|
13
|
+
defaultProjectId?: string;
|
|
14
|
+
/** Override API base url (defaults to https://api.scaleway.com). */
|
|
15
|
+
baseUrl?: string;
|
|
16
|
+
/** Inject fetch for tests. */
|
|
17
|
+
fetch?: typeof fetch;
|
|
18
|
+
}
|
|
19
|
+
declare class ScalewaySecretManagerProvider implements SecretProvider {
|
|
20
|
+
readonly id = "scaleway-secret-manager";
|
|
21
|
+
private readonly token;
|
|
22
|
+
private readonly defaultRegion?;
|
|
23
|
+
private readonly defaultProjectId?;
|
|
24
|
+
private readonly baseUrl;
|
|
25
|
+
private readonly fetchFn;
|
|
26
|
+
constructor(options?: ScalewaySecretManagerProviderOptions);
|
|
27
|
+
canHandle(reference: SecretReference): boolean;
|
|
28
|
+
getSecret(reference: SecretReference, options?: SecretFetchOptions): Promise<SecretValue>;
|
|
29
|
+
setSecret(reference: SecretReference, payload: SecretWritePayload): Promise<SecretRotationResult>;
|
|
30
|
+
rotateSecret(reference: SecretReference, payload: SecretWritePayload): Promise<SecretRotationResult>;
|
|
31
|
+
deleteSecret(reference: SecretReference): Promise<void>;
|
|
32
|
+
private parseReference;
|
|
33
|
+
private createSecret;
|
|
34
|
+
private createSecretVersion;
|
|
35
|
+
private buildReference;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { ScalewaySecretManagerProvider };
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { SecretProviderError, normalizeSecretPayload, parseSecretUri } from "./provider.js";
|
|
2
|
+
import { Buffer } from "node:buffer";
|
|
3
|
+
|
|
4
|
+
//#region src/integrations/secrets/scaleway-secret-manager.ts
|
|
5
|
+
const UUID_V4_LIKE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
6
|
+
var ScalewaySecretManagerProvider = class {
|
|
7
|
+
id = "scaleway-secret-manager";
|
|
8
|
+
token;
|
|
9
|
+
defaultRegion;
|
|
10
|
+
defaultProjectId;
|
|
11
|
+
baseUrl;
|
|
12
|
+
fetchFn;
|
|
13
|
+
constructor(options = {}) {
|
|
14
|
+
this.token = options.token ?? process.env.SCW_SECRET_KEY ?? process.env.SCALEWAY_SECRET_KEY ?? "";
|
|
15
|
+
this.defaultRegion = options.defaultRegion ?? process.env.SCW_DEFAULT_REGION ?? process.env.SCW_REGION;
|
|
16
|
+
this.defaultProjectId = options.defaultProjectId ?? process.env.SCW_DEFAULT_PROJECT_ID ?? process.env.SCW_PROJECT_ID;
|
|
17
|
+
this.baseUrl = options.baseUrl ?? "https://api.scaleway.com";
|
|
18
|
+
this.fetchFn = options.fetch ?? fetch;
|
|
19
|
+
}
|
|
20
|
+
canHandle(reference) {
|
|
21
|
+
try {
|
|
22
|
+
const parsed = parseSecretUri(reference);
|
|
23
|
+
return parsed.provider === "scw" && (parsed.path === "secret-manager" || parsed.path.startsWith("secret-manager/"));
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async getSecret(reference, options) {
|
|
29
|
+
const location = this.parseReference(reference);
|
|
30
|
+
if (!this.token) throw new SecretProviderError({
|
|
31
|
+
message: "Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).",
|
|
32
|
+
provider: this.id,
|
|
33
|
+
reference,
|
|
34
|
+
code: "FORBIDDEN"
|
|
35
|
+
});
|
|
36
|
+
if (!UUID_V4_LIKE.test(location.secretIdOrName)) throw new SecretProviderError({
|
|
37
|
+
message: "Scaleway getSecret requires a secretId (uuid) reference, not a secret name.",
|
|
38
|
+
provider: this.id,
|
|
39
|
+
reference,
|
|
40
|
+
code: "INVALID"
|
|
41
|
+
});
|
|
42
|
+
const revision = options?.version ?? location.revision ?? "latest";
|
|
43
|
+
const url = `${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(location.region)}/secrets/${encodeURIComponent(location.secretIdOrName)}/versions/${encodeURIComponent(revision)}/access`;
|
|
44
|
+
const response = await this.fetchFn(url, {
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers: { "X-Auth-Token": this.token }
|
|
47
|
+
});
|
|
48
|
+
if (!response.ok) throw await toScalewayError({
|
|
49
|
+
response,
|
|
50
|
+
provider: this.id,
|
|
51
|
+
reference,
|
|
52
|
+
operation: "getSecret"
|
|
53
|
+
});
|
|
54
|
+
const dataB64 = extractScalewayData(await response.json());
|
|
55
|
+
return {
|
|
56
|
+
data: Buffer.from(dataB64, "base64"),
|
|
57
|
+
version: revision,
|
|
58
|
+
metadata: {
|
|
59
|
+
region: location.region,
|
|
60
|
+
secretId: location.secretIdOrName
|
|
61
|
+
},
|
|
62
|
+
retrievedAt: /* @__PURE__ */ new Date()
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async setSecret(reference, payload) {
|
|
66
|
+
const location = this.parseReference(reference);
|
|
67
|
+
if (!this.token) throw new SecretProviderError({
|
|
68
|
+
message: "Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).",
|
|
69
|
+
provider: this.id,
|
|
70
|
+
reference,
|
|
71
|
+
code: "FORBIDDEN"
|
|
72
|
+
});
|
|
73
|
+
const bytes = normalizeSecretPayload(payload);
|
|
74
|
+
const encoded = Buffer.from(bytes).toString("base64");
|
|
75
|
+
const secretId = UUID_V4_LIKE.test(location.secretIdOrName) ? location.secretIdOrName : await this.createSecret({
|
|
76
|
+
region: location.region,
|
|
77
|
+
name: location.secretIdOrName,
|
|
78
|
+
reference
|
|
79
|
+
});
|
|
80
|
+
const version = await this.createSecretVersion({
|
|
81
|
+
region: location.region,
|
|
82
|
+
secretId,
|
|
83
|
+
dataB64: encoded,
|
|
84
|
+
reference
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
reference: this.buildReference(location.region, secretId, { version }),
|
|
88
|
+
version
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
async rotateSecret(reference, payload) {
|
|
92
|
+
return this.setSecret(reference, payload);
|
|
93
|
+
}
|
|
94
|
+
async deleteSecret(reference) {
|
|
95
|
+
const location = this.parseReference(reference);
|
|
96
|
+
if (!this.token) throw new SecretProviderError({
|
|
97
|
+
message: "Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).",
|
|
98
|
+
provider: this.id,
|
|
99
|
+
reference,
|
|
100
|
+
code: "FORBIDDEN"
|
|
101
|
+
});
|
|
102
|
+
if (!UUID_V4_LIKE.test(location.secretIdOrName)) throw new SecretProviderError({
|
|
103
|
+
message: "Scaleway deleteSecret requires a secretId (uuid) reference, not a secret name.",
|
|
104
|
+
provider: this.id,
|
|
105
|
+
reference,
|
|
106
|
+
code: "INVALID"
|
|
107
|
+
});
|
|
108
|
+
const url = `${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(location.region)}/secrets/${encodeURIComponent(location.secretIdOrName)}`;
|
|
109
|
+
const response = await this.fetchFn(url, {
|
|
110
|
+
method: "DELETE",
|
|
111
|
+
headers: { "X-Auth-Token": this.token }
|
|
112
|
+
});
|
|
113
|
+
if (!response.ok) throw await toScalewayError({
|
|
114
|
+
response,
|
|
115
|
+
provider: this.id,
|
|
116
|
+
reference,
|
|
117
|
+
operation: "deleteSecret"
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
parseReference(reference) {
|
|
121
|
+
const parsed = parseSecretUri(reference);
|
|
122
|
+
if (parsed.provider !== "scw") throw new SecretProviderError({
|
|
123
|
+
message: `Unsupported secret provider: ${parsed.provider}`,
|
|
124
|
+
provider: this.id,
|
|
125
|
+
reference,
|
|
126
|
+
code: "INVALID"
|
|
127
|
+
});
|
|
128
|
+
const segments = parsed.path.split("/").filter(Boolean);
|
|
129
|
+
if (segments.length < 2 || segments[0] !== "secret-manager") throw new SecretProviderError({
|
|
130
|
+
message: "Expected secret reference format scw://secret-manager/{region}/{secretIdOrName}[?version=...]",
|
|
131
|
+
provider: this.id,
|
|
132
|
+
reference,
|
|
133
|
+
code: "INVALID"
|
|
134
|
+
});
|
|
135
|
+
const region = segments[1] ?? this.defaultRegion;
|
|
136
|
+
if (!region) throw new SecretProviderError({
|
|
137
|
+
message: "Scaleway region must be provided either in reference (scw://secret-manager/{region}/...) or via SCW_DEFAULT_REGION/SCW_REGION.",
|
|
138
|
+
provider: this.id,
|
|
139
|
+
reference,
|
|
140
|
+
code: "INVALID"
|
|
141
|
+
});
|
|
142
|
+
const secretIdOrName = segments.slice(2).join("/");
|
|
143
|
+
if (!secretIdOrName) throw new SecretProviderError({
|
|
144
|
+
message: `Unable to resolve secret id/name from reference "${parsed.path}"`,
|
|
145
|
+
provider: this.id,
|
|
146
|
+
reference,
|
|
147
|
+
code: "INVALID"
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
region,
|
|
151
|
+
secretIdOrName,
|
|
152
|
+
revision: parsed.extras?.version
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async createSecret(params) {
|
|
156
|
+
const projectId = this.defaultProjectId;
|
|
157
|
+
if (!projectId) throw new SecretProviderError({
|
|
158
|
+
message: "Scaleway project id is required to create secrets by name (set SCW_DEFAULT_PROJECT_ID/SCW_PROJECT_ID).",
|
|
159
|
+
provider: this.id,
|
|
160
|
+
reference: params.reference,
|
|
161
|
+
code: "INVALID"
|
|
162
|
+
});
|
|
163
|
+
const url = `${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(params.region)}/secrets`;
|
|
164
|
+
const response = await this.fetchFn(url, {
|
|
165
|
+
method: "POST",
|
|
166
|
+
headers: {
|
|
167
|
+
"Content-Type": "application/json",
|
|
168
|
+
"X-Auth-Token": this.token
|
|
169
|
+
},
|
|
170
|
+
body: JSON.stringify({
|
|
171
|
+
name: params.name,
|
|
172
|
+
project_id: projectId
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
if (!response.ok) throw await toScalewayError({
|
|
176
|
+
response,
|
|
177
|
+
provider: this.id,
|
|
178
|
+
reference: params.reference,
|
|
179
|
+
operation: "createSecret"
|
|
180
|
+
});
|
|
181
|
+
return extractScalewaySecretId(await response.json());
|
|
182
|
+
}
|
|
183
|
+
async createSecretVersion(params) {
|
|
184
|
+
const url = `${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(params.region)}/secrets/${encodeURIComponent(params.secretId)}/versions`;
|
|
185
|
+
const response = await this.fetchFn(url, {
|
|
186
|
+
method: "POST",
|
|
187
|
+
headers: {
|
|
188
|
+
"Content-Type": "application/json",
|
|
189
|
+
"X-Auth-Token": this.token
|
|
190
|
+
},
|
|
191
|
+
body: JSON.stringify({ data: params.dataB64 })
|
|
192
|
+
});
|
|
193
|
+
if (!response.ok) throw await toScalewayError({
|
|
194
|
+
response,
|
|
195
|
+
provider: this.id,
|
|
196
|
+
reference: params.reference,
|
|
197
|
+
operation: "createSecretVersion"
|
|
198
|
+
});
|
|
199
|
+
return extractScalewayRevision(await response.json()) ?? "latest";
|
|
200
|
+
}
|
|
201
|
+
buildReference(region, secretId, extras) {
|
|
202
|
+
const base = `scw://secret-manager/${region}/${secretId}`;
|
|
203
|
+
const query = extras ? Object.entries(extras).filter(([, value]) => Boolean(value)).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&") : "";
|
|
204
|
+
return query ? `${base}?${query}` : base;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
function extractScalewayData(payload) {
|
|
208
|
+
if (!payload || typeof payload !== "object") throw new Error("Invalid scaleway secret payload");
|
|
209
|
+
const record = payload;
|
|
210
|
+
if (typeof record.data === "string" && record.data) return record.data;
|
|
211
|
+
throw new Error("Scaleway secret payload is missing data");
|
|
212
|
+
}
|
|
213
|
+
function extractScalewaySecretId(payload) {
|
|
214
|
+
if (!payload || typeof payload !== "object") throw new Error("Invalid scaleway createSecret payload");
|
|
215
|
+
const record = payload;
|
|
216
|
+
if (typeof record.id === "string" && record.id) return record.id;
|
|
217
|
+
throw new Error("Scaleway createSecret response is missing id");
|
|
218
|
+
}
|
|
219
|
+
function extractScalewayRevision(payload) {
|
|
220
|
+
if (!payload || typeof payload !== "object") return;
|
|
221
|
+
const record = payload;
|
|
222
|
+
if (typeof record.revision === "number") return String(record.revision);
|
|
223
|
+
if (typeof record.revision === "string" && record.revision) return record.revision;
|
|
224
|
+
if (typeof record.id === "string" && record.id) return record.id;
|
|
225
|
+
}
|
|
226
|
+
async function toScalewayError(params) {
|
|
227
|
+
const { response, provider, reference, operation } = params;
|
|
228
|
+
const code = response.status === 404 ? "NOT_FOUND" : response.status === 401 || response.status === 403 ? "FORBIDDEN" : response.status >= 400 && response.status < 500 ? "INVALID" : "UNKNOWN";
|
|
229
|
+
const bodyText = await safeReadBody(response);
|
|
230
|
+
return new SecretProviderError({
|
|
231
|
+
message: bodyText ? `Scaleway Secret Manager ${operation} failed (${response.status}): ${bodyText}` : `Scaleway Secret Manager ${operation} failed (${response.status})`,
|
|
232
|
+
provider,
|
|
233
|
+
reference,
|
|
234
|
+
code
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
async function safeReadBody(response) {
|
|
238
|
+
try {
|
|
239
|
+
const trimmed = (await response.text()).trim();
|
|
240
|
+
return trimmed.length ? trimmed : void 0;
|
|
241
|
+
} catch {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
//#endregion
|
|
247
|
+
export { ScalewaySecretManagerProvider };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/integrations/secrets-types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Secret Provider types for integrations
|
|
4
|
+
* These are core type definitions that don't require runtime dependencies.
|
|
5
|
+
*/
|
|
6
|
+
interface SecretValue {
|
|
7
|
+
data: Uint8Array;
|
|
8
|
+
version?: string;
|
|
9
|
+
metadata?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
interface SecretProvider {
|
|
12
|
+
id: string;
|
|
13
|
+
canHandle(reference: string): boolean;
|
|
14
|
+
getSecret(reference: string): Promise<SecretValue>;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { SecretProvider, SecretValue };
|
|
File without changes
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { OwnerShipMeta } from "../ownership.js";
|
|
2
|
+
import { CapabilityRef, CapabilityRequirement } from "../capabilities/capabilities.js";
|
|
3
|
+
import "../capabilities/index.js";
|
|
4
|
+
|
|
5
|
+
//#region src/integrations/spec.d.ts
|
|
6
|
+
type IntegrationCategory = 'payments' | 'email' | 'calendar' | 'sms' | 'ai-llm' | 'ai-voice' | 'speech-to-text' | 'vector-db' | 'storage' | 'accounting' | 'crm' | 'helpdesk' | 'open-banking' | 'custom';
|
|
7
|
+
type IntegrationOwnershipMode = 'managed' | 'byok';
|
|
8
|
+
interface IntegrationMeta extends OwnerShipMeta {
|
|
9
|
+
category: IntegrationCategory;
|
|
10
|
+
}
|
|
11
|
+
interface IntegrationCapabilityMapping {
|
|
12
|
+
/** Which CapabilitySpec this integration provides. */
|
|
13
|
+
provides: CapabilityRef[];
|
|
14
|
+
/** Optional: which capabilities it requires (e.g., storage for caching). */
|
|
15
|
+
requires?: CapabilityRequirement[];
|
|
16
|
+
}
|
|
17
|
+
interface IntegrationConfigSchema {
|
|
18
|
+
/** JSON Schema or SchemaModel defining required config fields. */
|
|
19
|
+
schema: unknown;
|
|
20
|
+
/** Example configuration (for docs/UI). */
|
|
21
|
+
example?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
interface IntegrationSecretSchema {
|
|
24
|
+
/** JSON Schema or SchemaModel describing secret fields. */
|
|
25
|
+
schema: unknown;
|
|
26
|
+
/** Redacted example for documentation/UI. */
|
|
27
|
+
example?: Record<string, string>;
|
|
28
|
+
}
|
|
29
|
+
interface IntegrationByokSetup {
|
|
30
|
+
/** Human-readable instructions for tenants configuring BYOK accounts. */
|
|
31
|
+
setupInstructions?: string;
|
|
32
|
+
/** Required scopes/permissions for BYOK accounts. */
|
|
33
|
+
requiredScopes?: string[];
|
|
34
|
+
}
|
|
35
|
+
interface IntegrationHealthCheck {
|
|
36
|
+
/** Endpoint or method to validate connection health. */
|
|
37
|
+
method?: 'ping' | 'list' | 'custom';
|
|
38
|
+
/** Timeout in ms for health check. */
|
|
39
|
+
timeoutMs?: number;
|
|
40
|
+
}
|
|
41
|
+
interface IntegrationSpec {
|
|
42
|
+
meta: IntegrationMeta;
|
|
43
|
+
/** Supported ownership modes for this provider. */
|
|
44
|
+
supportedModes: IntegrationOwnershipMode[];
|
|
45
|
+
/** Which capabilities this integration provides/requires. */
|
|
46
|
+
capabilities: IntegrationCapabilityMapping;
|
|
47
|
+
/** Configuration schema (API keys, endpoints, etc.). */
|
|
48
|
+
configSchema: IntegrationConfigSchema;
|
|
49
|
+
/** Secret schema (API/key material stored via secretRef). */
|
|
50
|
+
secretSchema: IntegrationSecretSchema;
|
|
51
|
+
/** Optional health check configuration. */
|
|
52
|
+
healthCheck?: IntegrationHealthCheck;
|
|
53
|
+
/** Documentation URL. */
|
|
54
|
+
docsUrl?: string;
|
|
55
|
+
/** Rate limits or usage constraints. */
|
|
56
|
+
constraints?: {
|
|
57
|
+
rateLimit?: {
|
|
58
|
+
rpm?: number;
|
|
59
|
+
rph?: number;
|
|
60
|
+
};
|
|
61
|
+
quotas?: Record<string, number>;
|
|
62
|
+
};
|
|
63
|
+
/** Provider-specific metadata for BYOK setup flows. */
|
|
64
|
+
byokSetup?: IntegrationByokSetup;
|
|
65
|
+
}
|
|
66
|
+
declare class IntegrationSpecRegistry {
|
|
67
|
+
private readonly items;
|
|
68
|
+
register(spec: IntegrationSpec): this;
|
|
69
|
+
list(): IntegrationSpec[];
|
|
70
|
+
get(key: string, version?: number): IntegrationSpec | undefined;
|
|
71
|
+
getByCategory(category: IntegrationCategory): IntegrationSpec[];
|
|
72
|
+
}
|
|
73
|
+
declare function makeIntegrationSpecKey(meta: IntegrationMeta): string;
|
|
74
|
+
//#endregion
|
|
75
|
+
export { IntegrationByokSetup, IntegrationCapabilityMapping, IntegrationCategory, IntegrationConfigSchema, IntegrationHealthCheck, IntegrationMeta, IntegrationOwnershipMode, IntegrationSecretSchema, IntegrationSpec, IntegrationSpecRegistry, makeIntegrationSpecKey };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region src/integrations/spec.ts
|
|
2
|
+
const integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
3
|
+
var IntegrationSpecRegistry = class {
|
|
4
|
+
items = /* @__PURE__ */ new Map();
|
|
5
|
+
register(spec) {
|
|
6
|
+
const key = integrationKey(spec.meta);
|
|
7
|
+
if (this.items.has(key)) throw new Error(`Duplicate IntegrationSpec ${key}`);
|
|
8
|
+
this.items.set(key, spec);
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
11
|
+
list() {
|
|
12
|
+
return [...this.items.values()];
|
|
13
|
+
}
|
|
14
|
+
get(key, version) {
|
|
15
|
+
if (version != null) return this.items.get(integrationKey({
|
|
16
|
+
key,
|
|
17
|
+
version
|
|
18
|
+
}));
|
|
19
|
+
let latest;
|
|
20
|
+
let maxVersion = -Infinity;
|
|
21
|
+
for (const spec of this.items.values()) {
|
|
22
|
+
if (spec.meta.key !== key) continue;
|
|
23
|
+
if (spec.meta.version > maxVersion) {
|
|
24
|
+
maxVersion = spec.meta.version;
|
|
25
|
+
latest = spec;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return latest;
|
|
29
|
+
}
|
|
30
|
+
getByCategory(category) {
|
|
31
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function makeIntegrationSpecKey(meta) {
|
|
35
|
+
return integrationKey(meta);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { IntegrationSpecRegistry, makeIntegrationSpecKey };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Job, JobQueue } from "./queue.js";
|
|
2
|
+
import { ZodSchema } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/jobs/define-job.d.ts
|
|
5
|
+
interface DefinedJob<TPayload> {
|
|
6
|
+
type: string;
|
|
7
|
+
schema: ZodSchema<TPayload>;
|
|
8
|
+
handler: (payload: TPayload, job: Job<TPayload>) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Register a `DefinedJob` on a queue with payload validation.
|
|
12
|
+
*
|
|
13
|
+
* - Parses and validates payload via the job's Zod schema
|
|
14
|
+
* - Invokes the defined handler with the validated payload
|
|
15
|
+
*/
|
|
16
|
+
declare function registerDefinedJob<TPayload>(queue: JobQueue, job: DefinedJob<TPayload>): void;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DefinedJob, registerDefinedJob };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/jobs/define-job.ts
|
|
2
|
+
/**
|
|
3
|
+
* Register a `DefinedJob` on a queue with payload validation.
|
|
4
|
+
*
|
|
5
|
+
* - Parses and validates payload via the job's Zod schema
|
|
6
|
+
* - Invokes the defined handler with the validated payload
|
|
7
|
+
*/
|
|
8
|
+
function registerDefinedJob(queue, job) {
|
|
9
|
+
queue.register(job.type, async (queuedJob) => {
|
|
10
|
+
const parsed = job.schema.parse(queuedJob.payload);
|
|
11
|
+
await job.handler(parsed, queuedJob);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { registerDefinedJob };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EnqueueOptions, Job, JobHandler, JobQueue } from "./queue.js";
|
|
2
|
+
|
|
3
|
+
//#region src/jobs/gcp-cloud-tasks.d.ts
|
|
4
|
+
interface CloudTasksClientLike {
|
|
5
|
+
createTask(request: {
|
|
6
|
+
parent: string;
|
|
7
|
+
task: {
|
|
8
|
+
httpRequest: {
|
|
9
|
+
httpMethod: number | string;
|
|
10
|
+
url: string;
|
|
11
|
+
body: Buffer;
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
oidcToken?: {
|
|
14
|
+
serviceAccountEmail: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
scheduleTime?: {
|
|
18
|
+
seconds: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}): Promise<unknown>;
|
|
22
|
+
}
|
|
23
|
+
interface GcpCloudTasksQueueOptions {
|
|
24
|
+
client: CloudTasksClientLike;
|
|
25
|
+
projectId: string;
|
|
26
|
+
location: string;
|
|
27
|
+
queue: string;
|
|
28
|
+
resolveUrl(jobType: string): string;
|
|
29
|
+
serviceAccountEmail?: string;
|
|
30
|
+
}
|
|
31
|
+
declare class GcpCloudTasksQueue implements JobQueue {
|
|
32
|
+
private readonly options;
|
|
33
|
+
private readonly handlers;
|
|
34
|
+
constructor(options: GcpCloudTasksQueueOptions);
|
|
35
|
+
enqueue<TPayload>(jobType: string, payload: TPayload, options?: EnqueueOptions): Promise<Job<TPayload>>;
|
|
36
|
+
register<TPayload, TResult = void>(jobType: string, handler: JobHandler<TPayload, TResult>): void;
|
|
37
|
+
start(): void;
|
|
38
|
+
stop(): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { GcpCloudTasksQueue, GcpCloudTasksQueueOptions };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { DEFAULT_RETRY_POLICY } from "./queue.js";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
|
|
4
|
+
//#region src/jobs/gcp-cloud-tasks.ts
|
|
5
|
+
var GcpCloudTasksQueue = class {
|
|
6
|
+
handlers = /* @__PURE__ */ new Map();
|
|
7
|
+
constructor(options) {
|
|
8
|
+
this.options = options;
|
|
9
|
+
}
|
|
10
|
+
async enqueue(jobType, payload, options = {}) {
|
|
11
|
+
const enqueueTime = options.delaySeconds != null ? { seconds: Math.floor(Date.now() / 1e3) + options.delaySeconds } : void 0;
|
|
12
|
+
const body = Buffer.from(JSON.stringify({
|
|
13
|
+
id: randomUUID(),
|
|
14
|
+
type: jobType,
|
|
15
|
+
payload
|
|
16
|
+
}), "utf-8");
|
|
17
|
+
await this.options.client.createTask({
|
|
18
|
+
parent: `projects/${this.options.projectId}/locations/${this.options.location}/queues/${this.options.queue}`,
|
|
19
|
+
task: {
|
|
20
|
+
httpRequest: {
|
|
21
|
+
httpMethod: "POST",
|
|
22
|
+
url: this.options.resolveUrl(jobType),
|
|
23
|
+
body,
|
|
24
|
+
headers: { "Content-Type": "application/json" },
|
|
25
|
+
oidcToken: this.options.serviceAccountEmail ? { serviceAccountEmail: this.options.serviceAccountEmail } : void 0
|
|
26
|
+
},
|
|
27
|
+
scheduleTime: enqueueTime
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
id: randomUUID(),
|
|
32
|
+
type: jobType,
|
|
33
|
+
version: 1,
|
|
34
|
+
payload,
|
|
35
|
+
status: "pending",
|
|
36
|
+
priority: options.priority ?? 0,
|
|
37
|
+
attempts: 0,
|
|
38
|
+
maxRetries: options.maxRetries ?? DEFAULT_RETRY_POLICY.maxRetries,
|
|
39
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
40
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
register(jobType, handler) {
|
|
44
|
+
this.handlers.set(jobType, handler);
|
|
45
|
+
}
|
|
46
|
+
start() {}
|
|
47
|
+
async stop() {
|
|
48
|
+
this.handlers.clear();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { GcpCloudTasksQueue };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EnqueueOptions, Job, JobHandler, JobQueue } from "./queue.js";
|
|
2
|
+
|
|
3
|
+
//#region src/jobs/gcp-pubsub.d.ts
|
|
4
|
+
interface PubSubClientLike {
|
|
5
|
+
topic(name: string): {
|
|
6
|
+
publishMessage(message: {
|
|
7
|
+
data: Buffer;
|
|
8
|
+
}): Promise<string>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface GcpPubSubQueueOptions {
|
|
12
|
+
client: PubSubClientLike;
|
|
13
|
+
topicName: string;
|
|
14
|
+
}
|
|
15
|
+
declare class GcpPubSubQueue implements JobQueue {
|
|
16
|
+
private readonly options;
|
|
17
|
+
private readonly handlers;
|
|
18
|
+
constructor(options: GcpPubSubQueueOptions);
|
|
19
|
+
enqueue<TPayload>(jobType: string, payload: TPayload, options?: EnqueueOptions): Promise<Job<TPayload>>;
|
|
20
|
+
register<TPayload, TResult = void>(jobType: string, handler: JobHandler<TPayload, TResult>): void;
|
|
21
|
+
start(): void;
|
|
22
|
+
stop(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { GcpPubSubQueue, GcpPubSubQueueOptions };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DEFAULT_RETRY_POLICY } from "./queue.js";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
|
|
4
|
+
//#region src/jobs/gcp-pubsub.ts
|
|
5
|
+
var GcpPubSubQueue = class {
|
|
6
|
+
handlers = /* @__PURE__ */ new Map();
|
|
7
|
+
constructor(options) {
|
|
8
|
+
this.options = options;
|
|
9
|
+
}
|
|
10
|
+
async enqueue(jobType, payload, options = {}) {
|
|
11
|
+
await this.options.client.topic(this.options.topicName).publishMessage({ data: Buffer.from(JSON.stringify({
|
|
12
|
+
id: randomUUID(),
|
|
13
|
+
type: jobType,
|
|
14
|
+
payload
|
|
15
|
+
}), "utf-8") });
|
|
16
|
+
return {
|
|
17
|
+
id: randomUUID(),
|
|
18
|
+
type: jobType,
|
|
19
|
+
version: 1,
|
|
20
|
+
payload,
|
|
21
|
+
status: "pending",
|
|
22
|
+
priority: options.priority ?? 0,
|
|
23
|
+
attempts: 0,
|
|
24
|
+
maxRetries: options.maxRetries ?? DEFAULT_RETRY_POLICY.maxRetries,
|
|
25
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
26
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
register(jobType, handler) {
|
|
30
|
+
this.handlers.set(jobType, handler);
|
|
31
|
+
}
|
|
32
|
+
start() {}
|
|
33
|
+
async stop() {
|
|
34
|
+
this.handlers.clear();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { GcpPubSubQueue };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EmailThreadListQuery } from "../../integrations/providers/email.js";
|
|
2
|
+
import { JobHandler } from "../queue.js";
|
|
3
|
+
import { GmailIngestionAdapter } from "../../knowledge/ingestion/gmail-adapter.js";
|
|
4
|
+
|
|
5
|
+
//#region src/jobs/handlers/gmail-sync-handler.d.ts
|
|
6
|
+
type GmailSyncJobPayload = EmailThreadListQuery;
|
|
7
|
+
declare function createGmailSyncHandler(adapter: GmailIngestionAdapter): JobHandler<GmailSyncJobPayload>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { GmailSyncJobPayload, createGmailSyncHandler };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JobQueue } from "../queue.js";
|
|
2
|
+
import { GmailSyncJobPayload, createGmailSyncHandler } from "./gmail-sync-handler.js";
|
|
3
|
+
import { PING_JOB_TYPE, PingPayload, PingPayloadSchema, pingJob } from "./ping-handler.js";
|
|
4
|
+
import { StorageDocumentJobPayload, createStorageDocumentHandler } from "./storage-document-handler.js";
|
|
5
|
+
|
|
6
|
+
//#region src/jobs/handlers/index.d.ts
|
|
7
|
+
declare function registerAllJobs(queue: JobQueue): void;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { GmailSyncJobPayload, PING_JOB_TYPE, PingPayload, PingPayloadSchema, StorageDocumentJobPayload, createGmailSyncHandler, createStorageDocumentHandler, pingJob, registerAllJobs };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { registerDefinedJob } from "../define-job.js";
|
|
2
|
+
import { createGmailSyncHandler } from "./gmail-sync-handler.js";
|
|
3
|
+
import { PING_JOB_TYPE, PingPayloadSchema, pingJob } from "./ping-handler.js";
|
|
4
|
+
import { createStorageDocumentHandler } from "./storage-document-handler.js";
|
|
5
|
+
|
|
6
|
+
//#region src/jobs/handlers/index.ts
|
|
7
|
+
function registerAllJobs(queue) {
|
|
8
|
+
registerDefinedJob(queue, pingJob);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PING_JOB_TYPE, PingPayloadSchema, createGmailSyncHandler, createStorageDocumentHandler, pingJob, registerAllJobs };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DefinedJob } from "../define-job.js";
|
|
2
|
+
import * as z$1 from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/jobs/handlers/ping-handler.d.ts
|
|
5
|
+
declare const PING_JOB_TYPE: "core.ping";
|
|
6
|
+
declare const PingPayloadSchema: z$1.ZodObject<{}, z$1.core.$strip>;
|
|
7
|
+
type PingPayload = z$1.infer<typeof PingPayloadSchema>;
|
|
8
|
+
declare const pingJob: DefinedJob<PingPayload>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { PING_JOB_TYPE, PingPayload, PingPayloadSchema, pingJob };
|