vitepress-openapi 0.2.15 → 0.2.17

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 (263) hide show
  1. package/dist/{OAJSONEditor-BPdzinnW.js → OAJSONEditor-6uG2SFZK.js} +6 -6
  2. package/dist/{OAJSONEditor-cdYfH8pW.cjs → OAJSONEditor-D-Yhb6db.cjs} +4 -4
  3. package/dist/{angular-html-D5QwJSjx.js → angular-html-BUsdri4u.js} +2 -2
  4. package/dist/angular-html-BzD9NQW5.cjs +1 -0
  5. package/dist/{angular-ts-CXuTnAMH.cjs → angular-ts-D1fX05LE.cjs} +1 -1
  6. package/dist/{angular-ts-B0kZpGGd.js → angular-ts-DLzsnsUB.js} +2 -2
  7. package/dist/{apl-CjAWNKej.cjs → apl-Bo4qJ495.cjs} +1 -1
  8. package/dist/{apl-CO2hi6pu.js → apl-D9bD1gNv.js} +5 -5
  9. package/dist/{astro-C8AbPvmY.js → astro-D8q6Gy7P.js} +5 -5
  10. package/dist/{astro-C6WzLepe.cjs → astro-DCjm-pbh.cjs} +1 -1
  11. package/dist/{blade-bJOeoSe0.cjs → blade-B6fombNo.cjs} +1 -1
  12. package/dist/{blade-B3TXqIqP.js → blade-Sc601tfi.js} +7 -7
  13. package/dist/{c-BTzN4Ylc.js → c-CfqZXQ2T.js} +1 -1
  14. package/dist/c-Dn__oIvS.cjs +1 -0
  15. package/dist/{chapel-D3SOeXgF.cjs → chapel-D7VyqyYt.cjs} +1 -1
  16. package/dist/{chapel-DqUUkRYq.js → chapel-xSzmwfXQ.js} +1 -1
  17. package/dist/{cobol-dlQjEakv.cjs → cobol-CAKxSKZT.cjs} +1 -1
  18. package/dist/{cobol-DFLW8ca0.js → cobol-CHAgZDLS.js} +2 -2
  19. package/dist/{coffee-1KoIHtzW.js → coffee-CeAuLo4O.js} +1 -1
  20. package/dist/{coffee-TUzF5uor.cjs → coffee-JnCJAydr.cjs} +1 -1
  21. package/dist/{core-x4pNOQS7.cjs → core-CNg5cW98.cjs} +3 -3
  22. package/dist/{core-CSILRXKH.js → core-s1UIPu_z.js} +114 -114
  23. package/dist/cpp-1aC9AELp.cjs +1 -0
  24. package/dist/{cpp-yEMsPd-1.js → cpp-DAEET6ev.js} +3 -3
  25. package/dist/{crystal-D_nHX3jS.cjs → crystal-BfArRaXr.cjs} +1 -1
  26. package/dist/{crystal-CENIitzj.js → crystal-C1qz7UnE.js} +6 -6
  27. package/dist/css-BVuZPxTF.cjs +1 -0
  28. package/dist/{css-B-WLUKlS.js → css-BZAFXxqD.js} +1 -1
  29. package/dist/{dist-BxzxjMCz.cjs → dist-CpZb0vTN.cjs} +5 -5
  30. package/dist/{dist-C1v4Xm4x.js → dist-DV8PoRsD.js} +1 -1
  31. package/dist/{edge-BEj_2N8x.js → edge-CWZ5MU2M.js} +3 -3
  32. package/dist/{edge-f2PDRzgK.cjs → edge-JzsrLjb_.cjs} +1 -1
  33. package/dist/{elixir-CQkxmVTM.js → elixir-Crtqxz1W.js} +1 -1
  34. package/dist/{elixir-CIcaqRsY.cjs → elixir-QzvqYFsV.cjs} +1 -1
  35. package/dist/{elm-DzGi_nR3.js → elm-9rlZJ0du.js} +1 -1
  36. package/dist/{elm-7G0I-hE6.cjs → elm-DTTDc-PO.cjs} +1 -1
  37. package/dist/{engine-javascript-DSMQf2z2.js → engine-javascript-CoT6aZfI.js} +2 -2
  38. package/dist/{engine-javascript-DsJlQOsE.cjs → engine-javascript-DWPOYZRs.cjs} +2 -2
  39. package/dist/{erb-COP2UPZ7.js → erb-C6UwauYe.js} +2 -2
  40. package/dist/{erb-B9-cGaTm.cjs → erb-DPWXQYaP.cjs} +1 -1
  41. package/dist/generate-BAgVJTNQ.js +103 -0
  42. package/dist/generate-BVoluROJ.cjs +1 -0
  43. package/dist/generateMarkdown-BYnrcWs0.js +692 -0
  44. package/dist/generateMarkdown-DyJdABwj.cjs +31 -0
  45. package/dist/{git-rebase-Ku61ihN2.cjs → git-rebase-Cwp0uWvv.cjs} +1 -1
  46. package/dist/{git-rebase-DTYLKCWV.js → git-rebase-xIgRvJ_q.js} +1 -1
  47. package/dist/{glimmer-js-D29AEl8t.js → glimmer-js-CNGdvMhA.js} +4 -4
  48. package/dist/{glimmer-js-izmglT1O.cjs → glimmer-js-Df_yNNoE.cjs} +1 -1
  49. package/dist/{glimmer-ts-DYj3qCHB.js → glimmer-ts-Dq4P7Mkf.js} +4 -4
  50. package/dist/{glimmer-ts-DJ1fakxz.cjs → glimmer-ts-DsAOmOGY.cjs} +1 -1
  51. package/dist/glsl-CjiF-xkH.cjs +1 -0
  52. package/dist/{glsl-Bc6nFncG.js → glsl-DZfvb15l.js} +2 -2
  53. package/dist/{graphql-Ds5Ubte9.js → graphql-CZmb-US9.js} +5 -5
  54. package/dist/graphql-r7AX53Pp.cjs +1 -0
  55. package/dist/{hack-DlUSG6ek.cjs → hack-Cs2ncrxq.cjs} +1 -1
  56. package/dist/{hack-B6E-ISVN.js → hack-DIIRgI4h.js} +2 -2
  57. package/dist/haml-3bvHwbYf.cjs +1 -0
  58. package/dist/{haml-DSK5muqV.js → haml-aboBnjLl.js} +3 -3
  59. package/dist/{handlebars-BxmkFTU3.cjs → handlebars-C7PZ80pQ.cjs} +1 -1
  60. package/dist/{handlebars-CGjGomme.js → handlebars-Z3oHMxHt.js} +4 -4
  61. package/dist/html-CtaiB3Oi.cjs +1 -0
  62. package/dist/{html-DvKVaMAh.js → html-Cz0Xqdyq.js} +3 -3
  63. package/dist/{html-derivative-Due6nHaa.cjs → html-derivative-BYOQo3PG.cjs} +1 -1
  64. package/dist/{html-derivative--Yb6fTDM.js → html-derivative-BjrHnqif.js} +1 -1
  65. package/dist/{http-BDb2okFn.cjs → http-BA9nOlAq.cjs} +1 -1
  66. package/dist/{http-Wf5dll9t.js → http-ieHS9PeS.js} +4 -4
  67. package/dist/{hurl-Ds566NU_.cjs → hurl-DFGEnvSS.cjs} +1 -1
  68. package/dist/{hurl-1Afa28rK.js → hurl-Dg9NkXrC.js} +2 -2
  69. package/dist/{java-DMU2lkyP.js → java-DCXCvNHA.js} +1 -1
  70. package/dist/java-DTzZZzv7.cjs +1 -0
  71. package/dist/javascript-DOKgRqe8.cjs +1 -0
  72. package/dist/{javascript-CkOfli2O.js → javascript-f9cb-Pl7.js} +1 -1
  73. package/dist/{jinja-C_EeM5kX.js → jinja-B2DAjJOY.js} +1 -1
  74. package/dist/{jinja-D65--viX.cjs → jinja-DE8g1bjX.cjs} +1 -1
  75. package/dist/{jison-D5yGxh57.js → jison-5BvvygJS.js} +1 -1
  76. package/dist/{jison-CgJDwgW4.cjs → jison-BCQciWJO.cjs} +1 -1
  77. package/dist/js-yaml-B-Up3zwX.cjs +28 -0
  78. package/dist/{js-yaml-CA-Iojzo.js → js-yaml-o4oD1Gp3.js} +1 -1
  79. package/dist/json-BcxNDt_H.cjs +1 -0
  80. package/dist/{json-DnSlp2pP.js → json-DZfYi9f2.js} +1 -1
  81. package/dist/{jsx-DIHyTcyM.js → jsx-D0ksVAAA.js} +1 -1
  82. package/dist/jsx-DxOBIFYM.cjs +1 -0
  83. package/dist/{julia-Upv7yuF3.cjs → julia-B3y7weJz.cjs} +1 -1
  84. package/dist/{julia-pnYWyN4H.js → julia-Dk4vCuW5.js} +4 -4
  85. package/dist/{just-kcvRoQaC.cjs → just-B7ftAo6t.cjs} +1 -1
  86. package/dist/{just-Rux3ihaI.js → just-BDbjiXnk.js} +5 -5
  87. package/dist/{latex-BNmmGRr9.js → latex-CC_8gzv9.js} +1 -1
  88. package/dist/{latex-ssVj4acX.cjs → latex-QeOQCy8M.cjs} +1 -1
  89. package/dist/{liquid-D9-xfAH9.cjs → liquid-BVZIda1i.cjs} +1 -1
  90. package/dist/{liquid-CkFTSuz5.js → liquid-CJVpPXmh.js} +4 -4
  91. package/dist/llms-DWks2vGp.cjs +26 -0
  92. package/dist/llms-yFQ0insM.js +418 -0
  93. package/dist/lua-BoAqNcbB.cjs +1 -0
  94. package/dist/{lua-BPZzb4jg.js → lua-Bwwgpolt.js} +2 -2
  95. package/dist/{marko-CckGih8c.cjs → marko-CX9I4GhY.cjs} +1 -1
  96. package/dist/{marko-U5lgzX4W.js → marko-z-UpeqN9.js} +3 -3
  97. package/dist/{mdc-ftW0jKss.js → mdc-ANp6h8jQ.js} +2 -2
  98. package/dist/{mdc-CIgbmpvb.cjs → mdc-BPd7ZDIZ.cjs} +1 -1
  99. package/dist/{nginx-CO6FbhYm.js → nginx-BUK9HsFk.js} +1 -1
  100. package/dist/{nginx-pp3BriFA.cjs → nginx-CLECRmW5.cjs} +1 -1
  101. package/dist/{nim-xNROytAe.cjs → nim-4G662efB.cjs} +1 -1
  102. package/dist/{nim-CJpN9IuJ.js → nim-pupbS7ww.js} +6 -6
  103. package/dist/{useOpenapi-DVLwqpMR.js → normalizeExamples-BFR42ENV.js} +4058 -2185
  104. package/dist/normalizeExamples-DNaOGXm0.cjs +45 -0
  105. package/dist/{org-BLgfq4oa.js → org-B8vjAQ9v.js} +26 -26
  106. package/dist/{org-BfvkBzjQ.cjs → org-XYh7PPQk.cjs} +1 -1
  107. package/dist/{perl-4iy1AzjP.js → perl-ChiZYWB8.js} +5 -5
  108. package/dist/{perl-gYxlBF7Z.cjs → perl-Qi4toP6W.cjs} +1 -1
  109. package/dist/{php-D7tWq26a.cjs → php-93axekrF.cjs} +1 -1
  110. package/dist/{php-DBpFECnW.js → php-JTDYSOFN.js} +6 -6
  111. package/dist/{pug-CYLX2lIo.cjs → pug-BHWWe-s7.cjs} +1 -1
  112. package/dist/{pug-B3SC-VJn.js → pug-BR1NlFnA.js} +3 -3
  113. package/dist/{qml-CjtYDlYC.cjs → qml-71TJR8lk.cjs} +1 -1
  114. package/dist/{qml-BJryVNLB.js → qml-BBCxB4Da.js} +1 -1
  115. package/dist/r-BVapaf2o.cjs +1 -0
  116. package/dist/{r-CO3AGhxE.js → r-u-VAz7bR.js} +1 -1
  117. package/dist/{razor-fizwqQUn.js → razor-Cqi5RzG6.js} +1 -1
  118. package/dist/{razor-Cjwm6SbM.cjs → razor-DMdT60zm.cjs} +1 -1
  119. package/dist/{regexp-BlBS23LV.js → regexp-9Pkh3Nf7.js} +1 -1
  120. package/dist/regexp-CwHm4hi_.cjs +1 -0
  121. package/dist/{rst-uzixnQEN.cjs → rst-BtwmHjj9.cjs} +1 -1
  122. package/dist/{rst-CQ-BOew2.js → rst-CLZRH5oU.js} +6 -6
  123. package/dist/{ruby-DYscwpKq.js → ruby-BZUQEFGQ.js} +12 -12
  124. package/dist/{ruby-DcF3FpOo.cjs → ruby-DuGe7Fs0.cjs} +1 -1
  125. package/dist/{sas-CQkHM7U4.cjs → sas-B7hIWqYI.cjs} +1 -1
  126. package/dist/{sas-xf7cYJ8D.js → sas-BO2zDPuE.js} +1 -1
  127. package/dist/scss-BpK0m8eZ.cjs +1 -0
  128. package/dist/{scss-D5Ro0FPj.js → scss-OFCrSwaR.js} +2 -2
  129. package/dist/{shellscript-DVhVbKuT.js → shellscript-BNTFxSmg.js} +1 -1
  130. package/dist/shellscript-KJDkFDLp.cjs +1 -0
  131. package/dist/{shellsession-DCV0F4Wc.js → shellsession-B5j5FuGA.js} +1 -1
  132. package/dist/{shellsession-CfBYvvpU.cjs → shellsession-DWalcvtJ.cjs} +1 -1
  133. package/dist/{soy-HCmyBkD1.cjs → soy-BQn3ItqC.cjs} +1 -1
  134. package/dist/{soy-DqvPS_mm.js → soy-C2Q794LP.js} +1 -1
  135. package/dist/{sql-C8Kl76rR.js → sql-8JHRpHTE.js} +1 -1
  136. package/dist/sql-C5y5nUuw.cjs +1 -0
  137. package/dist/{stata-CJiPjcNk.js → stata-BrNyU7bS.js} +1 -1
  138. package/dist/{stata-B1WKRY4L.cjs → stata-DyBO95gA.cjs} +1 -1
  139. package/dist/{surrealql-D34WxIUj.cjs → surrealql-CAAIvFqO.cjs} +1 -1
  140. package/dist/{surrealql-1H6TjudE.js → surrealql-DgN6gei3.js} +1 -1
  141. package/dist/{svelte-BdqWwltV.cjs → svelte-DGjw_UH1.cjs} +1 -1
  142. package/dist/{svelte-CIN2FBHe.js → svelte-FhQBX-tv.js} +3 -3
  143. package/dist/{templ-DfCxDv8S.js → templ-BUggPx5p.js} +2 -2
  144. package/dist/{templ-DRfIS7Yk.cjs → templ-Cxuj5rzV.cjs} +1 -1
  145. package/dist/tex-B3aY5DbH.cjs +1 -0
  146. package/dist/{tex-BTjGzapI.js → tex-BlOdu2Xy.js} +2 -2
  147. package/dist/{ts-tags-T_iDSaWH.cjs → ts-tags-BymwG1F9.cjs} +1 -1
  148. package/dist/{ts-tags-CV7DYDTm.js → ts-tags-DZBZzNkR.js} +7 -7
  149. package/dist/tsx-DgA8B92F.cjs +1 -0
  150. package/dist/{tsx-C9xVNnaW.js → tsx-mByJmMSt.js} +1 -1
  151. package/dist/{twig-C4i_cRPo.js → twig--2v8RtVi.js} +5 -5
  152. package/dist/{twig-D914CUNQ.cjs → twig-CWwcCfHy.cjs} +1 -1
  153. package/dist/types/src/cli.d.ts +1 -0
  154. package/dist/types/src/components/Common/Highlight/OAShiki.vue.d.ts +2 -2
  155. package/dist/types/src/components/Common/Highlight/OAVueJsonPretty.vue.d.ts +2 -2
  156. package/dist/types/src/components/Common/OACodeBlock.vue.d.ts +2 -2
  157. package/dist/types/src/components/Common/OACodeValue.vue.d.ts +2 -2
  158. package/dist/types/src/components/Common/OAJSONEditor.vue.d.ts +2 -2
  159. package/dist/types/src/components/Parameter/OAParameterAttribute.vue.d.ts +2 -2
  160. package/dist/types/src/components/Playground/OAPlaygroundParameterInput.vue.d.ts +2 -2
  161. package/dist/types/src/components/ui/badge/index.d.ts +1 -1
  162. package/dist/types/src/components/ui/button/index.d.ts +1 -1
  163. package/dist/types/src/composables/useTheme.d.ts +7 -0
  164. package/dist/types/src/index.d.ts +18 -3
  165. package/dist/types/src/lib/codeSamples/buildOperationRequest.d.ts +15 -0
  166. package/dist/types/src/lib/codeSamples/buildRequest.d.ts +6 -0
  167. package/dist/types/src/lib/constants.d.ts +3 -0
  168. package/dist/types/src/lib/markdown/generateMarkdown.d.ts +111 -0
  169. package/dist/types/src/lib/markdown/llmsSite.d.ts +137 -0
  170. package/dist/types/src/lib/markdown/markdownUtils.d.ts +35 -0
  171. package/dist/types/src/lib/markdown/operationToMarkdown.d.ts +66 -0
  172. package/dist/types/src/lib/markdown/sanitizeHtml.d.ts +5 -0
  173. package/dist/types/src/lib/parser/getSchemaUi.d.ts +1 -0
  174. package/dist/types/src/node/cli.d.ts +5 -0
  175. package/dist/types/src/node/generate.d.ts +38 -0
  176. package/dist/types/src/node/llms.d.ts +99 -0
  177. package/dist/types/src/node/llmsPlugin.d.ts +10 -0
  178. package/dist/typescript-BWfpZQ2O.cjs +1 -0
  179. package/dist/{typescript-Chl77Ui1.js → typescript-DF15DAwn.js} +1 -1
  180. package/dist/{typst-C6fVPKNq.cjs → typst-BEqsnZtv.cjs} +1 -1
  181. package/dist/{typst-BgQE6TAB.js → typst-uhRd3eU5.js} +29 -29
  182. package/dist/useSidebar-B2LH297o.cjs +6 -0
  183. package/dist/useSidebar-CoebjdWM.js +313 -0
  184. package/dist/vitepress-openapi.cli.cjs.js +22 -0
  185. package/dist/vitepress-openapi.cli.es.js +67 -0
  186. package/dist/vitepress-openapi.client.cjs.js +1 -1
  187. package/dist/vitepress-openapi.client.es.js +7 -6
  188. package/dist/vitepress-openapi.css +1 -1
  189. package/dist/vitepress-openapi.node.cjs.js +1 -1
  190. package/dist/vitepress-openapi.node.es.js +47 -2
  191. package/dist/vitepress-openapi.vue.cjs.js +1 -1
  192. package/dist/vitepress-openapi.vue.es.js +4 -3
  193. package/dist/{vue-CaajMfVy.cjs → vue-BQl-5Fd6.cjs} +1 -1
  194. package/dist/{vue-J95qJkfJ.js → vue-CSJXDMn1.js} +6 -6
  195. package/dist/{vue-DpVGGK22.js → vue-DIM9jH1x.js} +3091 -4626
  196. package/dist/vue-DwsEa2e4.cjs +7 -0
  197. package/dist/{vue-html-CtmhMKZ8.cjs → vue-html-AqZQgz92.cjs} +1 -1
  198. package/dist/{vue-html-BjrCwjva.js → vue-html-DYm4V3uo.js} +1 -1
  199. package/dist/{vue-vine-C4hFAX9j.js → vue-vine-BLrCVeql.js} +3 -3
  200. package/dist/{vue-vine-DHwm8nhC.cjs → vue-vine-C1QCIUv6.cjs} +1 -1
  201. package/dist/xml-DbN80t5u.cjs +1 -0
  202. package/dist/{xml-4tT4oeZd.js → xml-Df1jLF7H.js} +2 -2
  203. package/dist/{xsl-gK25ns76.cjs → xsl-7fKL5NbN.cjs} +1 -1
  204. package/dist/{xsl-ZTs2D31w.js → xsl-C2LJLnIq.js} +1 -1
  205. package/dist/{yaml-Cr99duBz.js → yaml-DABI1u00.js} +1 -1
  206. package/dist/yaml-DNB0t8B9.cjs +1 -0
  207. package/package.json +6 -2
  208. package/src/cli.ts +6 -0
  209. package/src/composables/useMarkdown.ts +8 -2
  210. package/src/composables/useSidebar.ts +1 -1
  211. package/src/composables/useTheme.ts +12 -0
  212. package/src/index.ts +26 -5
  213. package/src/lib/codeSamples/buildHarRequest.ts +5 -0
  214. package/src/lib/codeSamples/buildOperationRequest.ts +52 -0
  215. package/src/lib/codeSamples/buildRequest.ts +49 -28
  216. package/src/lib/constants.ts +5 -0
  217. package/src/lib/examples/getSchemaUiJson.ts +1 -1
  218. package/src/lib/markdown/generateMarkdown.ts +451 -0
  219. package/src/lib/markdown/llmsSite.ts +475 -0
  220. package/src/lib/markdown/markdownUtils.ts +104 -0
  221. package/src/lib/markdown/operationLink.ts +10 -3
  222. package/src/lib/markdown/operationToMarkdown.ts +834 -0
  223. package/src/lib/markdown/sanitizeHtml.ts +92 -0
  224. package/src/lib/parser/generateCodeSamples.ts +6 -31
  225. package/src/lib/parser/generateMissingOperationIds.ts +1 -1
  226. package/src/lib/parser/generateMissingSummary.ts +1 -1
  227. package/src/lib/parser/generateMissingTags.ts +1 -1
  228. package/src/lib/parser/generateRequestBodyUi.ts +1 -1
  229. package/src/lib/parser/generateResponseUi.ts +1 -1
  230. package/src/lib/parser/generateSecurityUi.ts +1 -1
  231. package/src/lib/parser/getSchemaUi.ts +7 -3
  232. package/src/lib/sidebar/generateSidebarItemsByPaths.ts +1 -1
  233. package/src/lib/spec/createOpenApiSpec.ts +1 -1
  234. package/src/node/cli.ts +107 -0
  235. package/src/node/generate.ts +207 -0
  236. package/src/node/llms.ts +431 -0
  237. package/src/node/llmsPlugin.ts +29 -0
  238. package/dist/angular-html-BoKsRe8T.cjs +0 -1
  239. package/dist/c-BCyoZ90X.cjs +0 -1
  240. package/dist/cpp-tnOfy09q.cjs +0 -1
  241. package/dist/css-02TmpFbt.cjs +0 -1
  242. package/dist/glsl-BGTPqLyQ.cjs +0 -1
  243. package/dist/graphql-DdYH_Rp2.cjs +0 -1
  244. package/dist/haml-D-xAsnlc.cjs +0 -1
  245. package/dist/html-BYiFDapk.cjs +0 -1
  246. package/dist/java-DwnayQnb.cjs +0 -1
  247. package/dist/javascript-CSKossUl.cjs +0 -1
  248. package/dist/js-yaml-uHYMr7LM.cjs +0 -28
  249. package/dist/json-DMvxal4O.cjs +0 -1
  250. package/dist/jsx-CJAVXoYP.cjs +0 -1
  251. package/dist/lua-CbILlNRp.cjs +0 -1
  252. package/dist/r-DKRgTYMs.cjs +0 -1
  253. package/dist/regexp-BbrbtHcV.cjs +0 -1
  254. package/dist/scss-B6SEboBH.cjs +0 -1
  255. package/dist/shellscript-UM_LESkp.cjs +0 -1
  256. package/dist/sql-B2O4UoSw.cjs +0 -1
  257. package/dist/tex-W_Dxzamg.cjs +0 -1
  258. package/dist/tsx-B3iFrpuZ.cjs +0 -1
  259. package/dist/typescript-Ai8puZIn.cjs +0 -1
  260. package/dist/useOpenapi-D3rJQzeG.cjs +0 -50
  261. package/dist/vue-Cdo23EVh.cjs +0 -6
  262. package/dist/xml-C1x13bX0.cjs +0 -1
  263. package/dist/yaml-BUexFoMb.cjs +0 -1
