@angriff36/manifest 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +476 -0
- package/dist/manifest/agent-sdk/agent-runtime.d.ts +30 -0
- package/dist/manifest/agent-sdk/agent-runtime.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/agent-runtime.js +232 -0
- package/dist/manifest/agent-sdk/agent-runtime.js.map +1 -0
- package/dist/manifest/agent-sdk/index.d.ts +17 -0
- package/dist/manifest/agent-sdk/index.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/index.js +21 -0
- package/dist/manifest/agent-sdk/index.js.map +1 -0
- package/dist/manifest/agent-sdk/intent-mapper.d.ts +17 -0
- package/dist/manifest/agent-sdk/intent-mapper.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/intent-mapper.js +115 -0
- package/dist/manifest/agent-sdk/intent-mapper.js.map +1 -0
- package/dist/manifest/agent-sdk/introspect.d.ts +42 -0
- package/dist/manifest/agent-sdk/introspect.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/introspect.js +284 -0
- package/dist/manifest/agent-sdk/introspect.js.map +1 -0
- package/dist/manifest/agent-sdk/json-schema.d.ts +29 -0
- package/dist/manifest/agent-sdk/json-schema.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/json-schema.js +132 -0
- package/dist/manifest/agent-sdk/json-schema.js.map +1 -0
- package/dist/manifest/agent-sdk/tool-definitions.d.ts +41 -0
- package/dist/manifest/agent-sdk/tool-definitions.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/tool-definitions.js +288 -0
- package/dist/manifest/agent-sdk/tool-definitions.js.map +1 -0
- package/dist/manifest/agent-sdk/types.d.ts +293 -0
- package/dist/manifest/agent-sdk/types.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/types.js +6 -0
- package/dist/manifest/agent-sdk/types.js.map +1 -0
- package/dist/manifest/api-diagnostics.d.ts +41 -0
- package/dist/manifest/api-diagnostics.d.ts.map +1 -0
- package/dist/manifest/api-diagnostics.js +105 -0
- package/dist/manifest/api-diagnostics.js.map +1 -0
- package/dist/manifest/approval/approval-store.d.ts +52 -0
- package/dist/manifest/approval/approval-store.d.ts.map +1 -0
- package/dist/manifest/approval/approval-store.js +25 -0
- package/dist/manifest/approval/approval-store.js.map +1 -0
- package/dist/manifest/approval/stores/memory.d.ts +33 -0
- package/dist/manifest/approval/stores/memory.d.ts.map +1 -0
- package/dist/manifest/approval/stores/memory.js +56 -0
- package/dist/manifest/approval/stores/memory.js.map +1 -0
- package/dist/manifest/approval/stores/postgres.d.ts +41 -0
- package/dist/manifest/approval/stores/postgres.d.ts.map +1 -0
- package/dist/manifest/approval/stores/postgres.js +124 -0
- package/dist/manifest/approval/stores/postgres.js.map +1 -0
- package/dist/manifest/audit/audit-sink.d.ts +53 -0
- package/dist/manifest/audit/audit-sink.d.ts.map +1 -0
- package/dist/manifest/audit/audit-sink.js +15 -0
- package/dist/manifest/audit/audit-sink.js.map +1 -0
- package/dist/manifest/audit/sinks/memory.d.ts +50 -0
- package/dist/manifest/audit/sinks/memory.d.ts.map +1 -0
- package/dist/manifest/audit/sinks/memory.js +66 -0
- package/dist/manifest/audit/sinks/memory.js.map +1 -0
- package/dist/manifest/audit/sinks/postgres.d.ts +31 -0
- package/dist/manifest/audit/sinks/postgres.d.ts.map +1 -0
- package/dist/manifest/audit/sinks/postgres.js +67 -0
- package/dist/manifest/audit/sinks/postgres.js.map +1 -0
- package/dist/manifest/binary-ir.d.ts +76 -0
- package/dist/manifest/binary-ir.d.ts.map +1 -0
- package/dist/manifest/binary-ir.js +124 -0
- package/dist/manifest/binary-ir.js.map +1 -0
- package/dist/manifest/breaking-change.d.ts +75 -0
- package/dist/manifest/breaking-change.d.ts.map +1 -0
- package/dist/manifest/breaking-change.js +704 -0
- package/dist/manifest/breaking-change.js.map +1 -0
- package/dist/manifest/compiler.d.ts +12 -0
- package/dist/manifest/compiler.d.ts.map +1 -0
- package/dist/manifest/compiler.js +23 -0
- package/dist/manifest/compiler.js.map +1 -0
- package/dist/manifest/config.d.ts +171 -0
- package/dist/manifest/config.d.ts.map +1 -0
- package/dist/manifest/config.js +65 -0
- package/dist/manifest/config.js.map +1 -0
- package/dist/manifest/constraint-analysis.d.ts +122 -0
- package/dist/manifest/constraint-analysis.d.ts.map +1 -0
- package/dist/manifest/constraint-analysis.js +340 -0
- package/dist/manifest/constraint-analysis.js.map +1 -0
- package/dist/manifest/date-time.d.ts +13 -0
- package/dist/manifest/date-time.d.ts.map +1 -0
- package/dist/manifest/date-time.js +60 -0
- package/dist/manifest/date-time.js.map +1 -0
- package/dist/manifest/debug/command-trace.d.ts +37 -0
- package/dist/manifest/debug/command-trace.d.ts.map +1 -0
- package/dist/manifest/debug/command-trace.js +51 -0
- package/dist/manifest/debug/command-trace.js.map +1 -0
- package/dist/manifest/debug/index.d.ts +3 -0
- package/dist/manifest/debug/index.d.ts.map +1 -0
- package/dist/manifest/debug/index.js +2 -0
- package/dist/manifest/debug/index.js.map +1 -0
- package/dist/manifest/domain-completeness.d.ts +13 -0
- package/dist/manifest/domain-completeness.d.ts.map +1 -0
- package/dist/manifest/domain-completeness.js +245 -0
- package/dist/manifest/domain-completeness.js.map +1 -0
- package/dist/manifest/entity-composition.d.ts +24 -0
- package/dist/manifest/entity-composition.d.ts.map +1 -0
- package/dist/manifest/entity-composition.js +157 -0
- package/dist/manifest/entity-composition.js.map +1 -0
- package/dist/manifest/examples.d.ts +6 -0
- package/dist/manifest/examples.d.ts.map +1 -0
- package/dist/manifest/examples.js +443 -0
- package/dist/manifest/examples.js.map +1 -0
- package/dist/manifest/federation/client.d.ts +52 -0
- package/dist/manifest/federation/client.d.ts.map +1 -0
- package/dist/manifest/federation/client.js +152 -0
- package/dist/manifest/federation/client.js.map +1 -0
- package/dist/manifest/federation/descriptor.d.ts +25 -0
- package/dist/manifest/federation/descriptor.d.ts.map +1 -0
- package/dist/manifest/federation/descriptor.js +97 -0
- package/dist/manifest/federation/descriptor.js.map +1 -0
- package/dist/manifest/federation/http-adapter.d.ts +26 -0
- package/dist/manifest/federation/http-adapter.d.ts.map +1 -0
- package/dist/manifest/federation/http-adapter.js +209 -0
- package/dist/manifest/federation/http-adapter.js.map +1 -0
- package/dist/manifest/federation/index.d.ts +51 -0
- package/dist/manifest/federation/index.d.ts.map +1 -0
- package/dist/manifest/federation/index.js +49 -0
- package/dist/manifest/federation/index.js.map +1 -0
- package/dist/manifest/federation/policy-bridge.d.ts +51 -0
- package/dist/manifest/federation/policy-bridge.d.ts.map +1 -0
- package/dist/manifest/federation/policy-bridge.js +122 -0
- package/dist/manifest/federation/policy-bridge.js.map +1 -0
- package/dist/manifest/federation/registry.d.ts +88 -0
- package/dist/manifest/federation/registry.d.ts.map +1 -0
- package/dist/manifest/federation/registry.js +165 -0
- package/dist/manifest/federation/registry.js.map +1 -0
- package/dist/manifest/federation/types.d.ts +209 -0
- package/dist/manifest/federation/types.d.ts.map +1 -0
- package/dist/manifest/federation/types.js +13 -0
- package/dist/manifest/federation/types.js.map +1 -0
- package/dist/manifest/generator.d.ts +44 -0
- package/dist/manifest/generator.d.ts.map +1 -0
- package/dist/manifest/generator.js +899 -0
- package/dist/manifest/generator.js.map +1 -0
- package/dist/manifest/ir-cache.d.ts +48 -0
- package/dist/manifest/ir-cache.d.ts.map +1 -0
- package/dist/manifest/ir-cache.js +91 -0
- package/dist/manifest/ir-cache.js.map +1 -0
- package/dist/manifest/ir-compiler.d.ts +135 -0
- package/dist/manifest/ir-compiler.d.ts.map +1 -0
- package/dist/manifest/ir-compiler.js +1477 -0
- package/dist/manifest/ir-compiler.js.map +1 -0
- package/dist/manifest/ir-diff.d.ts +266 -0
- package/dist/manifest/ir-diff.d.ts.map +1 -0
- package/dist/manifest/ir-diff.js +731 -0
- package/dist/manifest/ir-diff.js.map +1 -0
- package/dist/manifest/ir-version-store.d.ts +109 -0
- package/dist/manifest/ir-version-store.d.ts.map +1 -0
- package/dist/manifest/ir-version-store.js +162 -0
- package/dist/manifest/ir-version-store.js.map +1 -0
- package/dist/manifest/ir.d.ts +616 -0
- package/dist/manifest/ir.d.ts.map +1 -0
- package/dist/manifest/ir.js +2 -0
- package/dist/manifest/ir.js.map +1 -0
- package/dist/manifest/lexer.d.ts +37 -0
- package/dist/manifest/lexer.d.ts.map +1 -0
- package/dist/manifest/lexer.js +224 -0
- package/dist/manifest/lexer.js.map +1 -0
- package/dist/manifest/masking.d.ts +11 -0
- package/dist/manifest/masking.d.ts.map +1 -0
- package/dist/manifest/masking.js +34 -0
- package/dist/manifest/masking.js.map +1 -0
- package/dist/manifest/module-resolver.d.ts +42 -0
- package/dist/manifest/module-resolver.d.ts.map +1 -0
- package/dist/manifest/module-resolver.js +162 -0
- package/dist/manifest/module-resolver.js.map +1 -0
- package/dist/manifest/multi-compiler.d.ts +40 -0
- package/dist/manifest/multi-compiler.d.ts.map +1 -0
- package/dist/manifest/multi-compiler.js +324 -0
- package/dist/manifest/multi-compiler.js.map +1 -0
- package/dist/manifest/outbox/outbox-store.d.ts +56 -0
- package/dist/manifest/outbox/outbox-store.d.ts.map +1 -0
- package/dist/manifest/outbox/outbox-store.js +13 -0
- package/dist/manifest/outbox/outbox-store.js.map +1 -0
- package/dist/manifest/outbox/stores/dynamodb.d.ts +100 -0
- package/dist/manifest/outbox/stores/dynamodb.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/dynamodb.js +239 -0
- package/dist/manifest/outbox/stores/dynamodb.js.map +1 -0
- package/dist/manifest/outbox/stores/memory.d.ts +54 -0
- package/dist/manifest/outbox/stores/memory.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/memory.js +131 -0
- package/dist/manifest/outbox/stores/memory.js.map +1 -0
- package/dist/manifest/outbox/stores/mongodb.d.ts +58 -0
- package/dist/manifest/outbox/stores/mongodb.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/mongodb.js +151 -0
- package/dist/manifest/outbox/stores/mongodb.js.map +1 -0
- package/dist/manifest/outbox/stores/postgres.d.ts +81 -0
- package/dist/manifest/outbox/stores/postgres.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/postgres.js +182 -0
- package/dist/manifest/outbox/stores/postgres.js.map +1 -0
- package/dist/manifest/outbox/stores/redis.d.ts +95 -0
- package/dist/manifest/outbox/stores/redis.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/redis.js +248 -0
- package/dist/manifest/outbox/stores/redis.js.map +1 -0
- package/dist/manifest/parser.d.ts +148 -0
- package/dist/manifest/parser.d.ts.map +1 -0
- package/dist/manifest/parser.js +2243 -0
- package/dist/manifest/parser.js.map +1 -0
- package/dist/manifest/plugin-api.d.ts +202 -0
- package/dist/manifest/plugin-api.d.ts.map +1 -0
- package/dist/manifest/plugin-api.js +101 -0
- package/dist/manifest/plugin-api.js.map +1 -0
- package/dist/manifest/plugin-loader.d.ts +101 -0
- package/dist/manifest/plugin-loader.d.ts.map +1 -0
- package/dist/manifest/plugin-loader.js +332 -0
- package/dist/manifest/plugin-loader.js.map +1 -0
- package/dist/manifest/profiling.d.ts +183 -0
- package/dist/manifest/profiling.d.ts.map +1 -0
- package/dist/manifest/profiling.js +186 -0
- package/dist/manifest/profiling.js.map +1 -0
- package/dist/manifest/projections/analytics/generator.d.ts +27 -0
- package/dist/manifest/projections/analytics/generator.d.ts.map +1 -0
- package/dist/manifest/projections/analytics/generator.js +686 -0
- package/dist/manifest/projections/analytics/generator.js.map +1 -0
- package/dist/manifest/projections/analytics/types.d.ts +46 -0
- package/dist/manifest/projections/analytics/types.d.ts.map +1 -0
- package/dist/manifest/projections/analytics/types.js +8 -0
- package/dist/manifest/projections/analytics/types.js.map +1 -0
- package/dist/manifest/projections/builtins.d.ts +29 -0
- package/dist/manifest/projections/builtins.d.ts.map +1 -0
- package/dist/manifest/projections/builtins.js +143 -0
- package/dist/manifest/projections/builtins.js.map +1 -0
- package/dist/manifest/projections/convex/expression.d.ts +52 -0
- package/dist/manifest/projections/convex/expression.d.ts.map +1 -0
- package/dist/manifest/projections/convex/expression.js +166 -0
- package/dist/manifest/projections/convex/expression.js.map +1 -0
- package/dist/manifest/projections/convex/functions.d.ts +22 -0
- package/dist/manifest/projections/convex/functions.d.ts.map +1 -0
- package/dist/manifest/projections/convex/functions.js +786 -0
- package/dist/manifest/projections/convex/functions.js.map +1 -0
- package/dist/manifest/projections/convex/generator.d.ts +79 -0
- package/dist/manifest/projections/convex/generator.d.ts.map +1 -0
- package/dist/manifest/projections/convex/generator.js +406 -0
- package/dist/manifest/projections/convex/generator.js.map +1 -0
- package/dist/manifest/projections/convex/index.d.ts +10 -0
- package/dist/manifest/projections/convex/index.d.ts.map +1 -0
- package/dist/manifest/projections/convex/index.js +10 -0
- package/dist/manifest/projections/convex/index.js.map +1 -0
- package/dist/manifest/projections/convex/options.d.ts +153 -0
- package/dist/manifest/projections/convex/options.d.ts.map +1 -0
- package/dist/manifest/projections/convex/options.js +60 -0
- package/dist/manifest/projections/convex/options.js.map +1 -0
- package/dist/manifest/projections/convex/orchestration.d.ts +23 -0
- package/dist/manifest/projections/convex/orchestration.d.ts.map +1 -0
- package/dist/manifest/projections/convex/orchestration.js +150 -0
- package/dist/manifest/projections/convex/orchestration.js.map +1 -0
- package/dist/manifest/projections/convex/type-mapping.d.ts +40 -0
- package/dist/manifest/projections/convex/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/convex/type-mapping.js +71 -0
- package/dist/manifest/projections/convex/type-mapping.js.map +1 -0
- package/dist/manifest/projections/dart/generator.d.ts +33 -0
- package/dist/manifest/projections/dart/generator.d.ts.map +1 -0
- package/dist/manifest/projections/dart/generator.js +981 -0
- package/dist/manifest/projections/dart/generator.js.map +1 -0
- package/dist/manifest/projections/dart/types.d.ts +29 -0
- package/dist/manifest/projections/dart/types.d.ts.map +1 -0
- package/dist/manifest/projections/dart/types.js +5 -0
- package/dist/manifest/projections/dart/types.js.map +1 -0
- package/dist/manifest/projections/drizzle/generator.d.ts +27 -0
- package/dist/manifest/projections/drizzle/generator.d.ts.map +1 -0
- package/dist/manifest/projections/drizzle/generator.js +654 -0
- package/dist/manifest/projections/drizzle/generator.js.map +1 -0
- package/dist/manifest/projections/drizzle/index.d.ts +12 -0
- package/dist/manifest/projections/drizzle/index.d.ts.map +1 -0
- package/dist/manifest/projections/drizzle/index.js +12 -0
- package/dist/manifest/projections/drizzle/index.js.map +1 -0
- package/dist/manifest/projections/drizzle/options.d.ts +94 -0
- package/dist/manifest/projections/drizzle/options.d.ts.map +1 -0
- package/dist/manifest/projections/drizzle/options.js +31 -0
- package/dist/manifest/projections/drizzle/options.js.map +1 -0
- package/dist/manifest/projections/drizzle/type-mapping.d.ts +74 -0
- package/dist/manifest/projections/drizzle/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/drizzle/type-mapping.js +101 -0
- package/dist/manifest/projections/drizzle/type-mapping.js.map +1 -0
- package/dist/manifest/projections/dynamodb/generator.d.ts +48 -0
- package/dist/manifest/projections/dynamodb/generator.d.ts.map +1 -0
- package/dist/manifest/projections/dynamodb/generator.js +341 -0
- package/dist/manifest/projections/dynamodb/generator.js.map +1 -0
- package/dist/manifest/projections/elasticsearch/generator.d.ts +44 -0
- package/dist/manifest/projections/elasticsearch/generator.d.ts.map +1 -0
- package/dist/manifest/projections/elasticsearch/generator.js +613 -0
- package/dist/manifest/projections/elasticsearch/generator.js.map +1 -0
- package/dist/manifest/projections/elasticsearch/options.d.ts +56 -0
- package/dist/manifest/projections/elasticsearch/options.d.ts.map +1 -0
- package/dist/manifest/projections/elasticsearch/options.js +37 -0
- package/dist/manifest/projections/elasticsearch/options.js.map +1 -0
- package/dist/manifest/projections/elasticsearch/type-mapping.d.ts +30 -0
- package/dist/manifest/projections/elasticsearch/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/elasticsearch/type-mapping.js +34 -0
- package/dist/manifest/projections/elasticsearch/type-mapping.js.map +1 -0
- package/dist/manifest/projections/elasticsearch/types.d.ts +81 -0
- package/dist/manifest/projections/elasticsearch/types.d.ts.map +1 -0
- package/dist/manifest/projections/elasticsearch/types.js +10 -0
- package/dist/manifest/projections/elasticsearch/types.js.map +1 -0
- package/dist/manifest/projections/express/generator.d.ts +38 -0
- package/dist/manifest/projections/express/generator.d.ts.map +1 -0
- package/dist/manifest/projections/express/generator.js +620 -0
- package/dist/manifest/projections/express/generator.js.map +1 -0
- package/dist/manifest/projections/express/index.d.ts +8 -0
- package/dist/manifest/projections/express/index.d.ts.map +1 -0
- package/dist/manifest/projections/express/index.js +7 -0
- package/dist/manifest/projections/express/index.js.map +1 -0
- package/dist/manifest/projections/express/types.d.ts +92 -0
- package/dist/manifest/projections/express/types.d.ts.map +1 -0
- package/dist/manifest/projections/express/types.js +9 -0
- package/dist/manifest/projections/express/types.js.map +1 -0
- package/dist/manifest/projections/graphql/generator.d.ts +43 -0
- package/dist/manifest/projections/graphql/generator.d.ts.map +1 -0
- package/dist/manifest/projections/graphql/generator.js +662 -0
- package/dist/manifest/projections/graphql/generator.js.map +1 -0
- package/dist/manifest/projections/graphql/index.d.ts +11 -0
- package/dist/manifest/projections/graphql/index.d.ts.map +1 -0
- package/dist/manifest/projections/graphql/index.js +10 -0
- package/dist/manifest/projections/graphql/index.js.map +1 -0
- package/dist/manifest/projections/graphql/types.d.ts +69 -0
- package/dist/manifest/projections/graphql/types.d.ts.map +1 -0
- package/dist/manifest/projections/graphql/types.js +9 -0
- package/dist/manifest/projections/graphql/types.js.map +1 -0
- package/dist/manifest/projections/health/generator.d.ts +36 -0
- package/dist/manifest/projections/health/generator.d.ts.map +1 -0
- package/dist/manifest/projections/health/generator.js +355 -0
- package/dist/manifest/projections/health/generator.js.map +1 -0
- package/dist/manifest/projections/health/types.d.ts +67 -0
- package/dist/manifest/projections/health/types.d.ts.map +1 -0
- package/dist/manifest/projections/health/types.js +28 -0
- package/dist/manifest/projections/health/types.js.map +1 -0
- package/dist/manifest/projections/hono/generator.d.ts +36 -0
- package/dist/manifest/projections/hono/generator.d.ts.map +1 -0
- package/dist/manifest/projections/hono/generator.js +578 -0
- package/dist/manifest/projections/hono/generator.js.map +1 -0
- package/dist/manifest/projections/hono/types.d.ts +86 -0
- package/dist/manifest/projections/hono/types.d.ts.map +1 -0
- package/dist/manifest/projections/hono/types.js +10 -0
- package/dist/manifest/projections/hono/types.js.map +1 -0
- package/dist/manifest/projections/index.d.ts +58 -0
- package/dist/manifest/projections/index.d.ts.map +1 -0
- package/dist/manifest/projections/index.js +41 -0
- package/dist/manifest/projections/index.js.map +1 -0
- package/dist/manifest/projections/interface.d.ts +285 -0
- package/dist/manifest/projections/interface.d.ts.map +1 -0
- package/dist/manifest/projections/interface.js +8 -0
- package/dist/manifest/projections/interface.js.map +1 -0
- package/dist/manifest/projections/jsonschema/generator.d.ts +35 -0
- package/dist/manifest/projections/jsonschema/generator.d.ts.map +1 -0
- package/dist/manifest/projections/jsonschema/generator.js +347 -0
- package/dist/manifest/projections/jsonschema/generator.js.map +1 -0
- package/dist/manifest/projections/jsonschema/index.d.ts +3 -0
- package/dist/manifest/projections/jsonschema/index.d.ts.map +1 -0
- package/dist/manifest/projections/jsonschema/index.js +2 -0
- package/dist/manifest/projections/jsonschema/index.js.map +1 -0
- package/dist/manifest/projections/jsonschema/types.d.ts +31 -0
- package/dist/manifest/projections/jsonschema/types.d.ts.map +1 -0
- package/dist/manifest/projections/jsonschema/types.js +2 -0
- package/dist/manifest/projections/jsonschema/types.js.map +1 -0
- package/dist/manifest/projections/kysely/generator.d.ts +36 -0
- package/dist/manifest/projections/kysely/generator.d.ts.map +1 -0
- package/dist/manifest/projections/kysely/generator.js +325 -0
- package/dist/manifest/projections/kysely/generator.js.map +1 -0
- package/dist/manifest/projections/kysely/index.d.ts +4 -0
- package/dist/manifest/projections/kysely/index.d.ts.map +1 -0
- package/dist/manifest/projections/kysely/index.js +2 -0
- package/dist/manifest/projections/kysely/index.js.map +1 -0
- package/dist/manifest/projections/kysely/options.d.ts +61 -0
- package/dist/manifest/projections/kysely/options.d.ts.map +1 -0
- package/dist/manifest/projections/kysely/options.js +31 -0
- package/dist/manifest/projections/kysely/options.js.map +1 -0
- package/dist/manifest/projections/kysely/type-mapping.d.ts +61 -0
- package/dist/manifest/projections/kysely/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/kysely/type-mapping.js +84 -0
- package/dist/manifest/projections/kysely/type-mapping.js.map +1 -0
- package/dist/manifest/projections/llm-context/generator.d.ts +24 -0
- package/dist/manifest/projections/llm-context/generator.d.ts.map +1 -0
- package/dist/manifest/projections/llm-context/generator.js +371 -0
- package/dist/manifest/projections/llm-context/generator.js.map +1 -0
- package/dist/manifest/projections/llm-context/types.d.ts +205 -0
- package/dist/manifest/projections/llm-context/types.d.ts.map +1 -0
- package/dist/manifest/projections/llm-context/types.js +9 -0
- package/dist/manifest/projections/llm-context/types.js.map +1 -0
- package/dist/manifest/projections/materialized-views/expression-to-sql.d.ts +29 -0
- package/dist/manifest/projections/materialized-views/expression-to-sql.d.ts.map +1 -0
- package/dist/manifest/projections/materialized-views/expression-to-sql.js +211 -0
- package/dist/manifest/projections/materialized-views/expression-to-sql.js.map +1 -0
- package/dist/manifest/projections/materialized-views/generator.d.ts +29 -0
- package/dist/manifest/projections/materialized-views/generator.d.ts.map +1 -0
- package/dist/manifest/projections/materialized-views/generator.js +263 -0
- package/dist/manifest/projections/materialized-views/generator.js.map +1 -0
- package/dist/manifest/projections/materialized-views/options.d.ts +59 -0
- package/dist/manifest/projections/materialized-views/options.d.ts.map +1 -0
- package/dist/manifest/projections/materialized-views/options.js +34 -0
- package/dist/manifest/projections/materialized-views/options.js.map +1 -0
- package/dist/manifest/projections/materialized-views/types.d.ts +100 -0
- package/dist/manifest/projections/materialized-views/types.d.ts.map +1 -0
- package/dist/manifest/projections/materialized-views/types.js +11 -0
- package/dist/manifest/projections/materialized-views/types.js.map +1 -0
- package/dist/manifest/projections/mermaid/generator.d.ts +46 -0
- package/dist/manifest/projections/mermaid/generator.d.ts.map +1 -0
- package/dist/manifest/projections/mermaid/generator.js +436 -0
- package/dist/manifest/projections/mermaid/generator.js.map +1 -0
- package/dist/manifest/projections/mongoose/options.d.ts +30 -0
- package/dist/manifest/projections/mongoose/options.d.ts.map +1 -0
- package/dist/manifest/projections/mongoose/options.js +18 -0
- package/dist/manifest/projections/mongoose/options.js.map +1 -0
- package/dist/manifest/projections/mongoose/type-mapping.d.ts +42 -0
- package/dist/manifest/projections/mongoose/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/mongoose/type-mapping.js +64 -0
- package/dist/manifest/projections/mongoose/type-mapping.js.map +1 -0
- package/dist/manifest/projections/nextjs/defaults.d.ts +161 -0
- package/dist/manifest/projections/nextjs/defaults.d.ts.map +1 -0
- package/dist/manifest/projections/nextjs/defaults.js +157 -0
- package/dist/manifest/projections/nextjs/defaults.js.map +1 -0
- package/dist/manifest/projections/nextjs/generator.d.ts +78 -0
- package/dist/manifest/projections/nextjs/generator.d.ts.map +1 -0
- package/dist/manifest/projections/nextjs/generator.js +1339 -0
- package/dist/manifest/projections/nextjs/generator.js.map +1 -0
- package/dist/manifest/projections/nextjs/schedule-generator.d.ts +10 -0
- package/dist/manifest/projections/nextjs/schedule-generator.d.ts.map +1 -0
- package/dist/manifest/projections/nextjs/schedule-generator.js +54 -0
- package/dist/manifest/projections/nextjs/schedule-generator.js.map +1 -0
- package/dist/manifest/projections/openapi/generator.d.ts +37 -0
- package/dist/manifest/projections/openapi/generator.d.ts.map +1 -0
- package/dist/manifest/projections/openapi/generator.js +690 -0
- package/dist/manifest/projections/openapi/generator.js.map +1 -0
- package/dist/manifest/projections/openapi/index.d.ts +11 -0
- package/dist/manifest/projections/openapi/index.d.ts.map +1 -0
- package/dist/manifest/projections/openapi/index.js +10 -0
- package/dist/manifest/projections/openapi/index.js.map +1 -0
- package/dist/manifest/projections/openapi/types.d.ts +75 -0
- package/dist/manifest/projections/openapi/types.d.ts.map +1 -0
- package/dist/manifest/projections/openapi/types.js +9 -0
- package/dist/manifest/projections/openapi/types.js.map +1 -0
- package/dist/manifest/projections/prisma/generator.d.ts +32 -0
- package/dist/manifest/projections/prisma/generator.d.ts.map +1 -0
- package/dist/manifest/projections/prisma/generator.js +861 -0
- package/dist/manifest/projections/prisma/generator.js.map +1 -0
- package/dist/manifest/projections/prisma/index.d.ts +12 -0
- package/dist/manifest/projections/prisma/index.d.ts.map +1 -0
- package/dist/manifest/projections/prisma/index.js +12 -0
- package/dist/manifest/projections/prisma/index.js.map +1 -0
- package/dist/manifest/projections/prisma/options.d.ts +243 -0
- package/dist/manifest/projections/prisma/options.d.ts.map +1 -0
- package/dist/manifest/projections/prisma/options.js +59 -0
- package/dist/manifest/projections/prisma/options.js.map +1 -0
- package/dist/manifest/projections/prisma/type-mapping.d.ts +60 -0
- package/dist/manifest/projections/prisma/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/prisma/type-mapping.js +95 -0
- package/dist/manifest/projections/prisma/type-mapping.js.map +1 -0
- package/dist/manifest/projections/prisma-store/generator.d.ts +12 -0
- package/dist/manifest/projections/prisma-store/generator.d.ts.map +1 -0
- package/dist/manifest/projections/prisma-store/generator.js +52 -0
- package/dist/manifest/projections/prisma-store/generator.js.map +1 -0
- package/dist/manifest/projections/prisma-store/metadata-builder.d.ts +11 -0
- package/dist/manifest/projections/prisma-store/metadata-builder.d.ts.map +1 -0
- package/dist/manifest/projections/prisma-store/metadata-builder.js +183 -0
- package/dist/manifest/projections/prisma-store/metadata-builder.js.map +1 -0
- package/dist/manifest/projections/prisma-store/options.d.ts +31 -0
- package/dist/manifest/projections/prisma-store/options.d.ts.map +1 -0
- package/dist/manifest/projections/prisma-store/options.js +21 -0
- package/dist/manifest/projections/prisma-store/options.js.map +1 -0
- package/dist/manifest/projections/prisma-store/persistence.d.ts +4 -0
- package/dist/manifest/projections/prisma-store/persistence.d.ts.map +1 -0
- package/dist/manifest/projections/prisma-store/persistence.js +24 -0
- package/dist/manifest/projections/prisma-store/persistence.js.map +1 -0
- package/dist/manifest/projections/pydantic/generator.d.ts +27 -0
- package/dist/manifest/projections/pydantic/generator.d.ts.map +1 -0
- package/dist/manifest/projections/pydantic/generator.js +798 -0
- package/dist/manifest/projections/pydantic/generator.js.map +1 -0
- package/dist/manifest/projections/pydantic/types.d.ts +32 -0
- package/dist/manifest/projections/pydantic/types.d.ts.map +1 -0
- package/dist/manifest/projections/pydantic/types.js +5 -0
- package/dist/manifest/projections/pydantic/types.js.map +1 -0
- package/dist/manifest/projections/react-query/generator.d.ts +87 -0
- package/dist/manifest/projections/react-query/generator.d.ts.map +1 -0
- package/dist/manifest/projections/react-query/generator.js +413 -0
- package/dist/manifest/projections/react-query/generator.js.map +1 -0
- package/dist/manifest/projections/registry.d.ts +59 -0
- package/dist/manifest/projections/registry.d.ts.map +1 -0
- package/dist/manifest/projections/registry.js +110 -0
- package/dist/manifest/projections/registry.js.map +1 -0
- package/dist/manifest/projections/remix/generator.d.ts +58 -0
- package/dist/manifest/projections/remix/generator.d.ts.map +1 -0
- package/dist/manifest/projections/remix/generator.js +788 -0
- package/dist/manifest/projections/remix/generator.js.map +1 -0
- package/dist/manifest/projections/routes/generator.d.ts +32 -0
- package/dist/manifest/projections/routes/generator.d.ts.map +1 -0
- package/dist/manifest/projections/routes/generator.js +401 -0
- package/dist/manifest/projections/routes/generator.js.map +1 -0
- package/dist/manifest/projections/routes/types.d.ts +104 -0
- package/dist/manifest/projections/routes/types.d.ts.map +1 -0
- package/dist/manifest/projections/routes/types.js +11 -0
- package/dist/manifest/projections/routes/types.js.map +1 -0
- package/dist/manifest/projections/shared/naming.d.ts +64 -0
- package/dist/manifest/projections/shared/naming.d.ts.map +1 -0
- package/dist/manifest/projections/shared/naming.js +138 -0
- package/dist/manifest/projections/shared/naming.js.map +1 -0
- package/dist/manifest/projections/storybook/generator.d.ts +38 -0
- package/dist/manifest/projections/storybook/generator.d.ts.map +1 -0
- package/dist/manifest/projections/storybook/generator.js +462 -0
- package/dist/manifest/projections/storybook/generator.js.map +1 -0
- package/dist/manifest/projections/sveltekit/generator.d.ts +64 -0
- package/dist/manifest/projections/sveltekit/generator.d.ts.map +1 -0
- package/dist/manifest/projections/sveltekit/generator.js +1043 -0
- package/dist/manifest/projections/sveltekit/generator.js.map +1 -0
- package/dist/manifest/projections/sveltekit/index.d.ts +11 -0
- package/dist/manifest/projections/sveltekit/index.d.ts.map +1 -0
- package/dist/manifest/projections/sveltekit/index.js +10 -0
- package/dist/manifest/projections/sveltekit/index.js.map +1 -0
- package/dist/manifest/projections/sveltekit/types.d.ts +122 -0
- package/dist/manifest/projections/sveltekit/types.d.ts.map +1 -0
- package/dist/manifest/projections/sveltekit/types.js +10 -0
- package/dist/manifest/projections/sveltekit/types.js.map +1 -0
- package/dist/manifest/projections/terraform/generator.d.ts +29 -0
- package/dist/manifest/projections/terraform/generator.d.ts.map +1 -0
- package/dist/manifest/projections/terraform/generator.js +722 -0
- package/dist/manifest/projections/terraform/generator.js.map +1 -0
- package/dist/manifest/projections/terraform/index.d.ts +7 -0
- package/dist/manifest/projections/terraform/index.d.ts.map +1 -0
- package/dist/manifest/projections/terraform/index.js +7 -0
- package/dist/manifest/projections/terraform/index.js.map +1 -0
- package/dist/manifest/projections/terraform/options.d.ts +92 -0
- package/dist/manifest/projections/terraform/options.d.ts.map +1 -0
- package/dist/manifest/projections/terraform/options.js +37 -0
- package/dist/manifest/projections/terraform/options.js.map +1 -0
- package/dist/manifest/projections/terraform/types.d.ts +55 -0
- package/dist/manifest/projections/terraform/types.d.ts.map +1 -0
- package/dist/manifest/projections/terraform/types.js +38 -0
- package/dist/manifest/projections/terraform/types.js.map +1 -0
- package/dist/manifest/projections/zod/generator.d.ts +27 -0
- package/dist/manifest/projections/zod/generator.d.ts.map +1 -0
- package/dist/manifest/projections/zod/generator.js +367 -0
- package/dist/manifest/projections/zod/generator.js.map +1 -0
- package/dist/manifest/projections/zod/index.d.ts +8 -0
- package/dist/manifest/projections/zod/index.d.ts.map +1 -0
- package/dist/manifest/projections/zod/index.js +7 -0
- package/dist/manifest/projections/zod/index.js.map +1 -0
- package/dist/manifest/projections/zod/types.d.ts +14 -0
- package/dist/manifest/projections/zod/types.d.ts.map +1 -0
- package/dist/manifest/projections/zod/types.js +5 -0
- package/dist/manifest/projections/zod/types.js.map +1 -0
- package/dist/manifest/reaction-completeness-checks.d.ts +11 -0
- package/dist/manifest/reaction-completeness-checks.d.ts.map +1 -0
- package/dist/manifest/reaction-completeness-checks.js +106 -0
- package/dist/manifest/reaction-completeness-checks.js.map +1 -0
- package/dist/manifest/reaction-completeness.d.ts +9 -0
- package/dist/manifest/reaction-completeness.d.ts.map +1 -0
- package/dist/manifest/reaction-completeness.js +35 -0
- package/dist/manifest/reaction-completeness.js.map +1 -0
- package/dist/manifest/registry/emit.d.ts +53 -0
- package/dist/manifest/registry/emit.d.ts.map +1 -0
- package/dist/manifest/registry/emit.js +96 -0
- package/dist/manifest/registry/emit.js.map +1 -0
- package/dist/manifest/runtime-command-extensions.d.ts +21 -0
- package/dist/manifest/runtime-command-extensions.d.ts.map +1 -0
- package/dist/manifest/runtime-command-extensions.js +136 -0
- package/dist/manifest/runtime-command-extensions.js.map +1 -0
- package/dist/manifest/runtime-engine.d.ts +1019 -0
- package/dist/manifest/runtime-engine.d.ts.map +1 -0
- package/dist/manifest/runtime-engine.js +3872 -0
- package/dist/manifest/runtime-engine.js.map +1 -0
- package/dist/manifest/runtime-profiling-bridge.d.ts +22 -0
- package/dist/manifest/runtime-profiling-bridge.d.ts.map +1 -0
- package/dist/manifest/runtime-profiling-bridge.js +69 -0
- package/dist/manifest/runtime-profiling-bridge.js.map +1 -0
- package/dist/manifest/runtime-rate-limit.d.ts +52 -0
- package/dist/manifest/runtime-rate-limit.d.ts.map +1 -0
- package/dist/manifest/runtime-rate-limit.js +70 -0
- package/dist/manifest/runtime-rate-limit.js.map +1 -0
- package/dist/manifest/runtime-retry.d.ts +68 -0
- package/dist/manifest/runtime-retry.d.ts.map +1 -0
- package/dist/manifest/runtime-retry.js +93 -0
- package/dist/manifest/runtime-retry.js.map +1 -0
- package/dist/manifest/runtime-schedule.d.ts +47 -0
- package/dist/manifest/runtime-schedule.d.ts.map +1 -0
- package/dist/manifest/runtime-schedule.js +95 -0
- package/dist/manifest/runtime-schedule.js.map +1 -0
- package/dist/manifest/schedule-utils.d.ts +15 -0
- package/dist/manifest/schedule-utils.d.ts.map +1 -0
- package/dist/manifest/schedule-utils.js +82 -0
- package/dist/manifest/schedule-utils.js.map +1 -0
- package/dist/manifest/standalone-generator.d.ts +32 -0
- package/dist/manifest/standalone-generator.d.ts.map +1 -0
- package/dist/manifest/standalone-generator.js +596 -0
- package/dist/manifest/standalone-generator.js.map +1 -0
- package/dist/manifest/stores/prisma-generic/coercion.d.ts +17 -0
- package/dist/manifest/stores/prisma-generic/coercion.d.ts.map +1 -0
- package/dist/manifest/stores/prisma-generic/coercion.js +83 -0
- package/dist/manifest/stores/prisma-generic/coercion.js.map +1 -0
- package/dist/manifest/stores/prisma-generic/index.d.ts +3 -0
- package/dist/manifest/stores/prisma-generic/index.d.ts.map +1 -0
- package/dist/manifest/stores/prisma-generic/index.js +2 -0
- package/dist/manifest/stores/prisma-generic/index.js.map +1 -0
- package/dist/manifest/stores/prisma-generic/store.d.ts +35 -0
- package/dist/manifest/stores/prisma-generic/store.d.ts.map +1 -0
- package/dist/manifest/stores/prisma-generic/store.js +216 -0
- package/dist/manifest/stores/prisma-generic/store.js.map +1 -0
- package/dist/manifest/stores/prisma-generic/types.d.ts +46 -0
- package/dist/manifest/stores/prisma-generic/types.d.ts.map +1 -0
- package/dist/manifest/stores/prisma-generic/types.js +6 -0
- package/dist/manifest/stores/prisma-generic/types.js.map +1 -0
- package/dist/manifest/stores.node.d.ts +248 -0
- package/dist/manifest/stores.node.d.ts.map +1 -0
- package/dist/manifest/stores.node.js +718 -0
- package/dist/manifest/stores.node.js.map +1 -0
- package/dist/manifest/test/postgres-live-env.d.ts +9 -0
- package/dist/manifest/test/postgres-live-env.d.ts.map +1 -0
- package/dist/manifest/test/postgres-live-env.js +14 -0
- package/dist/manifest/test/postgres-live-env.js.map +1 -0
- package/dist/manifest/types.d.ts +570 -0
- package/dist/manifest/types.d.ts.map +1 -0
- package/dist/manifest/types.js +2 -0
- package/dist/manifest/types.js.map +1 -0
- package/dist/manifest/version.d.ts +15 -0
- package/dist/manifest/version.d.ts.map +1 -0
- package/dist/manifest/version.js +15 -0
- package/dist/manifest/version.js.map +1 -0
- package/dist/manifest/wasm/index.d.ts +15 -0
- package/dist/manifest/wasm/index.d.ts.map +1 -0
- package/dist/manifest/wasm/index.js +15 -0
- package/dist/manifest/wasm/index.js.map +1 -0
- package/dist/manifest/wasm/wasm-evaluator.d.ts +93 -0
- package/dist/manifest/wasm/wasm-evaluator.d.ts.map +1 -0
- package/dist/manifest/wasm/wasm-evaluator.js +242 -0
- package/dist/manifest/wasm/wasm-evaluator.js.map +1 -0
- package/dist/manifest/wasm/wasm-loader.d.ts +56 -0
- package/dist/manifest/wasm/wasm-loader.d.ts.map +1 -0
- package/dist/manifest/wasm/wasm-loader.js +132 -0
- package/dist/manifest/wasm/wasm-loader.js.map +1 -0
- package/docs/spec/config/manifest.config.schema.json +737 -0
- package/docs/spec/config/prisma-projection.schema.json +173 -0
- package/docs/spec/ir/ir-v1.schema.json +2033 -0
- package/docs/spec/plugins/plugin.schema.json +104 -0
- package/docs/spec/registry/bypasses.schema.json +87 -0
- package/docs/spec/registry/commands.schema.json +61 -0
- package/docs/spec/registry/entities.schema.json +52 -0
- package/docs/spec/semantics.md +630 -0
- package/package.json +356 -0
- package/packages/cli/dist/audit/bypass-violations.d.ts +16 -0
- package/packages/cli/dist/audit/bypass-violations.d.ts.map +1 -0
- package/packages/cli/dist/audit/bypass-violations.js +98 -0
- package/packages/cli/dist/audit/bypass-violations.js.map +1 -0
- package/packages/cli/dist/audit/direct-writes.d.ts +15 -0
- package/packages/cli/dist/audit/direct-writes.d.ts.map +1 -0
- package/packages/cli/dist/audit/direct-writes.js +86 -0
- package/packages/cli/dist/audit/direct-writes.js.map +1 -0
- package/packages/cli/dist/audit/event-fabrication.d.ts +17 -0
- package/packages/cli/dist/audit/event-fabrication.d.ts.map +1 -0
- package/packages/cli/dist/audit/event-fabrication.js +101 -0
- package/packages/cli/dist/audit/event-fabrication.js.map +1 -0
- package/packages/cli/dist/audit/existing-command-available.d.ts +20 -0
- package/packages/cli/dist/audit/existing-command-available.d.ts.map +1 -0
- package/packages/cli/dist/audit/existing-command-available.js +158 -0
- package/packages/cli/dist/audit/existing-command-available.js.map +1 -0
- package/packages/cli/dist/audit/missing-tests.d.ts +17 -0
- package/packages/cli/dist/audit/missing-tests.d.ts.map +1 -0
- package/packages/cli/dist/audit/missing-tests.js +108 -0
- package/packages/cli/dist/audit/missing-tests.js.map +1 -0
- package/packages/cli/dist/audit/route-drift.d.ts +16 -0
- package/packages/cli/dist/audit/route-drift.d.ts.map +1 -0
- package/packages/cli/dist/audit/route-drift.js +86 -0
- package/packages/cli/dist/audit/route-drift.js.map +1 -0
- package/packages/cli/dist/audit/types.d.ts +63 -0
- package/packages/cli/dist/audit/types.d.ts.map +1 -0
- package/packages/cli/dist/audit/types.js +10 -0
- package/packages/cli/dist/audit/types.js.map +1 -0
- package/packages/cli/dist/audit/unregistered-command-call.d.ts +25 -0
- package/packages/cli/dist/audit/unregistered-command-call.d.ts.map +1 -0
- package/packages/cli/dist/audit/unregistered-command-call.js +196 -0
- package/packages/cli/dist/audit/unregistered-command-call.js.map +1 -0
- package/packages/cli/dist/audit/unregistered-entity-write.d.ts +16 -0
- package/packages/cli/dist/audit/unregistered-entity-write.d.ts.map +1 -0
- package/packages/cli/dist/audit/unregistered-entity-write.js +96 -0
- package/packages/cli/dist/audit/unregistered-entity-write.js.map +1 -0
- package/packages/cli/dist/audit/write-receiver.d.ts +23 -0
- package/packages/cli/dist/audit/write-receiver.d.ts.map +1 -0
- package/packages/cli/dist/audit/write-receiver.js +32 -0
- package/packages/cli/dist/audit/write-receiver.js.map +1 -0
- package/packages/cli/dist/checks/dispatcher-presence.d.ts +37 -0
- package/packages/cli/dist/checks/dispatcher-presence.d.ts.map +1 -0
- package/packages/cli/dist/checks/dispatcher-presence.js +57 -0
- package/packages/cli/dist/checks/dispatcher-presence.js.map +1 -0
- package/packages/cli/dist/checks/package-shape.d.ts +81 -0
- package/packages/cli/dist/checks/package-shape.d.ts.map +1 -0
- package/packages/cli/dist/checks/package-shape.js +359 -0
- package/packages/cli/dist/checks/package-shape.js.map +1 -0
- package/packages/cli/dist/checks/runtime-smoke.d.ts +42 -0
- package/packages/cli/dist/checks/runtime-smoke.d.ts.map +1 -0
- package/packages/cli/dist/checks/runtime-smoke.js +167 -0
- package/packages/cli/dist/checks/runtime-smoke.js.map +1 -0
- package/packages/cli/dist/commands/analyze.d.ts +97 -0
- package/packages/cli/dist/commands/analyze.d.ts.map +1 -0
- package/packages/cli/dist/commands/analyze.js +411 -0
- package/packages/cli/dist/commands/analyze.js.map +1 -0
- package/packages/cli/dist/commands/audit-bypasses.d.ts +31 -0
- package/packages/cli/dist/commands/audit-bypasses.d.ts.map +1 -0
- package/packages/cli/dist/commands/audit-bypasses.js +152 -0
- package/packages/cli/dist/commands/audit-bypasses.js.map +1 -0
- package/packages/cli/dist/commands/audit-constitution.d.ts +20 -0
- package/packages/cli/dist/commands/audit-constitution.d.ts.map +1 -0
- package/packages/cli/dist/commands/audit-constitution.js +18 -0
- package/packages/cli/dist/commands/audit-constitution.js.map +1 -0
- package/packages/cli/dist/commands/audit-governance.d.ts +37 -0
- package/packages/cli/dist/commands/audit-governance.d.ts.map +1 -0
- package/packages/cli/dist/commands/audit-governance.js +78 -0
- package/packages/cli/dist/commands/audit-governance.js.map +1 -0
- package/packages/cli/dist/commands/audit-routes.d.ts +135 -0
- package/packages/cli/dist/commands/audit-routes.d.ts.map +1 -0
- package/packages/cli/dist/commands/audit-routes.js +514 -0
- package/packages/cli/dist/commands/audit-routes.js.map +1 -0
- package/packages/cli/dist/commands/breaking-change.d.ts +15 -0
- package/packages/cli/dist/commands/breaking-change.d.ts.map +1 -0
- package/packages/cli/dist/commands/breaking-change.js +150 -0
- package/packages/cli/dist/commands/breaking-change.js.map +1 -0
- package/packages/cli/dist/commands/build.d.ts +26 -0
- package/packages/cli/dist/commands/build.d.ts.map +1 -0
- package/packages/cli/dist/commands/build.js +58 -0
- package/packages/cli/dist/commands/build.js.map +1 -0
- package/packages/cli/dist/commands/changelog.d.ts +26 -0
- package/packages/cli/dist/commands/changelog.d.ts.map +1 -0
- package/packages/cli/dist/commands/changelog.js +365 -0
- package/packages/cli/dist/commands/changelog.js.map +1 -0
- package/packages/cli/dist/commands/check.d.ts +21 -0
- package/packages/cli/dist/commands/check.d.ts.map +1 -0
- package/packages/cli/dist/commands/check.js +31 -0
- package/packages/cli/dist/commands/check.js.map +1 -0
- package/packages/cli/dist/commands/compile.d.ts +19 -0
- package/packages/cli/dist/commands/compile.d.ts.map +1 -0
- package/packages/cli/dist/commands/compile.js +325 -0
- package/packages/cli/dist/commands/compile.js.map +1 -0
- package/packages/cli/dist/commands/config.d.ts +23 -0
- package/packages/cli/dist/commands/config.d.ts.map +1 -0
- package/packages/cli/dist/commands/config.js +172 -0
- package/packages/cli/dist/commands/config.js.map +1 -0
- package/packages/cli/dist/commands/coverage.d.ts +55 -0
- package/packages/cli/dist/commands/coverage.d.ts.map +1 -0
- package/packages/cli/dist/commands/coverage.js +343 -0
- package/packages/cli/dist/commands/coverage.js.map +1 -0
- package/packages/cli/dist/commands/diagram.d.ts +22 -0
- package/packages/cli/dist/commands/diagram.d.ts.map +1 -0
- package/packages/cli/dist/commands/diagram.js +176 -0
- package/packages/cli/dist/commands/diagram.js.map +1 -0
- package/packages/cli/dist/commands/docs.d.ts +18 -0
- package/packages/cli/dist/commands/docs.d.ts.map +1 -0
- package/packages/cli/dist/commands/docs.js +722 -0
- package/packages/cli/dist/commands/docs.js.map +1 -0
- package/packages/cli/dist/commands/doctor-lib.d.ts +147 -0
- package/packages/cli/dist/commands/doctor-lib.d.ts.map +1 -0
- package/packages/cli/dist/commands/doctor-lib.js +491 -0
- package/packages/cli/dist/commands/doctor-lib.js.map +1 -0
- package/packages/cli/dist/commands/doctor.d.ts +31 -0
- package/packages/cli/dist/commands/doctor.d.ts.map +1 -0
- package/packages/cli/dist/commands/doctor.js +628 -0
- package/packages/cli/dist/commands/doctor.js.map +1 -0
- package/packages/cli/dist/commands/emit-registries.d.ts +33 -0
- package/packages/cli/dist/commands/emit-registries.d.ts.map +1 -0
- package/packages/cli/dist/commands/emit-registries.js +109 -0
- package/packages/cli/dist/commands/emit-registries.js.map +1 -0
- package/packages/cli/dist/commands/enforce-surface.d.ts +62 -0
- package/packages/cli/dist/commands/enforce-surface.d.ts.map +1 -0
- package/packages/cli/dist/commands/enforce-surface.js +172 -0
- package/packages/cli/dist/commands/enforce-surface.js.map +1 -0
- package/packages/cli/dist/commands/fmt.d.ts +17 -0
- package/packages/cli/dist/commands/fmt.d.ts.map +1 -0
- package/packages/cli/dist/commands/fmt.js +129 -0
- package/packages/cli/dist/commands/fmt.js.map +1 -0
- package/packages/cli/dist/commands/gen-tests.d.ts +41 -0
- package/packages/cli/dist/commands/gen-tests.d.ts.map +1 -0
- package/packages/cli/dist/commands/gen-tests.js +370 -0
- package/packages/cli/dist/commands/gen-tests.js.map +1 -0
- package/packages/cli/dist/commands/generate-from-prompt.d.ts +34 -0
- package/packages/cli/dist/commands/generate-from-prompt.d.ts.map +1 -0
- package/packages/cli/dist/commands/generate-from-prompt.js +990 -0
- package/packages/cli/dist/commands/generate-from-prompt.js.map +1 -0
- package/packages/cli/dist/commands/generate.d.ts +36 -0
- package/packages/cli/dist/commands/generate.d.ts.map +1 -0
- package/packages/cli/dist/commands/generate.js +371 -0
- package/packages/cli/dist/commands/generate.js.map +1 -0
- package/packages/cli/dist/commands/harness.d.ts +13 -0
- package/packages/cli/dist/commands/harness.d.ts.map +1 -0
- package/packages/cli/dist/commands/harness.js +276 -0
- package/packages/cli/dist/commands/harness.js.map +1 -0
- package/packages/cli/dist/commands/init-ci.d.ts +19 -0
- package/packages/cli/dist/commands/init-ci.d.ts.map +1 -0
- package/packages/cli/dist/commands/init-ci.js +148 -0
- package/packages/cli/dist/commands/init-ci.js.map +1 -0
- package/packages/cli/dist/commands/init.d.ts +33 -0
- package/packages/cli/dist/commands/init.d.ts.map +1 -0
- package/packages/cli/dist/commands/init.js +157 -0
- package/packages/cli/dist/commands/init.js.map +1 -0
- package/packages/cli/dist/commands/install-hooks.d.ts +29 -0
- package/packages/cli/dist/commands/install-hooks.d.ts.map +1 -0
- package/packages/cli/dist/commands/install-hooks.js +139 -0
- package/packages/cli/dist/commands/install-hooks.js.map +1 -0
- package/packages/cli/dist/commands/integration-check.d.ts +62 -0
- package/packages/cli/dist/commands/integration-check.d.ts.map +1 -0
- package/packages/cli/dist/commands/integration-check.js +298 -0
- package/packages/cli/dist/commands/integration-check.js.map +1 -0
- package/packages/cli/dist/commands/ir-diff.d.ts +8 -0
- package/packages/cli/dist/commands/ir-diff.d.ts.map +1 -0
- package/packages/cli/dist/commands/ir-diff.js +199 -0
- package/packages/cli/dist/commands/ir-diff.js.map +1 -0
- package/packages/cli/dist/commands/lint-routes.d.ts +56 -0
- package/packages/cli/dist/commands/lint-routes.d.ts.map +1 -0
- package/packages/cli/dist/commands/lint-routes.js +228 -0
- package/packages/cli/dist/commands/lint-routes.js.map +1 -0
- package/packages/cli/dist/commands/load-test.d.ts +61 -0
- package/packages/cli/dist/commands/load-test.d.ts.map +1 -0
- package/packages/cli/dist/commands/load-test.js +675 -0
- package/packages/cli/dist/commands/load-test.js.map +1 -0
- package/packages/cli/dist/commands/migrate.d.ts +21 -0
- package/packages/cli/dist/commands/migrate.d.ts.map +1 -0
- package/packages/cli/dist/commands/migrate.js +264 -0
- package/packages/cli/dist/commands/migrate.js.map +1 -0
- package/packages/cli/dist/commands/mock.d.ts +79 -0
- package/packages/cli/dist/commands/mock.d.ts.map +1 -0
- package/packages/cli/dist/commands/mock.js +324 -0
- package/packages/cli/dist/commands/mock.js.map +1 -0
- package/packages/cli/dist/commands/pack-unpack.d.ts +30 -0
- package/packages/cli/dist/commands/pack-unpack.d.ts.map +1 -0
- package/packages/cli/dist/commands/pack-unpack.js +108 -0
- package/packages/cli/dist/commands/pack-unpack.js.map +1 -0
- package/packages/cli/dist/commands/preflight.d.ts +31 -0
- package/packages/cli/dist/commands/preflight.d.ts.map +1 -0
- package/packages/cli/dist/commands/preflight.js +246 -0
- package/packages/cli/dist/commands/preflight.js.map +1 -0
- package/packages/cli/dist/commands/profile.d.ts +30 -0
- package/packages/cli/dist/commands/profile.d.ts.map +1 -0
- package/packages/cli/dist/commands/profile.js +201 -0
- package/packages/cli/dist/commands/profile.js.map +1 -0
- package/packages/cli/dist/commands/repl.d.ts +16 -0
- package/packages/cli/dist/commands/repl.d.ts.map +1 -0
- package/packages/cli/dist/commands/repl.js +772 -0
- package/packages/cli/dist/commands/repl.js.map +1 -0
- package/packages/cli/dist/commands/routes.d.ts +24 -0
- package/packages/cli/dist/commands/routes.d.ts.map +1 -0
- package/packages/cli/dist/commands/routes.js +144 -0
- package/packages/cli/dist/commands/routes.js.map +1 -0
- package/packages/cli/dist/commands/scan.d.ts +23 -0
- package/packages/cli/dist/commands/scan.d.ts.map +1 -0
- package/packages/cli/dist/commands/scan.js +722 -0
- package/packages/cli/dist/commands/scan.js.map +1 -0
- package/packages/cli/dist/commands/seed.d.ts +35 -0
- package/packages/cli/dist/commands/seed.d.ts.map +1 -0
- package/packages/cli/dist/commands/seed.js +503 -0
- package/packages/cli/dist/commands/seed.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-ajv.d.ts +4 -0
- package/packages/cli/dist/commands/validate-ai-ajv.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-ajv.js +78 -0
- package/packages/cli/dist/commands/validate-ai-ajv.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-compiler.d.ts +5 -0
- package/packages/cli/dist/commands/validate-ai-compiler.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-compiler.js +8 -0
- package/packages/cli/dist/commands/validate-ai-compiler.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-report.d.ts +5 -0
- package/packages/cli/dist/commands/validate-ai-report.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-report.js +80 -0
- package/packages/cli/dist/commands/validate-ai-report.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-resolve-inputs.d.ts +6 -0
- package/packages/cli/dist/commands/validate-ai-resolve-inputs.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-resolve-inputs.js +54 -0
- package/packages/cli/dist/commands/validate-ai-resolve-inputs.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-semantic-checks.d.ts +4 -0
- package/packages/cli/dist/commands/validate-ai-semantic-checks.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-semantic-checks.js +218 -0
- package/packages/cli/dist/commands/validate-ai-semantic-checks.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-types.d.ts +41 -0
- package/packages/cli/dist/commands/validate-ai-types.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-types.js +2 -0
- package/packages/cli/dist/commands/validate-ai-types.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-validate-file.d.ts +5 -0
- package/packages/cli/dist/commands/validate-ai-validate-file.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-validate-file.js +126 -0
- package/packages/cli/dist/commands/validate-ai-validate-file.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai.d.ts +15 -0
- package/packages/cli/dist/commands/validate-ai.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai.js +124 -0
- package/packages/cli/dist/commands/validate-ai.js.map +1 -0
- package/packages/cli/dist/commands/validate.d.ts +15 -0
- package/packages/cli/dist/commands/validate.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate.js +205 -0
- package/packages/cli/dist/commands/validate.js.map +1 -0
- package/packages/cli/dist/commands/versions.d.ts +56 -0
- package/packages/cli/dist/commands/versions.d.ts.map +1 -0
- package/packages/cli/dist/commands/versions.js +427 -0
- package/packages/cli/dist/commands/versions.js.map +1 -0
- package/packages/cli/dist/commands/watch.d.ts +34 -0
- package/packages/cli/dist/commands/watch.d.ts.map +1 -0
- package/packages/cli/dist/commands/watch.js +253 -0
- package/packages/cli/dist/commands/watch.js.map +1 -0
- package/packages/cli/dist/index.d.ts +14 -0
- package/packages/cli/dist/index.d.ts.map +1 -0
- package/packages/cli/dist/index.js +1159 -0
- package/packages/cli/dist/index.js.map +1 -0
- package/packages/cli/dist/utils/config-validate.d.ts +48 -0
- package/packages/cli/dist/utils/config-validate.d.ts.map +1 -0
- package/packages/cli/dist/utils/config-validate.js +116 -0
- package/packages/cli/dist/utils/config-validate.js.map +1 -0
- package/packages/cli/dist/utils/config.d.ts +360 -0
- package/packages/cli/dist/utils/config.d.ts.map +1 -0
- package/packages/cli/dist/utils/config.js +567 -0
- package/packages/cli/dist/utils/config.js.map +1 -0
- package/packages/cli/dist/utils/schema.d.ts +8 -0
- package/packages/cli/dist/utils/schema.d.ts.map +1 -0
- package/packages/cli/dist/utils/schema.js +13 -0
- package/packages/cli/dist/utils/schema.js.map +1 -0
- package/packages/lsp-server/bin/manifest-lsp.js +3 -0
- package/packages/lsp-server/dist/compiler-bridge.d.ts +24 -0
- package/packages/lsp-server/dist/compiler-bridge.d.ts.map +1 -0
- package/packages/lsp-server/dist/compiler-bridge.js +32 -0
- package/packages/lsp-server/dist/compiler-bridge.js.map +1 -0
- package/packages/lsp-server/dist/document-store.d.ts +23 -0
- package/packages/lsp-server/dist/document-store.d.ts.map +1 -0
- package/packages/lsp-server/dist/document-store.js +40 -0
- package/packages/lsp-server/dist/document-store.js.map +1 -0
- package/packages/lsp-server/dist/features/completion.d.ts +23 -0
- package/packages/lsp-server/dist/features/completion.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/completion.js +293 -0
- package/packages/lsp-server/dist/features/completion.js.map +1 -0
- package/packages/lsp-server/dist/features/definition.d.ts +9 -0
- package/packages/lsp-server/dist/features/definition.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/definition.js +24 -0
- package/packages/lsp-server/dist/features/definition.js.map +1 -0
- package/packages/lsp-server/dist/features/diagnostics.d.ts +8 -0
- package/packages/lsp-server/dist/features/diagnostics.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/diagnostics.js +40 -0
- package/packages/lsp-server/dist/features/diagnostics.js.map +1 -0
- package/packages/lsp-server/dist/features/document-symbols.d.ts +8 -0
- package/packages/lsp-server/dist/features/document-symbols.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/document-symbols.js +164 -0
- package/packages/lsp-server/dist/features/document-symbols.js.map +1 -0
- package/packages/lsp-server/dist/features/hover.d.ts +9 -0
- package/packages/lsp-server/dist/features/hover.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/hover.js +100 -0
- package/packages/lsp-server/dist/features/hover.js.map +1 -0
- package/packages/lsp-server/dist/index.d.ts +6 -0
- package/packages/lsp-server/dist/index.d.ts.map +1 -0
- package/packages/lsp-server/dist/index.js +11 -0
- package/packages/lsp-server/dist/index.js.map +1 -0
- package/packages/lsp-server/dist/position-utils.d.ts +25 -0
- package/packages/lsp-server/dist/position-utils.d.ts.map +1 -0
- package/packages/lsp-server/dist/position-utils.js +39 -0
- package/packages/lsp-server/dist/position-utils.js.map +1 -0
- package/packages/lsp-server/dist/server.d.ts +14 -0
- package/packages/lsp-server/dist/server.d.ts.map +1 -0
- package/packages/lsp-server/dist/server.js +96 -0
- package/packages/lsp-server/dist/server.js.map +1 -0
- package/packages/lsp-server/dist/symbols/builtin-docs.d.ts +34 -0
- package/packages/lsp-server/dist/symbols/builtin-docs.d.ts.map +1 -0
- package/packages/lsp-server/dist/symbols/builtin-docs.js +193 -0
- package/packages/lsp-server/dist/symbols/builtin-docs.js.map +1 -0
- package/packages/lsp-server/dist/symbols/symbol-index.d.ts +18 -0
- package/packages/lsp-server/dist/symbols/symbol-index.d.ts.map +1 -0
- package/packages/lsp-server/dist/symbols/symbol-index.js +107 -0
- package/packages/lsp-server/dist/symbols/symbol-index.js.map +1 -0
- package/packages/mcp-server/bin/manifest-mcp.js +27 -0
- package/packages/mcp-server/dist/index.d.ts +24 -0
- package/packages/mcp-server/dist/index.d.ts.map +1 -0
- package/packages/mcp-server/dist/index.js +36 -0
- package/packages/mcp-server/dist/index.js.map +1 -0
- package/packages/mcp-server/dist/resources/ir-cache.d.ts +9 -0
- package/packages/mcp-server/dist/resources/ir-cache.d.ts.map +1 -0
- package/packages/mcp-server/dist/resources/ir-cache.js +47 -0
- package/packages/mcp-server/dist/resources/ir-cache.js.map +1 -0
- package/packages/mcp-server/dist/resources/ir-schema.d.ts +8 -0
- package/packages/mcp-server/dist/resources/ir-schema.d.ts.map +1 -0
- package/packages/mcp-server/dist/resources/ir-schema.js +39 -0
- package/packages/mcp-server/dist/resources/ir-schema.js.map +1 -0
- package/packages/mcp-server/dist/resources/semantics.d.ts +8 -0
- package/packages/mcp-server/dist/resources/semantics.d.ts.map +1 -0
- package/packages/mcp-server/dist/resources/semantics.js +38 -0
- package/packages/mcp-server/dist/resources/semantics.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts +7 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -0
- package/packages/mcp-server/dist/server.js +22 -0
- package/packages/mcp-server/dist/server.js.map +1 -0
- package/packages/mcp-server/dist/state/session-store.d.ts +39 -0
- package/packages/mcp-server/dist/state/session-store.d.ts.map +1 -0
- package/packages/mcp-server/dist/state/session-store.js +58 -0
- package/packages/mcp-server/dist/state/session-store.js.map +1 -0
- package/packages/mcp-server/dist/tools/compile.d.ts +30 -0
- package/packages/mcp-server/dist/tools/compile.d.ts.map +1 -0
- package/packages/mcp-server/dist/tools/compile.js +54 -0
- package/packages/mcp-server/dist/tools/compile.js.map +1 -0
- package/packages/mcp-server/dist/tools/execute.d.ts +112 -0
- package/packages/mcp-server/dist/tools/execute.d.ts.map +1 -0
- package/packages/mcp-server/dist/tools/execute.js +103 -0
- package/packages/mcp-server/dist/tools/execute.js.map +1 -0
- package/packages/mcp-server/dist/tools/explain.d.ts +25 -0
- package/packages/mcp-server/dist/tools/explain.d.ts.map +1 -0
- package/packages/mcp-server/dist/tools/explain.js +254 -0
- package/packages/mcp-server/dist/tools/explain.js.map +1 -0
- package/packages/mcp-server/dist/tools/validate.d.ts +23 -0
- package/packages/mcp-server/dist/tools/validate.d.ts.map +1 -0
- package/packages/mcp-server/dist/tools/validate.js +38 -0
- package/packages/mcp-server/dist/tools/validate.js.map +1 -0
- package/src/manifest/audit/sinks/postgres.sql +51 -0
- package/src/manifest/outbox/stores/postgres.sql +61 -0
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drizzle ORM schema projection.
|
|
3
|
+
*
|
|
4
|
+
* Consumes Manifest IR + projection config and emits Drizzle ORM TypeScript
|
|
5
|
+
* table definitions as a single `ProjectionArtifact`.
|
|
6
|
+
*
|
|
7
|
+
* Boundary rules (following Prisma projection conventions):
|
|
8
|
+
* - Relational interpretation starts HERE. No relational concept (table
|
|
9
|
+
* name, column name, precision, indexes) lives in Manifest core grammar
|
|
10
|
+
* or IR — all of it arrives via projection options.
|
|
11
|
+
* - The projection carries NO knowledge of any specific application,
|
|
12
|
+
* database instance, tenant layout, table naming scheme, or domain
|
|
13
|
+
* meaning of any field.
|
|
14
|
+
* - `computed` properties are derived and MUST NEVER become columns.
|
|
15
|
+
* - `external: true` entities are skipped. Stores with target `'memory'`
|
|
16
|
+
* or `'localStorage'` are skipped.
|
|
17
|
+
* - Unknown `type.name` produces a hard error diagnostic. No fallback.
|
|
18
|
+
*/
|
|
19
|
+
import { normalizeOptions } from './options.js';
|
|
20
|
+
import { resolveDrizzleColumnType, isNumericType, tableFunctionForDialect, importPathForDialect, DEFAULT_DECIMAL_PRECISION, DEFAULT_DECIMAL_SCALE, } from './type-mapping.js';
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// Surface identifiers
|
|
23
|
+
// ============================================================================
|
|
24
|
+
const SURFACE_SCHEMA = 'drizzle.schema';
|
|
25
|
+
const SURFACES = [SURFACE_SCHEMA];
|
|
26
|
+
// ============================================================================
|
|
27
|
+
// Store target classification
|
|
28
|
+
// ============================================================================
|
|
29
|
+
const PERSISTENT_TARGETS = new Set([
|
|
30
|
+
'durable',
|
|
31
|
+
'postgres',
|
|
32
|
+
'supabase',
|
|
33
|
+
]);
|
|
34
|
+
function isPersistent(target) {
|
|
35
|
+
return PERSISTENT_TARGETS.has(target);
|
|
36
|
+
}
|
|
37
|
+
// ============================================================================
|
|
38
|
+
// Helpers
|
|
39
|
+
// ============================================================================
|
|
40
|
+
function literalToDrizzleDefault(value) {
|
|
41
|
+
switch (value.kind) {
|
|
42
|
+
case 'string':
|
|
43
|
+
return `"${value.value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
|
|
44
|
+
case 'number':
|
|
45
|
+
return String(value.value);
|
|
46
|
+
case 'boolean':
|
|
47
|
+
return value.value ? 'true' : 'false';
|
|
48
|
+
case 'null':
|
|
49
|
+
return undefined;
|
|
50
|
+
case 'array': {
|
|
51
|
+
const elements = value.elements.map(literalToDrizzleDefault);
|
|
52
|
+
if (elements.some(element => element === undefined))
|
|
53
|
+
return undefined;
|
|
54
|
+
return `[${elements.join(', ')}]`;
|
|
55
|
+
}
|
|
56
|
+
case 'object':
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Convert a Manifest RefAction value (camelCase) to a Drizzle referential action
|
|
62
|
+
* string (lowercase, matching Drizzle's API: 'cascade', 'restrict', 'setNull', 'noAction', 'setDefault').
|
|
63
|
+
*/
|
|
64
|
+
function toDrizzleAction(action) {
|
|
65
|
+
// Drizzle uses camelCase for setNull, setDefault, noAction
|
|
66
|
+
// which already matches Manifest's IR format, so just return as-is.
|
|
67
|
+
return `'${action}'`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Emit a single Drizzle column definition line for an IR property, or null if
|
|
71
|
+
* the property is unmappable (with a diagnostic explaining why).
|
|
72
|
+
*
|
|
73
|
+
* Example output:
|
|
74
|
+
* id: uuid("id").primaryKey().defaultRandom()
|
|
75
|
+
* name: varchar("name", { length: 255 }).notNull()
|
|
76
|
+
* qty: integer("qty")
|
|
77
|
+
*/
|
|
78
|
+
function emitPropertyColumn(entity, prop, ir, options, _dialect) {
|
|
79
|
+
const diagnostics = [];
|
|
80
|
+
const isArray = prop.type.name === 'array' && prop.type.generic;
|
|
81
|
+
const effectiveTypeName = isArray ? prop.type.generic.name : prop.type.name;
|
|
82
|
+
const isValueObject = ir.values?.some(v => v.name === effectiveTypeName);
|
|
83
|
+
const typeOverrides = isValueObject ? undefined : options.typeMappings?.[entity.name];
|
|
84
|
+
const hasOverride = typeOverrides !== undefined
|
|
85
|
+
&& Object.prototype.hasOwnProperty.call(typeOverrides, prop.name);
|
|
86
|
+
const colType = isValueObject
|
|
87
|
+
? { builder: 'jsonb' }
|
|
88
|
+
: resolveDrizzleColumnType(effectiveTypeName, typeOverrides, prop.name);
|
|
89
|
+
if (!colType) {
|
|
90
|
+
if (effectiveTypeName === 'number' && !hasOverride) {
|
|
91
|
+
diagnostics.push({
|
|
92
|
+
severity: 'error',
|
|
93
|
+
code: 'DRIZZLE_AMBIGUOUS_NUMBER',
|
|
94
|
+
entity: entity.name,
|
|
95
|
+
message: `Property '${entity.name}.${prop.name}' is typed 'number', which is ambiguous (Manifest does not ` +
|
|
96
|
+
`distinguish integers from real numbers from money). Pick a precise type in the .manifest source: ` +
|
|
97
|
+
`'int' or 'bigint' for counts and ids, 'float' for measurements where rounding is acceptable, ` +
|
|
98
|
+
`'money' or 'decimal' for currency and other exact-decimal values. ` +
|
|
99
|
+
`Or supply a 'typeMappings.${entity.name}.${prop.name}' override.`,
|
|
100
|
+
});
|
|
101
|
+
return { line: null, diagnostics };
|
|
102
|
+
}
|
|
103
|
+
diagnostics.push({
|
|
104
|
+
severity: 'error',
|
|
105
|
+
code: 'DRIZZLE_UNKNOWN_TYPE',
|
|
106
|
+
entity: entity.name,
|
|
107
|
+
message: `Property '${entity.name}.${prop.name}' has IR type '${effectiveTypeName}' which is not in the default type mapping ` +
|
|
108
|
+
`and no override was supplied in 'typeMappings.${entity.name}.${prop.name}'. ` +
|
|
109
|
+
`Add an entry to typeMappings, or change the property type in the .manifest source.`,
|
|
110
|
+
});
|
|
111
|
+
return { line: null, diagnostics };
|
|
112
|
+
}
|
|
113
|
+
const hasCompositeKey = entity.key && entity.key.length > 0;
|
|
114
|
+
const isId = prop.name === 'id' && !hasCompositeKey;
|
|
115
|
+
const isRequired = isId || prop.modifiers.includes('required');
|
|
116
|
+
const isUnique = prop.modifiers.includes('unique') && !isId;
|
|
117
|
+
// Column name: use columnMappings override, else use property name
|
|
118
|
+
const colName = options.columnMappings?.[entity.name]?.[prop.name] ?? prop.name;
|
|
119
|
+
// Build the column builder call
|
|
120
|
+
const builder = colType.builder;
|
|
121
|
+
// Build params for the builder call
|
|
122
|
+
const builderParams = [`"${colName}"`];
|
|
123
|
+
// Type-specific parameters
|
|
124
|
+
const prec = options.precision?.[entity.name]?.[prop.name];
|
|
125
|
+
if (isNumericType({ builder }) || (prec && (colType.builder === 'numeric'))) {
|
|
126
|
+
if (prec) {
|
|
127
|
+
builderParams.push(`{ precision: ${prec.precision}, scale: ${prec.scale} }`);
|
|
128
|
+
}
|
|
129
|
+
else if (isNumericType({ builder })) {
|
|
130
|
+
builderParams.push(`{ precision: ${DEFAULT_DECIMAL_PRECISION}, scale: ${DEFAULT_DECIMAL_SCALE} }`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else if (colType.hasParams && colType.defaultParams && colType.builder === 'varchar') {
|
|
134
|
+
builderParams.push(`{ length: ${colType.defaultParams} }`);
|
|
135
|
+
}
|
|
136
|
+
else if (colType.hasParams && colType.defaultParams?.includes('mode')) {
|
|
137
|
+
// bigint mode param
|
|
138
|
+
builderParams.push(colType.defaultParams);
|
|
139
|
+
}
|
|
140
|
+
// Array type: for PostgreSQL, Drizzle uses .array() modifier
|
|
141
|
+
// e.g. varchar("tags", { length: 255 }).array()
|
|
142
|
+
let columnExpr = `${builder}(${builderParams.join(', ')})`;
|
|
143
|
+
// Chain modifiers
|
|
144
|
+
const modifiers = [];
|
|
145
|
+
// Primary key
|
|
146
|
+
if (isId) {
|
|
147
|
+
modifiers.push('.primaryKey()');
|
|
148
|
+
// UUID primary key gets .defaultRandom()
|
|
149
|
+
if (colType.builder === 'uuid' && !prop.defaultValue) {
|
|
150
|
+
modifiers.push('.defaultRandom()');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Not null (required)
|
|
154
|
+
if (isRequired && !isId) {
|
|
155
|
+
modifiers.push('.notNull()');
|
|
156
|
+
}
|
|
157
|
+
// Unique (on column)
|
|
158
|
+
if (isUnique) {
|
|
159
|
+
modifiers.push('.unique()');
|
|
160
|
+
}
|
|
161
|
+
// Encrypted column annotation (informational — encryption is handled at runtime)
|
|
162
|
+
const isEncrypted = prop.modifiers.includes('encrypted');
|
|
163
|
+
if (isEncrypted) {
|
|
164
|
+
diagnostics.push({ severity: 'info', message: `Column '${prop.name}' is marked encrypted — values are envelope-encrypted at runtime.` });
|
|
165
|
+
}
|
|
166
|
+
// Default value
|
|
167
|
+
if (prop.defaultValue && !isId) {
|
|
168
|
+
const def = literalToDrizzleDefault(prop.defaultValue);
|
|
169
|
+
if (def !== undefined) {
|
|
170
|
+
modifiers.push(`.default(${def})`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// Array modifier (applied after other modifiers except in specific cases)
|
|
174
|
+
if (isArray) {
|
|
175
|
+
modifiers.push('.array()');
|
|
176
|
+
}
|
|
177
|
+
columnExpr += modifiers.join('');
|
|
178
|
+
const commentPrefix = isEncrypted ? ` // @encrypted — values stored as envelope JSON\n` : '';
|
|
179
|
+
return {
|
|
180
|
+
line: `${commentPrefix} ${prop.name}: ${columnExpr},`,
|
|
181
|
+
diagnostics,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
// ============================================================================
|
|
185
|
+
// Relationship emission
|
|
186
|
+
// ============================================================================
|
|
187
|
+
/**
|
|
188
|
+
* Look up the Drizzle column type for a named property on the target entity.
|
|
189
|
+
* Used to type FK columns so they match the referenced parent column.
|
|
190
|
+
*/
|
|
191
|
+
function targetPropDrizzleType(targetEntityName, targetPropName, ir, options) {
|
|
192
|
+
const target = ir.entities.find((e) => e.name === targetEntityName);
|
|
193
|
+
if (!target)
|
|
194
|
+
return 'varchar';
|
|
195
|
+
const prop = target.properties.find((p) => p.name === targetPropName);
|
|
196
|
+
if (!prop)
|
|
197
|
+
return 'varchar';
|
|
198
|
+
const overrides = options.typeMappings?.[targetEntityName];
|
|
199
|
+
const colType = resolveDrizzleColumnType(prop.type.name, overrides, targetPropName);
|
|
200
|
+
return colType?.builder ?? 'varchar';
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Find opposite-side relationships for cardinality detection.
|
|
204
|
+
*/
|
|
205
|
+
function findOppositeRelations(fromEntityName, rel, ir) {
|
|
206
|
+
const target = ir.entities.find((e) => e.name === rel.target);
|
|
207
|
+
if (!target)
|
|
208
|
+
return [];
|
|
209
|
+
return target.relationships.filter((r) => {
|
|
210
|
+
if (r.target !== fromEntityName)
|
|
211
|
+
return false;
|
|
212
|
+
if (target.name === fromEntityName && r.name === rel.name)
|
|
213
|
+
return false;
|
|
214
|
+
return true;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Emit Drizzle column and relation lines for one IR relationship.
|
|
219
|
+
*/
|
|
220
|
+
function emitRelationship(entity, rel, ir, options, context) {
|
|
221
|
+
const diagnostics = [];
|
|
222
|
+
const lines = [];
|
|
223
|
+
// Dangling target guard.
|
|
224
|
+
if (!context.emittedEntities.has(rel.target)) {
|
|
225
|
+
diagnostics.push({
|
|
226
|
+
severity: 'warning',
|
|
227
|
+
code: 'DRIZZLE_RELATION_TARGET_NOT_EMITTED',
|
|
228
|
+
entity: entity.name,
|
|
229
|
+
message: `Relationship '${entity.name}.${rel.name}' (${rel.kind} → ${rel.target}) targets an entity that is not emitted. ` +
|
|
230
|
+
`${rel.target} may be external, have a non-persistent store, or have no store declaration.`,
|
|
231
|
+
});
|
|
232
|
+
return { lines, diagnostics };
|
|
233
|
+
}
|
|
234
|
+
// through → join-entity-mediated many-to-many
|
|
235
|
+
if (rel.through) {
|
|
236
|
+
diagnostics.push({
|
|
237
|
+
severity: 'info',
|
|
238
|
+
code: 'DRIZZLE_RELATION_VIA_THROUGH_UNIMPLEMENTED',
|
|
239
|
+
entity: entity.name,
|
|
240
|
+
message: `Relationship '${entity.name}.${rel.name}' uses 'through ${rel.through}'. ` +
|
|
241
|
+
`Declare the join entity with two belongsTo relations instead.`,
|
|
242
|
+
});
|
|
243
|
+
return { lines, diagnostics };
|
|
244
|
+
}
|
|
245
|
+
// Ambiguity check
|
|
246
|
+
const sameTargetCount = entity.relationships.filter((r) => r.target === rel.target).length;
|
|
247
|
+
const opposites = findOppositeRelations(entity.name, rel, ir);
|
|
248
|
+
if (sameTargetCount > 1 || opposites.length > 1) {
|
|
249
|
+
diagnostics.push({
|
|
250
|
+
severity: 'info',
|
|
251
|
+
code: 'DRIZZLE_RELATION_AMBIGUOUS',
|
|
252
|
+
entity: entity.name,
|
|
253
|
+
message: `Relationship '${entity.name}.${rel.name}' → ${rel.target} is one of multiple relations between these entities. ` +
|
|
254
|
+
`Consider using named relations to disambiguate.`,
|
|
255
|
+
});
|
|
256
|
+
return { lines, diagnostics };
|
|
257
|
+
}
|
|
258
|
+
const isOneToOne = opposites.some((o) => o.kind === 'hasOne');
|
|
259
|
+
switch (rel.kind) {
|
|
260
|
+
case 'hasMany':
|
|
261
|
+
case 'hasOne': {
|
|
262
|
+
// In Drizzle, the relation is declared via the `relations()` API.
|
|
263
|
+
// For hasMany/hasOne, we emit a comment noting the relation is set up
|
|
264
|
+
// on the belongsTo side. The actual relation definition is handled
|
|
265
|
+
// in a separate relations export below.
|
|
266
|
+
if (opposites.length === 0) {
|
|
267
|
+
diagnostics.push({
|
|
268
|
+
severity: 'warning',
|
|
269
|
+
code: 'DRIZZLE_RELATION_MISSING_BACKSIDE',
|
|
270
|
+
entity: entity.name,
|
|
271
|
+
message: `Relationship '${entity.name}.${rel.name}: ${rel.target}' has no back-relation. ` +
|
|
272
|
+
`Add a 'belongsTo' from ${rel.target} back to ${entity.name}.`,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
// hasMany/hasOne don't emit columns; the relation is defined via the Drizzle relations() API
|
|
276
|
+
// which we handle separately after all tables are emitted.
|
|
277
|
+
return { lines, diagnostics };
|
|
278
|
+
}
|
|
279
|
+
case 'belongsTo':
|
|
280
|
+
case 'ref': {
|
|
281
|
+
const configFkOverride = options.foreignKeys?.[entity.name]?.[rel.name];
|
|
282
|
+
let fkFields;
|
|
283
|
+
let configRefs;
|
|
284
|
+
if (configFkOverride !== undefined) {
|
|
285
|
+
if (typeof configFkOverride === 'string') {
|
|
286
|
+
fkFields = [configFkOverride];
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
const fkObj = configFkOverride;
|
|
290
|
+
fkFields = fkObj.fields;
|
|
291
|
+
configRefs = fkObj.references;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
fkFields = rel.foreignKey?.fields ?? [`${rel.name}Id`];
|
|
296
|
+
}
|
|
297
|
+
const refsFields = configRefs ?? rel.foreignKey?.references ?? ['id'];
|
|
298
|
+
const isComposite = fkFields.length > 1;
|
|
299
|
+
// Emit FK column(s) if not already declared as entity properties
|
|
300
|
+
for (let i = 0; i < fkFields.length; i++) {
|
|
301
|
+
const fkField = fkFields[i];
|
|
302
|
+
const refField = refsFields[i] ?? 'id';
|
|
303
|
+
const fkAlreadyDeclared = entity.properties.some((p) => p.name === fkField);
|
|
304
|
+
if (!fkAlreadyDeclared) {
|
|
305
|
+
const fkBuilder = targetPropDrizzleType(rel.target, refField, ir, options);
|
|
306
|
+
const colMap = options.columnMappings?.[entity.name]?.[fkField];
|
|
307
|
+
const colName = colMap ?? fkField;
|
|
308
|
+
let fkLine = ` ${fkField}: ${fkBuilder}("${colName}")`;
|
|
309
|
+
if (isOneToOne && !isComposite) {
|
|
310
|
+
fkLine += '.unique()';
|
|
311
|
+
}
|
|
312
|
+
fkLine += ',';
|
|
313
|
+
lines.push(fkLine);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (opposites.length === 0) {
|
|
317
|
+
diagnostics.push({
|
|
318
|
+
severity: 'warning',
|
|
319
|
+
code: 'DRIZZLE_RELATION_MISSING_BACKSIDE',
|
|
320
|
+
entity: entity.name,
|
|
321
|
+
message: `Relationship '${entity.name}.${rel.name}' (${rel.kind}) has no back-relation on ${rel.target}. ` +
|
|
322
|
+
`Add 'hasMany' or 'hasOne' on ${rel.target} pointing back to ${entity.name}.`,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
return { lines, diagnostics };
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function emitTable(entity, ir, options, context) {
|
|
330
|
+
const diagnostics = [];
|
|
331
|
+
const dialect = (options.dialect ?? 'postgresql');
|
|
332
|
+
const tableFn = tableFunctionForDialect(dialect);
|
|
333
|
+
const columns = [];
|
|
334
|
+
let sawIdProperty = false;
|
|
335
|
+
// Iterate properties only — computedProperties are never columns
|
|
336
|
+
for (const prop of entity.properties) {
|
|
337
|
+
if (prop.name === 'id')
|
|
338
|
+
sawIdProperty = true;
|
|
339
|
+
const { line, diagnostics: propDiags } = emitPropertyColumn(entity, prop, ir, options, dialect);
|
|
340
|
+
diagnostics.push(...propDiags);
|
|
341
|
+
if (line !== null)
|
|
342
|
+
columns.push(line);
|
|
343
|
+
}
|
|
344
|
+
const hasCompositeKey = entity.key && entity.key.length > 0;
|
|
345
|
+
if (!sawIdProperty && !hasCompositeKey) {
|
|
346
|
+
diagnostics.push({
|
|
347
|
+
severity: 'error',
|
|
348
|
+
code: 'DRIZZLE_NO_ID_PROPERTY',
|
|
349
|
+
entity: entity.name,
|
|
350
|
+
message: `Entity '${entity.name}' has no property named 'id' and no composite 'key' declaration. ` +
|
|
351
|
+
`Drizzle requires every table to have a primary key. ` +
|
|
352
|
+
`Add 'property required id: string' to the entity or declare 'key [field1, field2, ...]'.`,
|
|
353
|
+
});
|
|
354
|
+
return { tableCode: '', relationsCode: null, diagnostics };
|
|
355
|
+
}
|
|
356
|
+
// Collect FK column lines from relationships
|
|
357
|
+
const fkColumns = [];
|
|
358
|
+
for (const rel of entity.relationships) {
|
|
359
|
+
const { lines, diagnostics: relDiags } = emitRelationship(entity, rel, ir, options, context);
|
|
360
|
+
diagnostics.push(...relDiags);
|
|
361
|
+
fkColumns.push(...lines);
|
|
362
|
+
}
|
|
363
|
+
// Table name: use tableMappings override, else use lowercase entity name
|
|
364
|
+
const tableName = options.tableMappings?.[entity.name] ?? entity.name.toLowerCase();
|
|
365
|
+
// Variable name: use tableMappings if present, else camelCase entity name
|
|
366
|
+
const varName = options.tableMappings?.[entity.name] ?? entity.name.charAt(0).toLowerCase() + entity.name.slice(1);
|
|
367
|
+
// Build composite PK constraint
|
|
368
|
+
const compositePkLine = hasCompositeKey
|
|
369
|
+
? `\n ${entity.key.map(k => k).join(', ')}`
|
|
370
|
+
: null;
|
|
371
|
+
// Build unique constraints from alternateKeys
|
|
372
|
+
const uniqueConstraints = [];
|
|
373
|
+
if (entity.alternateKeys && entity.alternateKeys.length > 0) {
|
|
374
|
+
for (const ak of entity.alternateKeys) {
|
|
375
|
+
uniqueConstraints.push(ak.join(', '));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
// Build index definitions from options
|
|
379
|
+
const indexDefinitions = [];
|
|
380
|
+
const idx = options.indexes?.[entity.name];
|
|
381
|
+
if (idx && idx.length > 0) {
|
|
382
|
+
for (const entry of idx) {
|
|
383
|
+
if (Array.isArray(entry)) {
|
|
384
|
+
indexDefinitions.push(entry.join(', '));
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
indexDefinitions.push(entry.fields.join(', '));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// Combine all columns
|
|
392
|
+
const allColumns = [...columns, ...fkColumns];
|
|
393
|
+
// Build the table definition
|
|
394
|
+
let tableBody = allColumns.join('\n');
|
|
395
|
+
// Add composite PK
|
|
396
|
+
if (compositePkLine) {
|
|
397
|
+
tableBody += `\n // Composite primary key`;
|
|
398
|
+
tableBody += `\n // pk: [${entity.key.join(', ')}]`;
|
|
399
|
+
}
|
|
400
|
+
const tableCode = `export const ${varName} = ${tableFn}("${tableName}", {\n${tableBody}\n});`;
|
|
401
|
+
// Build relations code if entity has relationships
|
|
402
|
+
let relationsCode = null;
|
|
403
|
+
if (entity.relationships.length > 0) {
|
|
404
|
+
const relLines = [];
|
|
405
|
+
for (const rel of entity.relationships) {
|
|
406
|
+
if (!context.emittedEntities.has(rel.target))
|
|
407
|
+
continue;
|
|
408
|
+
if (rel.through)
|
|
409
|
+
continue;
|
|
410
|
+
const sameTargetCount = entity.relationships.filter((r) => r.target === rel.target).length;
|
|
411
|
+
if (sameTargetCount > 1)
|
|
412
|
+
continue;
|
|
413
|
+
const opposites = findOppositeRelations(entity.name, rel, ir);
|
|
414
|
+
const isOneToOne = opposites.some((o) => o.kind === 'hasOne');
|
|
415
|
+
// Determine FK fields
|
|
416
|
+
const configFkOverride = options.foreignKeys?.[entity.name]?.[rel.name];
|
|
417
|
+
let fkFields;
|
|
418
|
+
if (configFkOverride !== undefined) {
|
|
419
|
+
if (typeof configFkOverride === 'string') {
|
|
420
|
+
fkFields = [configFkOverride];
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
fkFields = configFkOverride.fields;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
fkFields = rel.foreignKey?.fields ?? [`${rel.name}Id`];
|
|
428
|
+
}
|
|
429
|
+
// Determine references
|
|
430
|
+
let refsFields;
|
|
431
|
+
if (configFkOverride && typeof configFkOverride !== 'string') {
|
|
432
|
+
refsFields = configFkOverride.references ?? ['id'];
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
refsFields = rel.foreignKey?.references ?? ['id'];
|
|
436
|
+
}
|
|
437
|
+
// Determine referential actions
|
|
438
|
+
let onDelete;
|
|
439
|
+
let onUpdate;
|
|
440
|
+
if (configFkOverride && typeof configFkOverride !== 'string') {
|
|
441
|
+
onDelete = configFkOverride.onDelete;
|
|
442
|
+
onUpdate = configFkOverride.onUpdate;
|
|
443
|
+
}
|
|
444
|
+
if (!onDelete && rel.onDelete)
|
|
445
|
+
onDelete = rel.onDelete;
|
|
446
|
+
if (!onUpdate && rel.onUpdate)
|
|
447
|
+
onUpdate = rel.onUpdate;
|
|
448
|
+
const targetVarName = options.tableMappings?.[rel.target] ?? rel.target.charAt(0).toLowerCase() + rel.target.slice(1);
|
|
449
|
+
switch (rel.kind) {
|
|
450
|
+
case 'hasMany':
|
|
451
|
+
relLines.push(` ${rel.name}: many(${targetVarName}),`);
|
|
452
|
+
break;
|
|
453
|
+
case 'hasOne':
|
|
454
|
+
relLines.push(` ${rel.name}: one(${targetVarName}),`);
|
|
455
|
+
break;
|
|
456
|
+
case 'belongsTo':
|
|
457
|
+
case 'ref': {
|
|
458
|
+
const relConfig = [];
|
|
459
|
+
relConfig.push(`fields: [${fkFields.map(f => `${varName}.${f}`).join(', ')}]`);
|
|
460
|
+
relConfig.push(`references: [${refsFields.map(r => `${targetVarName}.${r}`).join(', ')}]`);
|
|
461
|
+
if (onDelete)
|
|
462
|
+
relConfig.push(`onDelete: ${toDrizzleAction(onDelete)}`);
|
|
463
|
+
if (onUpdate)
|
|
464
|
+
relConfig.push(`onUpdate: ${toDrizzleAction(onUpdate)}`);
|
|
465
|
+
// In Drizzle, belongsTo uses one() with references
|
|
466
|
+
if (isOneToOne) {
|
|
467
|
+
relLines.push(` ${rel.name}: one(${targetVarName}, { ${relConfig.join(', ')} }),`);
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
relLines.push(` ${rel.name}: one(${targetVarName}, { ${relConfig.join(', ')} }),`);
|
|
471
|
+
}
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (relLines.length > 0) {
|
|
477
|
+
relationsCode = `export const ${varName}Relations = relations(${varName}, ({ one, many }) => ({\n${relLines.join('\n')}\n}));`;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return { tableCode, relationsCode, diagnostics };
|
|
481
|
+
}
|
|
482
|
+
// ============================================================================
|
|
483
|
+
// Index emission
|
|
484
|
+
// ============================================================================
|
|
485
|
+
function emitIndexes(entity, options) {
|
|
486
|
+
const idx = options.indexes?.[entity.name];
|
|
487
|
+
const lines = [];
|
|
488
|
+
const varName = options.tableMappings?.[entity.name] ?? entity.name.charAt(0).toLowerCase() + entity.name.slice(1);
|
|
489
|
+
if (idx && idx.length > 0) {
|
|
490
|
+
for (const entry of idx) {
|
|
491
|
+
const fields = Array.isArray(entry) ? entry : entry.fields;
|
|
492
|
+
const name = !Array.isArray(entry) && entry.name ? entry.name : `${varName}_${fields.join('_')}_idx`;
|
|
493
|
+
lines.push(`export const ${name.replace(/[^a-zA-Z0-9_]/g, '_')} = index("${name}")`);
|
|
494
|
+
lines.push(` .on(${fields.map(f => `${varName}.${f}`).join(', ')});`);
|
|
495
|
+
lines.push(``);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
// GIN tsvector index for searchable properties (PostgreSQL only)
|
|
499
|
+
const dialect = (options.dialect ?? 'postgresql');
|
|
500
|
+
const searchableFields = entity.properties.filter(p => p.modifiers.includes('searchable')).map(p => p.name);
|
|
501
|
+
if (searchableFields.length > 0 && dialect === 'postgresql') {
|
|
502
|
+
const tsvectorParts = searchableFields.map(f => `"${f}"`).join(` || ' ' || `);
|
|
503
|
+
const idxName = `${varName}_search_idx`;
|
|
504
|
+
lines.push(`export const ${idxName} = index("${idxName}")`);
|
|
505
|
+
lines.push(` .using("gin", sql\`to_tsvector('english', ${tsvectorParts})\`);`);
|
|
506
|
+
lines.push(``);
|
|
507
|
+
}
|
|
508
|
+
return lines;
|
|
509
|
+
}
|
|
510
|
+
// ============================================================================
|
|
511
|
+
// Projection target
|
|
512
|
+
// ============================================================================
|
|
513
|
+
export class DrizzleProjection {
|
|
514
|
+
name = 'drizzle';
|
|
515
|
+
description = 'Manifest IR → Drizzle ORM schema projection. TypeScript-first, compatible with Drizzle Kit migrations.';
|
|
516
|
+
surfaces = SURFACES;
|
|
517
|
+
generate(ir, request) {
|
|
518
|
+
if (request.surface !== SURFACE_SCHEMA) {
|
|
519
|
+
return {
|
|
520
|
+
artifacts: [],
|
|
521
|
+
diagnostics: [
|
|
522
|
+
{
|
|
523
|
+
severity: 'error',
|
|
524
|
+
code: 'UNKNOWN_SURFACE',
|
|
525
|
+
message: `Unknown surface '${request.surface}'. Available: ${SURFACES.join(', ')}.`,
|
|
526
|
+
},
|
|
527
|
+
],
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
const options = normalizeOptions(request.options);
|
|
531
|
+
const diagnostics = [];
|
|
532
|
+
const dialect = (options.dialect ?? 'postgresql');
|
|
533
|
+
const storeByEntity = new Map();
|
|
534
|
+
for (const s of ir.stores)
|
|
535
|
+
storeByEntity.set(s.entity, s.target);
|
|
536
|
+
const toEmit = [];
|
|
537
|
+
const emittedEntities = new Set();
|
|
538
|
+
for (const entity of ir.entities) {
|
|
539
|
+
if (entity.external === true) {
|
|
540
|
+
diagnostics.push({
|
|
541
|
+
severity: 'info',
|
|
542
|
+
code: 'DRIZZLE_SKIPPED_EXTERNAL',
|
|
543
|
+
entity: entity.name,
|
|
544
|
+
message: `Entity '${entity.name}' is marked external; skipped.`,
|
|
545
|
+
});
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
const target = storeByEntity.get(entity.name);
|
|
549
|
+
if (target === undefined) {
|
|
550
|
+
diagnostics.push({
|
|
551
|
+
severity: 'info',
|
|
552
|
+
code: 'DRIZZLE_SKIPPED_NO_STORE',
|
|
553
|
+
entity: entity.name,
|
|
554
|
+
message: `Entity '${entity.name}' has no 'store' declaration; skipped.`,
|
|
555
|
+
});
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
if (!isPersistent(target)) {
|
|
559
|
+
diagnostics.push({
|
|
560
|
+
severity: 'info',
|
|
561
|
+
code: 'DRIZZLE_SKIPPED_NON_DURABLE',
|
|
562
|
+
entity: entity.name,
|
|
563
|
+
message: `Entity '${entity.name}' has store target '${target}'; skipped.`,
|
|
564
|
+
});
|
|
565
|
+
continue;
|
|
566
|
+
}
|
|
567
|
+
toEmit.push(entity);
|
|
568
|
+
emittedEntities.add(entity.name);
|
|
569
|
+
}
|
|
570
|
+
const context = { emittedEntities };
|
|
571
|
+
// Emit tables
|
|
572
|
+
const tableDefs = [];
|
|
573
|
+
const relationDefs = [];
|
|
574
|
+
const indexDefs = [];
|
|
575
|
+
for (const entity of toEmit) {
|
|
576
|
+
const { tableCode, relationsCode, diagnostics: tableDiags } = emitTable(entity, ir, options, context);
|
|
577
|
+
diagnostics.push(...tableDiags);
|
|
578
|
+
if (tableCode) {
|
|
579
|
+
tableDefs.push(tableCode);
|
|
580
|
+
}
|
|
581
|
+
if (relationsCode) {
|
|
582
|
+
relationDefs.push(relationsCode);
|
|
583
|
+
}
|
|
584
|
+
// Emit indexes
|
|
585
|
+
const entityIndexes = emitIndexes(entity, options);
|
|
586
|
+
indexDefs.push(...entityIndexes);
|
|
587
|
+
}
|
|
588
|
+
// Build the final schema file
|
|
589
|
+
const tableFn = tableFunctionForDialect(dialect);
|
|
590
|
+
const importPath = importPathForDialect(dialect);
|
|
591
|
+
// Determine which column types are used so we import only what's needed
|
|
592
|
+
const usedTypes = new Set();
|
|
593
|
+
for (const entity of toEmit) {
|
|
594
|
+
for (const prop of entity.properties) {
|
|
595
|
+
const isArray = prop.type.name === 'array' && prop.type.generic;
|
|
596
|
+
const effectiveTypeName = isArray ? prop.type.generic.name : prop.type.name;
|
|
597
|
+
const isValueObject = ir.values?.some(v => v.name === effectiveTypeName);
|
|
598
|
+
const overrides = isValueObject ? undefined : options.typeMappings?.[entity.name];
|
|
599
|
+
const colType = isValueObject ? { builder: 'jsonb' } : resolveDrizzleColumnType(effectiveTypeName, overrides, prop.name);
|
|
600
|
+
if (colType)
|
|
601
|
+
usedTypes.add(colType.builder);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
const header = [
|
|
605
|
+
'// Auto-generated by @manifest/projection-drizzle',
|
|
606
|
+
'// DO NOT EDIT — regenerate with the projection.',
|
|
607
|
+
];
|
|
608
|
+
// Only emit imports when there are tables to emit
|
|
609
|
+
if (tableDefs.length > 0) {
|
|
610
|
+
header.push('');
|
|
611
|
+
header.push(`import { ${tableFn} } from '${importPath}';`);
|
|
612
|
+
// Add type imports
|
|
613
|
+
if (usedTypes.size > 0) {
|
|
614
|
+
const types = Array.from(usedTypes).sort().join(', ');
|
|
615
|
+
header.push(`import { ${types} } from '${importPath}';`);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
// Add relations import if any relations exist
|
|
619
|
+
const hasRelations = relationDefs.length > 0;
|
|
620
|
+
if (hasRelations) {
|
|
621
|
+
header.push(`import { relations } from 'drizzle-orm';`);
|
|
622
|
+
}
|
|
623
|
+
// Add index import if any indexes exist
|
|
624
|
+
if (indexDefs.length > 0) {
|
|
625
|
+
header.push(`import { index } from '${importPath}';`);
|
|
626
|
+
}
|
|
627
|
+
header.push('');
|
|
628
|
+
const codeParts = [
|
|
629
|
+
header.join('\n'),
|
|
630
|
+
];
|
|
631
|
+
if (tableDefs.length > 0) {
|
|
632
|
+
codeParts.push(tableDefs.join('\n\n'));
|
|
633
|
+
}
|
|
634
|
+
if (hasRelations) {
|
|
635
|
+
codeParts.push('');
|
|
636
|
+
codeParts.push(relationDefs.join('\n\n'));
|
|
637
|
+
}
|
|
638
|
+
if (indexDefs.length > 0) {
|
|
639
|
+
codeParts.push('');
|
|
640
|
+
codeParts.push(indexDefs.join('\n'));
|
|
641
|
+
}
|
|
642
|
+
const code = codeParts.join('\n');
|
|
643
|
+
const artifacts = [
|
|
644
|
+
{
|
|
645
|
+
id: 'drizzle.schema',
|
|
646
|
+
pathHint: options.output,
|
|
647
|
+
contentType: 'typescript',
|
|
648
|
+
code,
|
|
649
|
+
},
|
|
650
|
+
];
|
|
651
|
+
return { artifacts, diagnostics };
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
//# sourceMappingURL=generator.js.map
|