@mantajs/cli 0.2.0-beta.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.
Files changed (282) hide show
  1. package/bin/manta.mjs +20 -0
  2. package/bin/manta.ts +13 -0
  3. package/dist/admin/generate-admin-config.d.ts +8 -0
  4. package/dist/admin/generate-admin-config.d.ts.map +1 -0
  5. package/dist/admin/generate-admin-config.js +127 -0
  6. package/dist/admin/generate-admin-config.js.map +1 -0
  7. package/dist/ai/chat-handler.d.ts +10 -0
  8. package/dist/ai/chat-handler.d.ts.map +1 -0
  9. package/dist/ai/chat-handler.js +1353 -0
  10. package/dist/ai/chat-handler.js.map +1 -0
  11. package/dist/bootstrap/boot.d.ts +25 -0
  12. package/dist/bootstrap/boot.d.ts.map +1 -0
  13. package/dist/bootstrap/boot.js +344 -0
  14. package/dist/bootstrap/boot.js.map +1 -0
  15. package/dist/bootstrap/bootstrap-app.d.ts +71 -0
  16. package/dist/bootstrap/bootstrap-app.d.ts.map +1 -0
  17. package/dist/bootstrap/bootstrap-app.js +308 -0
  18. package/dist/bootstrap/bootstrap-app.js.map +1 -0
  19. package/dist/bootstrap/bootstrap-context.d.ts +76 -0
  20. package/dist/bootstrap/bootstrap-context.d.ts.map +1 -0
  21. package/dist/bootstrap/bootstrap-context.js +4 -0
  22. package/dist/bootstrap/bootstrap-context.js.map +1 -0
  23. package/dist/bootstrap/bootstrap-helpers.d.ts +71 -0
  24. package/dist/bootstrap/bootstrap-helpers.d.ts.map +1 -0
  25. package/dist/bootstrap/bootstrap-helpers.js +373 -0
  26. package/dist/bootstrap/bootstrap-helpers.js.map +1 -0
  27. package/dist/bootstrap/generate-types.d.ts +7 -0
  28. package/dist/bootstrap/generate-types.d.ts.map +1 -0
  29. package/dist/bootstrap/generate-types.js +832 -0
  30. package/dist/bootstrap/generate-types.js.map +1 -0
  31. package/dist/bootstrap/phases/assemble/index.d.ts +5 -0
  32. package/dist/bootstrap/phases/assemble/index.d.ts.map +1 -0
  33. package/dist/bootstrap/phases/assemble/index.js +5 -0
  34. package/dist/bootstrap/phases/assemble/index.js.map +1 -0
  35. package/dist/bootstrap/phases/assemble/load-links.d.ts +3 -0
  36. package/dist/bootstrap/phases/assemble/load-links.d.ts.map +1 -0
  37. package/dist/bootstrap/phases/assemble/load-links.js +160 -0
  38. package/dist/bootstrap/phases/assemble/load-links.js.map +1 -0
  39. package/dist/bootstrap/phases/assemble/load-modules.d.ts +3 -0
  40. package/dist/bootstrap/phases/assemble/load-modules.d.ts.map +1 -0
  41. package/dist/bootstrap/phases/assemble/load-modules.js +163 -0
  42. package/dist/bootstrap/phases/assemble/load-modules.js.map +1 -0
  43. package/dist/bootstrap/phases/assemble/load-resources.d.ts +3 -0
  44. package/dist/bootstrap/phases/assemble/load-resources.d.ts.map +1 -0
  45. package/dist/bootstrap/phases/assemble/load-resources.js +270 -0
  46. package/dist/bootstrap/phases/assemble/load-resources.js.map +1 -0
  47. package/dist/bootstrap/phases/assemble/wire-commands.d.ts +3 -0
  48. package/dist/bootstrap/phases/assemble/wire-commands.d.ts.map +1 -0
  49. package/dist/bootstrap/phases/assemble/wire-commands.js +408 -0
  50. package/dist/bootstrap/phases/assemble/wire-commands.js.map +1 -0
  51. package/dist/bootstrap/phases/assemble-modules.d.ts +3 -0
  52. package/dist/bootstrap/phases/assemble-modules.d.ts.map +1 -0
  53. package/dist/bootstrap/phases/assemble-modules.js +14 -0
  54. package/dist/bootstrap/phases/assemble-modules.js.map +1 -0
  55. package/dist/bootstrap/phases/build-app.d.ts +3 -0
  56. package/dist/bootstrap/phases/build-app.d.ts.map +1 -0
  57. package/dist/bootstrap/phases/build-app.js +15 -0
  58. package/dist/bootstrap/phases/build-app.js.map +1 -0
  59. package/dist/bootstrap/phases/discover-resources.d.ts +3 -0
  60. package/dist/bootstrap/phases/discover-resources.d.ts.map +1 -0
  61. package/dist/bootstrap/phases/discover-resources.js +60 -0
  62. package/dist/bootstrap/phases/discover-resources.js.map +1 -0
  63. package/dist/bootstrap/phases/index.d.ts +7 -0
  64. package/dist/bootstrap/phases/index.d.ts.map +1 -0
  65. package/dist/bootstrap/phases/index.js +7 -0
  66. package/dist/bootstrap/phases/index.js.map +1 -0
  67. package/dist/bootstrap/phases/init-infra.d.ts +3 -0
  68. package/dist/bootstrap/phases/init-infra.d.ts.map +1 -0
  69. package/dist/bootstrap/phases/init-infra.js +193 -0
  70. package/dist/bootstrap/phases/init-infra.js.map +1 -0
  71. package/dist/bootstrap/phases/seed-dev-users.d.ts +3 -0
  72. package/dist/bootstrap/phases/seed-dev-users.d.ts.map +1 -0
  73. package/dist/bootstrap/phases/seed-dev-users.js +93 -0
  74. package/dist/bootstrap/phases/seed-dev-users.js.map +1 -0
  75. package/dist/bootstrap/phases/wire/auth-helpers.d.ts +12 -0
  76. package/dist/bootstrap/phases/wire/auth-helpers.d.ts.map +1 -0
  77. package/dist/bootstrap/phases/wire/auth-helpers.js +25 -0
  78. package/dist/bootstrap/phases/wire/auth-helpers.js.map +1 -0
  79. package/dist/bootstrap/phases/wire/contexts/context-registry.d.ts +4 -0
  80. package/dist/bootstrap/phases/wire/contexts/context-registry.d.ts.map +1 -0
  81. package/dist/bootstrap/phases/wire/contexts/context-registry.js +96 -0
  82. package/dist/bootstrap/phases/wire/contexts/context-registry.js.map +1 -0
  83. package/dist/bootstrap/phases/wire/contexts/cqrs-routes.d.ts +3 -0
  84. package/dist/bootstrap/phases/wire/contexts/cqrs-routes.d.ts.map +1 -0
  85. package/dist/bootstrap/phases/wire/contexts/cqrs-routes.js +138 -0
  86. package/dist/bootstrap/phases/wire/contexts/cqrs-routes.js.map +1 -0
  87. package/dist/bootstrap/phases/wire/contexts/index.d.ts +6 -0
  88. package/dist/bootstrap/phases/wire/contexts/index.d.ts.map +1 -0
  89. package/dist/bootstrap/phases/wire/contexts/index.js +6 -0
  90. package/dist/bootstrap/phases/wire/contexts/index.js.map +1 -0
  91. package/dist/bootstrap/phases/wire/contexts/query-endpoints.d.ts +3 -0
  92. package/dist/bootstrap/phases/wire/contexts/query-endpoints.d.ts.map +1 -0
  93. package/dist/bootstrap/phases/wire/contexts/query-endpoints.js +116 -0
  94. package/dist/bootstrap/phases/wire/contexts/query-endpoints.js.map +1 -0
  95. package/dist/bootstrap/phases/wire/contexts/spa-warnings.d.ts +3 -0
  96. package/dist/bootstrap/phases/wire/contexts/spa-warnings.d.ts.map +1 -0
  97. package/dist/bootstrap/phases/wire/contexts/spa-warnings.js +17 -0
  98. package/dist/bootstrap/phases/wire/contexts/spa-warnings.js.map +1 -0
  99. package/dist/bootstrap/phases/wire/contexts/user-routes.d.ts +3 -0
  100. package/dist/bootstrap/phases/wire/contexts/user-routes.d.ts.map +1 -0
  101. package/dist/bootstrap/phases/wire/contexts/user-routes.js +83 -0
  102. package/dist/bootstrap/phases/wire/contexts/user-routes.js.map +1 -0
  103. package/dist/bootstrap/phases/wire/index.d.ts +5 -0
  104. package/dist/bootstrap/phases/wire/index.d.ts.map +1 -0
  105. package/dist/bootstrap/phases/wire/index.js +5 -0
  106. package/dist/bootstrap/phases/wire/index.js.map +1 -0
  107. package/dist/bootstrap/phases/wire/wire-adapter.d.ts +12 -0
  108. package/dist/bootstrap/phases/wire/wire-adapter.d.ts.map +1 -0
  109. package/dist/bootstrap/phases/wire/wire-adapter.js +156 -0
  110. package/dist/bootstrap/phases/wire/wire-adapter.js.map +1 -0
  111. package/dist/bootstrap/phases/wire/wire-auth.d.ts +3 -0
  112. package/dist/bootstrap/phases/wire/wire-auth.d.ts.map +1 -0
  113. package/dist/bootstrap/phases/wire/wire-auth.js +46 -0
  114. package/dist/bootstrap/phases/wire/wire-auth.js.map +1 -0
  115. package/dist/bootstrap/phases/wire/wire-contexts.d.ts +3 -0
  116. package/dist/bootstrap/phases/wire/wire-contexts.d.ts.map +1 -0
  117. package/dist/bootstrap/phases/wire/wire-contexts.js +15 -0
  118. package/dist/bootstrap/phases/wire/wire-contexts.js.map +1 -0
  119. package/dist/bootstrap/phases/wire/wire-cron-routes.d.ts +3 -0
  120. package/dist/bootstrap/phases/wire/wire-cron-routes.d.ts.map +1 -0
  121. package/dist/bootstrap/phases/wire/wire-cron-routes.js +102 -0
  122. package/dist/bootstrap/phases/wire/wire-cron-routes.js.map +1 -0
  123. package/dist/bootstrap/phases/wire/wire-extras.d.ts +3 -0
  124. package/dist/bootstrap/phases/wire/wire-extras.d.ts.map +1 -0
  125. package/dist/bootstrap/phases/wire/wire-extras.js +305 -0
  126. package/dist/bootstrap/phases/wire/wire-extras.js.map +1 -0
  127. package/dist/bootstrap/phases/wire/wire-workflow-routes.d.ts +3 -0
  128. package/dist/bootstrap/phases/wire/wire-workflow-routes.d.ts.map +1 -0
  129. package/dist/bootstrap/phases/wire/wire-workflow-routes.js +212 -0
  130. package/dist/bootstrap/phases/wire/wire-workflow-routes.js.map +1 -0
  131. package/dist/bootstrap/phases/wire-http.d.ts +3 -0
  132. package/dist/bootstrap/phases/wire-http.d.ts.map +1 -0
  133. package/dist/bootstrap/phases/wire-http.js +10 -0
  134. package/dist/bootstrap/phases/wire-http.js.map +1 -0
  135. package/dist/bootstrap/validate-generated-ts.d.ts +6 -0
  136. package/dist/bootstrap/validate-generated-ts.d.ts.map +1 -0
  137. package/dist/bootstrap/validate-generated-ts.js +26 -0
  138. package/dist/bootstrap/validate-generated-ts.js.map +1 -0
  139. package/dist/build/generate-manifest.d.ts +10 -0
  140. package/dist/build/generate-manifest.d.ts.map +1 -0
  141. package/dist/build/generate-manifest.js +138 -0
  142. package/dist/build/generate-manifest.js.map +1 -0
  143. package/dist/cli.d.ts +3 -0
  144. package/dist/cli.d.ts.map +1 -0
  145. package/dist/cli.js +421 -0
  146. package/dist/cli.js.map +1 -0
  147. package/dist/commands/build.d.ts +21 -0
  148. package/dist/commands/build.d.ts.map +1 -0
  149. package/dist/commands/build.js +399 -0
  150. package/dist/commands/build.js.map +1 -0
  151. package/dist/commands/db/create.d.ts +17 -0
  152. package/dist/commands/db/create.d.ts.map +1 -0
  153. package/dist/commands/db/create.js +94 -0
  154. package/dist/commands/db/create.js.map +1 -0
  155. package/dist/commands/db/diff.d.ts +39 -0
  156. package/dist/commands/db/diff.d.ts.map +1 -0
  157. package/dist/commands/db/diff.js +81 -0
  158. package/dist/commands/db/diff.js.map +1 -0
  159. package/dist/commands/db/generate.d.ts +58 -0
  160. package/dist/commands/db/generate.d.ts.map +1 -0
  161. package/dist/commands/db/generate.js +138 -0
  162. package/dist/commands/db/generate.js.map +1 -0
  163. package/dist/commands/db/migrate.d.ts +29 -0
  164. package/dist/commands/db/migrate.d.ts.map +1 -0
  165. package/dist/commands/db/migrate.js +118 -0
  166. package/dist/commands/db/migrate.js.map +1 -0
  167. package/dist/commands/db/pg-deps.d.ts +30 -0
  168. package/dist/commands/db/pg-deps.d.ts.map +1 -0
  169. package/dist/commands/db/pg-deps.js +178 -0
  170. package/dist/commands/db/pg-deps.js.map +1 -0
  171. package/dist/commands/db/rollback.d.ts +21 -0
  172. package/dist/commands/db/rollback.d.ts.map +1 -0
  173. package/dist/commands/db/rollback.js +85 -0
  174. package/dist/commands/db/rollback.js.map +1 -0
  175. package/dist/commands/db/types.d.ts +113 -0
  176. package/dist/commands/db/types.d.ts.map +1 -0
  177. package/dist/commands/db/types.js +4 -0
  178. package/dist/commands/db/types.js.map +1 -0
  179. package/dist/commands/dev.d.ts +12 -0
  180. package/dist/commands/dev.d.ts.map +1 -0
  181. package/dist/commands/dev.js +79 -0
  182. package/dist/commands/dev.js.map +1 -0
  183. package/dist/commands/exec.d.ts +21 -0
  184. package/dist/commands/exec.d.ts.map +1 -0
  185. package/dist/commands/exec.js +148 -0
  186. package/dist/commands/exec.js.map +1 -0
  187. package/dist/commands/generate.d.ts +11 -0
  188. package/dist/commands/generate.d.ts.map +1 -0
  189. package/dist/commands/generate.js +19 -0
  190. package/dist/commands/generate.js.map +1 -0
  191. package/dist/commands/init.d.ts +14 -0
  192. package/dist/commands/init.d.ts.map +1 -0
  193. package/dist/commands/init.js +476 -0
  194. package/dist/commands/init.js.map +1 -0
  195. package/dist/commands/start.d.ts +15 -0
  196. package/dist/commands/start.d.ts.map +1 -0
  197. package/dist/commands/start.js +121 -0
  198. package/dist/commands/start.js.map +1 -0
  199. package/dist/commands/user.d.ts +19 -0
  200. package/dist/commands/user.d.ts.map +1 -0
  201. package/dist/commands/user.js +125 -0
  202. package/dist/commands/user.js.map +1 -0
  203. package/dist/config/load-config.d.ts +23 -0
  204. package/dist/config/load-config.d.ts.map +1 -0
  205. package/dist/config/load-config.js +105 -0
  206. package/dist/config/load-config.js.map +1 -0
  207. package/dist/config/load-env.d.ts +11 -0
  208. package/dist/config/load-env.d.ts.map +1 -0
  209. package/dist/config/load-env.js +61 -0
  210. package/dist/config/load-env.js.map +1 -0
  211. package/dist/config/resolve-adapters.d.ts +23 -0
  212. package/dist/config/resolve-adapters.d.ts.map +1 -0
  213. package/dist/config/resolve-adapters.js +96 -0
  214. package/dist/config/resolve-adapters.js.map +1 -0
  215. package/dist/index.d.ts +18 -0
  216. package/dist/index.d.ts.map +1 -0
  217. package/dist/index.js +19 -0
  218. package/dist/index.js.map +1 -0
  219. package/dist/jiti.d.ts +2 -0
  220. package/dist/jiti.d.ts.map +1 -0
  221. package/dist/jiti.js +2 -0
  222. package/dist/jiti.js.map +1 -0
  223. package/dist/openapi/generate-spec.d.ts +56 -0
  224. package/dist/openapi/generate-spec.d.ts.map +1 -0
  225. package/dist/openapi/generate-spec.js +491 -0
  226. package/dist/openapi/generate-spec.js.map +1 -0
  227. package/dist/openapi/index.d.ts +4 -0
  228. package/dist/openapi/index.d.ts.map +1 -0
  229. package/dist/openapi/index.js +3 -0
  230. package/dist/openapi/index.js.map +1 -0
  231. package/dist/openapi/swagger-html.d.ts +2 -0
  232. package/dist/openapi/swagger-html.d.ts.map +1 -0
  233. package/dist/openapi/swagger-html.js +29 -0
  234. package/dist/openapi/swagger-html.js.map +1 -0
  235. package/dist/plugins/merge-resources.d.ts +18 -0
  236. package/dist/plugins/merge-resources.d.ts.map +1 -0
  237. package/dist/plugins/merge-resources.js +76 -0
  238. package/dist/plugins/merge-resources.js.map +1 -0
  239. package/dist/plugins/resolve-plugins.d.ts +14 -0
  240. package/dist/plugins/resolve-plugins.d.ts.map +1 -0
  241. package/dist/plugins/resolve-plugins.js +73 -0
  242. package/dist/plugins/resolve-plugins.js.map +1 -0
  243. package/dist/resource-loader.d.ts +151 -0
  244. package/dist/resource-loader.d.ts.map +1 -0
  245. package/dist/resource-loader.js +456 -0
  246. package/dist/resource-loader.js.map +1 -0
  247. package/dist/route-discovery.d.ts +33 -0
  248. package/dist/route-discovery.d.ts.map +1 -0
  249. package/dist/route-discovery.js +69 -0
  250. package/dist/route-discovery.js.map +1 -0
  251. package/dist/server-bootstrap.d.ts +38 -0
  252. package/dist/server-bootstrap.d.ts.map +1 -0
  253. package/dist/server-bootstrap.js +21 -0
  254. package/dist/server-bootstrap.js.map +1 -0
  255. package/dist/spa/generate-spa.d.ts +15 -0
  256. package/dist/spa/generate-spa.d.ts.map +1 -0
  257. package/dist/spa/generate-spa.js +357 -0
  258. package/dist/spa/generate-spa.js.map +1 -0
  259. package/dist/templates/agent/nextjs.md +129 -0
  260. package/dist/templates/agent/nuxt.md +98 -0
  261. package/dist/templates/agent/standalone.md +498 -0
  262. package/dist/types.d.ts +145 -0
  263. package/dist/types.d.ts.map +1 -0
  264. package/dist/types.js +3 -0
  265. package/dist/types.js.map +1 -0
  266. package/dist/utils/colors.d.ts +7 -0
  267. package/dist/utils/colors.d.ts.map +1 -0
  268. package/dist/utils/colors.js +8 -0
  269. package/dist/utils/colors.js.map +1 -0
  270. package/dist/utils/logger.d.ts +10 -0
  271. package/dist/utils/logger.d.ts.map +1 -0
  272. package/dist/utils/logger.js +27 -0
  273. package/dist/utils/logger.js.map +1 -0
  274. package/dist/utils/prompts.d.ts +6 -0
  275. package/dist/utils/prompts.d.ts.map +1 -0
  276. package/dist/utils/prompts.js +28 -0
  277. package/dist/utils/prompts.js.map +1 -0
  278. package/dist/utils/spinner.d.ts +7 -0
  279. package/dist/utils/spinner.d.ts.map +1 -0
  280. package/dist/utils/spinner.js +20 -0
  281. package/dist/utils/spinner.js.map +1 -0
  282. package/package.json +80 -0
