@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,981 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dart/Flutter projection for Manifest IR.
|
|
3
|
+
*
|
|
4
|
+
* Generates type-safe Dart model classes with `fromJson`/`toJson` methods
|
|
5
|
+
* and Riverpod or Provider state management hooks from IR entities and commands.
|
|
6
|
+
* Produces a Dart package consumable by Flutter apps.
|
|
7
|
+
*
|
|
8
|
+
* Surfaces:
|
|
9
|
+
* - dart.entity → Single entity model class
|
|
10
|
+
* - dart.command → Command params/return models
|
|
11
|
+
* - dart.models → All entity + command models in one file
|
|
12
|
+
* - dart.client → Dio-based async HTTP client SDK
|
|
13
|
+
* - dart.providers → Riverpod/Provider state management hooks
|
|
14
|
+
* - dart.package → Complete package (models + client + providers + pubspec)
|
|
15
|
+
*
|
|
16
|
+
* Reuses constraint analysis from `src/manifest/constraint-analysis.ts`
|
|
17
|
+
* for validator method generation.
|
|
18
|
+
*/
|
|
19
|
+
import { analyzeConstraints, numericRangeToZodChain, lengthConstraintToZodChain, patternConstraintToZodChain, } from '../../constraint-analysis.js';
|
|
20
|
+
// ============================================================================
|
|
21
|
+
// Type mapping
|
|
22
|
+
// ============================================================================
|
|
23
|
+
/** IR type name → Dart type. Generic types are handled separately. */
|
|
24
|
+
const TYPE_MAP = {
|
|
25
|
+
string: 'String',
|
|
26
|
+
text: 'String',
|
|
27
|
+
boolean: 'bool',
|
|
28
|
+
bool: 'bool',
|
|
29
|
+
number: 'double',
|
|
30
|
+
float: 'double',
|
|
31
|
+
decimal: 'String',
|
|
32
|
+
money: 'String',
|
|
33
|
+
int: 'int',
|
|
34
|
+
integer: 'int',
|
|
35
|
+
bigint: 'int',
|
|
36
|
+
date: 'DateTime',
|
|
37
|
+
datetime: 'DateTime',
|
|
38
|
+
timestamp: 'DateTime',
|
|
39
|
+
uuid: 'String',
|
|
40
|
+
email: 'String',
|
|
41
|
+
url: 'String',
|
|
42
|
+
uri: 'String',
|
|
43
|
+
json: 'dynamic',
|
|
44
|
+
any: 'dynamic',
|
|
45
|
+
bytes: 'Uint8List',
|
|
46
|
+
object: 'Map<String, dynamic>',
|
|
47
|
+
};
|
|
48
|
+
// ============================================================================
|
|
49
|
+
// Helpers
|
|
50
|
+
// ============================================================================
|
|
51
|
+
/** Convert an IRType to a Dart type annotation string. */
|
|
52
|
+
function irTypeToDart(type, diagnostics) {
|
|
53
|
+
// Handle generic types first (array, map) before TYPE_MAP lookup
|
|
54
|
+
if (type.name === 'array' && type.generic) {
|
|
55
|
+
const inner = irTypeToDart(type.generic, diagnostics);
|
|
56
|
+
return `List<${inner}>`;
|
|
57
|
+
}
|
|
58
|
+
if (type.name === 'map' && type.generic) {
|
|
59
|
+
const inner = irTypeToDart(type.generic, diagnostics);
|
|
60
|
+
return `Map<String, ${inner}>`;
|
|
61
|
+
}
|
|
62
|
+
const base = TYPE_MAP[type.name];
|
|
63
|
+
if (base === undefined) {
|
|
64
|
+
diagnostics.push({
|
|
65
|
+
severity: 'warning',
|
|
66
|
+
code: 'DART_UNKNOWN_TYPE',
|
|
67
|
+
message: `Unknown IR type "${type.name}", falling back to dynamic`,
|
|
68
|
+
});
|
|
69
|
+
return 'dynamic';
|
|
70
|
+
}
|
|
71
|
+
return base;
|
|
72
|
+
}
|
|
73
|
+
/** Convert snake_case or camelCase to PascalCase. */
|
|
74
|
+
function pascalCase(name) {
|
|
75
|
+
return name
|
|
76
|
+
.replace(/[_]+(.)/g, (_, c) => c.toUpperCase())
|
|
77
|
+
.replace(/^(.)/, (_, c) => c.toUpperCase());
|
|
78
|
+
}
|
|
79
|
+
/** Convert PascalCase or snake_case to camelCase. */
|
|
80
|
+
function camelCase(name) {
|
|
81
|
+
const pascal = pascalCase(name);
|
|
82
|
+
return pascal.charAt(0).toLowerCase() + pascal.slice(1);
|
|
83
|
+
}
|
|
84
|
+
/** Convert PascalCase to snake_case for file paths. */
|
|
85
|
+
function snakeCase(name) {
|
|
86
|
+
return name
|
|
87
|
+
.replace(/([A-Z])/g, '_$1')
|
|
88
|
+
.toLowerCase()
|
|
89
|
+
.replace(/^_/, '');
|
|
90
|
+
}
|
|
91
|
+
function generateEntityModel(entity, opts, diagnostics) {
|
|
92
|
+
const name = pascalCase(entity.name);
|
|
93
|
+
const lines = [];
|
|
94
|
+
const hasComputed = entity.computedProperties.length > 0;
|
|
95
|
+
// Analyze constraints for this entity
|
|
96
|
+
const analysis = analyzeConstraints(entity.constraints);
|
|
97
|
+
// Build lookup: property name → numeric range chain
|
|
98
|
+
const numericChains = new Map();
|
|
99
|
+
for (const range of analysis.numericRanges) {
|
|
100
|
+
const prop = range.propertyPath.replace(/^self\./, '');
|
|
101
|
+
numericChains.set(prop, numericRangeToZodChain(range));
|
|
102
|
+
}
|
|
103
|
+
// Build lookup: property name → length chain
|
|
104
|
+
const lengthChains = new Map();
|
|
105
|
+
for (const lc of analysis.lengthConstraints) {
|
|
106
|
+
const prop = lc.propertyPath.replace(/^self\./, '');
|
|
107
|
+
lengthChains.set(prop, lengthConstraintToZodChain(lc));
|
|
108
|
+
}
|
|
109
|
+
// Build lookup: property name → pattern chain
|
|
110
|
+
const patternChains = new Map();
|
|
111
|
+
for (const pc of analysis.patternConstraints) {
|
|
112
|
+
const prop = pc.propertyPath.replace(/^self\./, '');
|
|
113
|
+
const existing = patternChains.get(prop) ?? '';
|
|
114
|
+
patternChains.set(prop, existing + patternConstraintToZodChain(pc));
|
|
115
|
+
}
|
|
116
|
+
const hasConstraints = numericChains.size > 0 || lengthChains.size > 0 || patternChains.size > 0;
|
|
117
|
+
// Class header
|
|
118
|
+
lines.push(`/// Entity: ${entity.name}`);
|
|
119
|
+
if (entity.constraints.length > 0) {
|
|
120
|
+
for (const c of entity.constraints) {
|
|
121
|
+
if (c.message) {
|
|
122
|
+
lines.push(`/// Constraint: ${c.message}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
lines.push(`class ${name} {`);
|
|
127
|
+
lines.push(` final String id;`);
|
|
128
|
+
// Regular properties
|
|
129
|
+
for (const prop of entity.properties) {
|
|
130
|
+
if (prop.name === 'id')
|
|
131
|
+
continue; // id is always present
|
|
132
|
+
const dartType = irTypeToDart(prop.type, diagnostics);
|
|
133
|
+
const nullable = prop.type.nullable || !prop.modifiers.includes('required') ? '?' : '';
|
|
134
|
+
lines.push(` final ${dartType}${nullable} ${camelCase(prop.name)};`);
|
|
135
|
+
}
|
|
136
|
+
lines.push('');
|
|
137
|
+
// Constructor
|
|
138
|
+
lines.push(` const ${name}({`);
|
|
139
|
+
lines.push(` required this.id,`);
|
|
140
|
+
for (const prop of entity.properties) {
|
|
141
|
+
if (prop.name === 'id')
|
|
142
|
+
continue;
|
|
143
|
+
const required = prop.modifiers.includes('required') && !prop.type.nullable ? 'required ' : '';
|
|
144
|
+
lines.push(` ${required}this.${camelCase(prop.name)},`);
|
|
145
|
+
}
|
|
146
|
+
lines.push(` });`);
|
|
147
|
+
// fromJson factory
|
|
148
|
+
lines.push('');
|
|
149
|
+
lines.push(` factory ${name}.fromJson(Map<String, dynamic> json) {`);
|
|
150
|
+
lines.push(` return ${name}(`);
|
|
151
|
+
for (const prop of entity.properties) {
|
|
152
|
+
const fieldName = camelCase(prop.name);
|
|
153
|
+
const isRequired = prop.modifiers.includes('required') && !prop.type.nullable;
|
|
154
|
+
const dartType = irTypeToDart(prop.type, diagnostics);
|
|
155
|
+
let parseExpr = generateJsonParse(prop.name, prop.type, dartType, diagnostics);
|
|
156
|
+
if (!isRequired) {
|
|
157
|
+
parseExpr = `json['${prop.name}'] != null ? ${parseExpr} : null`;
|
|
158
|
+
}
|
|
159
|
+
// For required fields, parseExpr already includes the type cast
|
|
160
|
+
lines.push(` ${fieldName}: ${parseExpr},`);
|
|
161
|
+
}
|
|
162
|
+
lines.push(` );`);
|
|
163
|
+
lines.push(` }`);
|
|
164
|
+
// toJson method
|
|
165
|
+
lines.push('');
|
|
166
|
+
lines.push(` Map<String, dynamic> toJson() {`);
|
|
167
|
+
lines.push(` return {`);
|
|
168
|
+
lines.push(` 'id': id,`);
|
|
169
|
+
for (const prop of entity.properties) {
|
|
170
|
+
if (prop.name === 'id')
|
|
171
|
+
continue;
|
|
172
|
+
const fieldName = camelCase(prop.name);
|
|
173
|
+
const isOptional = !prop.modifiers.includes('required') || prop.type.nullable;
|
|
174
|
+
if (isOptional) {
|
|
175
|
+
lines.push(` '${prop.name}': ${fieldName},`);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
lines.push(` '${prop.name}': ${fieldName},`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
lines.push(` };`);
|
|
182
|
+
lines.push(` }`);
|
|
183
|
+
// copyWith method
|
|
184
|
+
if (opts.emitEquality) {
|
|
185
|
+
lines.push('');
|
|
186
|
+
lines.push(` ${name} copyWith({`);
|
|
187
|
+
lines.push(` String? id,`);
|
|
188
|
+
for (const prop of entity.properties) {
|
|
189
|
+
if (prop.name === 'id')
|
|
190
|
+
continue;
|
|
191
|
+
const dartType = irTypeToDart(prop.type, diagnostics);
|
|
192
|
+
const nullable = prop.type.nullable || !prop.modifiers.includes('required') ? '?' : '';
|
|
193
|
+
lines.push(` ${dartType}${nullable} ${camelCase(prop.name)},`);
|
|
194
|
+
}
|
|
195
|
+
lines.push(` }) {`);
|
|
196
|
+
lines.push(` return ${name}(`);
|
|
197
|
+
lines.push(` id: id ?? this.id,`);
|
|
198
|
+
for (const prop of entity.properties) {
|
|
199
|
+
if (prop.name === 'id')
|
|
200
|
+
continue;
|
|
201
|
+
const fieldName = camelCase(prop.name);
|
|
202
|
+
lines.push(` ${fieldName}: ${fieldName} ?? this.${fieldName},`);
|
|
203
|
+
}
|
|
204
|
+
lines.push(` );`);
|
|
205
|
+
lines.push(` }`);
|
|
206
|
+
// Equality
|
|
207
|
+
lines.push('');
|
|
208
|
+
lines.push(` @override`);
|
|
209
|
+
lines.push(` bool operator ==(Object other) {`);
|
|
210
|
+
lines.push(` if (identical(this, other)) return true;`);
|
|
211
|
+
lines.push(` return other is ${name} &&`);
|
|
212
|
+
lines.push(` other.id == id &&`);
|
|
213
|
+
for (const prop of entity.properties) {
|
|
214
|
+
if (prop.name === 'id')
|
|
215
|
+
continue;
|
|
216
|
+
lines.push(` other.${camelCase(prop.name)} == ${camelCase(prop.name)} &&`);
|
|
217
|
+
}
|
|
218
|
+
// Remove trailing &&
|
|
219
|
+
const lastIdx = lines.length - 1;
|
|
220
|
+
if (lines[lastIdx].endsWith('&&')) {
|
|
221
|
+
lines[lastIdx] = lines[lastIdx].slice(0, -3);
|
|
222
|
+
}
|
|
223
|
+
lines.push(`;`);
|
|
224
|
+
lines.push(` }`);
|
|
225
|
+
lines.push('');
|
|
226
|
+
lines.push(` @override`);
|
|
227
|
+
lines.push(` int get hashCode => Object.hash(id, ${entity.properties.filter(p => p.name !== 'id').map(p => camelCase(p.name)).join(', ')});`);
|
|
228
|
+
}
|
|
229
|
+
// Computed property getters
|
|
230
|
+
if (opts.emitComputedProperties && hasComputed) {
|
|
231
|
+
lines.push('');
|
|
232
|
+
for (const cp of entity.computedProperties) {
|
|
233
|
+
const dartType = irTypeToDart(cp.type, diagnostics);
|
|
234
|
+
const nullable = cp.type.nullable ? '?' : '';
|
|
235
|
+
lines.push(` /// Computed: ${cp.name}`);
|
|
236
|
+
lines.push(` ${dartType}${nullable} get ${camelCase(cp.name)} {`);
|
|
237
|
+
lines.push(` // Expression: ${expressionToDart(cp.expression)}`);
|
|
238
|
+
lines.push(` throw UnimplementedError('Computed property ${cp.name} must be evaluated by the server');`);
|
|
239
|
+
lines.push(` }`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// Validator method
|
|
243
|
+
if (opts.emitValidators && hasConstraints) {
|
|
244
|
+
lines.push('');
|
|
245
|
+
lines.push(` /// Validates constraints. Returns null if valid, error message otherwise.`);
|
|
246
|
+
lines.push(` String? validate() {`);
|
|
247
|
+
for (const [propName, chain] of numericChains) {
|
|
248
|
+
const fieldName = camelCase(propName);
|
|
249
|
+
lines.push(` if (${fieldName} != null) {`);
|
|
250
|
+
if (chain.includes('.min(')) {
|
|
251
|
+
const match = chain.match(/\.min\((\d+)\)/);
|
|
252
|
+
if (match) {
|
|
253
|
+
lines.push(` if (${fieldName}! < ${match[1]}) return '${propName} must be >= ${match[1]}';`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (chain.includes('.max(')) {
|
|
257
|
+
const match = chain.match(/\.max\((\d+)\)/);
|
|
258
|
+
if (match) {
|
|
259
|
+
lines.push(` if (${fieldName}! > ${match[1]}) return '${propName} must be <= ${match[1]}';`);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
lines.push(` }`);
|
|
263
|
+
}
|
|
264
|
+
for (const [propName, chain] of lengthChains) {
|
|
265
|
+
const fieldName = camelCase(propName);
|
|
266
|
+
lines.push(` if (${fieldName} != null) {`);
|
|
267
|
+
if (chain.includes('.min(')) {
|
|
268
|
+
const match = chain.match(/\.min\((\d+)\)/);
|
|
269
|
+
if (match) {
|
|
270
|
+
lines.push(` if (${fieldName}!.length < ${match[1]}) return '${propName} must be at least ${match[1]} characters';`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (chain.includes('.max(')) {
|
|
274
|
+
const match = chain.match(/\.max\((\d+)\)/);
|
|
275
|
+
if (match) {
|
|
276
|
+
lines.push(` if (${fieldName}!.length > ${match[1]}) return '${propName} must be at most ${match[1]} characters';`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
lines.push(` }`);
|
|
280
|
+
}
|
|
281
|
+
for (const [propName, chain] of patternChains) {
|
|
282
|
+
const fieldName = camelCase(propName);
|
|
283
|
+
const regexMatch = chain.match(/\.regex\(\/(.+?)\/\)/);
|
|
284
|
+
if (regexMatch) {
|
|
285
|
+
lines.push(` if (${fieldName} != null) {`);
|
|
286
|
+
lines.push(` if (!RegExp(r'${regexMatch[1]}').hasMatch(${fieldName}!)) return '${propName} format is invalid';`);
|
|
287
|
+
lines.push(` }`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
lines.push(` return null;`);
|
|
291
|
+
lines.push(` }`);
|
|
292
|
+
}
|
|
293
|
+
// toString
|
|
294
|
+
lines.push('');
|
|
295
|
+
lines.push(` @override`);
|
|
296
|
+
lines.push(` String toString() => '${name}(id: $id)';`);
|
|
297
|
+
lines.push(`}`);
|
|
298
|
+
return { lines, entityName: name, hasComputed, hasConstraints };
|
|
299
|
+
}
|
|
300
|
+
/** Generate a JSON parse expression for a property. */
|
|
301
|
+
function generateJsonParse(jsonKey, type, dartType, diagnostics) {
|
|
302
|
+
const jsonAccess = `json['${jsonKey}']`;
|
|
303
|
+
if (type.name === 'array' && type.generic) {
|
|
304
|
+
const innerDart = irTypeToDart(type.generic, diagnostics);
|
|
305
|
+
return `(${jsonAccess} as List<dynamic>).map((e) => e as ${innerDart}).toList()`;
|
|
306
|
+
}
|
|
307
|
+
if (type.name === 'map' && type.generic) {
|
|
308
|
+
const innerDart = irTypeToDart(type.generic, diagnostics);
|
|
309
|
+
return `(${jsonAccess} as Map<String, dynamic>).map((k, v) => MapEntry(k, v as ${innerDart}))`;
|
|
310
|
+
}
|
|
311
|
+
if (type.name === 'datetime' || type.name === 'date' || type.name === 'timestamp') {
|
|
312
|
+
return `DateTime.parse(${jsonAccess} as String)`;
|
|
313
|
+
}
|
|
314
|
+
if (type.name === 'bool' || type.name === 'boolean') {
|
|
315
|
+
return `${jsonAccess} as bool`;
|
|
316
|
+
}
|
|
317
|
+
if (type.name === 'int' || type.name === 'integer' || type.name === 'bigint') {
|
|
318
|
+
return `${jsonAccess} as int`;
|
|
319
|
+
}
|
|
320
|
+
if (type.name === 'number' || type.name === 'float') {
|
|
321
|
+
return `(${jsonAccess} as num).toDouble()`;
|
|
322
|
+
}
|
|
323
|
+
if (type.name === 'decimal' || type.name === 'money') {
|
|
324
|
+
return `${jsonAccess} as String`;
|
|
325
|
+
}
|
|
326
|
+
if (type.name === 'json' || type.name === 'any') {
|
|
327
|
+
return `${jsonAccess}`;
|
|
328
|
+
}
|
|
329
|
+
if (type.name === 'bytes') {
|
|
330
|
+
return `Uint8List.fromList(${jsonAccess} as List<int>)`;
|
|
331
|
+
}
|
|
332
|
+
// Default: string or unknown
|
|
333
|
+
return `${jsonAccess} as ${dartType}`;
|
|
334
|
+
}
|
|
335
|
+
/** Convert an IRExpression to a Dart comment representation. */
|
|
336
|
+
function expressionToDart(expr) {
|
|
337
|
+
if (!expr || typeof expr !== 'object')
|
|
338
|
+
return 'unknown';
|
|
339
|
+
const e = expr;
|
|
340
|
+
if (e.kind === 'binary') {
|
|
341
|
+
return `(${expressionToDart(e.left)} ${e.operator} ${expressionToDart(e.right)})`;
|
|
342
|
+
}
|
|
343
|
+
if (e.kind === 'identifier')
|
|
344
|
+
return String(e.name);
|
|
345
|
+
if (e.kind === 'literal') {
|
|
346
|
+
const val = e.value;
|
|
347
|
+
if (val.kind === 'string')
|
|
348
|
+
return `'${val.value}'`;
|
|
349
|
+
if (val.kind === 'number')
|
|
350
|
+
return String(val.value);
|
|
351
|
+
if (val.kind === 'boolean')
|
|
352
|
+
return String(val.value);
|
|
353
|
+
return String(val.kind);
|
|
354
|
+
}
|
|
355
|
+
if (e.kind === 'member') {
|
|
356
|
+
return `${expressionToDart(e.object)}.${e.property}`;
|
|
357
|
+
}
|
|
358
|
+
return `<${e.kind}>`;
|
|
359
|
+
}
|
|
360
|
+
// ============================================================================
|
|
361
|
+
// Command model generation
|
|
362
|
+
// ============================================================================
|
|
363
|
+
function generateCommandModel(command, _opts, diagnostics) {
|
|
364
|
+
const lines = [];
|
|
365
|
+
const name = pascalCase(command.name);
|
|
366
|
+
// Command params class
|
|
367
|
+
lines.push(`/// Command params: ${command.name}${command.entity ? ` on ${command.entity}` : ''}`);
|
|
368
|
+
lines.push(`class ${name}Params {`);
|
|
369
|
+
if (command.parameters.length === 0) {
|
|
370
|
+
lines.push(` const ${name}Params();`);
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
for (const param of command.parameters) {
|
|
374
|
+
const dartType = irTypeToDart(param.type, diagnostics);
|
|
375
|
+
const nullable = param.type.nullable || !param.required ? '?' : '';
|
|
376
|
+
lines.push(` final ${dartType}${nullable} ${camelCase(param.name)};`);
|
|
377
|
+
}
|
|
378
|
+
lines.push('');
|
|
379
|
+
lines.push(` const ${name}Params({`);
|
|
380
|
+
for (const param of command.parameters) {
|
|
381
|
+
const isRequired = param.required && !param.type.nullable;
|
|
382
|
+
lines.push(` ${isRequired ? 'required ' : ''}this.${camelCase(param.name)},`);
|
|
383
|
+
}
|
|
384
|
+
lines.push(` });`);
|
|
385
|
+
}
|
|
386
|
+
// toJson
|
|
387
|
+
lines.push('');
|
|
388
|
+
lines.push(` Map<String, dynamic> toJson() {`);
|
|
389
|
+
lines.push(` return {`);
|
|
390
|
+
for (const param of command.parameters) {
|
|
391
|
+
lines.push(` '${param.name}': ${camelCase(param.name)},`);
|
|
392
|
+
}
|
|
393
|
+
lines.push(` };`);
|
|
394
|
+
lines.push(` }`);
|
|
395
|
+
// fromJson
|
|
396
|
+
lines.push('');
|
|
397
|
+
lines.push(` factory ${name}Params.fromJson(Map<String, dynamic> json) {`);
|
|
398
|
+
if (command.parameters.length === 0) {
|
|
399
|
+
lines.push(` return const ${name}Params();`);
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
lines.push(` return ${name}Params(`);
|
|
403
|
+
for (const param of command.parameters) {
|
|
404
|
+
const fieldName = camelCase(param.name);
|
|
405
|
+
const dartType = irTypeToDart(param.type, diagnostics);
|
|
406
|
+
const isRequired = param.required && !param.type.nullable;
|
|
407
|
+
let parseExpr = generateJsonParse(param.name, param.type, dartType, diagnostics);
|
|
408
|
+
if (!isRequired) {
|
|
409
|
+
parseExpr = `json['${param.name}'] != null ? ${parseExpr} : null`;
|
|
410
|
+
}
|
|
411
|
+
lines.push(` ${fieldName}: ${parseExpr},`);
|
|
412
|
+
}
|
|
413
|
+
lines.push(` );`);
|
|
414
|
+
}
|
|
415
|
+
lines.push(` }`);
|
|
416
|
+
lines.push(`}`);
|
|
417
|
+
// Return type class (if command has a return type)
|
|
418
|
+
if (command.returns) {
|
|
419
|
+
lines.push('');
|
|
420
|
+
lines.push(`/// Return type for command: ${command.name}`);
|
|
421
|
+
lines.push(`class ${name}Return {`);
|
|
422
|
+
const dartType = irTypeToDart(command.returns, diagnostics);
|
|
423
|
+
lines.push(` final ${dartType} value;`);
|
|
424
|
+
lines.push('');
|
|
425
|
+
lines.push(` const ${name}Return({required this.value});`);
|
|
426
|
+
lines.push('');
|
|
427
|
+
lines.push(` factory ${name}Return.fromJson(Map<String, dynamic> json) {`);
|
|
428
|
+
lines.push(` return ${name}Return(`);
|
|
429
|
+
lines.push(` value: ${generateJsonParse('value', command.returns, dartType, diagnostics)},`);
|
|
430
|
+
lines.push(` );`);
|
|
431
|
+
lines.push(` }`);
|
|
432
|
+
lines.push('');
|
|
433
|
+
lines.push(` Map<String, dynamic> toJson() => {'value': value};`);
|
|
434
|
+
lines.push(`}`);
|
|
435
|
+
}
|
|
436
|
+
return lines;
|
|
437
|
+
}
|
|
438
|
+
// ============================================================================
|
|
439
|
+
// Enum model generation
|
|
440
|
+
// ============================================================================
|
|
441
|
+
function generateEnumModel(enumDef) {
|
|
442
|
+
const lines = [];
|
|
443
|
+
const name = pascalCase(enumDef.name);
|
|
444
|
+
lines.push(`/// Enum: ${enumDef.name}`);
|
|
445
|
+
lines.push(`enum ${name} {`);
|
|
446
|
+
for (const val of enumDef.values) {
|
|
447
|
+
const valName = camelCase(val.name);
|
|
448
|
+
const rawValue = val.name;
|
|
449
|
+
lines.push(` ${valName}('${rawValue}'),`);
|
|
450
|
+
}
|
|
451
|
+
lines.push('');
|
|
452
|
+
lines.push(` const ${name}(this.value);`);
|
|
453
|
+
lines.push(` final String value;`);
|
|
454
|
+
lines.push('');
|
|
455
|
+
lines.push(` static ${name} fromString(String value) {`);
|
|
456
|
+
lines.push(` return ${name}.values.firstWhere(`);
|
|
457
|
+
lines.push(` (e) => e.value == value,`);
|
|
458
|
+
lines.push(` orElse: () => throw ArgumentError('Unknown ${name}: $value'),`);
|
|
459
|
+
lines.push(` );`);
|
|
460
|
+
lines.push(` }`);
|
|
461
|
+
lines.push(`}`);
|
|
462
|
+
return lines;
|
|
463
|
+
}
|
|
464
|
+
// ============================================================================
|
|
465
|
+
// Client generation
|
|
466
|
+
// ============================================================================
|
|
467
|
+
function generateClient(ir, opts, _diagnostics) {
|
|
468
|
+
const lines = [];
|
|
469
|
+
const className = opts.clientClassName;
|
|
470
|
+
lines.push(`/// Async HTTP client for the Manifest API.`);
|
|
471
|
+
lines.push(`class ${className} {`);
|
|
472
|
+
lines.push(` final Dio _dio;`);
|
|
473
|
+
lines.push(` final String baseUrl;`);
|
|
474
|
+
lines.push('');
|
|
475
|
+
lines.push(` ${className}({`);
|
|
476
|
+
lines.push(` String? baseUrl,`);
|
|
477
|
+
lines.push(` Dio? dio,`);
|
|
478
|
+
lines.push(` String? apiKey,`);
|
|
479
|
+
lines.push(` }) : baseUrl = baseUrl ?? '${opts.clientBaseUrl}',`);
|
|
480
|
+
lines.push(` _dio = dio ?? Dio() {`);
|
|
481
|
+
lines.push(` _dio.options.baseUrl = baseUrl;`);
|
|
482
|
+
lines.push(` if (apiKey != null) {`);
|
|
483
|
+
lines.push(` _dio.options.headers['Authorization'] = 'Bearer ' + apiKey;`);
|
|
484
|
+
lines.push(` }`);
|
|
485
|
+
lines.push(` }`);
|
|
486
|
+
// Entity CRUD methods
|
|
487
|
+
for (const entity of ir.entities) {
|
|
488
|
+
const name = pascalCase(entity.name);
|
|
489
|
+
// list method
|
|
490
|
+
lines.push('');
|
|
491
|
+
lines.push(` /// List all ${name} entities.`);
|
|
492
|
+
lines.push(` Future<List<${name}>> list${name}s() async {`);
|
|
493
|
+
lines.push(` final response = await _dio.get('/api/${snakeCase(entity.name)}s');`);
|
|
494
|
+
lines.push(` final List<dynamic> data = response.data as List<dynamic>;`);
|
|
495
|
+
lines.push(` return data.map((json) => ${name}.fromJson(json as Map<String, dynamic>)).toList();`);
|
|
496
|
+
lines.push(` }`);
|
|
497
|
+
// get method
|
|
498
|
+
lines.push('');
|
|
499
|
+
lines.push(` /// Get a single ${name} by id.`);
|
|
500
|
+
lines.push(` Future<${name}> get${name}(String id) async {`);
|
|
501
|
+
lines.push(` final response = await _dio.get('/api/${snakeCase(entity.name)}s/' + id);`);
|
|
502
|
+
lines.push(` return ${name}.fromJson(response.data as Map<String, dynamic>);`);
|
|
503
|
+
lines.push(` }`);
|
|
504
|
+
// delete method
|
|
505
|
+
lines.push('');
|
|
506
|
+
lines.push(` /// Delete a ${name} by id.`);
|
|
507
|
+
lines.push(` Future<void> delete${name}(String id) async {`);
|
|
508
|
+
lines.push(` await _dio.delete('/api/${snakeCase(entity.name)}s/' + id);`);
|
|
509
|
+
lines.push(` }`);
|
|
510
|
+
}
|
|
511
|
+
// Command methods
|
|
512
|
+
for (const command of ir.commands) {
|
|
513
|
+
const name = pascalCase(command.name);
|
|
514
|
+
const hasParams = command.parameters.length > 0;
|
|
515
|
+
const hasReturn = !!command.returns;
|
|
516
|
+
let returnType = 'Future<void>';
|
|
517
|
+
if (hasReturn) {
|
|
518
|
+
returnType = `Future<${name}Return>`;
|
|
519
|
+
}
|
|
520
|
+
lines.push('');
|
|
521
|
+
if (command.entity) {
|
|
522
|
+
lines.push(` /// Execute command: ${command.name} on ${command.entity}`);
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
lines.push(` /// Execute command: ${command.name}`);
|
|
526
|
+
}
|
|
527
|
+
if (hasParams) {
|
|
528
|
+
lines.push(` ${returnType} ${camelCase(command.name)}(${name}Params params) async {`);
|
|
529
|
+
if (command.entity) {
|
|
530
|
+
lines.push(` final response = await _dio.post(`);
|
|
531
|
+
lines.push(` '/api/${snakeCase(command.entity)}s/\${params.id ?? ""}/${snakeCase(command.name)}',`);
|
|
532
|
+
lines.push(` data: params.toJson(),`);
|
|
533
|
+
lines.push(` );`);
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
lines.push(` final response = await _dio.post(`);
|
|
537
|
+
lines.push(` '/api/commands/${snakeCase(command.name)}',`);
|
|
538
|
+
lines.push(` data: params.toJson(),`);
|
|
539
|
+
lines.push(` );`);
|
|
540
|
+
}
|
|
541
|
+
if (hasReturn) {
|
|
542
|
+
lines.push(` return ${name}Return.fromJson(response.data as Map<String, dynamic>);`);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
lines.push(` ${returnType} ${camelCase(command.name)}() async {`);
|
|
547
|
+
if (command.entity) {
|
|
548
|
+
lines.push(` final response = await _dio.post('/api/${snakeCase(command.entity)}s/${snakeCase(command.name)}');`);
|
|
549
|
+
}
|
|
550
|
+
else {
|
|
551
|
+
lines.push(` final response = await _dio.post('/api/commands/${snakeCase(command.name)}');`);
|
|
552
|
+
}
|
|
553
|
+
if (hasReturn) {
|
|
554
|
+
lines.push(` return ${name}Return.fromJson(response.data as Map<String, dynamic>);`);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
lines.push(` }`);
|
|
558
|
+
}
|
|
559
|
+
// close method
|
|
560
|
+
lines.push('');
|
|
561
|
+
lines.push(` void close() {`);
|
|
562
|
+
lines.push(` _dio.close();`);
|
|
563
|
+
lines.push(` }`);
|
|
564
|
+
lines.push(`}`);
|
|
565
|
+
return lines;
|
|
566
|
+
}
|
|
567
|
+
// ============================================================================
|
|
568
|
+
// Provider generation (Riverpod / Provider)
|
|
569
|
+
// ============================================================================
|
|
570
|
+
function generateProviders(ir, opts, _diagnostics) {
|
|
571
|
+
const lines = [];
|
|
572
|
+
const className = opts.clientClassName;
|
|
573
|
+
if (opts.stateManagement === 'riverpod') {
|
|
574
|
+
// Riverpod providers
|
|
575
|
+
lines.push(`// Riverpod providers for Manifest entities and commands.`);
|
|
576
|
+
lines.push(`// Add flutter_riverpod and riverpod_annotation to your pubspec.yaml.`);
|
|
577
|
+
lines.push('');
|
|
578
|
+
// Client provider
|
|
579
|
+
lines.push(`/// Provider for the ${className} instance.`);
|
|
580
|
+
lines.push(`final ${className.toLowerCase()}Provider = Provider<${className}>((ref) {`);
|
|
581
|
+
lines.push(` final client = ${className}();`);
|
|
582
|
+
lines.push(` ref.onDispose(client.close);`);
|
|
583
|
+
lines.push(` return client;`);
|
|
584
|
+
lines.push(`});`);
|
|
585
|
+
// Entity providers
|
|
586
|
+
for (const entity of ir.entities) {
|
|
587
|
+
const name = pascalCase(entity.name);
|
|
588
|
+
const nameLower = camelCase(entity.name);
|
|
589
|
+
// FutureProvider for list
|
|
590
|
+
lines.push('');
|
|
591
|
+
lines.push(`/// Async provider for all ${name} entities.`);
|
|
592
|
+
lines.push(`final ${nameLower}ListProvider = FutureProvider<List<${name}>>((ref) async {`);
|
|
593
|
+
lines.push(` final client = ref.watch(${className.toLowerCase()}Provider);`);
|
|
594
|
+
lines.push(` return client.list${name}s();`);
|
|
595
|
+
lines.push(`});`);
|
|
596
|
+
// Family provider for single
|
|
597
|
+
lines.push('');
|
|
598
|
+
lines.push(`/// Async provider for a single ${name} by id.`);
|
|
599
|
+
lines.push(`final ${nameLower}Provider = FutureProvider.family<${name}, String>((ref, id) async {`);
|
|
600
|
+
lines.push(` final client = ref.watch(${className.toLowerCase()}Provider);`);
|
|
601
|
+
lines.push(` return client.get${name}(id);`);
|
|
602
|
+
lines.push(`});`);
|
|
603
|
+
}
|
|
604
|
+
// Command providers
|
|
605
|
+
for (const command of ir.commands) {
|
|
606
|
+
const name = pascalCase(command.name);
|
|
607
|
+
const hasParams = command.parameters.length > 0;
|
|
608
|
+
if (hasParams) {
|
|
609
|
+
lines.push('');
|
|
610
|
+
lines.push(`/// Provider that executes the ${name} command.`);
|
|
611
|
+
lines.push(`final ${camelCase(command.name)}Provider = Provider<${name}Command>((ref) {`);
|
|
612
|
+
lines.push(` return ${name}Command(ref);`);
|
|
613
|
+
lines.push(`});`);
|
|
614
|
+
lines.push('');
|
|
615
|
+
lines.push(`class ${name}Command {`);
|
|
616
|
+
lines.push(` final Ref ref;`);
|
|
617
|
+
lines.push(` ${name}Command(this.ref);`);
|
|
618
|
+
lines.push('');
|
|
619
|
+
if (command.returns) {
|
|
620
|
+
lines.push(` Future<${name}Return> call(${name}Params params) async {`);
|
|
621
|
+
}
|
|
622
|
+
else {
|
|
623
|
+
lines.push(` Future<void> call(${name}Params params) async {`);
|
|
624
|
+
}
|
|
625
|
+
lines.push(` final client = ref.read(${className.toLowerCase()}Provider);`);
|
|
626
|
+
lines.push(` final result = await client.${camelCase(command.name)}(params);`);
|
|
627
|
+
if (command.entity) {
|
|
628
|
+
lines.push(` ref.invalidate(${camelCase(command.entity)}ListProvider);`);
|
|
629
|
+
}
|
|
630
|
+
lines.push(` return result;`);
|
|
631
|
+
lines.push(` }`);
|
|
632
|
+
lines.push(`}`);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
else if (opts.stateManagement === 'provider') {
|
|
637
|
+
// Classic Provider (ChangeNotifier)
|
|
638
|
+
lines.push(`// ChangeNotifier providers for Manifest entities and commands.`);
|
|
639
|
+
lines.push(`// Add provider to your pubspec.yaml.`);
|
|
640
|
+
lines.push('');
|
|
641
|
+
// Client provider
|
|
642
|
+
lines.push(`/// InheritedWidget or Provider.of accessor for the ${className}.`);
|
|
643
|
+
lines.push(`final ${className.toLowerCase()}Provider = Provider<${className}>((_) {`);
|
|
644
|
+
lines.push(` return ${className}();`);
|
|
645
|
+
lines.push(`});`);
|
|
646
|
+
// Entity ChangeNotifiers
|
|
647
|
+
for (const entity of ir.entities) {
|
|
648
|
+
const name = pascalCase(entity.name);
|
|
649
|
+
const nameLower = camelCase(entity.name);
|
|
650
|
+
lines.push('');
|
|
651
|
+
lines.push(`/// ChangeNotifier for ${name} list state.`);
|
|
652
|
+
lines.push(`class ${name}ListNotifier extends ChangeNotifier {`);
|
|
653
|
+
lines.push(` final ${className} client;`);
|
|
654
|
+
lines.push(` List<${name}> ${nameLower}s = [];`);
|
|
655
|
+
lines.push(` bool isLoading = false;`);
|
|
656
|
+
lines.push(` String? error;`);
|
|
657
|
+
lines.push('');
|
|
658
|
+
lines.push(` ${name}ListNotifier(this.client);`);
|
|
659
|
+
lines.push('');
|
|
660
|
+
lines.push(` Future<void> load() async {`);
|
|
661
|
+
lines.push(` isLoading = true;`);
|
|
662
|
+
lines.push(` notifyListeners();`);
|
|
663
|
+
lines.push(` try {`);
|
|
664
|
+
lines.push(` ${nameLower}s = await client.list${name}s();`);
|
|
665
|
+
lines.push(` error = null;`);
|
|
666
|
+
lines.push(` } catch (e) {`);
|
|
667
|
+
lines.push(` error = e.toString();`);
|
|
668
|
+
lines.push(` } finally {`);
|
|
669
|
+
lines.push(` isLoading = false;`);
|
|
670
|
+
lines.push(` notifyListeners();`);
|
|
671
|
+
lines.push(` }`);
|
|
672
|
+
lines.push(` }`);
|
|
673
|
+
lines.push(`}`);
|
|
674
|
+
lines.push('');
|
|
675
|
+
lines.push(`final ${nameLower}ListNotifierProvider = ChangeNotifierProvider<${name}ListNotifier>((ref) {`);
|
|
676
|
+
lines.push(` final client = ref.watch(${className.toLowerCase()}Provider);`);
|
|
677
|
+
lines.push(` return ${name}ListNotifier(client);`);
|
|
678
|
+
lines.push(`});`);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
// 'none' stateManagement means no providers are generated
|
|
682
|
+
return lines;
|
|
683
|
+
}
|
|
684
|
+
// ============================================================================
|
|
685
|
+
// Package file generation
|
|
686
|
+
// ============================================================================
|
|
687
|
+
function generatePubspec(opts) {
|
|
688
|
+
const deps = [' dio: ^5.4.0'];
|
|
689
|
+
if (opts.stateManagement === 'riverpod') {
|
|
690
|
+
deps.push(' flutter_riverpod: ^2.4.9');
|
|
691
|
+
}
|
|
692
|
+
else if (opts.stateManagement === 'provider') {
|
|
693
|
+
deps.push(' provider: ^6.1.2');
|
|
694
|
+
}
|
|
695
|
+
return `name: ${opts.packageName}
|
|
696
|
+
description: Auto-generated Manifest client SDK for Flutter/Dart.
|
|
697
|
+
version: 0.1.0
|
|
698
|
+
publish_to: none
|
|
699
|
+
|
|
700
|
+
environment:
|
|
701
|
+
sdk: '>=3.2.0 <4.0.0'
|
|
702
|
+
flutter: '>=3.16.0'
|
|
703
|
+
|
|
704
|
+
dependencies:
|
|
705
|
+
${deps.join('\n')}
|
|
706
|
+
|
|
707
|
+
dev_dependencies:
|
|
708
|
+
lints: ^3.1.0
|
|
709
|
+
test: ^1.24.0
|
|
710
|
+
`;
|
|
711
|
+
}
|
|
712
|
+
function generatePackageReadme(opts) {
|
|
713
|
+
return `# ${opts.packageName}
|
|
714
|
+
|
|
715
|
+
Auto-generated Dart/Flutter client SDK for the Manifest API.
|
|
716
|
+
|
|
717
|
+
## Usage
|
|
718
|
+
|
|
719
|
+
\`\`\`dart
|
|
720
|
+
import 'package:${opts.packageName}/${opts.packageName}.dart';
|
|
721
|
+
|
|
722
|
+
final client = ${opts.clientClassName}(baseUrl: 'https://api.example.com');
|
|
723
|
+
|
|
724
|
+
// List entities
|
|
725
|
+
final tasks = await client.listTasks();
|
|
726
|
+
|
|
727
|
+
// Get by id
|
|
728
|
+
final task = await client.getTask('task-id');
|
|
729
|
+
|
|
730
|
+
// Execute commands
|
|
731
|
+
await client.updateStatus(UpdateStatusParams(id: 'task-id', newStatus: 'done'));
|
|
732
|
+
\`\`\`
|
|
733
|
+
|
|
734
|
+
## State Management
|
|
735
|
+
|
|
736
|
+
This package includes ${opts.stateManagement === 'riverpod' ? 'Riverpod' : opts.stateManagement === 'provider' ? 'Provider' : 'no'} state management hooks.
|
|
737
|
+
`;
|
|
738
|
+
}
|
|
739
|
+
// ============================================================================
|
|
740
|
+
// Options normalization
|
|
741
|
+
// ============================================================================
|
|
742
|
+
function normalizeOptions(options) {
|
|
743
|
+
return {
|
|
744
|
+
stateManagement: options?.stateManagement ?? 'riverpod',
|
|
745
|
+
clientBaseUrl: options?.clientBaseUrl ?? 'http://localhost:3000',
|
|
746
|
+
clientClassName: options?.clientClassName ?? 'ManifestClient',
|
|
747
|
+
emitComputedProperties: options?.emitComputedProperties !== false,
|
|
748
|
+
emitValidators: options?.emitValidators !== false,
|
|
749
|
+
emitEquality: options?.emitEquality !== false,
|
|
750
|
+
emitPackageFiles: options?.emitPackageFiles ?? false,
|
|
751
|
+
packageName: options?.packageName ?? 'manifest_client',
|
|
752
|
+
emitHeader: options?.emitHeader !== false,
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
// ============================================================================
|
|
756
|
+
// Header generation
|
|
757
|
+
// ============================================================================
|
|
758
|
+
function generateHeader(opts) {
|
|
759
|
+
if (!opts.emitHeader)
|
|
760
|
+
return [];
|
|
761
|
+
return [
|
|
762
|
+
`// Auto-generated by Manifest Dart projection. Do not edit manually.`,
|
|
763
|
+
`// Generated at: ${new Date().toISOString()}`,
|
|
764
|
+
``,
|
|
765
|
+
];
|
|
766
|
+
}
|
|
767
|
+
function generateImports(opts, includeProviders) {
|
|
768
|
+
const lines = [];
|
|
769
|
+
lines.push(`import 'dart:typed_data';`);
|
|
770
|
+
lines.push(`import 'package:dio/dio.dart';`);
|
|
771
|
+
if (includeProviders) {
|
|
772
|
+
if (opts.stateManagement === 'riverpod') {
|
|
773
|
+
lines.push(`import 'package:flutter_riverpod/flutter_riverpod.dart';`);
|
|
774
|
+
}
|
|
775
|
+
else if (opts.stateManagement === 'provider') {
|
|
776
|
+
lines.push(`import 'package:flutter/foundation.dart';`);
|
|
777
|
+
lines.push(`import 'package:provider/provider.dart';`);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
lines.push(``);
|
|
781
|
+
return lines;
|
|
782
|
+
}
|
|
783
|
+
// ============================================================================
|
|
784
|
+
// Main projection class
|
|
785
|
+
// ============================================================================
|
|
786
|
+
export class DartProjection {
|
|
787
|
+
name = 'dart';
|
|
788
|
+
description = 'Dart/Flutter model classes with fromJson/toJson and state management hooks';
|
|
789
|
+
surfaces = [
|
|
790
|
+
'dart.entity',
|
|
791
|
+
'dart.command',
|
|
792
|
+
'dart.models',
|
|
793
|
+
'dart.client',
|
|
794
|
+
'dart.providers',
|
|
795
|
+
'dart.package',
|
|
796
|
+
];
|
|
797
|
+
generate(ir, request) {
|
|
798
|
+
const diagnostics = [];
|
|
799
|
+
const opts = normalizeOptions(request.options);
|
|
800
|
+
switch (request.surface) {
|
|
801
|
+
case 'dart.entity':
|
|
802
|
+
return this.generateEntitySurface(ir, request, opts, diagnostics);
|
|
803
|
+
case 'dart.command':
|
|
804
|
+
return this.generateCommandSurface(ir, request, opts, diagnostics);
|
|
805
|
+
case 'dart.models':
|
|
806
|
+
return this.generateModelsSurface(ir, opts, diagnostics);
|
|
807
|
+
case 'dart.client':
|
|
808
|
+
return this.generateClientSurface(ir, opts, diagnostics);
|
|
809
|
+
case 'dart.providers':
|
|
810
|
+
return this.generateProvidersSurface(ir, opts, diagnostics);
|
|
811
|
+
case 'dart.package':
|
|
812
|
+
return this.generatePackageSurface(ir, opts, diagnostics);
|
|
813
|
+
default:
|
|
814
|
+
return {
|
|
815
|
+
artifacts: [],
|
|
816
|
+
diagnostics: [{
|
|
817
|
+
severity: 'error',
|
|
818
|
+
code: 'DART_UNKNOWN_SURFACE',
|
|
819
|
+
message: `Unknown surface "${request.surface}". Expected one of: ${this.surfaces.join(', ')}`,
|
|
820
|
+
}],
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
generateEntitySurface(ir, request, opts, diagnostics) {
|
|
825
|
+
const entities = request.entity
|
|
826
|
+
? ir.entities.filter(e => e.name === request.entity)
|
|
827
|
+
: ir.entities;
|
|
828
|
+
if (request.entity && entities.length === 0) {
|
|
829
|
+
return {
|
|
830
|
+
artifacts: [],
|
|
831
|
+
diagnostics: [{
|
|
832
|
+
severity: 'error',
|
|
833
|
+
code: 'DART_ENTITY_NOT_FOUND',
|
|
834
|
+
message: `Entity "${request.entity}" not found in IR`,
|
|
835
|
+
entity: request.entity,
|
|
836
|
+
}],
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
const artifacts = [];
|
|
840
|
+
for (const entity of entities) {
|
|
841
|
+
const result = generateEntityModel(entity, opts, diagnostics);
|
|
842
|
+
const lines = [...generateHeader(opts), ...result.lines];
|
|
843
|
+
const code = lines.join('\n');
|
|
844
|
+
artifacts.push({
|
|
845
|
+
id: `dart.entity.${entity.name}`,
|
|
846
|
+
pathHint: `lib/models/${snakeCase(entity.name)}.dart`,
|
|
847
|
+
contentType: 'dart',
|
|
848
|
+
code,
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
return { artifacts, diagnostics };
|
|
852
|
+
}
|
|
853
|
+
generateCommandSurface(ir, request, opts, diagnostics) {
|
|
854
|
+
const commands = request.command
|
|
855
|
+
? ir.commands.filter(c => c.name === request.command)
|
|
856
|
+
: ir.commands;
|
|
857
|
+
if (request.command && commands.length === 0) {
|
|
858
|
+
return {
|
|
859
|
+
artifacts: [],
|
|
860
|
+
diagnostics: [{
|
|
861
|
+
severity: 'error',
|
|
862
|
+
code: 'DART_COMMAND_NOT_FOUND',
|
|
863
|
+
message: `Command "${request.command}" not found in IR`,
|
|
864
|
+
}],
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
const artifacts = [];
|
|
868
|
+
for (const command of commands) {
|
|
869
|
+
const lines = generateCommandModel(command, opts, diagnostics);
|
|
870
|
+
const allLines = [...generateHeader(opts), ...lines];
|
|
871
|
+
const code = allLines.join('\n');
|
|
872
|
+
artifacts.push({
|
|
873
|
+
id: `dart.command.${command.name}`,
|
|
874
|
+
pathHint: `lib/commands/${snakeCase(command.name)}_params.dart`,
|
|
875
|
+
contentType: 'dart',
|
|
876
|
+
code,
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
return { artifacts, diagnostics };
|
|
880
|
+
}
|
|
881
|
+
generateModelsSurface(ir, opts, diagnostics) {
|
|
882
|
+
const allLines = [];
|
|
883
|
+
allLines.push(...generateHeader(opts));
|
|
884
|
+
allLines.push(`// Export all model classes.`);
|
|
885
|
+
allLines.push(`library manifest_models;`);
|
|
886
|
+
allLines.push('');
|
|
887
|
+
// Enums first
|
|
888
|
+
for (const enumDef of ir.enums) {
|
|
889
|
+
allLines.push(...generateEnumModel(enumDef));
|
|
890
|
+
allLines.push('');
|
|
891
|
+
}
|
|
892
|
+
// Entity models
|
|
893
|
+
for (const entity of ir.entities) {
|
|
894
|
+
const result = generateEntityModel(entity, opts, diagnostics);
|
|
895
|
+
allLines.push(...result.lines);
|
|
896
|
+
allLines.push('');
|
|
897
|
+
}
|
|
898
|
+
// Command models
|
|
899
|
+
for (const command of ir.commands) {
|
|
900
|
+
const cmdLines = generateCommandModel(command, opts, diagnostics);
|
|
901
|
+
allLines.push(...cmdLines);
|
|
902
|
+
allLines.push('');
|
|
903
|
+
}
|
|
904
|
+
return {
|
|
905
|
+
artifacts: [{
|
|
906
|
+
id: 'dart.models',
|
|
907
|
+
pathHint: 'lib/models/manifest_models.dart',
|
|
908
|
+
contentType: 'dart',
|
|
909
|
+
code: allLines.join('\n'),
|
|
910
|
+
}],
|
|
911
|
+
diagnostics,
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
generateClientSurface(ir, opts, diagnostics) {
|
|
915
|
+
const allLines = [];
|
|
916
|
+
allLines.push(...generateHeader(opts));
|
|
917
|
+
allLines.push(...generateImports(opts, false));
|
|
918
|
+
allLines.push(...generateClient(ir, opts, diagnostics));
|
|
919
|
+
return {
|
|
920
|
+
artifacts: [{
|
|
921
|
+
id: 'dart.client',
|
|
922
|
+
pathHint: 'lib/client/manifest_client.dart',
|
|
923
|
+
contentType: 'dart',
|
|
924
|
+
code: allLines.join('\n'),
|
|
925
|
+
}],
|
|
926
|
+
diagnostics,
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
generateProvidersSurface(ir, opts, diagnostics) {
|
|
930
|
+
const allLines = [];
|
|
931
|
+
allLines.push(...generateHeader(opts));
|
|
932
|
+
allLines.push(...generateImports(opts, true));
|
|
933
|
+
allLines.push(...generateProviders(ir, opts, diagnostics));
|
|
934
|
+
return {
|
|
935
|
+
artifacts: [{
|
|
936
|
+
id: 'dart.providers',
|
|
937
|
+
pathHint: 'lib/providers/manifest_providers.dart',
|
|
938
|
+
contentType: 'dart',
|
|
939
|
+
code: allLines.join('\n'),
|
|
940
|
+
}],
|
|
941
|
+
diagnostics,
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
generatePackageSurface(ir, opts, diagnostics) {
|
|
945
|
+
const artifacts = [];
|
|
946
|
+
// Models file
|
|
947
|
+
const modelsResult = this.generateModelsSurface(ir, opts, diagnostics);
|
|
948
|
+
if (modelsResult.artifacts[0]) {
|
|
949
|
+
artifacts.push(modelsResult.artifacts[0]);
|
|
950
|
+
}
|
|
951
|
+
// Client file
|
|
952
|
+
const clientResult = this.generateClientSurface(ir, opts, diagnostics);
|
|
953
|
+
if (clientResult.artifacts[0]) {
|
|
954
|
+
artifacts.push(clientResult.artifacts[0]);
|
|
955
|
+
}
|
|
956
|
+
// Providers file (if state management is enabled)
|
|
957
|
+
if (opts.stateManagement !== 'none') {
|
|
958
|
+
const providersResult = this.generateProvidersSurface(ir, opts, diagnostics);
|
|
959
|
+
if (providersResult.artifacts[0]) {
|
|
960
|
+
artifacts.push(providersResult.artifacts[0]);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
// Package files
|
|
964
|
+
if (opts.emitPackageFiles) {
|
|
965
|
+
artifacts.push({
|
|
966
|
+
id: 'dart.package.pubspec',
|
|
967
|
+
pathHint: 'pubspec.yaml',
|
|
968
|
+
contentType: 'yaml',
|
|
969
|
+
code: generatePubspec(opts),
|
|
970
|
+
});
|
|
971
|
+
artifacts.push({
|
|
972
|
+
id: 'dart.package.readme',
|
|
973
|
+
pathHint: 'README.md',
|
|
974
|
+
contentType: 'markdown',
|
|
975
|
+
code: generatePackageReadme(opts),
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
return { artifacts, diagnostics };
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
//# sourceMappingURL=generator.js.map
|