vitepress-openapi 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abap-BKBVphSj.cjs +1 -0
- package/dist/abap-CKmm5ecl.js +6 -0
- package/dist/actionscript-3-BeWGlvkz.cjs +1 -0
- package/dist/actionscript-3-DR99TPdY.js +6 -0
- package/dist/ada-rj8I9J9q.cjs +1 -0
- package/dist/ada-yCU0P5el.js +6 -0
- package/dist/angular-html-CEgVyJsZ.js +32 -0
- package/dist/angular-html-DKAFMRCg.cjs +1 -0
- package/dist/angular-ts-DZASjvFL.js +21 -0
- package/dist/angular-ts-SpeLjEmj.cjs +1 -0
- package/dist/apache-BUjz-sD2.js +6 -0
- package/dist/apache-DL1xuH1f.cjs +1 -0
- package/dist/apex-Bo3FKDKO.cjs +1 -0
- package/dist/apex-DHJjCeXE.js +6 -0
- package/dist/apl-Bd12wJTy.cjs +1 -0
- package/dist/apl-C3knM5Y5.js +16 -0
- package/dist/applescript-BW_Yroew.js +6 -0
- package/dist/applescript-Df_WKtiR.cjs +1 -0
- package/dist/ara-BhqBTiSN.js +6 -0
- package/dist/ara-CL-kONA8.cjs +1 -0
- package/dist/asciidoc-2HC3FYDQ.js +6 -0
- package/dist/asciidoc-CDM3xD67.cjs +1 -0
- package/dist/asm-DdQ_W1DP.cjs +1 -0
- package/dist/asm-nn3rtNPH.js +6 -0
- package/dist/astro-CLSOp-pp.js +16 -0
- package/dist/astro-CjZCr23_.cjs +1 -0
- package/dist/awk-Xfc8tT7r.js +6 -0
- package/dist/awk-yxo7FrL0.cjs +1 -0
- package/dist/ballerina-ClwhyJZ6.js +6 -0
- package/dist/ballerina-GT7CwAzF.cjs +1 -0
- package/dist/bat-ByBJMEDO.cjs +1 -0
- package/dist/bat-CltO_7lG.js +6 -0
- package/dist/beancount-Ct9I1sJT.cjs +1 -0
- package/dist/beancount-DEfTbbFX.js +6 -0
- package/dist/berry-DZkhZ7K3.cjs +1 -0
- package/dist/berry-PwsHPR_K.js +6 -0
- package/dist/bibtex-BgA36Z3k.cjs +1 -0
- package/dist/bibtex-EULQRLY5.js +6 -0
- package/dist/bicep-DFU2oTl7.js +6 -0
- package/dist/bicep-NGpU-VWq.cjs +1 -0
- package/dist/blade-CzH6A7DU.cjs +1 -0
- package/dist/blade-zR9OXcJN.js +20 -0
- package/dist/bsl-9bVgFeM9.cjs +1 -0
- package/dist/bsl-NkNNwerW.js +8 -0
- package/dist/c-IAP4evsT.cjs +1 -0
- package/dist/c-Q-TQE_U-.js +6 -0
- package/dist/cadence-CbYQ7c1c.cjs +1 -0
- package/dist/cadence-rXUcb5uY.js +6 -0
- package/dist/cairo-C4lSD4t2.js +8 -0
- package/dist/cairo-DEprNY2-.cjs +1 -0
- package/dist/clarity-DsDe22Nv.cjs +1 -0
- package/dist/clarity-c-opI0zV.js +6 -0
- package/dist/clojure-CXJfHrL3.js +6 -0
- package/dist/clojure-OUsr1SUl.cjs +1 -0
- package/dist/cmake-B1Mrfu1c.js +6 -0
- package/dist/cmake-CmtD_oe6.cjs +1 -0
- package/dist/cobol-Bgiuk0qu.js +10 -0
- package/dist/cobol-DwKTNRXq.cjs +1 -0
- package/dist/codeowners-Bt9yU6NX.js +6 -0
- package/dist/codeowners-QhPK6lIJ.cjs +1 -0
- package/dist/codeql-DIgHJHSH.cjs +1 -0
- package/dist/codeql-Dyy5tAoU.js +6 -0
- package/dist/coffee-CgE5nLEr.js +8 -0
- package/dist/coffee-DFWu2qnS.cjs +1 -0
- package/dist/common-lisp-DX-fvsba.cjs +1 -0
- package/dist/common-lisp-DvHEACkI.js +6 -0
- package/dist/coq-B6Ta79T2.js +6 -0
- package/dist/coq-DUGnuDWo.cjs +1 -0
- package/dist/cpp-8TuoQ1ID.js +18 -0
- package/dist/cpp-D66jeLUe.cjs +1 -0
- package/dist/crystal-CgBlSa2j.js +18 -0
- package/dist/crystal-CoEI2wor.cjs +1 -0
- package/dist/csharp-C5xjQZDk.cjs +1 -0
- package/dist/csharp-DmxfTLWR.js +6 -0
- package/dist/css-BvzHjYPT.js +6 -0
- package/dist/css-Dq_75vWh.cjs +1 -0
- package/dist/csv-CmYOceLb.js +6 -0
- package/dist/csv-DiEdJzSJ.cjs +1 -0
- package/dist/cue-D1vJRJEx.cjs +1 -0
- package/dist/cue-ZzumE7IT.js +6 -0
- package/dist/cypher-C0-W6MSl.cjs +1 -0
- package/dist/cypher-ClHbEYyl.js +6 -0
- package/dist/d-BC3qcBt3.js +6 -0
- package/dist/d-Dan8rvSt.cjs +1 -0
- package/dist/dart-6ObCrKr9.js +6 -0
- package/dist/dart-Ds0_0fwe.cjs +1 -0
- package/dist/dax-CoQIG3T-.cjs +1 -0
- package/dist/dax-DI4cJblQ.js +6 -0
- package/dist/desktop-B93p9R9O.js +6 -0
- package/dist/desktop-tn3MFXCZ.cjs +1 -0
- package/dist/diff-BxzP2J8R.js +6 -0
- package/dist/diff-CA31fCOg.cjs +1 -0
- package/dist/docker-CsHqm9tx.js +6 -0
- package/dist/docker-zJpMwmYa.cjs +1 -0
- package/dist/dotenv-BMjVjUL1.js +6 -0
- package/dist/dotenv-DpcNCNek.cjs +1 -0
- package/dist/dream-maker-BSGHuzJI.js +6 -0
- package/dist/dream-maker-DeCJ1TIe.cjs +1 -0
- package/dist/edge-CDhZjxjq.js +12 -0
- package/dist/edge-CIMi_MYu.cjs +1 -0
- package/dist/elixir-D2tNDB6F.js +8 -0
- package/dist/elixir-jJlvqtCv.cjs +1 -0
- package/dist/elm-CMswKElQ.js +8 -0
- package/dist/elm-DWBzRA53.cjs +1 -0
- package/dist/emacs-lisp-BsDl2-g8.js +6 -0
- package/dist/emacs-lisp-g56Kklmk.cjs +1 -0
- package/dist/erb-ClwnQx4U.js +10 -0
- package/dist/erb-ZuiCPMfr.cjs +1 -0
- package/dist/erlang--O7Wkems.cjs +1 -0
- package/dist/erlang-DzW6MnOn.js +6 -0
- package/dist/fennel-Bpla0ZMD.js +6 -0
- package/dist/fennel-DjaZhuQZ.cjs +1 -0
- package/dist/fish-B6QqlqeT.js +6 -0
- package/dist/fish-DdOCLNAp.cjs +1 -0
- package/dist/fluent-BMXUxfv1.js +6 -0
- package/dist/fluent-CJtpNuaO.cjs +1 -0
- package/dist/fortran-fixed-form-Bz2GqltN.js +8 -0
- package/dist/fortran-fixed-form-ZWypfwFL.cjs +1 -0
- package/dist/fortran-free-form-CAE0oKxH.js +6 -0
- package/dist/fortran-free-form-CpWsI4Cm.cjs +1 -0
- package/dist/fsharp-ByXkbngM.js +8 -0
- package/dist/fsharp-DBjblKRV.cjs +1 -0
- package/dist/gdresource-Bj1wtoUq.cjs +1 -0
- package/dist/gdresource-SCcfAPZH.js +10 -0
- package/dist/gdscript-BtBOWfNE.js +6 -0
- package/dist/gdscript-BwYJnVd5.cjs +1 -0
- package/dist/gdshader-Bk8fF6yr.js +6 -0
- package/dist/gdshader-DsmqQl4t.cjs +1 -0
- package/dist/genie-Dy2rU8CF.cjs +1 -0
- package/dist/genie-DzUvd7U9.js +6 -0
- package/dist/gherkin-CnN0LLeE.js +6 -0
- package/dist/gherkin-Dbjg1DU4.cjs +1 -0
- package/dist/git-commit-Bd32YZ0K.js +8 -0
- package/dist/git-commit-DlVDzq9L.cjs +1 -0
- package/dist/git-rebase-C8lK3sxN.js +8 -0
- package/dist/git-rebase-CqC5o1jw.cjs +1 -0
- package/dist/gleam-BirJ8P27.js +6 -0
- package/dist/gleam-DZA62vWQ.cjs +1 -0
- package/dist/glimmer-js-C2hoXB0v.js +14 -0
- package/dist/glimmer-js-DtXTBe0M.cjs +1 -0
- package/dist/glimmer-ts-BCTRZTQF.cjs +1 -0
- package/dist/glimmer-ts-DD_G5Cqz.js +14 -0
- package/dist/glsl-9kLALDdQ.js +8 -0
- package/dist/glsl-ryuFMRXo.cjs +1 -0
- package/dist/gnuplot-3CzqD77Q.cjs +1 -0
- package/dist/gnuplot-Mi8tmwAA.js +6 -0
- package/dist/go-C40b7FzD.js +6 -0
- package/dist/go-DTEtHPwj.cjs +1 -0
- package/dist/graphql-BR7p0n_u.js +14 -0
- package/dist/graphql-BRNoLQUT.cjs +1 -0
- package/dist/groovy-CKGJ02fD.cjs +1 -0
- package/dist/groovy-jM2LFJgZ.js +6 -0
- package/dist/hack-HRlvd5jy.cjs +1 -0
- package/dist/hack-zmitWuvz.js +10 -0
- package/dist/haml-473akyxI.cjs +1 -0
- package/dist/haml-C7KOzH0N.js +10 -0
- package/dist/handlebars-BIHfdH9s.cjs +1 -0
- package/dist/handlebars-bZmy6V7D.js +14 -0
- package/dist/haskell-BShesV2P.cjs +1 -0
- package/dist/haskell-WeIwNIP6.js +6 -0
- package/dist/haxe--TlBrvvF.cjs +1 -0
- package/dist/haxe-Dglytoly.js +6 -0
- package/dist/hcl-CrZnvm-1.cjs +1 -0
- package/dist/hcl-D438OF-I.js +6 -0
- package/dist/hjson-CEESwTUP.cjs +1 -0
- package/dist/hjson-DYBUbqOl.js +6 -0
- package/dist/hlsl-37_IS2Xu.js +6 -0
- package/dist/hlsl-DZFIq9DF.cjs +1 -0
- package/dist/html-Dmk7FzFV.js +10 -0
- package/dist/html-Mmdn7qi8.cjs +1 -0
- package/dist/html-derivative-B9vFBhzI.js +8 -0
- package/dist/html-derivative-r3lwioI0.cjs +1 -0
- package/dist/http-Ch63JHi4.js +14 -0
- package/dist/http-Gh2B1we3.cjs +1 -0
- package/dist/hxml-BjcIEQ94.cjs +1 -0
- package/dist/hxml-WQE9PXn_.js +8 -0
- package/dist/hy-Brt5EZ7-.js +6 -0
- package/dist/hy-a1E2Ed6P.cjs +1 -0
- package/dist/imba-C6-JmjCm.js +6 -0
- package/dist/imba-eh7Ci0zq.cjs +1 -0
- package/dist/ini-BZIuRIvJ.js +6 -0
- package/dist/ini-Dpu3Xy2p.cjs +1 -0
- package/dist/java-C0QqN_Gm.cjs +1 -0
- package/dist/java-D4mTlHIx.js +6 -0
- package/dist/javascript-7UOe5Mty.js +6 -0
- package/dist/javascript-CnD-bqIP.cjs +1 -0
- package/dist/jinja-B1ap2SZy.js +11 -0
- package/dist/jinja-DjH-JsPs.cjs +1 -0
- package/dist/jison-_-ITUMaV.cjs +1 -0
- package/dist/jison-eNQ9s0Nz.js +8 -0
- package/dist/json-DxJze_jm.js +6 -0
- package/dist/json-YkPizm35.cjs +1 -0
- package/dist/json5-BT4Fjg39.js +6 -0
- package/dist/json5-CCgFZiQn.cjs +1 -0
- package/dist/jsonc-CHjZD8gR.js +6 -0
- package/dist/jsonc-CKPHIcXW.cjs +1 -0
- package/dist/jsonl-BGuvDmy9.js +6 -0
- package/dist/jsonl-Dq56Hab-.cjs +1 -0
- package/dist/jsonnet-BQnHlHrT.cjs +1 -0
- package/dist/jsonnet-DUWohlSd.js +6 -0
- package/dist/jssm-BcADi6EI.js +6 -0
- package/dist/jssm-D0M9iZPY.cjs +1 -0
- package/dist/jsx-DILy9-lz.js +6 -0
- package/dist/jsx-D_bjWdZ-.cjs +1 -0
- package/dist/julia-BePtZvGj.cjs +1 -0
- package/dist/julia-LDZ561rQ.js +16 -0
- package/dist/kotlin-BHZjvNqT.cjs +1 -0
- package/dist/kotlin-ByBMgTeR.js +6 -0
- package/dist/kusto-DR_RvIFV.cjs +1 -0
- package/dist/kusto-Rfzg9KzR.js +6 -0
- package/dist/latex-BfX5U1Sd.js +8 -0
- package/dist/latex-DKuYuEde.cjs +1 -0
- package/dist/lean-CQ0o2I4A.cjs +1 -0
- package/dist/lean-CcxdlaEO.js +6 -0
- package/dist/less-BiVrhzh9.cjs +1 -0
- package/dist/less-CDsaWg7S.js +6 -0
- package/dist/liquid-D9E8oQwR.js +14 -0
- package/dist/liquid-DlhhSgrf.cjs +1 -0
- package/dist/llvm-e4Xul33y.js +6 -0
- package/dist/llvm-iaGQW23L.cjs +1 -0
- package/dist/log-BJG8AI4v.cjs +1 -0
- package/dist/log-BMWGfviR.js +6 -0
- package/dist/logo-GcWtji1S.js +6 -0
- package/dist/logo-HR1XAufm.cjs +1 -0
- package/dist/lua-BhOzxiNv.cjs +1 -0
- package/dist/lua-Dq5PiiEh.js +8 -0
- package/dist/luau-BgETl4eQ.js +6 -0
- package/dist/luau-DCnGcpg3.cjs +1 -0
- package/dist/make-BxBgf5SK.cjs +1 -0
- package/dist/make-DATkTn5k.js +6 -0
- package/dist/markdown-At0E3C-H.cjs +1 -0
- package/dist/markdown-tpAksNgs.js +6 -0
- package/dist/marko-Cx05A6qT.cjs +1 -0
- package/dist/marko-em1KZZPI.js +14 -0
- package/dist/matlab-BTwqDlCV.js +6 -0
- package/dist/matlab-dYTV8Va8.cjs +1 -0
- package/dist/mdc-B85Vzck_.js +12 -0
- package/dist/mdc-CpY2Iu8n.cjs +1 -0
- package/dist/mdx-hX86k0IB.cjs +1 -0
- package/dist/mdx-mgX1SPaH.js +6 -0
- package/dist/mermaid-BNSe6TK0.cjs +1 -0
- package/dist/mermaid-BO-KORj_.js +6 -0
- package/dist/mipsasm-BB9ZDfqv.js +6 -0
- package/dist/mipsasm-Dxt7TSM8.cjs +1 -0
- package/dist/mojo-BkvFwM2J.js +6 -0
- package/dist/mojo-DVF5PDJm.cjs +1 -0
- package/dist/move-653S600C.js +6 -0
- package/dist/move-hjDZLTyZ.cjs +1 -0
- package/dist/narrat-CBeKHgTl.cjs +1 -0
- package/dist/narrat-DmhDCBs-.js +6 -0
- package/dist/nextflow-CAZJVaqd.js +6 -0
- package/dist/nextflow-DWoN8m6B.cjs +1 -0
- package/dist/nginx-BO3apUFm.js +8 -0
- package/dist/nginx-J1xxYqiq.cjs +1 -0
- package/dist/nim-Da03I0MI.js +20 -0
- package/dist/nim-c5pK8XVR.cjs +1 -0
- package/dist/nix-Cw-Fr32O.cjs +1 -0
- package/dist/nix-vXy2x35h.js +6 -0
- package/dist/nushell-BqaXMsQv.js +6 -0
- package/dist/nushell-DEKS6FxE.cjs +1 -0
- package/dist/objective-c-AZYrx03J.js +6 -0
- package/dist/objective-c-BiwxnXN2.cjs +1 -0
- package/dist/objective-cpp-Bwb4Yru9.cjs +1 -0
- package/dist/objective-cpp-CkEytQjB.js +6 -0
- package/dist/ocaml-43I0AHKg.js +6 -0
- package/dist/ocaml-Bsgw2BvN.cjs +1 -0
- package/dist/pascal-0cU5prrt.js +6 -0
- package/dist/pascal-BgZRbqCd.cjs +1 -0
- package/dist/perl-DCeajP4C.cjs +1 -0
- package/dist/perl-Sam3x-2m.js +16 -0
- package/dist/php-Cs8ilq_M.cjs +1 -0
- package/dist/php-cn7Y86XO.js +18 -0
- package/dist/plsql-Cffw5ZDA.js +6 -0
- package/dist/plsql-CxYgGA0l.cjs +1 -0
- package/dist/po-BNfHvqmm.js +6 -0
- package/dist/po-Rhu6MvnX.cjs +1 -0
- package/dist/polar-BtWqSUq2.cjs +1 -0
- package/dist/polar-CAZahv3u.js +6 -0
- package/dist/postcss-05aHdL-n.js +6 -0
- package/dist/postcss-Dh97DcaJ.cjs +1 -0
- package/dist/powerquery-BGL6VIw7.cjs +1 -0
- package/dist/powerquery-DI9HkTvs.js +6 -0
- package/dist/powershell-BGGfoZT9.cjs +1 -0
- package/dist/powershell-CxGt-Df_.js +6 -0
- package/dist/prisma-Dp473sn0.cjs +1 -0
- package/dist/prisma-FZjmVtSl.js +6 -0
- package/dist/prolog-Bt0ZRw9B.js +6 -0
- package/dist/prolog-DVOKEGjw.cjs +1 -0
- package/dist/proto-MmCPeFAD.js +6 -0
- package/dist/proto-kd7Vn2fe.cjs +1 -0
- package/dist/pug-VGa046OQ.js +12 -0
- package/dist/pug-i3YuDXdo.cjs +1 -0
- package/dist/puppet-CUJHmnxV.js +6 -0
- package/dist/puppet-cDQP_ZC_.cjs +1 -0
- package/dist/purescript-Bu5C7qza.cjs +1 -0
- package/dist/purescript-CTuz6_OV.js +6 -0
- package/dist/python-BJbwsA0T.js +6 -0
- package/dist/python-DfZ1_mTl.cjs +1 -0
- package/dist/qml-1q6XOxIY.js +8 -0
- package/dist/qml-BHKKs0ef.cjs +1 -0
- package/dist/qmldir-BInDYbpo.js +6 -0
- package/dist/qmldir-DNF9H2ir.cjs +1 -0
- package/dist/qss-C2fdVvsl.cjs +1 -0
- package/dist/qss-DKUo3sLE.js +6 -0
- package/dist/r-CPcuPYAN.cjs +1 -0
- package/dist/r-Dv5b3YUy.js +6 -0
- package/dist/racket-BysEjE3G.cjs +1 -0
- package/dist/racket-DD4on1Oj.js +6 -0
- package/dist/raku-Ce3vjiCV.js +6 -0
- package/dist/raku-DWLMjSNy.cjs +1 -0
- package/dist/razor-Dp3Dl0el.js +10 -0
- package/dist/razor-T1Z_g-NG.cjs +1 -0
- package/dist/reg-CevkCKuZ.cjs +1 -0
- package/dist/reg-m_s_Kiip.js +6 -0
- package/dist/regexp-BazyLpPg.js +6 -0
- package/dist/regexp-DabTWNLE.cjs +1 -0
- package/dist/rel-BS5APza7.cjs +1 -0
- package/dist/rel-BcRfyd6Q.js +6 -0
- package/dist/riscv-BacM50Nk.cjs +1 -0
- package/dist/riscv-C-9cOotF.js +6 -0
- package/dist/rst-DtTT5B3a.cjs +1 -0
- package/dist/rst-S1r8fhKI.js +22 -0
- package/dist/ruby-C4LLnb0J.cjs +1 -0
- package/dist/ruby-C9ouFU24.js +30 -0
- package/dist/rust-CLzF9zIN.js +6 -0
- package/dist/rust-CNeTMPbB.cjs +1 -0
- package/dist/sas-D5Uu8u0y.cjs +1 -0
- package/dist/sas-DS05aYL8.js +8 -0
- package/dist/sass-DxHp5rTx.js +6 -0
- package/dist/sass-vyo-bUwh.cjs +1 -0
- package/dist/scala-D4grkFkl.js +6 -0
- package/dist/scala-ZSekD-8-.cjs +1 -0
- package/dist/scheme-72Y4OSvz.js +6 -0
- package/dist/scheme-Bx3i9Kld.cjs +1 -0
- package/dist/scss-B4jpoMHP.cjs +1 -0
- package/dist/scss-BAGVQGbP.js +8 -0
- package/dist/sdbl-B7T8abf4.js +6 -0
- package/dist/sdbl-DeWT5r4i.cjs +1 -0
- package/dist/shaderlab-CJ9SEu5m.cjs +1 -0
- package/dist/shaderlab-Og2joYaK.js +8 -0
- package/dist/shellscript-DOSAZMuM.cjs +1 -0
- package/dist/shellscript-gRuZ7hNk.js +6 -0
- package/dist/shellsession-DSUh-pv6.js +8 -0
- package/dist/shellsession-n8ShO2Ub.cjs +1 -0
- package/dist/smalltalk-BT4qeiTo.js +6 -0
- package/dist/smalltalk-CJzLG25t.cjs +1 -0
- package/dist/solidity-CYggdHYd.cjs +1 -0
- package/dist/solidity-CneOhxmR.js +6 -0
- package/dist/soy-77OmKKfc.js +8 -0
- package/dist/soy-CY1OmCeQ.cjs +1 -0
- package/dist/sparql-6Cg9ppCl.cjs +1 -0
- package/dist/sparql-B0KWFEri.js +8 -0
- package/dist/splunk-BNkn--jx.cjs +1 -0
- package/dist/splunk-CzJ-Zf8b.js +6 -0
- package/dist/sql-Bz-fWgcJ.js +6 -0
- package/dist/sql-DPy3KOn-.cjs +1 -0
- package/dist/ssh-config-B93wBIBa.cjs +1 -0
- package/dist/ssh-config-DP-hNVbF.js +6 -0
- package/dist/stata-DWUtbMh2.js +8 -0
- package/dist/stata-DpBB3IXl.cjs +1 -0
- package/dist/stylus-C6F8nglz.cjs +1 -0
- package/dist/stylus-eDS3yA4Q.js +6 -0
- package/dist/svelte-B5qv6Vtk.js +14 -0
- package/dist/svelte-Bq_9MsFO.cjs +1 -0
- package/dist/swift-Cu-y7Uk9.js +6 -0
- package/dist/swift-pA-2lrob.cjs +1 -0
- package/dist/system-verilog-B0NmSI3m.js +6 -0
- package/dist/system-verilog-BFOMplBM.cjs +1 -0
- package/dist/systemd-BcsEpy1P.js +6 -0
- package/dist/systemd-DWaxn4CM.cjs +1 -0
- package/dist/talonscript-AuFDHys9.js +6 -0
- package/dist/talonscript-DLwkTvTL.cjs +1 -0
- package/dist/tasl--DC4oX-L.cjs +1 -0
- package/dist/tasl-Cg_WBUAe.js +6 -0
- package/dist/tcl-0Q0H86Yn.cjs +1 -0
- package/dist/tcl-DN7buRTF.js +6 -0
- package/dist/templ-CIxJsqXB.cjs +1 -0
- package/dist/templ-DMsSjICO.js +12 -0
- package/dist/terraform-BXIY0Avr.js +6 -0
- package/dist/terraform-uO7d3UFK.cjs +1 -0
- package/dist/tex-D7Eue8nn.js +8 -0
- package/dist/tex-DwaQN_Jy.cjs +1 -0
- package/dist/toml-D5Jd3p3r.js +6 -0
- package/dist/toml-p_Hzbzdz.cjs +1 -0
- package/dist/ts-tags-G8Jx4Opf.cjs +1 -0
- package/dist/ts-tags-ltPAzp0x.js +41 -0
- package/dist/tsv-BtvSkaG0.js +6 -0
- package/dist/tsv-DqNGnuVj.cjs +1 -0
- package/dist/tsx-BacM7pKl.cjs +1 -0
- package/dist/tsx-CwYBzqZD.js +6 -0
- package/dist/turtle-DipIidr5.cjs +1 -0
- package/dist/turtle-_H59FV7D.js +6 -0
- package/dist/twig-CzeM-Mdc.cjs +1 -0
- package/dist/twig-DhAeGEYy.js +18 -0
- package/dist/types/src/components/Common/Highlight/OAShiki.vue.d.ts +2 -2
- package/dist/types/src/components/Common/OACodeBlock.vue.d.ts +2 -2
- package/dist/types/src/components/Playground/OAPlaygroundBodyInput.vue.d.ts +3 -0
- package/dist/types/src/components/Playground/OAPlaygroundParameterInput.vue.d.ts +19 -0
- package/dist/types/src/components/Playground/OAPlaygroundParameters.vue.d.ts +19 -0
- package/dist/types/src/components/Sample/OACodeSamples.vue.d.ts +1 -11
- package/dist/types/src/components/ui/select-with-custom-option/SelectWithCustomOption.vue.d.ts +1 -1
- package/dist/types/src/composables/useShiki.d.ts +2 -0
- package/dist/types/src/composables/useTheme.d.ts +35 -9
- package/dist/types/src/lib/codeSamples/generateCodeSample.d.ts +2 -1
- package/dist/types/src/lib/examples/getPropertyExample.d.ts +2 -0
- package/dist/types/src/lib/playground/playgroundExampleBehavior.d.ts +5 -0
- package/dist/typescript-Bt6RvN7l.js +6 -0
- package/dist/typescript-D8n4nQfB.cjs +1 -0
- package/dist/typespec-CLqB-2XS.cjs +1 -0
- package/dist/typespec-Djmco60m.js +6 -0
- package/dist/typst-D1Xy7XAg.js +6 -0
- package/dist/typst-sG9-qh9P.cjs +1 -0
- package/dist/useOpenapi-DHJ6SAsR.cjs +111 -0
- package/dist/{useOpenapi-6CsRISb7.js → useOpenapi-DqKJozk7.js} +1827 -1808
- package/dist/v-Dq1apf8y.cjs +1 -0
- package/dist/v-DtlRovWa.js +6 -0
- package/dist/vala-B2iuM95f.cjs +1 -0
- package/dist/vala-hXVBNcDV.js +6 -0
- package/dist/vb-CdOivdro.cjs +1 -0
- package/dist/vb-CeNdtQe1.js +6 -0
- package/dist/verilog-AMohXZcN.cjs +1 -0
- package/dist/verilog-B-bybjPF.js +6 -0
- package/dist/vhdl--iPMu36M.cjs +1 -0
- package/dist/vhdl-DvPF1z3y.js +6 -0
- package/dist/viml-B3XK6vKo.js +6 -0
- package/dist/viml-CrWc8Njv.cjs +1 -0
- package/dist/vitepress-openapi.client.cjs.js +179 -178
- package/dist/vitepress-openapi.client.es.js +27139 -25720
- package/dist/vitepress-openapi.css +1 -1
- package/dist/vitepress-openapi.node.cjs.js +1 -1
- package/dist/vitepress-openapi.node.es.js +1 -1
- package/dist/vue-BQReV1nl.js +31 -0
- package/dist/vue-DT8l9O9g.cjs +1 -0
- package/dist/vue-html-CGJZYYWg.js +10 -0
- package/dist/vue-html-DZ7EUmrr.cjs +1 -0
- package/dist/vyper-SBRFIT2x.js +6 -0
- package/dist/vyper-Wv1PKPYi.cjs +1 -0
- package/dist/wasm-CaJFM9eO.cjs +1 -0
- package/dist/wasm-LjSqHxW-.js +6 -0
- package/dist/wenyan-CRNx8UP3.cjs +1 -0
- package/dist/wenyan-pbVjoM9_.js +6 -0
- package/dist/wgsl-DF5qc9dd.cjs +1 -0
- package/dist/wgsl-DY4iK1q1.js +6 -0
- package/dist/wikitext-Aup4DNZQ.cjs +1 -0
- package/dist/wikitext-DImBD-ms.js +6 -0
- package/dist/wit-BjWgLsJj.cjs +1 -0
- package/dist/wit-CQMQOlTg.js +6 -0
- package/dist/wolfram-CalwhY2X.js +6 -0
- package/dist/wolfram-DVDIDijM.cjs +1 -0
- package/dist/xml-CCE_6duq.cjs +1 -0
- package/dist/xml-D4IZPm1_.js +8 -0
- package/dist/xsl-Bi6Zn0mH.cjs +1 -0
- package/dist/xsl-BziKlaTt.js +8 -0
- package/dist/yaml-DaO7k5B1.js +6 -0
- package/dist/yaml-XVBmpKh-.cjs +1 -0
- package/dist/zenscript-BP4Ggu2u.js +6 -0
- package/dist/zenscript-UyTM2fWU.cjs +1 -0
- package/dist/zig-BXwYp5qu.cjs +1 -0
- package/dist/zig-C6NB9UvU.js +6 -0
- package/package.json +2 -1
- package/src/components/Common/Highlight/OAShiki.vue +2 -2
- package/src/components/Feature/OAOperationContent.vue +0 -1
- package/src/components/Playground/OAPlayground.vue +7 -1
- package/src/components/Playground/OAPlaygroundBodyInput.vue +10 -2
- package/src/components/Playground/OAPlaygroundParameterInput.vue +20 -5
- package/src/components/Playground/OAPlaygroundParameters.vue +23 -8
- package/src/components/Sample/OACodeSamples.vue +86 -40
- package/src/composables/useShiki.ts +94 -11
- package/src/composables/useTheme.ts +69 -45
- package/src/lib/codeSamples/generateCodeSample.ts +18 -17
- package/src/lib/examples/getPropertyExample.ts +9 -1
- package/src/lib/parser/generateCodeSamples.ts +1 -1
- package/src/lib/parser/getSchemaUi.ts +9 -6
- package/src/lib/playground/playgroundExampleBehavior.ts +48 -0
- package/dist/useOpenapi-BWPHDvt-.cjs +0 -111
|
@@ -1,63 +1,109 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { OperationData } from '@/lib/operation/operationData'
|
|
3
|
+
import type { LanguageConfig } from '../../composables/useTheme'
|
|
3
4
|
import { OPERATION_DATA_KEY } from '@/lib/operation/operationData'
|
|
4
|
-
import {
|
|
5
|
+
import { inject, ref, watch } from 'vue'
|
|
6
|
+
import { useShiki } from '../../composables/useShiki'
|
|
5
7
|
import { useTheme } from '../../composables/useTheme'
|
|
6
8
|
import OACodeBlock from '../Common/OACodeBlock.vue'
|
|
7
9
|
|
|
10
|
+
type Sample = LanguageConfig & {
|
|
11
|
+
key: string
|
|
12
|
+
tabId: string
|
|
13
|
+
highlighter: string
|
|
14
|
+
source: string
|
|
15
|
+
}
|
|
16
|
+
|
|
8
17
|
const props = defineProps({
|
|
9
18
|
operationId: {
|
|
10
19
|
type: String,
|
|
11
20
|
required: true,
|
|
12
21
|
},
|
|
13
|
-
codeSamples: {
|
|
14
|
-
type: Object,
|
|
15
|
-
default: () => ({}),
|
|
16
|
-
},
|
|
17
22
|
})
|
|
18
23
|
|
|
19
24
|
const operationData = inject(OPERATION_DATA_KEY) as OperationData
|
|
20
25
|
|
|
21
26
|
const themeConfig = useTheme()
|
|
22
27
|
|
|
23
|
-
const
|
|
28
|
+
const shiki = useShiki()
|
|
24
29
|
|
|
25
|
-
const
|
|
30
|
+
const availableLanguages = themeConfig.getCodeSamplesAvailableLanguages()
|
|
26
31
|
|
|
27
32
|
const generator = themeConfig.getCodeSamplesGenerator()
|
|
28
33
|
|
|
29
|
-
const samples = ref(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
source,
|
|
33
|
-
}))
|
|
34
|
-
: props.codeSamples)
|
|
34
|
+
const samples = ref<Sample[]>([])
|
|
35
|
+
|
|
36
|
+
const activeSampleKey = ref('')
|
|
35
37
|
|
|
36
|
-
const
|
|
37
|
-
const defaultValue = themeConfig.getCodeSamplesDefaultLang()
|
|
38
|
+
const radioGroupName = `group-${props.operationId}`
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
watch(operationData.playground.request, async (playgroundRequest, _, onInvalidate) => {
|
|
41
|
+
let cancelled = false
|
|
42
|
+
onInvalidate(() => {
|
|
43
|
+
cancelled = true
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
if (!availableLanguages || !generator) {
|
|
47
|
+
return
|
|
41
48
|
}
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
const nextSamples = await Promise.all(
|
|
51
|
+
availableLanguages.map(async (langConfig) => {
|
|
52
|
+
const { lang, target, client, highlighter } = langConfig
|
|
53
|
+
const key = [lang, target, client]
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
.join('-')
|
|
56
|
+
const tabId = `tab-${props.operationId}-${key}`
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
try {
|
|
59
|
+
const source = await generator(langConfig, playgroundRequest)
|
|
60
|
+
if (!source) {
|
|
61
|
+
throw new Error('Code generator returned empty result.')
|
|
62
|
+
}
|
|
47
63
|
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
return {
|
|
65
|
+
...langConfig,
|
|
66
|
+
key,
|
|
67
|
+
tabId,
|
|
68
|
+
highlighter: highlighter || 'plain',
|
|
69
|
+
source,
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
console.error(`Failed to generate code sample for '${lang}'`, { langConfig, error })
|
|
74
|
+
return {
|
|
75
|
+
...langConfig,
|
|
76
|
+
key,
|
|
77
|
+
tabId,
|
|
78
|
+
highlighter: 'shell',
|
|
79
|
+
source: `// Failed to generate sample.\n// Please check the console for details.`,
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
// Guard against stale data due to rapid updates of `operationData.playground.request`
|
|
86
|
+
if (cancelled) {
|
|
50
87
|
return
|
|
51
88
|
}
|
|
52
89
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
90
|
+
// Preload all highlighter languages
|
|
91
|
+
const uniqueHighlighters = [...new Set(nextSamples.map(s => s.highlighter).filter(Boolean))]
|
|
92
|
+
await Promise.all(uniqueHighlighters.map(lang => shiki.ensureLanguage(lang)))
|
|
93
|
+
|
|
94
|
+
if (cancelled) {
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
samples.value = nextSamples
|
|
99
|
+
|
|
100
|
+
if (!activeSampleKey.value || !samples.value.some(s => s.key === activeSampleKey.value)) {
|
|
101
|
+
const defaultLang = themeConfig.getCodeSamplesDefaultLang()
|
|
102
|
+
const defaultSample = samples.value.find(s => s.lang === defaultLang) || samples.value[0]
|
|
103
|
+
if (defaultSample) {
|
|
104
|
+
activeSampleKey.value = defaultSample.key
|
|
105
|
+
}
|
|
106
|
+
}
|
|
61
107
|
}, {
|
|
62
108
|
deep: true,
|
|
63
109
|
immediate: true,
|
|
@@ -71,30 +117,30 @@ watch(operationData.playground.request, async (request) => {
|
|
|
71
117
|
class="vp-code-group vp-adaptive-theme mt-0"
|
|
72
118
|
>
|
|
73
119
|
<div class="tabs !m-0">
|
|
74
|
-
<template v-for="sample in samples" :key="sample.
|
|
120
|
+
<template v-for="sample in samples" :key="sample.key">
|
|
75
121
|
<input
|
|
76
|
-
:id="
|
|
122
|
+
:id="sample.tabId"
|
|
77
123
|
type="radio"
|
|
78
|
-
:name="
|
|
79
|
-
:checked="
|
|
80
|
-
@change="
|
|
124
|
+
:name="radioGroupName"
|
|
125
|
+
:checked="activeSampleKey === sample.key"
|
|
126
|
+
@change="activeSampleKey = sample.key"
|
|
81
127
|
>
|
|
82
128
|
<label
|
|
83
|
-
:for="
|
|
129
|
+
:for="sample.tabId"
|
|
84
130
|
:data-title="sample.icon"
|
|
85
|
-
>{{ sample.label
|
|
131
|
+
>{{ sample.label }}</label>
|
|
86
132
|
</template>
|
|
87
133
|
</div>
|
|
88
134
|
|
|
89
135
|
<div class="blocks">
|
|
90
136
|
<OACodeBlock
|
|
91
137
|
v-for="sample in samples"
|
|
92
|
-
:key="sample.
|
|
138
|
+
:key="sample.key"
|
|
93
139
|
:code="sample.source"
|
|
94
140
|
:lang="sample.highlighter"
|
|
95
141
|
:label="sample.label"
|
|
96
|
-
:active="
|
|
97
|
-
:class="{ active:
|
|
142
|
+
:active="activeSampleKey === sample.key"
|
|
143
|
+
:class="{ active: activeSampleKey === sample.key }"
|
|
98
144
|
class="!m-0"
|
|
99
145
|
/>
|
|
100
146
|
</div>
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import type { HighlighterCore } from 'shiki/core'
|
|
2
|
-
import
|
|
3
|
-
import js from '@shikijs/langs/javascript'
|
|
4
|
-
import json from '@shikijs/langs/json'
|
|
5
|
-
import markdown from '@shikijs/langs/markdown'
|
|
6
|
-
import php from '@shikijs/langs/php'
|
|
7
|
-
import python from '@shikijs/langs/python'
|
|
8
|
-
import ts from '@shikijs/langs/typescript'
|
|
9
|
-
import xml from '@shikijs/langs/xml'
|
|
2
|
+
import type { BundledLanguage } from 'shiki/langs'
|
|
10
3
|
import { createHighlighterCore } from 'shiki/core'
|
|
11
4
|
import { createJavaScriptRegexEngine } from 'shiki/engine/javascript'
|
|
5
|
+
import { bundledLanguages as highlighterImports } from 'shiki/langs'
|
|
12
6
|
import { ref } from 'vue'
|
|
13
7
|
import { useTheme } from './useTheme'
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
// Core highlighters always loaded for response body highlighting (not shown in code samples UI)
|
|
10
|
+
const CORE_HIGHLIGHTERS: BundledLanguage[] = ['json', 'xml', 'markdown']
|
|
16
11
|
|
|
17
12
|
let shiki: HighlighterCore | null = null
|
|
18
13
|
let initPromise: Promise<void> | null = null
|
|
19
14
|
|
|
15
|
+
// Track in-flight language loads to avoid duplicate requests
|
|
16
|
+
const languageLoadPromises = new Map<string, Promise<boolean>>()
|
|
17
|
+
|
|
20
18
|
const loading = ref(true)
|
|
21
|
-
const themeConfig = useTheme()
|
|
22
19
|
|
|
23
20
|
export function useShiki() {
|
|
21
|
+
/**
|
|
22
|
+
* Initialize Shiki with core highlighters only (json, xml, markdown).
|
|
23
|
+
* Additional languages are loaded on-demand via ensureLanguage().
|
|
24
|
+
*/
|
|
24
25
|
function init(): Promise<void> {
|
|
25
26
|
if (initPromise) {
|
|
26
27
|
return initPromise
|
|
@@ -33,17 +34,39 @@ export function useShiki() {
|
|
|
33
34
|
return
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
const themeConfig = useTheme()
|
|
38
|
+
|
|
39
|
+
// Load only core highlighters during init
|
|
40
|
+
const coreLangModules = await Promise.all(
|
|
41
|
+
CORE_HIGHLIGHTERS.map(async (lang) => {
|
|
42
|
+
const importer = highlighterImports[lang]
|
|
43
|
+
if (!importer) {
|
|
44
|
+
return []
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const mod = await importer()
|
|
48
|
+
return mod.default
|
|
49
|
+
} catch {
|
|
50
|
+
return []
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
)
|
|
54
|
+
|
|
36
55
|
shiki = await createHighlighterCore({
|
|
37
56
|
themes: [
|
|
38
57
|
themeConfig.getHighlighterTheme()?.light,
|
|
39
58
|
themeConfig.getHighlighterTheme()?.dark,
|
|
40
59
|
],
|
|
41
|
-
langs,
|
|
60
|
+
langs: coreLangModules.filter(Boolean).flat(),
|
|
42
61
|
engine: createJavaScriptRegexEngine({
|
|
43
62
|
target: 'ES2018',
|
|
44
63
|
}),
|
|
45
64
|
})
|
|
46
65
|
|
|
66
|
+
if (!shiki) {
|
|
67
|
+
throw new Error('Failed to create Shiki highlighter')
|
|
68
|
+
}
|
|
69
|
+
|
|
47
70
|
loading.value = false
|
|
48
71
|
} catch (error) {
|
|
49
72
|
initPromise = null
|
|
@@ -54,10 +77,67 @@ export function useShiki() {
|
|
|
54
77
|
return initPromise
|
|
55
78
|
}
|
|
56
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Ensure a language is loaded. Loads it on-demand if not already available.
|
|
82
|
+
* Returns true if the language is ready, false if it couldn't be loaded.
|
|
83
|
+
*/
|
|
84
|
+
async function ensureLanguage(lang: string): Promise<boolean> {
|
|
85
|
+
// Make sure shiki is initialized first
|
|
86
|
+
try {
|
|
87
|
+
await init()
|
|
88
|
+
} catch (e) {
|
|
89
|
+
console.error('Failed to initialize Shiki:', e)
|
|
90
|
+
return false
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (!shiki) {
|
|
94
|
+
return false
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Already loaded
|
|
98
|
+
if (shiki.getLoadedLanguages().includes(lang)) {
|
|
99
|
+
return true
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Check if already loading
|
|
103
|
+
const existingPromise = languageLoadPromises.get(lang)
|
|
104
|
+
if (existingPromise) {
|
|
105
|
+
return existingPromise
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Start loading
|
|
109
|
+
const loadPromise = (async () => {
|
|
110
|
+
const importer = highlighterImports[lang as BundledLanguage]
|
|
111
|
+
|
|
112
|
+
if (!importer) {
|
|
113
|
+
console.warn(`Shiki language "${lang}" not available.`)
|
|
114
|
+
return false
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
const mod = await importer()
|
|
119
|
+
await shiki!.loadLanguage(mod.default)
|
|
120
|
+
return true
|
|
121
|
+
} catch (e) {
|
|
122
|
+
console.error(`Failed to load Shiki language "${lang}":`, e)
|
|
123
|
+
return false
|
|
124
|
+
} finally {
|
|
125
|
+
languageLoadPromises.delete(lang)
|
|
126
|
+
}
|
|
127
|
+
})()
|
|
128
|
+
|
|
129
|
+
languageLoadPromises.set(lang, loadPromise)
|
|
130
|
+
return loadPromise
|
|
131
|
+
}
|
|
132
|
+
|
|
57
133
|
function isReady(): boolean {
|
|
58
134
|
return shiki !== null
|
|
59
135
|
}
|
|
60
136
|
|
|
137
|
+
function isLanguageLoaded(lang: string): boolean {
|
|
138
|
+
return shiki?.getLoadedLanguages().includes(lang) ?? false
|
|
139
|
+
}
|
|
140
|
+
|
|
61
141
|
function renderShiki(content: string, { lang, theme }: { lang: string, theme: string }) {
|
|
62
142
|
if (shiki && shiki.getLoadedLanguages().includes(lang)) {
|
|
63
143
|
return shiki.codeToHtml(content, {
|
|
@@ -72,6 +152,7 @@ export function useShiki() {
|
|
|
72
152
|
function reset() {
|
|
73
153
|
shiki = null
|
|
74
154
|
initPromise = null
|
|
155
|
+
languageLoadPromises.clear()
|
|
75
156
|
loading.value = true
|
|
76
157
|
}
|
|
77
158
|
|
|
@@ -79,7 +160,9 @@ export function useShiki() {
|
|
|
79
160
|
loading,
|
|
80
161
|
renderShiki,
|
|
81
162
|
init,
|
|
163
|
+
ensureLanguage,
|
|
82
164
|
isReady,
|
|
165
|
+
isLanguageLoaded,
|
|
83
166
|
reset,
|
|
84
167
|
initShiki: async () => {
|
|
85
168
|
console.warn('initShiki is deprecated, use init instead')
|
|
@@ -92,6 +92,8 @@ export interface ResponseConfig {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
export type PlaygroundExampleBehavior = 'placeholder' | 'value' | 'ignore'
|
|
96
|
+
|
|
95
97
|
export interface PlaygroundConfig {
|
|
96
98
|
jsonEditor?: {
|
|
97
99
|
mode?: Ref<PlaygroundJsonEditorMode>
|
|
@@ -99,6 +101,11 @@ export interface PlaygroundConfig {
|
|
|
99
101
|
navigationBar?: Ref<boolean>
|
|
100
102
|
statusBar?: Ref<boolean>
|
|
101
103
|
}
|
|
104
|
+
|
|
105
|
+
examples?: {
|
|
106
|
+
behavior?: Ref<PlaygroundExampleBehavior>
|
|
107
|
+
playgroundExampleBehavior?: Ref<PlaygroundExampleBehavior>
|
|
108
|
+
}
|
|
102
109
|
}
|
|
103
110
|
|
|
104
111
|
export interface SecurityConfig {
|
|
@@ -175,7 +182,6 @@ export interface UseThemeConfig {
|
|
|
175
182
|
}
|
|
176
183
|
|
|
177
184
|
export interface CodeSamplesConfig {
|
|
178
|
-
langs: string[]
|
|
179
185
|
defaultLang: string
|
|
180
186
|
availableLanguages: LanguageConfig[]
|
|
181
187
|
generator: GeneratorFunction
|
|
@@ -187,16 +193,24 @@ export interface LinksPrefixesConfig {
|
|
|
187
193
|
operations: string
|
|
188
194
|
}
|
|
189
195
|
|
|
190
|
-
interface LanguageConfig {
|
|
196
|
+
export interface LanguageConfig {
|
|
197
|
+
/** Unique identifier and Shiki highlighter language (e.g., 'curl', 'javascript', 'php') */
|
|
191
198
|
lang: string
|
|
199
|
+
/** Display name shown in the UI */
|
|
192
200
|
label: string
|
|
193
|
-
|
|
201
|
+
/** Target language for @scalar/snippetz code generation (e.g., 'js', 'shell', 'python') */
|
|
202
|
+
target?: string
|
|
203
|
+
/** HTTP client for the target language (e.g., 'fetch', 'axios', 'curl') */
|
|
204
|
+
client?: string
|
|
205
|
+
/** Icon identifier for vitepress-plugin-group-icons */
|
|
194
206
|
icon?: string
|
|
207
|
+
/** Shiki language for syntax highlighting (defaults to 'plain') */
|
|
208
|
+
highlighter?: string
|
|
195
209
|
}
|
|
196
210
|
|
|
197
211
|
export type PartialUseThemeConfig = Partial<UnwrapNestedRefs<UseThemeConfig>>
|
|
198
212
|
|
|
199
|
-
type GeneratorFunction = (
|
|
213
|
+
type GeneratorFunction = (langConfig: LanguageConfig, request: OARequest) => Promise<string>
|
|
200
214
|
|
|
201
215
|
type GetServersFunction = ({ method, path, operation }: { method: string, path: string, operation: ParsedOperation }) => string[] | null
|
|
202
216
|
|
|
@@ -220,24 +234,32 @@ export const availableLanguages: LanguageConfig[] = [
|
|
|
220
234
|
{
|
|
221
235
|
lang: 'curl',
|
|
222
236
|
label: 'cURL',
|
|
237
|
+
target: 'shell',
|
|
238
|
+
client: 'curl',
|
|
223
239
|
highlighter: 'bash',
|
|
224
240
|
icon: 'curl',
|
|
225
241
|
},
|
|
226
242
|
{
|
|
227
243
|
lang: 'javascript',
|
|
228
244
|
label: 'JavaScript',
|
|
245
|
+
target: 'js',
|
|
246
|
+
client: 'fetch',
|
|
229
247
|
highlighter: 'javascript',
|
|
230
248
|
icon: '.js',
|
|
231
249
|
},
|
|
232
250
|
{
|
|
233
251
|
lang: 'php',
|
|
234
252
|
label: 'PHP',
|
|
253
|
+
target: 'php',
|
|
254
|
+
client: 'curl',
|
|
235
255
|
highlighter: 'php',
|
|
236
256
|
icon: '.php',
|
|
237
257
|
},
|
|
238
258
|
{
|
|
239
259
|
lang: 'python',
|
|
240
260
|
label: 'Python',
|
|
261
|
+
target: 'python',
|
|
262
|
+
client: 'requests',
|
|
241
263
|
highlighter: 'python',
|
|
242
264
|
icon: '.py',
|
|
243
265
|
},
|
|
@@ -287,6 +309,10 @@ const defaultValues = {
|
|
|
287
309
|
navigationBar: false,
|
|
288
310
|
statusBar: false,
|
|
289
311
|
},
|
|
312
|
+
examples: {
|
|
313
|
+
behavior: 'value' as PlaygroundExampleBehavior,
|
|
314
|
+
playgroundExampleBehavior: 'value' as PlaygroundExampleBehavior,
|
|
315
|
+
},
|
|
290
316
|
},
|
|
291
317
|
security: {
|
|
292
318
|
defaultScheme: null as string | null,
|
|
@@ -338,15 +364,9 @@ const defaultValues = {
|
|
|
338
364
|
disableDownload: false,
|
|
339
365
|
},
|
|
340
366
|
codeSamples: {
|
|
341
|
-
langs: [
|
|
342
|
-
'curl',
|
|
343
|
-
'javascript',
|
|
344
|
-
'php',
|
|
345
|
-
'python',
|
|
346
|
-
],
|
|
347
367
|
defaultLang: 'curl',
|
|
348
368
|
availableLanguages,
|
|
349
|
-
generator: (
|
|
369
|
+
generator: (langConfig: LanguageConfig, request: OARequest) => generateCodeSample(langConfig, request),
|
|
350
370
|
defaultHeaders: {},
|
|
351
371
|
},
|
|
352
372
|
linksPrefixes: {
|
|
@@ -403,6 +423,10 @@ const themeConfig: UseThemeConfig = {
|
|
|
403
423
|
navigationBar: ref(defaultValues.playground.jsonEditor.navigationBar),
|
|
404
424
|
statusBar: ref(defaultValues.playground.jsonEditor.statusBar),
|
|
405
425
|
},
|
|
426
|
+
examples: {
|
|
427
|
+
behavior: ref(defaultValues.playground.examples?.behavior ?? 'value'),
|
|
428
|
+
playgroundExampleBehavior: ref(defaultValues.playground.examples?.playgroundExampleBehavior ?? 'value'),
|
|
429
|
+
},
|
|
406
430
|
},
|
|
407
431
|
security: {
|
|
408
432
|
defaultScheme: ref(defaultValues.security.defaultScheme),
|
|
@@ -433,7 +457,6 @@ const themeConfig: UseThemeConfig = {
|
|
|
433
457
|
disableDownload: ref(defaultValues.spec.disableDownload),
|
|
434
458
|
},
|
|
435
459
|
codeSamples: {
|
|
436
|
-
langs: defaultValues.codeSamples.langs,
|
|
437
460
|
defaultLang: defaultValues.codeSamples.defaultLang,
|
|
438
461
|
availableLanguages: defaultValues.codeSamples.availableLanguages,
|
|
439
462
|
generator: defaultValues.codeSamples.generator,
|
|
@@ -525,6 +548,12 @@ export function useTheme(initialConfig: PartialUseThemeConfig = {}) {
|
|
|
525
548
|
if (config.playground?.jsonEditor?.statusBar !== undefined) {
|
|
526
549
|
ensureNestedRefProperty(themeConfig, ['playground', 'jsonEditor'], 'statusBar', config.playground.jsonEditor.statusBar)
|
|
527
550
|
}
|
|
551
|
+
if (config.playground?.examples?.behavior !== undefined) {
|
|
552
|
+
ensureNestedRefProperty(themeConfig, ['playground', 'examples'], 'behavior', config.playground.examples.behavior)
|
|
553
|
+
}
|
|
554
|
+
if (config.playground?.examples?.playgroundExampleBehavior !== undefined) {
|
|
555
|
+
ensureNestedRefProperty(themeConfig, ['playground', 'examples'], 'playgroundExampleBehavior', config.playground.examples.playgroundExampleBehavior)
|
|
556
|
+
}
|
|
528
557
|
|
|
529
558
|
// Security
|
|
530
559
|
if (config.security?.defaultScheme !== undefined) {
|
|
@@ -745,6 +774,22 @@ export function useTheme(initialConfig: PartialUseThemeConfig = {}) {
|
|
|
745
774
|
ensureNestedRefProperty(themeConfig, ['playground', 'jsonEditor'], 'statusBar', value)
|
|
746
775
|
}
|
|
747
776
|
|
|
777
|
+
function getPlaygroundExamplesBehavior(): PlaygroundExampleBehavior {
|
|
778
|
+
return themeConfig?.playground?.examples?.behavior?.value ?? 'value'
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
function setPlaygroundExamplesBehavior(value: PlaygroundExampleBehavior) {
|
|
782
|
+
ensureNestedRefProperty(themeConfig, ['playground', 'examples'], 'behavior', value)
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
function getPlaygroundXExampleBehavior(): PlaygroundExampleBehavior {
|
|
786
|
+
return themeConfig?.playground?.examples?.playgroundExampleBehavior?.value ?? 'value'
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function setPlaygroundXExampleBehavior(value: PlaygroundExampleBehavior) {
|
|
790
|
+
ensureNestedRefProperty(themeConfig, ['playground', 'examples'], 'playgroundExampleBehavior', value)
|
|
791
|
+
}
|
|
792
|
+
|
|
748
793
|
function getSecurityDefaultScheme(): string | null | undefined {
|
|
749
794
|
return themeConfig?.security?.defaultScheme?.value
|
|
750
795
|
}
|
|
@@ -884,19 +929,10 @@ export function useTheme(initialConfig: PartialUseThemeConfig = {}) {
|
|
|
884
929
|
}
|
|
885
930
|
}
|
|
886
931
|
|
|
887
|
-
function getCodeSamplesLangs() {
|
|
888
|
-
const codeSamples = ensureNestedProperty(themeConfig, 'codeSamples')
|
|
889
|
-
|
|
890
|
-
if (!codeSamples.langs) {
|
|
891
|
-
codeSamples.langs = defaultValues.codeSamples.langs
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
return codeSamples.langs.filter((lang, index, self) => self.indexOf(lang) === index)
|
|
895
|
-
}
|
|
896
|
-
|
|
897
932
|
function getCodeSamplesDefaultLang() {
|
|
898
|
-
const
|
|
933
|
+
const availableLanguages = getCodeSamplesAvailableLanguages()
|
|
899
934
|
const codeSamples = ensureNestedProperty(themeConfig, 'codeSamples')
|
|
935
|
+
const availableLangs = availableLanguages.map(l => l.lang)
|
|
900
936
|
|
|
901
937
|
if (codeSamples.defaultLang && availableLangs.includes(codeSamples.defaultLang)) {
|
|
902
938
|
return codeSamples.defaultLang
|
|
@@ -905,10 +941,12 @@ export function useTheme(initialConfig: PartialUseThemeConfig = {}) {
|
|
|
905
941
|
return availableLangs[0]
|
|
906
942
|
}
|
|
907
943
|
|
|
908
|
-
function getCodeSamplesAvailableLanguages() {
|
|
944
|
+
function getCodeSamplesAvailableLanguages(filter: Array<string> = []) {
|
|
909
945
|
const codeSamples = ensureNestedProperty(themeConfig, 'codeSamples')
|
|
910
|
-
|
|
911
|
-
|
|
946
|
+
if (filter.length) {
|
|
947
|
+
return codeSamples.availableLanguages?.filter(lang => filter.includes(lang.lang)) || []
|
|
948
|
+
}
|
|
949
|
+
return codeSamples.availableLanguages || []
|
|
912
950
|
}
|
|
913
951
|
|
|
914
952
|
function getCodeSamplesGenerator() {
|
|
@@ -930,10 +968,6 @@ export function useTheme(initialConfig: PartialUseThemeConfig = {}) {
|
|
|
930
968
|
function setCodeSamplesConfig(config: Partial<UnwrapNestedRefs<CodeSamplesConfig>>) {
|
|
931
969
|
const codeSamples = ensureNestedProperty(themeConfig, 'codeSamples')
|
|
932
970
|
|
|
933
|
-
if (config.langs) {
|
|
934
|
-
codeSamples.langs = config.langs.filter((lang, index, self) => self.indexOf(lang) === index)
|
|
935
|
-
}
|
|
936
|
-
|
|
937
971
|
if (config.defaultLang) {
|
|
938
972
|
codeSamples.defaultLang = config.defaultLang
|
|
939
973
|
}
|
|
@@ -953,20 +987,7 @@ export function useTheme(initialConfig: PartialUseThemeConfig = {}) {
|
|
|
953
987
|
|
|
954
988
|
function setCodeSamplesAvailableLanguages(languages: LanguageConfig[]) {
|
|
955
989
|
const codeSamples = ensureNestedProperty(themeConfig, 'codeSamples')
|
|
956
|
-
|
|
957
|
-
if (!codeSamples.availableLanguages) {
|
|
958
|
-
codeSamples.availableLanguages = defaultValues.codeSamples.availableLanguages
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
const uniqueLanguages = [...new Set(languages.map(({ lang }) => lang))]
|
|
962
|
-
|
|
963
|
-
codeSamples.availableLanguages = uniqueLanguages.map((lang) => {
|
|
964
|
-
const language
|
|
965
|
-
= languages.find(l => l.lang === lang)
|
|
966
|
-
?? availableLanguages.find(l => l.lang === lang)
|
|
967
|
-
|
|
968
|
-
return language || { lang, label: lang, highlighter: 'plaintext' }
|
|
969
|
-
})
|
|
990
|
+
codeSamples.availableLanguages = languages
|
|
970
991
|
}
|
|
971
992
|
|
|
972
993
|
function getLinksPrefixesConfig() {
|
|
@@ -1091,6 +1112,10 @@ export function useTheme(initialConfig: PartialUseThemeConfig = {}) {
|
|
|
1091
1112
|
setPlaygroundJsonEditorNavigationBar,
|
|
1092
1113
|
getPlaygroundJsonEditorStatusBar,
|
|
1093
1114
|
setPlaygroundJsonEditorStatusBar,
|
|
1115
|
+
getPlaygroundExamplesBehavior,
|
|
1116
|
+
setPlaygroundExamplesBehavior,
|
|
1117
|
+
getPlaygroundXExampleBehavior,
|
|
1118
|
+
setPlaygroundXExampleBehavior,
|
|
1094
1119
|
getSecurityDefaultScheme,
|
|
1095
1120
|
setSecurityDefaultScheme,
|
|
1096
1121
|
getOperationBadges,
|
|
@@ -1109,7 +1134,6 @@ export function useTheme(initialConfig: PartialUseThemeConfig = {}) {
|
|
|
1109
1134
|
getWrapExamples,
|
|
1110
1135
|
getSpecDisableDownload,
|
|
1111
1136
|
setSpecConfig,
|
|
1112
|
-
getCodeSamplesLangs,
|
|
1113
1137
|
getCodeSamplesDefaultLang,
|
|
1114
1138
|
getCodeSamplesAvailableLanguages,
|
|
1115
1139
|
getCodeSamplesGenerator,
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LanguageConfig } from '../../composables/useTheme'
|
|
2
2
|
import { snippetz } from '@scalar/snippetz'
|
|
3
3
|
import { buildHarRequest } from './buildHarRequest'
|
|
4
4
|
import { buildRequest } from './buildRequest'
|
|
5
5
|
import { OARequest } from './request'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
python: 'python',
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const clientsMap: Record<string, ClientId<TargetId>> = {
|
|
15
|
-
curl: 'curl',
|
|
16
|
-
javascript: 'fetch',
|
|
17
|
-
php: 'curl',
|
|
18
|
-
python: 'requests',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function generateCodeSample(lang: string, request: OARequest | any): Promise<string> {
|
|
7
|
+
export async function generateCodeSample(
|
|
8
|
+
langConfig: LanguageConfig,
|
|
9
|
+
request: OARequest | any,
|
|
10
|
+
): Promise<string> {
|
|
22
11
|
const oaRequest = request instanceof OARequest
|
|
23
12
|
? request
|
|
24
13
|
: buildRequest(request)
|
|
25
14
|
|
|
26
15
|
const harRequest = buildHarRequest(oaRequest)
|
|
27
16
|
|
|
17
|
+
const { lang, target, client } = langConfig
|
|
18
|
+
|
|
19
|
+
if (!target) {
|
|
20
|
+
console.error(`Language "${lang}" has missing property "target" in availableLanguages`)
|
|
21
|
+
return ''
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!client) {
|
|
25
|
+
console.error(`Language "${lang}" has missing property "client" in availableLanguages`)
|
|
26
|
+
return ''
|
|
27
|
+
}
|
|
28
|
+
|
|
28
29
|
try {
|
|
29
|
-
return snippetz().print(
|
|
30
|
+
return snippetz().print(target as any, client as any, harRequest) ?? ''
|
|
30
31
|
} catch (e) {
|
|
31
32
|
console.error(e, request)
|
|
32
33
|
return ''
|
|
@@ -63,7 +63,7 @@ function firstFromExamples(
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export function
|
|
66
|
+
export function getPlaygroundSpecificExample(property: any): any {
|
|
67
67
|
if (property?.['x-playground-example'] !== undefined) {
|
|
68
68
|
return property['x-playground-example']
|
|
69
69
|
}
|
|
@@ -72,6 +72,10 @@ export function getPropertyExample(property: any): any {
|
|
|
72
72
|
return property.schema['x-playground-example']
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
return null
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function getStandardExample(property: any): any {
|
|
75
79
|
if (property?.example !== undefined) {
|
|
76
80
|
return property.example
|
|
77
81
|
}
|
|
@@ -104,3 +108,7 @@ export function getPropertyExample(property: any): any {
|
|
|
104
108
|
|
|
105
109
|
return null
|
|
106
110
|
}
|
|
111
|
+
|
|
112
|
+
export function getPropertyExample(property: any): any {
|
|
113
|
+
return getPlaygroundSpecificExample(property) ?? getStandardExample(property)
|
|
114
|
+
}
|
|
@@ -56,7 +56,7 @@ export async function generateCodeSamples(spec: ParsedOpenAPI): Promise<ParsedOp
|
|
|
56
56
|
availableLanguages.map(async (language) => {
|
|
57
57
|
return {
|
|
58
58
|
...language,
|
|
59
|
-
source: await generateCodeSample(language
|
|
59
|
+
source: await generateCodeSample(language, request),
|
|
60
60
|
}
|
|
61
61
|
}),
|
|
62
62
|
)
|