@@ -0,0 +1,692 @@
1
+ import { E as e, I as t, N as n, R as r, S as i, a, b as o, c as s, d as c, g as l, h as u, i as d, m as f, n as p, o as m, s as h, t as g, v as _, y as ee } from "./normalizeExamples-BFR42ENV.js";
2
+ //#region src/lib/markdown/markdownToPlainText.ts
3
+ var v = new _({ html: !0 }), y = {
4
+ "&": "&",
5
+ "&lt;": "<",
6
+ "&gt;": ">",
7
+ "&quot;": "\"",
8
+ "&#39;": "'"
9
+ }, b = /<\/(?:p|div|h[1-6]|li|blockquote|td|th|tr)>|<(?:br|hr)\s*\/?>/g, x = /<(?:"[^"]*"|'[^']*'|[^'">])*>/g, te = /&(?:amp|lt|gt|quot|#39);/g, ne = /\s+/g, re = /\s*\S*$/;
10
+ function S(e, t = {}) {
11
+ let n = v.render(e == null ? "" : e).replace(b, " ").replace(x, "").replace(te, (e) => y[e]).replace(ne, " ").trim(), { maxLength: r } = t;
12
+ if (r === void 0) return n;
13
+ if (!Number.isInteger(r) || r < 0) throw TypeError("markdownToPlainText: maxLength must be a non-negative integer");
14
+ return r === 0 ? "" : n.length <= r ? n : `${n.slice(0, r - 1).replace(re, "")}…`;
15
+ }
16
+ //#endregion
17
+ //#region src/lib/markdown/markdownUtils.ts
18
+ var C = /\r?\n/g, ie = /\|/g, w = /`+/g, ae = /[^\p{L}\p{N}_.-]+/gu, oe = /-{2,}/g, se = /^[-.]+|[-.]+$/g, ce = /[.!?:;]$/, le = /[\\[\]]/g;
19
+ function T(e) {
20
+ return String(e).replace(le, "\\$&");
21
+ }
22
+ function E(e, t) {
23
+ return `${"#".repeat(Math.min(Math.max(e, 1), 6))} ${t}`;
24
+ }
25
+ function D(e) {
26
+ var t;
27
+ let n = String(e), r = Math.max(0, ...((t = n.match(w)) == null ? [] : t).map((e) => e.length)), i = "`".repeat(r + 1), a = n.startsWith("`") || n.endsWith("`") ? " " : "";
28
+ return `${i}${a}${n}${a}${i}`;
29
+ }
30
+ function O(e, t = "") {
31
+ var n;
32
+ let r = Math.max(0, ...((n = e.match(w)) == null ? [] : n).map((e) => e.length)), i = "`".repeat(Math.max(3, r + 1));
33
+ return `${i}${t}\n${e.replace(/\n+$/, "")}\n${i}`;
34
+ }
35
+ function k(e) {
36
+ return e == null ? "" : String(e).trim().replace(ie, "\\|").replace(C, "<br>");
37
+ }
38
+ function A(e, t) {
39
+ return [
40
+ `| ${e.map(k).join(" | ")} |`,
41
+ `| ${e.map(() => "---").join(" | ")} |`,
42
+ ...t.map((e) => `| ${e.map(k).join(" | ")} |`)
43
+ ].join("\n");
44
+ }
45
+ function j(e, t) {
46
+ return e.trim().split(C).map((e, n) => n === 0 || !e.trim() ? e.trimEnd() : `${t}${e}`).join("\n");
47
+ }
48
+ function M(e, t) {
49
+ var n;
50
+ let r = (n = e == null ? void 0 : e.trim()) == null ? "" : n, i = t.filter(Boolean).join(" ");
51
+ return !r || !i ? r || i : r.includes("\n") ? `${r}\n\n${i}` : `${ce.test(r) ? r : `${r}.`} ${i}`;
52
+ }
53
+ function ue(e, t = "operation") {
54
+ return e.replace(ae, "-").replace(oe, "-").replace(se, "") || t;
55
+ }
56
+ function de(e) {
57
+ return [
58
+ "---",
59
+ ...Object.entries(e).filter(([, e]) => e !== void 0 && e !== "").map(([e, t]) => `${e}: ${JSON.stringify(t)}`),
60
+ "---"
61
+ ].join("\n");
62
+ }
63
+ //#endregion
64
+ //#region src/lib/markdown/operationToMarkdown.ts
65
+ var fe = [
66
+ {
67
+ in: "path",
68
+ title: "Path parameters"
69
+ },
70
+ {
71
+ in: "query",
72
+ title: "Query parameters"
73
+ },
74
+ {
75
+ in: "header",
76
+ title: "Header parameters"
77
+ },
78
+ {
79
+ in: "cookie",
80
+ title: "Cookie parameters"
81
+ }
82
+ ], pe = ["curl"], me = 4, he = 1e4, ge = /* @__PURE__ */ new Set(["format", "default"]), _e = "/operations/", ve = /\[([^\]]*)\]\(([^)\s]+)\)/g, ye = /^\s*(`{3,}|~{3,})/, be = /`+/g, xe = /[/?#]/, N = /* @__PURE__ */ new WeakMap();
83
+ function Se(e) {
84
+ let t = e.getSpec(), n = N.get(t);
85
+ if (!n) {
86
+ var r, i;
87
+ let e = /* @__PURE__ */ new Map();
88
+ for (let [n, o] of Object.entries((r = (i = t.components) == null ? void 0 : i.schemas) == null ? {} : r)) if (o && typeof o == "object") {
89
+ var a;
90
+ e.set((a = o[u]) == null ? o : a, n);
91
+ }
92
+ n = {
93
+ cache: new h(),
94
+ names: e
95
+ }, N.set(t, n);
96
+ }
97
+ return n;
98
+ }
99
+ function P(e, t) {
100
+ var n;
101
+ let r = t.schemas.cache.sources.get(e);
102
+ return r ? t.schemas.names.get((n = r[u]) == null ? r : n) : void 0;
103
+ }
104
+ async function F(e, t, n = {}) {
105
+ var r, i, a, o, s, c, l;
106
+ let u = t ? e.getOperation(t) : null;
107
+ if (!u) return "";
108
+ let d = (r = e.getOperationMethod(t)) == null ? "get" : r, f = (i = e.getOperationPath(t)) == null ? "" : i, p = {
109
+ level: (a = n.headingLevel) == null ? 1 : a,
110
+ schemaDepth: (o = n.schemaDepth) == null ? me : o,
111
+ maxExampleLength: (s = n.maxExampleLength) == null ? he : s,
112
+ schemas: Se(e),
113
+ expanded: /* @__PURE__ */ new Set()
114
+ }, m = `${d.toUpperCase()} ${f}`, h = [E(p.level, u.summary || m), D(m)];
115
+ u.deprecated && h.push("> **Deprecated:** this operation is deprecated and may be removed in a future version."), u.description && h.push(String(u.description).trim()), (c = u.externalDocs) != null && c.url && h.push(`See also: [${T(u.externalDocs.description || u.externalDocs.url)}](${u.externalDocs.url})`), h.push(...Te(e.getOperationServers(t), p), ...Ee(e, u, p), ...De(L(e, t), p), ...Oe(u, p), ...ke(u, p), ...await Ie(e, t, u, n, p)), n.openapiUrl && h.push(E(p.level + 1, "OpenAPI"), `Machine-readable specification: [${T(n.openapiUrl)}](${n.openapiUrl})`);
116
+ let g = h.filter(Boolean).join("\n\n");
117
+ return n.operationLink === !1 ? g : I(g, e, (l = n.operationLink) == null ? {} : l);
118
+ }
119
+ function I(e, t, n = {}) {
120
+ var r;
121
+ let i = (r = n.prefix) == null ? _e : r, a = null, o = (e, r, a) => {
122
+ var o;
123
+ if (!a.startsWith(i)) return e;
124
+ let s;
125
+ try {
126
+ s = decodeURIComponent(a.slice(i.length).split(xe)[0]);
127
+ } catch {
128
+ return e;
129
+ }
130
+ let c = t.getOperation(s);
131
+ if (!c) return e;
132
+ let l = (o = n.href) == null ? void 0 : o.call(n, s), u = r || T(c.summary || s);
133
+ return l === null ? u : `[${u}](${l == null ? a : l})`;
134
+ };
135
+ return e.split("\n").map((e) => {
136
+ if (a) return Ce(e, a) && (a = null), e;
137
+ let t = e.match(ye);
138
+ return t && !(t[1][0] === "`" && e.slice(t[0].length).includes("`")) ? (a = {
139
+ char: t[1][0],
140
+ length: t[1].length
141
+ }, e) : e.includes(i) ? we(e, (e) => e.replace(ve, o)) : e;
142
+ }).join("\n");
143
+ }
144
+ function Ce(e, t) {
145
+ let n = e.trim();
146
+ return n.length >= t.length && [...n].every((e) => e === t.char);
147
+ }
148
+ function we(e, t) {
149
+ let n = [...e.matchAll(be)], r = "", i = 0, a = 0;
150
+ for (; a < n.length;) {
151
+ let o = n[a], s = n.findIndex((e, t) => t > a && e[0].length === o[0].length);
152
+ if (s === -1) {
153
+ a++;
154
+ continue;
155
+ }
156
+ let c = n[s];
157
+ r += t(e.slice(i, o.index)) + e.slice(o.index, c.index + c[0].length), i = c.index + c[0].length, a = s + 1;
158
+ }
159
+ return r + t(e.slice(i));
160
+ }
161
+ function L(e, t) {
162
+ var n, r;
163
+ let i = e.getOperationPath(t), a = (n = i ? (r = e.getPaths()[i]) == null ? void 0 : r.parameters : void 0) == null ? [] : n, o = /* @__PURE__ */ new Map();
164
+ for (let n of [...a, ...e.getOperationParameters(t)]) {
165
+ if (!n) continue;
166
+ let e = n.name && n.in ? `${n.in}:${n.name}` : `ref:${o.size}`;
167
+ o.set(e, n);
168
+ }
169
+ return [...o.values()];
170
+ }
171
+ function Te(e, t) {
172
+ if (!(e != null && e.length)) return [];
173
+ let n = e.map((e) => {
174
+ var t;
175
+ let n = e.description ? `: ${e.description}` : "", r = Object.entries((t = e.variables) == null ? {} : t).map(([e, t]) => {
176
+ var n;
177
+ let r = [
178
+ t.default !== void 0 && `default ${D(t.default)}`,
179
+ ((n = t.enum) == null ? void 0 : n.length) && `one of ${t.enum.map(D).join(", ")}`,
180
+ t.description
181
+ ].filter(Boolean).join("; ");
182
+ return ` - ${D(`{${e}}`)}${r ? `: ${r}` : ""}`;
183
+ });
184
+ return [`- ${D(e.url)}${n}`, ...r].join("\n");
185
+ });
186
+ return [E(t.level + 1, "Servers"), n.join("\n")];
187
+ }
188
+ function Ee(e, t, n) {
189
+ var r, i, a, o;
190
+ let s = e.getSpec(), c = (r = (i = t.security) == null ? s.security : i) == null ? [] : r, l = m(c, (a = (o = s.components) == null ? void 0 : o.securitySchemes) == null ? {} : a);
191
+ if (!l.length) return [];
192
+ let u = (e, t, n) => Object.entries(t).map(([t, r]) => {
193
+ var i, a;
194
+ return `${n}- ${D(t)}: ${R(r, (i = (a = c[e]) == null ? void 0 : a[t]) == null ? [] : i, `${n} `)}`;
195
+ });
196
+ if (l.length === 1) {
197
+ let e = u(0, l[0].schemes, "");
198
+ return [
199
+ E(n.level + 1, "Authorization"),
200
+ e.length > 1 ? "All of the following are required:" : "",
201
+ e.join("\n")
202
+ ];
203
+ }
204
+ let d = l.flatMap((e, t) => {
205
+ let n = u(t, e.schemes, " ");
206
+ return n.length ? [`- Option ${t + 1}${n.length > 1 ? " (all required)" : ""}:`, ...n] : [`- Option ${t + 1}: no authentication`];
207
+ });
208
+ return [
209
+ E(n.level + 1, "Authorization"),
210
+ "Use one of the following options:",
211
+ d.join("\n")
212
+ ];
213
+ }
214
+ function R(e, t = [], n = " ") {
215
+ var r;
216
+ let i = [], a = [];
217
+ switch (e == null ? void 0 : e.type) {
218
+ case "http": {
219
+ var o;
220
+ let t = String((o = e.scheme) == null ? "" : o).toLowerCase();
221
+ i.push(`HTTP ${t || "authentication"}${e.bearerFormat ? ` (${e.bearerFormat})` : ""}.`), t === "bearer" ? i.push(`Send ${D("Authorization: Bearer <token>")}.`) : t === "basic" && i.push(`Send ${D("Authorization: Basic <credentials>")}.`);
222
+ break;
223
+ }
224
+ case "apiKey":
225
+ var s, c;
226
+ i.push(`API key in ${(s = e.in) == null ? "header" : s} ${D((c = e.name) == null ? "" : c)}.`);
227
+ break;
228
+ case "oauth2":
229
+ var l;
230
+ i.push("OAuth 2.0.");
231
+ for (let [t, r] of Object.entries((l = e.flows) == null ? {} : l)) {
232
+ let e = [
233
+ (r == null ? void 0 : r.authorizationUrl) && `authorization URL ${r.authorizationUrl}`,
234
+ (r == null ? void 0 : r.tokenUrl) && `token URL ${r.tokenUrl}`,
235
+ (r == null ? void 0 : r.refreshUrl) && `refresh URL ${r.refreshUrl}`
236
+ ].filter(Boolean).join(", ");
237
+ a.push(`${n}- Flow ${D(t)}${e ? `: ${e}` : ""}`);
238
+ }
239
+ break;
240
+ case "openIdConnect":
241
+ i.push(`OpenID Connect${e.openIdConnectUrl ? ` (${e.openIdConnectUrl})` : ""}.`);
242
+ break;
243
+ case "mutualTLS":
244
+ i.push("Mutual TLS.");
245
+ break;
246
+ default:
247
+ var u;
248
+ i.push(`${(u = e == null ? void 0 : e.type) == null ? "Unknown" : u} scheme.`);
249
+ }
250
+ return t.length && i.push(`Required scopes: ${t.map(D).join(", ")}.`), [j(M(i.join(" "), [e == null || (r = e.description) == null ? void 0 : r.trim()]), n), ...a].join("\n");
251
+ }
252
+ function De(e, t) {
253
+ let r = (e == null ? [] : e).filter((e) => e && e.name && e.in);
254
+ if (!r.length) return [];
255
+ let i = [E(t.level + 1, "Parameters")];
256
+ for (let e of fe) {
257
+ let a = r.filter((t) => t.in === e.in).map((e) => {
258
+ var t, r, i, a;
259
+ let o = V((t = e.schema) == null ? (r = Object.values((i = e.content) == null ? {} : i)[0]) == null ? void 0 : r.schema : t), s = M([e.deprecated && "**Deprecated.**", (a = e.description) == null ? void 0 : a.trim()].filter(Boolean).join(" "), G(o, n(e)));
260
+ return [
261
+ D(e.name),
262
+ o ? D(W(o)) : "",
263
+ e.required ? "Yes" : "No",
264
+ s
265
+ ];
266
+ });
267
+ a.length && i.push(E(t.level + 2, e.title), A([
268
+ "Name",
269
+ "Type",
270
+ "Required",
271
+ "Description"
272
+ ], a));
273
+ }
274
+ return i;
275
+ }
276
+ function Oe(e, t) {
277
+ var n;
278
+ let r = e.requestBody;
279
+ if (!r) return [];
280
+ let i = [r.required ? "Required." : "Optional.", (n = r.description) == null ? void 0 : n.trim()].filter(Boolean).join(" ");
281
+ return [
282
+ E(t.level + 1, "Request body"),
283
+ i,
284
+ ...z(r.content, t)
285
+ ];
286
+ }
287
+ function ke(e, t) {
288
+ var r;
289
+ let i = Object.entries((r = e.responses) == null ? {} : r);
290
+ if (!i.length) return [];
291
+ let a = [E(t.level + 1, "Responses")];
292
+ for (let [e, r] of i) {
293
+ var o;
294
+ a.push(E(t.level + 2, e)), r != null && r.description && a.push(String(r.description).trim());
295
+ let i = Object.entries((o = r == null ? void 0 : r.headers) == null ? {} : o);
296
+ if (i.length) {
297
+ let e = i.map(([e, t]) => {
298
+ let r = V(t == null ? void 0 : t.schema);
299
+ return [
300
+ D(e),
301
+ r ? D(W(r)) : "",
302
+ M(t == null ? void 0 : t.description, G(r, n(t)))
303
+ ];
304
+ });
305
+ a.push("Headers:", A([
306
+ "Name",
307
+ "Type",
308
+ "Description"
309
+ ], e));
310
+ }
311
+ a.push(...z(r == null ? void 0 : r.content, t));
312
+ }
313
+ return a;
314
+ }
315
+ function z(e, t) {
316
+ let n = [];
317
+ for (let [r, i] of Object.entries(e == null ? {} : e)) {
318
+ n.push(`Content type: ${D(r)}`);
319
+ let e = i != null && i.schema ? s(i.schema, t.schemas.cache) : i == null ? void 0 : i.ui;
320
+ e && n.push(...Me(e, t));
321
+ for (let a of Ae(i, r, e, t.maxExampleLength)) n.push(a.title ? `Example (${a.title}):` : "Example:", O(B(a.value, r), je(a.value, r)));
322
+ }
323
+ return n;
324
+ }
325
+ function Ae(e, t, n, r) {
326
+ var i, a, o;
327
+ if (!e) return [];
328
+ if (e.example !== void 0) return [{ value: e.example }];
329
+ let s = Object.entries((i = e.examples) == null ? {} : i), l = s.filter(([, e]) => !(e != null && e.isAutogenerated));
330
+ if (l.length) {
331
+ var u;
332
+ return ((u = g(Object.fromEntries(l))) == null ? [] : u).map((e) => ({
333
+ title: e.summary || e.name,
334
+ value: e.value
335
+ }));
336
+ }
337
+ let d = (a = (o = s.find(([, e]) => e == null ? void 0 : e.isAutogenerated)) == null ? void 0 : o[1]) == null ? n ? Object.values(c(t, n, !0))[0] : void 0 : a;
338
+ return !d || d.hideOnSchemaTabs || d.value === void 0 || d.value === "" || B(d.value, t).length > r ? [] : [{ value: d.value }];
339
+ }
340
+ function B(e, n) {
341
+ return typeof e == "string" && !t(n) ? e : p(e, { space: 2 });
342
+ }
343
+ function je(e, n) {
344
+ return r(n) ? "xml" : t(n) || typeof e != "string" ? "json" : "text";
345
+ }
346
+ function V(e) {
347
+ if (!e || typeof e != "object" || Object.keys(e).length === 0) return;
348
+ let t = s(e);
349
+ return Array.isArray(t) ? t[0] : t;
350
+ }
351
+ function Me(e, t) {
352
+ let n = Array.isArray(e) ? e : [e], r = [];
353
+ for (let e of n) {
354
+ var i;
355
+ if (!e) continue;
356
+ (i = e.description) != null && i.trim() && r.push(e.description.trim());
357
+ let n = P(e, t);
358
+ if (n && t.expanded.has(n)) {
359
+ r.push(`Type: ${D(W(e))} (see schema ${D(n)} above).`);
360
+ continue;
361
+ }
362
+ n && t.expanded.add(n);
363
+ let a = U(e);
364
+ r.push([
365
+ `Type: ${D(W(e))}${n ? ` (schema ${D(n)})` : ""}.`,
366
+ ...G(e),
367
+ a && `${a}:`
368
+ ].filter(Boolean).join(" "));
369
+ let o = [];
370
+ H(e, 0, t, o), o.length && r.push(o.join("\n"));
371
+ }
372
+ return r;
373
+ }
374
+ function H(e, t, n, r) {
375
+ var i, a;
376
+ if ((i = e.meta) != null && i.isCircularReference || !((a = e.properties) != null && a.length)) return;
377
+ if (t >= n.schemaDepth) {
378
+ r.push(`${" ".repeat(t)}- …`);
379
+ return;
380
+ }
381
+ let o = !!U(e);
382
+ e.properties.forEach((e, i) => {
383
+ Ne(e, o ? `Option ${i + 1}${e.title ? ` (${e.title})` : ""}` : D(e.name || `[${i}]`), t, n, r);
384
+ });
385
+ }
386
+ function Ne(e, t, n, r, i) {
387
+ var a, o, s;
388
+ let c = " ".repeat(n), l = P(e, r), u = !((a = e.meta) != null && a.isCircularReference) && !!((o = e.properties) != null && o.length), d = !!l && u && (r.expanded.has(l) || n + 1 >= r.schemaDepth), f = [D(W(e))];
389
+ l && f.push(d ? `see schema ${D(l)}` : `schema ${D(l)}`), e.required && f.push("required"), (s = e.meta) != null && s.isAdditionalProperties && f.push("additional properties");
390
+ let p = !d && U(e), m = M(e.description, [...G(e), p && `${p}:`]);
391
+ i.push(`${c}- ${t} (${f.join(", ")})${m ? `: ${j(m, `${c} `)}` : ""}`), !d && (l && r.expanded.add(l), H(e, n + 1, r, i));
392
+ }
393
+ function U(e) {
394
+ var t, n, r;
395
+ if ((t = e.properties) != null && t.length) {
396
+ if ((n = e.meta) != null && n.isOneOf) return "One of";
397
+ if ((r = e.meta) != null && r.isAnyOf) return "Any of";
398
+ }
399
+ }
400
+ function W(e) {
401
+ var t, n, r;
402
+ if ((t = e.meta) != null && t.isCircularReference) return "object";
403
+ let i = (n = e.constraints) == null ? void 0 : n.format, a = ((r = e.types) == null ? [] : r).filter(Boolean), o = a.map((t) => {
404
+ if (t === "array") {
405
+ var n, r, a;
406
+ let t = e.items ? W(e.items) : (n = e.subtype) == null ? (r = e.properties) != null && r.length && !((a = e.meta) != null && a.hasPrefixItems) ? "object" : void 0 : n;
407
+ return t ? `array<${t}>` : "array";
408
+ }
409
+ return i && t !== "object" && t !== "null" ? `${t}<${i}>` : t;
410
+ });
411
+ return e.nullable && !a.includes("null") && o.push("null"), o.join(" | ") || "any";
412
+ }
413
+ function G(e, t) {
414
+ var r, i, a, o;
415
+ if (!e) return t == null ? [] : [`Example: ${D(q(t))}.`];
416
+ let s = [];
417
+ if ((r = e.meta) != null && r.isConstant) {
418
+ let t = n(e);
419
+ return t != null && s.push(`Constant: ${D(q(t))}.`), s;
420
+ }
421
+ let c = (i = e.enum) == null ? (a = e.items) == null ? void 0 : a.enum : i;
422
+ c != null && c.length && s.push(`Possible values: ${c.map((e) => D(q(e))).join(", ")}.`), e.defaultValue !== void 0 && s.push(`Default: ${D(q(e.defaultValue))}.`);
423
+ let l = K(e.constraints);
424
+ l && s.push(`Constraints: ${l}.`);
425
+ let u = K((o = e.items) == null ? void 0 : o.constraints);
426
+ u && s.push(`Items: ${u}.`);
427
+ let d = t == null ? n(e) : t;
428
+ return d != null && s.push(`Example: ${D(q(d))}.`), s;
429
+ }
430
+ function K(e) {
431
+ return Object.entries(e == null ? {} : e).filter(([e]) => !ge.has(e)).map(([e, t]) => `${e}: ${q(t)}`).join(", ");
432
+ }
433
+ function q(e) {
434
+ return typeof e == "string" ? e : p(e, { space: 0 });
435
+ }
436
+ function Pe(e) {
437
+ return e === !1 ? [] : (e === !0 || e === void 0 ? pe : e).flatMap((e) => {
438
+ if (typeof e != "string") return [e];
439
+ let t = i.find((t) => t.lang === e);
440
+ return t ? [t] : (console.warn(`[vitepress-openapi] Unknown code sample language "${e}". Available: ${i.map((e) => e.lang).join(", ")}`), []);
441
+ });
442
+ }
443
+ function Fe(e) {
444
+ var t, n;
445
+ let r = String((t = e == null ? void 0 : e.url) == null ? "" : t);
446
+ for (let [t, a] of Object.entries((n = e == null ? void 0 : e.variables) == null ? {} : n)) {
447
+ var i;
448
+ r = r.replaceAll(`{${t}}`, String((i = a == null ? void 0 : a.default) == null ? "" : i));
449
+ }
450
+ return r ? URL.canParse(r) ? r : new URL(r, o).href : o;
451
+ }
452
+ async function Ie(t, n, r, i, a) {
453
+ let o = Pe(i.codeSamples);
454
+ if (!o.length) return [];
455
+ let s = [];
456
+ try {
457
+ var c, l, u;
458
+ let a = ((c = i.baseUrl) == null ? Fe(t.getOperationServers(n)[0]) : c).replace(/\/+$/, ""), p = f({
459
+ path: (l = t.getOperationPath(n)) == null ? "" : l,
460
+ method: (u = t.getOperationMethod(n)) == null ? "get" : u,
461
+ operation: r,
462
+ parameters: L(t, n),
463
+ baseUrl: a
464
+ });
465
+ for (let t of o) {
466
+ let n = await e(t, p);
467
+ if (n) {
468
+ var d;
469
+ s.push(`**${t.label}**`, O(n, (d = t.highlighter) == null ? t.lang : d));
470
+ }
471
+ }
472
+ } catch (e) {
473
+ console.warn(`[vitepress-openapi] Could not generate code samples for "${n}"`, e);
474
+ }
475
+ return s.length ? [E(a.level + 1, "Code samples"), ...s] : [];
476
+ }
477
+ //#endregion
478
+ //#region src/lib/markdown/generateMarkdown.ts
479
+ var Le = [
480
+ "index",
481
+ "llms",
482
+ "llms-full"
483
+ ], J = 160;
484
+ async function Re(e, t = {}) {
485
+ var n;
486
+ let { groupBy: r = "operation", linkPrefix: i = "/", llms: a = !0, frontmatter: o = !0, defaultTag: s = "Default", ...c } = t, { openapi: l, operations: u, groups: d } = Y(e, s), f = new Map(X(u.map((e) => e.operationId)).map((e, t) => [u[t], e])), p = X(d.map((e) => ee(e.name, { decamelize: !1 })));
487
+ d.forEach((e, t) => {
488
+ e.fileName = p[t];
489
+ });
490
+ let m = (e, t) => r === "tag" ? `${t.fileName}.md` : `${f.get(e)}.md`, h = c.operationLink !== !1 && {
491
+ href: (e) => {
492
+ let t = d.find((t) => t.operations.some((t) => t.operationId === e)), n = t == null ? void 0 : t.operations.find((t) => t.operationId === e);
493
+ return t && n ? `./${encodeURI(m(n, t))}` : void 0;
494
+ },
495
+ ...c.operationLink
496
+ }, g = (e) => h === !1 ? e : I(e, l, h);
497
+ d.forEach((e) => {
498
+ e.description = g(e.description);
499
+ });
500
+ let _ = /* @__PURE__ */ new Map(), v = async (e, t) => {
501
+ var n;
502
+ let r = `${t}:${e.operationId}`;
503
+ return _.has(r) || _.set(r, await F(l, e.operationId, {
504
+ ...c,
505
+ operationLink: h,
506
+ headingLevel: t
507
+ })), (n = _.get(r)) == null ? "" : n;
508
+ }, y = [], b = (e, t, n) => {
509
+ y.push({
510
+ path: e,
511
+ content: o ? `${de(t)}\n\n::: v-pre\n\n${n}\n\n:::\n` : `${n}\n`
512
+ });
513
+ };
514
+ if (r === "tag") for (let e of d) {
515
+ let t = [];
516
+ for (let n of e.operations) t.push(await v(n, 2));
517
+ b(`${e.fileName}.md`, {
518
+ title: e.name,
519
+ description: Z(e.description),
520
+ outline: [2, 3]
521
+ }, We(e, t));
522
+ }
523
+ else for (let e of u) b(`${f.get(e)}.md`, {
524
+ title: e.summary,
525
+ description: Z(e.description),
526
+ outline: [2, 3]
527
+ }, await v(e, 1));
528
+ let x = (n = l.getInfo()) == null ? {} : n;
529
+ if (b("index.md", {
530
+ title: String(x.title || "API Reference"),
531
+ description: Z(x.description)
532
+ }, Ue(l, d, {
533
+ operationUrl: r === "operation" ? (e, t) => `./${encodeURI(m(e, t))}` : void 0,
534
+ tagUrl: r === "tag" ? (e) => `./${encodeURI(`${e.fileName}.md`)}` : void 0,
535
+ openapiUrl: c.openapiUrl,
536
+ rewriteLinks: g
537
+ })), a) {
538
+ y.push({
539
+ path: "llms.txt",
540
+ content: qe(l, d, {
541
+ operationUrl: (e, t) => He(i, m(e, t)),
542
+ fullUrl: He(i, "llms-full.txt"),
543
+ openapiUrl: c.openapiUrl
544
+ })
545
+ });
546
+ let e = [];
547
+ for (let t of u) e.push(await v(t, 1));
548
+ y.push({
549
+ path: "llms-full.txt",
550
+ content: Je(l, e)
551
+ });
552
+ }
553
+ return y;
554
+ }
555
+ function Y(e, t = "Default") {
556
+ let n = ze(e, t), r = Be(n);
557
+ return {
558
+ openapi: n,
559
+ operations: r,
560
+ groups: Ve(n, r, t)
561
+ };
562
+ }
563
+ function ze(e, t) {
564
+ if (e && typeof e == "object" && typeof e.getOperation == "function") return e;
565
+ let n = typeof e == "string" ? e : structuredClone(e), r = a().parseSync({
566
+ spec: n,
567
+ defaultTag: t
568
+ });
569
+ if (!(r != null && r.openapi) || !r.paths) throw Error("[vitepress-openapi] Invalid OpenAPI document: only OpenAPI 3.x is supported.");
570
+ return d({
571
+ spec: r,
572
+ originalSpec: l(e)
573
+ });
574
+ }
575
+ function Be(e) {
576
+ let t = (t) => I(String(t == null ? "" : t), e);
577
+ return e.getPathsByVerbs().filter((e) => e == null ? void 0 : e.operationId).map((e) => {
578
+ var n;
579
+ return {
580
+ operationId: String(e.operationId),
581
+ method: String(e.verb),
582
+ path: String(e.path),
583
+ summary: String(e.summary || `${String(e.verb).toUpperCase()} ${e.path}`),
584
+ description: t(e.description),
585
+ tags: (n = e.tags) == null ? [] : n
586
+ };
587
+ });
588
+ }
589
+ function Ve(e, t, n) {
590
+ let r = e.getFilteredTags().filter((e) => e.name).map((e) => {
591
+ var n;
592
+ return {
593
+ name: String(e.name),
594
+ description: (n = e.description) == null ? "" : n,
595
+ fileName: "",
596
+ operations: t.filter((t) => t.tags.includes(String(e.name)))
597
+ };
598
+ }), i = t.filter((e) => e.tags.length === 0);
599
+ if (i.length) {
600
+ let e = r.find((e) => e.name === n);
601
+ e ? e.operations.push(...i) : r.push({
602
+ name: n,
603
+ description: "",
604
+ fileName: "",
605
+ operations: i
606
+ });
607
+ }
608
+ return r.filter((e) => e.operations.length > 0);
609
+ }
610
+ function X(e) {
611
+ let t = new Set(Le);
612
+ return e.map((e) => {
613
+ let n = ue(e), r = n, i = 2;
614
+ for (; t.has(r.toLowerCase());) r = `${n}-${i++}`;
615
+ return t.add(r.toLowerCase()), r;
616
+ });
617
+ }
618
+ function Z(e) {
619
+ return S(e, { maxLength: J });
620
+ }
621
+ function He(e, t) {
622
+ return `${e.endsWith("/") ? e : `${e}/`}${encodeURI(t)}`;
623
+ }
624
+ function Q(e) {
625
+ return `${e.method.toUpperCase()} ${e.path}`;
626
+ }
627
+ function Ue(e, t, n = {}) {
628
+ var r, i, a;
629
+ let o = (r = e.getInfo()) == null ? {} : r, s = [E(1, String(o.title || "API Reference"))];
630
+ if (o.version && s.push(`Version: ${D(o.version)}`), o.description) {
631
+ let e = String(o.description).trim();
632
+ s.push(n.rewriteLinks ? n.rewriteLinks(e) : e);
633
+ }
634
+ n.openapiUrl && s.push(`OpenAPI specification: [${T(n.openapiUrl)}](${n.openapiUrl})`);
635
+ let c = e.getServers();
636
+ c.length && s.push(E(2, "Servers"), c.map((e) => `- ${D(e.url)}${e.description ? `: ${e.description}` : ""}`).join("\n"));
637
+ let l = Object.entries((i = (a = e.getSpec().components) == null ? void 0 : a.securitySchemes) == null ? {} : i);
638
+ l.length && s.push(E(2, "Security schemes"), l.map(([e, t]) => `- ${D(e)}: ${R(t)}`).join("\n"));
639
+ for (let e of t) {
640
+ var u;
641
+ s.push(E(2, e.name)), e.description && s.push(e.description.trim());
642
+ let t = (u = n.tagUrl) == null ? void 0 : u.call(n, e), r = t ? " " : "", i = e.operations.map((t) => {
643
+ var i;
644
+ let a = (i = n.operationUrl) == null ? void 0 : i.call(n, t, e), o = a ? `[${T(t.summary)}](${a})` : t.summary;
645
+ return `${r}- ${o} ${D(Q(t))}`;
646
+ });
647
+ s.push((t ? [`- [${T(e.name)}](${t})`, ...i] : i).join("\n"));
648
+ }
649
+ return s.join("\n\n");
650
+ }
651
+ function We(e, t) {
652
+ var n;
653
+ return [
654
+ E(1, e.name),
655
+ (n = e.description) == null ? void 0 : n.trim(),
656
+ ...t
657
+ ].filter(Boolean).join("\n\n");
658
+ }
659
+ function Ge(e) {
660
+ var t, n;
661
+ let r = (t = e.getInfo()) == null ? {} : t;
662
+ return S(I(String((n = r.description) == null ? "" : n), e), { maxLength: 300 }) || `API reference for ${r.title || "this API"}${r.version ? ` (version ${r.version})` : ""}.`;
663
+ }
664
+ function Ke(e, t) {
665
+ let n = S(e.description, { maxLength: J });
666
+ return `- [${T(e.summary)}](${t}): ${Q(e)}${n ? ` - ${n}` : ""}`;
667
+ }
668
+ function qe(e, t, n) {
669
+ var r, i, a;
670
+ let o = (r = e.getInfo()) == null ? {} : r, s = [E(1, String(o.title || "API Reference")), `> ${Ge(e)}`], c = [
671
+ n.overviewUrl && `[Overview](${n.overviewUrl}): API description, servers, authentication and all operations`,
672
+ o.version && `Version: ${o.version}`,
673
+ ((i = e.getServers()[0]) == null ? void 0 : i.url) && `Base URL: ${e.getServers()[0].url}`
674
+ ].filter(Boolean);
675
+ c.length && s.push(c.map((e) => `- ${e}`).join("\n"));
676
+ for (let e of t) {
677
+ var l;
678
+ let t = (l = n.tagUrl) == null ? void 0 : l.call(n, e), r = e.operations.map((t) => Ke(t, n.operationUrl(t, e)));
679
+ t && r.unshift(`- [${T(e.name)}](${t}): all ${e.name} operations in a single file`), s.push(E(2, e.name), r.join("\n"));
680
+ }
681
+ return s.push(...(a = n.extraSections) == null ? [] : a), s.push(E(2, "Optional"), [`- [Full documentation](${n.fullUrl}): all operations in a single file`, n.openapiUrl && `- [OpenAPI specification](${n.openapiUrl}): machine-readable source of truth`].filter(Boolean).join("\n")), `${s.join("\n\n")}\n`;
682
+ }
683
+ function Je(e, t) {
684
+ return `${[$(e), ...t].join(Ye)}\n`;
685
+ }
686
+ var Ye = "\n\n---\n\n";
687
+ function $(e) {
688
+ var t;
689
+ return `${E(1, String(((t = e.getInfo()) == null ? void 0 : t.title) || "API Reference"))}\n\n> ${Ge(e)}`;
690
+ }
691
+ //#endregion
692
+ export { Ue as a, F as c, E as d, D as f, Y as i, I as l, Re as n, $ as o, S as p, Ke as r, qe as s, Ye as t, T as u };