@@ -0,0 +1,491 @@
1
+ // OpenAPI 3.1 spec generator — reflects Manta's CQRS architecture:
2
+ // Commands (mutations via POST /api/command/{name}) and Query Graph (reads via GET /api/query/{entity}).
3
+ // Zero manual annotation required.
4
+ import { zodToJsonSchema } from '@mantajs/core';
5
+ // ── Main generator ───────────────────────────────────────────────────
6
+ export function generateOpenApiSpec(options) {
7
+ const basePath = options.basePath ?? '/api';
8
+ const tags = new Map();
9
+ const spec = {
10
+ openapi: '3.1.0',
11
+ info: {
12
+ title: options.title ?? 'Manta API',
13
+ version: options.version ?? '1.0.0',
14
+ description: options.description ??
15
+ 'Auto-generated from Manta CQRS architecture. Commands = mutations, Query Graph = reads.',
16
+ },
17
+ paths: {},
18
+ components: {
19
+ schemas: {},
20
+ securitySchemes: {
21
+ bearerAuth: {
22
+ type: 'http',
23
+ scheme: 'bearer',
24
+ bearerFormat: 'JWT',
25
+ },
26
+ apiKeyAuth: {
27
+ type: 'apiKey',
28
+ in: 'header',
29
+ name: 'x-api-key',
30
+ },
31
+ },
32
+ },
33
+ tags: [],
34
+ };
35
+ // ── 1. Command endpoints (mutations) ───────────────────────────────
36
+ if (options.commands && options.commands.length > 0) {
37
+ tags.set('Commands', 'Mutation endpoints — execute business logic via defineCommand()');
38
+ for (const cmd of options.commands) {
39
+ const pathKey = `${basePath}/command/${cmd.name}`;
40
+ spec.paths[pathKey] = {
41
+ post: {
42
+ summary: cmd.description,
43
+ description: `Execute the \`${cmd.name}\` command. Input is validated against the Zod schema defined in defineCommand().`,
44
+ tags: ['Commands'],
45
+ operationId: `command_${cmd.name.replace(/-/g, '_')}`,
46
+ requestBody: {
47
+ required: true,
48
+ content: {
49
+ 'application/json': {
50
+ schema: zodToJsonSchema(cmd.inputSchema),
51
+ },
52
+ },
53
+ },
54
+ responses: {
55
+ '200': {
56
+ description: 'Command executed successfully',
57
+ content: {
58
+ 'application/json': {
59
+ schema: {
60
+ type: 'object',
61
+ properties: {
62
+ result: { type: 'object', description: 'Command result data' },
63
+ },
64
+ },
65
+ },
66
+ },
67
+ },
68
+ '400': {
69
+ description: 'Invalid input — Zod validation failed',
70
+ content: {
71
+ 'application/json': {
72
+ schema: { $ref: '#/components/schemas/MantaError' },
73
+ },
74
+ },
75
+ },
76
+ '401': { description: 'Unauthorized — missing or invalid JWT' },
77
+ '500': { description: 'Internal server error' },
78
+ },
79
+ security: [{ bearerAuth: [] }, { apiKeyAuth: [] }],
80
+ },
81
+ };
82
+ }
83
+ }
84
+ // ── 2. Query Graph endpoints (reads) ───────────────────────────────
85
+ if (options.entities && options.entities.length > 0) {
86
+ tags.set('Query', 'Read endpoints — auto-generated from DML entities via the Query Graph');
87
+ for (const entity of options.entities) {
88
+ const entityLower = entity.name.charAt(0).toLowerCase() + entity.name.slice(1);
89
+ const plural = pluralize(entityLower);
90
+ const tagName = entity.name;
91
+ tags.set(tagName, `CRUD reads for ${entity.name} entity`);
92
+ // Generate component schema for this entity
93
+ spec.components.schemas[entity.name] = entityFieldsToJsonSchema(entity);
94
+ // GET /api/query/{entity} — list with filters + pagination
95
+ const listPath = `${basePath}/query/${entityLower}`;
96
+ spec.paths[listPath] = {
97
+ get: {
98
+ summary: `List ${entity.name} records`,
99
+ description: `Query the ${entity.name} entity via the Query Graph. Supports filtering, pagination, field selection, and ordering.`,
100
+ tags: ['Query', tagName],
101
+ operationId: `list_${entityLower}`,
102
+ parameters: [...buildQueryParameters(), ...buildFilterParameters(entity)],
103
+ responses: {
104
+ '200': {
105
+ description: `List of ${entity.name} records`,
106
+ content: {
107
+ 'application/json': {
108
+ schema: {
109
+ type: 'object',
110
+ properties: {
111
+ [plural]: {
112
+ type: 'array',
113
+ items: { $ref: `#/components/schemas/${entity.name}` },
114
+ },
115
+ count: { type: 'integer', description: 'Total number of matching records' },
116
+ },
117
+ required: [plural, 'count'],
118
+ },
119
+ },
120
+ },
121
+ },
122
+ '400': {
123
+ description: 'Invalid query parameters',
124
+ content: {
125
+ 'application/json': {
126
+ schema: { $ref: '#/components/schemas/MantaError' },
127
+ },
128
+ },
129
+ },
130
+ '401': { description: 'Unauthorized' },
131
+ },
132
+ security: [{ bearerAuth: [] }, { apiKeyAuth: [] }],
133
+ },
134
+ };
135
+ // GET /api/query/{entity}/{id} — get by ID
136
+ const detailPath = `${basePath}/query/${entityLower}/{id}`;
137
+ spec.paths[detailPath] = {
138
+ get: {
139
+ summary: `Get ${entity.name} by ID`,
140
+ description: `Retrieve a single ${entity.name} record by its unique identifier.`,
141
+ tags: ['Query', tagName],
142
+ operationId: `get_${entityLower}`,
143
+ parameters: [
144
+ {
145
+ name: 'id',
146
+ in: 'path',
147
+ required: true,
148
+ schema: { type: 'string', format: 'uuid' },
149
+ description: `Unique identifier of the ${entity.name}`,
150
+ },
151
+ {
152
+ name: 'fields',
153
+ in: 'query',
154
+ required: false,
155
+ schema: { type: 'string' },
156
+ description: 'Comma-separated list of fields to return',
157
+ example: buildFieldsExample(entity),
158
+ },
159
+ ],
160
+ responses: {
161
+ '200': {
162
+ description: `${entity.name} record`,
163
+ content: {
164
+ 'application/json': {
165
+ schema: {
166
+ type: 'object',
167
+ properties: {
168
+ data: { $ref: `#/components/schemas/${entity.name}` },
169
+ },
170
+ required: ['data'],
171
+ },
172
+ },
173
+ },
174
+ },
175
+ '404': {
176
+ description: 'Not found',
177
+ content: {
178
+ 'application/json': {
179
+ schema: { $ref: '#/components/schemas/MantaError' },
180
+ },
181
+ },
182
+ },
183
+ '401': { description: 'Unauthorized' },
184
+ },
185
+ security: [{ bearerAuth: [] }, { apiKeyAuth: [] }],
186
+ },
187
+ };
188
+ }
189
+ }
190
+ // ── 3. Auth routes (auto-generated per defineUserModel context) ──────────
191
+ // V2: auth routes are per-context (/api/{ctx}/login, /api/{ctx}/me, etc.)
192
+ // They are dynamically generated from defineUserModel — not hardcoded here.
193
+ // TODO: Populate from discovered user definitions for accurate OpenAPI spec.
194
+ const authRoutes = [];
195
+ tags.set('Auth', 'Authentication — register, login, JWT management');
196
+ for (const route of authRoutes) {
197
+ const pathKey = route.path;
198
+ if (!spec.paths[pathKey])
199
+ spec.paths[pathKey] = {};
200
+ const operation = {
201
+ summary: route.summary,
202
+ tags: ['Auth'],
203
+ operationId: `auth_${route.path.split('/').pop()?.replace(/-/g, '_')}`,
204
+ responses: {
205
+ '200': {
206
+ description: 'Successful response',
207
+ content: { 'application/json': { schema: { type: 'object' } } },
208
+ },
209
+ '400': {
210
+ description: 'Invalid request',
211
+ content: { 'application/json': { schema: { $ref: '#/components/schemas/MantaError' } } },
212
+ },
213
+ '401': { description: 'Unauthorized' },
214
+ },
215
+ };
216
+ if (route.auth) {
217
+ operation.security = [{ bearerAuth: [] }];
218
+ }
219
+ spec.paths[pathKey][route.method.toLowerCase()] = operation;
220
+ }
221
+ // ── 4. Static routes (src/api/ — edge cases) ──────────────────────
222
+ if (options.routes && options.routes.length > 0) {
223
+ tags.set('Custom', 'Custom static routes from src/api/');
224
+ for (const route of options.routes) {
225
+ const pathKey = route.path.replace(/:(\w+)/g, '{$1}').replace(/\*\*/g, '{path}');
226
+ if (!spec.paths[pathKey])
227
+ spec.paths[pathKey] = {};
228
+ const operation = {
229
+ summary: route.summary ?? `${route.method.toUpperCase()} ${route.path}`,
230
+ tags: route.tags ?? ['Custom'],
231
+ };
232
+ // Extract path parameters
233
+ const paramMatches = route.path.matchAll(/:(\w+)/g);
234
+ const parameters = [];
235
+ for (const match of paramMatches) {
236
+ parameters.push({
237
+ name: match[1],
238
+ in: 'path',
239
+ required: true,
240
+ schema: { type: 'string' },
241
+ });
242
+ }
243
+ if (parameters.length > 0)
244
+ operation.parameters = parameters;
245
+ // Add request body if POST/PUT/PATCH
246
+ if (['POST', 'PUT', 'PATCH'].includes(route.method.toUpperCase()) && route.bodySchema) {
247
+ operation.requestBody = {
248
+ required: true,
249
+ content: {
250
+ 'application/json': {
251
+ schema: zodToJsonSchema(route.bodySchema),
252
+ },
253
+ },
254
+ };
255
+ }
256
+ operation.responses = {
257
+ '200': {
258
+ description: 'Successful response',
259
+ content: {
260
+ 'application/json': {
261
+ schema: route.responseSchema ? zodToJsonSchema(route.responseSchema) : { type: 'object' },
262
+ },
263
+ },
264
+ },
265
+ '400': {
266
+ description: 'Invalid request',
267
+ content: { 'application/json': { schema: { $ref: '#/components/schemas/MantaError' } } },
268
+ },
269
+ };
270
+ if (route.auth !== false) {
271
+ operation.security = [{ bearerAuth: [] }, { apiKeyAuth: [] }];
272
+ }
273
+ spec.paths[pathKey][route.method.toLowerCase()] = operation;
274
+ }
275
+ }
276
+ // ── 5. Shared component schemas ────────────────────────────────────
277
+ spec.components.schemas.MantaError = {
278
+ type: 'object',
279
+ description: 'Standard Manta error response',
280
+ properties: {
281
+ type: {
282
+ type: 'string',
283
+ description: 'Error type code',
284
+ example: 'INVALID_DATA',
285
+ enum: [
286
+ 'INVALID_DATA',
287
+ 'NOT_FOUND',
288
+ 'DUPLICATE_ERROR',
289
+ 'UNAUTHORIZED',
290
+ 'FORBIDDEN',
291
+ 'UNEXPECTED_STATE',
292
+ 'CONFLICT',
293
+ ],
294
+ },
295
+ message: { type: 'string', description: 'Human-readable error message', example: 'Validation failed' },
296
+ code: { type: 'string', description: 'Optional machine-readable code' },
297
+ details: { type: 'object', description: 'Additional error details (e.g. Zod validation errors)' },
298
+ },
299
+ required: ['type', 'message'],
300
+ };
301
+ spec.components.schemas.PaginationParams = {
302
+ type: 'object',
303
+ description: 'Standard pagination parameters for Query Graph endpoints',
304
+ properties: {
305
+ limit: { type: 'integer', default: 100, maximum: 10000, minimum: 1, description: 'Max records to return' },
306
+ offset: { type: 'integer', default: 0, minimum: 0, description: 'Number of records to skip' },
307
+ order: { type: 'string', description: 'Sort order. Prefix with - for descending.', example: '-created_at' },
308
+ },
309
+ };
310
+ // ── 6. Build tags array ────────────────────────────────────────────
311
+ // Order: Commands first, then Query, then entity-specific, then Auth, then Custom
312
+ const tagOrder = ['Commands', 'Query'];
313
+ const entityTags = [...tags.keys()].filter((t) => !['Commands', 'Query', 'Auth', 'Custom'].includes(t));
314
+ entityTags.sort();
315
+ tagOrder.push(...entityTags, 'Auth', 'Custom');
316
+ for (const name of tagOrder) {
317
+ const description = tags.get(name);
318
+ if (description) {
319
+ spec.tags.push({ name, description });
320
+ }
321
+ }
322
+ return spec;
323
+ }
324
+ // ── Helper: build standard query parameters ──────────────────────────
325
+ function buildQueryParameters() {
326
+ return [
327
+ {
328
+ name: 'limit',
329
+ in: 'query',
330
+ required: false,
331
+ schema: { type: 'integer', default: 100, maximum: 10000, minimum: 1 },
332
+ description: 'Maximum number of records to return',
333
+ },
334
+ {
335
+ name: 'offset',
336
+ in: 'query',
337
+ required: false,
338
+ schema: { type: 'integer', default: 0, minimum: 0 },
339
+ description: 'Number of records to skip for pagination',
340
+ },
341
+ {
342
+ name: 'order',
343
+ in: 'query',
344
+ required: false,
345
+ schema: { type: 'string' },
346
+ description: 'Sort order. Use field name for ascending, prefix with - for descending.',
347
+ example: '-created_at',
348
+ },
349
+ {
350
+ name: 'fields',
351
+ in: 'query',
352
+ required: false,
353
+ schema: { type: 'string' },
354
+ description: 'Comma-separated list of fields to return (default: all)',
355
+ },
356
+ {
357
+ name: 'withDeleted',
358
+ in: 'query',
359
+ required: false,
360
+ schema: { type: 'boolean', default: false },
361
+ description: 'Include soft-deleted records',
362
+ },
363
+ ];
364
+ }
365
+ // ── Helper: build filter parameters from entity fields ───────────────
366
+ function buildFilterParameters(entity) {
367
+ const params = [];
368
+ for (const field of entity.fields) {
369
+ const mapped = mapDmlTypeToJsonSchema(field.type);
370
+ params.push({
371
+ name: `filter[${field.name}]`,
372
+ in: 'query',
373
+ required: false,
374
+ schema: mapped.schema,
375
+ description: `Filter by ${field.name}${field.values ? ` (values: ${JSON.stringify(field.values)})` : ''}`,
376
+ });
377
+ }
378
+ return params;
379
+ }
380
+ // ── Helper: build fields example string ──────────────────────────────
381
+ function buildFieldsExample(entity) {
382
+ const fieldNames = ['id', ...entity.fields.slice(0, 3).map((f) => f.name)];
383
+ return fieldNames.join(',');
384
+ }
385
+ // ── Helper: pluralize entity name ────────────────────────────────────
386
+ function pluralize(name) {
387
+ if (name.endsWith('s') || name.endsWith('x') || name.endsWith('ch') || name.endsWith('sh')) {
388
+ return `${name}es`;
389
+ }
390
+ if (name.endsWith('y') && !/[aeiou]y$/i.test(name)) {
391
+ return `${name.slice(0, -1)}ies`;
392
+ }
393
+ return `${name}s`;
394
+ }
395
+ function mapDmlTypeToJsonSchema(dmlType) {
396
+ switch (dmlType) {
397
+ case 'text':
398
+ return { schema: { type: 'string' }, example: 'Example text' };
399
+ case 'number':
400
+ return { schema: { type: 'integer' }, example: 42 };
401
+ case 'float':
402
+ return { schema: { type: 'number' }, example: 19.99 };
403
+ case 'boolean':
404
+ return { schema: { type: 'boolean' }, example: true };
405
+ case 'bigNumber':
406
+ return { schema: { type: 'string', description: 'Numeric string for precision' }, example: '99999999.99' };
407
+ case 'dateTime':
408
+ return { schema: { type: 'string', format: 'date-time' }, example: '2026-01-15T10:30:00Z' };
409
+ case 'json':
410
+ return { schema: { type: 'object' }, example: {} };
411
+ case 'array':
412
+ return { schema: { type: 'array', items: {} } };
413
+ case 'enum':
414
+ return { schema: { type: 'string' } };
415
+ case 'id':
416
+ return { schema: { type: 'string', format: 'uuid' }, example: 'prod_01H...' };
417
+ case 'serial':
418
+ case 'autoincrement':
419
+ return { schema: { type: 'integer' }, example: 1 };
420
+ default:
421
+ return { schema: { type: 'string' } };
422
+ }
423
+ }
424
+ // ── Helper: convert entity fields to JSON Schema ─────────────────────
425
+ function entityFieldsToJsonSchema(entity) {
426
+ const properties = {};
427
+ const required = ['id'];
428
+ // Implicit ID field
429
+ properties.id = { type: 'string', format: 'uuid', description: 'Unique identifier', example: 'prod_01H...' };
430
+ for (const field of entity.fields) {
431
+ const mapped = mapDmlTypeToJsonSchema(field.type);
432
+ const propSchema = { ...mapped.schema };
433
+ if (mapped.example !== undefined) {
434
+ propSchema.example = mapped.example;
435
+ }
436
+ // Handle enum values
437
+ if (field.type === 'enum' && field.values) {
438
+ const values = Array.isArray(field.values) ? field.values : Object.values(field.values);
439
+ const stringValues = values.filter((v) => typeof v === 'string');
440
+ if (stringValues.length > 0) {
441
+ propSchema.enum = stringValues;
442
+ propSchema.example = stringValues[0];
443
+ }
444
+ }
445
+ if (field.nullable) {
446
+ propSchema.nullable = true;
447
+ }
448
+ properties[field.name] = propSchema;
449
+ if (!field.nullable) {
450
+ required.push(field.name);
451
+ }
452
+ }
453
+ // Implicit timestamp fields
454
+ properties.created_at = { type: 'string', format: 'date-time', description: 'Creation timestamp' };
455
+ properties.updated_at = { type: 'string', format: 'date-time', description: 'Last update timestamp' };
456
+ properties.deleted_at = { type: 'string', format: 'date-time', nullable: true, description: 'Soft-delete timestamp' };
457
+ required.push('created_at', 'updated_at');
458
+ return {
459
+ type: 'object',
460
+ properties,
461
+ required,
462
+ };
463
+ }
464
+ // ── Helper: parse DML entity schema into OpenApiEntityField[] ────────
465
+ // Called by bootstrap to extract field metadata from raw DmlEntity.schema
466
+ // (where values are property class instances with a parse() method).
467
+ export function parseDmlEntityFields(schema) {
468
+ const fields = [];
469
+ for (const [fieldName, value] of Object.entries(schema)) {
470
+ const v = value;
471
+ // Skip relations
472
+ if (v?.__dmlRelation === true)
473
+ continue;
474
+ // Skip values without parse method (not a DML property)
475
+ if (typeof v?.parse !== 'function')
476
+ continue;
477
+ const meta = v.parse(fieldName);
478
+ // Skip computed fields
479
+ if (meta.computed)
480
+ continue;
481
+ const dataType = meta.dataType;
482
+ fields.push({
483
+ name: fieldName,
484
+ type: dataType?.name ?? 'text',
485
+ nullable: meta.nullable || false,
486
+ values: meta.values,
487
+ });
488
+ }
489
+ return fields;
490
+ }
491
+ //# sourceMappingURL=generate-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-spec.js","sourceRoot":"","sources":["../../src/openap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AAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACxD,MAAM,CAAC,GAAG,KAAgC,CAAA;QAC1C,iBAAiB;QACjB,IAAI,CAAC,EAAE,aAAa,KAAK,IAAI;YAAE,SAAQ;QACvC,wDAAwD;QACxD,IAAI,OAAO,CAAC,EAAE,KAAK,KAAK,UAAU;YAAE,SAAQ;QAE5C,MAAM,IAAI,GAAI,CAAC,CAAC,KAAmD,CAAC,SAAS,CAAC,CAAA;QAC9E,uBAAuB;QACvB,IAAI,IAAI,CAAC,QAAQ;YAAE,SAAQ;QAE3B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAwC,CAAA;QAE9D,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ,EAAE,IAAI,IAAI,MAAM;YAC9B,QAAQ,EAAG,IAAI,CAAC,QAAoB,IAAI,KAAK;YAC7C,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type { GenerateOpenApiOptions, OpenApiCommand, OpenApiEntity, OpenApiEntityField, OpenApiRoute, OpenApiSpec, } from './generate-spec';
2
+ export { generateOpenApiSpec, parseDmlEntityFields } from './generate-spec';
3
+ export { getSwaggerHtml } from './swagger-html';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openapi/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,WAAW,GACZ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { generateOpenApiSpec, parseDmlEntityFields } from './generate-spec';
2
+ export { getSwaggerHtml } from './swagger-html';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openapi/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function getSwaggerHtml(specUrl: string): string;
2
+ //# sourceMappingURL=swagger-html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swagger-html.d.ts","sourceRoot":"","sources":["../../src/openapi/swagger-html.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA0BtD"}
@@ -0,0 +1,29 @@
1
+ // Swagger UI HTML page — serves the interactive API documentation.
2
+ export function getSwaggerHtml(specUrl) {
3
+ return `<!DOCTYPE html>
4
+ <html lang="en">
5
+ <head>
6
+ <meta charset="UTF-8">
7
+ <title>Manta API Docs</title>
8
+ <link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css">
9
+ <style>
10
+ body { margin: 0; padding: 0; }
11
+ .swagger-ui .topbar { display: none; }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <div id="swagger-ui"></div>
16
+ <script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
17
+ <script>
18
+ SwaggerUIBundle({
19
+ url: '${specUrl}',
20
+ dom_id: '#swagger-ui',
21
+ deepLinking: true,
22
+ presets: [SwaggerUIBundle.presets.apis, SwaggerUIBundle.SwaggerUIStandalonePreset],
23
+ layout: 'BaseLayout',
24
+ })
25
+ </script>
26
+ </body>
27
+ </html>`;
28
+ }
29
+ //# sourceMappingURL=swagger-html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swagger-html.js","sourceRoot":"","sources":["../../src/openapi/swagger-html.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO;;;;;;;;;;;;;;;;cAgBK,OAAO;;;;;;;;QAQb,CAAA;AACR,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { DiscoveredResources } from '../resource-loader';
2
+ import type { DiscoveredRoute, RouteImportFn } from '../route-discovery';
3
+ import type { ResolvedPlugin } from './resolve-plugins';
4
+ /**
5
+ * Discover resources from all plugins and merge with app resources.
6
+ * Order: plugins (in order, lowest → highest priority), then app (highest priority).
7
+ * Deduplication: last entry with the same key wins.
8
+ */
9
+ export declare function mergePluginResources(plugins: ResolvedPlugin[], appResources: DiscoveredResources, preloaded?: Array<{
10
+ name: string;
11
+ resources: DiscoveredResources;
12
+ rootDir: string;
13
+ }>): Promise<DiscoveredResources>;
14
+ /**
15
+ * Discover API routes from all plugins and the app, merged with deduplication.
16
+ */
17
+ export declare function mergePluginApiRoutes(plugins: ResolvedPlugin[], cwd: string, importFn?: RouteImportFn): Promise<DiscoveredRoute[]>;
18
+ //# sourceMappingURL=merge-resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-resources.d.ts","sourceRoot":"","sources":["../../src/plugins/merge-resources.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,cAAc,EAAE,EACzB,YAAY,EAAE,mBAAmB,EACjC,SAAS,CAAC,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,mBAAmB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GACnF,OAAO,CAAC,mBAAmB,CAAC,CAmB9B;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,cAAc,EAAE,EACzB,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,eAAe,EAAE,CAAC,CAe5B"}