@lssm/lib.contracts 0.0.0-canary-20251217054315 → 0.0.0-canary-20251217060433
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/dist/app-config/app-config.feature.d.ts +11 -0
- package/dist/app-config/branding.d.ts +55 -0
- package/dist/app-config/contracts.d.ts +244 -0
- package/dist/app-config/docs/app-config.docblock.d.ts +6 -0
- package/dist/app-config/events.d.ts +122 -0
- package/dist/app-config/index.d.ts +9 -0
- package/dist/app-config/lifecycle-contracts.d.ts +382 -0
- package/dist/app-config/lifecycle.d.ts +27 -0
- package/dist/app-config/runtime.d.ts +114 -0
- package/dist/app-config/spec.d.ts +175 -0
- package/dist/app-config/validation.d.ts +47 -0
- package/dist/capabilities/docs/capabilities.docblock.d.ts +6 -0
- package/dist/capabilities/openbanking.d.ts +9 -0
- package/dist/capabilities.d.ts +48 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/react/drivers/rn-reusables.d.ts +22 -0
- package/dist/client/react/drivers/shadcn.d.ts +12 -0
- package/dist/client/react/feature-render.d.ts +19 -0
- package/dist/client/react/form-render.d.ts +91 -0
- package/dist/client/react/index.d.ts +5 -0
- package/dist/contract-registry/index.d.ts +3 -0
- package/dist/contract-registry/schemas.d.ts +124 -0
- package/dist/contract-registry/types.d.ts +46 -0
- package/dist/contracts-adapter-hydration.d.ts +15 -0
- package/dist/contracts-adapter-input.d.ts +10 -0
- package/dist/data-views/docs/data-views.docblock.d.ts +6 -0
- package/dist/data-views/query-generator.d.ts +39 -0
- package/dist/data-views/runtime.d.ts +26 -0
- package/dist/data-views.d.ts +131 -0
- package/dist/docs/PUBLISHING.docblock.d.ts +6 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.d.ts +6 -0
- package/dist/docs/index.d.ts +6 -0
- package/dist/docs/meta.docs.d.ts +6 -0
- package/dist/docs/presentations.d.ts +33 -0
- package/dist/docs/registry.d.ts +24 -0
- package/dist/docs/tech/PHASE_1_QUICKSTART.docblock.d.ts +6 -0
- package/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.d.ts +6 -0
- package/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.d.ts +6 -0
- package/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.d.ts +6 -0
- package/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.d.ts +6 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/README.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/create-subscription.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/migrations.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/overlays.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/tests.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/themes.docblock.d.ts +6 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.d.ts +6 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.d.ts +6 -0
- package/dist/docs/tech/llm/llm-integration.docblock.d.ts +7 -0
- package/dist/docs/tech/mcp-endpoints.docblock.d.ts +6 -0
- package/dist/docs/tech/presentation-runtime.docblock.d.ts +6 -0
- package/dist/docs/tech/schema/README.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/learning-events.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/project-routing.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/team-invitations.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.d.ts +6 -0
- package/dist/docs/tech/studio/workspaces.docblock.d.ts +6 -0
- package/dist/docs/tech/telemetry-ingest.docblock.d.ts +6 -0
- package/dist/docs/tech/templates/runtime.docblock.d.ts +6 -0
- package/dist/docs/tech/vscode-extension.docblock.d.ts +6 -0
- package/dist/docs/tech/workflows/overview.docblock.d.ts +6 -0
- package/dist/docs/tech-contracts.docs.d.ts +6 -0
- package/dist/docs/types.d.ts +41 -0
- package/dist/events.d.ts +47 -0
- package/dist/experiments/docs/experiments.docblock.d.ts +6 -0
- package/dist/experiments/evaluator.d.ts +37 -0
- package/dist/experiments/spec-resolver.d.ts +16 -0
- package/dist/experiments/spec.d.ts +89 -0
- package/dist/features.d.ts +96 -0
- package/dist/forms/docs/forms.docblock.d.ts +6 -0
- package/dist/forms.d.ts +258 -0
- package/dist/index.d.ts +127 -0
- package/dist/install.d.ts +76 -0
- package/dist/integrations/binding.d.ts +17 -0
- package/dist/integrations/connection.d.ts +51 -0
- package/dist/integrations/contracts.d.ts +435 -0
- package/dist/integrations/docs/integrations.docblock.d.ts +6 -0
- package/dist/integrations/health.d.ts +21 -0
- package/dist/integrations/index.d.ts +34 -0
- package/dist/integrations/openbanking/contracts/accounts.d.ts +287 -0
- package/dist/integrations/openbanking/contracts/balances.d.ts +163 -0
- package/dist/integrations/openbanking/contracts/index.d.ts +10 -0
- package/dist/integrations/openbanking/contracts/transactions.d.ts +211 -0
- package/dist/integrations/openbanking/guards.d.ts +12 -0
- package/dist/integrations/openbanking/models.d.ts +228 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +11 -0
- package/dist/integrations/openbanking/telemetry.d.ts +15 -0
- package/dist/integrations/providers/calendar.d.ts +78 -0
- package/dist/integrations/providers/elevenlabs.d.ts +7 -0
- package/dist/integrations/providers/email.d.ts +86 -0
- package/dist/integrations/providers/embedding.d.ts +24 -0
- package/dist/integrations/providers/gcs-storage.d.ts +7 -0
- package/dist/integrations/providers/gmail.d.ts +7 -0
- package/dist/integrations/providers/google-calendar.d.ts +7 -0
- package/dist/integrations/providers/impls/elevenlabs-voice.d.ts +20 -0
- package/dist/integrations/providers/impls/gcs-storage.d.ts +24 -0
- package/dist/integrations/providers/impls/gmail-inbound.d.ts +26 -0
- package/dist/integrations/providers/impls/gmail-outbound.d.ts +18 -0
- package/dist/integrations/providers/impls/google-calendar.d.ts +23 -0
- package/dist/integrations/providers/impls/index.d.ts +15 -0
- package/dist/integrations/providers/impls/mistral-embedding.d.ts +23 -0
- package/dist/integrations/providers/impls/mistral-llm.d.ts +31 -0
- package/dist/integrations/providers/impls/postmark-email.d.ts +19 -0
- package/dist/integrations/providers/impls/powens-client.d.ts +124 -0
- package/dist/integrations/providers/impls/powens-openbanking.d.ts +27 -0
- package/dist/integrations/providers/impls/provider-factory.d.ts +26 -0
- package/dist/integrations/providers/impls/qdrant-vector.d.ts +24 -0
- package/dist/integrations/providers/impls/stripe-payments.d.ts +28 -0
- package/dist/integrations/providers/impls/twilio-sms.d.ts +20 -0
- package/dist/integrations/providers/index.d.ts +22 -0
- package/dist/integrations/providers/llm.d.ts +82 -0
- package/dist/integrations/providers/mistral.d.ts +7 -0
- package/dist/integrations/providers/openbanking.d.ts +128 -0
- package/dist/integrations/providers/payments.d.ts +109 -0
- package/dist/integrations/providers/postmark.d.ts +7 -0
- package/dist/integrations/providers/powens.d.ts +7 -0
- package/dist/integrations/providers/qdrant.d.ts +7 -0
- package/dist/integrations/providers/registry.d.ts +11 -0
- package/dist/integrations/providers/sms.d.ts +34 -0
- package/dist/integrations/providers/storage.d.ts +60 -0
- package/dist/integrations/providers/stripe.d.ts +7 -0
- package/dist/integrations/providers/twilio-sms.d.ts +7 -0
- package/dist/integrations/providers/vector-store.d.ts +43 -0
- package/dist/integrations/providers/voice.d.ts +34 -0
- package/dist/integrations/runtime.d.ts +99 -0
- package/dist/integrations/secrets/aws-secret-manager.d.ts +31 -0
- package/dist/integrations/secrets/env-secret-provider.d.ts +31 -0
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +32 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +1 -1
- package/dist/integrations/secrets/index.d.ts +7 -0
- package/dist/integrations/secrets/manager.d.ts +47 -0
- package/dist/integrations/secrets/provider.d.ts +52 -0
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts +38 -0
- package/dist/integrations/spec.d.ts +79 -0
- package/dist/jobs/define-job.d.ts +18 -0
- package/dist/jobs/gcp-cloud-tasks.d.ts +41 -0
- package/dist/jobs/gcp-pubsub.d.ts +25 -0
- package/dist/jobs/handlers/gmail-sync-handler.d.ts +9 -0
- package/dist/jobs/handlers/index.d.ts +9 -0
- package/dist/jobs/handlers/ping-handler.d.ts +10 -0
- package/dist/jobs/handlers/storage-document-handler.d.ts +12 -0
- package/dist/jobs/index.d.ts +3 -0
- package/dist/jobs/memory-queue.d.ts +18 -0
- package/dist/jobs/queue.d.ts +131 -0
- package/dist/jobs/scaleway-sqs-queue.d.ts +30 -0
- package/dist/jsonschema.d.ts +27 -0
- package/dist/knowledge/binding.d.ts +25 -0
- package/dist/knowledge/contracts.d.ts +316 -0
- package/dist/knowledge/docs/knowledge.docblock.d.ts +6 -0
- package/dist/knowledge/index.d.ts +10 -0
- package/dist/knowledge/ingestion/document-processor.d.ts +24 -0
- package/dist/knowledge/ingestion/embedding-service.d.ts +12 -0
- package/dist/knowledge/ingestion/gmail-adapter.d.ts +18 -0
- package/dist/knowledge/ingestion/index.d.ts +6 -0
- package/dist/knowledge/ingestion/storage-adapter.d.ts +15 -0
- package/dist/knowledge/ingestion/vector-indexer.d.ts +18 -0
- package/dist/knowledge/query/index.d.ts +2 -0
- package/dist/knowledge/query/service.d.ts +29 -0
- package/dist/knowledge/runtime.d.ts +32 -0
- package/dist/knowledge/source.d.ts +32 -0
- package/dist/knowledge/spaces/email-threads.d.ts +7 -0
- package/dist/knowledge/spaces/financial-docs.d.ts +7 -0
- package/dist/knowledge/spaces/financial-overview.d.ts +7 -0
- package/dist/knowledge/spaces/index.d.ts +7 -0
- package/dist/knowledge/spaces/product-canon.d.ts +7 -0
- package/dist/knowledge/spaces/support-faq.d.ts +7 -0
- package/dist/knowledge/spaces/uploaded-docs.d.ts +7 -0
- package/dist/knowledge/spec.d.ts +52 -0
- package/dist/llm/exporters.d.ts +67 -0
- package/dist/llm/index.d.ts +4 -0
- package/dist/llm/prompts.d.ts +51 -0
- package/dist/llm/types.d.ts +213 -0
- package/dist/markdown.d.ts +21 -0
- package/dist/migrations.d.ts +52 -0
- package/dist/onboarding-base.d.ts +137 -0
- package/dist/openapi.d.ts +31 -0
- package/dist/openbanking/docs/openbanking.docblock.d.ts +6 -0
- package/dist/ownership.d.ts +75 -0
- package/dist/policy/docs/policy.docblock.d.ts +6 -0
- package/dist/policy/engine.d.ts +39 -0
- package/dist/policy/opa-adapter.d.ts +45 -0
- package/dist/policy/spec.d.ts +114 -0
- package/dist/presentations/docs/presentations-conventions.docblock.d.ts +6 -0
- package/dist/presentations.backcompat.d.ts +7 -0
- package/dist/presentations.d.ts +98 -0
- package/dist/presentations.v2.d.ts +114 -0
- package/dist/prompt.d.ts +60 -0
- package/dist/promptRegistry.d.ts +15 -0
- package/dist/regenerator/adapters.d.ts +19 -0
- package/dist/regenerator/docs/regenerator.docblock.d.ts +6 -0
- package/dist/regenerator/executor.d.ts +70 -0
- package/dist/regenerator/index.d.ts +7 -0
- package/dist/regenerator/service.d.ts +33 -0
- package/dist/regenerator/sinks.d.ts +26 -0
- package/dist/regenerator/types.d.ts +107 -0
- package/dist/regenerator/utils.d.ts +9 -0
- package/dist/registry.d.ts +73 -0
- package/dist/resources.d.ts +64 -0
- package/dist/schema-to-markdown.d.ts +54 -0
- package/dist/server/graphql-pothos.d.ts +27 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/mcp/createMcpServer.d.ts +15 -0
- package/dist/server/mcp/mcpTypes.d.ts +29 -0
- package/dist/server/mcp/registerPresentations.d.ts +7 -0
- package/dist/server/mcp/registerPrompts.d.ts +8 -0
- package/dist/server/mcp/registerResources.d.ts +8 -0
- package/dist/server/mcp/registerTools.d.ts +8 -0
- package/dist/server/provider-mcp.d.ts +2 -0
- package/dist/server/rest-elysia.d.ts +40 -0
- package/dist/server/rest-express.d.ts +16 -0
- package/dist/server/rest-generic.d.ts +32 -0
- package/dist/server/rest-next-app.d.ts +35 -0
- package/dist/server/rest-next-mcp.d.ts +11 -0
- package/dist/server/rest-next-pages.d.ts +9 -0
- package/dist/spec.d.ts +195 -0
- package/dist/telemetry/anomaly.d.ts +27 -0
- package/dist/telemetry/docs/telemetry.docblock.d.ts +6 -0
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/telemetry/spec.d.ts +98 -0
- package/dist/telemetry/tracker.d.ts +51 -0
- package/dist/tests/index.d.ts +3 -0
- package/dist/tests/runner.d.ts +43 -0
- package/dist/tests/spec.d.ts +89 -0
- package/dist/themes.d.ts +55 -0
- package/dist/translations/catalog.d.ts +28 -0
- package/dist/translations/tenant.d.ts +15 -0
- package/dist/types/all.d.ts +60 -0
- package/dist/types.d.ts +88 -0
- package/dist/workflow/adapters/db-adapter.d.ts +34 -0
- package/dist/workflow/adapters/file-adapter.d.ts +14 -0
- package/dist/workflow/adapters/index.d.ts +4 -0
- package/dist/workflow/adapters/memory-store.d.ts +18 -0
- package/dist/workflow/expression.d.ts +9 -0
- package/dist/workflow/index.d.ts +10 -0
- package/dist/workflow/runner.d.ts +74 -0
- package/dist/workflow/sla-monitor.d.ts +20 -0
- package/dist/workflow/spec.d.ts +99 -0
- package/dist/workflow/state.d.ts +35 -0
- package/dist/workflow/validation.d.ts +28 -0
- package/package.json +250 -250
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CapabilityRegistry } from "../capabilities.js";
|
|
2
|
+
import { DataViewRegistry } from "../data-views.js";
|
|
3
|
+
import { WorkflowRegistry } from "../workflow/spec.js";
|
|
4
|
+
import { IntegrationSpecRegistry } from "../integrations/spec.js";
|
|
5
|
+
import { IntegrationConnection } from "../integrations/connection.js";
|
|
6
|
+
import { KnowledgeSpaceRegistry } from "../knowledge/spec.js";
|
|
7
|
+
import { KnowledgeSourceConfig } from "../knowledge/source.js";
|
|
8
|
+
import { BlueprintTranslationCatalog, PlatformTranslationCatalog } from "../translations/catalog.js";
|
|
9
|
+
import { AppBlueprintSpec, TenantAppConfig } from "./spec.js";
|
|
10
|
+
import { ResolvedAppConfig } from "./runtime.js";
|
|
11
|
+
|
|
12
|
+
//#region src/app-config/validation.d.ts
|
|
13
|
+
type ValidationSeverity = 'error' | 'warning' | 'info';
|
|
14
|
+
interface ValidationIssue {
|
|
15
|
+
code: string;
|
|
16
|
+
severity: ValidationSeverity;
|
|
17
|
+
path: string;
|
|
18
|
+
message: string;
|
|
19
|
+
suggestion?: string;
|
|
20
|
+
docsUrl?: string;
|
|
21
|
+
}
|
|
22
|
+
interface ValidationResult {
|
|
23
|
+
valid: boolean;
|
|
24
|
+
errors: ValidationIssue[];
|
|
25
|
+
warnings: ValidationIssue[];
|
|
26
|
+
info: ValidationIssue[];
|
|
27
|
+
}
|
|
28
|
+
interface ValidationContext {
|
|
29
|
+
integrationSpecs?: IntegrationSpecRegistry;
|
|
30
|
+
knowledgeSpaces?: KnowledgeSpaceRegistry;
|
|
31
|
+
knowledgeSources?: KnowledgeSourceConfig[];
|
|
32
|
+
capabilities?: CapabilityRegistry;
|
|
33
|
+
dataViews?: DataViewRegistry;
|
|
34
|
+
workflows?: WorkflowRegistry;
|
|
35
|
+
tenantConnections?: IntegrationConnection[];
|
|
36
|
+
existingConfigs?: TenantAppConfig[];
|
|
37
|
+
translationCatalogs?: {
|
|
38
|
+
platform?: PlatformTranslationCatalog | PlatformTranslationCatalog[] | undefined;
|
|
39
|
+
blueprint?: BlueprintTranslationCatalog | BlueprintTranslationCatalog[] | undefined;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
declare function validateConfig(blueprint: AppBlueprintSpec, tenant: TenantAppConfig, context?: ValidationContext): ValidationResult;
|
|
43
|
+
declare function validateBlueprint(blueprint: AppBlueprintSpec, context?: ValidationContext): ValidationResult;
|
|
44
|
+
declare function validateTenantConfig(blueprint: AppBlueprintSpec, tenant: TenantAppConfig, context?: ValidationContext): ValidationResult;
|
|
45
|
+
declare function validateResolvedConfig(blueprint: AppBlueprintSpec, resolved: ResolvedAppConfig, context?: ValidationContext): ValidationResult;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { ValidationContext, ValidationIssue, ValidationResult, ValidationSeverity, validateBlueprint, validateConfig, validateResolvedConfig, validateTenantConfig };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CapabilityRegistry, CapabilitySpec } from "../capabilities.js";
|
|
2
|
+
|
|
3
|
+
//#region src/capabilities/openbanking.d.ts
|
|
4
|
+
declare const openBankingAccountsReadCapability: CapabilitySpec;
|
|
5
|
+
declare const openBankingTransactionsReadCapability: CapabilitySpec;
|
|
6
|
+
declare const openBankingBalancesReadCapability: CapabilitySpec;
|
|
7
|
+
declare function registerOpenBankingCapabilities(registry: CapabilityRegistry): CapabilityRegistry;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { openBankingAccountsReadCapability, openBankingBalancesReadCapability, openBankingTransactionsReadCapability, registerOpenBankingCapabilities };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { OwnerShipMeta } from "./ownership.js";
|
|
2
|
+
import { DocId } from "./docs/registry.js";
|
|
3
|
+
|
|
4
|
+
//#region src/capabilities.d.ts
|
|
5
|
+
type CapabilityKind = 'api' | 'event' | 'data' | 'ui' | 'integration';
|
|
6
|
+
type CapabilitySurface = 'operation' | 'event' | 'workflow' | 'presentation' | 'resource';
|
|
7
|
+
interface CapabilitySurfaceRef {
|
|
8
|
+
surface: CapabilitySurface;
|
|
9
|
+
name: string;
|
|
10
|
+
version: number;
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
interface CapabilityMeta extends OwnerShipMeta {
|
|
14
|
+
/** Stable capability slug (e.g., "payments.stripe"). */
|
|
15
|
+
key: string;
|
|
16
|
+
/** Increment when the capability shape changes. */
|
|
17
|
+
version: number;
|
|
18
|
+
kind: CapabilityKind;
|
|
19
|
+
/** Optional doc block id for governance and navigation. */
|
|
20
|
+
docId?: DocId;
|
|
21
|
+
}
|
|
22
|
+
interface CapabilityRequirement {
|
|
23
|
+
key: string;
|
|
24
|
+
version?: number;
|
|
25
|
+
kind?: CapabilityKind;
|
|
26
|
+
optional?: boolean;
|
|
27
|
+
reason?: string;
|
|
28
|
+
}
|
|
29
|
+
interface CapabilityRef {
|
|
30
|
+
key: string;
|
|
31
|
+
version: number;
|
|
32
|
+
}
|
|
33
|
+
interface CapabilitySpec {
|
|
34
|
+
meta: CapabilityMeta;
|
|
35
|
+
provides?: CapabilitySurfaceRef[];
|
|
36
|
+
requires?: CapabilityRequirement[];
|
|
37
|
+
}
|
|
38
|
+
declare class CapabilityRegistry {
|
|
39
|
+
private readonly items;
|
|
40
|
+
register(spec: CapabilitySpec): this;
|
|
41
|
+
list(): CapabilitySpec[];
|
|
42
|
+
get(key: string, version?: number): CapabilitySpec | undefined;
|
|
43
|
+
satisfies(requirement: CapabilityRequirement, additional?: CapabilityRef[] | undefined): boolean;
|
|
44
|
+
}
|
|
45
|
+
declare function capabilityKey(spec: CapabilitySpec): string;
|
|
46
|
+
declare function defineCapability(spec: CapabilitySpec): CapabilitySpec;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { CapabilityKind, CapabilityMeta, CapabilityRef, CapabilityRegistry, CapabilityRequirement, CapabilitySpec, CapabilitySurface, CapabilitySurfaceRef, capabilityKey, defineCapability };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createEngineWithDefaults, createFeatureModule, registerFeature, renderFeaturePresentation } from "./react/feature-render.js";
|
|
2
|
+
import { ComputationMap, CreateRendererOptions, DriverSlots, RenderOptions, ResolverMap, createFormRenderer } from "./react/form-render.js";
|
|
3
|
+
import { ShadcnDriver, shadcnDriver } from "./react/drivers/shadcn.js";
|
|
4
|
+
import { RnReusablesDriver, rnReusablesDriver } from "./react/drivers/rn-reusables.js";
|
|
5
|
+
import "./react/index.js";
|
|
6
|
+
export { ComputationMap, CreateRendererOptions, DriverSlots, RenderOptions, ResolverMap, RnReusablesDriver, ShadcnDriver, createEngineWithDefaults, createFeatureModule, createFormRenderer, registerFeature, renderFeaturePresentation, rnReusablesDriver, shadcnDriver };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DriverSlots } from "../form-render.js";
|
|
2
|
+
|
|
3
|
+
//#region src/client/react/drivers/rn-reusables.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Create a React Native UI-kit driver by mapping required slots to components.
|
|
7
|
+
* Host apps should import their UI-kit primitives and pass them here.
|
|
8
|
+
*
|
|
9
|
+
* Example usage:
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { rnReusablesDriver } from '@lssm/lib.contracts/client/react/drivers/rn-reusables';
|
|
12
|
+
* import { Input, Textarea, Button } from '@lssm/lib.ui-kit/ui';
|
|
13
|
+
*
|
|
14
|
+
* const driver = rnReusablesDriver({
|
|
15
|
+
* Input, Textarea, Button, // ... other components
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function rnReusablesDriver(slots: DriverSlots): DriverSlots;
|
|
20
|
+
type RnReusablesDriver = ReturnType<typeof rnReusablesDriver>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { RnReusablesDriver, rnReusablesDriver };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DriverSlots } from "../form-render.js";
|
|
2
|
+
|
|
3
|
+
//#region src/client/react/drivers/shadcn.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Create a shadcn/ui driver by mapping required slots to components.
|
|
7
|
+
* Host apps should import their shadcn primitives and pass them here.
|
|
8
|
+
*/
|
|
9
|
+
declare function shadcnDriver(slots: DriverSlots): DriverSlots;
|
|
10
|
+
type ShadcnDriver = ReturnType<typeof shadcnDriver>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ShadcnDriver, shadcnDriver };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentMap, PresentationDescriptorV2, PresentationTarget, TransformEngine } from "../../presentations.v2.js";
|
|
2
|
+
import { FeatureModuleSpec, FeatureRegistry } from "../../features.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { BlockConfig } from "@blocknote/core";
|
|
5
|
+
|
|
6
|
+
//#region src/client/react/feature-render.d.ts
|
|
7
|
+
declare function createEngineWithDefaults(): TransformEngine;
|
|
8
|
+
declare function renderFeaturePresentation(engine: TransformEngine, target: PresentationTarget, desc: PresentationDescriptorV2, options?: {
|
|
9
|
+
componentMap?: ComponentMap;
|
|
10
|
+
reactProps?: Record<string, unknown>;
|
|
11
|
+
renderBlockNote?: (docJson: unknown, blockConfig?: BlockConfig) => React.ReactElement;
|
|
12
|
+
}): Promise<React.ReactElement | {
|
|
13
|
+
mimeType: string;
|
|
14
|
+
body: string;
|
|
15
|
+
} | null>;
|
|
16
|
+
declare function createFeatureModule(meta: FeatureModuleSpec['meta'], refs: Partial<Pick<FeatureModuleSpec, 'operations' | 'events' | 'presentations' | 'presentationsTargets'>>): FeatureModuleSpec;
|
|
17
|
+
declare function registerFeature(registry: FeatureRegistry, feature: FeatureModuleSpec): FeatureRegistry;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { createEngineWithDefaults, createFeatureModule, registerFeature, renderFeaturePresentation };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { FormOption, FormSpec, FormValuesFor } from "../../forms.js";
|
|
2
|
+
import { AnySchemaModel } from "@lssm/lib.schema";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/client/react/form-render.d.ts
|
|
7
|
+
interface DriverSlots {
|
|
8
|
+
Field: React.ComponentType<React.PropsWithChildren<{
|
|
9
|
+
'data-invalid'?: boolean;
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}>>;
|
|
13
|
+
FieldLabel: React.ComponentType<React.PropsWithChildren<{
|
|
14
|
+
htmlFor?: string;
|
|
15
|
+
}>>;
|
|
16
|
+
FieldDescription: React.ComponentType<React.PropsWithChildren<{}>>;
|
|
17
|
+
FieldError: React.ComponentType<{
|
|
18
|
+
errors: {
|
|
19
|
+
message?: string;
|
|
20
|
+
}[];
|
|
21
|
+
}>;
|
|
22
|
+
FieldGroup?: React.ComponentType<React.PropsWithChildren<{
|
|
23
|
+
className?: string;
|
|
24
|
+
}>>;
|
|
25
|
+
FieldSet?: React.ComponentType<React.PropsWithChildren<{
|
|
26
|
+
className?: string;
|
|
27
|
+
}>>;
|
|
28
|
+
FieldLegend?: React.ComponentType<React.PropsWithChildren<{
|
|
29
|
+
variant?: 'label' | 'default';
|
|
30
|
+
}>>;
|
|
31
|
+
Input: React.ComponentType<React.InputHTMLAttributes<HTMLInputElement>>;
|
|
32
|
+
Textarea: React.ComponentType<React.TextareaHTMLAttributes<HTMLTextAreaElement>>;
|
|
33
|
+
Select: React.ComponentType<{
|
|
34
|
+
id?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
value?: unknown;
|
|
37
|
+
onChange?: (v: any) => void;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
'aria-invalid'?: boolean;
|
|
40
|
+
options: FormOption[];
|
|
41
|
+
} & Record<string, unknown>>;
|
|
42
|
+
Checkbox: React.ComponentType<{
|
|
43
|
+
id?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
checked?: boolean;
|
|
46
|
+
onCheckedChange?: (v: boolean) => void;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
} & Record<string, unknown>>;
|
|
49
|
+
RadioGroup: React.ComponentType<{
|
|
50
|
+
id?: string;
|
|
51
|
+
name?: string;
|
|
52
|
+
value?: unknown;
|
|
53
|
+
onValueChange?: (v: any) => void;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
options: FormOption[];
|
|
56
|
+
} & Record<string, unknown>>;
|
|
57
|
+
Switch: React.ComponentType<{
|
|
58
|
+
id?: string;
|
|
59
|
+
name?: string;
|
|
60
|
+
checked?: boolean;
|
|
61
|
+
onCheckedChange?: (v: boolean) => void;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
} & Record<string, unknown>>;
|
|
64
|
+
Button: React.ComponentType<React.PropsWithChildren<{
|
|
65
|
+
type?: 'button' | 'submit' | 'reset';
|
|
66
|
+
variant?: string;
|
|
67
|
+
size?: string;
|
|
68
|
+
onClick?: () => void;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
}>>;
|
|
71
|
+
}
|
|
72
|
+
type ResolverMap<TValues> = Record<string, (values: TValues, args?: any) => Promise<FormOption[]> | FormOption[]>;
|
|
73
|
+
type ComputationMap<TValues> = Record<string, (values: TValues) => any>;
|
|
74
|
+
interface CreateRendererOptions<TValues = any> {
|
|
75
|
+
driver: DriverSlots;
|
|
76
|
+
formOptions?: Record<string, unknown>;
|
|
77
|
+
onSubmitOverride?: (values: TValues, actionKey: string) => Promise<void> | void;
|
|
78
|
+
activeFlags?: string[];
|
|
79
|
+
resolvers?: ResolverMap<TValues>;
|
|
80
|
+
computations?: ComputationMap<TValues>;
|
|
81
|
+
unmountStrategy?: 'keep' | 'clear';
|
|
82
|
+
}
|
|
83
|
+
interface RenderOptions<TValues = any> {
|
|
84
|
+
defaultValues?: Partial<TValues>;
|
|
85
|
+
overrides?: Partial<CreateRendererOptions<TValues>>;
|
|
86
|
+
}
|
|
87
|
+
declare function createFormRenderer<M extends AnySchemaModel = AnySchemaModel>(base: CreateRendererOptions<FormValuesFor<M>>): {
|
|
88
|
+
render: (spec: FormSpec<M>, options?: RenderOptions<FormValuesFor<M>>) => react_jsx_runtime0.JSX.Element;
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
export { ComputationMap, CreateRendererOptions, DriverSlots, RenderOptions, ResolverMap, createFormRenderer };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createEngineWithDefaults, createFeatureModule, registerFeature, renderFeaturePresentation } from "./feature-render.js";
|
|
2
|
+
import { ComputationMap, CreateRendererOptions, DriverSlots, RenderOptions, ResolverMap, createFormRenderer } from "./form-render.js";
|
|
3
|
+
import { ShadcnDriver, shadcnDriver } from "./drivers/shadcn.js";
|
|
4
|
+
import { RnReusablesDriver, rnReusablesDriver } from "./drivers/rn-reusables.js";
|
|
5
|
+
export { ComputationMap, CreateRendererOptions, DriverSlots, RenderOptions, ResolverMap, RnReusablesDriver, ShadcnDriver, createEngineWithDefaults, createFeatureModule, createFormRenderer, registerFeature, renderFeaturePresentation, rnReusablesDriver, shadcnDriver };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ContractRegistryFile, ContractRegistryItem, ContractRegistryItemType, ContractRegistryManifest, JsonSchema } from "./types.js";
|
|
2
|
+
import { ContractRegistryFileSchema, ContractRegistryItemParsed, ContractRegistryItemSchema, ContractRegistryItemTypeSchema, ContractRegistryManifestParsed, ContractRegistryManifestSchema } from "./schemas.js";
|
|
3
|
+
export { type ContractRegistryFile, ContractRegistryFileSchema, type ContractRegistryItem, type ContractRegistryItemParsed, ContractRegistryItemSchema, type ContractRegistryItemType, ContractRegistryItemTypeSchema, type ContractRegistryManifest, type ContractRegistryManifestParsed, ContractRegistryManifestSchema, type JsonSchema };
|
|
@@ -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
|
+
name: 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
|
+
idea: "idea";
|
|
50
|
+
in_creation: "in_creation";
|
|
51
|
+
experimental: "experimental";
|
|
52
|
+
beta: "beta";
|
|
53
|
+
stable: "stable";
|
|
54
|
+
deprecated: "deprecated";
|
|
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
|
+
name: 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
|
+
idea: "idea";
|
|
99
|
+
in_creation: "in_creation";
|
|
100
|
+
experimental: "experimental";
|
|
101
|
+
beta: "beta";
|
|
102
|
+
stable: "stable";
|
|
103
|
+
deprecated: "deprecated";
|
|
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,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
|
+
name: 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 };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ResourceRegistry } from "./resources.js";
|
|
2
|
+
|
|
3
|
+
//#region src/contracts-adapter-hydration.d.ts
|
|
4
|
+
interface ReturnsDecl {
|
|
5
|
+
isList: boolean;
|
|
6
|
+
inner: string;
|
|
7
|
+
}
|
|
8
|
+
declare function parseReturns(returnsLike: string): ReturnsDecl;
|
|
9
|
+
declare function hydrateResourceIfNeeded(resources: ResourceRegistry | undefined, result: unknown, opts: {
|
|
10
|
+
template?: string;
|
|
11
|
+
varName?: string;
|
|
12
|
+
returns: ReturnsDecl;
|
|
13
|
+
}): Promise<unknown>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ReturnsDecl, hydrateResourceIfNeeded, parseReturns };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnySchemaModel } from "@lssm/lib.schema";
|
|
2
|
+
import { SchemaTypes } from "@pothos/core";
|
|
3
|
+
|
|
4
|
+
//#region src/contracts-adapter-input.d.ts
|
|
5
|
+
declare function isSchemaModel(x: unknown): x is AnySchemaModel;
|
|
6
|
+
declare function createInputTypeBuilder<T extends SchemaTypes>(builder: PothosSchemaTypes.SchemaBuilder<T>): {
|
|
7
|
+
buildInputFieldArgs: (model: AnySchemaModel | null) => null;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createInputTypeBuilder, isSchemaModel };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DataViewSpec } from "../data-views.js";
|
|
2
|
+
|
|
3
|
+
//#region src/data-views/query-generator.d.ts
|
|
4
|
+
interface DataViewQueryParams {
|
|
5
|
+
filters?: Record<string, any>;
|
|
6
|
+
sort?: {
|
|
7
|
+
field: string;
|
|
8
|
+
direction: 'asc' | 'desc';
|
|
9
|
+
};
|
|
10
|
+
pagination?: {
|
|
11
|
+
page: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
};
|
|
14
|
+
search?: string;
|
|
15
|
+
}
|
|
16
|
+
interface DataViewQuery {
|
|
17
|
+
operationName: string;
|
|
18
|
+
input: Record<string, any>;
|
|
19
|
+
meta: {
|
|
20
|
+
pagination: {
|
|
21
|
+
page: number;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
skip: number;
|
|
24
|
+
take: number;
|
|
25
|
+
};
|
|
26
|
+
sorting?: {
|
|
27
|
+
field: string;
|
|
28
|
+
direction: 'asc' | 'desc';
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
declare class DataViewQueryGenerator {
|
|
33
|
+
private spec;
|
|
34
|
+
constructor(spec: DataViewSpec);
|
|
35
|
+
generate(params: DataViewQueryParams): DataViewQuery;
|
|
36
|
+
validateParams(params: DataViewQueryParams): string[];
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { DataViewQuery, DataViewQueryGenerator, DataViewQueryParams };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DataViewRegistry, DataViewSpec } from "../data-views.js";
|
|
2
|
+
|
|
3
|
+
//#region src/data-views/runtime.d.ts
|
|
4
|
+
interface DataViewRuntimeConfig {
|
|
5
|
+
registry: DataViewRegistry;
|
|
6
|
+
}
|
|
7
|
+
interface DataViewResult<T = any> {
|
|
8
|
+
data: T[];
|
|
9
|
+
total: number;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
error?: Error;
|
|
12
|
+
}
|
|
13
|
+
declare class DataViewRuntime {
|
|
14
|
+
private config;
|
|
15
|
+
private cache;
|
|
16
|
+
private subscriptions;
|
|
17
|
+
constructor(config: DataViewRuntimeConfig);
|
|
18
|
+
register(spec: DataViewSpec): void;
|
|
19
|
+
getSpec(name: string, version?: number): DataViewSpec | undefined;
|
|
20
|
+
executeQuery(specName: string, params: any): Promise<DataViewResult>;
|
|
21
|
+
invalidate(specName: string): void;
|
|
22
|
+
subscribe(specName: string, callback: () => void): () => void;
|
|
23
|
+
private notifySubscribers;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { DataViewResult, DataViewRuntime, DataViewRuntimeConfig };
|