@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,861 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prisma schema projection.
|
|
3
|
+
*
|
|
4
|
+
* Consumes Manifest IR + projection config and emits a Prisma schema string
|
|
5
|
+
* as a single `ProjectionArtifact`.
|
|
6
|
+
*
|
|
7
|
+
* Boundary rules (Checkpoint 1, normative):
|
|
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. Anything resembling an app-specific string in
|
|
14
|
+
* this file is a bug.
|
|
15
|
+
* - `computed` properties are derived and MUST NEVER become columns. We
|
|
16
|
+
* do this structurally by iterating `entity.properties` only and never
|
|
17
|
+
* touching `entity.computedProperties`.
|
|
18
|
+
* - `external: true` entities are skipped. Stores with target `'memory'`
|
|
19
|
+
* or `'localStorage'` are skipped. Targets `'durable'`, `'postgres'`,
|
|
20
|
+
* and `'supabase'` are emission targets. Entities with no store entry
|
|
21
|
+
* are skipped (no implicit ownership).
|
|
22
|
+
* - Unknown `type.name` produces a hard error diagnostic. No fallback.
|
|
23
|
+
*/
|
|
24
|
+
import { normalizeOptions } from './options.js';
|
|
25
|
+
import { resolvePrismaScalar, isDecimalScalar, DEFAULT_DECIMAL_PRECISION, DEFAULT_DECIMAL_SCALE, } from './type-mapping.js';
|
|
26
|
+
import { resolveColumnName, resolveTableName } from '../shared/naming.js';
|
|
27
|
+
// ============================================================================
|
|
28
|
+
// Surface identifiers
|
|
29
|
+
// ============================================================================
|
|
30
|
+
const SURFACE_SCHEMA = 'prisma.schema';
|
|
31
|
+
const SURFACES = [SURFACE_SCHEMA];
|
|
32
|
+
// ============================================================================
|
|
33
|
+
// Store target classification
|
|
34
|
+
// ============================================================================
|
|
35
|
+
/**
|
|
36
|
+
* Store targets the Prisma projection considers persistent and therefore
|
|
37
|
+
* eligible for model emission. `'durable'` is the backend-neutral signal
|
|
38
|
+
* introduced in Phase 2; `'postgres'` / `'supabase'` are the legacy
|
|
39
|
+
* backend-specific names that the runtime engine still knows about.
|
|
40
|
+
*/
|
|
41
|
+
const PERSISTENT_TARGETS = new Set([
|
|
42
|
+
'durable',
|
|
43
|
+
'postgres',
|
|
44
|
+
'supabase',
|
|
45
|
+
]);
|
|
46
|
+
function isPersistent(target) {
|
|
47
|
+
return PERSISTENT_TARGETS.has(target);
|
|
48
|
+
}
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Multi-schema layout
|
|
51
|
+
// ============================================================================
|
|
52
|
+
/**
|
|
53
|
+
* Providers that support multiple database schemas in Prisma. Enabling
|
|
54
|
+
* `multiSchema` with any other provider is a hard error.
|
|
55
|
+
*/
|
|
56
|
+
const MULTISCHEMA_PROVIDERS = new Set([
|
|
57
|
+
'postgresql',
|
|
58
|
+
'cockroachdb',
|
|
59
|
+
'sqlserver',
|
|
60
|
+
]);
|
|
61
|
+
/**
|
|
62
|
+
* Resolve the database schema a model belongs to, or `undefined` when the
|
|
63
|
+
* flat layout is in effect (multiSchema disabled). Resolution order:
|
|
64
|
+
* 1. explicit `entitySchema[name]` override
|
|
65
|
+
* 2. the entity's IR `module` (the real layout we are preserving)
|
|
66
|
+
* 3. `defaultSchema` (default `"public"`)
|
|
67
|
+
*/
|
|
68
|
+
function resolveSchemaName(entity, options) {
|
|
69
|
+
const ms = options.multiSchema;
|
|
70
|
+
if (!ms?.enabled)
|
|
71
|
+
return undefined;
|
|
72
|
+
return ms.entitySchema?.[entity.name] ?? entity.module ?? ms.defaultSchema ?? 'public';
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Resolve the database schema an enum belongs to (multiSchema only). Mirrors
|
|
76
|
+
* `resolveSchemaName` for entities: explicit `entitySchema[name]` override,
|
|
77
|
+
* then the enum's IR `module`, then `defaultSchema`.
|
|
78
|
+
*/
|
|
79
|
+
function resolveEnumSchemaName(enumDef, options) {
|
|
80
|
+
const ms = options.multiSchema;
|
|
81
|
+
if (!ms?.enabled)
|
|
82
|
+
return undefined;
|
|
83
|
+
return ms.entitySchema?.[enumDef.name] ?? enumDef.module ?? ms.defaultSchema ?? 'public';
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Emit a Prisma `enum` block from an IR enum. Only the value *names* are
|
|
87
|
+
* emitted: a Prisma enum value identifier IS its stored database value, whereas
|
|
88
|
+
* an IR enum value's `label` is UI-display-only and `ordinal` is a sort hint —
|
|
89
|
+
* neither is expressible as plain Prisma enum syntax (and emitting `label` via
|
|
90
|
+
* `@map` would silently change the stored value), so both are intentionally
|
|
91
|
+
* dropped. Declaration order is preserved (authoritative from the IR).
|
|
92
|
+
*/
|
|
93
|
+
function emitEnum(enumDef, options) {
|
|
94
|
+
const lines = [`enum ${enumDef.name} {`];
|
|
95
|
+
for (const value of enumDef.values) {
|
|
96
|
+
lines.push(` ${value.name}`);
|
|
97
|
+
}
|
|
98
|
+
const schemaName = resolveEnumSchemaName(enumDef, options);
|
|
99
|
+
if (schemaName) {
|
|
100
|
+
lines.push('');
|
|
101
|
+
lines.push(` @@schema("${schemaName}")`);
|
|
102
|
+
}
|
|
103
|
+
lines.push('}');
|
|
104
|
+
return lines.join('\n');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Build the datasource `schemas = [...]` list: explicit entries first (order
|
|
108
|
+
* preserved), then any schema referenced by a model OR enum but not explicitly
|
|
109
|
+
* listed, appended in sorted order. Guarantees every referenced schema is declared.
|
|
110
|
+
*/
|
|
111
|
+
function buildSchemasList(entities, enums, options) {
|
|
112
|
+
const ordered = [...(options.multiSchema?.schemas ?? [])];
|
|
113
|
+
const used = new Set();
|
|
114
|
+
for (const entity of entities) {
|
|
115
|
+
const schema = resolveSchemaName(entity, options);
|
|
116
|
+
if (schema)
|
|
117
|
+
used.add(schema);
|
|
118
|
+
}
|
|
119
|
+
for (const enumDef of enums) {
|
|
120
|
+
const schema = resolveEnumSchemaName(enumDef, options);
|
|
121
|
+
if (schema)
|
|
122
|
+
used.add(schema);
|
|
123
|
+
}
|
|
124
|
+
for (const schema of [...used].sort()) {
|
|
125
|
+
if (!ordered.includes(schema))
|
|
126
|
+
ordered.push(schema);
|
|
127
|
+
}
|
|
128
|
+
return ordered;
|
|
129
|
+
}
|
|
130
|
+
// ============================================================================
|
|
131
|
+
// Helpers
|
|
132
|
+
// ============================================================================
|
|
133
|
+
function literalToPrismaDefault(value) {
|
|
134
|
+
switch (value.kind) {
|
|
135
|
+
case 'string':
|
|
136
|
+
return `"${value.value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
|
|
137
|
+
case 'number':
|
|
138
|
+
return String(value.value);
|
|
139
|
+
case 'boolean':
|
|
140
|
+
return value.value ? 'true' : 'false';
|
|
141
|
+
case 'null':
|
|
142
|
+
// Prisma's `@default(null)` is not a thing; nullable columns omit @default.
|
|
143
|
+
return undefined;
|
|
144
|
+
case 'array': {
|
|
145
|
+
const elements = value.elements.map(literalToPrismaDefault);
|
|
146
|
+
if (elements.some(element => element === undefined))
|
|
147
|
+
return undefined;
|
|
148
|
+
return `[${elements.join(', ')}]`;
|
|
149
|
+
}
|
|
150
|
+
case 'object':
|
|
151
|
+
// Object defaults are not portable to Prisma; consumers can supply
|
|
152
|
+
// their own via fieldAttributes. Silently skip.
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function buildIndexLine(entry) {
|
|
157
|
+
if (Array.isArray(entry)) {
|
|
158
|
+
return ` @@index([${entry.join(', ')}])`;
|
|
159
|
+
}
|
|
160
|
+
const fields = `[${entry.fields.join(', ')}]`;
|
|
161
|
+
return entry.name
|
|
162
|
+
? ` @@index(${fields}, name: "${entry.name}")`
|
|
163
|
+
: ` @@index(${fields})`;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Convert a Manifest RefAction value (camelCase) to a Prisma referential action
|
|
167
|
+
* (PascalCase). e.g. `cascade` → `Cascade`, `setNull` → `SetNull`.
|
|
168
|
+
*/
|
|
169
|
+
function toPrismaAction(action) {
|
|
170
|
+
return action.charAt(0).toUpperCase() + action.slice(1);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Emit a single Prisma model field line for an IR property, or null if the
|
|
174
|
+
* property is unmappable (with a diagnostic explaining why).
|
|
175
|
+
*/
|
|
176
|
+
function emitPropertyLine(entity, prop, ir, options) {
|
|
177
|
+
const diagnostics = [];
|
|
178
|
+
// Array type handling: array<T> or T[] produces Prisma ScalarType[]
|
|
179
|
+
// (e.g. array<string> → String[], array<int> → Int[]).
|
|
180
|
+
const isArray = prop.type.name === 'array' && prop.type.generic;
|
|
181
|
+
const effectiveTypeName = isArray ? prop.type.generic.name : prop.type.name;
|
|
182
|
+
const isValueObject = ir.values?.some(v => v.name === effectiveTypeName);
|
|
183
|
+
// Enum-typed property: the IR type name matches a declared enum. The Prisma
|
|
184
|
+
// field type IS the enum name (emitted as a `enum` block by emitEnum), unless
|
|
185
|
+
// a typeMappings override is explicitly supplied.
|
|
186
|
+
const isEnum = (ir.enums?.some(e => e.name === effectiveTypeName) ?? false) && !isValueObject;
|
|
187
|
+
const typeOverrides = isValueObject ? undefined : options.typeMappings?.[entity.name];
|
|
188
|
+
const hasOverride = typeOverrides !== undefined
|
|
189
|
+
&& Object.prototype.hasOwnProperty.call(typeOverrides, prop.name);
|
|
190
|
+
const scalar = isValueObject
|
|
191
|
+
? 'Json'
|
|
192
|
+
: (isEnum && !hasOverride)
|
|
193
|
+
? effectiveTypeName
|
|
194
|
+
: resolvePrismaScalar(effectiveTypeName, typeOverrides, prop.name);
|
|
195
|
+
if (!scalar) {
|
|
196
|
+
if (effectiveTypeName === 'number' && !hasOverride) {
|
|
197
|
+
diagnostics.push({
|
|
198
|
+
severity: 'error',
|
|
199
|
+
code: 'PRISMA_AMBIGUOUS_NUMBER',
|
|
200
|
+
entity: entity.name,
|
|
201
|
+
message: `Property '${entity.name}.${prop.name}' is typed 'number', which is ambiguous (Manifest does not ` +
|
|
202
|
+
`distinguish integers from real numbers from money). Pick a precise type in the .manifest source: ` +
|
|
203
|
+
`'int' or 'bigint' for counts and ids, 'float' for measurements where rounding is acceptable, ` +
|
|
204
|
+
`'money' or 'decimal' for currency and other exact-decimal values. ` +
|
|
205
|
+
`Or supply a 'typeMappings.${entity.name}.${prop.name}' override.`,
|
|
206
|
+
});
|
|
207
|
+
return { line: null, diagnostics };
|
|
208
|
+
}
|
|
209
|
+
diagnostics.push({
|
|
210
|
+
severity: 'error',
|
|
211
|
+
code: 'PRISMA_UNKNOWN_TYPE',
|
|
212
|
+
entity: entity.name,
|
|
213
|
+
message: `Property '${entity.name}.${prop.name}' has IR type '${effectiveTypeName}' which is not in the default type mapping ` +
|
|
214
|
+
`and no override was supplied in 'typeMappings.${entity.name}.${prop.name}'. ` +
|
|
215
|
+
`Add an entry to typeMappings, or change the property type in the .manifest source.`,
|
|
216
|
+
});
|
|
217
|
+
return { line: null, diagnostics };
|
|
218
|
+
}
|
|
219
|
+
// @id is auto-added for a property named 'id' UNLESS the entity uses a composite key
|
|
220
|
+
// (in that case @@id([...]) is emitted at model level; the id column is not special).
|
|
221
|
+
const hasCompositeKey = entity.key && entity.key.length > 0;
|
|
222
|
+
const isId = prop.name === 'id' && !hasCompositeKey;
|
|
223
|
+
const isRequired = isId || prop.modifiers.includes('required');
|
|
224
|
+
// Prisma list fields (String[]) are implicitly optional — never append ?.
|
|
225
|
+
const nullableSuffix = isArray ? '' : (isRequired ? '' : '?');
|
|
226
|
+
// Prisma list suffix: scalar becomes scalar[].
|
|
227
|
+
const listSuffix = isArray ? '[]' : '';
|
|
228
|
+
// Attribute list, ordered: @id, @unique, @default, @map, @db.Decimal, @db.ObjectId,
|
|
229
|
+
// dbAttributes (@db.*), fieldAttributes (@unique, @default(now()), @updatedAt, etc.)
|
|
230
|
+
const attrs = [];
|
|
231
|
+
if (isId)
|
|
232
|
+
attrs.push('@id');
|
|
233
|
+
if (prop.modifiers.includes('unique') && !isId)
|
|
234
|
+
attrs.push('@unique');
|
|
235
|
+
const isMongo = options.provider === 'mongodb';
|
|
236
|
+
const colMapOverride = options.columnMappings?.[entity.name]?.[prop.name];
|
|
237
|
+
if (isId && isMongo && !colMapOverride && !prop.defaultValue) {
|
|
238
|
+
attrs.push('@default(auto())');
|
|
239
|
+
}
|
|
240
|
+
// Scan fieldAttributes early to detect @default overrides.
|
|
241
|
+
// We need to know BEFORE emitting the IR default whether the consumer
|
|
242
|
+
// supplied their own @default. Actual push is deferred after dbAttributes.
|
|
243
|
+
const fieldAttrs = options.fieldAttributes?.[entity.name]?.[prop.name];
|
|
244
|
+
const fieldAttrHasDefault = fieldAttrs?.some(fa => /^@default\b/.test(fa)) ?? false;
|
|
245
|
+
// NOTE: IR-level @default is NOT emitted here. It's emitted after dbAttributes
|
|
246
|
+
// so that the attribute ordering matches the existing test expectations
|
|
247
|
+
// (@id → @map → @db.* → @default → @updatedAt → @unique).
|
|
248
|
+
if (colMapOverride) {
|
|
249
|
+
attrs.push(`@map("${colMapOverride}")`);
|
|
250
|
+
}
|
|
251
|
+
else if (isId && isMongo) {
|
|
252
|
+
attrs.push('@map("_id")');
|
|
253
|
+
}
|
|
254
|
+
else if (options.naming) {
|
|
255
|
+
// Auto-casing convention: emit @map only when the physical name differs
|
|
256
|
+
// from the IR property name. The Prisma field identifier stays prop.name.
|
|
257
|
+
const phys = resolveColumnName(prop.name, options.naming);
|
|
258
|
+
if (phys !== prop.name)
|
|
259
|
+
attrs.push(`@map("${phys}")`);
|
|
260
|
+
}
|
|
261
|
+
const prec = options.precision?.[entity.name]?.[prop.name];
|
|
262
|
+
if (prec) {
|
|
263
|
+
attrs.push(`@db.Decimal(${prec.precision}, ${prec.scale})`);
|
|
264
|
+
}
|
|
265
|
+
else if (isDecimalScalar(scalar)) {
|
|
266
|
+
attrs.push(`@db.Decimal(${DEFAULT_DECIMAL_PRECISION}, ${DEFAULT_DECIMAL_SCALE})`);
|
|
267
|
+
}
|
|
268
|
+
if (isId && isMongo && scalar === 'String') {
|
|
269
|
+
const idTypeOverride = options.typeMappings?.[entity.name]?.id;
|
|
270
|
+
if (!idTypeOverride || idTypeOverride === 'String') {
|
|
271
|
+
attrs.push('@db.ObjectId');
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
// Generic @db.* attribute emission from config.
|
|
275
|
+
// Skip if a @db.Decimal was already emitted by the precision path above.
|
|
276
|
+
const hasDbDecimal = attrs.some(a => a.startsWith('@db.Decimal'));
|
|
277
|
+
const dbAttr = options.dbAttributes?.[entity.name]?.[prop.name];
|
|
278
|
+
if (dbAttr && !hasDbDecimal) {
|
|
279
|
+
attrs.push(`@db.${dbAttr}`);
|
|
280
|
+
}
|
|
281
|
+
// `= now()` / `= today()` default: emit a store-level `@default(now())` so the
|
|
282
|
+
// column is populated even when a row is inserted without the field.
|
|
283
|
+
if (prop.autoNow && !fieldAttrHasDefault) {
|
|
284
|
+
attrs.push('@default(now())');
|
|
285
|
+
}
|
|
286
|
+
// IR-level default: only emit if fieldAttributes didn't supply a @default override.
|
|
287
|
+
if (prop.defaultValue && !fieldAttrHasDefault) {
|
|
288
|
+
if (isEnum && prop.defaultValue.kind === 'string') {
|
|
289
|
+
// An enum default is a member identifier, emitted bare (`@default(draft)`),
|
|
290
|
+
// never quoted like a string literal (`@default("draft")` would be invalid).
|
|
291
|
+
attrs.push(`@default(${prop.defaultValue.value})`);
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
const def = literalToPrismaDefault(prop.defaultValue);
|
|
295
|
+
if (def !== undefined)
|
|
296
|
+
attrs.push(`@default(${def})`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
// Field-level attributes from config (e.g. @unique, @default(now()), @updatedAt).
|
|
300
|
+
// For @default: replaces any IR-emitted @default in-place (consumer override wins).
|
|
301
|
+
// For all other kinds: suppressed if already present from IR/modifiers.
|
|
302
|
+
if (fieldAttrs && fieldAttrs.length > 0) {
|
|
303
|
+
for (const fa of fieldAttrs) {
|
|
304
|
+
const faKind = fa.match(/^@\w+/)?.[0];
|
|
305
|
+
if (faKind === '@default') {
|
|
306
|
+
// Replace any existing @default (from IR) in-place to preserve attribute order.
|
|
307
|
+
const idx = attrs.findIndex(a => a.startsWith('@default'));
|
|
308
|
+
if (idx !== -1) {
|
|
309
|
+
attrs[idx] = fa;
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
attrs.push(fa);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
else if (faKind) {
|
|
316
|
+
// Non-default: skip if this kind already exists in attrs.
|
|
317
|
+
if (!attrs.some(a => a.startsWith(faKind)))
|
|
318
|
+
attrs.push(fa);
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
attrs.push(fa);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const attrPart = attrs.length ? ' ' + attrs.join(' ') : '';
|
|
326
|
+
const encryptedComment = prop.modifiers.includes('encrypted')
|
|
327
|
+
? ' // @encrypted — envelope-encrypted at runtime'
|
|
328
|
+
: '';
|
|
329
|
+
return {
|
|
330
|
+
line: ` ${prop.name} ${scalar}${listSuffix}${nullableSuffix}${attrPart}${encryptedComment}`,
|
|
331
|
+
diagnostics,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
// ============================================================================
|
|
335
|
+
// Relationship emission
|
|
336
|
+
// ============================================================================
|
|
337
|
+
/**
|
|
338
|
+
* Look up the Prisma scalar type for a named property on the target entity.
|
|
339
|
+
* Used to type FK columns so they match the referenced parent column.
|
|
340
|
+
* Falls back to `'String'` when the target or property is not found.
|
|
341
|
+
*/
|
|
342
|
+
function targetPropPrismaType(targetEntityName, targetPropName, ir, options) {
|
|
343
|
+
const target = ir.entities.find((e) => e.name === targetEntityName);
|
|
344
|
+
if (!target)
|
|
345
|
+
return 'String';
|
|
346
|
+
const prop = target.properties.find((p) => p.name === targetPropName);
|
|
347
|
+
if (!prop)
|
|
348
|
+
return 'String';
|
|
349
|
+
const overrides = options.typeMappings?.[targetEntityName];
|
|
350
|
+
return resolvePrismaScalar(prop.type.name, overrides, targetPropName) ?? 'String';
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Find every relationship declared on `targetEntity` whose target is
|
|
354
|
+
* `fromEntityName`. These are the "opposite-side" relationships used to
|
|
355
|
+
* decide cardinality (1:1 vs 1:N) and detect ambiguity or missing back-rels.
|
|
356
|
+
*
|
|
357
|
+
* SELF-RELATION HANDLING: when `rel.target === fromEntityName`, we filter
|
|
358
|
+
* the relationship out of its own opposite set by name to avoid false-positive
|
|
359
|
+
* ambiguity and suppress the missing-backside warning.
|
|
360
|
+
*/
|
|
361
|
+
function findOppositeRelations(fromEntityName, rel, ir) {
|
|
362
|
+
const target = ir.entities.find((e) => e.name === rel.target);
|
|
363
|
+
if (!target)
|
|
364
|
+
return [];
|
|
365
|
+
return target.relationships.filter((r) => {
|
|
366
|
+
if (r.target !== fromEntityName)
|
|
367
|
+
return false;
|
|
368
|
+
if (target.name === fromEntityName && r.name === rel.name)
|
|
369
|
+
return false;
|
|
370
|
+
return true;
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Emit Prisma field lines for one IR relationship.
|
|
375
|
+
*
|
|
376
|
+
* Composite-PK/FK additions (v1.0):
|
|
377
|
+
* - `foreignKey.fields` is an array of local column names (1 = single, N = composite).
|
|
378
|
+
* - `foreignKey.references` is an array of remote column names (absent → default ["id"]).
|
|
379
|
+
* - For composite FK: emit one column line per local field; emit `@@unique([...])` for 1:1.
|
|
380
|
+
* - `onDelete`/`onUpdate`: emit as Prisma referential action attributes when present.
|
|
381
|
+
*/
|
|
382
|
+
function emitRelationship(entity, rel, ir, options, context) {
|
|
383
|
+
const diagnostics = [];
|
|
384
|
+
const lines = [];
|
|
385
|
+
// (0) Dangling target guard.
|
|
386
|
+
if (!context.emittedEntities.has(rel.target)) {
|
|
387
|
+
diagnostics.push({
|
|
388
|
+
severity: 'warning',
|
|
389
|
+
code: 'PRISMA_RELATION_TARGET_NOT_EMITTED',
|
|
390
|
+
entity: entity.name,
|
|
391
|
+
message: `Relationship '${entity.name}.${rel.name}' (${rel.kind} → ${rel.target}) targets an entity that is not emitted as a Prisma model. ` +
|
|
392
|
+
`${rel.target} may be 'external entity', have a non-persistent store (memory/localStorage), or have no store declaration. ` +
|
|
393
|
+
`The relation field has been skipped to avoid a dangling reference; declare ${rel.target} as a durable entity, or remove the relationship.`,
|
|
394
|
+
});
|
|
395
|
+
lines.push(` // ${rel.kind} ${rel.name}: ${rel.target} — see PRISMA_RELATION_TARGET_NOT_EMITTED`);
|
|
396
|
+
return { lines, diagnostics };
|
|
397
|
+
}
|
|
398
|
+
// (1) `through` → join-entity-mediated many-to-many.
|
|
399
|
+
if (rel.through) {
|
|
400
|
+
diagnostics.push({
|
|
401
|
+
severity: 'info',
|
|
402
|
+
code: 'PRISMA_RELATION_VIA_THROUGH_UNIMPLEMENTED',
|
|
403
|
+
entity: entity.name,
|
|
404
|
+
message: `Relationship '${entity.name}.${rel.name}' uses 'through ${rel.through}' (many-to-many via join entity). ` +
|
|
405
|
+
`The projection does not emit this as a Prisma field — declare the join entity ('${rel.through}') ` +
|
|
406
|
+
`as its own entity with two belongsTo relations to wire the Prisma schema.`,
|
|
407
|
+
});
|
|
408
|
+
lines.push(` // ${rel.kind} ${rel.name}: ${rel.target} through ${rel.through} — see PRISMA_RELATION_VIA_THROUGH_UNIMPLEMENTED`);
|
|
409
|
+
return { lines, diagnostics };
|
|
410
|
+
}
|
|
411
|
+
// (2) Ambiguity check.
|
|
412
|
+
const sameTargetCount = entity.relationships.filter((r) => r.target === rel.target).length;
|
|
413
|
+
const opposites = findOppositeRelations(entity.name, rel, ir);
|
|
414
|
+
if (sameTargetCount > 1 || opposites.length > 1) {
|
|
415
|
+
diagnostics.push({
|
|
416
|
+
severity: 'info',
|
|
417
|
+
code: 'PRISMA_RELATION_AMBIGUOUS',
|
|
418
|
+
entity: entity.name,
|
|
419
|
+
message: `Relationship '${entity.name}.${rel.name}' → ${rel.target} is one of multiple relations between these entities. ` +
|
|
420
|
+
`Prisma requires named relations (e.g. \`@relation("authoredBooks")\`) to disambiguate; the projection does not ` +
|
|
421
|
+
`emit names automatically. Add the @relation name by hand, or refactor to a single relation.`,
|
|
422
|
+
});
|
|
423
|
+
lines.push(` // ${rel.kind} ${rel.name}: ${rel.target} — see PRISMA_RELATION_AMBIGUOUS`);
|
|
424
|
+
return { lines, diagnostics };
|
|
425
|
+
}
|
|
426
|
+
switch (rel.kind) {
|
|
427
|
+
case 'hasMany': {
|
|
428
|
+
lines.push(` ${rel.name} ${rel.target}[]`);
|
|
429
|
+
if (opposites.length === 0) {
|
|
430
|
+
diagnostics.push({
|
|
431
|
+
severity: 'warning',
|
|
432
|
+
code: 'PRISMA_RELATION_MISSING_BACKSIDE',
|
|
433
|
+
entity: entity.name,
|
|
434
|
+
message: `Relationship '${entity.name}.${rel.name}: ${rel.target}[]' has no back-relation declared on ${rel.target}. ` +
|
|
435
|
+
`Prisma rejects one-sided relations — add a 'belongsTo' (or 'ref') from ${rel.target} back to ${entity.name}.`,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
return { lines, diagnostics };
|
|
439
|
+
}
|
|
440
|
+
case 'hasOne': {
|
|
441
|
+
lines.push(` ${rel.name} ${rel.target}?`);
|
|
442
|
+
if (opposites.length === 0) {
|
|
443
|
+
diagnostics.push({
|
|
444
|
+
severity: 'warning',
|
|
445
|
+
code: 'PRISMA_RELATION_MISSING_BACKSIDE',
|
|
446
|
+
entity: entity.name,
|
|
447
|
+
message: `Relationship '${entity.name}.${rel.name}: ${rel.target}?' has no back-relation declared on ${rel.target}. ` +
|
|
448
|
+
`Prisma rejects one-sided relations — add a 'belongsTo' (or 'ref') from ${rel.target} back to ${entity.name}, ` +
|
|
449
|
+
`and the FK will be marked @unique automatically.`,
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
return { lines, diagnostics };
|
|
453
|
+
}
|
|
454
|
+
case 'belongsTo':
|
|
455
|
+
case 'ref': {
|
|
456
|
+
// Config override can be a string (FK column name) or an object
|
|
457
|
+
// (ForeignKeyConfig with fields, references, and optional referential actions).
|
|
458
|
+
const configFkOverride = options.foreignKeys?.[entity.name]?.[rel.name];
|
|
459
|
+
let fkFields;
|
|
460
|
+
let configRefs;
|
|
461
|
+
let configOnDelete;
|
|
462
|
+
let configOnUpdate;
|
|
463
|
+
if (configFkOverride !== undefined) {
|
|
464
|
+
if (typeof configFkOverride === 'string') {
|
|
465
|
+
// Legacy/simple form: just the FK column name.
|
|
466
|
+
fkFields = [configFkOverride];
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
// Object form: ForeignKeyConfig with fields, references, actions.
|
|
470
|
+
const fkObj = configFkOverride;
|
|
471
|
+
fkFields = fkObj.fields;
|
|
472
|
+
configRefs = fkObj.references;
|
|
473
|
+
configOnDelete = fkObj.onDelete;
|
|
474
|
+
configOnUpdate = fkObj.onUpdate;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
fkFields = rel.foreignKey?.fields ?? [`${rel.name}Id`];
|
|
479
|
+
}
|
|
480
|
+
const refsFields = configRefs ?? rel.foreignKey?.references ?? ['id'];
|
|
481
|
+
const isComposite = fkFields.length > 1;
|
|
482
|
+
// 1:1 if target has a `hasOne` pointing back at us.
|
|
483
|
+
const isOneToOne = opposites.some((o) => o.kind === 'hasOne');
|
|
484
|
+
// Emit FK column(s). Each local FK field gets a column line unless
|
|
485
|
+
// the entity already declares a property with that name.
|
|
486
|
+
for (let i = 0; i < fkFields.length; i++) {
|
|
487
|
+
const fkField = fkFields[i];
|
|
488
|
+
const refField = refsFields[i] ?? 'id';
|
|
489
|
+
const fkAlreadyDeclared = entity.properties.some((p) => p.name === fkField);
|
|
490
|
+
if (!fkAlreadyDeclared) {
|
|
491
|
+
const fkType = targetPropPrismaType(rel.target, refField, ir, options);
|
|
492
|
+
// For single-column 1:1 → @unique on the column. For composite, @@unique at model level.
|
|
493
|
+
const uniqueAttr = (!isComposite && isOneToOne) ? ' @unique' : '';
|
|
494
|
+
// Explicit columnMappings override wins; otherwise the auto-casing
|
|
495
|
+
// convention maps the physical FK column name (identifier stays fkField).
|
|
496
|
+
let physMap = options.columnMappings?.[entity.name]?.[fkField];
|
|
497
|
+
if (!physMap && options.naming) {
|
|
498
|
+
const phys = resolveColumnName(fkField, options.naming);
|
|
499
|
+
if (phys !== fkField)
|
|
500
|
+
physMap = phys;
|
|
501
|
+
}
|
|
502
|
+
const colMapAttr = physMap ? ` @map("${physMap}")` : '';
|
|
503
|
+
lines.push(` ${fkField} ${fkType}${uniqueAttr}${colMapAttr}`);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// For composite 1:1, emit @@unique at model level.
|
|
507
|
+
if (isComposite && isOneToOne) {
|
|
508
|
+
lines.push(` @@unique([${fkFields.join(', ')}])`);
|
|
509
|
+
}
|
|
510
|
+
// Relation field line with correct fields/references and optional referential actions.
|
|
511
|
+
// Config-level onDelete/onUpdate (from ForeignKeyConfig) take precedence over IR-level.
|
|
512
|
+
const fieldsAttr = `fields: [${fkFields.join(', ')}]`;
|
|
513
|
+
const refsAttr = `references: [${refsFields.join(', ')}]`;
|
|
514
|
+
const effectiveOnDelete = configOnDelete ?? (rel.onDelete ? toPrismaAction(rel.onDelete) : undefined);
|
|
515
|
+
const effectiveOnUpdate = configOnUpdate ?? (rel.onUpdate ? toPrismaAction(rel.onUpdate) : undefined);
|
|
516
|
+
const onDeleteAttr = effectiveOnDelete ? `, onDelete: ${effectiveOnDelete}` : '';
|
|
517
|
+
const onUpdateAttr = effectiveOnUpdate ? `, onUpdate: ${effectiveOnUpdate}` : '';
|
|
518
|
+
lines.push(` ${rel.name} ${rel.target} @relation(${fieldsAttr}, ${refsAttr}${onDeleteAttr}${onUpdateAttr})`);
|
|
519
|
+
if (opposites.length === 0) {
|
|
520
|
+
diagnostics.push({
|
|
521
|
+
severity: 'warning',
|
|
522
|
+
code: 'PRISMA_RELATION_MISSING_BACKSIDE',
|
|
523
|
+
entity: entity.name,
|
|
524
|
+
message: `Relationship '${entity.name}.${rel.name}: ${rel.target}' (${rel.kind}) has no back-relation declared on ${rel.target}. ` +
|
|
525
|
+
`Prisma rejects one-sided relations — add 'hasMany' or 'hasOne' on ${rel.target} pointing back to ${entity.name}.`,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
return { lines, diagnostics };
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function emitModel(entity, ir, options, context) {
|
|
533
|
+
const diagnostics = [];
|
|
534
|
+
const lines = [];
|
|
535
|
+
lines.push(`model ${entity.name} {`);
|
|
536
|
+
let effectiveOptions = options;
|
|
537
|
+
if (entity.timestamps) {
|
|
538
|
+
const merged = { ...options, fieldAttributes: { ...options.fieldAttributes } };
|
|
539
|
+
merged.fieldAttributes[entity.name] = { ...merged.fieldAttributes[entity.name] };
|
|
540
|
+
const fa = merged.fieldAttributes[entity.name];
|
|
541
|
+
if (!fa['createdAt'])
|
|
542
|
+
fa['createdAt'] = ['@default(now())'];
|
|
543
|
+
if (!fa['updatedAt'])
|
|
544
|
+
fa['updatedAt'] = ['@updatedAt'];
|
|
545
|
+
effectiveOptions = merged;
|
|
546
|
+
}
|
|
547
|
+
let sawIdProperty = false;
|
|
548
|
+
// STRUCTURAL invariant: iterate `properties` only. `computedProperties`
|
|
549
|
+
// is a separate list and MUST never become columns.
|
|
550
|
+
for (const prop of entity.properties) {
|
|
551
|
+
if (prop.name === 'id')
|
|
552
|
+
sawIdProperty = true;
|
|
553
|
+
const { line, diagnostics: propDiags } = emitPropertyLine(entity, prop, ir, effectiveOptions);
|
|
554
|
+
diagnostics.push(...propDiags);
|
|
555
|
+
if (line !== null)
|
|
556
|
+
lines.push(line);
|
|
557
|
+
}
|
|
558
|
+
// Composite PK suppresses the PRISMA_NO_ID_PROPERTY check since
|
|
559
|
+
// the entity's identity is established via @@id([...]) below.
|
|
560
|
+
const hasCompositeKey = entity.key && entity.key.length > 0;
|
|
561
|
+
if (!sawIdProperty && !hasCompositeKey) {
|
|
562
|
+
// No PK at all — Prisma will reject this model. Skip it rather than emitting
|
|
563
|
+
// an invalid model that makes prisma validate fail on an otherwise clean schema.
|
|
564
|
+
diagnostics.push({
|
|
565
|
+
severity: 'error',
|
|
566
|
+
code: 'PRISMA_NO_ID_PROPERTY',
|
|
567
|
+
entity: entity.name,
|
|
568
|
+
message: `Entity '${entity.name}' has no property named 'id' and no composite 'key' declaration. ` +
|
|
569
|
+
`Prisma requires every model to have at least one unique identity field. ` +
|
|
570
|
+
`Add 'property required id: string' to the entity or declare 'key [field1, field2, ...]'. ` +
|
|
571
|
+
`This model is skipped; all other models are still emitted.`,
|
|
572
|
+
});
|
|
573
|
+
return { lines: [], diagnostics };
|
|
574
|
+
}
|
|
575
|
+
if (ir.tenant) {
|
|
576
|
+
const tenantProp = ir.tenant.property;
|
|
577
|
+
const alreadyDeclared = entity.properties.some(p => p.name === tenantProp);
|
|
578
|
+
if (!alreadyDeclared) {
|
|
579
|
+
const tenantScalar = resolvePrismaScalar(ir.tenant.type.name, undefined, tenantProp) ?? 'String';
|
|
580
|
+
lines.push(` ${tenantProp} ${tenantScalar}`);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
// Relationships
|
|
584
|
+
if (entity.relationships.length > 0) {
|
|
585
|
+
lines.push('');
|
|
586
|
+
for (const rel of entity.relationships) {
|
|
587
|
+
const { lines: relLines, diagnostics: relDiags } = emitRelationship(entity, rel, ir, options, context);
|
|
588
|
+
lines.push(...relLines);
|
|
589
|
+
diagnostics.push(...relDiags);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
// @@map (table name override). Explicit tableMappings wins; otherwise the
|
|
593
|
+
// auto-casing convention maps the physical table name (model name stays
|
|
594
|
+
// entity.name, so relations/indexes are unaffected).
|
|
595
|
+
let tableMap = options.tableMappings?.[entity.name];
|
|
596
|
+
if (!tableMap && options.naming) {
|
|
597
|
+
const phys = resolveTableName(entity.name, options.naming);
|
|
598
|
+
if (phys !== entity.name)
|
|
599
|
+
tableMap = phys;
|
|
600
|
+
}
|
|
601
|
+
let hadModelAttr = false;
|
|
602
|
+
if (tableMap) {
|
|
603
|
+
lines.push('');
|
|
604
|
+
lines.push(` @@map("${tableMap}")`);
|
|
605
|
+
hadModelAttr = true;
|
|
606
|
+
}
|
|
607
|
+
// @@id for composite PK
|
|
608
|
+
if (hasCompositeKey) {
|
|
609
|
+
if (!hadModelAttr) {
|
|
610
|
+
lines.push('');
|
|
611
|
+
hadModelAttr = true;
|
|
612
|
+
}
|
|
613
|
+
lines.push(` @@id([${entity.key.join(', ')}])`);
|
|
614
|
+
}
|
|
615
|
+
// @@unique for alternate keys (non-PK unique constraints for FK references targets)
|
|
616
|
+
if (entity.alternateKeys && entity.alternateKeys.length > 0) {
|
|
617
|
+
if (!hadModelAttr) {
|
|
618
|
+
lines.push('');
|
|
619
|
+
hadModelAttr = true;
|
|
620
|
+
}
|
|
621
|
+
for (const ak of entity.alternateKeys) {
|
|
622
|
+
lines.push(` @@unique([${ak.join(', ')}])`);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
// @@index lines
|
|
626
|
+
const idx = options.indexes?.[entity.name];
|
|
627
|
+
if (idx && idx.length > 0) {
|
|
628
|
+
if (!hadModelAttr)
|
|
629
|
+
lines.push('');
|
|
630
|
+
for (const entry of idx)
|
|
631
|
+
lines.push(buildIndexLine(entry));
|
|
632
|
+
}
|
|
633
|
+
if (ir.tenant) {
|
|
634
|
+
const tenantProp = ir.tenant.property;
|
|
635
|
+
const alreadyIndexed = (idx ?? []).some(entry => Array.isArray(entry) ? entry.includes(tenantProp) : entry.fields.includes(tenantProp)) || (entity.key ?? []).includes(tenantProp);
|
|
636
|
+
if (!alreadyIndexed) {
|
|
637
|
+
if (!hadModelAttr) {
|
|
638
|
+
lines.push('');
|
|
639
|
+
hadModelAttr = true;
|
|
640
|
+
}
|
|
641
|
+
lines.push(` @@index([${tenantProp}])`);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
// @@fulltext for searchable properties
|
|
645
|
+
const searchableFields = entity.properties.filter(p => p.modifiers.includes('searchable')).map(p => p.name);
|
|
646
|
+
if (searchableFields.length > 0) {
|
|
647
|
+
if (!hadModelAttr) {
|
|
648
|
+
lines.push('');
|
|
649
|
+
hadModelAttr = true;
|
|
650
|
+
}
|
|
651
|
+
lines.push(` @@fulltext([${searchableFields.join(', ')}])`);
|
|
652
|
+
}
|
|
653
|
+
// @@schema — preserve the model's module layout when multiSchema is enabled.
|
|
654
|
+
const schemaName = resolveSchemaName(entity, options);
|
|
655
|
+
if (schemaName) {
|
|
656
|
+
if (!hadModelAttr) {
|
|
657
|
+
lines.push('');
|
|
658
|
+
hadModelAttr = true;
|
|
659
|
+
}
|
|
660
|
+
lines.push(` @@schema("${schemaName}")`);
|
|
661
|
+
}
|
|
662
|
+
lines.push('}');
|
|
663
|
+
if (ir.tenant) {
|
|
664
|
+
const tableName = tableMap ?? entity.name;
|
|
665
|
+
const tenantCol = ir.tenant.property;
|
|
666
|
+
lines.push('');
|
|
667
|
+
lines.push(`// -- RLS policy (apply manually or via migration):`);
|
|
668
|
+
lines.push(`// ALTER TABLE "${tableName}" ENABLE ROW LEVEL SECURITY;`);
|
|
669
|
+
lines.push(`// CREATE POLICY tenant_isolation ON "${tableName}"`);
|
|
670
|
+
lines.push(`// USING ("${tenantCol}" = current_setting('app.tenant_id'));`);
|
|
671
|
+
}
|
|
672
|
+
return { lines, diagnostics };
|
|
673
|
+
}
|
|
674
|
+
// ============================================================================
|
|
675
|
+
// Schema-level emission (datasource + generator + models)
|
|
676
|
+
// ============================================================================
|
|
677
|
+
function emitDatasourceBlock(provider, schemas = []) {
|
|
678
|
+
if (!provider)
|
|
679
|
+
return [];
|
|
680
|
+
// Prisma 7+: datasource block carries only the provider — no `url` property.
|
|
681
|
+
// The connection URL MUST be supplied by the consumer via prisma.config.ts.
|
|
682
|
+
// A prisma.config.ts companion artifact is emitted alongside this schema.
|
|
683
|
+
//
|
|
684
|
+
// Multi-schema: when models declare `@@schema(...)`, the datasource must list
|
|
685
|
+
// every referenced schema via `schemas = [...]`. multiSchema is GA in current
|
|
686
|
+
// Prisma (no previewFeatures flag required).
|
|
687
|
+
const datasource = ['datasource db {', ` provider = "${provider}"`];
|
|
688
|
+
if (schemas.length > 0) {
|
|
689
|
+
datasource.push(` schemas = [${schemas.map(s => `"${s}"`).join(', ')}]`);
|
|
690
|
+
}
|
|
691
|
+
datasource.push('}');
|
|
692
|
+
return [
|
|
693
|
+
...datasource,
|
|
694
|
+
'',
|
|
695
|
+
'generator client {',
|
|
696
|
+
' provider = "prisma-client-js"',
|
|
697
|
+
'}',
|
|
698
|
+
'',
|
|
699
|
+
];
|
|
700
|
+
}
|
|
701
|
+
function emitPrismaConfigTs(envVar = 'DATABASE_URL') {
|
|
702
|
+
return [
|
|
703
|
+
'// Auto-generated by @manifest/projection-prisma',
|
|
704
|
+
'// Prisma 7+: connection URL lives here, not in schema.prisma.',
|
|
705
|
+
'// Set the DATABASE_URL environment variable (or replace with your env var name).',
|
|
706
|
+
"import { defineConfig } from 'prisma/config';",
|
|
707
|
+
'',
|
|
708
|
+
'export default defineConfig({',
|
|
709
|
+
' datasources: {',
|
|
710
|
+
' db: {',
|
|
711
|
+
` url: process.env.${envVar},`,
|
|
712
|
+
' },',
|
|
713
|
+
' },',
|
|
714
|
+
'});',
|
|
715
|
+
'',
|
|
716
|
+
].join('\n');
|
|
717
|
+
}
|
|
718
|
+
// ============================================================================
|
|
719
|
+
// Projection target
|
|
720
|
+
// ============================================================================
|
|
721
|
+
export class PrismaProjection {
|
|
722
|
+
name = 'prisma';
|
|
723
|
+
description = 'Manifest IR → Prisma schema projection. Compile-time only. App-agnostic.';
|
|
724
|
+
surfaces = SURFACES;
|
|
725
|
+
generate(ir, request) {
|
|
726
|
+
if (request.surface !== SURFACE_SCHEMA) {
|
|
727
|
+
return {
|
|
728
|
+
artifacts: [],
|
|
729
|
+
diagnostics: [
|
|
730
|
+
{
|
|
731
|
+
severity: 'error',
|
|
732
|
+
code: 'UNKNOWN_SURFACE',
|
|
733
|
+
message: `Unknown surface '${request.surface}'. Available: ${SURFACES.join(', ')}.`,
|
|
734
|
+
},
|
|
735
|
+
],
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
let options = normalizeOptions(request.options);
|
|
739
|
+
const diagnostics = [];
|
|
740
|
+
// Multi-schema provider guard. Multiple schemas are a PostgreSQL /
|
|
741
|
+
// CockroachDB / SQL Server capability; on any other provider we cannot
|
|
742
|
+
// emit a valid multi-schema layout, so fall back to flat and explain why.
|
|
743
|
+
if (options.multiSchema?.enabled &&
|
|
744
|
+
options.provider &&
|
|
745
|
+
!MULTISCHEMA_PROVIDERS.has(options.provider)) {
|
|
746
|
+
diagnostics.push({
|
|
747
|
+
severity: 'error',
|
|
748
|
+
code: 'PRISMA_MULTISCHEMA_UNSUPPORTED_PROVIDER',
|
|
749
|
+
message: `multiSchema is enabled but provider '${options.provider}' does not support multiple database schemas. ` +
|
|
750
|
+
`Prisma multi-schema requires 'postgresql', 'cockroachdb', or 'sqlserver'. ` +
|
|
751
|
+
`Models are emitted WITHOUT @@schema (flat layout). Remove multiSchema or switch provider.`,
|
|
752
|
+
});
|
|
753
|
+
options = { ...options, multiSchema: { ...options.multiSchema, enabled: false } };
|
|
754
|
+
}
|
|
755
|
+
const storeByEntity = new Map();
|
|
756
|
+
for (const s of ir.stores)
|
|
757
|
+
storeByEntity.set(s.entity, s.target);
|
|
758
|
+
const toEmit = [];
|
|
759
|
+
const emittedEntities = new Set();
|
|
760
|
+
for (const entity of ir.entities) {
|
|
761
|
+
if (entity.external === true) {
|
|
762
|
+
diagnostics.push({
|
|
763
|
+
severity: 'info',
|
|
764
|
+
code: 'PRISMA_SKIPPED_EXTERNAL',
|
|
765
|
+
entity: entity.name,
|
|
766
|
+
message: `Entity '${entity.name}' is marked external; skipped (no Prisma model emitted).`,
|
|
767
|
+
});
|
|
768
|
+
continue;
|
|
769
|
+
}
|
|
770
|
+
const target = storeByEntity.get(entity.name);
|
|
771
|
+
if (target === undefined) {
|
|
772
|
+
diagnostics.push({
|
|
773
|
+
severity: 'info',
|
|
774
|
+
code: 'PRISMA_SKIPPED_NO_STORE',
|
|
775
|
+
entity: entity.name,
|
|
776
|
+
message: `Entity '${entity.name}' has no 'store' declaration; skipped. Add 'store ${entity.name} in durable' to emit a Prisma model.`,
|
|
777
|
+
});
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
if (!isPersistent(target)) {
|
|
781
|
+
diagnostics.push({
|
|
782
|
+
severity: 'info',
|
|
783
|
+
code: 'PRISMA_SKIPPED_NON_DURABLE',
|
|
784
|
+
entity: entity.name,
|
|
785
|
+
message: `Entity '${entity.name}' has store target '${target}'; skipped. Flip to 'durable' to emit a Prisma model.`,
|
|
786
|
+
});
|
|
787
|
+
continue;
|
|
788
|
+
}
|
|
789
|
+
toEmit.push(entity);
|
|
790
|
+
emittedEntities.add(entity.name);
|
|
791
|
+
}
|
|
792
|
+
// Enums referenced by an emitted (durable) entity's property. We only emit
|
|
793
|
+
// enum blocks that a Prisma model actually uses — an enum referenced solely
|
|
794
|
+
// by a skipped (memory/external) entity would be an orphan declaration.
|
|
795
|
+
const referencedEnumNames = new Set();
|
|
796
|
+
for (const entity of toEmit) {
|
|
797
|
+
for (const prop of entity.properties) {
|
|
798
|
+
const typeName = prop.type.name === 'array' && prop.type.generic
|
|
799
|
+
? prop.type.generic.name
|
|
800
|
+
: prop.type.name;
|
|
801
|
+
if ((ir.enums ?? []).some(e => e.name === typeName))
|
|
802
|
+
referencedEnumNames.add(typeName);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
const enumsToEmit = (ir.enums ?? []).filter(e => referencedEnumNames.has(e.name));
|
|
806
|
+
// Schemas referenced by the models/enums we are about to emit (empty when
|
|
807
|
+
// multiSchema is disabled). Drives both the datasource `schemas = [...]`
|
|
808
|
+
// list and the models-only advisory below.
|
|
809
|
+
const schemasList = buildSchemasList(toEmit, enumsToEmit, options);
|
|
810
|
+
// Models-only mode (no provider → no datasource block): @@schema is still
|
|
811
|
+
// emitted, but the consumer's existing datasource must declare the schemas.
|
|
812
|
+
if (options.multiSchema?.enabled && !options.provider && schemasList.length > 0) {
|
|
813
|
+
diagnostics.push({
|
|
814
|
+
severity: 'info',
|
|
815
|
+
code: 'PRISMA_MULTISCHEMA_MODELS_ONLY',
|
|
816
|
+
message: `multiSchema is enabled with no provider (models-only mode). @@schema(...) is emitted on each model, ` +
|
|
817
|
+
`but no datasource block is generated. Ensure your existing datasource declares ` +
|
|
818
|
+
`schemas = [${schemasList.map(s => `"${s}"`).join(', ')}].`,
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
const context = { emittedEntities };
|
|
822
|
+
const modelBlocks = [];
|
|
823
|
+
for (const entity of toEmit) {
|
|
824
|
+
const { lines, diagnostics: modelDiags } = emitModel(entity, ir, options, context);
|
|
825
|
+
diagnostics.push(...modelDiags);
|
|
826
|
+
modelBlocks.push(lines.join('\n'));
|
|
827
|
+
}
|
|
828
|
+
const enumBlocks = enumsToEmit.map(e => emitEnum(e, options));
|
|
829
|
+
const header = [
|
|
830
|
+
'// Auto-generated by @manifest/projection-prisma',
|
|
831
|
+
'// DO NOT EDIT — regenerate with the projection.',
|
|
832
|
+
'',
|
|
833
|
+
...emitDatasourceBlock(options.provider, schemasList),
|
|
834
|
+
];
|
|
835
|
+
const headerStr = header.join('\n');
|
|
836
|
+
const bodyBlocks = [...modelBlocks, ...enumBlocks];
|
|
837
|
+
const code = (bodyBlocks.length > 0)
|
|
838
|
+
? headerStr + '\n' + bodyBlocks.join('\n\n') + '\n'
|
|
839
|
+
: headerStr + '// No persistent entities found in IR.\n';
|
|
840
|
+
const artifacts = [
|
|
841
|
+
{
|
|
842
|
+
id: 'prisma.schema',
|
|
843
|
+
pathHint: options.output,
|
|
844
|
+
contentType: 'prisma',
|
|
845
|
+
code,
|
|
846
|
+
},
|
|
847
|
+
];
|
|
848
|
+
// When a provider is set, emit a prisma.config.ts companion so consumers have
|
|
849
|
+
// a complete, runnable output (Prisma 7 requires the URL here, not in schema).
|
|
850
|
+
if (options.provider) {
|
|
851
|
+
artifacts.push({
|
|
852
|
+
id: 'prisma.config.ts',
|
|
853
|
+
pathHint: 'prisma.config.ts',
|
|
854
|
+
contentType: 'typescript',
|
|
855
|
+
code: emitPrismaConfigTs(options.urlEnvVar ?? 'DATABASE_URL'),
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
return { artifacts, diagnostics };
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
//# sourceMappingURL=generator.js.map
|