specli 0.0.10 → 0.0.12

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 (334) hide show
  1. package/bin/cli.sh +27 -0
  2. package/dist/{src/ai → ai}/tools.d.ts +0 -1
  3. package/dist/ai/tools.js +161 -0
  4. package/dist/ai/tools.test.d.ts +1 -0
  5. package/dist/ai/tools.test.js +56 -0
  6. package/dist/{src/cli → cli}/auth-requirements.d.ts +0 -1
  7. package/dist/cli/auth-requirements.js +65 -0
  8. package/dist/cli/auth-requirements.test.d.ts +1 -0
  9. package/dist/cli/auth-requirements.test.js +16 -0
  10. package/dist/{src/cli → cli}/auth-schemes.d.ts +0 -1
  11. package/dist/cli/auth-schemes.js +112 -0
  12. package/dist/cli/auth-schemes.test.d.ts +1 -0
  13. package/dist/cli/auth-schemes.test.js +56 -0
  14. package/dist/{src/cli → cli}/capabilities.d.ts +0 -1
  15. package/dist/cli/capabilities.js +41 -0
  16. package/dist/cli/capabilities.test.d.ts +1 -0
  17. package/dist/cli/capabilities.test.js +84 -0
  18. package/dist/{src/cli → cli}/command-id.d.ts +0 -1
  19. package/dist/cli/command-id.js +8 -0
  20. package/dist/cli/command-id.test.d.ts +1 -0
  21. package/dist/cli/command-id.test.js +27 -0
  22. package/dist/{src/cli → cli}/command-index.d.ts +0 -1
  23. package/dist/cli/command-index.js +9 -0
  24. package/dist/{src/cli → cli}/command-model.d.ts +0 -1
  25. package/dist/cli/command-model.js +53 -0
  26. package/dist/cli/command-model.test.d.ts +1 -0
  27. package/dist/cli/command-model.test.js +40 -0
  28. package/dist/{src/cli → cli}/compile.d.ts +0 -1
  29. package/dist/cli/compile.js +79 -0
  30. package/dist/{src/cli → cli}/crypto.d.ts +0 -1
  31. package/dist/cli/crypto.js +9 -0
  32. package/dist/{src/cli → cli}/derive-name.d.ts +0 -1
  33. package/dist/cli/derive-name.js +96 -0
  34. package/dist/{src/cli → cli}/exec.d.ts +0 -1
  35. package/dist/cli/exec.js +50 -0
  36. package/dist/{src/cli → cli}/main.d.ts +0 -1
  37. package/dist/cli/main.js +177 -0
  38. package/dist/{src/cli → cli}/naming.d.ts +0 -1
  39. package/dist/cli/naming.js +191 -0
  40. package/dist/cli/naming.test.d.ts +1 -0
  41. package/dist/cli/naming.test.js +75 -0
  42. package/dist/{src/cli → cli}/operations.d.ts +0 -1
  43. package/dist/cli/operations.js +100 -0
  44. package/dist/cli/operations.test.d.ts +1 -0
  45. package/dist/cli/operations.test.js +51 -0
  46. package/dist/{src/cli → cli}/params.d.ts +0 -1
  47. package/dist/cli/params.js +36 -0
  48. package/dist/cli/params.test.d.ts +1 -0
  49. package/dist/cli/params.test.js +62 -0
  50. package/dist/{src/cli → cli}/pluralize.d.ts +0 -1
  51. package/dist/cli/pluralize.js +38 -0
  52. package/dist/{src/cli → cli}/positional.d.ts +0 -1
  53. package/dist/cli/positional.js +35 -0
  54. package/dist/cli/positional.test.d.ts +1 -0
  55. package/dist/cli/positional.test.js +60 -0
  56. package/dist/{src/cli → cli}/request-body.d.ts +0 -1
  57. package/dist/cli/request-body.js +44 -0
  58. package/dist/cli/request-body.test.d.ts +1 -0
  59. package/dist/cli/request-body.test.js +31 -0
  60. package/dist/{src/cli → cli}/runtime/argv.d.ts +0 -1
  61. package/dist/cli/runtime/argv.js +15 -0
  62. package/dist/{src/cli → cli}/runtime/auth/resolve.d.ts +0 -1
  63. package/dist/cli/runtime/auth/resolve.js +39 -0
  64. package/dist/{src/cli → cli}/runtime/body-flags.d.ts +0 -1
  65. package/dist/cli/runtime/body-flags.js +117 -0
  66. package/dist/cli/runtime/body-flags.test.d.ts +1 -0
  67. package/dist/cli/runtime/body-flags.test.js +192 -0
  68. package/dist/{src/cli → cli}/runtime/body.d.ts +0 -1
  69. package/dist/cli/runtime/body.js +16 -0
  70. package/dist/{src/cli → cli}/runtime/collect.d.ts +0 -1
  71. package/dist/cli/runtime/collect.js +3 -0
  72. package/dist/{src/cli → cli}/runtime/compat.d.ts +0 -1
  73. package/dist/cli/runtime/compat.js +78 -0
  74. package/dist/{src/cli → cli}/runtime/context.d.ts +0 -1
  75. package/dist/cli/runtime/context.js +44 -0
  76. package/dist/{src/cli → cli}/runtime/execute.d.ts +0 -1
  77. package/dist/cli/runtime/execute.js +106 -0
  78. package/dist/{src/cli → cli}/runtime/generated.d.ts +0 -1
  79. package/dist/cli/runtime/generated.js +168 -0
  80. package/dist/{src/cli → cli}/runtime/headers.d.ts +0 -1
  81. package/dist/cli/runtime/headers.js +30 -0
  82. package/dist/{src/cli → cli}/runtime/index.d.ts +0 -1
  83. package/dist/cli/runtime/index.js +3 -0
  84. package/dist/{src/cli → cli}/runtime/profile/secrets.d.ts +0 -1
  85. package/dist/cli/runtime/profile/secrets.js +53 -0
  86. package/dist/{src/cli → cli}/runtime/profile/store.d.ts +0 -1
  87. package/dist/cli/runtime/profile/store.js +63 -0
  88. package/dist/{src/cli → cli}/runtime/request.d.ts +0 -1
  89. package/dist/cli/runtime/request.js +283 -0
  90. package/dist/cli/runtime/request.test.d.ts +1 -0
  91. package/dist/cli/runtime/request.test.js +332 -0
  92. package/dist/{src/cli → cli}/runtime/server-url.d.ts +0 -1
  93. package/dist/cli/runtime/server-url.js +28 -0
  94. package/dist/{src/cli → cli}/runtime/template.d.ts +0 -1
  95. package/dist/cli/runtime/template.js +22 -0
  96. package/dist/cli/runtime/validate/ajv.d.ts +2 -0
  97. package/dist/cli/runtime/validate/ajv.js +11 -0
  98. package/dist/{src/cli → cli}/runtime/validate/coerce.d.ts +0 -1
  99. package/dist/cli/runtime/validate/coerce.js +63 -0
  100. package/dist/cli/runtime/validate/coerce.test.d.ts +1 -0
  101. package/dist/cli/runtime/validate/coerce.test.js +75 -0
  102. package/dist/{src/cli → cli}/runtime/validate/error.d.ts +0 -1
  103. package/dist/cli/runtime/validate/error.js +19 -0
  104. package/dist/{src/cli → cli}/runtime/validate/index.d.ts +0 -1
  105. package/dist/cli/runtime/validate/index.js +4 -0
  106. package/dist/{src/cli → cli}/runtime/validate/schema.d.ts +0 -1
  107. package/dist/cli/runtime/validate/schema.js +38 -0
  108. package/dist/{src/cli → cli}/schema-shape.d.ts +0 -1
  109. package/dist/cli/schema-shape.js +34 -0
  110. package/dist/{src/cli → cli}/schema.d.ts +0 -1
  111. package/dist/cli/schema.js +31 -0
  112. package/dist/{src/cli → cli}/server.d.ts +0 -1
  113. package/dist/cli/server.js +130 -0
  114. package/dist/cli/server.test.d.ts +1 -0
  115. package/dist/cli/server.test.js +49 -0
  116. package/dist/{src/cli → cli}/spec-id.d.ts +0 -1
  117. package/dist/cli/spec-id.js +8 -0
  118. package/dist/{src/cli → cli}/spec-loader.d.ts +0 -1
  119. package/dist/cli/spec-loader.js +40 -0
  120. package/dist/{src/cli → cli}/stable-json.d.ts +0 -1
  121. package/dist/cli/stable-json.js +29 -0
  122. package/dist/{src/cli → cli}/strings.d.ts +0 -1
  123. package/dist/cli/strings.js +20 -0
  124. package/dist/{src/cli → cli}/types.d.ts +0 -1
  125. package/dist/cli/types.js +3 -0
  126. package/dist/cli.d.ts +0 -1
  127. package/dist/cli.js +52 -2325
  128. package/dist/compiled.d.ts +2 -0
  129. package/{src/compiled.ts → dist/compiled.js} +8 -11
  130. package/dist/macros/env.d.ts +10 -0
  131. package/dist/macros/env.js +22 -0
  132. package/dist/macros/spec.d.ts +5 -0
  133. package/dist/macros/spec.js +16 -0
  134. package/dist/weather +0 -0
  135. package/package.json +12 -25
  136. package/cli.ts +0 -77
  137. package/dist/cli.d.ts.map +0 -1
  138. package/dist/cli.js.map +0 -53
  139. package/dist/index.d.ts +0 -2
  140. package/dist/index.d.ts.map +0 -1
  141. package/dist/index.js +0 -2032
  142. package/dist/index.js.map +0 -48
  143. package/dist/src/ai/tools.d.ts.map +0 -1
  144. package/dist/src/ai/tools.js +0 -1656
  145. package/dist/src/ai/tools.js.map +0 -45
  146. package/dist/src/cli/auth-requirements.d.ts.map +0 -1
  147. package/dist/src/cli/auth-requirements.js +0 -66
  148. package/dist/src/cli/auth-requirements.js.map +0 -10
  149. package/dist/src/cli/auth-schemes.d.ts.map +0 -1
  150. package/dist/src/cli/auth-schemes.js +0 -116
  151. package/dist/src/cli/auth-schemes.js.map +0 -11
  152. package/dist/src/cli/capabilities.d.ts.map +0 -1
  153. package/dist/src/cli/capabilities.js +0 -45
  154. package/dist/src/cli/capabilities.js.map +0 -10
  155. package/dist/src/cli/command-id.d.ts.map +0 -1
  156. package/dist/src/cli/command-id.js +0 -18
  157. package/dist/src/cli/command-id.js.map +0 -11
  158. package/dist/src/cli/command-index.d.ts.map +0 -1
  159. package/dist/src/cli/command-index.js +0 -15
  160. package/dist/src/cli/command-index.js.map +0 -10
  161. package/dist/src/cli/command-model.d.ts.map +0 -1
  162. package/dist/src/cli/command-model.js +0 -274
  163. package/dist/src/cli/command-model.js.map +0 -18
  164. package/dist/src/cli/compile.d.ts.map +0 -1
  165. package/dist/src/cli/compile.js +0 -146
  166. package/dist/src/cli/compile.js.map +0 -11
  167. package/dist/src/cli/crypto.d.ts.map +0 -1
  168. package/dist/src/cli/crypto.js +0 -15
  169. package/dist/src/cli/crypto.js.map +0 -10
  170. package/dist/src/cli/derive-name.d.ts.map +0 -1
  171. package/dist/src/cli/derive-name.js +0 -70
  172. package/dist/src/cli/derive-name.js.map +0 -10
  173. package/dist/src/cli/exec.d.ts.map +0 -1
  174. package/dist/src/cli/exec.js +0 -2077
  175. package/dist/src/cli/exec.js.map +0 -49
  176. package/dist/src/cli/main.d.ts.map +0 -1
  177. package/dist/src/cli/main.js +0 -2032
  178. package/dist/src/cli/main.js.map +0 -48
  179. package/dist/src/cli/naming.d.ts.map +0 -1
  180. package/dist/src/cli/naming.js +0 -216
  181. package/dist/src/cli/naming.js.map +0 -12
  182. package/dist/src/cli/operations.d.ts.map +0 -1
  183. package/dist/src/cli/operations.js +0 -103
  184. package/dist/src/cli/operations.js.map +0 -10
  185. package/dist/src/cli/params.d.ts.map +0 -1
  186. package/dist/src/cli/params.js +0 -79
  187. package/dist/src/cli/params.js.map +0 -12
  188. package/dist/src/cli/pluralize.d.ts.map +0 -1
  189. package/dist/src/cli/pluralize.js +0 -43
  190. package/dist/src/cli/pluralize.js.map +0 -10
  191. package/dist/src/cli/positional.d.ts.map +0 -1
  192. package/dist/src/cli/positional.js +0 -39
  193. package/dist/src/cli/positional.js.map +0 -10
  194. package/dist/src/cli/request-body.d.ts.map +0 -1
  195. package/dist/src/cli/request-body.js +0 -82
  196. package/dist/src/cli/request-body.js.map +0 -12
  197. package/dist/src/cli/runtime/argv.d.ts.map +0 -1
  198. package/dist/src/cli/runtime/argv.js +0 -22
  199. package/dist/src/cli/runtime/argv.js.map +0 -10
  200. package/dist/src/cli/runtime/auth/resolve.d.ts.map +0 -1
  201. package/dist/src/cli/runtime/auth/resolve.js +0 -38
  202. package/dist/src/cli/runtime/auth/resolve.js.map +0 -10
  203. package/dist/src/cli/runtime/body-flags.d.ts.map +0 -1
  204. package/dist/src/cli/runtime/body-flags.js +0 -86
  205. package/dist/src/cli/runtime/body-flags.js.map +0 -10
  206. package/dist/src/cli/runtime/body.d.ts.map +0 -1
  207. package/dist/src/cli/runtime/body.js +0 -40
  208. package/dist/src/cli/runtime/body.js.map +0 -11
  209. package/dist/src/cli/runtime/collect.d.ts.map +0 -1
  210. package/dist/src/cli/runtime/collect.js +0 -9
  211. package/dist/src/cli/runtime/collect.js.map +0 -10
  212. package/dist/src/cli/runtime/compat.d.ts.map +0 -1
  213. package/dist/src/cli/runtime/compat.js +0 -62
  214. package/dist/src/cli/runtime/compat.js.map +0 -10
  215. package/dist/src/cli/runtime/context.d.ts.map +0 -1
  216. package/dist/src/cli/runtime/context.js +0 -936
  217. package/dist/src/cli/runtime/context.js.map +0 -32
  218. package/dist/src/cli/runtime/execute.d.ts.map +0 -1
  219. package/dist/src/cli/runtime/execute.js +0 -670
  220. package/dist/src/cli/runtime/execute.js.map +0 -22
  221. package/dist/src/cli/runtime/generated.d.ts.map +0 -1
  222. package/dist/src/cli/runtime/generated.js +0 -869
  223. package/dist/src/cli/runtime/generated.js.map +0 -23
  224. package/dist/src/cli/runtime/headers.d.ts.map +0 -1
  225. package/dist/src/cli/runtime/headers.js +0 -36
  226. package/dist/src/cli/runtime/headers.js.map +0 -10
  227. package/dist/src/cli/runtime/index.d.ts.map +0 -1
  228. package/dist/src/cli/runtime/index.js +0 -1808
  229. package/dist/src/cli/runtime/index.js.map +0 -46
  230. package/dist/src/cli/runtime/profile/secrets.d.ts.map +0 -1
  231. package/dist/src/cli/runtime/profile/secrets.js +0 -51
  232. package/dist/src/cli/runtime/profile/secrets.js.map +0 -11
  233. package/dist/src/cli/runtime/profile/store.d.ts.map +0 -1
  234. package/dist/src/cli/runtime/profile/store.js +0 -102
  235. package/dist/src/cli/runtime/profile/store.js.map +0 -11
  236. package/dist/src/cli/runtime/request.d.ts.map +0 -1
  237. package/dist/src/cli/runtime/request.js +0 -571
  238. package/dist/src/cli/runtime/request.js.map +0 -21
  239. package/dist/src/cli/runtime/server-url.d.ts.map +0 -1
  240. package/dist/src/cli/runtime/server-url.js +0 -55
  241. package/dist/src/cli/runtime/server-url.js.map +0 -11
  242. package/dist/src/cli/runtime/template.d.ts.map +0 -1
  243. package/dist/src/cli/runtime/template.js +0 -29
  244. package/dist/src/cli/runtime/template.js.map +0 -10
  245. package/dist/src/cli/runtime/validate/ajv.d.ts +0 -3
  246. package/dist/src/cli/runtime/validate/ajv.d.ts.map +0 -1
  247. package/dist/src/cli/runtime/validate/ajv.js +0 -17
  248. package/dist/src/cli/runtime/validate/ajv.js.map +0 -10
  249. package/dist/src/cli/runtime/validate/coerce.d.ts.map +0 -1
  250. package/dist/src/cli/runtime/validate/coerce.js +0 -60
  251. package/dist/src/cli/runtime/validate/coerce.js.map +0 -10
  252. package/dist/src/cli/runtime/validate/error.d.ts.map +0 -1
  253. package/dist/src/cli/runtime/validate/error.js +0 -21
  254. package/dist/src/cli/runtime/validate/error.js.map +0 -10
  255. package/dist/src/cli/runtime/validate/index.d.ts.map +0 -1
  256. package/dist/src/cli/runtime/validate/index.js +0 -122
  257. package/dist/src/cli/runtime/validate/index.js.map +0 -13
  258. package/dist/src/cli/runtime/validate/schema.d.ts.map +0 -1
  259. package/dist/src/cli/runtime/validate/schema.js +0 -36
  260. package/dist/src/cli/runtime/validate/schema.js.map +0 -10
  261. package/dist/src/cli/schema-shape.d.ts.map +0 -1
  262. package/dist/src/cli/schema-shape.js +0 -41
  263. package/dist/src/cli/schema-shape.js.map +0 -10
  264. package/dist/src/cli/schema.d.ts.map +0 -1
  265. package/dist/src/cli/schema.js +0 -38
  266. package/dist/src/cli/schema.js.map +0 -10
  267. package/dist/src/cli/server.d.ts.map +0 -1
  268. package/dist/src/cli/server.js +0 -64
  269. package/dist/src/cli/server.js.map +0 -11
  270. package/dist/src/cli/spec-id.d.ts.map +0 -1
  271. package/dist/src/cli/spec-id.js +0 -21
  272. package/dist/src/cli/spec-id.js.map +0 -11
  273. package/dist/src/cli/spec-loader.d.ts.map +0 -1
  274. package/dist/src/cli/spec-loader.js +0 -110
  275. package/dist/src/cli/spec-loader.js.map +0 -15
  276. package/dist/src/cli/stable-json.d.ts.map +0 -1
  277. package/dist/src/cli/stable-json.js +0 -35
  278. package/dist/src/cli/stable-json.js.map +0 -10
  279. package/dist/src/cli/strings.d.ts.map +0 -1
  280. package/dist/src/cli/strings.js +0 -16
  281. package/dist/src/cli/strings.js.map +0 -10
  282. package/dist/src/cli/types.d.ts.map +0 -1
  283. package/dist/src/cli/types.js +0 -9
  284. package/dist/src/cli/types.js.map +0 -10
  285. package/index.ts +0 -1
  286. package/src/ai/tools.ts +0 -211
  287. package/src/cli/auth-requirements.ts +0 -91
  288. package/src/cli/auth-schemes.ts +0 -187
  289. package/src/cli/capabilities.ts +0 -88
  290. package/src/cli/command-id.ts +0 -16
  291. package/src/cli/command-index.ts +0 -19
  292. package/src/cli/command-model.ts +0 -128
  293. package/src/cli/compile.ts +0 -101
  294. package/src/cli/crypto.ts +0 -9
  295. package/src/cli/derive-name.ts +0 -101
  296. package/src/cli/exec.ts +0 -72
  297. package/src/cli/main.ts +0 -231
  298. package/src/cli/naming.ts +0 -224
  299. package/src/cli/operations.ts +0 -152
  300. package/src/cli/params.ts +0 -71
  301. package/src/cli/pluralize.ts +0 -41
  302. package/src/cli/positional.ts +0 -75
  303. package/src/cli/request-body.ts +0 -94
  304. package/src/cli/runtime/argv.ts +0 -14
  305. package/src/cli/runtime/auth/resolve.ts +0 -59
  306. package/src/cli/runtime/body-flags.ts +0 -176
  307. package/src/cli/runtime/body.ts +0 -24
  308. package/src/cli/runtime/collect.ts +0 -6
  309. package/src/cli/runtime/compat.ts +0 -89
  310. package/src/cli/runtime/context.ts +0 -62
  311. package/src/cli/runtime/execute.ts +0 -147
  312. package/src/cli/runtime/generated.ts +0 -242
  313. package/src/cli/runtime/headers.ts +0 -37
  314. package/src/cli/runtime/index.ts +0 -3
  315. package/src/cli/runtime/profile/secrets.ts +0 -83
  316. package/src/cli/runtime/profile/store.ts +0 -100
  317. package/src/cli/runtime/request.ts +0 -390
  318. package/src/cli/runtime/server-url.ts +0 -45
  319. package/src/cli/runtime/template.ts +0 -26
  320. package/src/cli/runtime/validate/ajv.ts +0 -13
  321. package/src/cli/runtime/validate/coerce.ts +0 -71
  322. package/src/cli/runtime/validate/error.ts +0 -29
  323. package/src/cli/runtime/validate/index.ts +0 -4
  324. package/src/cli/runtime/validate/schema.ts +0 -54
  325. package/src/cli/schema-shape.ts +0 -36
  326. package/src/cli/schema.ts +0 -76
  327. package/src/cli/server.ts +0 -88
  328. package/src/cli/spec-id.ts +0 -12
  329. package/src/cli/spec-loader.ts +0 -58
  330. package/src/cli/stable-json.ts +0 -35
  331. package/src/cli/strings.ts +0 -21
  332. package/src/cli/types.ts +0 -59
  333. package/src/macros/env.ts +0 -21
  334. package/src/macros/spec.ts +0 -17
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/cli/runtime/validate/schema.ts"],
4
- "sourcesContent": [
5
- "import type { CommandAction } from \"../../command-model.ts\";\nimport type { JsonSchema } from \"../../types.ts\";\n\nexport type ValidationSchemas = {\n\tquerySchema?: JsonSchema;\n\theaderSchema?: JsonSchema;\n\tcookieSchema?: JsonSchema;\n};\n\ntype ObjectSchema = {\n\ttype: \"object\";\n\tproperties: Record<string, JsonSchema>;\n\trequired?: string[];\n};\n\nexport function deriveValidationSchemas(\n\taction: CommandAction,\n): ValidationSchemas {\n\t// We validate only simple containers for now.\n\t// Deep style/encoding differences for OpenAPI params are out of scope for v1.\n\tconst query: ObjectSchema = { type: \"object\", properties: {}, required: [] };\n\tconst header: ObjectSchema = { type: \"object\", properties: {}, required: [] };\n\tconst cookie: ObjectSchema = { type: \"object\", properties: {}, required: [] };\n\n\tfor (const p of action.params) {\n\t\tif (p.kind !== \"flag\") continue;\n\t\tconst target =\n\t\t\tp.in === \"query\"\n\t\t\t\t? query\n\t\t\t\t: p.in === \"header\"\n\t\t\t\t\t? header\n\t\t\t\t\t: p.in === \"cookie\"\n\t\t\t\t\t\t? cookie\n\t\t\t\t\t\t: undefined;\n\t\tif (!target) continue;\n\n\t\tconst schema = p.schema ?? (p.type === \"unknown\" ? {} : { type: p.type });\n\t\ttarget.properties[p.name] = schema;\n\t\tif (p.required) {\n\t\t\tif (!target.required) target.required = [];\n\t\t\ttarget.required.push(p.name);\n\t\t}\n\t}\n\n\tif (!query.required?.length) delete query.required;\n\tif (!header.required?.length) delete header.required;\n\tif (!cookie.required?.length) delete cookie.required;\n\n\treturn {\n\t\tquerySchema: Object.keys(query.properties).length ? query : undefined,\n\t\theaderSchema: Object.keys(header.properties).length ? header : undefined,\n\t\tcookieSchema: Object.keys(cookie.properties).length ? cookie : undefined,\n\t};\n}\n"
6
- ],
7
- "mappings": ";AAeO,SAAS,uBAAuB,CACtC,QACoB;AAAA,EAGpB,MAAM,QAAsB,EAAE,MAAM,UAAU,YAAY,CAAC,GAAG,UAAU,CAAC,EAAE;AAAA,EAC3E,MAAM,SAAuB,EAAE,MAAM,UAAU,YAAY,CAAC,GAAG,UAAU,CAAC,EAAE;AAAA,EAC5E,MAAM,SAAuB,EAAE,MAAM,UAAU,YAAY,CAAC,GAAG,UAAU,CAAC,EAAE;AAAA,EAE5E,WAAW,KAAK,OAAO,QAAQ;AAAA,IAC9B,IAAI,EAAE,SAAS;AAAA,MAAQ;AAAA,IACvB,MAAM,SACL,EAAE,OAAO,UACN,QACA,EAAE,OAAO,WACR,SACA,EAAE,OAAO,WACR,SACA;AAAA,IACN,IAAI,CAAC;AAAA,MAAQ;AAAA,IAEb,MAAM,SAAS,EAAE,WAAW,EAAE,SAAS,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK;AAAA,IACvE,OAAO,WAAW,EAAE,QAAQ;AAAA,IAC5B,IAAI,EAAE,UAAU;AAAA,MACf,IAAI,CAAC,OAAO;AAAA,QAAU,OAAO,WAAW,CAAC;AAAA,MACzC,OAAO,SAAS,KAAK,EAAE,IAAI;AAAA,IAC5B;AAAA,EACD;AAAA,EAEA,IAAI,CAAC,MAAM,UAAU;AAAA,IAAQ,OAAO,MAAM;AAAA,EAC1C,IAAI,CAAC,OAAO,UAAU;AAAA,IAAQ,OAAO,OAAO;AAAA,EAC5C,IAAI,CAAC,OAAO,UAAU;AAAA,IAAQ,OAAO,OAAO;AAAA,EAE5C,OAAO;AAAA,IACN,aAAa,OAAO,KAAK,MAAM,UAAU,EAAE,SAAS,QAAQ;AAAA,IAC5D,cAAc,OAAO,KAAK,OAAO,UAAU,EAAE,SAAS,SAAS;AAAA,IAC/D,cAAc,OAAO,KAAK,OAAO,UAAU,EAAE,SAAS,SAAS;AAAA,EAChE;AAAA;",
8
- "debugId": "B7803722EF1A23FC64756E2164756E21",
9
- "names": []
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-shape.d.ts","sourceRoot":"","sources":["../../../src/cli/schema-shape.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAClB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,OAAO,GACP,QAAQ,GACR,SAAS,CAAC;AAEb,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAUxD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAInE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS,CAQ1E"}
@@ -1,41 +0,0 @@
1
- // src/cli/schema-shape.ts
2
- function getSchemaType(schema) {
3
- if (!schema || typeof schema !== "object")
4
- return "unknown";
5
- const t = schema.type;
6
- if (t === "string")
7
- return "string";
8
- if (t === "number")
9
- return "number";
10
- if (t === "integer")
11
- return "integer";
12
- if (t === "boolean")
13
- return "boolean";
14
- if (t === "array")
15
- return "array";
16
- if (t === "object")
17
- return "object";
18
- return "unknown";
19
- }
20
- function getSchemaFormat(schema) {
21
- if (!schema || typeof schema !== "object")
22
- return;
23
- const f = schema.format;
24
- return typeof f === "string" ? f : undefined;
25
- }
26
- function getSchemaEnumStrings(schema) {
27
- if (!schema || typeof schema !== "object")
28
- return;
29
- const e = schema.enum;
30
- if (!Array.isArray(e))
31
- return;
32
- const values = e.filter((v) => typeof v === "string");
33
- return values.length ? values : undefined;
34
- }
35
- export {
36
- getSchemaType,
37
- getSchemaFormat,
38
- getSchemaEnumStrings
39
- };
40
-
41
- //# debugId=8FA3BAE542EBDBEF64756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/schema-shape.ts"],
4
- "sourcesContent": [
5
- "export type ParamType =\n\t| \"string\"\n\t| \"number\"\n\t| \"integer\"\n\t| \"boolean\"\n\t| \"array\"\n\t| \"object\"\n\t| \"unknown\";\n\nexport function getSchemaType(schema: unknown): ParamType {\n\tif (!schema || typeof schema !== \"object\") return \"unknown\";\n\tconst t = (schema as { type?: unknown }).type;\n\tif (t === \"string\") return \"string\";\n\tif (t === \"number\") return \"number\";\n\tif (t === \"integer\") return \"integer\";\n\tif (t === \"boolean\") return \"boolean\";\n\tif (t === \"array\") return \"array\";\n\tif (t === \"object\") return \"object\";\n\treturn \"unknown\";\n}\n\nexport function getSchemaFormat(schema: unknown): string | undefined {\n\tif (!schema || typeof schema !== \"object\") return undefined;\n\tconst f = (schema as { format?: unknown }).format;\n\treturn typeof f === \"string\" ? f : undefined;\n}\n\nexport function getSchemaEnumStrings(schema: unknown): string[] | undefined {\n\tif (!schema || typeof schema !== \"object\") return undefined;\n\tconst e = (schema as { enum?: unknown }).enum;\n\tif (!Array.isArray(e)) return undefined;\n\n\t// We only surface string enums for now (enough for flag docs + completion).\n\tconst values = e.filter((v) => typeof v === \"string\") as string[];\n\treturn values.length ? values : undefined;\n}\n"
6
- ],
7
- "mappings": ";AASO,SAAS,aAAa,CAAC,QAA4B;AAAA,EACzD,IAAI,CAAC,UAAU,OAAO,WAAW;AAAA,IAAU,OAAO;AAAA,EAClD,MAAM,IAAK,OAA8B;AAAA,EACzC,IAAI,MAAM;AAAA,IAAU,OAAO;AAAA,EAC3B,IAAI,MAAM;AAAA,IAAU,OAAO;AAAA,EAC3B,IAAI,MAAM;AAAA,IAAW,OAAO;AAAA,EAC5B,IAAI,MAAM;AAAA,IAAW,OAAO;AAAA,EAC5B,IAAI,MAAM;AAAA,IAAS,OAAO;AAAA,EAC1B,IAAI,MAAM;AAAA,IAAU,OAAO;AAAA,EAC3B,OAAO;AAAA;AAGD,SAAS,eAAe,CAAC,QAAqC;AAAA,EACpE,IAAI,CAAC,UAAU,OAAO,WAAW;AAAA,IAAU;AAAA,EAC3C,MAAM,IAAK,OAAgC;AAAA,EAC3C,OAAO,OAAO,MAAM,WAAW,IAAI;AAAA;AAG7B,SAAS,oBAAoB,CAAC,QAAuC;AAAA,EAC3E,IAAI,CAAC,UAAU,OAAO,WAAW;AAAA,IAAU;AAAA,EAC3C,MAAM,IAAK,OAA8B;AAAA,EACzC,IAAI,CAAC,MAAM,QAAQ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CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACrC,YAAY,EACZ,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClE,CAAC;AAEF,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,mBAAmB,EAAE,EACjC,OAAO,EAAE,gBAAgB,EAAE,GAAG,SAAS,EACvC,OAAO,EAAE,UAAU,EAAE,EACrB,WAAW,EAAE,UAAU,EAAE,EACzB,QAAQ,EAAE,YAAY,GAAG,SAAS,EAClC,aAAa,EAAE,OAAO,oBAAoB,EAAE,aAAa,GAAG,SAAS,EACrE,YAAY,EAAE,YAAY,GACxB,YAAY,CAqBd;AAED,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,YAAY,GAClB,mBAAmB,CAQrB"}
@@ -1,38 +0,0 @@
1
- // src/cli/schema.ts
2
- function buildSchemaOutput(loaded, operations, planned, servers, authSchemes, commands, commandsIndex, capabilities) {
3
- return {
4
- schemaVersion: 1,
5
- openapi: {
6
- version: loaded.doc.openapi,
7
- title: loaded.doc.info?.title,
8
- infoVersion: loaded.doc.info?.version
9
- },
10
- spec: {
11
- id: loaded.id,
12
- fingerprint: loaded.fingerprint,
13
- source: loaded.source
14
- },
15
- capabilities,
16
- servers,
17
- authSchemes,
18
- operations,
19
- planned,
20
- commands,
21
- commandsIndex
22
- };
23
- }
24
- function toMinimalSchemaOutput(output) {
25
- return {
26
- schemaVersion: output.schemaVersion,
27
- openapi: output.openapi,
28
- spec: output.spec,
29
- capabilities: output.capabilities,
30
- commands: output.commands
31
- };
32
- }
33
- export {
34
- toMinimalSchemaOutput,
35
- buildSchemaOutput
36
- };
37
-
38
- //# debugId=FF74A06844E78B4164756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/schema.ts"],
4
- "sourcesContent": [
5
- "import type { AuthScheme } from \"./auth-schemes.ts\";\nimport type { Capabilities } from \"./capabilities.ts\";\nimport type { CommandModel } from \"./command-model.ts\";\nimport type { PlannedOperation } from \"./naming.ts\";\nimport type { ServerInfo } from \"./server.ts\";\nimport type { LoadedSpec, NormalizedOperation } from \"./types.ts\";\n\nexport type SchemaOutput = {\n\tschemaVersion: 1;\n\topenapi: {\n\t\tversion: string;\n\t\ttitle?: string;\n\t\tinfoVersion?: string;\n\t};\n\tspec: {\n\t\tid: string;\n\t\tfingerprint: string;\n\t\tsource: LoadedSpec[\"source\"];\n\t};\n\tcapabilities: Capabilities;\n\tservers: ServerInfo[];\n\tauthSchemes: AuthScheme[];\n\toperations: NormalizedOperation[];\n\tplanned?: PlannedOperation[];\n\tcommands?: CommandModel;\n\tcommandsIndex?: import(\"./command-index.ts\").CommandsIndex;\n};\n\nexport type MinimalSchemaOutput = Pick<\n\tSchemaOutput,\n\t\"schemaVersion\" | \"openapi\" | \"spec\" | \"capabilities\" | \"commands\"\n>;\n\nexport function buildSchemaOutput(\n\tloaded: LoadedSpec,\n\toperations: NormalizedOperation[],\n\tplanned: PlannedOperation[] | undefined,\n\tservers: ServerInfo[],\n\tauthSchemes: AuthScheme[],\n\tcommands: CommandModel | undefined,\n\tcommandsIndex: import(\"./command-index.ts\").CommandsIndex | undefined,\n\tcapabilities: Capabilities,\n): SchemaOutput {\n\treturn {\n\t\tschemaVersion: 1,\n\t\topenapi: {\n\t\t\tversion: loaded.doc.openapi,\n\t\t\ttitle: loaded.doc.info?.title,\n\t\t\tinfoVersion: loaded.doc.info?.version,\n\t\t},\n\t\tspec: {\n\t\t\tid: loaded.id,\n\t\t\tfingerprint: loaded.fingerprint,\n\t\t\tsource: loaded.source,\n\t\t},\n\t\tcapabilities,\n\t\tservers,\n\t\tauthSchemes,\n\t\toperations,\n\t\tplanned,\n\t\tcommands,\n\t\tcommandsIndex,\n\t};\n}\n\nexport function toMinimalSchemaOutput(\n\toutput: SchemaOutput,\n): MinimalSchemaOutput {\n\treturn {\n\t\tschemaVersion: output.schemaVersion,\n\t\topenapi: output.openapi,\n\t\tspec: output.spec,\n\t\tcapabilities: output.capabilities,\n\t\tcommands: output.commands,\n\t};\n}\n"
6
- ],
7
- "mappings": ";AAiCO,SAAS,iBAAiB,CAChC,QACA,YACA,SACA,SACA,aACA,UACA,eACA,cACe;AAAA,EACf,OAAO;AAAA,IACN,eAAe;AAAA,IACf,SAAS;AAAA,MACR,SAAS,OAAO,IAAI;AAAA,MACpB,OAAO,OAAO,IAAI,MAAM;AAAA,MACxB,aAAa,OAAO,IAAI,MAAM;AAAA,IAC/B;AAAA,IACA,MAAM;AAAA,MACL,IAAI,OAAO;AAAA,MACX,aAAa,OAAO;AAAA,MACpB,QAAQ,OAAO;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA;AAGM,SAAS,qBAAqB,CACpC,QACsB;AAAA,EACtB,OAAO;AAAA,IACN,eAAe,OAAO;AAAA,IACtB,SAAS,OAAO;AAAA,IAChB,MAAM,OAAO;AAAA,IACb,cAAc,OAAO;AAAA,IACrB,UAAU,OAAO;AAAA,EAClB;AAAA;",
8
- "debugId": "FF74A06844E78B4164756E2164756E21",
9
- "names": []
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/cli/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA2BF,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,EAAE,CAyCzD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAEvE"}
@@ -1,64 +0,0 @@
1
- // src/cli/schema-shape.ts
2
- function getSchemaEnumStrings(schema) {
3
- if (!schema || typeof schema !== "object")
4
- return;
5
- const e = schema.enum;
6
- if (!Array.isArray(e))
7
- return;
8
- const values = e.filter((v) => typeof v === "string");
9
- return values.length ? values : undefined;
10
- }
11
-
12
- // src/cli/server.ts
13
- function extractVariableNames(url) {
14
- const names = [];
15
- const re = /\{([^}]+)\}/g;
16
- while (true) {
17
- const match = re.exec(url);
18
- if (!match)
19
- break;
20
- names.push(match[1] ?? "");
21
- }
22
- return names.map((n) => n.trim()).filter(Boolean);
23
- }
24
- function listServers(doc) {
25
- const servers = doc.servers ?? [];
26
- const out = [];
27
- for (const raw of servers) {
28
- const s = raw;
29
- if (!s || typeof s !== "object")
30
- continue;
31
- if (typeof s.url !== "string")
32
- continue;
33
- const variableNames = extractVariableNames(s.url);
34
- const variables = [];
35
- const rawVars = s.variables && typeof s.variables === "object" && !Array.isArray(s.variables) ? s.variables : {};
36
- for (const name of variableNames) {
37
- const v = rawVars[name];
38
- const def = v?.default;
39
- const desc = v?.description;
40
- variables.push({
41
- name,
42
- default: typeof def === "string" ? def : undefined,
43
- enum: getSchemaEnumStrings(v),
44
- description: typeof desc === "string" ? desc : undefined
45
- });
46
- }
47
- out.push({
48
- url: s.url,
49
- description: typeof s.description === "string" ? s.description : undefined,
50
- variables,
51
- variableNames
52
- });
53
- }
54
- return out;
55
- }
56
- function getDefaultServerUrl(doc) {
57
- return listServers(doc)[0]?.url;
58
- }
59
- export {
60
- listServers,
61
- getDefaultServerUrl
62
- };
63
-
64
- //# debugId=48EC706FB473AF1D64756E2164756E21
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/schema-shape.ts", "../../../src/cli/server.ts"],
4
- "sourcesContent": [
5
- "export type ParamType =\n\t| \"string\"\n\t| \"number\"\n\t| \"integer\"\n\t| \"boolean\"\n\t| \"array\"\n\t| \"object\"\n\t| \"unknown\";\n\nexport function getSchemaType(schema: unknown): ParamType {\n\tif (!schema || typeof schema !== \"object\") return \"unknown\";\n\tconst t = (schema as { type?: unknown }).type;\n\tif (t === \"string\") return \"string\";\n\tif (t === \"number\") return \"number\";\n\tif (t === \"integer\") return \"integer\";\n\tif (t === \"boolean\") return \"boolean\";\n\tif (t === \"array\") return \"array\";\n\tif (t === \"object\") return \"object\";\n\treturn \"unknown\";\n}\n\nexport function getSchemaFormat(schema: unknown): string | undefined {\n\tif (!schema || typeof schema !== \"object\") return undefined;\n\tconst f = (schema as { format?: unknown }).format;\n\treturn typeof f === \"string\" ? f : undefined;\n}\n\nexport function getSchemaEnumStrings(schema: unknown): string[] | undefined {\n\tif (!schema || typeof schema !== \"object\") return undefined;\n\tconst e = (schema as { enum?: unknown }).enum;\n\tif (!Array.isArray(e)) return undefined;\n\n\t// We only surface string enums for now (enough for flag docs + completion).\n\tconst values = e.filter((v) => typeof v === \"string\") as string[];\n\treturn values.length ? values : undefined;\n}\n",
6
- "import { getSchemaEnumStrings } from \"./schema-shape.ts\";\nimport type { OpenApiDoc } from \"./types.ts\";\n\nexport type ServerVariable = {\n\tname: string;\n\tdefault?: string;\n\tenum?: string[];\n\tdescription?: string;\n};\n\nexport type ServerInfo = {\n\turl: string;\n\tdescription?: string;\n\tvariables: ServerVariable[];\n\tvariableNames: string[];\n};\n\ntype RawServerVariable = {\n\tdefault?: unknown;\n\tenum?: unknown;\n\tdescription?: unknown;\n};\n\ntype RawServer = {\n\turl?: unknown;\n\tdescription?: unknown;\n\tvariables?: unknown;\n};\n\nfunction extractVariableNames(url: string): string[] {\n\tconst names: string[] = [];\n\tconst re = /\\{([^}]+)\\}/g;\n\n\twhile (true) {\n\t\tconst match = re.exec(url);\n\t\tif (!match) break;\n\t\tnames.push(match[1] ?? \"\");\n\t}\n\n\treturn names.map((n) => n.trim()).filter(Boolean);\n}\n\nexport function listServers(doc: OpenApiDoc): ServerInfo[] {\n\tconst servers = doc.servers ?? [];\n\tconst out: ServerInfo[] = [];\n\n\tfor (const raw of servers) {\n\t\tconst s = raw as RawServer;\n\t\tif (!s || typeof s !== \"object\") continue;\n\t\tif (typeof s.url !== \"string\") continue;\n\n\t\tconst variableNames = extractVariableNames(s.url);\n\t\tconst variables: ServerVariable[] = [];\n\n\t\tconst rawVars =\n\t\t\ts.variables &&\n\t\t\ttypeof s.variables === \"object\" &&\n\t\t\t!Array.isArray(s.variables)\n\t\t\t\t? (s.variables as Record<string, RawServerVariable>)\n\t\t\t\t: {};\n\n\t\tfor (const name of variableNames) {\n\t\t\tconst v = rawVars[name];\n\t\t\tconst def = v?.default;\n\t\t\tconst desc = v?.description;\n\t\t\tvariables.push({\n\t\t\t\tname,\n\t\t\t\tdefault: typeof def === \"string\" ? def : undefined,\n\t\t\t\tenum: getSchemaEnumStrings(v),\n\t\t\t\tdescription: typeof desc === \"string\" ? desc : undefined,\n\t\t\t});\n\t\t}\n\n\t\tout.push({\n\t\t\turl: s.url,\n\t\t\tdescription:\n\t\t\t\ttypeof s.description === \"string\" ? s.description : undefined,\n\t\t\tvariables,\n\t\t\tvariableNames,\n\t\t});\n\t}\n\n\treturn out;\n}\n\nexport function getDefaultServerUrl(doc: OpenApiDoc): string | undefined {\n\treturn listServers(doc)[0]?.url;\n}\n"
7
- ],
8
- "mappings": ";AA2BO,SAAS,oBAAoB,CAAC,QAAuC;AAAA,EAC3E,IAAI,CAAC,UAAU,OAAO,WAAW;AAAA,IAAU;AAAA,EAC3C,MAAM,IAAK,OAA8B;AAAA,EACzC,IAAI,CAAC,MAAM,QAAQ,CAAC;AAAA,IAAG;AAAA,EAGvB,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM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,gBAAgB,WAAW,EAAE,cAAc;AAAA,MACrD;AAAA,MACA;AAAA,IACD,CAAC;AAAA,EACF;AAAA,EAEA,OAAO;AAAA;AAGD,SAAS,mBAAmB,CAAC,KAAqC;AAAA,EACxE,OAAO,YAAY,GAAG,EAAE,IAAI;AAAA;",
9
- "debugId": "48EC706FB473AF1D64756E2164756E21",
10
- "names": []
11
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec-id.d.ts","sourceRoot":"","sources":["../../../src/cli/spec-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,wBAAgB,SAAS,CACxB,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,aAAa,CAAC,GAC7C,MAAM,CAMR"}
@@ -1,21 +0,0 @@
1
- // src/cli/strings.ts
2
- function kebabCase(input) {
3
- const trimmed = input.trim();
4
- if (!trimmed)
5
- return "";
6
- return trimmed.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_.:/]+/g, "-").replace(/[^a-zA-Z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").toLowerCase();
7
- }
8
-
9
- // src/cli/spec-id.ts
10
- function getSpecId(loaded) {
11
- const title = loaded.doc.info?.title;
12
- const fromTitle = title ? kebabCase(title) : "";
13
- if (fromTitle)
14
- return fromTitle;
15
- return loaded.fingerprint.slice(0, 12);
16
- }
17
- export {
18
- getSpecId
19
- };
20
-
21
- //# debugId=A0EF73B41552326E64756E2164756E21
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/strings.ts", "../../../src/cli/spec-id.ts"],
4
- "sourcesContent": [
5
- "export function kebabCase(input: string): string {\n\tconst trimmed = input.trim();\n\tif (!trimmed) return \"\";\n\n\t// Convert spaces/underscores/dots to dashes, split camelCase.\n\treturn trimmed\n\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n\t\t.replace(/[\\s_.:/]+/g, \"-\")\n\t\t.replace(/[^a-zA-Z0-9-]/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.toLowerCase();\n}\n\nexport function titleCase(input: string): string {\n\treturn input\n\t\t.split(/\\s+/g)\n\t\t.filter(Boolean)\n\t\t.map((w) => w[0]?.toUpperCase() + w.slice(1))\n\t\t.join(\" \");\n}\n",
6
- "import { kebabCase } from \"./strings.ts\";\nimport type { LoadedSpec } from \"./types.ts\";\n\nexport function getSpecId(\n\tloaded: Pick<LoadedSpec, \"doc\" | \"fingerprint\">,\n): string {\n\tconst title = loaded.doc.info?.title;\n\tconst fromTitle = title ? kebabCase(title) : \"\";\n\tif (fromTitle) return fromTitle;\n\n\treturn loaded.fingerprint.slice(0, 12);\n}\n"
7
- ],
8
- "mappings": ";AAAO,SAAS,SAAS,CAAC,OAAuB;AAAA,EAChD,MAAM,UAAU,MAAM,KAAK;AAAA,EAC3B,IAAI,CAAC;AAAA,IAAS,OAAO;AAAA,EAGrB,OAAO,QACL,QAAQ,sBAAsB,OAAO,EACrC,QAAQ,cAAc,GAAG,EACzB,QAAQ,kBAAkB,GAAG,EAC7B,QAAQ,OAAO,GAAG,EAClB,QAAQ,UAAU,EAAE,EACpB,YAAY;AAAA;;;ACRR,SAAS,SAAS,CACxB,QACS;AAAA,EACT,MAAM,QAAQ,OAAO,IAAI,MAAM;AAAA,EAC/B,MAAM,YAAY,QAAQ,UAAU,KAAK,IAAI;AAAA,EAC7C,IAAI;AAAA,IAAW,OAAO;AAAA,EAEtB,OAAO,OAAO,YAAY,MAAM,GAAG,EAAE;AAAA;",
9
- "debugId": "A0EF73B41552326E64756E2164756E21",
10
- "names": []
11
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"spec-loader.d.ts","sourceRoot":"","sources":["../../../src/cli/spec-loader.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAA0B,MAAM,YAAY,CAAC;AAErE,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAeF,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CA+B5E"}
@@ -1,110 +0,0 @@
1
- // src/cli/spec-loader.ts
2
- import SwaggerParser from "@apidevtools/swagger-parser";
3
-
4
- // src/cli/crypto.ts
5
- async function sha256Hex(text) {
6
- const data = new TextEncoder().encode(text);
7
- const hash = await crypto.subtle.digest("SHA-256", data);
8
- const bytes = new Uint8Array(hash);
9
- let out = "";
10
- for (const b of bytes)
11
- out += b.toString(16).padStart(2, "0");
12
- return out;
13
- }
14
-
15
- // src/cli/runtime/compat.ts
16
- import { parse as parseYaml } from "yaml";
17
- var isBun = typeof globalThis.Bun !== "undefined";
18
- function parseYamlContent(text) {
19
- if (isBun) {
20
- const { YAML } = globalThis.Bun;
21
- return YAML.parse(text);
22
- }
23
- return parseYaml(text);
24
- }
25
-
26
- // src/cli/strings.ts
27
- function kebabCase(input) {
28
- const trimmed = input.trim();
29
- if (!trimmed)
30
- return "";
31
- return trimmed.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_.:/]+/g, "-").replace(/[^a-zA-Z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").toLowerCase();
32
- }
33
-
34
- // src/cli/spec-id.ts
35
- function getSpecId(loaded) {
36
- const title = loaded.doc.info?.title;
37
- const fromTitle = title ? kebabCase(title) : "";
38
- if (fromTitle)
39
- return fromTitle;
40
- return loaded.fingerprint.slice(0, 12);
41
- }
42
-
43
- // src/cli/stable-json.ts
44
- function stableStringify(value, options) {
45
- const visiting = new WeakSet;
46
- return JSON.stringify(sort(value, visiting), null, options?.space);
47
- }
48
- function sort(value, visiting) {
49
- if (value === null)
50
- return null;
51
- if (Array.isArray(value)) {
52
- if (visiting.has(value))
53
- return { __specli_circular: true };
54
- visiting.add(value);
55
- const out = value.map((v) => sort(v, visiting));
56
- visiting.delete(value);
57
- return out;
58
- }
59
- if (typeof value === "object") {
60
- if (visiting.has(value))
61
- return { __specli_circular: true };
62
- visiting.add(value);
63
- const obj = value;
64
- const out = {};
65
- for (const key of Object.keys(obj).sort()) {
66
- out[key] = sort(obj[key], visiting);
67
- }
68
- visiting.delete(value);
69
- return out;
70
- }
71
- return value;
72
- }
73
-
74
- // src/cli/spec-loader.ts
75
- function isProbablyUrl(input) {
76
- return /^https?:\/\//i.test(input);
77
- }
78
- function parseSpecText(text) {
79
- const trimmed = text.trimStart();
80
- if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
81
- return JSON.parse(text);
82
- }
83
- return parseYamlContent(text);
84
- }
85
- async function loadSpec(options) {
86
- const { spec, embeddedSpecText } = options;
87
- let source;
88
- let inputForParser;
89
- if (typeof embeddedSpecText === "string") {
90
- source = "embedded";
91
- inputForParser = parseSpecText(embeddedSpecText);
92
- } else if (spec) {
93
- source = isProbablyUrl(spec) ? "url" : "file";
94
- inputForParser = spec;
95
- } else {
96
- throw new Error("Missing spec. Provide --spec <url|path> or build with an embedded spec.");
97
- }
98
- const doc = await SwaggerParser.dereference(inputForParser);
99
- if (!doc || typeof doc !== "object" || typeof doc.openapi !== "string") {
100
- throw new Error("Loaded spec is not a valid OpenAPI document");
101
- }
102
- const fingerprint = await sha256Hex(stableStringify(doc));
103
- const id = getSpecId({ doc, fingerprint });
104
- return { source, id, fingerprint, doc };
105
- }
106
- export {
107
- loadSpec
108
- };
109
-
110
- //# debugId=2E9579CCB8CDDEED64756E2164756E21
@@ -1,15 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/spec-loader.ts", "../../../src/cli/crypto.ts", "../../../src/cli/runtime/compat.ts", "../../../src/cli/strings.ts", "../../../src/cli/spec-id.ts", "../../../src/cli/stable-json.ts"],
4
- "sourcesContent": [
5
- "import SwaggerParser from \"@apidevtools/swagger-parser\";\n\nimport { sha256Hex } from \"./crypto.ts\";\nimport { parseYamlContent } from \"./runtime/compat.ts\";\nimport { getSpecId } from \"./spec-id.ts\";\nimport { stableStringify } from \"./stable-json.ts\";\nimport type { LoadedSpec, OpenApiDoc, SpecSource } from \"./types.ts\";\n\nexport type LoadSpecOptions = {\n\tspec?: string;\n\tembeddedSpecText?: string;\n};\n\nfunction isProbablyUrl(input: string): boolean {\n\treturn /^https?:\\/\\//i.test(input);\n}\n\nfunction parseSpecText(text: string): unknown {\n\tconst trimmed = text.trimStart();\n\tif (trimmed.startsWith(\"{\") || trimmed.startsWith(\"[\")) {\n\t\treturn JSON.parse(text);\n\t}\n\n\treturn parseYamlContent(text);\n}\n\nexport async function loadSpec(options: LoadSpecOptions): Promise<LoadedSpec> {\n\tconst { spec, embeddedSpecText } = options;\n\n\tlet source: SpecSource;\n\tlet inputForParser: unknown;\n\n\tif (typeof embeddedSpecText === \"string\") {\n\t\tsource = \"embedded\";\n\t\tinputForParser = parseSpecText(embeddedSpecText);\n\t} else if (spec) {\n\t\tsource = isProbablyUrl(spec) ? \"url\" : \"file\";\n\t\tinputForParser = spec;\n\t} else {\n\t\tthrow new Error(\n\t\t\t\"Missing spec. Provide --spec <url|path> or build with an embedded spec.\",\n\t\t);\n\t}\n\n\tconst doc = (await SwaggerParser.dereference(\n\t\t// biome-ignore lint/suspicious/noExplicitAny: unknown\n\t\tinputForParser as any,\n\t)) as OpenApiDoc;\n\n\tif (!doc || typeof doc !== \"object\" || typeof doc.openapi !== \"string\") {\n\t\tthrow new Error(\"Loaded spec is not a valid OpenAPI document\");\n\t}\n\n\tconst fingerprint = await sha256Hex(stableStringify(doc));\n\tconst id = getSpecId({ doc, fingerprint });\n\n\treturn { source, id, fingerprint, doc };\n}\n",
6
- "export async function sha256Hex(text: string): Promise<string> {\n\tconst data = new TextEncoder().encode(text);\n\tconst hash = await crypto.subtle.digest(\"SHA-256\", data);\n\tconst bytes = new Uint8Array(hash);\n\n\tlet out = \"\";\n\tfor (const b of bytes) out += b.toString(16).padStart(2, \"0\");\n\treturn out;\n}\n",
7
- "/**\n * Cross-runtime compatibility utilities for Bun and Node.js\n *\n * This module provides abstractions over Bun-specific APIs to allow\n * the exec command to run in Node.js while compile remains Bun-only.\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { parse as parseYaml } from \"yaml\";\n\n/**\n * Detect if we're running in Bun\n */\nexport const isBun = typeof globalThis.Bun !== \"undefined\";\n\n/**\n * Read a file's text content - works in both Bun and Node.js\n */\nexport async function readFileText(path: string): Promise<string> {\n\tif (isBun) {\n\t\treturn Bun.file(path).text();\n\t}\n\treturn readFileSync(path, \"utf-8\");\n}\n\n/**\n * Check if a file exists - works in both Bun and Node.js\n */\nexport async function fileExists(path: string): Promise<boolean> {\n\tif (isBun) {\n\t\treturn Bun.file(path).exists();\n\t}\n\treturn existsSync(path);\n}\n\n/**\n * Write text to a file - works in both Bun and Node.js\n */\nexport async function writeFileText(\n\tpath: string,\n\tcontent: string,\n): Promise<void> {\n\tif (isBun) {\n\t\tawait Bun.write(path, content);\n\t\treturn;\n\t}\n\twriteFileSync(path, content, \"utf-8\");\n}\n\n/**\n * Create directory recursively - works in both Bun and Node.js\n */\nexport async function mkdirp(path: string): Promise<void> {\n\tif (isBun) {\n\t\tawait Bun.$`mkdir -p ${path}`;\n\t\treturn;\n\t}\n\tmkdirSync(path, { recursive: true });\n}\n\n/**\n * Parse YAML content - works in both Bun and Node.js\n */\nexport function parseYamlContent(text: string): unknown {\n\tif (isBun) {\n\t\tconst { YAML } = globalThis.Bun;\n\t\treturn YAML.parse(text);\n\t}\n\treturn parseYaml(text);\n}\n\n/**\n * Read from stdin - works in both Bun and Node.js\n */\nexport async function readStdinText(): Promise<string> {\n\tif (isBun) {\n\t\treturn Bun.stdin.text();\n\t}\n\t// Node.js stdin reading\n\treturn new Promise((resolve, reject) => {\n\t\tlet data = \"\";\n\t\tprocess.stdin.setEncoding(\"utf8\");\n\t\tprocess.stdin.on(\"data\", (chunk) => {\n\t\t\tdata += chunk;\n\t\t});\n\t\tprocess.stdin.on(\"end\", () => resolve(data));\n\t\tprocess.stdin.on(\"error\", reject);\n\t});\n}\n",
8
- "export function kebabCase(input: string): string {\n\tconst trimmed = input.trim();\n\tif (!trimmed) return \"\";\n\n\t// Convert spaces/underscores/dots to dashes, split camelCase.\n\treturn trimmed\n\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n\t\t.replace(/[\\s_.:/]+/g, \"-\")\n\t\t.replace(/[^a-zA-Z0-9-]/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.toLowerCase();\n}\n\nexport function titleCase(input: string): string {\n\treturn input\n\t\t.split(/\\s+/g)\n\t\t.filter(Boolean)\n\t\t.map((w) => w[0]?.toUpperCase() + w.slice(1))\n\t\t.join(\" \");\n}\n",
9
- "import { kebabCase } from \"./strings.ts\";\nimport type { LoadedSpec } from \"./types.ts\";\n\nexport function getSpecId(\n\tloaded: Pick<LoadedSpec, \"doc\" | \"fingerprint\">,\n): string {\n\tconst title = loaded.doc.info?.title;\n\tconst fromTitle = title ? kebabCase(title) : \"\";\n\tif (fromTitle) return fromTitle;\n\n\treturn loaded.fingerprint.slice(0, 12);\n}\n",
10
- "export function stableStringify(\n\tvalue: unknown,\n\toptions?: { space?: number },\n): string {\n\tconst visiting = new WeakSet<object>();\n\treturn JSON.stringify(sort(value, visiting), null, options?.space);\n}\n\nfunction sort(value: unknown, visiting: WeakSet<object>): unknown {\n\tif (value === null) return null;\n\n\tif (Array.isArray(value)) {\n\t\tif (visiting.has(value)) return { __specli_circular: true };\n\t\tvisiting.add(value);\n\t\tconst out = value.map((v) => sort(v, visiting));\n\t\tvisiting.delete(value);\n\t\treturn out;\n\t}\n\n\tif (typeof value === \"object\") {\n\t\tif (visiting.has(value)) return { __specli_circular: true };\n\t\tvisiting.add(value);\n\n\t\tconst obj = value as Record<string, unknown>;\n\t\tconst out: Record<string, unknown> = {};\n\t\tfor (const key of Object.keys(obj).sort()) {\n\t\t\tout[key] = sort(obj[key], visiting);\n\t\t}\n\n\t\tvisiting.delete(value);\n\t\treturn out;\n\t}\n\n\treturn value;\n}\n"
11
- ],
12
- "mappings": ";AAAA;;;ACAA,eAAsB,SAAS,CAAC,MAA+B;AAAA,EAC9D,MAAM,OAAO,IAAI,YAAY,EAAE,OAAO,IAAI;AAAA,EAC1C,MAAM,OAAO,MAAM,OAAO,OAAO,OAAO,WAAW,IAAI;AAAA,EACvD,MAAM,QAAQ,IAAI,WAAW,IAAI;AAAA,EAEjC,IAAI,MAAM;AAAA,EACV,WAAW,KAAK;AAAA,IAAO,OAAO,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AAAA,EAC5D,OAAO;AAAA;;;ACCR,kBAAS;AAKF,IAAM,QAAQ,OAAO,WAAW,QAAQ;AAkDxC,SAAS,gBAAgB,CAAC,MAAuB;AAAA,EACvD,IAAI,OAAO;AAAA,IACV,QAAQ,SAAS,WAAW;AAAA,IAC5B,OAAO,KAAK,MAAM,IAAI;AAAA,EACvB;AAAA,EACA,OAAO,UAAU,IAAI;AAAA;;;ACpEf,SAAS,SAAS,CAAC,OAAuB;AAAA,EAChD,MAAM,UAAU,MAAM,KAAK;AAAA,EAC3B,IAAI,CAAC;AAAA,IAAS,OAAO;AAAA,EAGrB,OAAO,QACL,QAAQ,sBAAsB,OAAO,EACrC,QAAQ,cAAc,GAAG,EACzB,QAAQ,kBAAkB,GAAG,EAC7B,QAAQ,OAAO,GAAG,EAClB,QAAQ,UAAU,EAAE,EACpB,YAAY;AAAA;;;ACRR,SAAS,SAAS,CACxB,QACS;AAAA,EACT,MAAM,QAAQ,OAAO,IAAI,MAAM;AAAA,EAC/B,MAAM,YAAY,QAAQ,UAAU,KAAK,IAAI;AAAA,EAC7C,IAAI;AAAA,IAAW,OAAO;AAAA,EAEtB,OAAO,OAAO,YAAY,MAAM,GAAG,EAAE;AAAA;;;ACV/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AAQ,CAAC,SAA+C;AAAA,EAC7E,QAAQ,MAAM,qBAAqB;AAAA,EAEnC,IAAI;AAAA,EACJ,IAAI;AAAA,EAEJ,IAAI,OAAO,qBAAqB,UAAU;AAAA,IACzC,SAAS;AAAA,IACT,iBAAiB,cAAc,gBAAgB;AAAA,EAChD,EAAO,SAAI,MAAM;AAAA,IAChB,SAAS,cAAc,IAAI,IAAI,QAAQ;AAAA,IACvC,iBAAiB;AAAA,EAClB,EAAO;AAAA,IACN,MAAM,IAAI,MACT,yEACD;AAAA;AAAA,EAGD,MAAM,MAAO,MAAM,cAAc,YAEhC,cACD;AAAA,EAEA,IAAI,CAAC,OAAO,OAAO,QAAQ,YAAY,OAAO,IAAI,YAAY,UAAU;AAAA,IACvE,MAAM,IAAI,MAAM,6CAA6C;AAAA,EAC9D;AAAA,EAEA,MAAM,cAAc,MAAM,UAAU,gBAAgB,GAAG,CAAC;AAAA,EACxD,MAAM,KAAK,UAAU,EAAE,KAAK,YAAY,CAAC;AAAA,EAEzC,OAAO,EAAE,QAAQ,IAAI,aAAa,IAAI;AAAA;",
13
- "debugId": "2E9579CCB8CDDEED64756E2164756E21",
14
- "names": []
15
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"stable-json.d.ts","sourceRoot":"","sources":["../../../src/cli/stable-json.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAC9B,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B,MAAM,CAGR"}
@@ -1,35 +0,0 @@
1
- // src/cli/stable-json.ts
2
- function stableStringify(value, options) {
3
- const visiting = new WeakSet;
4
- return JSON.stringify(sort(value, visiting), null, options?.space);
5
- }
6
- function sort(value, visiting) {
7
- if (value === null)
8
- return null;
9
- if (Array.isArray(value)) {
10
- if (visiting.has(value))
11
- return { __specli_circular: true };
12
- visiting.add(value);
13
- const out = value.map((v) => sort(v, visiting));
14
- visiting.delete(value);
15
- return out;
16
- }
17
- if (typeof value === "object") {
18
- if (visiting.has(value))
19
- return { __specli_circular: true };
20
- visiting.add(value);
21
- const obj = value;
22
- const out = {};
23
- for (const key of Object.keys(obj).sort()) {
24
- out[key] = sort(obj[key], visiting);
25
- }
26
- visiting.delete(value);
27
- return out;
28
- }
29
- return value;
30
- }
31
- export {
32
- stableStringify
33
- };
34
-
35
- //# debugId=4C2A1B7ECCB1A47264756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/stable-json.ts"],
4
- "sourcesContent": [
5
- "export function stableStringify(\n\tvalue: unknown,\n\toptions?: { space?: number },\n): string {\n\tconst visiting = new WeakSet<object>();\n\treturn JSON.stringify(sort(value, visiting), null, options?.space);\n}\n\nfunction sort(value: unknown, visiting: WeakSet<object>): unknown {\n\tif (value === null) return null;\n\n\tif (Array.isArray(value)) {\n\t\tif (visiting.has(value)) return { __specli_circular: true };\n\t\tvisiting.add(value);\n\t\tconst out = value.map((v) => sort(v, visiting));\n\t\tvisiting.delete(value);\n\t\treturn out;\n\t}\n\n\tif (typeof value === \"object\") {\n\t\tif (visiting.has(value)) return { __specli_circular: true };\n\t\tvisiting.add(value);\n\n\t\tconst obj = value as Record<string, unknown>;\n\t\tconst out: Record<string, unknown> = {};\n\t\tfor (const key of Object.keys(obj).sort()) {\n\t\t\tout[key] = sort(obj[key], visiting);\n\t\t}\n\n\t\tvisiting.delete(value);\n\t\treturn out;\n\t}\n\n\treturn value;\n}\n"
6
- ],
7
- "mappings": ";AAAO,SAAS,eAAe,CAC9B,OACA,SACS;AAAA,EACT,MAAM,WAAW,IAAI;AAAA,EACrB,OAAO,KAAK,UAAU,KAAK,OAAO,QAAQ,GAAG,MAAM,SAAS,KAAK;AAAA;AAGlE,SAAS,IAAI,CAAC,OAAgB,UAAoC;AAAA,EACjE,IAAI,UAAU;AAAA,IAAM,OAAO;AAAA,EAE3B,IAAI,MAAM,QAAQ,KAAK,GAAG;AAAA,IACzB,IAAI,SAAS,IAAI,KAAK;AAAA,MAAG,OAAO,EAAE,mBAAmB,KAAK;AAAA,IAC1D,SAAS,IAAI,KAAK;AAAA,IAClB,MAAM,MAAM,MAAM,IAAI,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC;AAAA,IAC9C,SAAS,OAAO,KAAK;AAAA,IACrB,OAAO;AAAA,EACR;AAAA,EAEA,IAAI,OAAO,UAAU,UAAU;AAAA,IAC9B,IAAI,SAAS,IAAI,KAAK;AAAA,MAAG,OAAO,EAAE,mBAAmB,KAAK;AAAA,IAC1D,SAAS,IAAI,KAAK;AAAA,IAElB,MAAM,MAAM;AAAA,IACZ,MAAM,MAA+B,CAAC;AAAA,IACtC,WAAW,OAAO,OAAO,KAAK,GAAG,EAAE,KAAK,GAAG;AAAA,MAC1C,IAAI,OAAO,KAAK,IAAI,MAAM,QAAQ;AAAA,IACnC;AAAA,IAEA,SAAS,OAAO,KAAK;AAAA,IACrB,OAAO;AAAA,EACR;AAAA,EAEA,OAAO;AAAA;",
8
- "debugId": "4C2A1B7ECCB1A47264756E2164756E21",
9
- "names": []
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../src/cli/strings.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY/C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM/C"}
@@ -1,16 +0,0 @@
1
- // src/cli/strings.ts
2
- function kebabCase(input) {
3
- const trimmed = input.trim();
4
- if (!trimmed)
5
- return "";
6
- return trimmed.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_.:/]+/g, "-").replace(/[^a-zA-Z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").toLowerCase();
7
- }
8
- function titleCase(input) {
9
- return input.split(/\s+/g).filter(Boolean).map((w) => w[0]?.toUpperCase() + w.slice(1)).join(" ");
10
- }
11
- export {
12
- titleCase,
13
- kebabCase
14
- };
15
-
16
- //# debugId=F97990A7FD34C33764756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/strings.ts"],
4
- "sourcesContent": [
5
- "export function kebabCase(input: string): string {\n\tconst trimmed = input.trim();\n\tif (!trimmed) return \"\";\n\n\t// Convert spaces/underscores/dots to dashes, split camelCase.\n\treturn trimmed\n\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n\t\t.replace(/[\\s_.:/]+/g, \"-\")\n\t\t.replace(/[^a-zA-Z0-9-]/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.toLowerCase();\n}\n\nexport function titleCase(input: string): string {\n\treturn input\n\t\t.split(/\\s+/g)\n\t\t.filter(Boolean)\n\t\t.map((w) => w[0]?.toUpperCase() + w.slice(1))\n\t\t.join(\" \");\n}\n"
6
- ],
7
- "mappings": ";AAAO,SAAS,SAAS,CAAC,OAAuB;AAAA,EAChD,MAAM,UAAU,MAAM,KAAK;AAAA,EAC3B,IAAI,CAAC;AAAA,IAAS,OAAO;AAAA,EAGrB,OAAO,QACL,QAAQ,sBAAsB,OAAO,EACrC,QAAQ,cAAc,GAAG,EACzB,QAAQ,kBAAkB,GAAG,EAC7B,QAAQ,OAAO,GAAG,EAClB,QAAQ,UAAU,EAAE,EACpB,YAAY;AAAA;AAGR,SAAS,SAAS,CAAC,OAAuB;AAAA,EAChD,OAAO,MACL,MAAM,MAAM,EACZ,OAAO,OAAO,EACd,IAAI,CAAC,MAAM,EAAE,IAAI,YAAY,IAAI,EAAE,MAAM,CAAC,CAAC,EAC3C,KAAK,GAAG;AAAA;",
8
- "debugId": "F97990A7FD34C33764756E2164756E21",
9
- "names": []
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,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AS,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,UAAU,CAAC;CAChB,CAAC"}
@@ -1,9 +0,0 @@
1
- // src/cli/types.ts
2
- function isJsonSchema(value) {
3
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
4
- }
5
- export {
6
- isJsonSchema
7
- };
8
-
9
- //# debugId=D591F75F6084972664756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/cli/types.ts"],
4
- "sourcesContent": [
5
- "export type SpecSource = \"embedded\" | \"file\" | \"url\";\n\nexport type SecurityRequirement = Record<string, string[]>;\n\nexport type OpenApiDoc = {\n\topenapi: string;\n\tinfo?: {\n\t\ttitle?: string;\n\t\tversion?: string;\n\t};\n\tservers?: Array<{ url: string; description?: string; variables?: unknown }>;\n\tsecurity?: SecurityRequirement[];\n\tcomponents?: {\n\t\tsecuritySchemes?: Record<string, unknown>;\n\t};\n\tpaths?: Record<string, unknown>;\n};\n\nexport type NormalizedParameter = {\n\tin: \"path\" | \"query\" | \"header\" | \"cookie\";\n\tname: string;\n\trequired: boolean;\n\tdescription?: string;\n\tschema?: unknown;\n};\n\n// Minimal JSON Schema-like shape for validation and flag expansion.\nexport type JsonSchema = Record<string, unknown>;\n\nexport function isJsonSchema(value: unknown): value is JsonSchema {\n\treturn Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nexport type NormalizedRequestBody = {\n\trequired: boolean;\n\tcontentTypes: string[];\n\tschemasByContentType: Record<string, unknown | undefined>;\n};\n\nexport type NormalizedOperation = {\n\tkey: string;\n\tmethod: string;\n\tpath: string;\n\toperationId?: string;\n\ttags: string[];\n\tsummary?: string;\n\tdescription?: string;\n\tdeprecated?: boolean;\n\tsecurity?: SecurityRequirement[];\n\tparameters: NormalizedParameter[];\n\trequestBody?: NormalizedRequestBody;\n};\n\nexport type LoadedSpec = {\n\tsource: SpecSource;\n\tid: string;\n\tfingerprint: string;\n\tdoc: OpenApiDoc;\n};\n"
6
- ],
7
- "mappings": ";AA6BO,SAAS,YAAY,CAAC,OAAqC;AAAA,EACjE,OAAO,QAAQ,KAAK,KAAK,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAAA;",
8
- "debugId": "D591F75F6084972664756E2164756E21",
9
- "names": []
10
- }
package/index.ts DELETED
@@ -1 +0,0 @@
1
- export { main } from "./src/cli/main.ts";