@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,1043 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SvelteKit projection for Manifest IR.
|
|
3
|
+
*
|
|
4
|
+
* Generates SvelteKit server routes (+server.ts) and load functions
|
|
5
|
+
* (+page.server.ts) from IR commands and entity reads. Mirrors the
|
|
6
|
+
* Next.js App Router projection but targets SvelteKit conventions:
|
|
7
|
+
*
|
|
8
|
+
* - +server.ts → API route (GET/POST) emitting `RequestHandler`s
|
|
9
|
+
* - +page.server.ts → `PageServerLoad` for SSR data and form `actions`
|
|
10
|
+
* - $lib/* aliases → `src/lib` imports
|
|
11
|
+
* - type-safe `PageData` → via the generated `./$types` module
|
|
12
|
+
*
|
|
13
|
+
* Surfaces:
|
|
14
|
+
* - sveltekit.server → +server.ts for an entity (GET list/detail, POST dispatch)
|
|
15
|
+
* - sveltekit.load → +page.server.ts (`load` + `actions`) for an entity page
|
|
16
|
+
* - sveltekit.command → +server.ts dedicated to a single command POST
|
|
17
|
+
* - sveltekit.types → TypeScript types for entities, commands, results
|
|
18
|
+
* - sveltekit.client → $lib client utilities (response helpers, fetch wrappers)
|
|
19
|
+
*
|
|
20
|
+
* Writes always flow through the Manifest runtime so guards, policies,
|
|
21
|
+
* and constraints stay authoritative. Reads MAY bypass the runtime for
|
|
22
|
+
* performance (Prisma-style direct queries) when a database client is
|
|
23
|
+
* configured.
|
|
24
|
+
*
|
|
25
|
+
* Registers as the `sveltekit` projection in the canonical registry.
|
|
26
|
+
*/
|
|
27
|
+
// ============================================================================
|
|
28
|
+
// Surface constants
|
|
29
|
+
// ============================================================================
|
|
30
|
+
const SURFACE_SERVER = 'sveltekit.server';
|
|
31
|
+
const SURFACE_LOAD = 'sveltekit.load';
|
|
32
|
+
const SURFACE_COMMAND = 'sveltekit.command';
|
|
33
|
+
const SURFACE_TYPES = 'sveltekit.types';
|
|
34
|
+
const SURFACE_CLIENT = 'sveltekit.client';
|
|
35
|
+
const SURFACES = [
|
|
36
|
+
SURFACE_SERVER,
|
|
37
|
+
SURFACE_LOAD,
|
|
38
|
+
SURFACE_COMMAND,
|
|
39
|
+
SURFACE_TYPES,
|
|
40
|
+
SURFACE_CLIENT,
|
|
41
|
+
];
|
|
42
|
+
/**
|
|
43
|
+
* Default values for the SvelteKit projection.
|
|
44
|
+
*/
|
|
45
|
+
export const SVELTEKIT_DEFAULTS = {
|
|
46
|
+
authProvider: 'lucia',
|
|
47
|
+
authImportPath: '$lib/server/auth',
|
|
48
|
+
runtimeImportPath: '$lib/server/manifest-runtime',
|
|
49
|
+
runtimeFactoryName: 'createManifestRuntime',
|
|
50
|
+
databaseImportPath: '$lib/server/database',
|
|
51
|
+
routesDir: 'src/routes',
|
|
52
|
+
includeTenantFilter: true,
|
|
53
|
+
includeSoftDeleteFilter: true,
|
|
54
|
+
tenantIdProperty: 'tenantId',
|
|
55
|
+
deletedAtProperty: 'deletedAt',
|
|
56
|
+
strictMode: true,
|
|
57
|
+
includeComments: true,
|
|
58
|
+
unauthorizedStatus: 401,
|
|
59
|
+
emitFormActions: true,
|
|
60
|
+
emitTypeImports: true,
|
|
61
|
+
};
|
|
62
|
+
function normalizeOptions(opts = {}) {
|
|
63
|
+
return {
|
|
64
|
+
authProvider: opts.authProvider ?? SVELTEKIT_DEFAULTS.authProvider,
|
|
65
|
+
authImportPath: opts.authImportPath ?? SVELTEKIT_DEFAULTS.authImportPath,
|
|
66
|
+
runtimeImportPath: opts.runtimeImportPath ?? SVELTEKIT_DEFAULTS.runtimeImportPath,
|
|
67
|
+
runtimeFactoryName: opts.runtimeFactoryName ?? SVELTEKIT_DEFAULTS.runtimeFactoryName,
|
|
68
|
+
databaseImportPath: opts.databaseImportPath ?? SVELTEKIT_DEFAULTS.databaseImportPath,
|
|
69
|
+
validationImportPath: opts.validationImportPath,
|
|
70
|
+
routesDir: opts.routesDir ?? SVELTEKIT_DEFAULTS.routesDir,
|
|
71
|
+
includeTenantFilter: opts.includeTenantFilter ?? SVELTEKIT_DEFAULTS.includeTenantFilter,
|
|
72
|
+
includeSoftDeleteFilter: opts.includeSoftDeleteFilter ?? SVELTEKIT_DEFAULTS.includeSoftDeleteFilter,
|
|
73
|
+
tenantIdProperty: opts.tenantIdProperty ?? SVELTEKIT_DEFAULTS.tenantIdProperty,
|
|
74
|
+
deletedAtProperty: opts.deletedAtProperty ?? SVELTEKIT_DEFAULTS.deletedAtProperty,
|
|
75
|
+
strictMode: opts.strictMode ?? SVELTEKIT_DEFAULTS.strictMode,
|
|
76
|
+
includeComments: opts.includeComments ?? SVELTEKIT_DEFAULTS.includeComments,
|
|
77
|
+
unauthorizedStatus: opts.unauthorizedStatus ?? SVELTEKIT_DEFAULTS.unauthorizedStatus,
|
|
78
|
+
tenantProvider: opts.tenantProvider,
|
|
79
|
+
emitFormActions: opts.emitFormActions ?? SVELTEKIT_DEFAULTS.emitFormActions,
|
|
80
|
+
emitTypeImports: opts.emitTypeImports ?? SVELTEKIT_DEFAULTS.emitTypeImports,
|
|
81
|
+
generatedAt: opts.generatedAt ?? new Date().toISOString(),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// ============================================================================
|
|
85
|
+
// Naming helpers
|
|
86
|
+
// ============================================================================
|
|
87
|
+
function toPascalCase(value) {
|
|
88
|
+
if (!value)
|
|
89
|
+
return value;
|
|
90
|
+
return value[0].toUpperCase() + value.slice(1);
|
|
91
|
+
}
|
|
92
|
+
function toLowerCamelCase(value) {
|
|
93
|
+
if (!value)
|
|
94
|
+
return value;
|
|
95
|
+
return value[0].toLowerCase() + value.slice(1);
|
|
96
|
+
}
|
|
97
|
+
function toKebabCase(value) {
|
|
98
|
+
return value
|
|
99
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
100
|
+
.replace(/\s+/g, '-')
|
|
101
|
+
.toLowerCase();
|
|
102
|
+
}
|
|
103
|
+
function toRouteSegment(value) {
|
|
104
|
+
return toKebabCase(value);
|
|
105
|
+
}
|
|
106
|
+
// ============================================================================
|
|
107
|
+
// Type mapping: IR type → TypeScript
|
|
108
|
+
// ============================================================================
|
|
109
|
+
function irTypeToTs(irType) {
|
|
110
|
+
const baseMap = {
|
|
111
|
+
string: 'string',
|
|
112
|
+
number: 'number',
|
|
113
|
+
integer: 'number',
|
|
114
|
+
int: 'number',
|
|
115
|
+
boolean: 'boolean',
|
|
116
|
+
bool: 'boolean',
|
|
117
|
+
date: 'string',
|
|
118
|
+
datetime: 'string',
|
|
119
|
+
uuid: 'string',
|
|
120
|
+
email: 'string',
|
|
121
|
+
url: 'string',
|
|
122
|
+
uri: 'string',
|
|
123
|
+
any: 'unknown',
|
|
124
|
+
object: 'Record<string, unknown>',
|
|
125
|
+
decimal: 'string',
|
|
126
|
+
void: 'void',
|
|
127
|
+
};
|
|
128
|
+
let base;
|
|
129
|
+
if (irType.name === 'array' && irType.generic) {
|
|
130
|
+
base = `${irTypeToTs(irType.generic)}[]`;
|
|
131
|
+
}
|
|
132
|
+
else if (irType.name === 'map' && irType.generic) {
|
|
133
|
+
base = `Record<string, ${irTypeToTs(irType.generic)}>`;
|
|
134
|
+
}
|
|
135
|
+
else if (irType.name === 'record') {
|
|
136
|
+
base = 'Record<string, unknown>';
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
base = baseMap[irType.name] ?? 'unknown';
|
|
140
|
+
}
|
|
141
|
+
return irType.nullable ? `${base} | null` : base;
|
|
142
|
+
}
|
|
143
|
+
// ============================================================================
|
|
144
|
+
// Expression / value pretty-printer (for header comments only)
|
|
145
|
+
// ============================================================================
|
|
146
|
+
function irValueToJson(value) {
|
|
147
|
+
switch (value.kind) {
|
|
148
|
+
case 'string':
|
|
149
|
+
return value.value;
|
|
150
|
+
case 'number':
|
|
151
|
+
return value.value;
|
|
152
|
+
case 'boolean':
|
|
153
|
+
return value.value;
|
|
154
|
+
case 'null':
|
|
155
|
+
return null;
|
|
156
|
+
case 'array':
|
|
157
|
+
return value.elements.map(irValueToJson);
|
|
158
|
+
case 'object': {
|
|
159
|
+
const obj = {};
|
|
160
|
+
for (const [k, v] of Object.entries(value.properties)) {
|
|
161
|
+
obj[k] = irValueToJson(v);
|
|
162
|
+
}
|
|
163
|
+
return obj;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function expressionToString(expr) {
|
|
168
|
+
switch (expr.kind) {
|
|
169
|
+
case 'literal':
|
|
170
|
+
return JSON.stringify(irValueToJson(expr.value));
|
|
171
|
+
case 'identifier':
|
|
172
|
+
return expr.name;
|
|
173
|
+
case 'member':
|
|
174
|
+
return `${expressionToString(expr.object)}.${expr.property}`;
|
|
175
|
+
case 'binary':
|
|
176
|
+
return `${expressionToString(expr.left)} ${expr.operator} ${expressionToString(expr.right)}`;
|
|
177
|
+
case 'unary':
|
|
178
|
+
return `${expr.operator}${expressionToString(expr.operand)}`;
|
|
179
|
+
case 'call':
|
|
180
|
+
return `${expressionToString(expr.callee)}(${expr.args.map(expressionToString).join(', ')})`;
|
|
181
|
+
case 'conditional':
|
|
182
|
+
return `${expressionToString(expr.condition)} ? ${expressionToString(expr.consequent)} : ${expressionToString(expr.alternate)}`;
|
|
183
|
+
case 'array':
|
|
184
|
+
return `[${expr.elements.map(expressionToString).join(', ')}]`;
|
|
185
|
+
case 'object':
|
|
186
|
+
return `{${expr.properties
|
|
187
|
+
.map((p) => `${p.key}: ${expressionToString(p.value)}`)
|
|
188
|
+
.join(', ')}}`;
|
|
189
|
+
case 'lambda':
|
|
190
|
+
return `(${expr.params.join(', ')}) => ${expressionToString(expr.body)}`;
|
|
191
|
+
default:
|
|
192
|
+
return String(expr);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// ============================================================================
|
|
196
|
+
// Header
|
|
197
|
+
// ============================================================================
|
|
198
|
+
function emitHeader(options, target) {
|
|
199
|
+
if (!options.includeComments)
|
|
200
|
+
return '';
|
|
201
|
+
return [
|
|
202
|
+
'/**',
|
|
203
|
+
` * Auto-generated SvelteKit ${target}`,
|
|
204
|
+
' * Generated from Manifest IR — DO NOT EDIT',
|
|
205
|
+
` * Generated at: ${options.generatedAt}`,
|
|
206
|
+
' *',
|
|
207
|
+
' * Writes flow through the Manifest runtime to enforce',
|
|
208
|
+
' * guards, policies, and constraints. Reads MAY bypass the runtime',
|
|
209
|
+
' * when a database client is configured.',
|
|
210
|
+
' *',
|
|
211
|
+
' * Regenerate with: manifest generate <ir> -p sveltekit',
|
|
212
|
+
' */',
|
|
213
|
+
'',
|
|
214
|
+
].join('\n');
|
|
215
|
+
}
|
|
216
|
+
// ============================================================================
|
|
217
|
+
// Auth import / body generation
|
|
218
|
+
// ============================================================================
|
|
219
|
+
function generateAuthImports(options) {
|
|
220
|
+
switch (options.authProvider) {
|
|
221
|
+
case 'lucia':
|
|
222
|
+
return `import { lucia } from "${options.authImportPath}";`;
|
|
223
|
+
case 'auth-js':
|
|
224
|
+
return `import { getServerSession } from "${options.authImportPath}";`;
|
|
225
|
+
case 'custom':
|
|
226
|
+
return `import { requireUser } from "${options.authImportPath}";`;
|
|
227
|
+
case 'none':
|
|
228
|
+
default:
|
|
229
|
+
return '';
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Auth body for `+server.ts` style handlers (using `event.locals`/`event.request`).
|
|
234
|
+
* Produces lines that resolve a `userId` (and optionally `orgId`) plus an
|
|
235
|
+
* unauthorized short-circuit returning the configured status code.
|
|
236
|
+
*/
|
|
237
|
+
function generateServerAuthBody(options) {
|
|
238
|
+
const status = options.unauthorizedStatus;
|
|
239
|
+
switch (options.authProvider) {
|
|
240
|
+
case 'lucia':
|
|
241
|
+
return [
|
|
242
|
+
` const session = event.locals.session;`,
|
|
243
|
+
` if (!session?.user?.id) {`,
|
|
244
|
+
` return json({ error: "Unauthorized", diagnostics: [] }, { status: ${status} });`,
|
|
245
|
+
` }`,
|
|
246
|
+
` const userId = session.user.id;`,
|
|
247
|
+
].join('\n');
|
|
248
|
+
case 'auth-js':
|
|
249
|
+
return [
|
|
250
|
+
` const session = await getServerSession(event);`,
|
|
251
|
+
` if (!session?.user?.id) {`,
|
|
252
|
+
` return json({ error: "Unauthorized", diagnostics: [] }, { status: ${status} });`,
|
|
253
|
+
` }`,
|
|
254
|
+
` const userId = session.user.id;`,
|
|
255
|
+
].join('\n');
|
|
256
|
+
case 'custom':
|
|
257
|
+
return [
|
|
258
|
+
` const user = await requireUser(event);`,
|
|
259
|
+
` if (!user?.id) {`,
|
|
260
|
+
` return json({ error: "Unauthorized", diagnostics: [] }, { status: ${status} });`,
|
|
261
|
+
` }`,
|
|
262
|
+
` const userId = user.id;`,
|
|
263
|
+
].join('\n');
|
|
264
|
+
case 'none':
|
|
265
|
+
default:
|
|
266
|
+
return [
|
|
267
|
+
` // Auth disabled — all requests allowed`,
|
|
268
|
+
` const userId = "anonymous";`,
|
|
269
|
+
].join('\n');
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Auth body for `+page.server.ts` style loaders (`load` and form `actions`).
|
|
274
|
+
* Uses redirect/error helpers instead of inline JSON responses since the
|
|
275
|
+
* SvelteKit convention is to throw `redirect()` / `error()` from server load
|
|
276
|
+
* functions.
|
|
277
|
+
*/
|
|
278
|
+
function generateLoadAuthBody(options) {
|
|
279
|
+
const status = options.unauthorizedStatus;
|
|
280
|
+
switch (options.authProvider) {
|
|
281
|
+
case 'lucia':
|
|
282
|
+
return [
|
|
283
|
+
` const session = event.locals.session;`,
|
|
284
|
+
` if (!session?.user?.id) {`,
|
|
285
|
+
` throw redirect(${status === 401 ? '302' : status}, "/login");`,
|
|
286
|
+
` }`,
|
|
287
|
+
` const userId = session.user.id;`,
|
|
288
|
+
].join('\n');
|
|
289
|
+
case 'auth-js':
|
|
290
|
+
return [
|
|
291
|
+
` const session = await getServerSession(event);`,
|
|
292
|
+
` if (!session?.user?.id) {`,
|
|
293
|
+
` throw redirect(${status === 401 ? '302' : status}, "/login");`,
|
|
294
|
+
` }`,
|
|
295
|
+
` const userId = session.user.id;`,
|
|
296
|
+
].join('\n');
|
|
297
|
+
case 'custom':
|
|
298
|
+
return [
|
|
299
|
+
` const user = await requireUser(event);`,
|
|
300
|
+
` if (!user?.id) {`,
|
|
301
|
+
` throw redirect(${status === 401 ? '302' : status}, "/login");`,
|
|
302
|
+
` }`,
|
|
303
|
+
` const userId = user.id;`,
|
|
304
|
+
].join('\n');
|
|
305
|
+
case 'none':
|
|
306
|
+
default:
|
|
307
|
+
return [
|
|
308
|
+
` // Auth disabled — all requests allowed`,
|
|
309
|
+
` const userId = "anonymous";`,
|
|
310
|
+
].join('\n');
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
// ============================================================================
|
|
314
|
+
// Tenant resolution
|
|
315
|
+
// ============================================================================
|
|
316
|
+
function generateTenantLookup(options, jsonReturn) {
|
|
317
|
+
if (!options.includeTenantFilter)
|
|
318
|
+
return '';
|
|
319
|
+
if (options.tenantProvider) {
|
|
320
|
+
const { functionName, lookupKey } = options.tenantProvider;
|
|
321
|
+
return [
|
|
322
|
+
``,
|
|
323
|
+
` const ${options.tenantIdProperty} = await ${functionName}(${lookupKey});`,
|
|
324
|
+
` if (!${options.tenantIdProperty}) {`,
|
|
325
|
+
jsonReturn
|
|
326
|
+
? ` return json({ error: "Tenant not found", diagnostics: [] }, { status: 400 });`
|
|
327
|
+
: ` throw error(400, "Tenant not found");`,
|
|
328
|
+
` }`,
|
|
329
|
+
].join('\n');
|
|
330
|
+
}
|
|
331
|
+
return [
|
|
332
|
+
``,
|
|
333
|
+
` const userMapping = await database.userTenantMapping.findUnique({`,
|
|
334
|
+
` where: { userId },`,
|
|
335
|
+
` });`,
|
|
336
|
+
` if (!userMapping) {`,
|
|
337
|
+
jsonReturn
|
|
338
|
+
? ` return json({ error: "User not mapped to tenant", diagnostics: [] }, { status: 400 });`
|
|
339
|
+
: ` throw error(400, "User not mapped to tenant");`,
|
|
340
|
+
` }`,
|
|
341
|
+
` const { ${options.tenantIdProperty} } = userMapping;`,
|
|
342
|
+
].join('\n');
|
|
343
|
+
}
|
|
344
|
+
// ============================================================================
|
|
345
|
+
// Prisma-style direct read helpers
|
|
346
|
+
// ============================================================================
|
|
347
|
+
function entityHasProperty(entity, propertyName) {
|
|
348
|
+
return entity.properties.some((p) => p.name === propertyName);
|
|
349
|
+
}
|
|
350
|
+
function generateListReadQuery(entity, options) {
|
|
351
|
+
const delegate = toLowerCamelCase(entity.name);
|
|
352
|
+
const variable = `${delegate}s`;
|
|
353
|
+
const conditions = [];
|
|
354
|
+
if (options.includeTenantFilter) {
|
|
355
|
+
conditions.push(options.tenantIdProperty);
|
|
356
|
+
}
|
|
357
|
+
if (options.includeSoftDeleteFilter &&
|
|
358
|
+
entityHasProperty(entity, options.deletedAtProperty)) {
|
|
359
|
+
conditions.push(`${options.deletedAtProperty}: null`);
|
|
360
|
+
}
|
|
361
|
+
const whereClause = conditions.length
|
|
362
|
+
? `where: { ${conditions.join(', ')} },`
|
|
363
|
+
: '';
|
|
364
|
+
const orderByField = entityHasProperty(entity, 'createdAt') ? 'createdAt' : 'id';
|
|
365
|
+
return [
|
|
366
|
+
` const ${variable} = await database.${delegate}.findMany({`,
|
|
367
|
+
` ${whereClause}`,
|
|
368
|
+
` orderBy: { ${orderByField}: "desc" },`,
|
|
369
|
+
` });`,
|
|
370
|
+
].join('\n');
|
|
371
|
+
}
|
|
372
|
+
// ============================================================================
|
|
373
|
+
// Command comment block
|
|
374
|
+
// ============================================================================
|
|
375
|
+
function generateCommandComment(command, entity, policies) {
|
|
376
|
+
const lines = [];
|
|
377
|
+
lines.push(' /**');
|
|
378
|
+
lines.push(` * ${toPascalCase(command.name)} command for ${entity.name}.`);
|
|
379
|
+
if (command.guards.length > 0) {
|
|
380
|
+
lines.push(` * Guards: ${command.guards.length} (evaluated in order, halts on first failure)`);
|
|
381
|
+
for (let i = 0; i < command.guards.length; i++) {
|
|
382
|
+
lines.push(` * [${i}] ${expressionToString(command.guards[i])}`);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (command.constraints && command.constraints.length > 0) {
|
|
386
|
+
lines.push(` * Constraints: ${command.constraints.length}`);
|
|
387
|
+
}
|
|
388
|
+
const entityPolicies = policies.filter((p) => p.entity === entity.name);
|
|
389
|
+
if (entityPolicies.length > 0) {
|
|
390
|
+
lines.push(` * Policies: ${entityPolicies.map((p) => p.name).join(', ')}`);
|
|
391
|
+
}
|
|
392
|
+
if (command.emits.length > 0) {
|
|
393
|
+
lines.push(` * Emits: ${command.emits.join(', ')}`);
|
|
394
|
+
}
|
|
395
|
+
lines.push(' */');
|
|
396
|
+
return lines.join('\n');
|
|
397
|
+
}
|
|
398
|
+
function generateImports(options, flags) {
|
|
399
|
+
const lines = [];
|
|
400
|
+
// SvelteKit core helpers
|
|
401
|
+
const skitParts = [];
|
|
402
|
+
if (flags.includeJson)
|
|
403
|
+
skitParts.push('json');
|
|
404
|
+
if (flags.includeError)
|
|
405
|
+
skitParts.push('error');
|
|
406
|
+
if (flags.includeRedirect)
|
|
407
|
+
skitParts.push('redirect');
|
|
408
|
+
if (flags.includeFail)
|
|
409
|
+
skitParts.push('fail');
|
|
410
|
+
if (skitParts.length > 0) {
|
|
411
|
+
lines.push(`import { ${skitParts.join(', ')} } from "@sveltejs/kit";`);
|
|
412
|
+
}
|
|
413
|
+
// Type-only imports from generated ./$types module
|
|
414
|
+
if (options.emitTypeImports && flags.includeTypes !== 'none') {
|
|
415
|
+
if (flags.includeTypes === 'server') {
|
|
416
|
+
lines.push(`import type { RequestHandler } from "./$types";`);
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
lines.push(`import type { Actions, PageServerLoad } from "./$types";`);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
// Database (for direct reads)
|
|
423
|
+
if (flags.includeDatabase) {
|
|
424
|
+
lines.push(`import { database } from "${options.databaseImportPath}";`);
|
|
425
|
+
}
|
|
426
|
+
// Runtime factory (for writes / command dispatch)
|
|
427
|
+
if (flags.includeRuntime) {
|
|
428
|
+
lines.push(`import { ${options.runtimeFactoryName} } from "${options.runtimeImportPath}";`);
|
|
429
|
+
}
|
|
430
|
+
// Auth provider import
|
|
431
|
+
const authImport = generateAuthImports(options);
|
|
432
|
+
if (authImport)
|
|
433
|
+
lines.push(authImport);
|
|
434
|
+
if (lines.length > 0)
|
|
435
|
+
lines.push('');
|
|
436
|
+
return lines.join('\n');
|
|
437
|
+
}
|
|
438
|
+
// ============================================================================
|
|
439
|
+
// +server.ts generator (sveltekit.server)
|
|
440
|
+
// ============================================================================
|
|
441
|
+
function generateServerFile(entity, ir, options) {
|
|
442
|
+
const lines = [];
|
|
443
|
+
lines.push(emitHeader(options, `+server.ts route for ${entity.name}`));
|
|
444
|
+
lines.push(generateImports(options, {
|
|
445
|
+
includeJson: true,
|
|
446
|
+
includeError: false,
|
|
447
|
+
includeRedirect: false,
|
|
448
|
+
includeFail: false,
|
|
449
|
+
includeRuntime: true,
|
|
450
|
+
includeDatabase: true,
|
|
451
|
+
includeTypes: 'server',
|
|
452
|
+
}));
|
|
453
|
+
// GET → list
|
|
454
|
+
lines.push(`/**`);
|
|
455
|
+
lines.push(` * GET /${toRouteSegment(entity.name)} — list ${entity.name} entities`);
|
|
456
|
+
lines.push(` */`);
|
|
457
|
+
lines.push(`export const GET: RequestHandler = async (event) => {`);
|
|
458
|
+
lines.push(' try {');
|
|
459
|
+
lines.push(generateServerAuthBody(options));
|
|
460
|
+
const listTenant = generateTenantLookup(options, /* jsonReturn */ true);
|
|
461
|
+
if (listTenant)
|
|
462
|
+
lines.push(listTenant);
|
|
463
|
+
lines.push('');
|
|
464
|
+
lines.push(generateListReadQuery(entity, options));
|
|
465
|
+
lines.push('');
|
|
466
|
+
lines.push(` return json({ ${toLowerCamelCase(entity.name)}s });`);
|
|
467
|
+
lines.push(' } catch (err) {');
|
|
468
|
+
lines.push(` console.error("Error fetching ${toLowerCamelCase(entity.name)}s:", err);`);
|
|
469
|
+
lines.push(' return json(');
|
|
470
|
+
lines.push(' { error: "Internal server error", diagnostics: [] },');
|
|
471
|
+
lines.push(' { status: 500 }');
|
|
472
|
+
lines.push(' );');
|
|
473
|
+
lines.push(' }');
|
|
474
|
+
lines.push('};');
|
|
475
|
+
lines.push('');
|
|
476
|
+
// POST → dispatch a command on this entity
|
|
477
|
+
// Body shape: { command: string, params?: object, instanceId?: string }
|
|
478
|
+
const entityCommands = ir.commands
|
|
479
|
+
.filter((c) => c.entity === entity.name)
|
|
480
|
+
.map((c) => c.name);
|
|
481
|
+
lines.push(`/**`);
|
|
482
|
+
lines.push(` * POST /${toRouteSegment(entity.name)} — dispatch a Manifest command on ${entity.name}.`);
|
|
483
|
+
if (entityCommands.length > 0) {
|
|
484
|
+
lines.push(` * Available commands: ${entityCommands.join(', ')}`);
|
|
485
|
+
}
|
|
486
|
+
lines.push(' * Body: { command: string, params?: object, instanceId?: string }');
|
|
487
|
+
lines.push(` */`);
|
|
488
|
+
lines.push(`export const POST: RequestHandler = async (event) => {`);
|
|
489
|
+
lines.push(' try {');
|
|
490
|
+
lines.push(generateServerAuthBody(options));
|
|
491
|
+
const writeTenant = generateTenantLookup(options, /* jsonReturn */ true);
|
|
492
|
+
if (writeTenant)
|
|
493
|
+
lines.push(writeTenant);
|
|
494
|
+
lines.push('');
|
|
495
|
+
lines.push(' const body = await event.request.json();');
|
|
496
|
+
lines.push(' const { command, params, instanceId } = body ?? {};');
|
|
497
|
+
lines.push(' if (typeof command !== "string" || command.length === 0) {');
|
|
498
|
+
lines.push(' return json(');
|
|
499
|
+
lines.push(' { error: "Missing command name", diagnostics: [] },');
|
|
500
|
+
lines.push(' { status: 400 }');
|
|
501
|
+
lines.push(' );');
|
|
502
|
+
lines.push(' }');
|
|
503
|
+
lines.push('');
|
|
504
|
+
const userCtx = options.includeTenantFilter
|
|
505
|
+
? `{ user: { id: userId, ${options.tenantIdProperty} } }`
|
|
506
|
+
: `{ user: { id: userId } }`;
|
|
507
|
+
lines.push(` const runtime = await ${options.runtimeFactoryName}(${userCtx});`);
|
|
508
|
+
lines.push(` const result = await runtime.runCommand("${entity.name}", command, {`);
|
|
509
|
+
lines.push(' params: params ?? {},');
|
|
510
|
+
lines.push(' instanceId,');
|
|
511
|
+
lines.push(' });');
|
|
512
|
+
lines.push('');
|
|
513
|
+
lines.push(' if (!result.success) {');
|
|
514
|
+
lines.push(' const firstDiagnostic = result.diagnostics?.[0];');
|
|
515
|
+
lines.push(' const status = firstDiagnostic?.kind === "policy_denial" ? 403');
|
|
516
|
+
lines.push(' : firstDiagnostic?.kind === "guard_failure" ? 422');
|
|
517
|
+
lines.push(' : firstDiagnostic?.kind === "constraint_block" ? 422');
|
|
518
|
+
lines.push(' : firstDiagnostic?.kind === "concurrency_conflict" ? 409');
|
|
519
|
+
lines.push(' : 400;');
|
|
520
|
+
lines.push(' return json(');
|
|
521
|
+
lines.push(' { error: result.error, diagnostics: result.diagnostics },');
|
|
522
|
+
lines.push(' { status }');
|
|
523
|
+
lines.push(' );');
|
|
524
|
+
lines.push(' }');
|
|
525
|
+
lines.push('');
|
|
526
|
+
lines.push(' return json({');
|
|
527
|
+
lines.push(' data: result.data,');
|
|
528
|
+
lines.push(' events: result.events,');
|
|
529
|
+
lines.push(' diagnostics: result.diagnostics,');
|
|
530
|
+
lines.push(' });');
|
|
531
|
+
lines.push(' } catch (err) {');
|
|
532
|
+
lines.push(` console.error("Error dispatching command on ${entity.name}:", err);`);
|
|
533
|
+
lines.push(' return json(');
|
|
534
|
+
lines.push(' { error: "Internal server error", diagnostics: [] },');
|
|
535
|
+
lines.push(' { status: 500 }');
|
|
536
|
+
lines.push(' );');
|
|
537
|
+
lines.push(' }');
|
|
538
|
+
lines.push('};');
|
|
539
|
+
lines.push('');
|
|
540
|
+
return lines.join('\n');
|
|
541
|
+
}
|
|
542
|
+
// ============================================================================
|
|
543
|
+
// +page.server.ts generator (sveltekit.load)
|
|
544
|
+
// ============================================================================
|
|
545
|
+
function generateLoadFile(entity, ir, options) {
|
|
546
|
+
const lines = [];
|
|
547
|
+
lines.push(emitHeader(options, `+page.server.ts loader for ${entity.name}`));
|
|
548
|
+
lines.push(generateImports(options, {
|
|
549
|
+
includeJson: false,
|
|
550
|
+
includeError: true,
|
|
551
|
+
includeRedirect: true,
|
|
552
|
+
includeFail: options.emitFormActions,
|
|
553
|
+
includeRuntime: options.emitFormActions,
|
|
554
|
+
includeDatabase: true,
|
|
555
|
+
includeTypes: 'load',
|
|
556
|
+
}));
|
|
557
|
+
// load function
|
|
558
|
+
const variable = `${toLowerCamelCase(entity.name)}s`;
|
|
559
|
+
lines.push(`/**`);
|
|
560
|
+
lines.push(` * SvelteKit PageServerLoad for the ${entity.name} list page. Returns`);
|
|
561
|
+
lines.push(' * type-safe `PageData` consumed by the corresponding +page.svelte.');
|
|
562
|
+
lines.push(` */`);
|
|
563
|
+
lines.push(`export const load: PageServerLoad = async (event) => {`);
|
|
564
|
+
lines.push(generateLoadAuthBody(options));
|
|
565
|
+
const loadTenant = generateTenantLookup(options, /* jsonReturn */ false);
|
|
566
|
+
if (loadTenant)
|
|
567
|
+
lines.push(loadTenant);
|
|
568
|
+
lines.push('');
|
|
569
|
+
lines.push(generateListReadQuery(entity, options));
|
|
570
|
+
lines.push('');
|
|
571
|
+
lines.push(` return { ${variable} };`);
|
|
572
|
+
lines.push(`};`);
|
|
573
|
+
lines.push('');
|
|
574
|
+
if (options.emitFormActions) {
|
|
575
|
+
const entityCommands = ir.commands
|
|
576
|
+
.filter((c) => c.entity === entity.name)
|
|
577
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
578
|
+
lines.push(`/**`);
|
|
579
|
+
lines.push(' * SvelteKit form actions — POST-only handlers backing progressive');
|
|
580
|
+
lines.push(' * enhancement <form action="?/commandName" method="POST"> submissions.');
|
|
581
|
+
lines.push(' * Each action validates input via the Manifest runtime so guards, policies,');
|
|
582
|
+
lines.push(' * and constraints remain authoritative.');
|
|
583
|
+
lines.push(` */`);
|
|
584
|
+
lines.push('export const actions: Actions = {');
|
|
585
|
+
if (entityCommands.length === 0) {
|
|
586
|
+
lines.push(' // No commands declared for this entity.');
|
|
587
|
+
}
|
|
588
|
+
for (const command of entityCommands) {
|
|
589
|
+
lines.push(generateCommandComment(command, entity, ir.policies));
|
|
590
|
+
lines.push(` ${command.name}: async (event) => {`);
|
|
591
|
+
lines.push(' try {');
|
|
592
|
+
lines.push(generateServerAuthBody(options));
|
|
593
|
+
const actionTenant = generateTenantLookup(options, /* jsonReturn */ true);
|
|
594
|
+
if (actionTenant)
|
|
595
|
+
lines.push(actionTenant);
|
|
596
|
+
lines.push('');
|
|
597
|
+
lines.push(' const formData = await event.request.formData();');
|
|
598
|
+
lines.push(' const params = Object.fromEntries(formData);');
|
|
599
|
+
lines.push(' const instanceId =');
|
|
600
|
+
lines.push(' (typeof params.instanceId === "string" ? params.instanceId : undefined) ??');
|
|
601
|
+
lines.push(' (typeof params.id === "string" ? params.id : undefined);');
|
|
602
|
+
lines.push('');
|
|
603
|
+
const userCtx = options.includeTenantFilter
|
|
604
|
+
? `{ user: { id: userId, ${options.tenantIdProperty} } }`
|
|
605
|
+
: `{ user: { id: userId } }`;
|
|
606
|
+
lines.push(` const runtime = await ${options.runtimeFactoryName}(${userCtx});`);
|
|
607
|
+
lines.push(` const result = await runtime.runCommand("${entity.name}", "${command.name}", {`);
|
|
608
|
+
lines.push(' params,');
|
|
609
|
+
lines.push(' instanceId,');
|
|
610
|
+
lines.push(' });');
|
|
611
|
+
lines.push('');
|
|
612
|
+
lines.push(' if (!result.success) {');
|
|
613
|
+
lines.push(' const firstDiagnostic = result.diagnostics?.[0];');
|
|
614
|
+
lines.push(' const status = firstDiagnostic?.kind === "policy_denial" ? 403');
|
|
615
|
+
lines.push(' : firstDiagnostic?.kind === "guard_failure" ? 422');
|
|
616
|
+
lines.push(' : firstDiagnostic?.kind === "constraint_block" ? 422');
|
|
617
|
+
lines.push(' : firstDiagnostic?.kind === "concurrency_conflict" ? 409');
|
|
618
|
+
lines.push(' : 400;');
|
|
619
|
+
lines.push(' return fail(status, {');
|
|
620
|
+
lines.push(' error: result.error,');
|
|
621
|
+
lines.push(' diagnostics: result.diagnostics,');
|
|
622
|
+
lines.push(' });');
|
|
623
|
+
lines.push(' }');
|
|
624
|
+
lines.push('');
|
|
625
|
+
lines.push(' return {');
|
|
626
|
+
lines.push(' success: true,');
|
|
627
|
+
lines.push(' data: result.data,');
|
|
628
|
+
lines.push(' events: result.events,');
|
|
629
|
+
lines.push(' diagnostics: result.diagnostics,');
|
|
630
|
+
lines.push(' };');
|
|
631
|
+
lines.push(' } catch (err) {');
|
|
632
|
+
lines.push(` console.error("Error executing ${command.name}:", err);`);
|
|
633
|
+
lines.push(' return fail(500, {');
|
|
634
|
+
lines.push(' error: "Internal server error",');
|
|
635
|
+
lines.push(' diagnostics: [],');
|
|
636
|
+
lines.push(' });');
|
|
637
|
+
lines.push(' }');
|
|
638
|
+
lines.push(' },');
|
|
639
|
+
lines.push('');
|
|
640
|
+
}
|
|
641
|
+
lines.push('};');
|
|
642
|
+
lines.push('');
|
|
643
|
+
}
|
|
644
|
+
return lines.join('\n');
|
|
645
|
+
}
|
|
646
|
+
// ============================================================================
|
|
647
|
+
// +server.ts dedicated command route (sveltekit.command)
|
|
648
|
+
// ============================================================================
|
|
649
|
+
function generateCommandServerFile(entity, command, ir, options) {
|
|
650
|
+
const lines = [];
|
|
651
|
+
lines.push(emitHeader(options, `+server.ts route for ${entity.name}.${command.name}`));
|
|
652
|
+
lines.push(generateImports(options, {
|
|
653
|
+
includeJson: true,
|
|
654
|
+
includeError: false,
|
|
655
|
+
includeRedirect: false,
|
|
656
|
+
includeFail: false,
|
|
657
|
+
includeRuntime: true,
|
|
658
|
+
includeDatabase: false,
|
|
659
|
+
includeTypes: 'server',
|
|
660
|
+
}));
|
|
661
|
+
lines.push(generateCommandComment(command, entity, ir.policies).replace(/^ {2}/gm, ''));
|
|
662
|
+
lines.push(`export const POST: RequestHandler = async (event) => {`);
|
|
663
|
+
lines.push(' try {');
|
|
664
|
+
lines.push(generateServerAuthBody(options));
|
|
665
|
+
const cmdTenant = generateTenantLookup(options, /* jsonReturn */ true);
|
|
666
|
+
if (cmdTenant)
|
|
667
|
+
lines.push(cmdTenant);
|
|
668
|
+
lines.push('');
|
|
669
|
+
lines.push(' const body = await event.request.json().catch(() => ({}));');
|
|
670
|
+
lines.push(' const instanceId =');
|
|
671
|
+
lines.push(' (typeof body?.instanceId === "string" ? body.instanceId : undefined) ??');
|
|
672
|
+
lines.push(' (typeof body?.id === "string" ? body.id : undefined);');
|
|
673
|
+
lines.push('');
|
|
674
|
+
const userCtx = options.includeTenantFilter
|
|
675
|
+
? `{ user: { id: userId, ${options.tenantIdProperty} } }`
|
|
676
|
+
: `{ user: { id: userId } }`;
|
|
677
|
+
lines.push(` const runtime = await ${options.runtimeFactoryName}(${userCtx});`);
|
|
678
|
+
lines.push(` const result = await runtime.runCommand("${entity.name}", "${command.name}", {`);
|
|
679
|
+
lines.push(' params: body ?? {},');
|
|
680
|
+
lines.push(' instanceId,');
|
|
681
|
+
lines.push(' });');
|
|
682
|
+
lines.push('');
|
|
683
|
+
lines.push(' if (!result.success) {');
|
|
684
|
+
lines.push(' const firstDiagnostic = result.diagnostics?.[0];');
|
|
685
|
+
lines.push(' const status = firstDiagnostic?.kind === "policy_denial" ? 403');
|
|
686
|
+
lines.push(' : firstDiagnostic?.kind === "guard_failure" ? 422');
|
|
687
|
+
lines.push(' : firstDiagnostic?.kind === "constraint_block" ? 422');
|
|
688
|
+
lines.push(' : firstDiagnostic?.kind === "concurrency_conflict" ? 409');
|
|
689
|
+
lines.push(' : 400;');
|
|
690
|
+
lines.push(' return json(');
|
|
691
|
+
lines.push(' { error: result.error, diagnostics: result.diagnostics },');
|
|
692
|
+
lines.push(' { status }');
|
|
693
|
+
lines.push(' );');
|
|
694
|
+
lines.push(' }');
|
|
695
|
+
lines.push('');
|
|
696
|
+
lines.push(' return json({');
|
|
697
|
+
lines.push(' data: result.data,');
|
|
698
|
+
lines.push(' events: result.events,');
|
|
699
|
+
lines.push(' diagnostics: result.diagnostics,');
|
|
700
|
+
lines.push(' });');
|
|
701
|
+
lines.push(' } catch (err) {');
|
|
702
|
+
lines.push(` console.error("Error executing ${entity.name}.${command.name}:", err);`);
|
|
703
|
+
lines.push(' return json(');
|
|
704
|
+
lines.push(' { error: "Internal server error", diagnostics: [] },');
|
|
705
|
+
lines.push(' { status: 500 }');
|
|
706
|
+
lines.push(' );');
|
|
707
|
+
lines.push(' }');
|
|
708
|
+
lines.push('};');
|
|
709
|
+
lines.push('');
|
|
710
|
+
return lines.join('\n');
|
|
711
|
+
}
|
|
712
|
+
// ============================================================================
|
|
713
|
+
// sveltekit.types — entity / command / result types
|
|
714
|
+
// ============================================================================
|
|
715
|
+
function generateEntityInterface(entity) {
|
|
716
|
+
const lines = [];
|
|
717
|
+
lines.push(`export interface ${entity.name} {`);
|
|
718
|
+
for (const prop of entity.properties) {
|
|
719
|
+
const optional = prop.modifiers.includes('optional') ||
|
|
720
|
+
prop.defaultValue !== undefined ||
|
|
721
|
+
prop.type.nullable;
|
|
722
|
+
const sigil = optional ? '?' : '';
|
|
723
|
+
lines.push(` ${prop.name}${sigil}: ${irTypeToTs(prop.type)};`);
|
|
724
|
+
}
|
|
725
|
+
for (const computed of entity.computedProperties) {
|
|
726
|
+
lines.push(` readonly ${computed.name}: ${irTypeToTs(computed.type)};`);
|
|
727
|
+
}
|
|
728
|
+
lines.push('}');
|
|
729
|
+
return lines.join('\n');
|
|
730
|
+
}
|
|
731
|
+
function generateCommandParamsInterface(command) {
|
|
732
|
+
const lines = [];
|
|
733
|
+
const entity = command.entity ?? 'Unknown';
|
|
734
|
+
const name = `${toPascalCase(entity)}${toPascalCase(command.name)}Params`;
|
|
735
|
+
lines.push(`export interface ${name} {`);
|
|
736
|
+
for (const param of command.parameters) {
|
|
737
|
+
const sigil = param.required ? '' : '?';
|
|
738
|
+
lines.push(` ${param.name}${sigil}: ${irTypeToTs(param.type)};`);
|
|
739
|
+
}
|
|
740
|
+
lines.push('}');
|
|
741
|
+
return lines.join('\n');
|
|
742
|
+
}
|
|
743
|
+
function generateTypesFile(ir, options) {
|
|
744
|
+
const lines = [];
|
|
745
|
+
lines.push(emitHeader(options, 'TypeScript types for SvelteKit routes'));
|
|
746
|
+
lines.push('/** Diagnostic emitted by the Manifest runtime when a command fails. */');
|
|
747
|
+
lines.push('export interface ManifestDiagnostic {');
|
|
748
|
+
lines.push(' kind: string;');
|
|
749
|
+
lines.push(' message: string;');
|
|
750
|
+
lines.push(' [key: string]: unknown;');
|
|
751
|
+
lines.push('}');
|
|
752
|
+
lines.push('');
|
|
753
|
+
lines.push('/** Standardized success payload returned by +server.ts POST handlers. */');
|
|
754
|
+
lines.push('export interface ManifestActionResult<T = unknown> {');
|
|
755
|
+
lines.push(' success: boolean;');
|
|
756
|
+
lines.push(' data?: T;');
|
|
757
|
+
lines.push(' error?: string;');
|
|
758
|
+
lines.push(' events?: unknown[];');
|
|
759
|
+
lines.push(' diagnostics?: ManifestDiagnostic[];');
|
|
760
|
+
lines.push('}');
|
|
761
|
+
lines.push('');
|
|
762
|
+
const sortedEntities = [...ir.entities].sort((a, b) => a.name.localeCompare(b.name));
|
|
763
|
+
for (const entity of sortedEntities) {
|
|
764
|
+
lines.push(generateEntityInterface(entity));
|
|
765
|
+
lines.push('');
|
|
766
|
+
}
|
|
767
|
+
const sortedCommands = [...ir.commands]
|
|
768
|
+
.filter((c) => c.parameters.length > 0)
|
|
769
|
+
.sort((a, b) => {
|
|
770
|
+
const ak = `${a.entity ?? ''}.${a.name}`;
|
|
771
|
+
const bk = `${b.entity ?? ''}.${b.name}`;
|
|
772
|
+
return ak.localeCompare(bk);
|
|
773
|
+
});
|
|
774
|
+
for (const command of sortedCommands) {
|
|
775
|
+
lines.push(generateCommandParamsInterface(command));
|
|
776
|
+
lines.push('');
|
|
777
|
+
}
|
|
778
|
+
return lines.join('\n').trimEnd() + '\n';
|
|
779
|
+
}
|
|
780
|
+
// ============================================================================
|
|
781
|
+
// sveltekit.client — $lib client utilities
|
|
782
|
+
// ============================================================================
|
|
783
|
+
function generateClientFile(options) {
|
|
784
|
+
const lines = [];
|
|
785
|
+
lines.push(emitHeader(options, '$lib client utilities for SvelteKit'));
|
|
786
|
+
lines.push('import type { ManifestActionResult, ManifestDiagnostic } from "./manifest-types";');
|
|
787
|
+
lines.push('');
|
|
788
|
+
lines.push('/**');
|
|
789
|
+
lines.push(' * Invoke a Manifest command via the SvelteKit +server.ts dispatch route.');
|
|
790
|
+
lines.push(' * Use this from client components after `enhance` is not appropriate.');
|
|
791
|
+
lines.push(' */');
|
|
792
|
+
lines.push('export async function invokeManifestCommand<T = unknown>(');
|
|
793
|
+
lines.push(' entity: string,');
|
|
794
|
+
lines.push(' command: string,');
|
|
795
|
+
lines.push(' params: Record<string, unknown> = {},');
|
|
796
|
+
lines.push(' instanceId?: string,');
|
|
797
|
+
lines.push(' fetchImpl: typeof fetch = fetch,');
|
|
798
|
+
lines.push('): Promise<ManifestActionResult<T>> {');
|
|
799
|
+
lines.push(' const segment = entity');
|
|
800
|
+
lines.push(' .replace(/([a-z0-9])([A-Z])/g, "$1-$2")');
|
|
801
|
+
lines.push(' .toLowerCase();');
|
|
802
|
+
lines.push(' const response = await fetchImpl(`/${segment}`, {');
|
|
803
|
+
lines.push(' method: "POST",');
|
|
804
|
+
lines.push(' headers: { "Content-Type": "application/json" },');
|
|
805
|
+
lines.push(' body: JSON.stringify({ command, params, instanceId }),');
|
|
806
|
+
lines.push(' });');
|
|
807
|
+
lines.push(' const payload = (await response.json().catch(() => ({}))) as ManifestActionResult<T>;');
|
|
808
|
+
lines.push(' if (!response.ok && payload.success === undefined) {');
|
|
809
|
+
lines.push(' return {');
|
|
810
|
+
lines.push(' success: false,');
|
|
811
|
+
lines.push(' error: (payload as unknown as { error?: string }).error ?? response.statusText,');
|
|
812
|
+
lines.push(' diagnostics: (payload as unknown as { diagnostics?: ManifestDiagnostic[] }).diagnostics ?? [],');
|
|
813
|
+
lines.push(' };');
|
|
814
|
+
lines.push(' }');
|
|
815
|
+
lines.push(' return payload;');
|
|
816
|
+
lines.push('}');
|
|
817
|
+
lines.push('');
|
|
818
|
+
lines.push('/**');
|
|
819
|
+
lines.push(' * Normalize a runtime command result into the ManifestActionResult shape.');
|
|
820
|
+
lines.push(' */');
|
|
821
|
+
lines.push('export function normalizeCommandResult<T = unknown>(');
|
|
822
|
+
lines.push(' result: unknown,');
|
|
823
|
+
lines.push('): ManifestActionResult<T> {');
|
|
824
|
+
lines.push(' const r = result as Partial<ManifestActionResult<T>> & { error?: string };');
|
|
825
|
+
lines.push(' if (r && typeof r.success === "boolean") {');
|
|
826
|
+
lines.push(' return r as ManifestActionResult<T>;');
|
|
827
|
+
lines.push(' }');
|
|
828
|
+
lines.push(' return {');
|
|
829
|
+
lines.push(' success: !r?.error,');
|
|
830
|
+
lines.push(' data: r?.data as T | undefined,');
|
|
831
|
+
lines.push(' error: r?.error,');
|
|
832
|
+
lines.push(' events: r?.events ?? [],');
|
|
833
|
+
lines.push(' diagnostics: r?.diagnostics ?? [],');
|
|
834
|
+
lines.push(' };');
|
|
835
|
+
lines.push('}');
|
|
836
|
+
lines.push('');
|
|
837
|
+
return lines.join('\n');
|
|
838
|
+
}
|
|
839
|
+
// ============================================================================
|
|
840
|
+
// Surface dispatchers
|
|
841
|
+
// ============================================================================
|
|
842
|
+
function entityNotFoundDiagnostic(entityName, ir) {
|
|
843
|
+
return {
|
|
844
|
+
severity: 'error',
|
|
845
|
+
code: 'ENTITY_NOT_FOUND',
|
|
846
|
+
message: `Entity "${entityName}" not found in IR. Available entities: ${ir.entities
|
|
847
|
+
.map((e) => e.name)
|
|
848
|
+
.join(', ')}`,
|
|
849
|
+
entity: entityName,
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
function commandNotFoundDiagnostic(entityName, commandName, ir) {
|
|
853
|
+
const entityCommands = ir.commands
|
|
854
|
+
.filter((c) => c.entity === entityName)
|
|
855
|
+
.map((c) => c.name);
|
|
856
|
+
return {
|
|
857
|
+
severity: 'error',
|
|
858
|
+
code: 'COMMAND_NOT_FOUND',
|
|
859
|
+
message: `Command "${commandName}" not found on entity "${entityName}". Available commands: ${entityCommands.join(', ')}`,
|
|
860
|
+
entity: entityName,
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
// ============================================================================
|
|
864
|
+
// Projection class
|
|
865
|
+
// ============================================================================
|
|
866
|
+
/**
|
|
867
|
+
* SvelteKit projection.
|
|
868
|
+
*
|
|
869
|
+
* Emits `+server.ts` API routes, `+page.server.ts` loaders with form
|
|
870
|
+
* `actions`, and supporting type / client artifacts that integrate with
|
|
871
|
+
* the Manifest runtime. Mirrors the Next.js App Router projection's
|
|
872
|
+
* semantics while honouring SvelteKit-specific conventions.
|
|
873
|
+
*/
|
|
874
|
+
export class SvelteKitProjection {
|
|
875
|
+
name = 'sveltekit';
|
|
876
|
+
description = 'SvelteKit +server.ts routes and +page.server.ts loaders with form actions, $lib imports, and type-safe PageData';
|
|
877
|
+
surfaces = SURFACES;
|
|
878
|
+
generate(ir, request) {
|
|
879
|
+
const options = normalizeOptions((request.options ?? {}));
|
|
880
|
+
switch (request.surface) {
|
|
881
|
+
case SURFACE_SERVER: {
|
|
882
|
+
if (!request.entity) {
|
|
883
|
+
return {
|
|
884
|
+
artifacts: [],
|
|
885
|
+
diagnostics: [
|
|
886
|
+
{
|
|
887
|
+
severity: 'error',
|
|
888
|
+
code: 'MISSING_ENTITY',
|
|
889
|
+
message: `surface "${SURFACE_SERVER}" requires entity`,
|
|
890
|
+
},
|
|
891
|
+
],
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
const entity = ir.entities.find((e) => e.name === request.entity);
|
|
895
|
+
if (!entity) {
|
|
896
|
+
return {
|
|
897
|
+
artifacts: [],
|
|
898
|
+
diagnostics: [entityNotFoundDiagnostic(request.entity, ir)],
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
const code = generateServerFile(entity, ir, options);
|
|
902
|
+
return {
|
|
903
|
+
artifacts: [
|
|
904
|
+
{
|
|
905
|
+
id: `sveltekit.server:${request.entity}`,
|
|
906
|
+
pathHint: `${options.routesDir}/${toRouteSegment(request.entity)}/+server.ts`,
|
|
907
|
+
contentType: 'typescript',
|
|
908
|
+
code,
|
|
909
|
+
},
|
|
910
|
+
],
|
|
911
|
+
diagnostics: [],
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
case SURFACE_LOAD: {
|
|
915
|
+
if (!request.entity) {
|
|
916
|
+
return {
|
|
917
|
+
artifacts: [],
|
|
918
|
+
diagnostics: [
|
|
919
|
+
{
|
|
920
|
+
severity: 'error',
|
|
921
|
+
code: 'MISSING_ENTITY',
|
|
922
|
+
message: `surface "${SURFACE_LOAD}" requires entity`,
|
|
923
|
+
},
|
|
924
|
+
],
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
const entity = ir.entities.find((e) => e.name === request.entity);
|
|
928
|
+
if (!entity) {
|
|
929
|
+
return {
|
|
930
|
+
artifacts: [],
|
|
931
|
+
diagnostics: [entityNotFoundDiagnostic(request.entity, ir)],
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
const code = generateLoadFile(entity, ir, options);
|
|
935
|
+
return {
|
|
936
|
+
artifacts: [
|
|
937
|
+
{
|
|
938
|
+
id: `sveltekit.load:${request.entity}`,
|
|
939
|
+
pathHint: `${options.routesDir}/${toRouteSegment(request.entity)}/+page.server.ts`,
|
|
940
|
+
contentType: 'typescript',
|
|
941
|
+
code,
|
|
942
|
+
},
|
|
943
|
+
],
|
|
944
|
+
diagnostics: [],
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
case SURFACE_COMMAND: {
|
|
948
|
+
if (!request.entity) {
|
|
949
|
+
return {
|
|
950
|
+
artifacts: [],
|
|
951
|
+
diagnostics: [
|
|
952
|
+
{
|
|
953
|
+
severity: 'error',
|
|
954
|
+
code: 'MISSING_ENTITY',
|
|
955
|
+
message: `surface "${SURFACE_COMMAND}" requires entity`,
|
|
956
|
+
},
|
|
957
|
+
],
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
if (!request.command) {
|
|
961
|
+
return {
|
|
962
|
+
artifacts: [],
|
|
963
|
+
diagnostics: [
|
|
964
|
+
{
|
|
965
|
+
severity: 'error',
|
|
966
|
+
code: 'MISSING_COMMAND',
|
|
967
|
+
message: `surface "${SURFACE_COMMAND}" requires command`,
|
|
968
|
+
},
|
|
969
|
+
],
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
const entity = ir.entities.find((e) => e.name === request.entity);
|
|
973
|
+
if (!entity) {
|
|
974
|
+
return {
|
|
975
|
+
artifacts: [],
|
|
976
|
+
diagnostics: [entityNotFoundDiagnostic(request.entity, ir)],
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
const command = ir.commands.find((c) => c.entity === request.entity && c.name === request.command);
|
|
980
|
+
if (!command) {
|
|
981
|
+
return {
|
|
982
|
+
artifacts: [],
|
|
983
|
+
diagnostics: [
|
|
984
|
+
commandNotFoundDiagnostic(request.entity, request.command, ir),
|
|
985
|
+
],
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
const code = generateCommandServerFile(entity, command, ir, options);
|
|
989
|
+
return {
|
|
990
|
+
artifacts: [
|
|
991
|
+
{
|
|
992
|
+
id: `sveltekit.command:${request.entity}.${request.command}`,
|
|
993
|
+
pathHint: `${options.routesDir}/${toRouteSegment(request.entity)}/commands/${toRouteSegment(request.command)}/+server.ts`,
|
|
994
|
+
contentType: 'typescript',
|
|
995
|
+
code,
|
|
996
|
+
},
|
|
997
|
+
],
|
|
998
|
+
diagnostics: [],
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
case SURFACE_TYPES: {
|
|
1002
|
+
const code = generateTypesFile(ir, options);
|
|
1003
|
+
return {
|
|
1004
|
+
artifacts: [
|
|
1005
|
+
{
|
|
1006
|
+
id: 'sveltekit.types',
|
|
1007
|
+
pathHint: 'src/lib/manifest-types.ts',
|
|
1008
|
+
contentType: 'typescript',
|
|
1009
|
+
code,
|
|
1010
|
+
},
|
|
1011
|
+
],
|
|
1012
|
+
diagnostics: [],
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
case SURFACE_CLIENT: {
|
|
1016
|
+
const code = generateClientFile(options);
|
|
1017
|
+
return {
|
|
1018
|
+
artifacts: [
|
|
1019
|
+
{
|
|
1020
|
+
id: 'sveltekit.client',
|
|
1021
|
+
pathHint: 'src/lib/manifest-client.ts',
|
|
1022
|
+
contentType: 'typescript',
|
|
1023
|
+
code,
|
|
1024
|
+
},
|
|
1025
|
+
],
|
|
1026
|
+
diagnostics: [],
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
default:
|
|
1030
|
+
return {
|
|
1031
|
+
artifacts: [],
|
|
1032
|
+
diagnostics: [
|
|
1033
|
+
{
|
|
1034
|
+
severity: 'error',
|
|
1035
|
+
code: 'UNKNOWN_SURFACE',
|
|
1036
|
+
message: `Unknown surface: "${request.surface}". Available: ${SURFACES.join(', ')}`,
|
|
1037
|
+
},
|
|
1038
|
+
],
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
//# sourceMappingURL=generator.js.map
|