@happyvertical/smrt-core 0.30.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/AGENTS.md +124 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +265 -0
- package/bin/smrt-prebuild.js +26 -0
- package/dist/__tests__/fixtures/advisor-test-classes.d.ts +28 -0
- package/dist/__tests__/fixtures/advisor-test-classes.d.ts.map +1 -0
- package/dist/__tests__/fixtures/collection-coverage-fixtures.d.ts +12 -0
- package/dist/__tests__/fixtures/collection-coverage-fixtures.d.ts.map +1 -0
- package/dist/__tests__/fixtures/inheritance-resolver-fixtures.d.ts +28 -0
- package/dist/__tests__/fixtures/inheritance-resolver-fixtures.d.ts.map +1 -0
- package/dist/__tests__/fixtures/inheritance-test-classes.d.ts +43 -0
- package/dist/__tests__/fixtures/inheritance-test-classes.d.ts.map +1 -0
- package/dist/__tests__/fixtures/mcp-integration-test-classes.d.ts +18 -0
- package/dist/__tests__/fixtures/mcp-integration-test-classes.d.ts.map +1 -0
- package/dist/__tests__/fixtures/object-ai-memory-fixtures.d.ts +15 -0
- package/dist/__tests__/fixtures/object-ai-memory-fixtures.d.ts.map +1 -0
- package/dist/__tests__/fixtures/object-spec-test-classes.d.ts +13 -0
- package/dist/__tests__/fixtures/object-spec-test-classes.d.ts.map +1 -0
- package/dist/__tests__/fixtures/registry-test-classes.d.ts +23 -0
- package/dist/__tests__/fixtures/registry-test-classes.d.ts.map +1 -0
- package/dist/adapters/ai-usage.d.ts +23 -0
- package/dist/adapters/ai-usage.d.ts.map +1 -0
- package/dist/adapters/ai-usage.js +105 -0
- package/dist/adapters/ai-usage.js.map +1 -0
- package/dist/adapters/cost-rates.d.ts +20 -0
- package/dist/adapters/cost-rates.d.ts.map +1 -0
- package/dist/adapters/cost-rates.js +40 -0
- package/dist/adapters/cost-rates.js.map +1 -0
- package/dist/adapters/index.d.ts +19 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/metrics.d.ts +111 -0
- package/dist/adapters/metrics.d.ts.map +1 -0
- package/dist/adapters/metrics.js +169 -0
- package/dist/adapters/metrics.js.map +1 -0
- package/dist/adapters/pubsub.d.ts +124 -0
- package/dist/adapters/pubsub.d.ts.map +1 -0
- package/dist/adapters/pubsub.js +121 -0
- package/dist/adapters/pubsub.js.map +1 -0
- package/dist/browser.d.ts +32 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +68 -0
- package/dist/browser.js.map +1 -0
- package/dist/child-accessors.d.ts +27 -0
- package/dist/child-accessors.d.ts.map +1 -0
- package/dist/child-accessors.js +35 -0
- package/dist/child-accessors.js.map +1 -0
- package/dist/class.d.ts +313 -0
- package/dist/class.d.ts.map +1 -0
- package/dist/class.js +896 -0
- package/dist/class.js.map +1 -0
- package/dist/collection-cache.d.ts +110 -0
- package/dist/collection-cache.d.ts.map +1 -0
- package/dist/collection-cache.js +187 -0
- package/dist/collection-cache.js.map +1 -0
- package/dist/collection.d.ts +894 -0
- package/dist/collection.d.ts.map +1 -0
- package/dist/collection.js +1987 -0
- package/dist/collection.js.map +1 -0
- package/dist/config/global-config.d.ts +3 -0
- package/dist/config/global-config.d.ts.map +1 -0
- package/dist/config/global-config.js +19 -0
- package/dist/config/global-config.js.map +1 -0
- package/dist/config.d.ts +145 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +57 -0
- package/dist/config.js.map +1 -0
- package/dist/consumer-plugin/index.d.ts +22 -0
- package/dist/consumer-plugin/index.d.ts.map +1 -0
- package/dist/consumer-plugin/index.js +452 -0
- package/dist/consumer-plugin/index.js.map +1 -0
- package/dist/consumer-plugin.d.ts +8 -0
- package/dist/consumer-plugin.d.ts.map +1 -0
- package/dist/consumer-plugin.js +5 -0
- package/dist/consumer-plugin.js.map +1 -0
- package/dist/database.d.ts +95 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +32 -0
- package/dist/database.js.map +1 -0
- package/dist/decorators/compatibility.d.ts +14 -0
- package/dist/decorators/compatibility.d.ts.map +1 -0
- package/dist/decorators/compatibility.js +111 -0
- package/dist/decorators/compatibility.js.map +1 -0
- package/dist/decorators/index.d.ts +381 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +104 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/dispatch/bus.d.ts +306 -0
- package/dist/dispatch/bus.d.ts.map +1 -0
- package/dist/dispatch/bus.js +583 -0
- package/dist/dispatch/bus.js.map +1 -0
- package/dist/dispatch/collections/DispatchSubscriptions.d.ts +79 -0
- package/dist/dispatch/collections/DispatchSubscriptions.d.ts.map +1 -0
- package/dist/dispatch/collections/DispatchSubscriptions.js +243 -0
- package/dist/dispatch/collections/DispatchSubscriptions.js.map +1 -0
- package/dist/dispatch/collections/Dispatches.d.ts +98 -0
- package/dist/dispatch/collections/Dispatches.d.ts.map +1 -0
- package/dist/dispatch/collections/Dispatches.js +358 -0
- package/dist/dispatch/collections/Dispatches.js.map +1 -0
- package/dist/dispatch/index.d.ts +47 -0
- package/dist/dispatch/index.d.ts.map +1 -0
- package/dist/dispatch/models/Dispatch.d.ts +101 -0
- package/dist/dispatch/models/Dispatch.d.ts.map +1 -0
- package/dist/dispatch/models/Dispatch.js +162 -0
- package/dist/dispatch/models/Dispatch.js.map +1 -0
- package/dist/dispatch/models/DispatchSubscription.d.ts +83 -0
- package/dist/dispatch/models/DispatchSubscription.d.ts.map +1 -0
- package/dist/dispatch/models/DispatchSubscription.js +112 -0
- package/dist/dispatch/models/DispatchSubscription.js.map +1 -0
- package/dist/dispatch/tenant-resolver.d.ts +98 -0
- package/dist/dispatch/tenant-resolver.d.ts.map +1 -0
- package/dist/dispatch/tenant-resolver.js +32 -0
- package/dist/dispatch/tenant-resolver.js.map +1 -0
- package/dist/dispatch/types.d.ts +149 -0
- package/dist/dispatch/types.d.ts.map +1 -0
- package/dist/embeddings/hash.d.ts +33 -0
- package/dist/embeddings/hash.d.ts.map +1 -0
- package/dist/embeddings/hash.js +37 -0
- package/dist/embeddings/hash.js.map +1 -0
- package/dist/embeddings/index.d.ts +36 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/provider.d.ts +75 -0
- package/dist/embeddings/provider.d.ts.map +1 -0
- package/dist/embeddings/provider.js +170 -0
- package/dist/embeddings/provider.js.map +1 -0
- package/dist/embeddings/similarity.d.ts +47 -0
- package/dist/embeddings/similarity.d.ts.map +1 -0
- package/dist/embeddings/similarity.js +64 -0
- package/dist/embeddings/similarity.js.map +1 -0
- package/dist/embeddings/storage.d.ts +125 -0
- package/dist/embeddings/storage.d.ts.map +1 -0
- package/dist/embeddings/storage.js +283 -0
- package/dist/embeddings/storage.js.map +1 -0
- package/dist/embeddings/types.d.ts +250 -0
- package/dist/embeddings/types.d.ts.map +1 -0
- package/dist/errors.d.ts +363 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +669 -0
- package/dist/errors.js.map +1 -0
- package/dist/generators/cli.d.ts +162 -0
- package/dist/generators/cli.d.ts.map +1 -0
- package/dist/generators/cli.js +462 -0
- package/dist/generators/cli.js.map +1 -0
- package/dist/generators/index.d.ts +13 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/mcp-runtime-template.d.ts +60 -0
- package/dist/generators/mcp-runtime-template.d.ts.map +1 -0
- package/dist/generators/mcp-runtime-template.js +509 -0
- package/dist/generators/mcp-runtime-template.js.map +1 -0
- package/dist/generators/mcp.d.ts +231 -0
- package/dist/generators/mcp.d.ts.map +1 -0
- package/dist/generators/mcp.js +1220 -0
- package/dist/generators/mcp.js.map +1 -0
- package/dist/generators/rest.d.ts +171 -0
- package/dist/generators/rest.d.ts.map +1 -0
- package/dist/generators/rest.js +591 -0
- package/dist/generators/rest.js.map +1 -0
- package/dist/generators/swagger.d.ts +21 -0
- package/dist/generators/swagger.d.ts.map +1 -0
- package/dist/generators/swagger.js +307 -0
- package/dist/generators/swagger.js.map +1 -0
- package/dist/generators/tenant-gate.d.ts +74 -0
- package/dist/generators/tenant-gate.d.ts.map +1 -0
- package/dist/generators/tenant-gate.js +15 -0
- package/dist/generators/tenant-gate.js.map +1 -0
- package/dist/generators.d.ts +8 -0
- package/dist/generators.d.ts.map +1 -0
- package/dist/generators.js +19 -0
- package/dist/generators.js.map +1 -0
- package/dist/hierarchical.d.ts +103 -0
- package/dist/hierarchical.d.ts.map +1 -0
- package/dist/hierarchical.js +184 -0
- package/dist/hierarchical.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +202 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptors.d.ts +251 -0
- package/dist/interceptors.d.ts.map +1 -0
- package/dist/interceptors.js +259 -0
- package/dist/interceptors.js.map +1 -0
- package/dist/junction.d.ts +99 -0
- package/dist/junction.d.ts.map +1 -0
- package/dist/junction.js +136 -0
- package/dist/junction.js.map +1 -0
- package/dist/knowledge.d.ts +11 -0
- package/dist/knowledge.d.ts.map +1 -0
- package/dist/knowledge.js +310 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/lazy-config.d.ts +160 -0
- package/dist/lazy-config.d.ts.map +1 -0
- package/dist/lazy-config.js +146 -0
- package/dist/lazy-config.js.map +1 -0
- package/dist/manifest/discover-base-classes.d.ts +78 -0
- package/dist/manifest/discover-base-classes.d.ts.map +1 -0
- package/dist/manifest/discover-base-classes.js +85 -0
- package/dist/manifest/discover-base-classes.js.map +1 -0
- package/dist/manifest/discover-smrt-packages.d.ts +48 -0
- package/dist/manifest/discover-smrt-packages.d.ts.map +1 -0
- package/dist/manifest/discover-smrt-packages.js +361 -0
- package/dist/manifest/discover-smrt-packages.js.map +1 -0
- package/dist/manifest/generator.d.ts +93 -0
- package/dist/manifest/generator.d.ts.map +1 -0
- package/dist/manifest/generator.js +380 -0
- package/dist/manifest/generator.js.map +1 -0
- package/dist/manifest/index.d.ts +16 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +51 -0
- package/dist/manifest/index.js.map +1 -0
- package/dist/manifest/manager.d.ts +51 -0
- package/dist/manifest/manager.d.ts.map +1 -0
- package/dist/manifest/manager.js +89 -0
- package/dist/manifest/manager.js.map +1 -0
- package/dist/manifest/manifest-loader.d.ts +187 -0
- package/dist/manifest/manifest-loader.d.ts.map +1 -0
- package/dist/manifest/manifest-loader.js +847 -0
- package/dist/manifest/manifest-loader.js.map +1 -0
- package/dist/manifest/sources/composite.d.ts +22 -0
- package/dist/manifest/sources/composite.d.ts.map +1 -0
- package/dist/manifest/sources/composite.js +60 -0
- package/dist/manifest/sources/composite.js.map +1 -0
- package/dist/manifest/sources/embedded.d.ts +7 -0
- package/dist/manifest/sources/embedded.d.ts.map +1 -0
- package/dist/manifest/sources/embedded.js +30 -0
- package/dist/manifest/sources/embedded.js.map +1 -0
- package/dist/manifest/sources/explicit-paths.d.ts +17 -0
- package/dist/manifest/sources/explicit-paths.d.ts.map +1 -0
- package/dist/manifest/sources/explicit-paths.js +35 -0
- package/dist/manifest/sources/explicit-paths.js.map +1 -0
- package/dist/manifest/sources/fallback.d.ts +25 -0
- package/dist/manifest/sources/fallback.d.ts.map +1 -0
- package/dist/manifest/sources/fallback.js +63 -0
- package/dist/manifest/sources/fallback.js.map +1 -0
- package/dist/manifest/sources/index.d.ts +17 -0
- package/dist/manifest/sources/index.d.ts.map +1 -0
- package/dist/manifest/sources/local-test.d.ts +7 -0
- package/dist/manifest/sources/local-test.d.ts.map +1 -0
- package/dist/manifest/sources/local-test.js +21 -0
- package/dist/manifest/sources/local-test.js.map +1 -0
- package/dist/manifest/sources/static.d.ts +7 -0
- package/dist/manifest/sources/static.d.ts.map +1 -0
- package/dist/manifest/sources/static.js +19 -0
- package/dist/manifest/sources/static.js.map +1 -0
- package/dist/manifest/sources/test.d.ts +7 -0
- package/dist/manifest/sources/test.d.ts.map +1 -0
- package/dist/manifest/sources/test.js +21 -0
- package/dist/manifest/sources/test.js.map +1 -0
- package/dist/manifest/sources/types.d.ts +79 -0
- package/dist/manifest/sources/types.d.ts.map +1 -0
- package/dist/manifest/sources/types.js +61 -0
- package/dist/manifest/sources/types.js.map +1 -0
- package/dist/manifest/static-manifest.d.ts +4 -0
- package/dist/manifest/static-manifest.d.ts.map +1 -0
- package/dist/manifest/static-manifest.js +1535 -0
- package/dist/manifest/static-manifest.js.map +1 -0
- package/dist/manifest/store.d.ts +111 -0
- package/dist/manifest/store.d.ts.map +1 -0
- package/dist/manifest/store.js +431 -0
- package/dist/manifest/store.js.map +1 -0
- package/dist/manifest/test-manifest-loader.d.ts +3 -0
- package/dist/manifest/test-manifest-loader.d.ts.map +1 -0
- package/dist/manifest/test-manifest-stub.d.ts +4 -0
- package/dist/manifest/test-manifest-stub.d.ts.map +1 -0
- package/dist/manifest/test-manifest-stub.js +80013 -0
- package/dist/manifest/test-manifest-stub.js.map +1 -0
- package/dist/manifest.d.ts +8 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +20 -0
- package/dist/manifest.js.map +1 -0
- package/dist/manifest.json +1489 -0
- package/dist/mcp-advisor/index.d.ts +499 -0
- package/dist/mcp-advisor/index.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/add-ai-methods.d.ts +6 -0
- package/dist/mcp-advisor/tools/add-ai-methods.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/configure-decorators.d.ts +6 -0
- package/dist/mcp-advisor/tools/configure-decorators.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/generate-collection.d.ts +6 -0
- package/dist/mcp-advisor/tools/generate-collection.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/generate-field-definitions.d.ts +6 -0
- package/dist/mcp-advisor/tools/generate-field-definitions.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/generate-smrt-class.d.ts +6 -0
- package/dist/mcp-advisor/tools/generate-smrt-class.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/get-object-config.d.ts +6 -0
- package/dist/mcp-advisor/tools/get-object-config.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/get-object-schema.d.ts +10 -0
- package/dist/mcp-advisor/tools/get-object-schema.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/list-registered-objects.d.ts +9 -0
- package/dist/mcp-advisor/tools/list-registered-objects.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/preview-api-endpoints.d.ts +9 -0
- package/dist/mcp-advisor/tools/preview-api-endpoints.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/preview-mcp-tools.d.ts +9 -0
- package/dist/mcp-advisor/tools/preview-mcp-tools.d.ts.map +1 -0
- package/dist/mcp-advisor/tools/validate-smrt-object.d.ts +6 -0
- package/dist/mcp-advisor/tools/validate-smrt-object.d.ts.map +1 -0
- package/dist/mcp-advisor/types.d.ts +209 -0
- package/dist/mcp-advisor/types.d.ts.map +1 -0
- package/dist/migrations/backfill-tracker.d.ts +84 -0
- package/dist/migrations/backfill-tracker.d.ts.map +1 -0
- package/dist/migrations/backfill-tracker.js +118 -0
- package/dist/migrations/backfill-tracker.js.map +1 -0
- package/dist/migrations/checksum.d.ts +43 -0
- package/dist/migrations/checksum.d.ts.map +1 -0
- package/dist/migrations/checksum.js +32 -0
- package/dist/migrations/checksum.js.map +1 -0
- package/dist/migrations/differ.d.ts +186 -0
- package/dist/migrations/differ.d.ts.map +1 -0
- package/dist/migrations/differ.js +601 -0
- package/dist/migrations/differ.js.map +1 -0
- package/dist/migrations/generator.d.ts +133 -0
- package/dist/migrations/generator.d.ts.map +1 -0
- package/dist/migrations/generator.js +328 -0
- package/dist/migrations/generator.js.map +1 -0
- package/dist/migrations/index.d.ts +20 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/orchestrate.d.ts +148 -0
- package/dist/migrations/orchestrate.d.ts.map +1 -0
- package/dist/migrations/orchestrate.js +118 -0
- package/dist/migrations/orchestrate.js.map +1 -0
- package/dist/migrations/tracker.d.ts +134 -0
- package/dist/migrations/tracker.d.ts.map +1 -0
- package/dist/migrations/tracker.js +624 -0
- package/dist/migrations/tracker.js.map +1 -0
- package/dist/migrations/types.d.ts +221 -0
- package/dist/migrations/types.d.ts.map +1 -0
- package/dist/migrations.d.ts +7 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +26 -0
- package/dist/migrations.js.map +1 -0
- package/dist/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +56 -0
- package/dist/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js.map +1 -0
- package/dist/node_modules/.pnpm/brace-expansion@5.0.5/node_modules/brace-expansion/dist/esm/index.js +163 -0
- package/dist/node_modules/.pnpm/brace-expansion@5.0.5/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/assert-valid-pattern.js +13 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/ast.js +654 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/brace-expressions.js +111 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/escape.js +10 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/index.js +824 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/unescape.js +10 -0
- package/dist/node_modules/.pnpm/minimatch@10.2.3/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/dist/object.d.ts +1202 -0
- package/dist/object.d.ts.map +1 -0
- package/dist/object.js +2731 -0
- package/dist/object.js.map +1 -0
- package/dist/polymorphic-association.d.ts +69 -0
- package/dist/polymorphic-association.d.ts.map +1 -0
- package/dist/polymorphic-association.js +96 -0
- package/dist/polymorphic-association.js.map +1 -0
- package/dist/prebuild/cli.d.ts +7 -0
- package/dist/prebuild/cli.d.ts.map +1 -0
- package/dist/prebuild/cli.js +29 -0
- package/dist/prebuild/cli.js.map +1 -0
- package/dist/prebuild/index.d.ts +22 -0
- package/dist/prebuild/index.d.ts.map +1 -0
- package/dist/prebuild/index.js +239 -0
- package/dist/prebuild/index.js.map +1 -0
- package/dist/prebuild.d.ts +8 -0
- package/dist/prebuild.d.ts.map +1 -0
- package/dist/prebuild.js +6 -0
- package/dist/prebuild.js.map +1 -0
- package/dist/registry/cache-config.d.ts +13 -0
- package/dist/registry/cache-config.d.ts.map +1 -0
- package/dist/registry/cache-config.js +17 -0
- package/dist/registry/cache-config.js.map +1 -0
- package/dist/registry/class-registration.d.ts +31 -0
- package/dist/registry/class-registration.d.ts.map +1 -0
- package/dist/registry/class-registration.js +1074 -0
- package/dist/registry/class-registration.js.map +1 -0
- package/dist/registry/collection-resolution.d.ts +45 -0
- package/dist/registry/collection-resolution.d.ts.map +1 -0
- package/dist/registry/collection-resolution.js +121 -0
- package/dist/registry/collection-resolution.js.map +1 -0
- package/dist/registry/collision-policy.d.ts +179 -0
- package/dist/registry/collision-policy.d.ts.map +1 -0
- package/dist/registry/collision-policy.js +153 -0
- package/dist/registry/collision-policy.js.map +1 -0
- package/dist/registry/diagnostics.d.ts +58 -0
- package/dist/registry/diagnostics.d.ts.map +1 -0
- package/dist/registry/diagnostics.js +54 -0
- package/dist/registry/diagnostics.js.map +1 -0
- package/dist/registry/embedding-manager.d.ts +23 -0
- package/dist/registry/embedding-manager.d.ts.map +1 -0
- package/dist/registry/embedding-manager.js +62 -0
- package/dist/registry/embedding-manager.js.map +1 -0
- package/dist/registry/index.d.ts +13 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/inheritance-resolver.d.ts +13 -0
- package/dist/registry/inheritance-resolver.d.ts.map +1 -0
- package/dist/registry/inheritance-resolver.js +244 -0
- package/dist/registry/inheritance-resolver.js.map +1 -0
- package/dist/registry/manifest-field-merge.d.ts +4 -0
- package/dist/registry/manifest-field-merge.d.ts.map +1 -0
- package/dist/registry/manifest-field-merge.js +82 -0
- package/dist/registry/manifest-field-merge.js.map +1 -0
- package/dist/registry/name-resolver.d.ts +102 -0
- package/dist/registry/name-resolver.d.ts.map +1 -0
- package/dist/registry/name-resolver.js +241 -0
- package/dist/registry/name-resolver.js.map +1 -0
- package/dist/registry/relationship-graph.d.ts +16 -0
- package/dist/registry/relationship-graph.d.ts.map +1 -0
- package/dist/registry/relationship-graph.js +79 -0
- package/dist/registry/relationship-graph.js.map +1 -0
- package/dist/registry/schema-builder.d.ts +113 -0
- package/dist/registry/schema-builder.d.ts.map +1 -0
- package/dist/registry/schema-builder.js +474 -0
- package/dist/registry/schema-builder.js.map +1 -0
- package/dist/registry/shared-state.d.ts +62 -0
- package/dist/registry/shared-state.d.ts.map +1 -0
- package/dist/registry/shared-state.js +135 -0
- package/dist/registry/shared-state.js.map +1 -0
- package/dist/registry/types.d.ts +667 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/validator.d.ts +13 -0
- package/dist/registry/validator.d.ts.map +1 -0
- package/dist/registry/validator.js +138 -0
- package/dist/registry/validator.js.map +1 -0
- package/dist/registry.d.ts +1358 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +2301 -0
- package/dist/registry.js.map +1 -0
- package/dist/runtime/client.d.ts +34 -0
- package/dist/runtime/client.d.ts.map +1 -0
- package/dist/runtime/client.js +104 -0
- package/dist/runtime/client.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/mcp.d.ts +47 -0
- package/dist/runtime/mcp.d.ts.map +1 -0
- package/dist/runtime/mcp.js +72 -0
- package/dist/runtime/mcp.js.map +1 -0
- package/dist/runtime/server.d.ts +92 -0
- package/dist/runtime/server.d.ts.map +1 -0
- package/dist/runtime/server.js +390 -0
- package/dist/runtime/server.js.map +1 -0
- package/dist/runtime/types.d.ts +58 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime.d.ts +8 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +10 -0
- package/dist/runtime.js.map +1 -0
- package/dist/scanner/import-scanner.d.ts +7 -0
- package/dist/scanner/import-scanner.d.ts.map +1 -0
- package/dist/scanner/index.d.ts +12 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/manifest-generator.d.ts +304 -0
- package/dist/scanner/manifest-generator.d.ts.map +1 -0
- package/dist/scanner/manifest-generator.js +1707 -0
- package/dist/scanner/manifest-generator.js.map +1 -0
- package/dist/scanner/test-file-patterns.d.ts +18 -0
- package/dist/scanner/test-file-patterns.d.ts.map +1 -0
- package/dist/scanner/test-file-patterns.js +16 -0
- package/dist/scanner/test-file-patterns.js.map +1 -0
- package/dist/scanner/types.d.ts +313 -0
- package/dist/scanner/types.d.ts.map +1 -0
- package/dist/scanner/types.js +2 -0
- package/dist/scanner/types.js.map +1 -0
- package/dist/scanner.d.ts +6 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +6 -0
- package/dist/scanner.js.map +1 -0
- package/dist/schema/code-generator.d.ts +53 -0
- package/dist/schema/code-generator.d.ts.map +1 -0
- package/dist/schema/ddl/base-strategy.d.ts +80 -0
- package/dist/schema/ddl/base-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/base-strategy.js +240 -0
- package/dist/schema/ddl/base-strategy.js.map +1 -0
- package/dist/schema/ddl/duckdb-strategy.d.ts +33 -0
- package/dist/schema/ddl/duckdb-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/duckdb-strategy.js +74 -0
- package/dist/schema/ddl/duckdb-strategy.js.map +1 -0
- package/dist/schema/ddl/index.d.ts +53 -0
- package/dist/schema/ddl/index.d.ts.map +1 -0
- package/dist/schema/ddl/index.js +80 -0
- package/dist/schema/ddl/index.js.map +1 -0
- package/dist/schema/ddl/json-duckdb-strategy.d.ts +8 -0
- package/dist/schema/ddl/json-duckdb-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/json-duckdb-strategy.js +14 -0
- package/dist/schema/ddl/json-duckdb-strategy.js.map +1 -0
- package/dist/schema/ddl/postgres-strategy.d.ts +29 -0
- package/dist/schema/ddl/postgres-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/postgres-strategy.js +102 -0
- package/dist/schema/ddl/postgres-strategy.js.map +1 -0
- package/dist/schema/ddl/sqlite-strategy.d.ts +38 -0
- package/dist/schema/ddl/sqlite-strategy.d.ts.map +1 -0
- package/dist/schema/ddl/sqlite-strategy.js +74 -0
- package/dist/schema/ddl/sqlite-strategy.js.map +1 -0
- package/dist/schema/ddl/types.d.ts +114 -0
- package/dist/schema/ddl/types.d.ts.map +1 -0
- package/dist/schema/generator.d.ts +176 -0
- package/dist/schema/generator.d.ts.map +1 -0
- package/dist/schema/generator.js +1076 -0
- package/dist/schema/generator.js.map +1 -0
- package/dist/schema/index-utils.d.ts +19 -0
- package/dist/schema/index-utils.d.ts.map +1 -0
- package/dist/schema/index-utils.js +32 -0
- package/dist/schema/index-utils.js.map +1 -0
- package/dist/schema/index.d.ts +13 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/override-system.d.ts +43 -0
- package/dist/schema/override-system.d.ts.map +1 -0
- package/dist/schema/schema-aggregator.d.ts +112 -0
- package/dist/schema/schema-aggregator.d.ts.map +1 -0
- package/dist/schema/schema-manager.d.ts +95 -0
- package/dist/schema/schema-manager.d.ts.map +1 -0
- package/dist/schema/schema-manager.js +283 -0
- package/dist/schema/schema-manager.js.map +1 -0
- package/dist/schema/sql-identifiers.d.ts +107 -0
- package/dist/schema/sql-identifiers.d.ts.map +1 -0
- package/dist/schema/sql-identifiers.js +190 -0
- package/dist/schema/sql-identifiers.js.map +1 -0
- package/dist/schema/table-verifier.d.ts +10 -0
- package/dist/schema/table-verifier.d.ts.map +1 -0
- package/dist/schema/table-verifier.js +37 -0
- package/dist/schema/table-verifier.js.map +1 -0
- package/dist/schema/types.d.ts +241 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/utils.d.ts +32 -0
- package/dist/schema/utils.d.ts.map +1 -0
- package/dist/schema/utils.js +134 -0
- package/dist/schema/utils.js.map +1 -0
- package/dist/scripts/create-wrappers.js +89 -0
- package/dist/scripts/generate-manifest.js +155 -0
- package/dist/scripts/generate-test-manifest.js +77 -0
- package/dist/scripts/migrate-datetime-to-timestamp.ts +310 -0
- package/dist/scripts/prepack.js +49 -0
- package/dist/signals/bus.d.ts +64 -0
- package/dist/signals/bus.d.ts.map +1 -0
- package/dist/signals/bus.js +102 -0
- package/dist/signals/bus.js.map +1 -0
- package/dist/signals/index.d.ts +11 -0
- package/dist/signals/index.d.ts.map +1 -0
- package/dist/signals/sanitizer.d.ts +54 -0
- package/dist/signals/sanitizer.d.ts.map +1 -0
- package/dist/signals/sanitizer.js +111 -0
- package/dist/signals/sanitizer.js.map +1 -0
- package/dist/smrt-knowledge.json +335 -0
- package/dist/system/compatibility.d.ts +8 -0
- package/dist/system/compatibility.d.ts.map +1 -0
- package/dist/system/compatibility.js +409 -0
- package/dist/system/compatibility.js.map +1 -0
- package/dist/system/index.d.ts +9 -0
- package/dist/system/index.d.ts.map +1 -0
- package/dist/system/schema.d.ts +69 -0
- package/dist/system/schema.d.ts.map +1 -0
- package/dist/system/schema.js +271 -0
- package/dist/system/schema.js.map +1 -0
- package/dist/system/types.d.ts +135 -0
- package/dist/system/types.d.ts.map +1 -0
- package/dist/system-fields.d.ts +44 -0
- package/dist/system-fields.d.ts.map +1 -0
- package/dist/system-fields.js +55 -0
- package/dist/system-fields.js.map +1 -0
- package/dist/table-cache.d.ts +28 -0
- package/dist/table-cache.d.ts.map +1 -0
- package/dist/table-cache.js +21 -0
- package/dist/table-cache.js.map +1 -0
- package/dist/test-utils.d.ts +140 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/testing/database.d.ts +73 -0
- package/dist/testing/database.d.ts.map +1 -0
- package/dist/testing/database.js +204 -0
- package/dist/testing/database.js.map +1 -0
- package/dist/testing/index.d.ts +21 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing.d.ts +6 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +5 -0
- package/dist/testing.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/tool-executor.d.ts +101 -0
- package/dist/tools/tool-executor.d.ts.map +1 -0
- package/dist/tools/tool-executor.js +142 -0
- package/dist/tools/tool-executor.js.map +1 -0
- package/dist/tools/tool-generator.d.ts +54 -0
- package/dist/tools/tool-generator.d.ts.map +1 -0
- package/dist/tools/tool-generator.js +121 -0
- package/dist/tools/tool-generator.js.map +1 -0
- package/dist/utils/chunk.d.ts +32 -0
- package/dist/utils/chunk.d.ts.map +1 -0
- package/dist/utils/chunk.js +14 -0
- package/dist/utils/chunk.js.map +1 -0
- package/dist/utils/import-workspace-module.d.ts +8 -0
- package/dist/utils/import-workspace-module.d.ts.map +1 -0
- package/dist/utils/import-workspace-module.js +81 -0
- package/dist/utils/import-workspace-module.js.map +1 -0
- package/dist/utils/json.d.ts +102 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +43 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/lru-cache.d.ts +69 -0
- package/dist/utils/lru-cache.d.ts.map +1 -0
- package/dist/utils/lru-cache.js +100 -0
- package/dist/utils/lru-cache.js.map +1 -0
- package/dist/utils/naming.d.ts +16 -0
- package/dist/utils/naming.d.ts.map +1 -0
- package/dist/utils/naming.js +23 -0
- package/dist/utils/naming.js.map +1 -0
- package/dist/utils/qualified-names.d.ts +122 -0
- package/dist/utils/qualified-names.d.ts.map +1 -0
- package/dist/utils/qualified-names.js +82 -0
- package/dist/utils/qualified-names.js.map +1 -0
- package/dist/utils/scanner-module.d.ts +37 -0
- package/dist/utils/scanner-module.d.ts.map +1 -0
- package/dist/utils.d.ts +177 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +185 -0
- package/dist/utils.js.map +1 -0
- package/dist/vite-plugin/import-build-aware.d.ts +68 -0
- package/dist/vite-plugin/import-build-aware.d.ts.map +1 -0
- package/dist/vite-plugin/import-build-aware.js +72 -0
- package/dist/vite-plugin/import-build-aware.js.map +1 -0
- package/dist/vite-plugin/index.d.ts +59 -0
- package/dist/vite-plugin/index.d.ts.map +1 -0
- package/dist/vite-plugin/index.js +1400 -0
- package/dist/vite-plugin/index.js.map +1 -0
- package/dist/vite-plugin/sveltekit-generator.d.ts +66 -0
- package/dist/vite-plugin/sveltekit-generator.d.ts.map +1 -0
- package/dist/vite-plugin/sveltekit-generator.js +1375 -0
- package/dist/vite-plugin/sveltekit-generator.js.map +1 -0
- package/dist/vite-plugin/templates/default-ui.ts +432 -0
- package/dist/vite-plugin/templates/default.html +206 -0
- package/dist/vite-plugin.d.ts +8 -0
- package/dist/vite-plugin.d.ts.map +1 -0
- package/dist/vite-plugin.js +11 -0
- package/dist/vite-plugin.js.map +1 -0
- package/package.json +208 -0
|
@@ -0,0 +1,667 @@
|
|
|
1
|
+
import { DomainKnowledgeConfig } from '@happyvertical/smrt-types';
|
|
2
|
+
import { SmrtCollection } from '../collection';
|
|
3
|
+
import { CollectionCacheConfig } from '../collection-cache';
|
|
4
|
+
import { SmrtObject } from '../object';
|
|
5
|
+
import { QualifiedClassName, SmartObjectManifest, SmrtVisibility, ValidationRule } from '../scanner/types.js';
|
|
6
|
+
import { SchemaDefinition } from '../schema/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Type for any constructor function that extends SmrtObject.
|
|
9
|
+
* Used for WeakMap keys where we need to accept any subclass constructor.
|
|
10
|
+
*/
|
|
11
|
+
export type SmrtObjectConstructor = new (...args: any[]) => SmrtObject;
|
|
12
|
+
export type ApiHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
13
|
+
export interface ApiSerializerReference {
|
|
14
|
+
/**
|
|
15
|
+
* Module specifier to import the serializer from.
|
|
16
|
+
*
|
|
17
|
+
* Supports package imports and project aliases such as `$lib/...`.
|
|
18
|
+
*/
|
|
19
|
+
importPath: string;
|
|
20
|
+
/**
|
|
21
|
+
* Named export to use as the serializer function.
|
|
22
|
+
*/
|
|
23
|
+
exportName: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ApiCustomRouteConfig {
|
|
26
|
+
/**
|
|
27
|
+
* Route scope for custom methods.
|
|
28
|
+
* - `item`: Generates `/<collection>/[id]/<path>`
|
|
29
|
+
* - `collection`: Generates `/<collection>/<path>`
|
|
30
|
+
*
|
|
31
|
+
* Defaults to `collection` for static methods and `item` for instance methods.
|
|
32
|
+
*/
|
|
33
|
+
scope?: 'item' | 'collection';
|
|
34
|
+
/**
|
|
35
|
+
* HTTP verb for the generated route.
|
|
36
|
+
* Defaults to `POST` for custom actions.
|
|
37
|
+
*/
|
|
38
|
+
method?: ApiHttpMethod;
|
|
39
|
+
/**
|
|
40
|
+
* Optional custom path segment for the route.
|
|
41
|
+
* Defaults to the method name.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* routes: {
|
|
46
|
+
* browseFacts: { scope: 'collection', method: 'GET', path: 'facts' }
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
path?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ApiSerializersConfig {
|
|
53
|
+
/**
|
|
54
|
+
* Custom serializers REPLACE the framework's default `toPublicJSON()`
|
|
55
|
+
* serialization on generated routes. Security (#1540): when you supply a
|
|
56
|
+
* serializer you are responsible for excluding `@field({ sensitive: true })`
|
|
57
|
+
* fields — a serializer that returns `item.toJSON()` (or spreads all fields)
|
|
58
|
+
* will leak secrets that the default path would have stripped.
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* Serializer used for standard item responses (`get`, `create`, `update`).
|
|
62
|
+
*/
|
|
63
|
+
item?: ApiSerializerReference;
|
|
64
|
+
/**
|
|
65
|
+
* Serializer used for standard list responses.
|
|
66
|
+
*
|
|
67
|
+
* When omitted, SMRT falls back to `item` for each list entry.
|
|
68
|
+
*/
|
|
69
|
+
listItem?: ApiSerializerReference;
|
|
70
|
+
}
|
|
71
|
+
export interface ApiConfig {
|
|
72
|
+
/**
|
|
73
|
+
* Optional collection path override for generated CRUD routes.
|
|
74
|
+
*
|
|
75
|
+
* When omitted, SMRT derives the path from `tableName` by replacing `_` with `-`.
|
|
76
|
+
* This remains the supported way to keep legacy/public route shapes stable when
|
|
77
|
+
* the storage table name differs from the desired URL segment.
|
|
78
|
+
*/
|
|
79
|
+
path?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Exclude specific endpoints (supports both standard CRUD actions and custom methods)
|
|
82
|
+
*/
|
|
83
|
+
exclude?: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Include only specific endpoints (supports both standard CRUD actions and custom methods)
|
|
86
|
+
*/
|
|
87
|
+
include?: string[];
|
|
88
|
+
/**
|
|
89
|
+
* Custom middleware for this object's endpoints
|
|
90
|
+
*/
|
|
91
|
+
middleware?: any[];
|
|
92
|
+
/**
|
|
93
|
+
* Custom endpoint handlers (supports both standard CRUD actions and custom methods)
|
|
94
|
+
*/
|
|
95
|
+
customize?: Record<string, (req: any, collection: any) => Promise<any>>;
|
|
96
|
+
/**
|
|
97
|
+
* Route metadata for custom API methods.
|
|
98
|
+
* Lets generated routes declare collection-vs-item scope, HTTP verb, and path.
|
|
99
|
+
*/
|
|
100
|
+
routes?: Record<string, ApiCustomRouteConfig>;
|
|
101
|
+
/**
|
|
102
|
+
* Optional serializers for standard generated CRUD responses.
|
|
103
|
+
* Useful when item JSON needs async enrichment beyond `transformJSON()`.
|
|
104
|
+
*/
|
|
105
|
+
serializers?: ApiSerializersConfig;
|
|
106
|
+
/**
|
|
107
|
+
* Authorization posture for generated CRUD routes (fail-closed by default).
|
|
108
|
+
*
|
|
109
|
+
* Generated REST / MCP / SvelteKit routes require an authenticated principal
|
|
110
|
+
* on `locals` (e.g. `locals.user` / `locals.session`) unless this opts out:
|
|
111
|
+
* - `false` (default): every route requires authentication — reads and writes.
|
|
112
|
+
* - `true`: all routes are public (no auth required). Use only for genuinely
|
|
113
|
+
* public data.
|
|
114
|
+
* - `'read'`: read routes (`list`/`get`) are public, but mutating routes
|
|
115
|
+
* (`create`/`update`/`delete`) still require authentication.
|
|
116
|
+
*
|
|
117
|
+
* This is a security default: omitting it means the routes are protected.
|
|
118
|
+
*/
|
|
119
|
+
public?: boolean | 'read';
|
|
120
|
+
/**
|
|
121
|
+
* Allowlist of field names that may be set from the request body on generated
|
|
122
|
+
* `create`/`update` routes.
|
|
123
|
+
*
|
|
124
|
+
* When set, only these fields are accepted; everything else in the body is
|
|
125
|
+
* dropped. Regardless of this list, framework/server-managed fields (`id`,
|
|
126
|
+
* `tenantId`, timestamps, `_`-prefixed) and `@field({ readonly: true })`
|
|
127
|
+
* fields are always stripped to prevent mass-assignment.
|
|
128
|
+
*/
|
|
129
|
+
writable?: string[];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Configuration options for SMRT objects registered in the system
|
|
133
|
+
*
|
|
134
|
+
* Controls how objects are exposed through generated APIs, CLIs, and MCP servers.
|
|
135
|
+
* Each section configures a different aspect of code generation and runtime behavior.
|
|
136
|
+
*
|
|
137
|
+
* @interface SmartObjectConfig
|
|
138
|
+
*/
|
|
139
|
+
export interface SmartObjectConfig {
|
|
140
|
+
/**
|
|
141
|
+
* Custom name for the object (defaults to class name)
|
|
142
|
+
*/
|
|
143
|
+
name?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Explicit package name for deterministic qualified registration.
|
|
146
|
+
*
|
|
147
|
+
* Build tools should prefer setting this instead of relying on runtime
|
|
148
|
+
* stack/package.json discovery, which can fail in bundled deployments.
|
|
149
|
+
*/
|
|
150
|
+
packageName?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Custom table name for database storage (defaults to pluralized snake_case class name)
|
|
153
|
+
* Explicitly setting this ensures the table name survives code minification
|
|
154
|
+
*/
|
|
155
|
+
tableName?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Storage type for the synthetic `id` primary key (defaults to 'uuid').
|
|
158
|
+
*
|
|
159
|
+
* Use 'text' only for models that intentionally generate non-UUID ids.
|
|
160
|
+
* On SQLite, UUID maps to TEXT at DDL render time because SQLite has no
|
|
161
|
+
* native UUID type.
|
|
162
|
+
*/
|
|
163
|
+
idType?: 'uuid' | 'text';
|
|
164
|
+
/**
|
|
165
|
+
* Table inheritance strategy (defaults to 'cti')
|
|
166
|
+
* - 'cti': Class Table Inheritance - one table per class (current default)
|
|
167
|
+
* - 'sti': Single Table Inheritance - shared table with discriminator column
|
|
168
|
+
*
|
|
169
|
+
* Set once on base class, children inherit automatically.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* @smrt({ tableStrategy: 'sti' })
|
|
174
|
+
* class Event extends SmrtObject {
|
|
175
|
+
* title: string = '';
|
|
176
|
+
* }
|
|
177
|
+
*
|
|
178
|
+
* // Meeting inherits 'sti' strategy
|
|
179
|
+
* @smrt()
|
|
180
|
+
* class Meeting extends Event {
|
|
181
|
+
* roomId = foreignKey(Room);
|
|
182
|
+
* }
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
tableStrategy?: 'cti' | 'sti';
|
|
186
|
+
/**
|
|
187
|
+
* Custom conflict columns for UPSERT operations
|
|
188
|
+
*
|
|
189
|
+
* By default, SMRT uses ['slug', 'context'] for CTI tables and
|
|
190
|
+
* ['slug', 'context', '_meta_type'] for STI tables. Override this
|
|
191
|
+
* for junction tables or models with different natural keys.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```typescript
|
|
195
|
+
* // Junction table using foreign keys as natural key
|
|
196
|
+
* @smrt({ conflictColumns: ['event_id', 'profile_id'] })
|
|
197
|
+
* class EventParticipant extends SmrtObject {
|
|
198
|
+
* eventId = '';
|
|
199
|
+
* profileId = '';
|
|
200
|
+
* }
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
conflictColumns?: string[];
|
|
204
|
+
/**
|
|
205
|
+
* Opt-in read-through cache for collection reads (issue #1498).
|
|
206
|
+
*
|
|
207
|
+
* When set, `collection.list()` and `collection.get()` memoize result
|
|
208
|
+
* rows for `ttl` milliseconds. Mutations through SMRT (`save()`,
|
|
209
|
+
* `delete()`, `collection.create()`, `getOrUpsert()`, junction
|
|
210
|
+
* attach/detach) automatically invalidate the table's cached entries
|
|
211
|
+
* in-process. With `crossProcess: true`, invalidations also broadcast to
|
|
212
|
+
* peer replicas via the database adapter's notification capability
|
|
213
|
+
* (e.g. Postgres LISTEN/NOTIFY) when the adapter provides one.
|
|
214
|
+
*
|
|
215
|
+
* Defaults to off — caching is opinionated and silently serving stale
|
|
216
|
+
* rows would be a footgun. Children inherit the nearest ancestor's
|
|
217
|
+
* setting; set `cache: false` on a child to opt back out. Per-call
|
|
218
|
+
* options override this: `list({ cache: false })` forces a fresh read,
|
|
219
|
+
* `list({ cache: { ttl } })` enables caching for that call only.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```typescript
|
|
223
|
+
* @smrt({ cache: { ttl: 60_000 } })
|
|
224
|
+
* class Product extends SmrtObject {
|
|
225
|
+
* name: string = '';
|
|
226
|
+
* }
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
cache?: CollectionCacheConfig | false;
|
|
230
|
+
/**
|
|
231
|
+
* Visibility control for manifest inclusion and cross-package access
|
|
232
|
+
* - 'public': Included in published manifest, available to all consumers (default)
|
|
233
|
+
* - 'internal': Package-only, excluded from published manifest
|
|
234
|
+
* - 'test': Test-only, never in any published manifest
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```typescript
|
|
238
|
+
* // Public class (default) - exported to consumers
|
|
239
|
+
* @smrt({ visibility: 'public' })
|
|
240
|
+
* class Product extends SmrtObject {}
|
|
241
|
+
*
|
|
242
|
+
* // Internal helper class - not exported
|
|
243
|
+
* @smrt({ visibility: 'internal' })
|
|
244
|
+
* class InternalHelper extends SmrtObject {}
|
|
245
|
+
*
|
|
246
|
+
* // Test fixture - never exported
|
|
247
|
+
* @smrt({ visibility: 'test' })
|
|
248
|
+
* class TestProduct extends SmrtObject {}
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
visibility?: SmrtVisibility;
|
|
252
|
+
/**
|
|
253
|
+
* Agent/developer knowledge metadata.
|
|
254
|
+
*
|
|
255
|
+
* Set to false to exclude this object from generated smrt-knowledge.json
|
|
256
|
+
* without changing runtime manifest registration. Object-level metadata
|
|
257
|
+
* augments package-level knowledge defaults from smrt.config.
|
|
258
|
+
*/
|
|
259
|
+
knowledge?: false | Pick<DomainKnowledgeConfig, 'tags' | 'summary' | 'risks'>;
|
|
260
|
+
/**
|
|
261
|
+
* API configuration
|
|
262
|
+
*/
|
|
263
|
+
api?: boolean | ApiConfig;
|
|
264
|
+
/**
|
|
265
|
+
* MCP server configuration
|
|
266
|
+
*/
|
|
267
|
+
mcp?: boolean | {
|
|
268
|
+
/**
|
|
269
|
+
* Include specific tools (supports both standard CRUD actions and custom methods)
|
|
270
|
+
*/
|
|
271
|
+
include?: string[];
|
|
272
|
+
/**
|
|
273
|
+
* Exclude specific tools (supports both standard CRUD actions and custom methods)
|
|
274
|
+
*/
|
|
275
|
+
exclude?: string[];
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* CLI configuration
|
|
279
|
+
*/
|
|
280
|
+
cli?: boolean | {
|
|
281
|
+
/**
|
|
282
|
+
* Include specific commands (supports both standard CRUD actions and custom methods)
|
|
283
|
+
*/
|
|
284
|
+
include?: string[];
|
|
285
|
+
/**
|
|
286
|
+
* Exclude specific commands (supports both standard CRUD actions and custom methods)
|
|
287
|
+
*/
|
|
288
|
+
exclude?: string[];
|
|
289
|
+
/**
|
|
290
|
+
* Skip the build-time check that every `cli.include` method is also
|
|
291
|
+
* exposed via the API. Set this for classes whose CLI is invoked
|
|
292
|
+
* in-process (e.g. admin/security tools intentionally without HTTP
|
|
293
|
+
* routes) rather than over HTTP.
|
|
294
|
+
*/
|
|
295
|
+
skipApiCheck?: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Whether this CLI surface should be advertised through HTTP discovery
|
|
298
|
+
* (`GET /api/_resources`) for `@happyvertical/smrt-app-cli`.
|
|
299
|
+
*
|
|
300
|
+
* Set to `false` for package-internal or in-process CLI resources that
|
|
301
|
+
* may still be useful to local generators but do not have app HTTP
|
|
302
|
+
* routes in downstream deployments.
|
|
303
|
+
*/
|
|
304
|
+
http?: boolean;
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* AI callable configuration
|
|
308
|
+
*/
|
|
309
|
+
ai?: {
|
|
310
|
+
/**
|
|
311
|
+
* Methods that AI can call
|
|
312
|
+
* - Array of method names, e.g., ['analyze', 'validate']
|
|
313
|
+
* - 'public-async' to auto-include all public async methods
|
|
314
|
+
* - 'all' to include all methods (not recommended)
|
|
315
|
+
*/
|
|
316
|
+
callable?: string[] | 'public-async' | 'all';
|
|
317
|
+
/**
|
|
318
|
+
* Methods to exclude from AI calling (higher priority than callable)
|
|
319
|
+
*/
|
|
320
|
+
exclude?: string[];
|
|
321
|
+
/**
|
|
322
|
+
* Additional tool descriptions to override method JSDoc
|
|
323
|
+
*/
|
|
324
|
+
descriptions?: Record<string, string>;
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* Lifecycle hooks
|
|
328
|
+
*/
|
|
329
|
+
hooks?: {
|
|
330
|
+
beforeSave?: string | ((instance: any) => Promise<void>);
|
|
331
|
+
afterSave?: string | ((instance: any) => Promise<void>);
|
|
332
|
+
beforeCreate?: string | ((instance: any) => Promise<void>);
|
|
333
|
+
afterCreate?: string | ((instance: any) => Promise<void>);
|
|
334
|
+
beforeUpdate?: string | ((instance: any) => Promise<void>);
|
|
335
|
+
afterUpdate?: string | ((instance: any) => Promise<void>);
|
|
336
|
+
beforeDelete?: string | ((instance: any) => Promise<void>);
|
|
337
|
+
afterDelete?: string | ((instance: any) => Promise<void>);
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Embedding configuration for semantic search
|
|
341
|
+
*
|
|
342
|
+
* Enable vector embeddings on this class for similarity search.
|
|
343
|
+
* Project-level defaults come from smrt.config embeddings section.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```typescript
|
|
347
|
+
* @smrt({
|
|
348
|
+
* embeddings: {
|
|
349
|
+
* fields: ['title', 'body'],
|
|
350
|
+
* autoGenerate: true
|
|
351
|
+
* }
|
|
352
|
+
* })
|
|
353
|
+
* class Article extends SmrtObject {
|
|
354
|
+
* title: string = '';
|
|
355
|
+
* body: string = '';
|
|
356
|
+
* }
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
embeddings?: {
|
|
360
|
+
/**
|
|
361
|
+
* Fields to generate embeddings for
|
|
362
|
+
* Each field gets its own embedding vector stored in _smrt_embeddings
|
|
363
|
+
*/
|
|
364
|
+
fields: string[];
|
|
365
|
+
/**
|
|
366
|
+
* Override project-level embedding provider
|
|
367
|
+
* - 'local': Use local Node.js model (@xenova/transformers)
|
|
368
|
+
* - 'ai': Use AI library (OpenAI, etc.)
|
|
369
|
+
* - 'auto': Try local first, fallback to AI
|
|
370
|
+
*/
|
|
371
|
+
provider?: 'local' | 'ai' | 'auto';
|
|
372
|
+
/**
|
|
373
|
+
* Automatically generate embeddings on save
|
|
374
|
+
* Only regenerates when content changes (via content hash)
|
|
375
|
+
* @default true
|
|
376
|
+
*/
|
|
377
|
+
autoGenerate?: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* Regenerate embeddings when field content changes
|
|
380
|
+
* Uses content hash comparison to detect changes
|
|
381
|
+
* @default true
|
|
382
|
+
*/
|
|
383
|
+
regenerateOnChange?: boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Create a combined embedding from multiple fields
|
|
386
|
+
* Useful for holistic similarity search across an object
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* ```typescript
|
|
390
|
+
* combinedField: {
|
|
391
|
+
* name: 'content',
|
|
392
|
+
* template: '{title}\n\n{body}'
|
|
393
|
+
* }
|
|
394
|
+
* ```
|
|
395
|
+
*/
|
|
396
|
+
combinedField?: {
|
|
397
|
+
/** Field name for the combined embedding */
|
|
398
|
+
name: string;
|
|
399
|
+
/** Template with {fieldName} placeholders */
|
|
400
|
+
template: string;
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* Multi-tenancy configuration
|
|
405
|
+
*
|
|
406
|
+
* Enable automatic tenant isolation for this class.
|
|
407
|
+
* When enabled, a `tenantId` field is auto-injected and queries are
|
|
408
|
+
* automatically filtered by tenant context.
|
|
409
|
+
*
|
|
410
|
+
* Requires `@happyvertical/smrt-tenancy` package to be installed
|
|
411
|
+
* and `enableTenancy()` to be called at app startup.
|
|
412
|
+
*
|
|
413
|
+
* @example Simple boolean flag (uses defaults)
|
|
414
|
+
* ```typescript
|
|
415
|
+
* @smrt({ tenantScoped: true })
|
|
416
|
+
* class Account extends SmrtObject {
|
|
417
|
+
* // tenantId field auto-injected
|
|
418
|
+
* name: string = '';
|
|
419
|
+
* }
|
|
420
|
+
* ```
|
|
421
|
+
*
|
|
422
|
+
* @example With custom options
|
|
423
|
+
* ```typescript
|
|
424
|
+
* @smrt({
|
|
425
|
+
* tenantScoped: {
|
|
426
|
+
* mode: 'optional', // Works with or without tenant context
|
|
427
|
+
* allowSuperAdminBypass: true
|
|
428
|
+
* }
|
|
429
|
+
* })
|
|
430
|
+
* class AuditLog extends SmrtObject { }
|
|
431
|
+
* ```
|
|
432
|
+
*
|
|
433
|
+
* @see https://github.com/happyvertical/smrt/issues/688
|
|
434
|
+
*/
|
|
435
|
+
tenantScoped?: boolean | {
|
|
436
|
+
/**
|
|
437
|
+
* Tenancy mode for this class
|
|
438
|
+
* - 'required': Must have tenant context for all operations (default)
|
|
439
|
+
* - 'optional': Works with or without tenant context
|
|
440
|
+
* @default 'required'
|
|
441
|
+
*/
|
|
442
|
+
mode?: 'required' | 'optional';
|
|
443
|
+
/**
|
|
444
|
+
* Field name for the tenant ID
|
|
445
|
+
* @default 'tenantId'
|
|
446
|
+
*/
|
|
447
|
+
field?: string;
|
|
448
|
+
/**
|
|
449
|
+
* Auto-filter all queries by tenant
|
|
450
|
+
* @default true
|
|
451
|
+
*/
|
|
452
|
+
autoFilter?: boolean;
|
|
453
|
+
/**
|
|
454
|
+
* Auto-populate tenant ID from context on create
|
|
455
|
+
* @default true
|
|
456
|
+
*/
|
|
457
|
+
autoPopulate?: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* Allow super admin bypass for this class
|
|
460
|
+
* @default false
|
|
461
|
+
*/
|
|
462
|
+
allowSuperAdminBypass?: boolean;
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* Code-owned feature toggle declarations for this class.
|
|
466
|
+
*
|
|
467
|
+
* Feature definitions live in code and can be synced into runtime metadata
|
|
468
|
+
* stores by downstream packages (for example `@happyvertical/smrt-features`).
|
|
469
|
+
* Each feature is identified by a class-local key that becomes part of the
|
|
470
|
+
* canonical feature key `<qualifiedClassName>#<localId>`.
|
|
471
|
+
*
|
|
472
|
+
* V1 supports boolean flags only.
|
|
473
|
+
*/
|
|
474
|
+
features?: Record<string, {
|
|
475
|
+
/**
|
|
476
|
+
* Default enabled state before runtime overrides are applied.
|
|
477
|
+
*/
|
|
478
|
+
defaultEnabled: boolean;
|
|
479
|
+
/**
|
|
480
|
+
* Human-friendly label for admin UIs and generated docs.
|
|
481
|
+
*/
|
|
482
|
+
label?: string;
|
|
483
|
+
/**
|
|
484
|
+
* Optional description explaining what the feature does.
|
|
485
|
+
*/
|
|
486
|
+
description?: string;
|
|
487
|
+
/**
|
|
488
|
+
* Additional code-owned metadata for applications.
|
|
489
|
+
*/
|
|
490
|
+
metadata?: Record<string, unknown>;
|
|
491
|
+
}>;
|
|
492
|
+
/**
|
|
493
|
+
* Agent metadata configuration
|
|
494
|
+
*
|
|
495
|
+
* Only relevant for classes extending Agent. Provides metadata
|
|
496
|
+
* that the manifest build uses to auto-generate permissions, features,
|
|
497
|
+
* menu items, and component declarations.
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* ```typescript
|
|
501
|
+
* @smrt({
|
|
502
|
+
* tableName: 'praecos',
|
|
503
|
+
* agent: {
|
|
504
|
+
* icon: 'newspaper',
|
|
505
|
+
* tier: 'standard',
|
|
506
|
+
* description: 'Council meeting coverage and article generation',
|
|
507
|
+
* },
|
|
508
|
+
* cli: { include: ['discover', 'fetch', 'analyze'] },
|
|
509
|
+
* })
|
|
510
|
+
* export class Praeco extends Agent { }
|
|
511
|
+
* ```
|
|
512
|
+
*/
|
|
513
|
+
agent?: {
|
|
514
|
+
/** Icon identifier (e.g., 'newspaper', 'cloud', 'git-branch') */
|
|
515
|
+
icon?: string;
|
|
516
|
+
/** Billing tier: 'free' | 'standard' | 'premium' */
|
|
517
|
+
tier?: 'free' | 'standard' | 'premium';
|
|
518
|
+
/** Human-readable description of the agent */
|
|
519
|
+
description?: string;
|
|
520
|
+
};
|
|
521
|
+
/**
|
|
522
|
+
* Optional UI hints consumed by `@happyvertical/smrt-svelte`'s
|
|
523
|
+
* `navTreeFromManifest()` helper (and any other manifest → admin-UI
|
|
524
|
+
* adapters). The framework itself never reads these — they round-trip
|
|
525
|
+
* through the generated manifest as plain data, letting consumers
|
|
526
|
+
* declare icon glyphs / labels next to the model rather than in a
|
|
527
|
+
* separate hand-written nav config.
|
|
528
|
+
*
|
|
529
|
+
* Kept deliberately minimal. Adding apparel-specific terminology or
|
|
530
|
+
* design-system-specific shapes here would couple the framework to a
|
|
531
|
+
* vertical; consumers that need richer hints should layer their own
|
|
532
|
+
* adapter on top.
|
|
533
|
+
*
|
|
534
|
+
* @example
|
|
535
|
+
* ```typescript
|
|
536
|
+
* @smrt({
|
|
537
|
+
* ui: { icon: 'newspaper', label: 'News articles' },
|
|
538
|
+
* })
|
|
539
|
+
* class Article extends SmrtObject { ... }
|
|
540
|
+
* ```
|
|
541
|
+
*/
|
|
542
|
+
ui?: {
|
|
543
|
+
/**
|
|
544
|
+
* Icon identifier / glyph / emoji passed straight through to
|
|
545
|
+
* generated nav entries. Interpretation is consumer-defined — the
|
|
546
|
+
* framework only persists the string.
|
|
547
|
+
*/
|
|
548
|
+
icon?: string;
|
|
549
|
+
/**
|
|
550
|
+
* Override the auto-pluralized label used for generated nav entries
|
|
551
|
+
* (e.g. `Article` → "Articles"). Leave undefined to use the default.
|
|
552
|
+
*/
|
|
553
|
+
label?: string;
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Synchronous manifest for build-time imports (Issue #270 Phase 1)
|
|
557
|
+
* Allows passing manifest directly instead of async loading
|
|
558
|
+
* @internal Advanced usage - typically set by build tools
|
|
559
|
+
*/
|
|
560
|
+
_manifest?: SmartObjectManifest;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Validation function that takes an object instance and returns
|
|
564
|
+
* a ValidationError if validation fails, or null if validation passes
|
|
565
|
+
*/
|
|
566
|
+
export type ValidatorFunction = (instance: any) => Promise<import('../errors').ValidationError | null>;
|
|
567
|
+
/**
|
|
568
|
+
* Relationship type for the relationship map
|
|
569
|
+
*/
|
|
570
|
+
export type RelationshipType = 'foreignKey' | 'crossPackageRef' | 'oneToMany' | 'manyToMany';
|
|
571
|
+
/**
|
|
572
|
+
* Metadata about a relationship between classes
|
|
573
|
+
*/
|
|
574
|
+
export interface RelationshipMetadata {
|
|
575
|
+
/** Source class name */
|
|
576
|
+
sourceClass: string;
|
|
577
|
+
/** Field name on the source class */
|
|
578
|
+
fieldName: string;
|
|
579
|
+
/** Target/related class name */
|
|
580
|
+
targetClass: string;
|
|
581
|
+
/** Type of relationship */
|
|
582
|
+
type: RelationshipType;
|
|
583
|
+
/** Options for the relationship (onDelete, etc.) */
|
|
584
|
+
options: any;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Internal representation of a registered SMRT class
|
|
588
|
+
*
|
|
589
|
+
* @interface RegisteredClass
|
|
590
|
+
*/
|
|
591
|
+
export interface RegisteredClass {
|
|
592
|
+
/**
|
|
593
|
+
* Simple class name (e.g., "Product")
|
|
594
|
+
*/
|
|
595
|
+
name: string;
|
|
596
|
+
/**
|
|
597
|
+
* Qualified class name in format "@package/name:ClassName"
|
|
598
|
+
* This is the PRIMARY KEY for registry lookups.
|
|
599
|
+
* Example: "@happyvertical/smrt-core:Product"
|
|
600
|
+
*/
|
|
601
|
+
qualifiedName?: QualifiedClassName;
|
|
602
|
+
constructor: typeof SmrtObject;
|
|
603
|
+
collectionConstructor?: new (options: any) => SmrtCollection<any>;
|
|
604
|
+
config: SmartObjectConfig;
|
|
605
|
+
fields: Map<string, any>;
|
|
606
|
+
/** Method definitions from manifest (for custom CLI/API/MCP generation) */
|
|
607
|
+
methods: Map<string, any>;
|
|
608
|
+
/** Cached schema definition generated during registration */
|
|
609
|
+
schema?: SchemaDefinition;
|
|
610
|
+
/** Compiled validation functions for efficient runtime validation */
|
|
611
|
+
validators?: ValidatorFunction[];
|
|
612
|
+
/**
|
|
613
|
+
* Pre-computed validation rules from manifest (Issue #782)
|
|
614
|
+
* When available, these are used instead of compiling validator closures,
|
|
615
|
+
* significantly reducing CLI startup time.
|
|
616
|
+
*/
|
|
617
|
+
validationRules?: ValidationRule[];
|
|
618
|
+
/** AI-callable tools generated from methods at build time */
|
|
619
|
+
tools?: Array<{
|
|
620
|
+
type: 'function';
|
|
621
|
+
function: {
|
|
622
|
+
name: string;
|
|
623
|
+
description?: string;
|
|
624
|
+
parameters?: Record<string, any>;
|
|
625
|
+
};
|
|
626
|
+
}>;
|
|
627
|
+
/** Package name from manifest (for external package classes) */
|
|
628
|
+
packageName?: string;
|
|
629
|
+
/** Source file path where the class was defined (for collision detection) */
|
|
630
|
+
sourceFilePath?: string;
|
|
631
|
+
/**
|
|
632
|
+
* Pluralized endpoint/collection name from the manifest (e.g. `sourcecrawls`
|
|
633
|
+
* for `SourceCrawl`). This is the segment the SvelteKit route generator
|
|
634
|
+
* uses for `/api/<collection>/...`, and it is NOT the same as `tableName`
|
|
635
|
+
* (which is snake_case and can be overridden/uncountable). Stored here so
|
|
636
|
+
* runtime consumers (e.g. `createResourceListHandler`) can build URLs that
|
|
637
|
+
* match the generated routes instead of re-deriving from `tableName`.
|
|
638
|
+
* See smrt#1311 consumer-migration finding.
|
|
639
|
+
*/
|
|
640
|
+
collection?: string;
|
|
641
|
+
/** Parent class name (for inheritance chain tracking) */
|
|
642
|
+
extends?: string;
|
|
643
|
+
/** Generic type arg from `SmrtCollection<X>` — marks collection classes. */
|
|
644
|
+
extendsTypeArg?: string;
|
|
645
|
+
/** Full inheritance chain from base to this class (cached for performance) */
|
|
646
|
+
inheritanceChain?: string[];
|
|
647
|
+
/** Merged fields from entire inheritance chain (cached, includes parent fields) */
|
|
648
|
+
inheritedFields?: Map<string, any>;
|
|
649
|
+
/** Merged methods from entire inheritance chain (cached, includes parent methods) */
|
|
650
|
+
inheritedMethods?: Map<string, any>;
|
|
651
|
+
/** Normalized tenant scoping configuration (Issue #688) */
|
|
652
|
+
tenantScopedConfig?: {
|
|
653
|
+
mode: 'required' | 'optional';
|
|
654
|
+
field: string;
|
|
655
|
+
autoFilter: boolean;
|
|
656
|
+
autoPopulate: boolean;
|
|
657
|
+
allowSuperAdminBypass: boolean;
|
|
658
|
+
};
|
|
659
|
+
/**
|
|
660
|
+
* Visibility control for manifest inclusion
|
|
661
|
+
* - 'public': Included in published manifest (default)
|
|
662
|
+
* - 'internal': Package-only, excluded from published manifest
|
|
663
|
+
* - 'test': Test-only, never in any published manifest
|
|
664
|
+
*/
|
|
665
|
+
visibility?: SmrtVisibility;
|
|
666
|
+
}
|
|
667
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,UAAU,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExE,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAE9B;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC;;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W,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,mFAAmF;IACnF,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,2DAA2D;IAC3D,kBAAkB,CAAC,EAAE;QACnB,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,OAAO,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,qBAAqB,EAAE,OAAO,CAAC;KAChC,CAAC;IACF;;;;;OAKG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ValidatorFunction } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Compile validation functions from field definitions.
|
|
4
|
+
*
|
|
5
|
+
* Extracts validation rules from field options and compiles them into
|
|
6
|
+
* efficient validation functions that can be executed at runtime.
|
|
7
|
+
*
|
|
8
|
+
* @param className - Name of the class being validated
|
|
9
|
+
* @param fields - Map of field definitions
|
|
10
|
+
* @returns Array of compiled validation functions
|
|
11
|
+
*/
|
|
12
|
+
export declare function compileValidators(className: string, fields: Map<string, any>): ValidatorFunction[];
|
|
13
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/registry/validator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GACvB,iBAAiB,EAAE,CAmKrB"}
|