@geekmidas/cli 10.0.0-alpha.11 → 10.0.0-alpha.13

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 (242) hide show
  1. package/README.md +13 -40
  2. package/dist/{HostingerProvider-BcyFRbqV.mjs → HostingerProvider-BY26bWwB.mjs} +20 -21
  3. package/dist/HostingerProvider-BY26bWwB.mjs.map +1 -0
  4. package/dist/{HostingerProvider-BOvsgATO.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
  5. package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
  6. package/dist/{LocalStateProvider-yjXZXZDM.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
  7. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
  8. package/dist/{LocalStateProvider-Bq-0C0sg.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
  9. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
  10. package/dist/{Route53Provider-C0xmer8U.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
  11. package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
  12. package/dist/{Route53Provider-CH9XH7bz.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
  13. package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
  14. package/dist/{SSMStateProvider-DOZifZfE.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
  15. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
  16. package/dist/{SSMStateProvider-CXtNgPfy.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
  17. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
  18. package/dist/{backup-provisioner-cE2PuCTb.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
  19. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
  20. package/dist/{backup-provisioner-DXXg6FIL.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
  21. package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
  22. package/dist/{bundler-CaTGtiaO.cjs → bundler-BeNDZdHQ.cjs} +10 -28
  23. package/dist/bundler-BeNDZdHQ.cjs.map +1 -0
  24. package/dist/{bundler-S3ek7ea-.mjs → bundler-BodTL4kf.mjs} +9 -26
  25. package/dist/bundler-BodTL4kf.mjs.map +1 -0
  26. package/dist/{config-HhDpJmLO.cjs → config-Q1rvKHvw.cjs} +74 -69
  27. package/dist/config-Q1rvKHvw.cjs.map +1 -0
  28. package/dist/{config-B0L2tvvC.mjs → config-pqGD3hF9.mjs} +26 -14
  29. package/dist/config-pqGD3hF9.mjs.map +1 -0
  30. package/dist/config.cjs +4 -5
  31. package/dist/config.d.cts +14 -17
  32. package/dist/config.d.cts.map +1 -1
  33. package/dist/config.d.mts +14 -17
  34. package/dist/config.d.mts.map +1 -1
  35. package/dist/config.mjs +3 -5
  36. package/dist/{credentials-CZrys9C5.mjs → credentials-BekkKtY_.mjs} +1331 -1100
  37. package/dist/credentials-BekkKtY_.mjs.map +1 -0
  38. package/dist/{credentials-B2Pyh3bJ.cjs → credentials-Q6F0uqJq.cjs} +1468 -1232
  39. package/dist/credentials-Q6F0uqJq.cjs.map +1 -0
  40. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  41. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  42. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  43. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  44. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  45. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  46. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  47. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  48. package/dist/deploy/sniffer-hooks.cjs +13 -7
  49. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  50. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  51. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  52. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  53. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  54. package/dist/deploy/sniffer-hooks.mjs +9 -2
  55. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  56. package/dist/deploy/sniffer-loader.cjs +16 -7
  57. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  58. package/dist/deploy/sniffer-loader.d.cts +1 -1
  59. package/dist/deploy/sniffer-loader.d.mts +1 -1
  60. package/dist/deploy/sniffer-loader.mjs +13 -2
  61. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  62. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  63. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  64. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  65. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  66. package/dist/deploy/sniffer-routes-worker.mjs +2 -2
  67. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  68. package/dist/deploy/sniffer-worker.cjs +15 -6
  69. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  70. package/dist/deploy/sniffer-worker.d.cts +1 -3
  71. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  72. package/dist/deploy/sniffer-worker.d.mts +1 -3
  73. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  74. package/dist/deploy/sniffer-worker.mjs +15 -4
  75. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  76. package/dist/{discover-DTmFeloL.cjs → discover-BERGFg8v.cjs} +81 -64
  77. package/dist/discover-BERGFg8v.cjs.map +1 -0
  78. package/dist/{discover-CAlFgYec.mjs → discover-CK-n3w6b.mjs} +35 -20
  79. package/dist/discover-CK-n3w6b.mjs.map +1 -0
  80. package/dist/{emit-CUD1BWls.cjs → emit-BdoPFjZf.cjs} +53 -36
  81. package/dist/emit-BdoPFjZf.cjs.map +1 -0
  82. package/dist/{emit-CIlvnDvV.mjs → emit-Bzq7JsMP.mjs} +24 -6
  83. package/dist/emit-Bzq7JsMP.mjs.map +1 -0
  84. package/dist/{fullstack-secrets-METaRLS1.mjs → fullstack-secrets-BET8gqwK.mjs} +9 -15
  85. package/dist/fullstack-secrets-BET8gqwK.mjs.map +1 -0
  86. package/dist/{fullstack-secrets-D6MyHhQP.cjs → fullstack-secrets-DXsWO-5m.cjs} +19 -38
  87. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +1 -0
  88. package/dist/{generator-VE2JrFlY.mjs → generator-LfZU7NlU.mjs} +8 -14
  89. package/dist/generator-LfZU7NlU.mjs.map +1 -0
  90. package/dist/{generator-CNzBw7g5.cjs → generator-Wdfp0jCS.cjs} +38 -45
  91. package/dist/generator-Wdfp0jCS.cjs.map +1 -0
  92. package/dist/{github-BrvaPkFf.cjs → github-BfflNPVe.cjs} +36 -30
  93. package/dist/{github-BrvaPkFf.cjs.map → github-BfflNPVe.cjs.map} +1 -1
  94. package/dist/{github-CrpsXSfV.mjs → github-CRwnxKmD.mjs} +27 -20
  95. package/dist/github-CRwnxKmD.mjs.map +1 -0
  96. package/dist/{index-CR5urhWX.d.cts → index-Cd-qeOam.d.mts} +3 -12
  97. package/dist/index-Cd-qeOam.d.mts.map +1 -0
  98. package/dist/{index-Ayxg_DQY.d.mts → index-D-iAVHx-.d.cts} +3 -12
  99. package/dist/index-D-iAVHx-.d.cts.map +1 -0
  100. package/dist/index.cjs +3320 -2961
  101. package/dist/index.cjs.map +1 -1
  102. package/dist/index.d.cts +1 -1
  103. package/dist/index.d.mts +1 -1
  104. package/dist/index.mjs +3200 -2858
  105. package/dist/index.mjs.map +1 -1
  106. package/dist/{keystore-TxeYM7an.mjs → keystore-B4PRlbgE.mjs} +5 -7
  107. package/dist/keystore-B4PRlbgE.mjs.map +1 -0
  108. package/dist/{keystore-C9rint2E.cjs → keystore-DgGRj2Yy.cjs} +23 -26
  109. package/dist/keystore-DgGRj2Yy.cjs.map +1 -0
  110. package/dist/{openapi-DaKlTKxz.cjs → openapi-Dcbme-Us.cjs} +134 -171
  111. package/dist/openapi-Dcbme-Us.cjs.map +1 -0
  112. package/dist/openapi-react-query.cjs +156 -2
  113. package/dist/openapi-react-query.cjs.map +1 -0
  114. package/dist/openapi-react-query.d.cts +1 -3
  115. package/dist/openapi-react-query.d.cts.map +1 -1
  116. package/dist/openapi-react-query.d.mts +1 -3
  117. package/dist/openapi-react-query.d.mts.map +1 -1
  118. package/dist/openapi-react-query.mjs +156 -2
  119. package/dist/openapi-react-query.mjs.map +1 -0
  120. package/dist/{openapi-y1d7Kalt.mjs → openapi-vy4JzhUv.mjs} +76 -106
  121. package/dist/openapi-vy4JzhUv.mjs.map +1 -0
  122. package/dist/openapi.cjs +3 -6
  123. package/dist/openapi.d.cts +8 -11
  124. package/dist/openapi.d.cts.map +1 -1
  125. package/dist/openapi.d.mts +8 -11
  126. package/dist/openapi.d.mts.map +1 -1
  127. package/dist/openapi.mjs +2 -6
  128. package/dist/reconcile/public.cjs +4 -4
  129. package/dist/reconcile/public.d.cts +8 -26
  130. package/dist/reconcile/public.d.cts.map +1 -1
  131. package/dist/reconcile/public.d.mts +8 -26
  132. package/dist/reconcile/public.d.mts.map +1 -1
  133. package/dist/reconcile/public.mjs +3 -4
  134. package/dist/{reconcile-CYMhFSYy.cjs → reconcile-Dd2iyILf.cjs} +4 -7
  135. package/dist/reconcile-Dd2iyILf.cjs.map +1 -0
  136. package/dist/{reconcile-C13ERt1U.mjs → reconcile-DhQ00DpU.mjs} +4 -7
  137. package/dist/reconcile-DhQ00DpU.mjs.map +1 -0
  138. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  139. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  140. package/dist/{storage-CSNplaJn.cjs → storage-C-30BD1e.cjs} +59 -69
  141. package/dist/storage-C-30BD1e.cjs.map +1 -0
  142. package/dist/{storage-B020InPW.mjs → storage-P_b3w7uj.mjs} +22 -13
  143. package/dist/storage-P_b3w7uj.mjs.map +1 -0
  144. package/dist/{sync-CzHXiR9c.mjs → sync-B3xxXtJT.mjs} +18 -6
  145. package/dist/sync-B3xxXtJT.mjs.map +1 -0
  146. package/dist/{sync-0ILCb-1S.cjs → sync-D7uTIIEi.cjs} +43 -25
  147. package/dist/sync-D7uTIIEi.cjs.map +1 -0
  148. package/dist/types-BGo5TaNE.d.mts +6164 -0
  149. package/dist/types-BGo5TaNE.d.mts.map +1 -0
  150. package/dist/types-C5ZNpUad.d.cts +6165 -0
  151. package/dist/types-C5ZNpUad.d.cts.map +1 -0
  152. package/dist/workspace/index.cjs +3 -3
  153. package/dist/workspace/index.d.cts +3 -3
  154. package/dist/workspace/index.d.mts +3 -3
  155. package/dist/workspace/index.mjs +2 -3
  156. package/dist/{workspace-DaEX7FEg.mjs → workspace-CgwmXEtc.mjs} +725 -871
  157. package/dist/workspace-CgwmXEtc.mjs.map +1 -0
  158. package/dist/{workspace-C-a3G_U0.cjs → workspace-mFpI_ky_.cjs} +894 -1041
  159. package/dist/workspace-mFpI_ky_.cjs.map +1 -0
  160. package/package.json +14 -14
  161. package/dist/CachedStateProvider-BEBl2wQT.cjs +0 -60
  162. package/dist/CachedStateProvider-BEBl2wQT.cjs.map +0 -1
  163. package/dist/CachedStateProvider-C-8wtlto.mjs +0 -3
  164. package/dist/CachedStateProvider-Co4n5Wvs.mjs +0 -54
  165. package/dist/CachedStateProvider-Co4n5Wvs.mjs.map +0 -1
  166. package/dist/CachedStateProvider-DqhGpzsm.cjs +0 -3
  167. package/dist/HostingerProvider-BOvsgATO.cjs.map +0 -1
  168. package/dist/HostingerProvider-BcyFRbqV.mjs.map +0 -1
  169. package/dist/LocalStateProvider-Bq-0C0sg.mjs.map +0 -1
  170. package/dist/LocalStateProvider-yjXZXZDM.cjs.map +0 -1
  171. package/dist/Route53Provider-C0xmer8U.mjs.map +0 -1
  172. package/dist/Route53Provider-CH9XH7bz.cjs.map +0 -1
  173. package/dist/SSMStateProvider-CXtNgPfy.cjs.map +0 -1
  174. package/dist/SSMStateProvider-DOZifZfE.mjs.map +0 -1
  175. package/dist/backup-provisioner-DXXg6FIL.mjs.map +0 -1
  176. package/dist/backup-provisioner-cE2PuCTb.cjs.map +0 -1
  177. package/dist/bundler-CaTGtiaO.cjs.map +0 -1
  178. package/dist/bundler-S3ek7ea-.mjs.map +0 -1
  179. package/dist/chunk-Duj1WY3L.mjs +0 -7
  180. package/dist/config-B0L2tvvC.mjs.map +0 -1
  181. package/dist/config-HhDpJmLO.cjs.map +0 -1
  182. package/dist/credentials-B2Pyh3bJ.cjs.map +0 -1
  183. package/dist/credentials-B5zRHdAl.mjs +0 -141
  184. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  185. package/dist/credentials-BapzjyV5.cjs +0 -195
  186. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  187. package/dist/credentials-CZrys9C5.mjs.map +0 -1
  188. package/dist/discover-CAlFgYec.mjs.map +0 -1
  189. package/dist/discover-DTmFeloL.cjs.map +0 -1
  190. package/dist/dokploy-api-5cK2InBm.cjs +0 -3
  191. package/dist/dokploy-api-D2Ny4Jrc.mjs +0 -3
  192. package/dist/dokploy-api-pdaBryoY.mjs +0 -706
  193. package/dist/dokploy-api-pdaBryoY.mjs.map +0 -1
  194. package/dist/dokploy-api-zqKe9lHH.cjs +0 -718
  195. package/dist/dokploy-api-zqKe9lHH.cjs.map +0 -1
  196. package/dist/emit-CIlvnDvV.mjs.map +0 -1
  197. package/dist/emit-CUD1BWls.cjs.map +0 -1
  198. package/dist/encryption-D2pL3tHH.cjs +0 -54
  199. package/dist/encryption-D2pL3tHH.cjs.map +0 -1
  200. package/dist/encryption-YDsXXi6w.mjs +0 -3
  201. package/dist/encryption-_4zwjOAR.mjs +0 -42
  202. package/dist/encryption-_4zwjOAR.mjs.map +0 -1
  203. package/dist/encryption-sQ2Oxx0d.cjs +0 -4
  204. package/dist/fullstack-secrets-D6MyHhQP.cjs.map +0 -1
  205. package/dist/fullstack-secrets-METaRLS1.mjs.map +0 -1
  206. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  207. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  208. package/dist/github-CrpsXSfV.mjs.map +0 -1
  209. package/dist/index-Ayxg_DQY.d.mts.map +0 -1
  210. package/dist/index-CR5urhWX.d.cts.map +0 -1
  211. package/dist/keystore-C9rint2E.cjs.map +0 -1
  212. package/dist/keystore-TxeYM7an.mjs.map +0 -1
  213. package/dist/openapi-DaKlTKxz.cjs.map +0 -1
  214. package/dist/openapi-react-query-BKH334Ug.cjs +0 -173
  215. package/dist/openapi-react-query-BKH334Ug.cjs.map +0 -1
  216. package/dist/openapi-react-query-DoR5CmzQ.mjs +0 -167
  217. package/dist/openapi-react-query-DoR5CmzQ.mjs.map +0 -1
  218. package/dist/openapi-y1d7Kalt.mjs.map +0 -1
  219. package/dist/reconcile-C13ERt1U.mjs.map +0 -1
  220. package/dist/reconcile-CYMhFSYy.cjs.map +0 -1
  221. package/dist/setup-BWgMs4gg.mjs +0 -12
  222. package/dist/setup-DOv92pIu.cjs +0 -473
  223. package/dist/setup-DOv92pIu.cjs.map +0 -1
  224. package/dist/setup-DQo_h_yK.mjs +0 -443
  225. package/dist/setup-DQo_h_yK.mjs.map +0 -1
  226. package/dist/setup-lCx_DcUo.cjs +0 -12
  227. package/dist/storage-B020InPW.mjs.map +0 -1
  228. package/dist/storage-CSNplaJn.cjs.map +0 -1
  229. package/dist/storage-DGBzMLZa.mjs +0 -4
  230. package/dist/storage-DlVol_oj.cjs +0 -8
  231. package/dist/sync-0ILCb-1S.cjs.map +0 -1
  232. package/dist/sync-CzHXiR9c.mjs.map +0 -1
  233. package/dist/sync-DYENfOt4.cjs +0 -4
  234. package/dist/sync-HAau6h_R.mjs +0 -3
  235. package/dist/types-CL7jPFM2.d.mts +0 -2220
  236. package/dist/types-CL7jPFM2.d.mts.map +0 -1
  237. package/dist/types-Y3fKQSAK.d.cts +0 -2220
  238. package/dist/types-Y3fKQSAK.d.cts.map +0 -1
  239. package/dist/workspace-C-a3G_U0.cjs.map +0 -1
  240. package/dist/workspace-DQxxs7Jk.cjs +0 -10
  241. package/dist/workspace-DaEX7FEg.mjs.map +0 -1
  242. package/dist/workspace-DbI580qS.mjs +0 -9
@@ -1,14 +1,12 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_discover = require('./discover-DTmFeloL.cjs');
3
- const require_config = require('./config-HhDpJmLO.cjs');
4
- const node_path = require_chunk.__toESM(require("node:path"));
5
- const __geekmidas_manifest = require_chunk.__toESM(require("@geekmidas/manifest"));
6
- const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
7
- const node_child_process = require_chunk.__toESM(require("node:child_process"));
8
- const __geekmidas_constructs_endpoints = require_chunk.__toESM(require("@geekmidas/constructs/endpoints"));
9
- const node_url = require_chunk.__toESM(require("node:url"));
10
- const __geekmidas_schema_conversion = require_chunk.__toESM(require("@geekmidas/schema/conversion"));
11
-
1
+ const require_discover = require("./discover-BERGFg8v.cjs");
2
+ const require_config = require("./config-Q1rvKHvw.cjs");
3
+ let node_fs_promises = require("node:fs/promises");
4
+ let node_path = require("node:path");
5
+ let node_child_process = require("node:child_process");
6
+ let _geekmidas_manifest = require("@geekmidas/manifest");
7
+ let _geekmidas_constructs_endpoints = require("@geekmidas/constructs/endpoints");
8
+ let node_url = require("node:url");
9
+ let _geekmidas_schema_conversion = require("@geekmidas/schema/conversion");
12
10
  //#region src/build/endpoint-analyzer.ts
13
11
  /**
14
12
  * Analyze an endpoint to extract its features
@@ -85,7 +83,6 @@ function summarizeAnalysis(analyses) {
85
83
  byFeature
86
84
  };
87
85
  }
88
-
89
86
  //#endregion
90
87
  //#region src/build/handler-templates.ts
91
88
  /**
@@ -107,8 +104,7 @@ function generateMinimalHandler(analysis) {
107
104
  const { exportName, features } = analysis;
108
105
  const method = analysis.method.toLowerCase();
109
106
  const validators = generateValidators(exportName, features);
110
- const hasValidators = validators.length > 0;
111
- if (!hasValidators && !features.hasOutputValidation) return `
107
+ if (!(validators.length > 0) && !features.hasOutputValidation) return `
112
108
  // Minimal handler: ${analysis.route} (${analysis.method})
113
109
  app.${method}('${analysis.route}', async (c) => {
114
110
  const result = await ${exportName}.handler(
@@ -256,10 +252,10 @@ function generateValidatorsFile(analyses) {
256
252
  const needsQuery = analyses.some((a) => a.features.hasQueryValidation);
257
253
  const needsParams = analyses.some((a) => a.features.hasParamValidation);
258
254
  if (!needsBody && !needsQuery && !needsParams) return `// No validators needed for this build\nexport {};\n`;
259
- const exports$1 = [];
255
+ const exports = [];
260
256
  const factories = [];
261
257
  if (needsBody) {
262
- exports$1.push("validateBody");
258
+ exports.push("validateBody");
263
259
  factories.push(`
264
260
  export const validateBody = (endpoint: any) =>
265
261
  validator('json', async (value, c) => {
@@ -270,7 +266,7 @@ export const validateBody = (endpoint: any) =>
270
266
  });`);
271
267
  }
272
268
  if (needsQuery) {
273
- exports$1.push("validateQuery");
269
+ exports.push("validateQuery");
274
270
  factories.push(`
275
271
  export const validateQuery = (endpoint: any) =>
276
272
  validator('query', async (_, c) => {
@@ -282,7 +278,7 @@ export const validateQuery = (endpoint: any) =>
282
278
  });`);
283
279
  }
284
280
  if (needsParams) {
285
- exports$1.push("validateParams");
281
+ exports.push("validateParams");
286
282
  factories.push(`
287
283
  export const validateParams = (endpoint: any) =>
288
284
  validator('param', async (params, c) => {
@@ -306,8 +302,7 @@ ${factories.join("\n")}
306
302
  */
307
303
  function generateMinimalEndpointFile(analysis, endpointImport) {
308
304
  const { exportName, features } = analysis;
309
- const needsValidators = features.hasBodyValidation || features.hasQueryValidation || features.hasParamValidation;
310
- const validatorImport = needsValidators ? generateValidatorImportsForEndpoint(analysis) : "";
305
+ const validatorImport = features.hasBodyValidation || features.hasQueryValidation || features.hasParamValidation ? generateValidatorImportsForEndpoint(analysis) : "";
311
306
  const handler = generateMinimalHandler(analysis);
312
307
  return `/**
313
308
  * Minimal endpoint: ${analysis.route} (${analysis.method})
@@ -332,8 +327,7 @@ ${handler}
332
327
  */
333
328
  function generateStandardEndpointFile(analysis, endpointImport) {
334
329
  const { exportName, features } = analysis;
335
- const needsValidators = features.hasBodyValidation || features.hasQueryValidation || features.hasParamValidation;
336
- const validatorImport = needsValidators ? generateValidatorImportsForEndpoint(analysis) : "";
330
+ const validatorImport = features.hasBodyValidation || features.hasQueryValidation || features.hasParamValidation ? generateValidatorImportsForEndpoint(analysis) : "";
337
331
  const eventsImport = features.hasEvents ? `import { publishConstructEvents } from '@geekmidas/constructs/endpoints';` : "";
338
332
  const handler = generateStandardHandler(analysis);
339
333
  return `/**
@@ -425,7 +419,7 @@ export function setupFullEndpoints(
425
419
  }
426
420
  const imports = tierEndpoints.map((a) => `import { setup${capitalize(a.exportName)} } from './${a.exportName}.js';`).join("\n");
427
421
  if (tier === "minimal") {
428
- const calls$1 = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, logger);`).join("\n");
422
+ const calls = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, logger);`).join("\n");
429
423
  return `/**
430
424
  * Minimal-tier endpoint index (${tierEndpoints.length} endpoints)
431
425
  * Near-raw-Hono performance
@@ -438,12 +432,12 @@ export function setupMinimalEndpoints(
438
432
  app: Hono,
439
433
  logger: Logger,
440
434
  ): void {
441
- ${calls$1}
435
+ ${calls}
442
436
  }
443
437
  `;
444
438
  }
445
439
  if (tier === "standard") {
446
- const calls$1 = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, serviceDiscovery, logger);`).join("\n");
440
+ const calls = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, serviceDiscovery, logger);`).join("\n");
447
441
  return `/**
448
442
  * Standard-tier endpoint index (${tierEndpoints.length} endpoints)
449
443
  * Auth and/or services enabled
@@ -458,7 +452,7 @@ export function setupStandardEndpoints(
458
452
  serviceDiscovery: ServiceDiscovery<any, any>,
459
453
  logger: Logger,
460
454
  ): void {
461
- ${calls$1}
455
+ ${calls}
462
456
  }
463
457
  `;
464
458
  }
@@ -528,9 +522,7 @@ function generateEndpointFilesNested(analyses, endpointImports) {
528
522
  case "standard":
529
523
  files[fileName] = generateStandardEndpointFile(analysis, endpointImport);
530
524
  break;
531
- case "full":
532
- files[fileName] = generateFullEndpointFile(analysis, endpointImport);
533
- break;
525
+ case "full": files[fileName] = generateFullEndpointFile(analysis, endpointImport);
534
526
  }
535
527
  }
536
528
  return files;
@@ -587,7 +579,6 @@ export async function setupEndpoints(
587
579
  }
588
580
  `;
589
581
  }
590
-
591
582
  //#endregion
592
583
  //#region src/generators/EndpointGenerator.ts
593
584
  /**
@@ -605,11 +596,11 @@ export async function setupEndpoints(
605
596
  * Falls back to the configured paths for an app that declares no surface.
606
597
  */
607
598
  function runtimeFor(context, fromDir, owner) {
608
- const module$1 = owner ? context.owners?.[owner] ?? context.surface?.module : context.surface?.module;
609
- if (module$1) {
610
- const specifier = importSpecifier(fromDir, module$1.specifier);
599
+ const module = owner ? context.owners?.[owner] ?? context.surface?.module : context.surface?.module;
600
+ if (module) {
601
+ const specifier = importSpecifier(fromDir, module.specifier);
611
602
  return {
612
- imports: `import { ${module$1.exportName} as __surface } from '${specifier}';`,
603
+ imports: `import { ${module.exportName} as __surface } from '${specifier}';`,
613
604
  bindings: [
614
605
  "// What this construct was declared with. Objects, not module paths:",
615
606
  "// the entry imports the owner, so there is nothing to print.",
@@ -677,7 +668,7 @@ function corsFor(surface) {
677
668
  }
678
669
  var EndpointGenerator = class extends require_discover.ConstructGenerator {
679
670
  isConstruct(value) {
680
- return __geekmidas_constructs_endpoints.Endpoint.isEndpoint(value);
671
+ return _geekmidas_constructs_endpoints.Endpoint.isEndpoint(value);
681
672
  }
682
673
  async build(context, constructs, outputDir, options) {
683
674
  const provider = options?.provider || "aws-apigatewayv2";
@@ -733,8 +724,7 @@ var EndpointGenerator = class extends require_discover.ConstructGenerator {
733
724
  async generateHandlerFile(outputDir, sourceFile, exportName, provider, _endpoint, context) {
734
725
  const handlerFileName = `${exportName}.ts`;
735
726
  const handlerPath = (0, node_path.join)(outputDir, handlerFileName);
736
- const relativePath = (0, node_path.relative)((0, node_path.dirname)(handlerPath), sourceFile);
737
- const importPath = relativePath.replace(/\.ts$/, ".js");
727
+ const importPath = (0, node_path.relative)((0, node_path.dirname)(handlerPath), sourceFile).replace(/\.ts$/, ".js");
738
728
  let content;
739
729
  switch (provider) {
740
730
  case "aws-apigatewayv1":
@@ -752,16 +742,14 @@ var EndpointGenerator = class extends require_discover.ConstructGenerator {
752
742
  return handlerPath;
753
743
  }
754
744
  async generateEndpointsFile(outputDir, endpoints, context) {
755
- const endpointsFileName = "endpoints.ts";
756
- const endpointsPath = (0, node_path.join)(outputDir, endpointsFileName);
745
+ const endpointsPath = (0, node_path.join)(outputDir, "endpoints.ts");
757
746
  const importsByFile = /* @__PURE__ */ new Map();
758
747
  for (const { path, key } of endpoints) {
759
- const relativePath = (0, node_path.relative)((0, node_path.dirname)(endpointsPath), path.relative);
760
- const importPath = relativePath.replace(/\.ts$/, ".js");
748
+ const importPath = (0, node_path.relative)((0, node_path.dirname)(endpointsPath), path.relative).replace(/\.ts$/, ".js");
761
749
  if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
762
750
  importsByFile.get(importPath)?.push(key);
763
751
  }
764
- const endpointImports = Array.from(importsByFile.entries()).map(([importPath, exports$1]) => `import { ${exports$1.join(", ")} } from '${importPath}';`).join("\n");
752
+ const endpointImports = Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n");
765
753
  const allExportNames = endpoints.map(({ key }) => key);
766
754
  if (context.production?.enabled && context.production.optimizedHandlers) return this.generateOptimizedEndpointsFile(endpointsPath, endpoints, endpointImports, allExportNames);
767
755
  const content = `import type { EnvironmentParser } from '@geekmidas/envkit';
@@ -823,11 +811,9 @@ export async function setupEndpoints(
823
811
  const analyses = endpoints.map(({ key, construct }) => analyzeEndpoint(construct, key));
824
812
  const endpointImports = endpoints.map(({ key, path }) => {
825
813
  const tierDir = (0, node_path.join)(endpointsDir, "standard");
826
- const relativePath = (0, node_path.relative)(tierDir, path.relative);
827
- const importPath = relativePath.replace(/\.ts$/, ".js");
828
814
  return {
829
815
  exportName: key,
830
- importPath
816
+ importPath: (0, node_path.relative)(tierDir, path.relative).replace(/\.ts$/, ".js")
831
817
  };
832
818
  });
833
819
  const summary = summarizeAnalysis(analyses);
@@ -849,8 +835,7 @@ export async function setupEndpoints(
849
835
  }
850
836
  async generateAppFile(outputDir, context) {
851
837
  if (context.production?.enabled) return this.generateProductionAppFile(outputDir, context);
852
- const appFileName = "app.ts";
853
- const appPath = (0, node_path.join)(outputDir, appFileName);
838
+ const appPath = (0, node_path.join)(outputDir, "app.ts");
854
839
  const runtime = runtimeFor(context, (0, node_path.dirname)(appPath));
855
840
  const telescopeEnabled = context.telescope?.enabled;
856
841
  const telescopeWebSocketEnabled = context.telescope?.websocket;
@@ -860,32 +845,35 @@ export async function setupEndpoints(
860
845
  const studioFromDatabase = !usesExternalStudio && !!context.studio?.database;
861
846
  const telescopeFromSurface = !!context.surface?.module && !usesExternalTelescope;
862
847
  let telescopeImports = "";
863
- if (telescopeEnabled) if (telescopeFromSurface) telescopeImports = "import { createMiddleware, createUI } from '@geekmidas/telescope/hono';";
864
- else if (usesExternalTelescope) {
865
- const relativeTelescopePath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.telescope?.telescopePath);
866
- telescopeImports = `import ${context.telescope?.telescopeImportPattern} from '${relativeTelescopePath}';
848
+ if (telescopeEnabled) {
849
+ if (telescopeFromSurface) telescopeImports = "import { createMiddleware, createUI } from '@geekmidas/telescope/hono';";
850
+ else if (usesExternalTelescope) {
851
+ const relativeTelescopePath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.telescope?.telescopePath);
852
+ telescopeImports = `import ${context.telescope?.telescopeImportPattern} from '${relativeTelescopePath}';
867
853
  import { createMiddleware, createUI } from '@geekmidas/telescope/hono';`;
868
- } else telescopeImports = `import { Telescope, InMemoryStorage } from '@geekmidas/telescope';
854
+ } else telescopeImports = `import { Telescope, InMemoryStorage } from '@geekmidas/telescope';
869
855
  import { createMiddleware, createUI } from '@geekmidas/telescope/hono';`;
856
+ }
870
857
  let studioImports = "";
871
- if (studioEnabled) if (usesExternalStudio) {
872
- const relativeStudioPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.studio?.studioPath);
873
- studioImports = `import ${context.studio?.studioImportPattern} from '${relativeStudioPath}';
858
+ if (studioEnabled) {
859
+ if (usesExternalStudio) {
860
+ const relativeStudioPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.studio?.studioPath);
861
+ studioImports = `import ${context.studio?.studioImportPattern} from '${relativeStudioPath}';
874
862
  import { createStudioApp } from '@geekmidas/studio/server/hono';`;
875
- } else if (studioFromDatabase) {
876
- const dbSpecifier = importSpecifier((0, node_path.dirname)(appPath), context.studio.database.specifier);
877
- studioImports = `import { snifferContext } from '@geekmidas/constructs';
863
+ } else if (studioFromDatabase) {
864
+ const dbSpecifier = importSpecifier((0, node_path.dirname)(appPath), context.studio.database.specifier);
865
+ studioImports = `import { snifferContext } from '@geekmidas/constructs';
878
866
  import { Direction, InMemoryMonitoringStorage, Studio } from '@geekmidas/studio';
879
867
  import { ${context.studio.database.exportName} as __studioDb } from '${dbSpecifier}';
880
868
  import { createStudioApp } from '@geekmidas/studio/server/hono';`;
881
- } else studioImports = "";
869
+ } else studioImports = "";
870
+ }
882
871
  const cors = corsFor(context.surface);
883
872
  let hooksImports = "";
884
873
  let beforeSetupCall = "";
885
874
  let afterSetupCall = "";
886
875
  if (context.hooks?.serverHooksPath) {
887
- const relativeHooksPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.hooks.serverHooksPath);
888
- hooksImports = `import * as serverHooks from '${relativeHooksPath}';`;
876
+ hooksImports = `import * as serverHooks from '${(0, node_path.relative)((0, node_path.dirname)(appPath), context.hooks.serverHooksPath)}';`;
889
877
  beforeSetupCall = `
890
878
  // Call beforeSetup hook if defined
891
879
  if (typeof serverHooks.beforeSetup === 'function') {
@@ -931,7 +919,8 @@ import { createStudioApp } from '@geekmidas/studio/server/hono';`;
931
919
  }
932
920
  ` : "";
933
921
  let telescopeSetup = "";
934
- if (telescopeEnabled) if (telescopeFromSurface || usesExternalTelescope) telescopeSetup = `
922
+ if (telescopeEnabled) {
923
+ if (telescopeFromSurface || usesExternalTelescope) telescopeSetup = `
935
924
  ${telescopeWebSocketSetupCode}
936
925
  // Add telescope middleware (before endpoints to capture all requests)
937
926
  honoApp.use('*', createMiddleware(telescope));
@@ -940,7 +929,7 @@ ${telescopeWebSocketSetupCode}
940
929
  const telescopeUI = createUI(telescope);
941
930
  honoApp.route('${context.telescope?.path}', telescopeUI);
942
931
  `;
943
- else telescopeSetup = `
932
+ else telescopeSetup = `
944
933
  // Setup Telescope for debugging/monitoring
945
934
  const telescopeStorage = new InMemoryStorage({ maxEntries: ${context.telescope?.maxEntries} });
946
935
  const telescope = new Telescope({
@@ -958,6 +947,7 @@ ${telescopeWebSocketSetupCode}
958
947
  const telescopeUI = createUI(telescope);
959
948
  honoApp.route('${context.telescope?.path}', telescopeUI);
960
949
  `;
950
+ }
961
951
  let studioSetup = "";
962
952
  if (studioEnabled && studioFromDatabase) studioSetup = `
963
953
  // Studio, built from the declared database. The client comes from the
@@ -1153,8 +1143,7 @@ export const handler = ${exportName};
1153
1143
  * No dev tools (Telescope, Studio, WebSocket), includes health checks and graceful shutdown
1154
1144
  */
1155
1145
  async generateProductionAppFile(outputDir, context) {
1156
- const appFileName = "app.ts";
1157
- const appPath = (0, node_path.join)(outputDir, appFileName);
1146
+ const appPath = (0, node_path.join)(outputDir, "app.ts");
1158
1147
  const runtime = runtimeFor(context, (0, node_path.dirname)(appPath));
1159
1148
  const production = context.production;
1160
1149
  const healthCheckPath = production.healthCheck;
@@ -1166,8 +1155,7 @@ export const handler = ${exportName};
1166
1155
  let beforeSetupCall = "";
1167
1156
  let afterSetupCall = "";
1168
1157
  if (context.hooks?.serverHooksPath) {
1169
- const relativeHooksPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.hooks.serverHooksPath);
1170
- hooksImports = `import * as serverHooks from '${relativeHooksPath}';`;
1158
+ hooksImports = `import * as serverHooks from '${(0, node_path.relative)((0, node_path.dirname)(appPath), context.hooks.serverHooksPath)}';`;
1171
1159
  beforeSetupCall = `
1172
1160
  // Call beforeSetup hook if defined
1173
1161
  if (typeof serverHooks.beforeSetup === 'function') {
@@ -1216,7 +1204,6 @@ import { setupCrons } from './crons.js';` : "";
1216
1204
  process.on('SIGTERM', shutdown);
1217
1205
  process.on('SIGINT', shutdown);
1218
1206
  ` : "";
1219
- const endpointsImportPath = production.optimizedHandlers ? "./endpoints/index.js" : "./endpoints.js";
1220
1207
  const content = `/**
1221
1208
  * Generated production server application
1222
1209
  *
@@ -1228,7 +1215,7 @@ import { setupCrons } from './crons.js';` : "";
1228
1215
  */
1229
1216
  import { Hono } from 'hono';
1230
1217
  import type { Hono as HonoType } from 'hono';
1231
- import { setupEndpoints } from '${endpointsImportPath}';
1218
+ import { setupEndpoints } from '${production.optimizedHandlers ? "./endpoints/index.js" : "./endpoints.js"}';
1232
1219
  ${subscriberImport}
1233
1220
  ${runtime.imports}
1234
1221
  ${runtime.bindings}
@@ -1295,7 +1282,7 @@ export default createApp;
1295
1282
  */
1296
1283
  async generateProductionServerEntry(outputDir) {
1297
1284
  const serverPath = (0, node_path.join)(outputDir, "server.ts");
1298
- const content = `#!/usr/bin/env node
1285
+ await (0, node_fs_promises.writeFile)(serverPath, `#!/usr/bin/env node
1299
1286
  /**
1300
1287
  * Production server entry point
1301
1288
  * Generated by 'gkm build --provider server --production'
@@ -1311,11 +1298,9 @@ await start({
1311
1298
  port,
1312
1299
  serve: (app, port) => { serve({ fetch: app.fetch, port }); },
1313
1300
  });
1314
- `;
1315
- await (0, node_fs_promises.writeFile)(serverPath, content);
1301
+ `);
1316
1302
  }
1317
1303
  };
1318
-
1319
1304
  //#endregion
1320
1305
  //#region src/generators/OpenApiTsGenerator.ts
1321
1306
  /**
@@ -1466,11 +1451,11 @@ var OpenApiTsGenerator = class {
1466
1451
  }
1467
1452
  }
1468
1453
  }
1469
- const registrySchemas = await (0, __geekmidas_schema_conversion.getRegisteredZodJsonSchemas)();
1454
+ const registrySchemas = await (0, _geekmidas_schema_conversion.getRegisteredZodJsonSchemas)();
1470
1455
  for (const [rawName, rawSchema] of Object.entries(registrySchemas)) {
1471
1456
  const defName = this.pascalCase(rawName);
1472
1457
  if (collectedDefs.has(defName) || generatedNames.has(defName)) continue;
1473
- const { id: _id, $defs: _defs,...rest } = rawSchema;
1458
+ const { id: _id, $defs: _defs, ...rest } = rawSchema;
1474
1459
  collectedDefs.set(defName, rest);
1475
1460
  }
1476
1461
  for (const [defName, defSchema] of collectedDefs) if (!generatedNames.has(defName)) {
@@ -1486,7 +1471,7 @@ var OpenApiTsGenerator = class {
1486
1471
  */
1487
1472
  async getSchemaName(schema, defaultName) {
1488
1473
  try {
1489
- const metadata = await (0, __geekmidas_schema_conversion.getSchemaMetadata)(schema);
1474
+ const metadata = await (0, _geekmidas_schema_conversion.getSchemaMetadata)(schema);
1490
1475
  if (metadata?.id) return this.pascalCase(metadata.id);
1491
1476
  } catch {}
1492
1477
  return defaultName;
@@ -1506,17 +1491,17 @@ var OpenApiTsGenerator = class {
1506
1491
  async schemaToInterfaceWithDefs(schema, name, collectedDefs) {
1507
1492
  try {
1508
1493
  const vendor = schema["~standard"]?.vendor;
1509
- if (!vendor || !(vendor in __geekmidas_schema_conversion.StandardSchemaJsonSchema)) return null;
1510
- const toJsonSchema = __geekmidas_schema_conversion.StandardSchemaJsonSchema[vendor];
1494
+ if (!vendor || !(vendor in _geekmidas_schema_conversion.StandardSchemaJsonSchema)) return unknownType(name);
1495
+ const toJsonSchema = _geekmidas_schema_conversion.StandardSchemaJsonSchema[vendor];
1511
1496
  const jsonSchema = await toJsonSchema(schema);
1512
- if (!jsonSchema) return null;
1497
+ if (!jsonSchema) return unknownType(name);
1513
1498
  if (jsonSchema.$defs && typeof jsonSchema.$defs === "object") {
1514
1499
  for (const [defName, defSchema] of Object.entries(jsonSchema.$defs)) if (!collectedDefs.has(defName)) {
1515
- const { id,...schemaWithoutId } = defSchema;
1500
+ const { id, ...schemaWithoutId } = defSchema;
1516
1501
  collectedDefs.set(defName, schemaWithoutId);
1517
1502
  }
1518
1503
  }
1519
- const { $defs,...schemaWithoutDefs } = jsonSchema;
1504
+ const { $defs, ...schemaWithoutDefs } = jsonSchema;
1520
1505
  const ref = schemaWithoutDefs.$ref;
1521
1506
  if (ref && Object.keys(schemaWithoutDefs).every((k) => k === "$ref" || k === "$schema")) {
1522
1507
  const target = ref.split("/").pop();
@@ -1524,14 +1509,11 @@ var OpenApiTsGenerator = class {
1524
1509
  }
1525
1510
  return this.jsonSchemaToInterface(schemaWithoutDefs, name);
1526
1511
  } catch {
1527
- return null;
1512
+ return unknownType(name);
1528
1513
  }
1529
1514
  }
1530
1515
  jsonSchemaToInterface(schema, name) {
1531
- if (schema.type !== "object" || !schema.properties) {
1532
- const typeStr = this.jsonSchemaTypeToTs(schema);
1533
- return `export type ${name} = ${typeStr};`;
1534
- }
1516
+ if (schema.type !== "object" || !schema.properties) return `export type ${name} = ${this.jsonSchemaTypeToTs(schema)};`;
1535
1517
  const props = [];
1536
1518
  const required = new Set(schema.required || []);
1537
1519
  for (const [propName, propSchema] of Object.entries(schema.properties)) {
@@ -1544,13 +1526,15 @@ var OpenApiTsGenerator = class {
1544
1526
  }
1545
1527
  jsonSchemaTypeToTs(schema) {
1546
1528
  if (!schema) return "unknown";
1547
- if (schema.$ref) {
1548
- const refName = schema.$ref.split("/").pop() || "unknown";
1549
- return refName;
1550
- }
1529
+ if (schema.$ref) return schema.$ref.split("/").pop() || "unknown";
1530
+ if (schema.const !== void 0) return typeof schema.const === "string" ? `'${schema.const}'` : String(schema.const);
1551
1531
  if (schema.anyOf) return schema.anyOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" | ");
1552
1532
  if (schema.oneOf) return schema.oneOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" | ");
1553
1533
  if (schema.allOf) return schema.allOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" & ");
1534
+ if (Array.isArray(schema.type)) return schema.type.map((type) => this.jsonSchemaTypeToTs({
1535
+ ...schema,
1536
+ type
1537
+ })).join(" | ");
1554
1538
  switch (schema.type) {
1555
1539
  case "string":
1556
1540
  if (schema.enum) return schema.enum.map((e) => `'${e}'`).join(" | ");
@@ -1574,10 +1558,7 @@ var OpenApiTsGenerator = class {
1574
1558
  }
1575
1559
  return `{ ${props.join("; ")} }`;
1576
1560
  }
1577
- if (schema.additionalProperties) {
1578
- const valueType = this.jsonSchemaTypeToTs(schema.additionalProperties);
1579
- return `Record<string, ${valueType}>`;
1580
- }
1561
+ if (schema.additionalProperties) return `Record<string, ${this.jsonSchemaTypeToTs(schema.additionalProperties)}>`;
1581
1562
  return "Record<string, unknown>";
1582
1563
  default: return "unknown";
1583
1564
  }
@@ -1598,10 +1579,7 @@ var OpenApiTsGenerator = class {
1598
1579
  }
1599
1580
  const firstWithParams = infos.find((i) => i.input?.params);
1600
1581
  let paramsEntry = "";
1601
- if (firstWithParams?.input?.params) {
1602
- const paramsName = await this.getSchemaName(firstWithParams.input.params, `${this.getSchemaBaseName(firstWithParams)}Params`);
1603
- paramsEntry = `\n parameters: {\n path: ${paramsName};\n };`;
1604
- }
1582
+ if (firstWithParams?.input?.params) paramsEntry = `\n parameters: {\n path: ${await this.getSchemaName(firstWithParams.input.params, `${this.getSchemaBaseName(firstWithParams)}Params`)};\n };`;
1605
1583
  pathEntries.push(` '${route}': {${paramsEntry}\n${methodEntries.join("\n")}\n };`);
1606
1584
  }
1607
1585
  return `export interface paths {\n${pathEntries.join("\n")}\n}`;
@@ -1640,8 +1618,7 @@ var OpenApiTsGenerator = class {
1640
1618
  return acc;
1641
1619
  }, {});
1642
1620
  const schemeNames = securitySchemes.map((s) => `'${s.name}'`).join(" | ");
1643
- const hasSecuritySchemes = schemeNames.length > 0;
1644
- const createApiSection = hasSecuritySchemes ? `
1621
+ const createApiSection = schemeNames.length > 0 ? `
1645
1622
  // ============================================================
1646
1623
  // API Client Factory
1647
1624
  // ============================================================
@@ -1818,20 +1795,14 @@ ${createApiSection}
1818
1795
  `;
1819
1796
  }
1820
1797
  };
1821
-
1822
- //#endregion
1823
- //#region src/workspace/client-generator.ts
1824
1798
  /**
1825
- * Normalize routes to an array of patterns.
1826
- * Handles string, string[], and PartitionedRoutes (extracts paths).
1827
- * @internal Exported for use in dev command
1799
+ * The declaration for a schema that cannot be converted — a vendor with no
1800
+ * converter, or one that fails. The paths interface names it either way, so
1801
+ * leaving it undeclared made the generated client fail to compile.
1828
1802
  */
1829
- function normalizeRoutes(routes) {
1830
- if (!routes) return [];
1831
- if (require_discover.isPartitionedRoutes(routes)) return Array.isArray(routes.paths) ? routes.paths : [routes.paths];
1832
- return Array.isArray(routes) ? routes : [routes];
1803
+ function unknownType(name) {
1804
+ return `export type ${name} = unknown;`;
1833
1805
  }
1834
-
1835
1806
  //#endregion
1836
1807
  //#region src/openapi.ts
1837
1808
  /**
@@ -1846,7 +1817,7 @@ const OPENAPI_OUTPUT_PATH = "./.gkm/openapi.ts";
1846
1817
  * name and its `WEBHOOKS_URL`.
1847
1818
  */
1848
1819
  function openApiPathFor(surfaceId) {
1849
- return `./.gkm/openapi/${(0, __geekmidas_manifest.kebabCase)(surfaceId)}.ts`;
1820
+ return `./.gkm/openapi/${(0, _geekmidas_manifest.kebabCase)(surfaceId)}.ts`;
1850
1821
  }
1851
1822
  /**
1852
1823
  * Resolve OpenAPI config from GkmConfig
@@ -1874,8 +1845,7 @@ function resolveOpenApiConfig(config) {
1874
1845
  * directories under it — not a `routes` field anybody wrote.
1875
1846
  */
1876
1847
  async function generateOpenApiFrom(routes, options = {}) {
1877
- const loaded = await new EndpointGenerator().load(routes, void 0, options.bustCache);
1878
- return generateOpenApi(loaded.map(({ construct }) => construct), options);
1848
+ return generateOpenApi((await new EndpointGenerator().load(routes, void 0, options.bustCache)).map(({ construct }) => construct), options);
1879
1849
  }
1880
1850
  /**
1881
1851
  * Generate an OpenAPI spec for each surface these endpoints name.
@@ -1911,8 +1881,8 @@ async function generateOpenApi(endpoints, options = {}) {
1911
1881
  const tsGenerator = new OpenApiTsGenerator();
1912
1882
  const written = [];
1913
1883
  for (const [surfaceId, surfaceEndpoints] of bySurface) {
1914
- const relative$1 = openApiPathFor(surfaceId);
1915
- const outputPath = (0, node_path.join)(process.cwd(), relative$1);
1884
+ const relative = openApiPathFor(surfaceId);
1885
+ const outputPath = (0, node_path.join)(process.cwd(), relative);
1916
1886
  await (0, node_fs_promises.mkdir)((0, node_path.dirname)(outputPath), { recursive: true });
1917
1887
  const tsContent = await tsGenerator.generate(surfaceEndpoints, {
1918
1888
  title: openApiConfig.title ?? surfaceId,
@@ -1920,8 +1890,8 @@ async function generateOpenApi(endpoints, options = {}) {
1920
1890
  description: openApiConfig.description
1921
1891
  });
1922
1892
  await (0, node_fs_promises.writeFile)(outputPath, tsContent);
1923
- written.push(relative$1);
1924
- logger.log(`📄 OpenAPI client generated: ${relative$1} (${surfaceEndpoints.length} endpoints)`);
1893
+ written.push(relative);
1894
+ logger.log(`📄 OpenAPI client generated: ${relative} (${surfaceEndpoints.length} endpoints)`);
1925
1895
  }
1926
1896
  return {
1927
1897
  outputPath: (0, node_path.join)(process.cwd(), written[0]),
@@ -1976,8 +1946,7 @@ async function openapiCommand(options = {}) {
1976
1946
  async function generateOpenApiForApp(workspaceRoot, _appName, app, silent = true) {
1977
1947
  if (app.type !== "backend") return null;
1978
1948
  const appPath = (0, node_path.join)(workspaceRoot, app.path);
1979
- const globs = [(0, node_path.join)(appPath, "**/*.ts")];
1980
- return generateOpenApiFrom(globs, {
1949
+ return generateOpenApiFrom([(0, node_path.join)(appPath, "**/*.ts")], {
1981
1950
  openapi: app.openapi ?? { enabled: true },
1982
1951
  silent
1983
1952
  });
@@ -1998,7 +1967,7 @@ function resolveGkmBinPath() {
1998
1967
  */
1999
1968
  async function runOpenApiInSubprocess(appCwd, appName) {
2000
1969
  const binPath = resolveGkmBinPath();
2001
- await new Promise((resolve$1, reject) => {
1970
+ await new Promise((resolve, reject) => {
2002
1971
  const child = (0, node_child_process.spawn)(process.execPath, [
2003
1972
  binPath,
2004
1973
  "openapi",
@@ -2011,65 +1980,59 @@ async function runOpenApiInSubprocess(appCwd, appName) {
2011
1980
  });
2012
1981
  child.on("error", reject);
2013
1982
  child.on("close", (code) => {
2014
- if (code === 0) resolve$1();
2015
- else reject(new Error(`OpenAPI generation for app "${appName}" exited with code ${code}`));
1983
+ if (code === 0) resolve();
1984
+ else reject(/* @__PURE__ */ new Error(`OpenAPI generation for app "${appName}" exited with code ${code}`));
2016
1985
  });
2017
1986
  });
2018
1987
  }
2019
-
2020
1988
  //#endregion
2021
- Object.defineProperty(exports, 'EndpointGenerator', {
2022
- enumerable: true,
2023
- get: function () {
2024
- return EndpointGenerator;
2025
- }
2026
- });
2027
- Object.defineProperty(exports, 'OPENAPI_OUTPUT_PATH', {
2028
- enumerable: true,
2029
- get: function () {
2030
- return OPENAPI_OUTPUT_PATH;
2031
- }
1989
+ Object.defineProperty(exports, "EndpointGenerator", {
1990
+ enumerable: true,
1991
+ get: function() {
1992
+ return EndpointGenerator;
1993
+ }
2032
1994
  });
2033
- Object.defineProperty(exports, 'generateOpenApi', {
2034
- enumerable: true,
2035
- get: function () {
2036
- return generateOpenApi;
2037
- }
1995
+ Object.defineProperty(exports, "OPENAPI_OUTPUT_PATH", {
1996
+ enumerable: true,
1997
+ get: function() {
1998
+ return OPENAPI_OUTPUT_PATH;
1999
+ }
2038
2000
  });
2039
- Object.defineProperty(exports, 'generateOpenApiFrom', {
2040
- enumerable: true,
2041
- get: function () {
2042
- return generateOpenApiFrom;
2043
- }
2001
+ Object.defineProperty(exports, "generateOpenApi", {
2002
+ enumerable: true,
2003
+ get: function() {
2004
+ return generateOpenApi;
2005
+ }
2044
2006
  });
2045
- Object.defineProperty(exports, 'normalizeRoutes', {
2046
- enumerable: true,
2047
- get: function () {
2048
- return normalizeRoutes;
2049
- }
2007
+ Object.defineProperty(exports, "generateOpenApiFrom", {
2008
+ enumerable: true,
2009
+ get: function() {
2010
+ return generateOpenApiFrom;
2011
+ }
2050
2012
  });
2051
- Object.defineProperty(exports, 'openApiPathFor', {
2052
- enumerable: true,
2053
- get: function () {
2054
- return openApiPathFor;
2055
- }
2013
+ Object.defineProperty(exports, "openApiPathFor", {
2014
+ enumerable: true,
2015
+ get: function() {
2016
+ return openApiPathFor;
2017
+ }
2056
2018
  });
2057
- Object.defineProperty(exports, 'openapiCommand', {
2058
- enumerable: true,
2059
- get: function () {
2060
- return openapiCommand;
2061
- }
2019
+ Object.defineProperty(exports, "openapiCommand", {
2020
+ enumerable: true,
2021
+ get: function() {
2022
+ return openapiCommand;
2023
+ }
2062
2024
  });
2063
- Object.defineProperty(exports, 'resolveOpenApiConfig', {
2064
- enumerable: true,
2065
- get: function () {
2066
- return resolveOpenApiConfig;
2067
- }
2025
+ Object.defineProperty(exports, "resolveOpenApiConfig", {
2026
+ enumerable: true,
2027
+ get: function() {
2028
+ return resolveOpenApiConfig;
2029
+ }
2068
2030
  });
2069
- Object.defineProperty(exports, 'runtimeFor', {
2070
- enumerable: true,
2071
- get: function () {
2072
- return runtimeFor;
2073
- }
2031
+ Object.defineProperty(exports, "runtimeFor", {
2032
+ enumerable: true,
2033
+ get: function() {
2034
+ return runtimeFor;
2035
+ }
2074
2036
  });
2075
- //# sourceMappingURL=openapi-DaKlTKxz.cjs.map
2037
+
2038
+ //# sourceMappingURL=openapi-Dcbme-Us.cjs.map