@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,124 @@
|
|
|
1
|
+
import { ContractRegistryItem, ContractRegistryManifest } from "./types.js";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/contract-registry/schemas.d.ts
|
|
5
|
+
declare const ContractRegistryItemTypeSchema: z.ZodEnum<{
|
|
6
|
+
"contractspec:operation": "contractspec:operation";
|
|
7
|
+
"contractspec:event": "contractspec:event";
|
|
8
|
+
"contractspec:presentation": "contractspec:presentation";
|
|
9
|
+
"contractspec:form": "contractspec:form";
|
|
10
|
+
"contractspec:feature": "contractspec:feature";
|
|
11
|
+
"contractspec:workflow": "contractspec:workflow";
|
|
12
|
+
"contractspec:template": "contractspec:template";
|
|
13
|
+
"contractspec:integration": "contractspec:integration";
|
|
14
|
+
"contractspec:data-view": "contractspec:data-view";
|
|
15
|
+
"contractspec:migration": "contractspec:migration";
|
|
16
|
+
"contractspec:telemetry": "contractspec:telemetry";
|
|
17
|
+
"contractspec:experiment": "contractspec:experiment";
|
|
18
|
+
"contractspec:app-config": "contractspec:app-config";
|
|
19
|
+
"contractspec:knowledge": "contractspec:knowledge";
|
|
20
|
+
}>;
|
|
21
|
+
declare const ContractRegistryFileSchema: z.ZodObject<{
|
|
22
|
+
path: z.ZodString;
|
|
23
|
+
type: z.ZodString;
|
|
24
|
+
content: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
declare const ContractRegistryItemSchema: z.ZodObject<{
|
|
27
|
+
key: z.ZodString;
|
|
28
|
+
type: z.ZodEnum<{
|
|
29
|
+
"contractspec:operation": "contractspec:operation";
|
|
30
|
+
"contractspec:event": "contractspec:event";
|
|
31
|
+
"contractspec:presentation": "contractspec:presentation";
|
|
32
|
+
"contractspec:form": "contractspec:form";
|
|
33
|
+
"contractspec:feature": "contractspec:feature";
|
|
34
|
+
"contractspec:workflow": "contractspec:workflow";
|
|
35
|
+
"contractspec:template": "contractspec:template";
|
|
36
|
+
"contractspec:integration": "contractspec:integration";
|
|
37
|
+
"contractspec:data-view": "contractspec:data-view";
|
|
38
|
+
"contractspec:migration": "contractspec:migration";
|
|
39
|
+
"contractspec:telemetry": "contractspec:telemetry";
|
|
40
|
+
"contractspec:experiment": "contractspec:experiment";
|
|
41
|
+
"contractspec:app-config": "contractspec:app-config";
|
|
42
|
+
"contractspec:knowledge": "contractspec:knowledge";
|
|
43
|
+
}>;
|
|
44
|
+
version: z.ZodNumber;
|
|
45
|
+
title: z.ZodString;
|
|
46
|
+
description: z.ZodString;
|
|
47
|
+
meta: z.ZodObject<{
|
|
48
|
+
stability: z.ZodEnum<{
|
|
49
|
+
experimental: "experimental";
|
|
50
|
+
beta: "beta";
|
|
51
|
+
stable: "stable";
|
|
52
|
+
deprecated: "deprecated";
|
|
53
|
+
idea: "idea";
|
|
54
|
+
in_creation: "in_creation";
|
|
55
|
+
}>;
|
|
56
|
+
owners: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
57
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
files: z.ZodArray<z.ZodObject<{
|
|
62
|
+
path: z.ZodString;
|
|
63
|
+
type: z.ZodString;
|
|
64
|
+
content: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
schema: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
68
|
+
output: z.ZodOptional<z.ZodUnknown>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
declare const ContractRegistryManifestSchema: z.ZodObject<{
|
|
72
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
75
|
+
items: z.ZodArray<z.ZodObject<{
|
|
76
|
+
key: z.ZodString;
|
|
77
|
+
type: z.ZodEnum<{
|
|
78
|
+
"contractspec:operation": "contractspec:operation";
|
|
79
|
+
"contractspec:event": "contractspec:event";
|
|
80
|
+
"contractspec:presentation": "contractspec:presentation";
|
|
81
|
+
"contractspec:form": "contractspec:form";
|
|
82
|
+
"contractspec:feature": "contractspec:feature";
|
|
83
|
+
"contractspec:workflow": "contractspec:workflow";
|
|
84
|
+
"contractspec:template": "contractspec:template";
|
|
85
|
+
"contractspec:integration": "contractspec:integration";
|
|
86
|
+
"contractspec:data-view": "contractspec:data-view";
|
|
87
|
+
"contractspec:migration": "contractspec:migration";
|
|
88
|
+
"contractspec:telemetry": "contractspec:telemetry";
|
|
89
|
+
"contractspec:experiment": "contractspec:experiment";
|
|
90
|
+
"contractspec:app-config": "contractspec:app-config";
|
|
91
|
+
"contractspec:knowledge": "contractspec:knowledge";
|
|
92
|
+
}>;
|
|
93
|
+
version: z.ZodNumber;
|
|
94
|
+
title: z.ZodString;
|
|
95
|
+
description: z.ZodString;
|
|
96
|
+
meta: z.ZodObject<{
|
|
97
|
+
stability: z.ZodEnum<{
|
|
98
|
+
experimental: "experimental";
|
|
99
|
+
beta: "beta";
|
|
100
|
+
stable: "stable";
|
|
101
|
+
deprecated: "deprecated";
|
|
102
|
+
idea: "idea";
|
|
103
|
+
in_creation: "in_creation";
|
|
104
|
+
}>;
|
|
105
|
+
owners: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
106
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
109
|
+
registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
110
|
+
files: z.ZodArray<z.ZodObject<{
|
|
111
|
+
path: z.ZodString;
|
|
112
|
+
type: z.ZodString;
|
|
113
|
+
content: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
schema: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
117
|
+
output: z.ZodOptional<z.ZodUnknown>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
type ContractRegistryItemParsed = z.infer<typeof ContractRegistryItemSchema> & ContractRegistryItem;
|
|
122
|
+
type ContractRegistryManifestParsed = z.infer<typeof ContractRegistryManifestSchema> & ContractRegistryManifest;
|
|
123
|
+
//#endregion
|
|
124
|
+
export { ContractRegistryFileSchema, ContractRegistryItemParsed, ContractRegistryItemSchema, ContractRegistryItemTypeSchema, ContractRegistryManifestParsed, ContractRegistryManifestSchema };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { StabilityEnum } from "../ownership.js";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/contract-registry/schemas.ts
|
|
5
|
+
const ContractRegistryItemTypeValues = [
|
|
6
|
+
"contractspec:operation",
|
|
7
|
+
"contractspec:event",
|
|
8
|
+
"contractspec:presentation",
|
|
9
|
+
"contractspec:form",
|
|
10
|
+
"contractspec:feature",
|
|
11
|
+
"contractspec:workflow",
|
|
12
|
+
"contractspec:template",
|
|
13
|
+
"contractspec:integration",
|
|
14
|
+
"contractspec:data-view",
|
|
15
|
+
"contractspec:migration",
|
|
16
|
+
"contractspec:telemetry",
|
|
17
|
+
"contractspec:experiment",
|
|
18
|
+
"contractspec:app-config",
|
|
19
|
+
"contractspec:knowledge"
|
|
20
|
+
];
|
|
21
|
+
const ContractRegistryItemTypeSchema = z.enum(ContractRegistryItemTypeValues);
|
|
22
|
+
const ContractRegistryFileSchema = z.object({
|
|
23
|
+
path: z.string().min(1),
|
|
24
|
+
type: z.string().min(1),
|
|
25
|
+
content: z.string().optional()
|
|
26
|
+
});
|
|
27
|
+
const ContractRegistryItemSchema = z.object({
|
|
28
|
+
key: z.string().min(1),
|
|
29
|
+
type: ContractRegistryItemTypeSchema,
|
|
30
|
+
version: z.number().int().nonnegative(),
|
|
31
|
+
title: z.string().min(1),
|
|
32
|
+
description: z.string().min(1),
|
|
33
|
+
meta: z.object({
|
|
34
|
+
stability: z.enum([
|
|
35
|
+
StabilityEnum.Idea,
|
|
36
|
+
StabilityEnum.InCreation,
|
|
37
|
+
StabilityEnum.Experimental,
|
|
38
|
+
StabilityEnum.Beta,
|
|
39
|
+
StabilityEnum.Stable,
|
|
40
|
+
StabilityEnum.Deprecated
|
|
41
|
+
]),
|
|
42
|
+
owners: z.array(z.string().min(1)).default([]),
|
|
43
|
+
tags: z.array(z.string().min(1)).default([])
|
|
44
|
+
}),
|
|
45
|
+
dependencies: z.array(z.string().min(1)).optional(),
|
|
46
|
+
registryDependencies: z.array(z.string().min(1)).optional(),
|
|
47
|
+
files: z.array(ContractRegistryFileSchema).min(1),
|
|
48
|
+
schema: z.object({
|
|
49
|
+
input: z.unknown().optional(),
|
|
50
|
+
output: z.unknown().optional()
|
|
51
|
+
}).optional()
|
|
52
|
+
});
|
|
53
|
+
const ContractRegistryManifestSchema = z.object({
|
|
54
|
+
$schema: z.string().min(1).optional(),
|
|
55
|
+
name: z.string().min(1),
|
|
56
|
+
homepage: z.string().min(1).optional(),
|
|
57
|
+
items: z.array(ContractRegistryItemSchema)
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema, ContractRegistryManifestSchema };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Owner, Stability, Tag } from "../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region src/contract-registry/types.d.ts
|
|
4
|
+
type ContractRegistryItemType = 'contractspec:operation' | 'contractspec:event' | 'contractspec:presentation' | 'contractspec:form' | 'contractspec:feature' | 'contractspec:workflow' | 'contractspec:template' | 'contractspec:integration' | 'contractspec:data-view' | 'contractspec:migration' | 'contractspec:telemetry' | 'contractspec:experiment' | 'contractspec:app-config' | 'contractspec:knowledge';
|
|
5
|
+
type JsonSchema = unknown;
|
|
6
|
+
interface ContractRegistryFile {
|
|
7
|
+
/** Path relative to the registry project root */
|
|
8
|
+
path: string;
|
|
9
|
+
/**
|
|
10
|
+
* File classification (kept open-ended to remain ejectable and compatible
|
|
11
|
+
* with multiple consumers).
|
|
12
|
+
*
|
|
13
|
+
* Examples: 'registry:component', 'contractspec:spec', 'registry:lib'
|
|
14
|
+
*/
|
|
15
|
+
type: string;
|
|
16
|
+
/** Optional inline content (if serving without file hosting) */
|
|
17
|
+
content?: string;
|
|
18
|
+
}
|
|
19
|
+
interface ContractRegistryItem {
|
|
20
|
+
key: string;
|
|
21
|
+
type: ContractRegistryItemType;
|
|
22
|
+
version: number;
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
meta: {
|
|
26
|
+
stability: Stability;
|
|
27
|
+
owners: Owner[];
|
|
28
|
+
tags: Tag[];
|
|
29
|
+
};
|
|
30
|
+
dependencies?: string[];
|
|
31
|
+
registryDependencies?: string[];
|
|
32
|
+
files: ContractRegistryFile[];
|
|
33
|
+
schema?: {
|
|
34
|
+
input?: JsonSchema;
|
|
35
|
+
output?: JsonSchema;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
interface ContractRegistryManifest {
|
|
39
|
+
/** Optional JSON-schema reference for tooling */
|
|
40
|
+
$schema?: string;
|
|
41
|
+
name: string;
|
|
42
|
+
homepage?: string;
|
|
43
|
+
items: ContractRegistryItem[];
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { ContractRegistryFile, ContractRegistryItem, ContractRegistryItemType, ContractRegistryManifest, JsonSchema };
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DataViewAction, DataViewBaseConfig, DataViewConfig, DataViewDetailConfig, DataViewField, DataViewFieldFormat, DataViewFilter, DataViewGridConfig, DataViewKind, DataViewListConfig, DataViewMeta, DataViewSections, DataViewSource, DataViewStates, DataViewTableColumn, DataViewTableConfig } from "./types.js";
|
|
2
|
+
import { DataViewRef, DataViewSpec, defineDataView } from "./spec.js";
|
|
3
|
+
import { DataViewRegistry, dataViewKey } from "./registry.js";
|
|
4
|
+
import "./index.js";
|
|
5
|
+
export { DataViewAction, DataViewBaseConfig, DataViewConfig, DataViewDetailConfig, DataViewField, DataViewFieldFormat, DataViewFilter, DataViewGridConfig, DataViewKind, DataViewListConfig, DataViewMeta, DataViewRef, DataViewRegistry, DataViewSections, DataViewSource, DataViewSpec, DataViewStates, DataViewTableColumn, DataViewTableConfig, dataViewKey, defineDataView };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../../docs/registry.js";
|
|
2
|
+
|
|
3
|
+
//#region src/data-views/docs/data-views.docblock.ts
|
|
4
|
+
const tech_contracts_data_views_DocBlocks = [{
|
|
5
|
+
id: "docs.tech.contracts.data-views",
|
|
6
|
+
title: "DataViewSpec Overview",
|
|
7
|
+
summary: "`DataViewSpec` is the declarative contract for projecting entities into list/detail/table/grid experiences. Each spec ties to contract operations (`source.primary`, `source.item`) and describes how the UI should present, sort, and filter records. Host applications use the spec to render UI with shared components (`DataViewRenderer`, `DataViewList`, `DataViewTable`, `DataViewDetail`) while keeping presentation logic in a single source of truth.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/tech/contracts/data-views",
|
|
11
|
+
tags: [
|
|
12
|
+
"tech",
|
|
13
|
+
"contracts",
|
|
14
|
+
"data-views"
|
|
15
|
+
],
|
|
16
|
+
body: "# DataViewSpec Overview\n\n## Purpose\n\n`DataViewSpec` is the declarative contract for projecting entities into list/detail/table/grid experiences. Each spec ties to contract operations (`source.primary`, `source.item`) and describes how the UI should present, sort, and filter records. Host applications use the spec to render UI with shared components (`DataViewRenderer`, `DataViewList`, `DataViewTable`, `DataViewDetail`) while keeping presentation logic in a single source of truth.\n\n## Location\n\n- Type definitions and registry: `packages/libs/contracts/src/data-views.ts`\n- React renderers: `packages/libs/design-system/src/components/data-view`\n- CLI scaffolding: `contractspec create --type data-view`\n\n## Schema Highlights\n\n```ts\nexport interface DataViewSpec {\n meta: DataViewMeta; // ownership meta + { name, version, entity }\n source: DataViewSource; // contract operations and refresh events\n view: DataViewConfig; // union of list/detail/table/grid definitions\n states?: DataViewStates; // optional empty/error/loading presentations\n policy?: { flags?: string[]; pii?: string[] };\n}\n```\n\n- **DataViewMeta**: `name`, `version`, `entity`, ownership metadata (title, description, domain, owners, tags, stability).\n- **DataViewSource**:\n - `primary`: required query operation (`OpRef`) for fetching collections.\n - `item`: optional detail query (recommended for `detail` views).\n - `mutations`: optional create/update/delete operation refs.\n - `refreshEvents`: events that should trigger refresh.\n- **DataViewConfig** (union):\n - `list`: card/compact list, `primaryField`, `secondaryFields`.\n - `table`: column configuration (`columns`, alignments, density).\n - `detail`: sections of fields for record inspection.\n - `grid`: multi-column grid (rendered as card list today).\n- **DataViewField**: `key`, `label`, `dataPath`, formatting hints (`format`), sort/filter toggles, optional presentation override.\n- **DataViewFilter**: describes filter inputs (search, enum, number, date, boolean).\n- **DataViewAction**: simple declarative actions (`navigation` or `operation`).\n\n## Registry Usage\n\n```ts\nimport { DataViewRegistry } from '@contractspec/lib.contracts/data-views';\nimport { ResidentsDataView } from './data-views/residents.data-view';\n\nconst registry = new DataViewRegistry();\nregistry.register(ResidentsDataView);\n\nconst listView = registry.get('residents.admin.list');\n```\n\nRegistries guard against duplicate `(name, version)` pairs and make latest-version lookup trivial.\n\n## Rendering\n\n```tsx\nimport { DataViewRenderer } from '@contractspec/lib.design-system';\nimport { ResidentsDataView } from '../contracts/data-views/residents.data-view';\n\nfunction ResidentsTable({ rows }: { rows: Record<string, unknown>[] }) {\n return (\n <DataViewRenderer\n spec={ResidentsDataView}\n items={rows}\n onRowClick={(row) => console.log('Selected', row)}\n />\n );\n}\n```\n\nFor more control, use specific components:\n\n- `DataViewList` – friendly cards/rows\n- `DataViewTable` – tabular presentation with optional header/footers\n- `DataViewDetail` – two-column grouped layout for record inspection\n\nRenderers rely on the field definitions (`dataPath`, `format`) to extract values and render them consistently.\n\n## CLI Scaffolding\n\n```bash\n# Interactive wizard\ncontractspec create --type data-view\n\n# Generates packages/.../data-views/<name>.data-view.ts\n\n# Optional renderer scaffold\ncontractspec build path/to/<name>.data-view.ts\n# → produces <name>.renderer.tsx that wraps DataViewRenderer with sensible props\n```\n\nWizard prompts:\n- name (dot notation), version, entity\n- kind (`list`, `table`, `detail`, `grid`)\n- primary query operation (required) and optional item query\n- fields (label, data path, format, sorting/filtering)\n\n## Authoring Guidelines\n\n1. **Separation of data & presentation**: keep fetching logic inside contract operations; DataViewSpec only references them via `source`.\n2. **Versioning**: bump `meta.version` when field membership, ordering, or semantics change.\n3. **Consistency**: reuse common field keys across modules to enable shared renderers and filters.\n4. **States**: reference `PresentationRef` for empty/error/loader states to ensure consistent UX.\n5. **Actions**: prefer referencing contract operations instead of embedding business logic in the UI.\n\n## Roadmap\n\n- Derived filters from `fields.filterable` (auto-generated UI).\n- Table density presets per platform.\n- Bridge to PolicySpec for field-level visibility (Phase 2 policy expansion).\n- Automated docs/LLM sync via CLI.\n\n"
|
|
17
|
+
}];
|
|
18
|
+
registerDocBlocks(tech_contracts_data_views_DocBlocks);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { tech_contracts_data_views_DocBlocks };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataViewAction, DataViewBaseConfig, DataViewConfig, DataViewDetailConfig, DataViewField, DataViewFieldFormat, DataViewFilter, DataViewGridConfig, DataViewKind, DataViewListConfig, DataViewMeta, DataViewSections, DataViewSource, DataViewStates, DataViewTableColumn, DataViewTableConfig } from "./types.js";
|
|
2
|
+
import { DataViewRef, DataViewSpec, defineDataView } from "./spec.js";
|
|
3
|
+
import { DataViewRegistry, dataViewKey } from "./registry.js";
|
|
4
|
+
export { type DataViewAction, type DataViewBaseConfig, type DataViewConfig, type DataViewDetailConfig, type DataViewField, type DataViewFieldFormat, type DataViewFilter, type DataViewGridConfig, type DataViewKind, type DataViewListConfig, type DataViewMeta, type DataViewRef, DataViewRegistry, type DataViewSections, type DataViewSource, type DataViewSpec, type DataViewStates, type DataViewTableColumn, type DataViewTableConfig, dataViewKey, defineDataView };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DataViewSpec } from "./spec.js";
|
|
2
|
+
import "./index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/data-views/query-generator.d.ts
|
|
5
|
+
interface DataViewQueryParams {
|
|
6
|
+
filters?: Record<string, unknown>;
|
|
7
|
+
sort?: {
|
|
8
|
+
field: string;
|
|
9
|
+
direction: 'asc' | 'desc';
|
|
10
|
+
};
|
|
11
|
+
pagination?: {
|
|
12
|
+
page: number;
|
|
13
|
+
pageSize: number;
|
|
14
|
+
};
|
|
15
|
+
search?: string;
|
|
16
|
+
}
|
|
17
|
+
interface DataViewQuery {
|
|
18
|
+
operationName: string;
|
|
19
|
+
input: Record<string, unknown>;
|
|
20
|
+
meta: {
|
|
21
|
+
pagination: {
|
|
22
|
+
page: number;
|
|
23
|
+
pageSize: number;
|
|
24
|
+
skip: number;
|
|
25
|
+
take: number;
|
|
26
|
+
};
|
|
27
|
+
sorting?: {
|
|
28
|
+
field: string;
|
|
29
|
+
direction: 'asc' | 'desc';
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
declare class DataViewQueryGenerator {
|
|
34
|
+
private spec;
|
|
35
|
+
constructor(spec: DataViewSpec);
|
|
36
|
+
generate(params: DataViewQueryParams): DataViewQuery;
|
|
37
|
+
validateParams(params: DataViewQueryParams): string[];
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { DataViewQuery, DataViewQueryGenerator, DataViewQueryParams };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region src/data-views/query-generator.ts
|
|
2
|
+
var DataViewQueryGenerator = class {
|
|
3
|
+
constructor(spec) {
|
|
4
|
+
this.spec = spec;
|
|
5
|
+
}
|
|
6
|
+
generate(params) {
|
|
7
|
+
const { primary } = this.spec.source;
|
|
8
|
+
const page = params.pagination?.page ?? 1;
|
|
9
|
+
const pageSize = params.pagination?.pageSize ?? 20;
|
|
10
|
+
const skip = (page - 1) * pageSize;
|
|
11
|
+
const take = pageSize;
|
|
12
|
+
const input = {
|
|
13
|
+
skip,
|
|
14
|
+
take,
|
|
15
|
+
...params.filters
|
|
16
|
+
};
|
|
17
|
+
if (params.search) input.search = params.search;
|
|
18
|
+
if (params.sort) input.orderBy = { [params.sort.field]: params.sort.direction };
|
|
19
|
+
return {
|
|
20
|
+
operationName: primary.key,
|
|
21
|
+
input,
|
|
22
|
+
meta: {
|
|
23
|
+
pagination: {
|
|
24
|
+
page,
|
|
25
|
+
pageSize,
|
|
26
|
+
skip,
|
|
27
|
+
take
|
|
28
|
+
},
|
|
29
|
+
sorting: params.sort
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
validateParams(params) {
|
|
34
|
+
const errors = [];
|
|
35
|
+
if (params.filters && this.spec.view.filters) {
|
|
36
|
+
for (const key of Object.keys(params.filters)) if (!this.spec.view.filters.find((f) => f.key === key)) errors.push(`Unknown filter key: ${key}`);
|
|
37
|
+
}
|
|
38
|
+
if (params.sort) {
|
|
39
|
+
const field = this.spec.view.fields.find((f) => f.key === params.sort?.field);
|
|
40
|
+
if (!field) errors.push(`Unknown sort field: ${params.sort.field}`);
|
|
41
|
+
else if (field.sortable === false) errors.push(`Field is not sortable: ${params.sort.field}`);
|
|
42
|
+
}
|
|
43
|
+
return errors;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { DataViewQueryGenerator };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { GroupKeyFn, RegistryFilter } from "../registry-utils.js";
|
|
2
|
+
import { DataViewSpec } from "./spec.js";
|
|
3
|
+
|
|
4
|
+
//#region src/data-views/registry.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Generate a unique key for a data view spec.
|
|
8
|
+
*/
|
|
9
|
+
declare function dataViewKey(spec: DataViewSpec): string;
|
|
10
|
+
/**
|
|
11
|
+
* Registry for managing data view specifications.
|
|
12
|
+
*/
|
|
13
|
+
declare class DataViewRegistry {
|
|
14
|
+
private readonly items;
|
|
15
|
+
/**
|
|
16
|
+
* Register a data view spec.
|
|
17
|
+
* @throws Error if a spec with the same key already exists.
|
|
18
|
+
*/
|
|
19
|
+
register(spec: DataViewSpec): this;
|
|
20
|
+
/**
|
|
21
|
+
* List all registered data view specs.
|
|
22
|
+
*/
|
|
23
|
+
list(): DataViewSpec[];
|
|
24
|
+
/**
|
|
25
|
+
* Get a data view by key and optional version.
|
|
26
|
+
* If version is not specified, returns the latest version.
|
|
27
|
+
*/
|
|
28
|
+
get(name: string, version?: number): DataViewSpec | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Filter data views by criteria.
|
|
31
|
+
*/
|
|
32
|
+
filter(criteria: RegistryFilter): DataViewSpec[];
|
|
33
|
+
/**
|
|
34
|
+
* List data views with specific tag.
|
|
35
|
+
*/
|
|
36
|
+
listByTag(tag: string): DataViewSpec[];
|
|
37
|
+
/**
|
|
38
|
+
* List data views by owner.
|
|
39
|
+
*/
|
|
40
|
+
listByOwner(owner: string): DataViewSpec[];
|
|
41
|
+
/**
|
|
42
|
+
* Group data views by key function.
|
|
43
|
+
*/
|
|
44
|
+
groupBy(keyFn: GroupKeyFn<DataViewSpec>): Map<string, DataViewSpec[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Get unique tags from all data views.
|
|
47
|
+
*/
|
|
48
|
+
getUniqueTags(): string[];
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { DataViewRegistry, dataViewKey };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { filterBy, getUniqueTags, groupBy, init_registry_utils } from "../registry-utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/data-views/registry.ts
|
|
4
|
+
init_registry_utils();
|
|
5
|
+
/**
|
|
6
|
+
* Generate a unique key for a data view spec.
|
|
7
|
+
*/
|
|
8
|
+
function dataViewKey(spec) {
|
|
9
|
+
return `${spec.meta.key}.v${spec.meta.version}`;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Registry for managing data view specifications.
|
|
13
|
+
*/
|
|
14
|
+
var DataViewRegistry = class {
|
|
15
|
+
items = /* @__PURE__ */ new Map();
|
|
16
|
+
/**
|
|
17
|
+
* Register a data view spec.
|
|
18
|
+
* @throws Error if a spec with the same key already exists.
|
|
19
|
+
*/
|
|
20
|
+
register(spec) {
|
|
21
|
+
const key = dataViewKey(spec);
|
|
22
|
+
if (this.items.has(key)) throw new Error(`Duplicate data view ${key}`);
|
|
23
|
+
this.items.set(key, spec);
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List all registered data view specs.
|
|
28
|
+
*/
|
|
29
|
+
list() {
|
|
30
|
+
return [...this.items.values()];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get a data view by key and optional version.
|
|
34
|
+
* If version is not specified, returns the latest version.
|
|
35
|
+
*/
|
|
36
|
+
get(name, version) {
|
|
37
|
+
if (version != null) return this.items.get(`${name}.v${version}`);
|
|
38
|
+
let candidate;
|
|
39
|
+
let max = -Infinity;
|
|
40
|
+
for (const spec of this.items.values()) {
|
|
41
|
+
if (spec.meta.key !== name) continue;
|
|
42
|
+
if (spec.meta.version > max) {
|
|
43
|
+
max = spec.meta.version;
|
|
44
|
+
candidate = spec;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return candidate;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Filter data views by criteria.
|
|
51
|
+
*/
|
|
52
|
+
filter(criteria) {
|
|
53
|
+
return filterBy(this.list(), criteria);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* List data views with specific tag.
|
|
57
|
+
*/
|
|
58
|
+
listByTag(tag) {
|
|
59
|
+
return this.list().filter((d) => d.meta.tags?.includes(tag));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* List data views by owner.
|
|
63
|
+
*/
|
|
64
|
+
listByOwner(owner) {
|
|
65
|
+
return this.list().filter((d) => d.meta.owners?.includes(owner));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Group data views by key function.
|
|
69
|
+
*/
|
|
70
|
+
groupBy(keyFn) {
|
|
71
|
+
return groupBy(this.list(), keyFn);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get unique tags from all data views.
|
|
75
|
+
*/
|
|
76
|
+
getUniqueTags() {
|
|
77
|
+
return getUniqueTags(this.list());
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
export { DataViewRegistry, dataViewKey };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DataViewSpec } from "./spec.js";
|
|
2
|
+
import { DataViewRegistry } from "./registry.js";
|
|
3
|
+
import "./index.js";
|
|
4
|
+
|
|
5
|
+
//#region src/data-views/runtime.d.ts
|
|
6
|
+
interface DataViewRuntimeConfig {
|
|
7
|
+
registry: DataViewRegistry;
|
|
8
|
+
}
|
|
9
|
+
interface DataViewResult<T = unknown> {
|
|
10
|
+
data: T[];
|
|
11
|
+
total: number;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
error?: Error;
|
|
14
|
+
}
|
|
15
|
+
declare class DataViewRuntime {
|
|
16
|
+
private config;
|
|
17
|
+
private cache;
|
|
18
|
+
private subscriptions;
|
|
19
|
+
constructor(config: DataViewRuntimeConfig);
|
|
20
|
+
register(spec: DataViewSpec): void;
|
|
21
|
+
getSpec(name: string, version?: number): DataViewSpec | undefined;
|
|
22
|
+
executeQuery(specName: string, _params: unknown): Promise<DataViewResult>;
|
|
23
|
+
invalidate(specName: string): void;
|
|
24
|
+
subscribe(specName: string, callback: () => void): () => void;
|
|
25
|
+
private notifySubscribers;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { DataViewResult, DataViewRuntime, DataViewRuntimeConfig };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region src/data-views/runtime.ts
|
|
2
|
+
var DataViewRuntime = class {
|
|
3
|
+
cache = /* @__PURE__ */ new Map();
|
|
4
|
+
subscriptions = /* @__PURE__ */ new Map();
|
|
5
|
+
constructor(config) {
|
|
6
|
+
this.config = config;
|
|
7
|
+
}
|
|
8
|
+
register(spec) {
|
|
9
|
+
this.config.registry.register(spec);
|
|
10
|
+
}
|
|
11
|
+
getSpec(name, version) {
|
|
12
|
+
return this.config.registry.get(name, version);
|
|
13
|
+
}
|
|
14
|
+
async executeQuery(specName, _params) {
|
|
15
|
+
if (!this.getSpec(specName)) throw new Error(`DataView spec not found: ${specName}`);
|
|
16
|
+
return {
|
|
17
|
+
data: [],
|
|
18
|
+
total: 0,
|
|
19
|
+
loading: false
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
invalidate(specName) {
|
|
23
|
+
this.cache.delete(specName);
|
|
24
|
+
this.notifySubscribers(specName);
|
|
25
|
+
}
|
|
26
|
+
subscribe(specName, callback) {
|
|
27
|
+
if (!this.subscriptions.has(specName)) this.subscriptions.set(specName, /* @__PURE__ */ new Set());
|
|
28
|
+
this.subscriptions.get(specName)?.add(callback);
|
|
29
|
+
return () => {
|
|
30
|
+
this.subscriptions.get(specName)?.delete(callback);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
notifySubscribers(specName) {
|
|
34
|
+
this.subscriptions.get(specName)?.forEach((cb) => cb());
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { DataViewRuntime };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ExperimentRef } from "../experiments/spec.js";
|
|
2
|
+
import { DataViewConfig, DataViewMeta, DataViewSource, DataViewStates } from "./types.js";
|
|
3
|
+
|
|
4
|
+
//#region src/data-views/spec.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Complete specification for a data view.
|
|
8
|
+
*/
|
|
9
|
+
interface DataViewSpec {
|
|
10
|
+
meta: DataViewMeta;
|
|
11
|
+
source: DataViewSource;
|
|
12
|
+
view: DataViewConfig;
|
|
13
|
+
states?: DataViewStates;
|
|
14
|
+
policy?: {
|
|
15
|
+
flags?: string[];
|
|
16
|
+
pii?: string[];
|
|
17
|
+
};
|
|
18
|
+
experiments?: ExperimentRef[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Reference to a data view spec.
|
|
22
|
+
*/
|
|
23
|
+
interface DataViewRef {
|
|
24
|
+
key: string;
|
|
25
|
+
version: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Helper to define a data view spec with type safety.
|
|
29
|
+
*/
|
|
30
|
+
declare function defineDataView(spec: DataViewSpec): DataViewSpec;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DataViewRef, DataViewSpec, defineDataView };
|