@scalar/api-reference 1.63.0 → 1.64.1

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 (656) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.d.ts.map +1 -1
  3. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js +1 -1
  4. package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js.map +1 -1
  5. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  6. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js +1 -1
  7. package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js.map +1 -1
  8. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js +2 -2
  9. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js.map +1 -1
  10. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts.map +1 -1
  11. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js +1 -1
  12. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js.map +1 -1
  13. package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js.map +1 -1
  14. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +1 -3
  15. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
  16. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
  17. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -1
  18. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js +13 -27
  19. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -1
  20. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
  21. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
  22. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -1
  23. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +37 -25
  24. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -1
  25. package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js.map +1 -1
  26. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
  27. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
  28. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -1
  29. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +10 -4
  30. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
  31. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js +1 -1
  32. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -1
  33. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
  34. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js +1 -1
  35. package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js.map +1 -1
  36. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +1 -1
  37. package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -1
  38. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js +1 -1
  39. package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js.map +1 -1
  40. package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js +1 -1
  41. package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js.map +1 -1
  42. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.d.ts.map +1 -1
  43. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +1 -1
  44. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js.map +1 -1
  45. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js +1 -1
  46. package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js.map +1 -1
  47. package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +1 -1
  48. package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js.map +1 -1
  49. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
  50. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
  51. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +1 -1
  52. package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
  53. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.d.ts.map +1 -1
  54. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.js +1 -1
  55. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.js.map +1 -1
  56. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js +5 -5
  57. package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js.map +1 -1
  58. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js +1 -1
  59. package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js.map +1 -1
  60. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.d.ts.map +1 -1
  61. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js +1 -1
  62. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js.map +1 -1
  63. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js +16 -9
  64. package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js.map +1 -1
  65. package/dist/blocks/scalar-sdk-installation-instructions/helpers/language-icon.js.map +1 -1
  66. package/dist/blocks/scalar-sdk-installation-instructions/helpers/renderable-sdks.js.map +1 -1
  67. package/dist/blocks/scalar-sdk-installation-instructions/helpers/visible-tab-count.js.map +1 -1
  68. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  69. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js +1 -1
  70. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js.map +1 -1
  71. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts.map +1 -1
  72. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +1 -1
  73. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -1
  74. package/dist/browser/chunks/AgentScalarChatInterface-D1mzA447.js +27 -0
  75. package/dist/browser/chunks/ScalarTextInput.vue-OfiA6SHf.js +27 -0
  76. package/dist/browser/chunks/{basic-shape-diamond.svg-BTEOT1FL.js → basic-shape-diamond.svg-o5eiY2I7.js} +2 -2
  77. package/dist/browser/chunks/{basic-shape-hexagon.svg-BSPzaCgF.js → basic-shape-hexagon.svg-CGuS7mbd.js} +2 -2
  78. package/dist/browser/chunks/{basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js → basic-shape-primary-circle-ellipse-round.svg-DDIpXiBm.js} +2 -2
  79. package/dist/browser/chunks/{basic-shape-primary-square-rectangle.svg-n2YRykHD.js → basic-shape-primary-square-rectangle.svg-DzVEJHMB.js} +2 -2
  80. package/dist/browser/chunks/{basic-shape-shield.svg-Bec9cJDA.js → basic-shape-shield.svg-BZzapRqv.js} +2 -2
  81. package/dist/browser/chunks/browser-CTPPEMEL.js +129 -0
  82. package/dist/browser/chunks/{computer-device-desktop-monitor.svg-m6j893Hb.js → computer-device-desktop-monitor.svg-OSM05r1I.js} +2 -2
  83. package/dist/browser/chunks/{computer-device-desktop.svg-Dk1VVO7k.js → computer-device-desktop.svg-BMFzGZ27.js} +2 -2
  84. package/dist/browser/chunks/{computer-device-laptop.svg-BNGVUCYS.js → computer-device-laptop.svg-CMAjzuB-.js} +2 -2
  85. package/dist/browser/chunks/{computer-device-mobile-phone-android-samsung-back.svg-CC4UUTFw.js → computer-device-mobile-phone-android-samsung-back.svg-D4xBONmL.js} +2 -2
  86. package/dist/browser/chunks/{computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js → computer-device-mobile-phone-android-samsung.svg-gbMJLjJw.js} +2 -2
  87. package/dist/browser/chunks/{computer-device-mobile-phone-iphone-x-back.svg-CLm7sgMM.js → computer-device-mobile-phone-iphone-x-back.svg-Bl1rmdKA.js} +2 -2
  88. package/dist/browser/chunks/{computer-device-mobile-phone-iphone-x.svg-Xrttg6_7.js → computer-device-mobile-phone-iphone-x.svg-DVetP0aa.js} +2 -2
  89. package/dist/browser/chunks/{computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js → computer-device-mobile-tablet-touch.svg-Zi88BP4L.js} +2 -2
  90. package/dist/browser/chunks/{computer-device-mobile-tablet.svg-DCr0XlRc.js → computer-device-mobile-tablet.svg-C1ggisWP.js} +2 -2
  91. package/dist/browser/chunks/{computer-device-network-ethernet-cat6.svg-AK9l0iOl.js → computer-device-network-ethernet-cat6.svg-BIUymdC1.js} +2 -2
  92. package/dist/browser/chunks/{computer-device-network-lan-www.svg-gUIdFBlE.js → computer-device-network-lan-www.svg-CoFUlIVO.js} +2 -2
  93. package/dist/browser/chunks/{computer-device-network-wifi-connection.svg-Be-EMm4e.js → computer-device-network-wifi-connection.svg-DeWsacxI.js} +2 -2
  94. package/dist/browser/chunks/{computer-device-network-wifi-router.svg-Dc2VzyqK.js → computer-device-network-wifi-router.svg-BjpZEot4.js} +2 -2
  95. package/dist/browser/chunks/{ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js → ecology-science-erlenmeyer-flask.svg-ftjGGirE.js} +2 -2
  96. package/dist/browser/chunks/{image-flash-lightning.svg-EETR_y1q.js → image-flash-lightning.svg-DYQ0W4Fi.js} +2 -2
  97. package/dist/browser/chunks/{image-picture-flower.svg-DN1AYzJU.js → image-picture-flower.svg-Bfe5SVDf.js} +2 -2
  98. package/dist/browser/chunks/{interface-alert-exclamation-diamond.svg-C5NozMV_.js → interface-alert-exclamation-diamond.svg-D1HePDNM.js} +2 -2
  99. package/dist/browser/chunks/{interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js → interface-alert-exclamation-triangle-warning.svg-CILUsxBC.js} +2 -2
  100. package/dist/browser/chunks/{interface-alert-information-circle.svg-ckkkt9Mv.js → interface-alert-information-circle.svg-9LrbJM5J.js} +2 -2
  101. package/dist/browser/chunks/{interface-award-crown.svg-pjvn9hY-.js → interface-award-crown.svg-DllWgiU1.js} +2 -2
  102. package/dist/browser/chunks/{interface-bookmark.svg-BK9HKQBT.js → interface-bookmark-tag.svg-Dc-JL-Kc.js} +2 -2
  103. package/dist/browser/chunks/{interface-bookmark-tag.svg-r2r-lQq4.js → interface-bookmark.svg-Dc-JL-Kc.js} +2 -2
  104. package/dist/browser/chunks/{interface-calendar-date-one.svg-DNnF0M1I.js → interface-calendar-date-one.svg-DO2jelhF.js} +2 -2
  105. package/dist/browser/chunks/{interface-content-book-open-pages.svg-CQj_w9Vp.js → interface-content-book-open-pages.svg-BJjMjIgA.js} +2 -2
  106. package/dist/browser/chunks/{interface-content-book-page.svg-DppoeJRe.js → interface-content-book-page.svg-C6rKB2fs.js} +2 -2
  107. package/dist/browser/chunks/{interface-content-file.svg-CvcD7OiY.js → interface-content-file.svg-CS0q2FKx.js} +2 -2
  108. package/dist/browser/chunks/{interface-content-folder.svg-BmtS5I9A.js → interface-content-folder.svg-CThTWsJX.js} +2 -2
  109. package/dist/browser/chunks/{interface-copy-clipboard.svg-Be6EI50X.js → interface-copy-clipboard.svg-DdN67cLv.js} +2 -2
  110. package/dist/browser/chunks/{interface-edit-attachment.svg-G5TKzpWX.js → interface-edit-attachment.svg-Ciizphuh.js} +2 -2
  111. package/dist/browser/chunks/{interface-edit-binocular.svg-jzL-DvGB.js → interface-edit-binocular.svg-Dw1nDqmL.js} +2 -2
  112. package/dist/browser/chunks/{interface-edit-magic-wand.svg-BOTlymvp.js → interface-edit-magic-wand.svg-BYS0jm_E.js} +2 -2
  113. package/dist/browser/chunks/{interface-edit-tool-paint-roller.svg-s9dwryx7.js → interface-edit-tool-paint-roller.svg-NioSHZC2.js} +2 -2
  114. package/dist/browser/chunks/{interface-edit-tool-pencil.svg-C7v0dbB3.js → interface-edit-tool-pencil.svg-P87QFlat.js} +2 -2
  115. package/dist/browser/chunks/{interface-favorite-award.svg-CYHUgUG0.js → interface-favorite-award.svg-DBBAChSi.js} +2 -2
  116. package/dist/browser/chunks/{interface-favorite-flag.svg-C10zlKOb.js → interface-favorite-flag.svg-HlhPomHY.js} +2 -2
  117. package/dist/browser/chunks/{interface-favorite-heart.svg-eoduXxlz.js → interface-favorite-heart.svg-Cqu2GYDo.js} +2 -2
  118. package/dist/browser/chunks/{interface-favorite-star.svg-BSmxJetr.js → interface-favorite-star.svg-BD4JY_J2.js} +2 -2
  119. package/dist/browser/chunks/{interface-favorite-stars-sparkles.svg-JTFLj3Ls.js → interface-favorite-stars-sparkles.svg-BXi6aO8q.js} +2 -2
  120. package/dist/browser/chunks/{interface-hierarchy-flowchart.svg-Cg_Wy0kN.js → interface-hierarchy-flowchart.svg-CDEVSsD4.js} +2 -2
  121. package/dist/browser/chunks/{interface-home-house.svg-DytoGRnv.js → interface-home-house.svg-DJetUjwj.js} +2 -2
  122. package/dist/browser/chunks/{interface-hyperlink.svg-CuEfmmQI.js → interface-hyperlink.svg-DJ1LREmz.js} +2 -2
  123. package/dist/browser/chunks/{interface-lighting-brightness.svg-DSK0h_Pa.js → interface-lighting-brightness.svg-TGKAaHYV.js} +2 -2
  124. package/dist/browser/chunks/{interface-lock-closed.svg-Cn6TaLYv.js → interface-lock-closed.svg-3hehWr3i.js} +2 -2
  125. package/dist/browser/chunks/{interface-lock-open-unlock.svg-CVkG5-9W.js → interface-lock-open-unlock.svg-CuXKcv1m.js} +2 -2
  126. package/dist/browser/chunks/{interface-login-key.svg-y-cwwXjN.js → interface-login-key.svg-Chwvvywd.js} +2 -2
  127. package/dist/browser/chunks/{interface-search.svg-S-puVFJB.js → interface-search.svg-JDE3fk0u.js} +2 -2
  128. package/dist/browser/chunks/{interface-setting-cog.svg-CTH4_lLg.js → interface-setting-cog.svg-BBCkeh4K.js} +2 -2
  129. package/dist/browser/chunks/{interface-share-megaphone-bullhorn.svg-Pbp39MyC.js → interface-share-megaphone-bullhorn.svg-CDdxF-4y.js} +2 -2
  130. package/dist/browser/chunks/{interface-share-rocket.svg-BgCsIRZO.js → interface-share-rocket.svg-DSbdn_o7.js} +2 -2
  131. package/dist/browser/chunks/{interface-share-satellite.svg-DAMN9d5G.js → interface-share-satellite.svg-CefBVZvY.js} +2 -2
  132. package/dist/browser/chunks/{interface-share-space-ship.svg-Dt-Mejxk.js → interface-share-space-ship.svg-tFA2dsSU.js} +2 -2
  133. package/dist/browser/chunks/{interface-share.svg-vFYTXSti.js → interface-share.svg-BpOGopyv.js} +2 -2
  134. package/dist/browser/chunks/{interface-signal-square.svg-DNG4LpAe.js → interface-signal-square.svg-BcX_BoaC.js} +2 -2
  135. package/dist/browser/chunks/{interface-time-clock-circle.svg-Bpz-nLxo.js → interface-time-clock-circle.svg-C8B_L_RM.js} +2 -2
  136. package/dist/browser/chunks/{interface-time-hour-glass.svg-D7agfKsH.js → interface-time-hour-glass.svg-qw-oeoVn.js} +2 -2
  137. package/dist/browser/chunks/{interface-users-multiple.svg-CkPJBBnG.js → interface-users-multiple.svg-Cs13Eewq.js} +2 -2
  138. package/dist/browser/chunks/{interface-weather-moon.svg-CaTZFMPO.js → interface-weather-moon.svg-CV-oDTae.js} +2 -2
  139. package/dist/browser/chunks/{mail-chat-bubble-square.svg-DC8RIihp.js → mail-chat-bubble-square.svg-dpauJhin.js} +2 -2
  140. package/dist/browser/chunks/{mail-send-email-paper-airplane.svg-D8OLs9jz.js → mail-send-email-paper-airplane.svg-BBofxojL.js} +2 -2
  141. package/dist/browser/chunks/{mail-send-envelope.svg-CV33h5Sx.js → mail-send-envelope.svg-DyENgYOI.js} +2 -2
  142. package/dist/browser/chunks/modal-BS4e2gew.js +99 -0
  143. package/dist/browser/chunks/{money-cashier-receipt.svg-CJL8C2gs.js → money-cashier-receipt.svg-dNTr5aio.js} +2 -2
  144. package/dist/browser/chunks/{money-currency-dollar-pay.svg-VdBplCTx.js → money-currency-dollar-pay.svg-1ZESPtFY.js} +2 -2
  145. package/dist/browser/chunks/{money-graph-arrow-increase.svg-DcRov3zk.js → money-graph-arrow-increase.svg-kEZ2u2z2.js} +2 -2
  146. package/dist/browser/chunks/{money-graph-bar-chart-increase.svg-Cc7KxjX-.js → money-graph-bar-chart-increase.svg-B-t2UWB3.js} +2 -2
  147. package/dist/browser/chunks/{nature-ecology-leaf.svg-DR3cTZxt.js → nature-ecology-leaf.svg-DZ2GJV8m.js} +2 -2
  148. package/dist/browser/chunks/{phone-telephone.svg-DyY0gUlk.js → phone-telephone.svg-C12QjpN7.js} +2 -2
  149. package/dist/browser/chunks/{programming-bug.svg-BHLT-Qhp.js → programming-bug.svg-wLTsruN9.js} +2 -2
  150. package/dist/browser/chunks/{programming-cloud.svg-B6YW33ba.js → programming-cloud.svg-3XU6dNUg.js} +2 -2
  151. package/dist/browser/chunks/{programming-computer-database-server.svg-B6o5Sdn-.js → programming-computer-database-server.svg-B1JrHSPd.js} +2 -2
  152. package/dist/browser/chunks/{programming-computer-database.svg-Cl7OVtpJ.js → programming-computer-database.svg-BxHSuFl7.js} +2 -2
  153. package/dist/browser/chunks/{programming-module-four-layout.svg-BQrerL1x.js → programming-module-four-layout.svg-CeV35q45.js} +2 -2
  154. package/dist/browser/chunks/{programming-module-three.svg-B2KTQzBM.js → programming-module-three.svg-YIBpLt45.js} +2 -2
  155. package/dist/browser/chunks/{programming-module.svg-CiID7kPm.js → programming-module.svg-CU_pEibI.js} +2 -2
  156. package/dist/browser/chunks/{programming-script-code.svg-D1M5rtkN.js → programming-script-code.svg-CLzinmHT.js} +2 -2
  157. package/dist/browser/chunks/runtime-core.esm-bundler-CqqEw5ds.js +17 -0
  158. package/dist/browser/chunks/{shopping-cart.svg-BEegiIR9.js → shopping-cart.svg-Brzddu3K.js} +2 -2
  159. package/dist/browser/chunks/{shopping-gift-present.svg-BUHwuLix.js → shopping-gift-present.svg-l2K48g7L.js} +2 -2
  160. package/dist/browser/chunks/{shopping-shipping-box-parcel-package.svg-D6fxWdYx.js → shopping-shipping-box-parcel-package.svg-DesGopPo.js} +2 -2
  161. package/dist/browser/chunks/{tag-new-circle.svg-jsg1bGs0.js → tag-new-circle.svg-DE-VaLZU.js} +2 -2
  162. package/dist/browser/chunks/{travel-map-earth-globe.svg-ClbMiU-f.js → travel-map-earth-globe.svg-DLaOMzx6.js} +2 -2
  163. package/dist/browser/chunks/vendor-DWZAEyBy.js +306 -0
  164. package/dist/browser/standalone.esm.js +26 -24
  165. package/dist/browser/standalone.js +310 -311
  166. package/dist/components/AgentScalar/AgentScalarButton.vue.script.js +1 -1
  167. package/dist/components/AgentScalar/AgentScalarButton.vue.script.js.map +1 -1
  168. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js +1 -1
  169. package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js.map +1 -1
  170. package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
  171. package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
  172. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +1 -1
  173. package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
  174. package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts.map +1 -1
  175. package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
  176. package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -1
  177. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +47 -32
  178. package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -1
  179. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  180. package/dist/components/Anchor/Anchor.vue.script.js +1 -1
  181. package/dist/components/Anchor/Anchor.vue.script.js.map +1 -1
  182. package/dist/components/Anchor/WithBreadcrumb.vue.script.js +2 -2
  183. package/dist/components/Anchor/WithBreadcrumb.vue.script.js.map +1 -1
  184. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  185. package/dist/components/ApiReference.vue.js +1 -1
  186. package/dist/components/ApiReference.vue.js.map +1 -1
  187. package/dist/components/ApiReference.vue.script.js +141 -33
  188. package/dist/components/ApiReference.vue.script.js.map +1 -1
  189. package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
  190. package/dist/components/Badge/Badge.vue.js +1 -1
  191. package/dist/components/Badge/Badge.vue.js.map +1 -1
  192. package/dist/components/Badge/Badge.vue.script.js +9 -9
  193. package/dist/components/Badge/Badge.vue.script.js.map +1 -1
  194. package/dist/components/ClassicHeader.vue.js +1 -1
  195. package/dist/components/ClassicHeader.vue.js.map +1 -1
  196. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +1 -1
  197. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +1 -1
  198. package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -1
  199. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +1 -1
  200. package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
  201. package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
  202. package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
  203. package/dist/components/Content/AsyncApi/Channel.vue.script.js +1 -1
  204. package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
  205. package/dist/components/Content/AsyncApi/ChannelsList.vue.js +1 -1
  206. package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js +1 -1
  207. package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js.map +1 -1
  208. package/dist/components/Content/AsyncApi/Message.vue.d.ts.map +1 -1
  209. package/dist/components/Content/AsyncApi/Message.vue.js +1 -1
  210. package/dist/components/Content/AsyncApi/Message.vue.script.js +2 -2
  211. package/dist/components/Content/AsyncApi/Message.vue.script.js.map +1 -1
  212. package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -1
  213. package/dist/components/Content/AsyncApi/Operation.vue.js +1 -1
  214. package/dist/components/Content/AsyncApi/Operation.vue.js.map +1 -1
  215. package/dist/components/Content/AsyncApi/Operation.vue.script.js +6 -1
  216. package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -1
  217. package/dist/components/Content/AsyncApi/helpers/adapt-async-api-parameters.js.map +1 -1
  218. package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js.map +1 -1
  219. package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js.map +1 -1
  220. package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js.map +1 -1
  221. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.d.ts +17 -0
  222. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.d.ts.map +1 -0
  223. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.js +21 -0
  224. package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.js.map +1 -0
  225. package/dist/components/Content/AsyncApi/helpers/pick-heading.js.map +1 -1
  226. package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js.map +1 -1
  227. package/dist/components/Content/Auth/Auth.vue.script.js +1 -1
  228. package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
  229. package/dist/components/Content/Content.vue.script.js +1 -1
  230. package/dist/components/Content/Content.vue.script.js.map +1 -1
  231. package/dist/components/Content/Models/Model.vue.script.js +1 -1
  232. package/dist/components/Content/Models/Model.vue.script.js.map +1 -1
  233. package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
  234. package/dist/components/Content/Models/ModelTag.vue.script.js +2 -2
  235. package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -1
  236. package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts.map +1 -1
  237. package/dist/components/Content/Models/components/ClassicLayout.vue.js +1 -1
  238. package/dist/components/Content/Models/components/ClassicLayout.vue.script.js +1 -1
  239. package/dist/components/Content/Models/components/ClassicLayout.vue.script.js.map +1 -1
  240. package/dist/components/Content/Models/components/ModernLayout.vue.d.ts.map +1 -1
  241. package/dist/components/Content/Models/components/ModernLayout.vue.script.js +1 -1
  242. package/dist/components/Content/Models/components/ModernLayout.vue.script.js.map +1 -1
  243. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +1 -1
  244. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  245. package/dist/components/Content/Schema/LinkButton.vue.js +1 -1
  246. package/dist/components/Content/Schema/LinkButton.vue.js.map +1 -1
  247. package/dist/components/Content/Schema/RenderString.vue.script.js +1 -1
  248. package/dist/components/Content/Schema/RenderString.vue.script.js.map +1 -1
  249. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  250. package/dist/components/Content/Schema/Schema.vue.js +1 -1
  251. package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
  252. package/dist/components/Content/Schema/Schema.vue.script.js +5 -13
  253. package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
  254. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  255. package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -1
  256. package/dist/components/Content/Schema/SchemaComposition.vue.script.js +69 -34
  257. package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
  258. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +1 -1
  259. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js +1 -1
  260. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js.map +1 -1
  261. package/dist/components/Content/Schema/SchemaEnums.vue.d.ts.map +1 -1
  262. package/dist/components/Content/Schema/SchemaEnums.vue.js +1 -1
  263. package/dist/components/Content/Schema/SchemaEnums.vue.js.map +1 -1
  264. package/dist/components/Content/Schema/SchemaEnums.vue.script.js +16 -8
  265. package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
  266. package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
  267. package/dist/components/Content/Schema/SchemaHeading.vue.script.js +1 -1
  268. package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -1
  269. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +1 -1
  270. package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -1
  271. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +1 -1
  272. package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
  273. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  274. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  275. package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
  276. package/dist/components/Content/Schema/SchemaProperty.vue.script.js +4 -3
  277. package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
  278. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +1 -1
  279. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +1 -1
  280. package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -1
  281. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +1 -1
  282. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js +1 -1
  283. package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js.map +1 -1
  284. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
  285. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +1 -1
  286. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -1
  287. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  288. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  289. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
  290. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +31 -21
  291. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  292. package/dist/components/Content/Schema/helpers/dynamic-scope.js.map +1 -1
  293. package/dist/components/Content/Schema/helpers/format-example.js.map +1 -1
  294. package/dist/components/Content/Schema/helpers/format-value.js.map +1 -1
  295. package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -1
  296. package/dist/components/Content/Schema/helpers/get-enum-values.js.map +1 -1
  297. package/dist/components/Content/Schema/helpers/get-property-description.js.map +1 -1
  298. package/dist/components/Content/Schema/helpers/get-ref-name.js.map +1 -1
  299. package/dist/components/Content/Schema/helpers/get-schema-type.js.map +1 -1
  300. package/dist/components/Content/Schema/helpers/has-complex-array-items.js.map +1 -1
  301. package/dist/components/Content/Schema/helpers/is-empty-schema-object.js.map +1 -1
  302. package/dist/components/Content/Schema/helpers/is-type-object.js.map +1 -1
  303. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +3 -3
  304. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
  305. package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -1
  306. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +1 -4
  307. package/dist/components/Content/Schema/helpers/optimize-value-for-display.js.map +1 -1
  308. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.d.ts +32 -0
  309. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.d.ts.map +1 -0
  310. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js +97 -0
  311. package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js.map +1 -0
  312. package/dist/components/Content/Schema/helpers/schema-composition.js.map +1 -1
  313. package/dist/components/Content/Schema/helpers/schema-cycle.js.map +1 -1
  314. package/dist/components/Content/Schema/helpers/schema-name.js.map +1 -1
  315. package/dist/components/Content/Schema/helpers/should-display-description.js.map +1 -1
  316. package/dist/components/Content/Schema/helpers/should-display-heading.js.map +1 -1
  317. package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js.map +1 -1
  318. package/dist/components/Content/Schema/helpers/sort-property-names.js.map +1 -1
  319. package/dist/components/Content/Tags/Tag.vue.script.js +1 -1
  320. package/dist/components/Content/Tags/Tag.vue.script.js.map +1 -1
  321. package/dist/components/Content/Tags/components/ClassicLayout.vue.d.ts.map +1 -1
  322. package/dist/components/Content/Tags/components/ClassicLayout.vue.js +1 -1
  323. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +1 -1
  324. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js.map +1 -1
  325. package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
  326. package/dist/components/Content/Tags/components/ModernLayout.vue.js +1 -1
  327. package/dist/components/Content/Tags/components/ModernLayout.vue.script.js +1 -1
  328. package/dist/components/Content/Tags/components/ModernLayout.vue.script.js.map +1 -1
  329. package/dist/components/Content/Tags/components/TagSection.vue.d.ts.map +1 -1
  330. package/dist/components/Content/Tags/components/TagSection.vue.script.js +1 -1
  331. package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -1
  332. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  333. package/dist/components/GettingStarted.vue.js +1 -1
  334. package/dist/components/GettingStarted.vue.js.map +1 -1
  335. package/dist/components/GettingStarted.vue.script.js +4 -3
  336. package/dist/components/GettingStarted.vue.script.js.map +1 -1
  337. package/dist/components/HttpMethod/HttpMethod.vue.script.js +1 -1
  338. package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
  339. package/dist/components/IntersectionObserver.vue.script.js +10 -7
  340. package/dist/components/IntersectionObserver.vue.script.js.map +1 -1
  341. package/dist/components/Lazy/Lazy.vue.script.js +2 -2
  342. package/dist/components/Lazy/Lazy.vue.script.js.map +1 -1
  343. package/dist/components/LinkList/LinkList.vue.js +1 -1
  344. package/dist/components/LinkList/LinkList.vue.js.map +1 -1
  345. package/dist/components/LinkList/LinkList.vue.script.js +2 -2
  346. package/dist/components/LinkList/LinkList.vue.script.js.map +1 -1
  347. package/dist/components/MobileHeader.vue.d.ts.map +1 -1
  348. package/dist/components/MobileHeader.vue.script.js +4 -4
  349. package/dist/components/MobileHeader.vue.script.js.map +1 -1
  350. package/dist/components/OperationPath.vue.d.ts.map +1 -1
  351. package/dist/components/OperationPath.vue.js +1 -1
  352. package/dist/components/OperationPath.vue.script.js +1 -1
  353. package/dist/components/OperationPath.vue.script.js.map +1 -1
  354. package/dist/components/OperationsList/OperationsList.vue.js +1 -1
  355. package/dist/components/OperationsList/OperationsList.vue.script.js +1 -1
  356. package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -1
  357. package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
  358. package/dist/components/OperationsList/OperationsListItem.vue.script.js +1 -1
  359. package/dist/components/OperationsList/OperationsListItem.vue.script.js.map +1 -1
  360. package/dist/components/RenderPlugins/RenderPluginView.vue.script.js +1 -1
  361. package/dist/components/RenderPlugins/RenderPluginView.vue.script.js.map +1 -1
  362. package/dist/components/RenderPlugins/RenderPlugins.vue.script.js +1 -1
  363. package/dist/components/RenderPlugins/RenderPlugins.vue.script.js.map +1 -1
  364. package/dist/components/ScreenReader.vue.js +1 -1
  365. package/dist/components/ScreenReader.vue.script.js +2 -2
  366. package/dist/components/ScreenReader.vue.script.js.map +1 -1
  367. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
  368. package/dist/components/Section/CompactSection.vue.js +1 -1
  369. package/dist/components/Section/CompactSection.vue.js.map +1 -1
  370. package/dist/components/Section/CompactSection.vue.script.js +22 -6
  371. package/dist/components/Section/CompactSection.vue.script.js.map +1 -1
  372. package/dist/components/Section/Section.vue.js +1 -1
  373. package/dist/components/Section/Section.vue.script.js +1 -1
  374. package/dist/components/Section/Section.vue.script.js.map +1 -1
  375. package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
  376. package/dist/components/Section/SectionAccordion.vue.js +1 -1
  377. package/dist/components/Section/SectionAccordion.vue.script.js +1 -1
  378. package/dist/components/Section/SectionAccordion.vue.script.js.map +1 -1
  379. package/dist/components/Section/SectionColumn.vue.js +1 -1
  380. package/dist/components/Section/SectionColumn.vue.js.map +1 -1
  381. package/dist/components/Section/SectionColumns.vue.js +1 -1
  382. package/dist/components/Section/SectionColumns.vue.js.map +1 -1
  383. package/dist/components/Section/SectionContainer.vue.js +1 -1
  384. package/dist/components/Section/SectionContainer.vue.script.js +2 -2
  385. package/dist/components/Section/SectionContainer.vue.script.js.map +1 -1
  386. package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
  387. package/dist/components/Section/SectionContainerAccordion.vue.js +1 -1
  388. package/dist/components/Section/SectionContainerAccordion.vue.script.js +1 -1
  389. package/dist/components/Section/SectionContainerAccordion.vue.script.js.map +1 -1
  390. package/dist/components/Section/SectionContent.vue.js +1 -1
  391. package/dist/components/Section/SectionContent.vue.js.map +1 -1
  392. package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
  393. package/dist/components/Section/SectionHeader.vue.js +1 -1
  394. package/dist/components/Section/SectionHeader.vue.js.map +1 -1
  395. package/dist/components/Section/SectionHeader.vue.script.js +3 -3
  396. package/dist/components/Section/SectionHeader.vue.script.js.map +1 -1
  397. package/dist/components/Section/SectionHeaderTag.vue.js +1 -1
  398. package/dist/components/Section/SectionHeaderTag.vue.script.js +1 -1
  399. package/dist/components/Section/SectionHeaderTag.vue.script.js.map +1 -1
  400. package/dist/components/SectionFlare/SectionFlare.vue.js +1 -1
  401. package/dist/components/SectionFlare/SectionFlare.vue.js.map +1 -1
  402. package/dist/components/ShowMoreButton.vue.js +1 -1
  403. package/dist/components/ShowMoreButton.vue.script.js +1 -1
  404. package/dist/components/ShowMoreButton.vue.script.js.map +1 -1
  405. package/dist/features/Operation/Operation.vue.script.js +2 -2
  406. package/dist/features/Operation/Operation.vue.script.js.map +1 -1
  407. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  408. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +2 -2
  409. package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
  410. package/dist/features/Operation/components/Header.vue.script.js +1 -1
  411. package/dist/features/Operation/components/Header.vue.script.js.map +1 -1
  412. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  413. package/dist/features/Operation/components/Headers.vue.js +1 -1
  414. package/dist/features/Operation/components/Headers.vue.script.js +1 -1
  415. package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
  416. package/dist/features/Operation/components/OperationParameters.vue.script.js +2 -2
  417. package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
  418. package/dist/features/Operation/components/OperationResponses.vue.script.js +1 -1
  419. package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -1
  420. package/dist/features/Operation/components/OperationScopes.vue.d.ts +8 -0
  421. package/dist/features/Operation/components/OperationScopes.vue.d.ts.map +1 -0
  422. package/dist/features/Operation/components/OperationScopes.vue.js +7 -0
  423. package/dist/features/Operation/components/OperationScopes.vue.js.map +1 -0
  424. package/dist/features/Operation/components/OperationScopes.vue.script.js +60 -0
  425. package/dist/features/Operation/components/OperationScopes.vue.script.js.map +1 -0
  426. package/dist/features/Operation/components/ParameterList.vue.script.js +1 -1
  427. package/dist/features/Operation/components/ParameterList.vue.script.js.map +1 -1
  428. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  429. package/dist/features/Operation/components/ParameterListItem.vue.script.js +1 -1
  430. package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
  431. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  432. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  433. package/dist/features/Operation/components/RequestBody.vue.script.js +2 -2
  434. package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
  435. package/dist/features/Operation/components/SecurityRequirementBadge.vue.d.ts.map +1 -1
  436. package/dist/features/Operation/components/SecurityRequirementBadge.vue.js.map +1 -1
  437. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +90 -17
  438. package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
  439. package/dist/features/Operation/components/SecurityRequirementBadgeScheme.vue.script.js +1 -1
  440. package/dist/features/Operation/components/SecurityRequirementBadgeScheme.vue.script.js.map +1 -1
  441. package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
  442. package/dist/features/Operation/components/callbacks/Callback.vue.script.js +1 -1
  443. package/dist/features/Operation/components/callbacks/Callback.vue.script.js.map +1 -1
  444. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +1 -1
  445. package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -1
  446. package/dist/features/Operation/components/helpers/get-parameter-examples.js.map +1 -1
  447. package/dist/features/Operation/helpers/filter-selected-security.js.map +1 -1
  448. package/dist/features/Operation/helpers/flatten-deep-object-query-parameter.js.map +1 -1
  449. package/dist/features/Operation/helpers/get-required-security.d.ts +13 -0
  450. package/dist/features/Operation/helpers/get-required-security.d.ts.map +1 -1
  451. package/dist/features/Operation/helpers/get-required-security.js +22 -1
  452. package/dist/features/Operation/helpers/get-required-security.js.map +1 -1
  453. package/dist/features/Operation/helpers/operation-stability.js.map +1 -1
  454. package/dist/features/Operation/helpers/should-ignore-entity.js.map +1 -1
  455. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
  456. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  457. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  458. package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
  459. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +16 -7
  460. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  461. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  462. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  463. package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
  464. package/dist/features/Operation/layouts/ModernLayout.vue.script.js +3 -1
  465. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  466. package/dist/features/Operation/request-body-composition-index.js.map +1 -1
  467. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  468. package/dist/features/Search/components/SearchButton.vue.script.js +1 -1
  469. package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
  470. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  471. package/dist/features/Search/components/SearchModal.vue.js +1 -1
  472. package/dist/features/Search/components/SearchModal.vue.script.js +1 -1
  473. package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
  474. package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
  475. package/dist/features/Search/components/SearchResult.vue.script.js +1 -1
  476. package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
  477. package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -1
  478. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  479. package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
  480. package/dist/features/ask-agent-button/AskAgentButton.vue.js +1 -1
  481. package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +1 -1
  482. package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -1
  483. package/dist/features/developer-tools/DeveloperTools.vue.script.js +2 -2
  484. package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -1
  485. package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +1 -1
  486. package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js.map +1 -1
  487. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +1 -1
  488. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -1
  489. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
  490. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
  491. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +3 -3
  492. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
  493. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.d.ts +2 -2
  494. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +1 -1
  495. package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js.map +1 -1
  496. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +2 -2
  497. package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -1
  498. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -1
  499. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +4 -3
  500. package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -1
  501. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
  502. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
  503. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +2 -1
  504. package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
  505. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -1
  506. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +4 -3
  507. package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -1
  508. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.d.ts.map +1 -1
  509. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +1 -1
  510. package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -1
  511. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +1 -1
  512. package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
  513. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +2 -2
  514. package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -1
  515. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +1 -1
  516. package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
  517. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  518. package/dist/features/example-responses/ExampleResponse.vue.script.js +1 -1
  519. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  520. package/dist/features/example-responses/ExampleResponseTab.vue.js +1 -1
  521. package/dist/features/example-responses/ExampleResponseTab.vue.script.js +1 -1
  522. package/dist/features/example-responses/ExampleResponseTab.vue.script.js.map +1 -1
  523. package/dist/features/example-responses/ExampleResponseTabList.vue.d.ts.map +1 -1
  524. package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
  525. package/dist/features/example-responses/ExampleResponseTabList.vue.script.js +1 -1
  526. package/dist/features/example-responses/ExampleResponseTabList.vue.script.js.map +1 -1
  527. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  528. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  529. package/dist/features/example-responses/ExampleResponses.vue.script.js +1 -1
  530. package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
  531. package/dist/features/example-responses/ExampleSchema.vue.script.js +1 -1
  532. package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -1
  533. package/dist/features/example-responses/helpers/has-response-content.js.map +1 -1
  534. package/dist/features/example-responses/helpers/normalize-mime-type-object.js.map +1 -1
  535. package/dist/features/example-responses/helpers/normalize-mime-type.js.map +1 -1
  536. package/dist/features/external-docs/ExternalDocs.vue.d.ts.map +1 -1
  537. package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -1
  538. package/dist/features/external-docs/ExternalDocs.vue.script.js +27 -15
  539. package/dist/features/external-docs/ExternalDocs.vue.script.js.map +1 -1
  540. package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
  541. package/dist/features/info-object/Contact.vue.js.map +1 -1
  542. package/dist/features/info-object/Contact.vue.script.js +18 -12
  543. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  544. package/dist/features/info-object/InfoLink.vue.d.ts.map +1 -1
  545. package/dist/features/info-object/InfoLink.vue.js.map +1 -1
  546. package/dist/features/info-object/InfoLink.vue.script.js +23 -11
  547. package/dist/features/info-object/InfoLink.vue.script.js.map +1 -1
  548. package/dist/features/info-object/License.vue.d.ts.map +1 -1
  549. package/dist/features/info-object/License.vue.js.map +1 -1
  550. package/dist/features/info-object/License.vue.script.js +13 -7
  551. package/dist/features/info-object/License.vue.script.js.map +1 -1
  552. package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
  553. package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
  554. package/dist/features/info-object/TermsOfService.vue.script.js +12 -6
  555. package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
  556. package/dist/features/localization/locales/ar.d.ts +1 -0
  557. package/dist/features/localization/locales/ar.d.ts.map +1 -1
  558. package/dist/features/localization/locales/ar.js +2 -1
  559. package/dist/features/localization/locales/ar.js.map +1 -1
  560. package/dist/features/localization/locales/de.d.ts +1 -0
  561. package/dist/features/localization/locales/de.d.ts.map +1 -1
  562. package/dist/features/localization/locales/de.js +2 -1
  563. package/dist/features/localization/locales/de.js.map +1 -1
  564. package/dist/features/localization/locales/en.d.ts +1 -0
  565. package/dist/features/localization/locales/en.d.ts.map +1 -1
  566. package/dist/features/localization/locales/en.js +2 -1
  567. package/dist/features/localization/locales/en.js.map +1 -1
  568. package/dist/features/localization/locales/es.d.ts +1 -0
  569. package/dist/features/localization/locales/es.d.ts.map +1 -1
  570. package/dist/features/localization/locales/es.js +2 -1
  571. package/dist/features/localization/locales/es.js.map +1 -1
  572. package/dist/features/localization/locales/fr.d.ts +1 -0
  573. package/dist/features/localization/locales/fr.d.ts.map +1 -1
  574. package/dist/features/localization/locales/fr.js +2 -1
  575. package/dist/features/localization/locales/fr.js.map +1 -1
  576. package/dist/features/localization/locales/pt.d.ts +229 -0
  577. package/dist/features/localization/locales/pt.d.ts.map +1 -0
  578. package/dist/features/localization/locales/pt.js +227 -0
  579. package/dist/features/localization/locales/pt.js.map +1 -0
  580. package/dist/features/localization/locales/ru.d.ts +1 -0
  581. package/dist/features/localization/locales/ru.d.ts.map +1 -1
  582. package/dist/features/localization/locales/ru.js +2 -1
  583. package/dist/features/localization/locales/ru.js.map +1 -1
  584. package/dist/features/localization/locales/zh-cn.d.ts +1 -0
  585. package/dist/features/localization/locales/zh-cn.d.ts.map +1 -1
  586. package/dist/features/localization/locales/zh-cn.js +2 -1
  587. package/dist/features/localization/locales/zh-cn.js.map +1 -1
  588. package/dist/features/localization/translations.d.ts +235 -0
  589. package/dist/features/localization/translations.d.ts.map +1 -1
  590. package/dist/features/localization/translations.js +4 -2
  591. package/dist/features/localization/translations.js.map +1 -1
  592. package/dist/features/localization/use-localization.js.map +1 -1
  593. package/dist/features/multiple-documents/DocumentSelector.vue.d.ts.map +1 -1
  594. package/dist/features/multiple-documents/DocumentSelector.vue.script.js +1 -1
  595. package/dist/features/multiple-documents/DocumentSelector.vue.script.js.map +1 -1
  596. package/dist/features/specification-extension/SpecificationExtension.vue.script.js +1 -1
  597. package/dist/features/specification-extension/SpecificationExtension.vue.script.js.map +1 -1
  598. package/dist/features/specification-extension/helpers.js.map +1 -1
  599. package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
  600. package/dist/features/test-request-button/TestRequestButton.vue.script.js +1 -1
  601. package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -1
  602. package/dist/features/x-badges/XBadges.vue.d.ts.map +1 -1
  603. package/dist/features/x-badges/XBadges.vue.script.js +1 -1
  604. package/dist/features/x-badges/XBadges.vue.script.js.map +1 -1
  605. package/dist/helpers/color-mode.js.map +1 -1
  606. package/dist/helpers/download.js.map +1 -1
  607. package/dist/helpers/get-async-api-message-payload-schema.js.map +1 -1
  608. package/dist/helpers/get-async-api-model-schema.js.map +1 -1
  609. package/dist/helpers/id-routing.d.ts +18 -4
  610. package/dist/helpers/id-routing.d.ts.map +1 -1
  611. package/dist/helpers/id-routing.js +67 -20
  612. package/dist/helpers/id-routing.js.map +1 -1
  613. package/dist/helpers/is-introduction-entry.js.map +1 -1
  614. package/dist/helpers/lazy-bus.js.map +1 -1
  615. package/dist/helpers/load-from-perssistance.js.map +1 -1
  616. package/dist/helpers/map-config-plugins.js.map +1 -1
  617. package/dist/helpers/map-config-to-workspace-store.js.map +1 -1
  618. package/dist/helpers/normalize-configurations.js +1 -1
  619. package/dist/helpers/normalize-configurations.js.map +1 -1
  620. package/dist/helpers/openapi.d.ts +6 -1
  621. package/dist/helpers/openapi.d.ts.map +1 -1
  622. package/dist/helpers/openapi.js +37 -6
  623. package/dist/helpers/openapi.js.map +1 -1
  624. package/dist/helpers/safe-deep-clone.js.map +1 -1
  625. package/dist/helpers/storage.d.ts +21 -2
  626. package/dist/helpers/storage.d.ts.map +1 -1
  627. package/dist/helpers/storage.js +14 -0
  628. package/dist/helpers/storage.js.map +1 -1
  629. package/dist/helpers/upload-temp-document.js.map +1 -1
  630. package/dist/hooks/use-agent.js.map +1 -1
  631. package/dist/hooks/use-intersection.js.map +1 -1
  632. package/dist/plugins/hooks/usePluginManager.js.map +1 -1
  633. package/dist/plugins/persistence-plugin.js +6 -1
  634. package/dist/plugins/persistence-plugin.js.map +1 -1
  635. package/dist/plugins/plugin-manager.js +35 -0
  636. package/dist/plugins/plugin-manager.js.map +1 -1
  637. package/dist/plugins/posthog/index.js.map +1 -1
  638. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  639. package/dist/standalone/lib/html-api.js +11 -4
  640. package/dist/standalone/lib/html-api.js.map +1 -1
  641. package/dist/standalone/lib/load-plugins-from-urls.d.ts +13 -0
  642. package/dist/standalone/lib/load-plugins-from-urls.d.ts.map +1 -0
  643. package/dist/standalone/lib/load-plugins-from-urls.js +60 -0
  644. package/dist/standalone/lib/load-plugins-from-urls.js.map +1 -0
  645. package/dist/style.css +1637 -1505
  646. package/dist/styles/print.css +118 -0
  647. package/dist/styles/tailwind.config.css +16 -0
  648. package/dist/vue-styles.css +1102 -1050
  649. package/package.json +29 -29
  650. package/dist/browser/chunks/AgentScalarChatInterface-YU9KKgvZ.js +0 -27
  651. package/dist/browser/chunks/ScalarTextInput.vue-B-Nhpn0q.js +0 -27
  652. package/dist/browser/chunks/browser-67K6wmG9.js +0 -129
  653. package/dist/browser/chunks/modal-BVUfMpuv.js +0 -15
  654. package/dist/browser/chunks/modal-WJ4Gcv8N.js +0 -99
  655. package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +0 -17
  656. package/dist/browser/chunks/vendor-BqFs9NIb.js +0 -306
@@ -24,17 +24,31 @@ export declare const getIdFromUrl: (url: string | URL, basePath: string | undefi
24
24
  * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id
25
25
  */
26
26
  export declare const makeUrlFromId: (_id: string, basePath: string | undefined, isMultiDocument: boolean) => URL | undefined;
27
+ /**
28
+ * Source data for a single webhook redirect: the raw event name, its method, and the current id.
29
+ *
30
+ * The current slug is read back off the id, so this layer does not need to know the (dot-keeping)
31
+ * slug rule — it only reproduces the legacy (dot-dropping) slug to match old bookmarks.
32
+ */
33
+ export type WebhookRedirectSource = {
34
+ /** Raw webhook event name from the OpenAPI `webhooks` key, e.g. `account_holder.created`. */
35
+ name: string;
36
+ /** HTTP method of the webhook operation. */
37
+ method: string;
38
+ /** Current navigation id of the webhook, e.g. `default/webhook/POST/account-holder.created`. */
39
+ id: string;
40
+ };
27
41
  /**
28
42
  * Rewrites navigation ids in a URL to their current form.
29
43
  *
30
44
  * The URL is reduced to its routing-agnostic id (see {@link locateIdCarriers}), each redirect rule
31
- * is applied in id-space (see {@link buildRedirects}), and the result is spliced back into the
32
- * original location. This handles hash, hash-base-path, and path routing uniformly, so a new
33
- * redirect only has to be added to the list once.
45
+ * is applied in id-space (see {@link buildRedirects} for models and {@link buildWebhookRedirects} for
46
+ * webhooks), and the result is spliced back into the original location. This handles hash,
47
+ * hash-base-path, and path routing uniformly, so a new redirect only has to be added to the list once.
34
48
  *
35
49
  * Returns the canonicalized URL when a rewrite happens, or null otherwise.
36
50
  */
37
- export declare const redirectUrl: (url: string | URL, modelsSectionSlug: string, documentSlug: string, isMultiDocument: boolean, basePath?: string) => URL | null;
51
+ export declare const redirectUrl: (url: string | URL, modelsSectionSlug: string, documentSlug: string, isMultiDocument: boolean, basePath?: string, webhooks?: WebhookRedirectSource[]) => URL | null;
38
52
  /** Extracts the schema parameters from the id if they are present */
39
53
  export declare const getSchemaParamsFromId: (id: string) => {
40
54
  rawId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"id-routing.d.ts","sourceRoot":"","sources":["../../src/helpers/id-routing.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,WAEhD,CAAA;AAyCD,mEAAmE;AACnE,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,YAAY,MAAM,GAAG,SAAS,WAMnF,CAAA;AACD,mEAAmE;AACnE,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,EAAE,YAAY,MAAM,GAAG,SAAS,WAYrG,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,EAAE,YAAY,MAAM,GAAG,SAAS,WAW7G,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,YAWvE,CAAA;AAED;;;;;;GA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,GAAI,KAAK,MAAM,GAAG,GAAG,EAAE,UAAU,MAAM,GAAG,SAAS,EAAE,YAAY,MAAM,GAAG,SAAS,WAQ3G,CAAA;AAmBD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,EAAE,iBAAiB,OAAO,oBAsBhG,CAAA;AA6KD;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,gGAAgG;IAChG,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAqED;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,GACtB,KAAK,MAAM,GAAG,GAAG,EACjB,mBAAmB,MAAM,EACzB,cAAc,MAAM,EACpB,iBAAiB,OAAO,EACxB,WAAW,MAAM,EACjB,WAAU,qBAAqB,EAAO,KACrC,GAAG,GAAG,IA4BR,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CA2BjF,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { slugify } from "@scalar/helpers/string/slugify";
1
2
  //#region src/helpers/id-routing.ts
2
3
  var sanitizeBasePath = (basePath) => {
3
4
  return basePath.replace(/^\/+|\/+$/g, "");
@@ -172,23 +173,82 @@ var buildRedirects = ({ modelsSectionSlug, documentSlug, isMultiDocument }) => {
172
173
  return redirects;
173
174
  };
174
175
  /**
176
+ * Markers that separate an operation id from a schema path within an anchor id.
177
+ * `responses` mirrors the request-body/parameter markers so response property
178
+ * anchors (e.g. `operation.responses.200.name`) resolve back to the operation id.
179
+ * Without it, deep links into responses cannot find their operation.
180
+ */
181
+ var SCHEMA_PARAM_MARKERS = [
182
+ ".body.",
183
+ ".path.",
184
+ ".query.",
185
+ ".header.",
186
+ ".responses."
187
+ ];
188
+ /**
189
+ * Builds redirect rules mapping each webhook's legacy dot-dropped slug to its current slug.
190
+ *
191
+ * Webhook ids used to slugify the event name with no options, which dropped dots
192
+ * (`account_holder.created` -> `account-holdercreated`); the current id keeps them
193
+ * (`account-holder.created`). That rewrite cannot be reversed generically, so we emit one exact rule
194
+ * per webhook whose legacy slug differs from the current one. Each rule matches the invariant
195
+ * `webhook/<METHOD>/<legacy-slug>` tail, so it applies regardless of the document/tag prefix in front
196
+ * of it and preserves any sub-anchor after it. A sub-anchor is either a `/` segment or a dot-joined
197
+ * schema property anchor (e.g. `.body.id`, see {@link SCHEMA_PARAM_MARKERS}); a dot followed by
198
+ * anything else is not treated as a boundary, because the legacy slug never contains a dot while a
199
+ * current webhook slug can, so such a URL belongs to a different webhook.
200
+ *
201
+ * Because the legacy slug is lossy, two things can make a redirect unsafe, and both are dropped so an
202
+ * ambiguous link falls through to normal not-found handling instead of landing on the wrong webhook:
203
+ * - the legacy slug is already another webhook's *current* slug (redirecting it would hijack a valid
204
+ * URL), or
205
+ * - two webhooks collapse to the same legacy slug (the old bookmark is genuinely ambiguous).
206
+ */
207
+ var buildWebhookRedirects = (webhooks) => {
208
+ const key = (method, slug) => `${method.toUpperCase()}/${slug}`;
209
+ const currentKeys = /* @__PURE__ */ new Set();
210
+ const legacyCounts = /* @__PURE__ */ new Map();
211
+ for (const { name, method, id } of webhooks) {
212
+ currentKeys.add(key(method, id.slice(id.lastIndexOf("/") + 1)));
213
+ const legacySlug = slugify(name);
214
+ if (legacySlug) {
215
+ const legacyKey = key(method, legacySlug);
216
+ legacyCounts.set(legacyKey, (legacyCounts.get(legacyKey) ?? 0) + 1);
217
+ }
218
+ }
219
+ const boundary = `(?=$|/|${SCHEMA_PARAM_MARKERS.map(escapeRegex).join("|")})`;
220
+ const redirects = [];
221
+ for (const { name, method, id } of webhooks) {
222
+ const upperMethod = method.toUpperCase();
223
+ const currentSlug = id.slice(id.lastIndexOf("/") + 1);
224
+ const legacySlug = slugify(name);
225
+ const legacyKey = key(method, legacySlug);
226
+ if (!legacySlug || legacySlug === currentSlug || currentKeys.has(legacyKey) || (legacyCounts.get(legacyKey) ?? 0) > 1) continue;
227
+ redirects.push({
228
+ match: new RegExp(`(^|/)webhook/${escapeRegex(upperMethod)}/${escapeRegex(legacySlug)}${boundary}`),
229
+ replace: (_match, prefix) => `${prefix}webhook/${upperMethod}/${currentSlug}`
230
+ });
231
+ }
232
+ return redirects;
233
+ };
234
+ /**
175
235
  * Rewrites navigation ids in a URL to their current form.
176
236
  *
177
237
  * The URL is reduced to its routing-agnostic id (see {@link locateIdCarriers}), each redirect rule
178
- * is applied in id-space (see {@link buildRedirects}), and the result is spliced back into the
179
- * original location. This handles hash, hash-base-path, and path routing uniformly, so a new
180
- * redirect only has to be added to the list once.
238
+ * is applied in id-space (see {@link buildRedirects} for models and {@link buildWebhookRedirects} for
239
+ * webhooks), and the result is spliced back into the original location. This handles hash,
240
+ * hash-base-path, and path routing uniformly, so a new redirect only has to be added to the list once.
181
241
  *
182
242
  * Returns the canonicalized URL when a rewrite happens, or null otherwise.
183
243
  */
184
- var redirectUrl = (url, modelsSectionSlug, documentSlug, isMultiDocument, basePath) => {
244
+ var redirectUrl = (url, modelsSectionSlug, documentSlug, isMultiDocument, basePath, webhooks = []) => {
185
245
  if (!documentSlug) return null;
186
246
  const target = new URL(typeof url === "string" ? url : url.toString());
187
- const redirects = buildRedirects({
247
+ const redirects = [...buildRedirects({
188
248
  modelsSectionSlug,
189
249
  documentSlug,
190
250
  isMultiDocument
191
- });
251
+ }), ...buildWebhookRedirects(webhooks)];
192
252
  let didRedirect = false;
193
253
  for (const carrier of locateIdCarriers(target, basePath)) {
194
254
  const rewritten = applyIdRedirects(carrier.value, redirects);
@@ -199,19 +259,6 @@ var redirectUrl = (url, modelsSectionSlug, documentSlug, isMultiDocument, basePa
199
259
  }
200
260
  return didRedirect ? target : null;
201
261
  };
202
- /**
203
- * Markers that separate an operation id from a schema path within an anchor id.
204
- * `responses` mirrors the request-body/parameter markers so response property
205
- * anchors (e.g. `operation.responses.200.name`) resolve back to the operation id.
206
- * Without it, deep links into responses cannot find their operation.
207
- */
208
- var SCHEMA_PARAM_MARKERS = [
209
- ".body.",
210
- ".path.",
211
- ".query.",
212
- ".header.",
213
- ".responses."
214
- ];
215
262
  /** Extracts the schema parameters from the id if they are present */
216
263
  var getSchemaParamsFromId = (id) => {
217
264
  let markerIndex = -1;
@@ -229,6 +276,6 @@ var getSchemaParamsFromId = (id) => {
229
276
  };
230
277
  };
231
278
  //#endregion
232
- export { getIdFromUrl, getSchemaParamsFromId, makeUrlFromId, matchesBasePath, redirectUrl };
279
+ export { getIdFromHash, getIdFromHashBasePath, getIdFromPath, getIdFromUrl, getSchemaParamsFromId, makeUrlFromId, matchesBasePath, redirectUrl, sanitizeBasePath };
233
280
 
234
281
  //# sourceMappingURL=id-routing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"id-routing.js","names":[],"sources":["../../src/helpers/id-routing.ts"],"sourcesContent":["export const sanitizeBasePath = (basePath: string) => {\n return basePath.replace(/^\\/+|\\/+$/g, '')\n}\n\nconst isHashBasePath = (basePath: string) => basePath.startsWith('#')\n\nconst sanitizeHashBasePath = (basePath: string) => {\n return basePath.replace(/^#+/, '').replace(/\\/+$/g, '')\n}\n\nconst applySlugPrefix = (base: string, slugPrefix: string | undefined) => {\n return slugPrefix ? `${slugPrefix}${base ? '/' : ''}${base}` : base\n}\n\nconst stripBasePathPrefix = (value: string, basePath: string) => {\n if (value === basePath) {\n return ''\n }\n\n if (value.startsWith(`${basePath}/`)) {\n return value.slice(basePath.length + 1)\n }\n\n return null\n}\n\n/**\n * Builds the URL-encoded, slash-prefixed form of a sanitized base path.\n *\n * Each segment is encoded separately so the result matches how the browser stores\n * `location.pathname` (which encodes within segments but leaves the slashes between them).\n */\nconst encodeBasePath = (sanitized: string) => {\n if (!sanitized) {\n return ''\n }\n\n return `/${sanitized\n .split('/')\n .map((segment) => encodeURIComponent(segment))\n .join('/')}`\n}\n\n/** Extracts an element id from the hash when using hash routing */\nexport const getIdFromHash = (location: string | URL, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n const base = decodeURIComponent(url.hash.slice(1))\n\n return applySlugPrefix(base, slugPrefix)\n}\n/** Extracts an element id from the path when using path routing */\nexport const getIdFromPath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const basePathWithSlash = encodeBasePath(sanitizeBasePath(basePath))\n\n // Extract the portion after the basePath\n if (url.pathname.startsWith(basePathWithSlash)) {\n const remainder = url.pathname.slice(basePathWithSlash.length)\n const base = decodeURIComponent(remainder.startsWith('/') ? remainder.slice(1) : remainder)\n return applySlugPrefix(base, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Extracts an element id from a hash-prefixed basePath */\nexport const getIdFromHashBasePath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const hash = decodeURIComponent(url.hash.slice(1))\n const sanitized = sanitizeHashBasePath(basePath)\n\n const remainder = stripBasePathPrefix(hash, sanitized)\n if (remainder !== null) {\n return applySlugPrefix(remainder, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Determines whether a URL matches the provided basePath. */\nexport const matchesBasePath = (location: string | URL, basePath: string) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n if (isHashBasePath(basePath)) {\n const hash = decodeURIComponent(url.hash)\n return hash === basePath || hash.startsWith(`${basePath}/`)\n }\n\n const basePathWithSlash = encodeBasePath(sanitizeBasePath(basePath))\n\n return url.pathname === basePathWithSlash || url.pathname.startsWith(`${basePathWithSlash}/`)\n}\n\n/**\n * Extracts a navigation id from a URL based on the routing type\n *\n * @param url - The URL to extract the id from\n * @param basePath - The base path used in path routing\n * @param slugPrefix - If the document slug is not expected in the URL then we must prefix it\n */\nexport const getIdFromUrl = (url: string | URL, basePath: string | undefined, slugPrefix: string | undefined) => {\n if (typeof basePath !== 'string') {\n return getIdFromHash(url, slugPrefix)\n }\n\n return isHashBasePath(basePath)\n ? getIdFromHashBasePath(url, basePath, slugPrefix)\n : getIdFromPath(url, basePath, slugPrefix)\n}\n\n/**\n * Strips the first segment from an id and preserves trailing slashes\n * Used in single-document mode where the document slug is not needed in the URL\n *\n * @param id - The full id to process\n * @returns The id with the first segment removed, preserving trailing slash if present\n */\nconst stripFirstSegment = (id: string): string => {\n // For preserving trailing slash in the id\n const hasTrailingSlash = id.endsWith('/')\n const segments = id.split('/').filter(Boolean).slice(1)\n const result = segments.join('/')\n\n // Only preserve trailing slash if there's actual content\n return hasTrailingSlash && result ? `${result}/` : result\n}\n\n/**\n * Generate a new URL and applies the ID to the path or hash\n * depending on the type of routing used\n *\n * @param id - The id to apply to the URL\n * @param basePath - The base path used in path routing\n * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id\n */\nexport const makeUrlFromId = (_id: string, basePath: string | undefined, isMultiDocument: boolean) => {\n if (typeof window === 'undefined') {\n return undefined\n }\n\n /** When there is only 1 document we don't need to include the document name in the URL */\n const id = isMultiDocument ? _id : stripFirstSegment(_id)\n const url = new URL(window.location.href)\n\n if (typeof basePath === 'string') {\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n url.hash = [base, id].filter(Boolean).join('/')\n } else {\n const base = sanitizeBasePath(basePath)\n url.pathname = `${base}/${id}`\n }\n } else {\n url.hash = id\n }\n\n return url\n}\n\nconst escapeRegex = (value: string) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n\n/**\n * A located navigation id: the decoded id plus a way to write a rewritten id back.\n */\ntype IdCarrier = {\n /** The decoded navigation id with all routing chrome (`#`, base path) removed. */\n value: string\n /** Splices `next` back into the location this id came from, preserving the URL shape. */\n write: (next: string) => void\n}\n\n/** Carrier for an id that lives in the bare hash fragment (`#<id>`). */\nconst bareHashCarrier = (url: URL): IdCarrier => ({\n value: decodeURIComponent(url.hash.slice(1)),\n write: (next) => {\n url.hash = next\n },\n})\n\n/**\n * Locates the navigation id inside a URL regardless of the routing mode.\n *\n * The id can live in three places — the bare hash, a hash base path (`#<base>/<id>`), or the\n * pathname after a path base path. Each carrier pairs the decoded id with a `write` callback, so\n * callers edit ids in id-space without re-deriving the routing chrome for each mode.\n *\n * Multiple carriers are returned: the canonical location for the active routing mode comes first,\n * followed by a legacy bare-hash carrier. Both path and hash-base-path routing include the bare hash\n * so a stale `#default/model/User` bookmark (left over from before the base path was configured) is\n * still canonicalized — the previous implementation rewrote such doc-slug-anchored hashes on every\n * load regardless of the routing mode. Callers rewrite every carrier that matches, not just the\n * first, so a legacy id sitting in both the pathname and the hash is cleaned up in one pass.\n */\nconst locateIdCarriers = (url: URL, basePath: string | undefined): IdCarrier[] => {\n // Hash routing: the id is the bare fragment.\n if (typeof basePath !== 'string') {\n return [bareHashCarrier(url)]\n }\n\n // Hash base path routing: the id follows a `#<base>/` prefix.\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n const hash = decodeURIComponent(url.hash.slice(1))\n\n return [\n {\n value: stripBasePathPrefix(hash, base) ?? '',\n write: (next) => {\n url.hash = [base, next].filter(Boolean).join('/')\n },\n },\n // Legacy fallback: an old bookmark may carry the id in the fragment without the base prefix.\n bareHashCarrier(url),\n ]\n }\n\n // Path routing: the id follows the (URL-encoded) base path in the pathname.\n const base = sanitizeBasePath(basePath)\n const remainder = stripBasePathPrefix(url.pathname, encodeBasePath(base))\n\n return [\n {\n value: remainder === null ? '' : decodeURIComponent(remainder),\n write: (next) => {\n // Assigning to `pathname` re-encodes characters, so we splice with the decoded base.\n url.pathname = base ? `/${base}/${next}` : `/${next}`\n },\n },\n // Legacy fallback: an old hash-routing bookmark may still carry the id in the fragment.\n bareHashCarrier(url),\n ]\n}\n\n/**\n * A single redirect rule, expressed in routing-agnostic id-space.\n *\n * Ids are navigation strings with all routing chrome (`#`, base path) stripped — see\n * {@link locateIdCarrier}. A rule is just the shape of an id rewrite: `match` is tested against the\n * id and `replace` follows the native `String.prototype.replace` contract, so a rule can be a plain\n * segment swap or an arbitrary replacer function. A rule that does not match leaves the id alone.\n */\ntype IdRedirect = {\n /** Pattern tested against the routing-agnostic id. */\n match: RegExp\n /** Replacement passed straight to `String.prototype.replace` (template string or replacer fn). */\n replace: string | ((substring: string, ...groups: string[]) => string)\n}\n\n/**\n * Applies redirect rules to an id and returns the first rewrite that changes it.\n *\n * Rules are tried in order and the search stops at the first match, so list more specific rules\n * before more general ones. Returns the id unchanged when no rule applies.\n */\nconst applyIdRedirects = (id: string, redirects: IdRedirect[]): string => {\n for (const { match, replace } of redirects) {\n // The ternary narrows the union so each `String.prototype.replace` overload type-checks.\n const next = typeof replace === 'string' ? id.replace(match, replace) : id.replace(match, replace)\n if (next !== id) {\n return next\n }\n }\n\n return id\n}\n\n/** Optional `(tag-group/<n>/)?tag/<slug>/` chrome that may sit in front of a section segment. */\nconst TAG_CHROME = '(?:(?:tag-group/[^/]+/)?tag/[^/]+/)?'\n\n/**\n * Runtime values the redirect rules are built from.\n *\n * The rules are data, but a few entries depend on per-document values (the configurable models\n * section slug, the active document slug, single- vs multi-document mode), so the list is built per\n * call rather than declared as a static constant.\n */\ntype RedirectContext = {\n /** Current (possibly customized) slug of the models section, e.g. `models` or `schemas`. */\n modelsSectionSlug: string\n /** Slug of the active document; legacy ids are anchored to it to avoid false positives. */\n documentSlug: string\n /** Multi-document ids always carry the doc slug; single-document bookmarks may omit it. */\n isMultiDocument: boolean\n}\n\n/**\n * Builds the list of id redirects for the current document.\n *\n * Add an entry here to support a new redirect. Each rule runs against every URL shape (hash, hash\n * base path, path) for free, because rules operate on routing-agnostic ids.\n */\nconst buildRedirects = ({ modelsSectionSlug, documentSlug, isMultiDocument }: RedirectContext): IdRedirect[] => {\n const escapedDoc = escapeRegex(documentSlug)\n // Keeping the tag chrome inside the doc-slug group is deliberate: a slug-less\n // `tag/<slug>/<segment>/<name>` is left alone, since once the document slug is stripped it is\n // ambiguous with an operation under a tag literally named after the segment.\n const documentPrefix = isMultiDocument ? `${escapedDoc}/${TAG_CHROME}` : `(?:${escapedDoc}/${TAG_CHROME})?`\n\n // Rewrites a leading `<from>/` section segment to the current models section slug. The trailing\n // `/` leaves an already-correct segment and operation paths such as `default/POST/model/train`\n // untouched.\n const renameSectionSegment = (from: string): IdRedirect => ({\n match: new RegExp(`^(${documentPrefix})${escapeRegex(from)}/`),\n replace: (_match, prefix) => `${prefix}${modelsSectionSlug}/`,\n })\n\n const redirects = [\n // Earlier versions hardcoded a singular `model/` prefix for individual schema entries even\n // though the section itself was plural, so old bookmarks like `default/model/User` would 404.\n renameSectionSegment('model'),\n ]\n\n // The models section used to live at the literal `models/`. Once a custom label moves it\n // elsewhere (e.g. `schemas/`), older `models/<name>` bookmarks must follow it. When the slug is\n // still the default `models` this would be a no-op, so only register it when it actually differs.\n if (modelsSectionSlug !== 'models') {\n redirects.push(renameSectionSegment('models'))\n }\n\n return redirects\n}\n\n/**\n * Rewrites navigation ids in a URL to their current form.\n *\n * The URL is reduced to its routing-agnostic id (see {@link locateIdCarriers}), each redirect rule\n * is applied in id-space (see {@link buildRedirects}), and the result is spliced back into the\n * original location. This handles hash, hash-base-path, and path routing uniformly, so a new\n * redirect only has to be added to the list once.\n *\n * Returns the canonicalized URL when a rewrite happens, or null otherwise.\n */\nexport const redirectUrl = (\n url: string | URL,\n modelsSectionSlug: string,\n documentSlug: string,\n isMultiDocument: boolean,\n basePath?: string,\n): URL | null => {\n if (!documentSlug) {\n return null\n }\n\n const target = new URL(typeof url === 'string' ? url : url.toString())\n const redirects = buildRedirects({ modelsSectionSlug, documentSlug, isMultiDocument })\n\n // Canonicalize every place the id might live. The carriers are distinct physical locations (the\n // pathname and the bare hash), so a single page load can carry a legacy id in more than one — for\n // example a path-routing URL whose stale hash still holds an old bookmark. Rewriting all of them\n // avoids the address bar showing a corrected path next to an outdated hash. A redirect rule is\n // anchored to the document slug, so it never matches the base-prefixed value of a fallback carrier,\n // which keeps carriers that happen to share a location (hash base path + bare hash) from clobbering\n // each other.\n let didRedirect = false\n for (const carrier of locateIdCarriers(target, basePath)) {\n const rewritten = applyIdRedirects(carrier.value, redirects)\n if (rewritten !== carrier.value) {\n carrier.write(rewritten)\n didRedirect = true\n }\n }\n\n return didRedirect ? target : null\n}\n\n/**\n * Markers that separate an operation id from a schema path within an anchor id.\n * `responses` mirrors the request-body/parameter markers so response property\n * anchors (e.g. `operation.responses.200.name`) resolve back to the operation id.\n * Without it, deep links into responses cannot find their operation.\n */\nconst SCHEMA_PARAM_MARKERS = ['.body.', '.path.', '.query.', '.header.', '.responses.']\n\n/** Extracts the schema parameters from the id if they are present */\nexport const getSchemaParamsFromId = (id: string): { rawId: string; params: string } => {\n // Split at the first marker: an operation id never contains one, so everything\n // before the first marker is the operation id and the rest is the schema path.\n // (Splitting at the last marker would mishandle a property named like a marker\n // keyword, e.g. a request body field called `responses`.) A plain string scan\n // avoids the polynomial backtracking a `(.*)marker(.*)` regex would incur on\n // long, marker-less ids.\n let markerIndex = -1\n for (const marker of SCHEMA_PARAM_MARKERS) {\n const index = id.indexOf(marker)\n if (index !== -1 && (markerIndex === -1 || index < markerIndex)) {\n markerIndex = index\n }\n }\n\n if (markerIndex === -1) {\n return {\n rawId: id,\n params: '',\n }\n }\n\n return {\n rawId: id.slice(0, markerIndex),\n // Drop the leading dot but keep the marker keyword (e.g. `body.name`).\n params: id.slice(markerIndex + 1),\n }\n}\n"],"mappings":";AAAA,IAAa,oBAAoB,aAAqB;AACpD,QAAO,SAAS,QAAQ,cAAc,GAAG;;AAG3C,IAAM,kBAAkB,aAAqB,SAAS,WAAW,IAAI;AAErE,IAAM,wBAAwB,aAAqB;AACjD,QAAO,SAAS,QAAQ,OAAO,GAAG,CAAC,QAAQ,SAAS,GAAG;;AAGzD,IAAM,mBAAmB,MAAc,eAAmC;AACxE,QAAO,aAAa,GAAG,aAAa,OAAO,MAAM,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AED,MAAM,YAAY,CAGhB,qBAAqB,QAAQ,CAC9B;AAKD,KAAI,sBAAsB,SACxB,WAAU,KAAK,qBAAqB,SAAS,CAAC;AAGhD,QAAO;;;;;;;;;;;;AAaT,IAAa,eACX,KACA,mBACA,cACA,iBACA,aACe;AACf,KAAI,CAAC,aACH,QAAO;CAGT,MAAM,SAAS,IAAI,IAAI,OAAO,QAAQ,WAAW,MAAM,IAAI,UAAU,CAAC;CACtE,MAAM,YAAY,eAAe;EAAE;EAAmB;EAAc;EAAiB,CAAC;CAStF,IAAI,cAAc;AAClB,MAAK,MAAM,WAAW,iBAAiB,QAAQ,SAAS,EAAE;EACxD,MAAM,YAAY,iBAAiB,QAAQ,OAAO,UAAU;AAC5D,MAAI,cAAc,QAAQ,OAAO;AAC/B,WAAQ,MAAM,UAAU;AACxB,iBAAc;;;AAIlB,QAAO,cAAc,SAAS;;;;;;;;AAShC,IAAM,uBAAuB;CAAC;CAAU;CAAU;CAAW;CAAY;CAAc;;AAGvF,IAAa,yBAAyB,OAAkD;CAOtF,IAAI,cAAc;AAClB,MAAK,MAAM,UAAU,sBAAsB;EACzC,MAAM,QAAQ,GAAG,QAAQ,OAAO;AAChC,MAAI,UAAU,OAAO,gBAAgB,MAAM,QAAQ,aACjD,eAAc;;AAIlB,KAAI,gBAAgB,GAClB,QAAO;EACL,OAAO;EACP,QAAQ;EACT;AAGH,QAAO;EACL,OAAO,GAAG,MAAM,GAAG,YAAY;EAE/B,QAAQ,GAAG,MAAM,cAAc,EAAE;EAClC"}
1
+ {"version":3,"file":"id-routing.js","names":[],"sources":["../../src/helpers/id-routing.ts"],"sourcesContent":["import { slugify } from '@scalar/helpers/string/slugify'\n\nexport const sanitizeBasePath = (basePath: string) => {\n return basePath.replace(/^\\/+|\\/+$/g, '')\n}\n\nconst isHashBasePath = (basePath: string) => basePath.startsWith('#')\n\nconst sanitizeHashBasePath = (basePath: string) => {\n return basePath.replace(/^#+/, '').replace(/\\/+$/g, '')\n}\n\nconst applySlugPrefix = (base: string, slugPrefix: string | undefined) => {\n return slugPrefix ? `${slugPrefix}${base ? '/' : ''}${base}` : base\n}\n\nconst stripBasePathPrefix = (value: string, basePath: string) => {\n if (value === basePath) {\n return ''\n }\n\n if (value.startsWith(`${basePath}/`)) {\n return value.slice(basePath.length + 1)\n }\n\n return null\n}\n\n/**\n * Builds the URL-encoded, slash-prefixed form of a sanitized base path.\n *\n * Each segment is encoded separately so the result matches how the browser stores\n * `location.pathname` (which encodes within segments but leaves the slashes between them).\n */\nconst encodeBasePath = (sanitized: string) => {\n if (!sanitized) {\n return ''\n }\n\n return `/${sanitized\n .split('/')\n .map((segment) => encodeURIComponent(segment))\n .join('/')}`\n}\n\n/** Extracts an element id from the hash when using hash routing */\nexport const getIdFromHash = (location: string | URL, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n const base = decodeURIComponent(url.hash.slice(1))\n\n return applySlugPrefix(base, slugPrefix)\n}\n/** Extracts an element id from the path when using path routing */\nexport const getIdFromPath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const basePathWithSlash = encodeBasePath(sanitizeBasePath(basePath))\n\n // Extract the portion after the basePath\n if (url.pathname.startsWith(basePathWithSlash)) {\n const remainder = url.pathname.slice(basePathWithSlash.length)\n const base = decodeURIComponent(remainder.startsWith('/') ? remainder.slice(1) : remainder)\n return applySlugPrefix(base, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Extracts an element id from a hash-prefixed basePath */\nexport const getIdFromHashBasePath = (location: string | URL, basePath: string, slugPrefix: string | undefined) => {\n const url = typeof location === 'string' ? new URL(location) : location\n const hash = decodeURIComponent(url.hash.slice(1))\n const sanitized = sanitizeHashBasePath(basePath)\n\n const remainder = stripBasePathPrefix(hash, sanitized)\n if (remainder !== null) {\n return applySlugPrefix(remainder, slugPrefix)\n }\n\n return slugPrefix ?? ''\n}\n\n/** Determines whether a URL matches the provided basePath. */\nexport const matchesBasePath = (location: string | URL, basePath: string) => {\n const url = typeof location === 'string' ? new URL(location) : location\n\n if (isHashBasePath(basePath)) {\n const hash = decodeURIComponent(url.hash)\n return hash === basePath || hash.startsWith(`${basePath}/`)\n }\n\n const basePathWithSlash = encodeBasePath(sanitizeBasePath(basePath))\n\n return url.pathname === basePathWithSlash || url.pathname.startsWith(`${basePathWithSlash}/`)\n}\n\n/**\n * Extracts a navigation id from a URL based on the routing type\n *\n * @param url - The URL to extract the id from\n * @param basePath - The base path used in path routing\n * @param slugPrefix - If the document slug is not expected in the URL then we must prefix it\n */\nexport const getIdFromUrl = (url: string | URL, basePath: string | undefined, slugPrefix: string | undefined) => {\n if (typeof basePath !== 'string') {\n return getIdFromHash(url, slugPrefix)\n }\n\n return isHashBasePath(basePath)\n ? getIdFromHashBasePath(url, basePath, slugPrefix)\n : getIdFromPath(url, basePath, slugPrefix)\n}\n\n/**\n * Strips the first segment from an id and preserves trailing slashes\n * Used in single-document mode where the document slug is not needed in the URL\n *\n * @param id - The full id to process\n * @returns The id with the first segment removed, preserving trailing slash if present\n */\nconst stripFirstSegment = (id: string): string => {\n // For preserving trailing slash in the id\n const hasTrailingSlash = id.endsWith('/')\n const segments = id.split('/').filter(Boolean).slice(1)\n const result = segments.join('/')\n\n // Only preserve trailing slash if there's actual content\n return hasTrailingSlash && result ? `${result}/` : result\n}\n\n/**\n * Generate a new URL and applies the ID to the path or hash\n * depending on the type of routing used\n *\n * @param id - The id to apply to the URL\n * @param basePath - The base path used in path routing\n * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id\n */\nexport const makeUrlFromId = (_id: string, basePath: string | undefined, isMultiDocument: boolean) => {\n if (typeof window === 'undefined') {\n return undefined\n }\n\n /** When there is only 1 document we don't need to include the document name in the URL */\n const id = isMultiDocument ? _id : stripFirstSegment(_id)\n const url = new URL(window.location.href)\n\n if (typeof basePath === 'string') {\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n url.hash = [base, id].filter(Boolean).join('/')\n } else {\n const base = sanitizeBasePath(basePath)\n url.pathname = `${base}/${id}`\n }\n } else {\n url.hash = id\n }\n\n return url\n}\n\nconst escapeRegex = (value: string) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n\n/**\n * A located navigation id: the decoded id plus a way to write a rewritten id back.\n */\ntype IdCarrier = {\n /** The decoded navigation id with all routing chrome (`#`, base path) removed. */\n value: string\n /** Splices `next` back into the location this id came from, preserving the URL shape. */\n write: (next: string) => void\n}\n\n/** Carrier for an id that lives in the bare hash fragment (`#<id>`). */\nconst bareHashCarrier = (url: URL): IdCarrier => ({\n value: decodeURIComponent(url.hash.slice(1)),\n write: (next) => {\n url.hash = next\n },\n})\n\n/**\n * Locates the navigation id inside a URL regardless of the routing mode.\n *\n * The id can live in three places — the bare hash, a hash base path (`#<base>/<id>`), or the\n * pathname after a path base path. Each carrier pairs the decoded id with a `write` callback, so\n * callers edit ids in id-space without re-deriving the routing chrome for each mode.\n *\n * Multiple carriers are returned: the canonical location for the active routing mode comes first,\n * followed by a legacy bare-hash carrier. Both path and hash-base-path routing include the bare hash\n * so a stale `#default/model/User` bookmark (left over from before the base path was configured) is\n * still canonicalized — the previous implementation rewrote such doc-slug-anchored hashes on every\n * load regardless of the routing mode. Callers rewrite every carrier that matches, not just the\n * first, so a legacy id sitting in both the pathname and the hash is cleaned up in one pass.\n */\nconst locateIdCarriers = (url: URL, basePath: string | undefined): IdCarrier[] => {\n // Hash routing: the id is the bare fragment.\n if (typeof basePath !== 'string') {\n return [bareHashCarrier(url)]\n }\n\n // Hash base path routing: the id follows a `#<base>/` prefix.\n if (isHashBasePath(basePath)) {\n const base = sanitizeHashBasePath(basePath)\n const hash = decodeURIComponent(url.hash.slice(1))\n\n return [\n {\n value: stripBasePathPrefix(hash, base) ?? '',\n write: (next) => {\n url.hash = [base, next].filter(Boolean).join('/')\n },\n },\n // Legacy fallback: an old bookmark may carry the id in the fragment without the base prefix.\n bareHashCarrier(url),\n ]\n }\n\n // Path routing: the id follows the (URL-encoded) base path in the pathname.\n const base = sanitizeBasePath(basePath)\n const remainder = stripBasePathPrefix(url.pathname, encodeBasePath(base))\n\n return [\n {\n value: remainder === null ? '' : decodeURIComponent(remainder),\n write: (next) => {\n // Assigning to `pathname` re-encodes characters, so we splice with the decoded base.\n url.pathname = base ? `/${base}/${next}` : `/${next}`\n },\n },\n // Legacy fallback: an old hash-routing bookmark may still carry the id in the fragment.\n bareHashCarrier(url),\n ]\n}\n\n/**\n * A single redirect rule, expressed in routing-agnostic id-space.\n *\n * Ids are navigation strings with all routing chrome (`#`, base path) stripped — see\n * {@link locateIdCarrier}. A rule is just the shape of an id rewrite: `match` is tested against the\n * id and `replace` follows the native `String.prototype.replace` contract, so a rule can be a plain\n * segment swap or an arbitrary replacer function. A rule that does not match leaves the id alone.\n */\ntype IdRedirect = {\n /** Pattern tested against the routing-agnostic id. */\n match: RegExp\n /** Replacement passed straight to `String.prototype.replace` (template string or replacer fn). */\n replace: string | ((substring: string, ...groups: string[]) => string)\n}\n\n/**\n * Applies redirect rules to an id and returns the first rewrite that changes it.\n *\n * Rules are tried in order and the search stops at the first match, so list more specific rules\n * before more general ones. Returns the id unchanged when no rule applies.\n */\nconst applyIdRedirects = (id: string, redirects: IdRedirect[]): string => {\n for (const { match, replace } of redirects) {\n // The ternary narrows the union so each `String.prototype.replace` overload type-checks.\n const next = typeof replace === 'string' ? id.replace(match, replace) : id.replace(match, replace)\n if (next !== id) {\n return next\n }\n }\n\n return id\n}\n\n/** Optional `(tag-group/<n>/)?tag/<slug>/` chrome that may sit in front of a section segment. */\nconst TAG_CHROME = '(?:(?:tag-group/[^/]+/)?tag/[^/]+/)?'\n\n/**\n * Runtime values the redirect rules are built from.\n *\n * The rules are data, but a few entries depend on per-document values (the configurable models\n * section slug, the active document slug, single- vs multi-document mode), so the list is built per\n * call rather than declared as a static constant.\n */\ntype RedirectContext = {\n /** Current (possibly customized) slug of the models section, e.g. `models` or `schemas`. */\n modelsSectionSlug: string\n /** Slug of the active document; legacy ids are anchored to it to avoid false positives. */\n documentSlug: string\n /** Multi-document ids always carry the doc slug; single-document bookmarks may omit it. */\n isMultiDocument: boolean\n}\n\n/**\n * Builds the list of id redirects for the current document.\n *\n * Add an entry here to support a new redirect. Each rule runs against every URL shape (hash, hash\n * base path, path) for free, because rules operate on routing-agnostic ids.\n */\nconst buildRedirects = ({ modelsSectionSlug, documentSlug, isMultiDocument }: RedirectContext): IdRedirect[] => {\n const escapedDoc = escapeRegex(documentSlug)\n // Keeping the tag chrome inside the doc-slug group is deliberate: a slug-less\n // `tag/<slug>/<segment>/<name>` is left alone, since once the document slug is stripped it is\n // ambiguous with an operation under a tag literally named after the segment.\n const documentPrefix = isMultiDocument ? `${escapedDoc}/${TAG_CHROME}` : `(?:${escapedDoc}/${TAG_CHROME})?`\n\n // Rewrites a leading `<from>/` section segment to the current models section slug. The trailing\n // `/` leaves an already-correct segment and operation paths such as `default/POST/model/train`\n // untouched.\n const renameSectionSegment = (from: string): IdRedirect => ({\n match: new RegExp(`^(${documentPrefix})${escapeRegex(from)}/`),\n replace: (_match, prefix) => `${prefix}${modelsSectionSlug}/`,\n })\n\n const redirects = [\n // Earlier versions hardcoded a singular `model/` prefix for individual schema entries even\n // though the section itself was plural, so old bookmarks like `default/model/User` would 404.\n renameSectionSegment('model'),\n ]\n\n // The models section used to live at the literal `models/`. Once a custom label moves it\n // elsewhere (e.g. `schemas/`), older `models/<name>` bookmarks must follow it. When the slug is\n // still the default `models` this would be a no-op, so only register it when it actually differs.\n if (modelsSectionSlug !== 'models') {\n redirects.push(renameSectionSegment('models'))\n }\n\n return redirects\n}\n\n/**\n * Markers that separate an operation id from a schema path within an anchor id.\n * `responses` mirrors the request-body/parameter markers so response property\n * anchors (e.g. `operation.responses.200.name`) resolve back to the operation id.\n * Without it, deep links into responses cannot find their operation.\n */\nconst SCHEMA_PARAM_MARKERS = ['.body.', '.path.', '.query.', '.header.', '.responses.']\n\n/**\n * Source data for a single webhook redirect: the raw event name, its method, and the current id.\n *\n * The current slug is read back off the id, so this layer does not need to know the (dot-keeping)\n * slug rule — it only reproduces the legacy (dot-dropping) slug to match old bookmarks.\n */\nexport type WebhookRedirectSource = {\n /** Raw webhook event name from the OpenAPI `webhooks` key, e.g. `account_holder.created`. */\n name: string\n /** HTTP method of the webhook operation. */\n method: string\n /** Current navigation id of the webhook, e.g. `default/webhook/POST/account-holder.created`. */\n id: string\n}\n\n/**\n * Builds redirect rules mapping each webhook's legacy dot-dropped slug to its current slug.\n *\n * Webhook ids used to slugify the event name with no options, which dropped dots\n * (`account_holder.created` -> `account-holdercreated`); the current id keeps them\n * (`account-holder.created`). That rewrite cannot be reversed generically, so we emit one exact rule\n * per webhook whose legacy slug differs from the current one. Each rule matches the invariant\n * `webhook/<METHOD>/<legacy-slug>` tail, so it applies regardless of the document/tag prefix in front\n * of it and preserves any sub-anchor after it. A sub-anchor is either a `/` segment or a dot-joined\n * schema property anchor (e.g. `.body.id`, see {@link SCHEMA_PARAM_MARKERS}); a dot followed by\n * anything else is not treated as a boundary, because the legacy slug never contains a dot while a\n * current webhook slug can, so such a URL belongs to a different webhook.\n *\n * Because the legacy slug is lossy, two things can make a redirect unsafe, and both are dropped so an\n * ambiguous link falls through to normal not-found handling instead of landing on the wrong webhook:\n * - the legacy slug is already another webhook's *current* slug (redirecting it would hijack a valid\n * URL), or\n * - two webhooks collapse to the same legacy slug (the old bookmark is genuinely ambiguous).\n */\nconst buildWebhookRedirects = (webhooks: WebhookRedirectSource[]): IdRedirect[] => {\n const key = (method: string, slug: string) => `${method.toUpperCase()}/${slug}`\n\n // Index current slugs so a legacy redirect never clobbers a real, current URL, and count legacy\n // slugs so we can drop the ones two webhooks share.\n const currentKeys = new Set<string>()\n const legacyCounts = new Map<string, number>()\n for (const { name, method, id } of webhooks) {\n currentKeys.add(key(method, id.slice(id.lastIndexOf('/') + 1)))\n const legacySlug = slugify(name)\n if (legacySlug) {\n const legacyKey = key(method, legacySlug)\n legacyCounts.set(legacyKey, (legacyCounts.get(legacyKey) ?? 0) + 1)\n }\n }\n\n // Property deep links append their breadcrumb to the operation id with dots\n // (`<slug>.body.id`), so the slug boundary must accept a schema-param marker\n // alongside the end of the id and a `/` segment.\n const boundary = `(?=$|/|${SCHEMA_PARAM_MARKERS.map(escapeRegex).join('|')})`\n\n const redirects: IdRedirect[] = []\n for (const { name, method, id } of webhooks) {\n const upperMethod = method.toUpperCase()\n const currentSlug = id.slice(id.lastIndexOf('/') + 1)\n const legacySlug = slugify(name)\n const legacyKey = key(method, legacySlug)\n\n // Skip when the slug did not change, when the legacy slug is a real current URL, or when it is\n // shared by more than one webhook.\n if (\n !legacySlug ||\n legacySlug === currentSlug ||\n currentKeys.has(legacyKey) ||\n (legacyCounts.get(legacyKey) ?? 0) > 1\n ) {\n continue\n }\n\n redirects.push({\n match: new RegExp(`(^|/)webhook/${escapeRegex(upperMethod)}/${escapeRegex(legacySlug)}${boundary}`),\n replace: (_match, prefix) => `${prefix}webhook/${upperMethod}/${currentSlug}`,\n })\n }\n\n return redirects\n}\n\n/**\n * Rewrites navigation ids in a URL to their current form.\n *\n * The URL is reduced to its routing-agnostic id (see {@link locateIdCarriers}), each redirect rule\n * is applied in id-space (see {@link buildRedirects} for models and {@link buildWebhookRedirects} for\n * webhooks), and the result is spliced back into the original location. This handles hash,\n * hash-base-path, and path routing uniformly, so a new redirect only has to be added to the list once.\n *\n * Returns the canonicalized URL when a rewrite happens, or null otherwise.\n */\nexport const redirectUrl = (\n url: string | URL,\n modelsSectionSlug: string,\n documentSlug: string,\n isMultiDocument: boolean,\n basePath?: string,\n webhooks: WebhookRedirectSource[] = [],\n): URL | null => {\n if (!documentSlug) {\n return null\n }\n\n const target = new URL(typeof url === 'string' ? url : url.toString())\n const redirects = [\n ...buildRedirects({ modelsSectionSlug, documentSlug, isMultiDocument }),\n ...buildWebhookRedirects(webhooks),\n ]\n\n // Canonicalize every place the id might live. The carriers are distinct physical locations (the\n // pathname and the bare hash), so a single page load can carry a legacy id in more than one — for\n // example a path-routing URL whose stale hash still holds an old bookmark. Rewriting all of them\n // avoids the address bar showing a corrected path next to an outdated hash. A redirect rule is\n // anchored to the document slug, so it never matches the base-prefixed value of a fallback carrier,\n // which keeps carriers that happen to share a location (hash base path + bare hash) from clobbering\n // each other.\n let didRedirect = false\n for (const carrier of locateIdCarriers(target, basePath)) {\n const rewritten = applyIdRedirects(carrier.value, redirects)\n if (rewritten !== carrier.value) {\n carrier.write(rewritten)\n didRedirect = true\n }\n }\n\n return didRedirect ? target : null\n}\n\n/** Extracts the schema parameters from the id if they are present */\nexport const getSchemaParamsFromId = (id: string): { rawId: string; params: string } => {\n // Split at the first marker: an operation id never contains one, so everything\n // before the first marker is the operation id and the rest is the schema path.\n // (Splitting at the last marker would mishandle a property named like a marker\n // keyword, e.g. a request body field called `responses`.) A plain string scan\n // avoids the polynomial backtracking a `(.*)marker(.*)` regex would incur on\n // long, marker-less ids.\n let markerIndex = -1\n for (const marker of SCHEMA_PARAM_MARKERS) {\n const index = id.indexOf(marker)\n if (index !== -1 && (markerIndex === -1 || index < markerIndex)) {\n markerIndex = index\n }\n }\n\n if (markerIndex === -1) {\n return {\n rawId: id,\n params: '',\n }\n }\n\n return {\n rawId: id.slice(0, markerIndex),\n // Drop the leading dot but keep the marker keyword (e.g. `body.name`).\n params: id.slice(markerIndex + 1),\n }\n}\n"],"mappings":";;AAEA,IAAa,oBAAoB,aAAqB;CACpD,OAAO,SAAS,QAAQ,cAAc,EAAE;AAC1C;AAEA,IAAM,kBAAkB,aAAqB,SAAS,WAAW,GAAG;AAEpE,IAAM,wBAAwB,aAAqB;CACjD,OAAO,SAAS,QAAQ,OAAO,EAAE,CAAC,CAAC,QAAQ,SAAS,EAAE;AACxD;AAEA,IAAM,mBAAmB,MAAc,eAAmC;CACxE,OAAO,aAAa,GAAG,aAAa,OAAO,MAAM,KAAK,SAAS;AACjE;AAEA,IAAM,uBAAuB,OAAe,aAAq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AAY,UAAU,IAAI,UAAU;GAClG,UAAU,QAAQ,WAAW,GAAG,OAAO,UAAU,YAAY,GAAG;EAClE,CAAC;CACH;CAEA,OAAO;AACT;;;;;;;;;;;AAYA,IAAa,eACX,KACA,mBACA,cACA,iBACA,UACA,WAAoC,CAAC,MACtB;CACf,IAAI,CAAC,cACH,OAAO;CAGT,MAAM,SAAS,IAAI,IAAI,OAAO,QAAQ,WAAW,MAAM,IAAI,SAAS,CAAC;CACrE,MAAM,YAAY,CAChB,GAAG,eAAe;EAAE;EAAmB;EAAc;CAAgB,CAAC,GACtE,GAAG,sBAAsB,QAAQ,CACnC;CASA,IAAI,cAAc;CAClB,KAAK,MAAM,WAAW,iBAAiB,QAAQ,QAAQ,GAAG;EACxD,MAAM,YAAY,iBAAiB,QAAQ,OAAO,SAAS;EAC3D,IAAI,cAAc,QAAQ,OAAO;GAC/B,QAAQ,MAAM,SAAS;GACvB,cAAc;EAChB;CACF;CAEA,OAAO,cAAc,SAAS;AAChC;;AAGA,IAAa,yBAAyB,OAAkD;CAOtF,IAAI,cAAc;CAClB,KAAK,MAAM,UAAU,sBAAsB;EACzC,MAAM,QAAQ,GAAG,QAAQ,MAAM;EAC/B,IAAI,UAAU,OAAO,gBAAgB,MAAM,QAAQ,cACjD,cAAc;CAElB;CAEA,IAAI,gBAAgB,IAClB,OAAO;EACL,OAAO;EACP,QAAQ;CACV;CAGF,OAAO;EACL,OAAO,GAAG,MAAM,GAAG,WAAW;EAE9B,QAAQ,GAAG,MAAM,cAAc,CAAC;CAClC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-introduction-entry.js","names":[],"sources":["../../src/helpers/is-introduction-entry.ts"],"sourcesContent":["/**\n * The auto-generated \"Introduction\" navigation entry always uses the `introduction` slug, so its id\n * ends with this suffix regardless of the active locale or the displayed title.\n */\nexport const INTRODUCTION_ENTRY_ID_SUFFIX = '/description/introduction'\n\n/**\n * Whether a navigation entry is the auto-generated introduction section.\n *\n * We match on the stable entry id instead of the English title so localization does not accidentally\n * rewrite unrelated description headings that happen to be called \"Introduction\".\n */\nexport const isIntroductionEntry = (entry: { type?: string; id?: string }): boolean =>\n entry.type === 'text' && typeof entry.id === 'string' && entry.id.endsWith(INTRODUCTION_ENTRY_ID_SUFFIX)\n"],"mappings":";;;;;AAIA,IAAa,+BAA+B;;;;;;;AAQ5C,IAAa,uBAAuB,UAClC,MAAM,SAAS,UAAU,OAAO,MAAM,OAAO,YAAY,MAAM,GAAG,SAAA,4BAAsC"}
1
+ {"version":3,"file":"is-introduction-entry.js","names":[],"sources":["../../src/helpers/is-introduction-entry.ts"],"sourcesContent":["/**\n * The auto-generated \"Introduction\" navigation entry always uses the `introduction` slug, so its id\n * ends with this suffix regardless of the active locale or the displayed title.\n */\nexport const INTRODUCTION_ENTRY_ID_SUFFIX = '/description/introduction'\n\n/**\n * Whether a navigation entry is the auto-generated introduction section.\n *\n * We match on the stable entry id instead of the English title so localization does not accidentally\n * rewrite unrelated description headings that happen to be called \"Introduction\".\n */\nexport const isIntroductionEntry = (entry: { type?: string; id?: string }): boolean =>\n entry.type === 'text' && typeof entry.id === 'string' && entry.id.endsWith(INTRODUCTION_ENTRY_ID_SUFFIX)\n"],"mappings":";;;;;AAIA,IAAa,+BAA+B;;;;;;;AAQ5C,IAAa,uBAAuB,UAClC,MAAM,SAAS,UAAU,OAAO,MAAM,OAAO,YAAY,MAAM,GAAG,SAAA,2BAAqC"}
@@ -1 +1 @@
1
- {"version":3,"file":"lazy-bus.js","names":[],"sources":["../../src/helpers/lazy-bus.ts"],"sourcesContent":["import { watchDebounced } from '@vueuse/core'\nimport { nanoid } from 'nanoid'\nimport { computed, nextTick, onBeforeUnmount, reactive, ref } from 'vue'\n\nimport { getSchemaParamsFromId } from './id-routing'\n\n/**\n * List of items that are in the priority queue and will be rendered first (e.g. scroll target).\n */\nconst priorityQueue = reactive<Set<string>>(new Set())\n/** List of items that are pending to be loaded (in viewport overscan). */\nconst pendingQueue = reactive<Set<string>>(new Set())\n/** List of items that are already loaded and stay mounted (no eviction). */\nconst readyQueue = reactive<Set<string>>(new Set())\n/**\n * Flag to indicate if the lazy bus is currently running\n * Blocks ID changes while running\n */\nconst isRunning = ref(false)\n\n/** How long tryScroll keeps retrying to find the element (ms). */\nconst SCROLL_RETRY_MS = 3000\n\n/** Tracks when the initial load is complete. */\nexport const firstLazyLoadComplete = ref(false)\n\n/**\n * The id of the element we are currently scrolling to (the anchor target).\n *\n * Schema properties live inside collapsible disclosures that are not part of the\n * navigation tree, so the lazy bus cannot expand them the way it expands sidebar\n * parents. Instead we publish the active target here and let each collapsible\n * schema disclosure open itself when its breadcrumb is on the path to the target.\n * This is what makes deep links to hidden (collapsed) schema properties work.\n */\nexport const scrollTargetId = ref<string>('')\n\n/**\n * Clears the scroll target once we are done with it, so a stale target cannot\n * re-open a disclosure the user later collapsed (or that remounts). Guarded by\n * the id so a newer navigation that started during the scroll retry is kept.\n */\nconst clearScrollTarget = (id: string): void => {\n if (scrollTargetId.value === id) {\n scrollTargetId.value = ''\n }\n}\n\n/** List of unique identifiers that are blocking intersection */\nconst intersectionBlockers = reactive<Set<string>>(new Set())\n\nconst onRenderComplete = new Set<() => void>()\n\n/** Cached content heights so placeholders can match when not rendered. */\nconst lazyPlaceholderHeights = reactive<Map<string, number>>(new Map())\n\nexport const getLazyPlaceholderHeight = (id: string): number | undefined => lazyPlaceholderHeights.get(id)\n\nexport const setLazyPlaceholderHeight = (id: string, height: number): void => {\n if (!Number.isFinite(height) || height <= 0) {\n return\n }\n lazyPlaceholderHeights.set(id, Math.round(height))\n}\n\n/** Adds a one time callback to be executed when the lazy bus has finished loading */\nconst addLazyCompleteCallback = (callback: (() => void) | undefined) => {\n if (callback) {\n onRenderComplete.add(callback)\n }\n}\n\ntype UnblockFn = () => void\n\n/**\n * Blocks intersection until the returned unblock callback is run.\n * Prevents scroll jump while we render new lazy content.\n */\nexport const blockIntersection = (): UnblockFn => {\n const blockId = nanoid()\n intersectionBlockers.add(blockId)\n\n /** Unblock uses a small delay to ensure the scroll is complete before enabling intersection */\n return () => setTimeout(() => intersectionBlockers.delete(blockId), 100)\n}\n\n/** If there are any pending blocking operations we disable intersection */\nexport const intersectionEnabled = computed(() => intersectionBlockers.size === 0)\n\n/**\n * Processes the full queue: priority first, then pending. Blocks intersection while\n * rendering so the viewport does not jump. No eviction — items stay in readyQueue.\n */\nconst runLazyBus = () => {\n // We always render the lazy bus when the window is undefined (see useLazyBus)\n if (typeof window === 'undefined') {\n return\n }\n\n if (isRunning.value) {\n return\n }\n\n isRunning.value = true\n\n /**\n * Sets all the pending elements into the ready queue\n * After waiting for Vue to update the DOM we execute the callbacks and unblock intersection\n */\n const processQueue = async () => {\n const priorityIds = [...priorityQueue]\n const pendingIds = [...pendingQueue]\n\n if (priorityIds.length === 0 && pendingIds.length === 0) {\n onRenderComplete.forEach((fn) => fn())\n onRenderComplete.clear()\n isRunning.value = false\n firstLazyLoadComplete.value = true\n return\n }\n\n for (const id of priorityIds) {\n readyQueue.add(id)\n priorityQueue.delete(id)\n }\n for (const id of pendingIds) {\n readyQueue.add(id)\n pendingQueue.delete(id)\n }\n\n await nextTick()\n\n onRenderComplete.forEach((fn) => fn())\n onRenderComplete.clear()\n isRunning.value = false\n firstLazyLoadComplete.value = true\n }\n\n if (window.requestIdleCallback) {\n window.requestIdleCallback(processQueue, { timeout: 1500 })\n } else {\n // biome-ignore lint/nursery/noFloatingPromises: Expected floating promise\n nextTick(processQueue)\n }\n}\n\n/**\n * Run the lazy bus when the queue changes and is not currently running\n * Debounce so that multiple changes to the queue are batched together\n *\n * We must run when the priority queue changes because we rely on finish callbacks\n * anytime we request potentially lazy elements. If we don't run when the priority queue changes\n * we may not have a finish callback even though the element is set to load.\n */\nwatchDebounced(\n [() => pendingQueue.size, () => priorityQueue.size, () => isRunning.value],\n () => {\n if ((pendingQueue.size > 0 || priorityQueue.size > 0) && !isRunning.value) {\n runLazyBus()\n }\n },\n { debounce: 300, maxWait: 1500 },\n)\n\n/**\n * We only make elements pending if they are not already in the priority or ready queue\n */\nconst addToPendingQueue = (id: string | undefined) => {\n if (id && !readyQueue.has(id) && !priorityQueue.has(id)) {\n pendingQueue.add(id)\n }\n}\n\n/**\n * Add elements to the priority queue for immediate rendering.\n * We allow adding items already in readyQueue so that callbacks are still triggered,\n * but processQueue will skip actual re-rendering for items already ready.\n */\nexport const addToPriorityQueue = (id: string | undefined) => {\n if (id && !priorityQueue.has(id)) {\n priorityQueue.add(id)\n }\n}\n\n/**\n * Request an item to be rendered (e.g. when it re-enters the overscan zone).\n */\nexport const requestLazyRender = (id: string | undefined, priority = false): void => {\n if (!id || readyQueue.has(id)) {\n return\n }\n if (priority) {\n addToPriorityQueue(id)\n } else {\n addToPendingQueue(id)\n }\n if (!isRunning.value) {\n runLazyBus()\n }\n}\n\n/**\n * Schedules a single run of the lazy bus so that documents with no Lazy components\n * (e.g. no operations, tags, or models) still get firstLazyLoadComplete set and the\n * full-viewport placeholder can be hidden. Call from content root on mount.\n */\nexport const scheduleInitialLoadComplete = (): void => {\n if (typeof window === 'undefined') {\n return\n }\n const delay = 400\n window.setTimeout(() => runLazyBus(), delay)\n}\n\n/** When an element is unmounted we remove it from all queues */\nconst resetLazyElement = (id: string) => {\n priorityQueue.delete(id)\n pendingQueue.delete(id)\n readyQueue.delete(id)\n lazyPlaceholderHeights.delete(id)\n}\n\n// ---------------------------------------------------------------------------\n\n/**\n * Tracks the lazy loading state of an element.\n * Use isReady (or expanded) to decide whether to render the slot or show a placeholder.\n * The element is only added to the queue when it enters the viewport overscan (see Lazy.vue).\n */\nexport function useLazyBus(id: string) {\n onBeforeUnmount(() => {\n resetLazyElement(id)\n })\n\n return {\n isReady: computed(() => typeof window === 'undefined' || priorityQueue.has(id) || readyQueue.has(id)),\n }\n}\n\n/**\n * Scroll to a possibly lazy-loaded element. Expands parents and adds target (and\n * parents) to the priority queue, then scrolls after Vue has flushed.\n */\nexport const scrollToLazy = (\n id: string,\n setExpanded: (id: string, value: boolean) => void,\n getEntryById: (id: string) => { id: string; parent?: { id: string }; children?: { id: string }[] } | undefined,\n) => {\n const item = getEntryById(id)\n\n /**\n * If the element is lazy we must freeze the element so that it does not move until after the next lazy bus run\n * If the element never loads then the scroll onFailure callback will be run to unfreeze the element\n *\n * If the readyQueue does not have the item we must freeze it while it renders\n * If the item has lazy children we must freeze the item while the children are (potentially) loaded\n */\n const isLazy = !readyQueue.has(id) || item?.children?.some((child) => !readyQueue.has(child.id))\n\n const unfreeze = isLazy ? freeze(id) : undefined\n addLazyCompleteCallback(unfreeze)\n\n // Disable intersection while we scroll to the element\n const unblock = blockIntersection()\n const { rawId } = getSchemaParamsFromId(id)\n\n // Publish the target so collapsible schema disclosures on the path can open\n // themselves. Schema properties are not in the navigation tree, so this is the\n // only way the scroll target inside a collapsed schema becomes reachable.\n scrollTargetId.value = id\n\n addToPriorityQueue(id)\n addToPriorityQueue(rawId)\n\n // When there are children we ensure the first 2 are loaded\n if (item?.children) {\n item.children.slice(0, 2).forEach((child) => addToPriorityQueue(child.id))\n }\n\n // When there are sibling items we attempt to load the next 2 to better fill the viewport\n if (item?.parent) {\n const parent = getEntryById(item.parent.id)\n const elementIdx = parent?.children?.findIndex((child) => child.id === id)\n if (elementIdx !== undefined && elementIdx >= 0) {\n parent?.children?.slice(elementIdx, elementIdx + 2).forEach((child) => addToPriorityQueue(child.id))\n }\n }\n\n setExpanded(rawId, true)\n /**\n * Recursively expand the parents and set them as a loading priority\n * This ensures all parents will be immediately loaded and open\n */\n const addParents = (currentId: string) => {\n const parent = getEntryById(currentId)?.parent\n if (parent) {\n addToPriorityQueue(parent.id)\n setExpanded(parent.id, true)\n addParents(parent.id)\n }\n }\n /** Must use the rawId as schema params are not in the navigation tree */\n addParents(rawId)\n\n void nextTick(() => {\n tryScroll(id, Date.now() + SCROLL_RETRY_MS, unblock, unfreeze)\n })\n}\n\n/**\n * Tiny wrapper around the scrollIntoView API\n * Retries up to the stopTime in case the element is not yet rendered\n *\n * @param id - The id of the element to scroll to\n * @param stopTime - The time to stop retrying in unix milliseconds\n */\nconst tryScroll = (id: string, stopTime: number, onComplete: UnblockFn, onFailure?: () => void): void => {\n const element = document.getElementById(id)\n if (element) {\n element.scrollIntoView({ block: 'start' })\n clearScrollTarget(id)\n onComplete()\n } else if (Date.now() < stopTime) {\n requestAnimationFrame(() => tryScroll(id, stopTime, onComplete, onFailure))\n } else {\n // If the scroll has expired we enable intersection again\n clearScrollTarget(id)\n onComplete()\n onFailure?.()\n }\n}\n\nconst freeze = (id: string): (() => void) => {\n let stop = false\n\n /**\n * Runs until the stop flag is set\n * Executes the final frame after stop changes to true\n */\n const runFrame = (stopAfterFrame: boolean) => {\n const element = document.getElementById(id)\n if (element) {\n element.scrollIntoView({ block: 'start' })\n }\n if (!stopAfterFrame) {\n requestAnimationFrame(() => runFrame(stop))\n }\n }\n\n runFrame(false)\n\n return () => {\n stop = true\n }\n}\n"],"mappings":";;;;;;;;AASA,IAAM,gBAAgB,yBAAsB,IAAI,KAAK,CAAC;;AAEtD,IAAM,eAAe,yBAAsB,IAAI,KAAK,CAAC;;AAErD,IAAM,aAAa,yBAAsB,IAAI,KAAK,CAAC;;;;;AAKnD,IAAM,YAAY,IAAI,MAAM;;AAG5B,IAAM,kBAAkB;;AAGxB,IAAa,wBAAwB,IAAI,MAAM;;;;;;;;;;AAW/C,IAAa,iBAAiB,IAAY,GAAG;;;;;;AAO7C,IAAM,qBAAqB,OAAqB;AAC9C,KAAI,eAAe,UAAU,GAC3B,gBAAe,QAAQ;;;AAK3B,IAAM,uBAAuB,yBAAsB,IAAI,KAAK,CAAC;AAE7D,IAAM,mCAAmB,IAAI,KAAiB;;AAG9C,IAAM,yBAAyB,yBAA8B,IAAI,KAAK,CAAC;AAEvE,IAAa,4BAA4B,OAAmC,uBAAuB,IAAI,GAAG;AAE1G,IAAa,4BAA4B,IAAY,WAAyB;AAC5E,KAAI,CAAC,OAAO,SAAS,OAAO,IAAI,UAAU,EACxC;AAEF,wBAAuB,IAAI,IA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ebounced } from '@vueuse/core'\nimport { nanoid } from 'nanoid'\nimport { computed, nextTick, onBeforeUnmount, reactive, ref } from 'vue'\n\nimport { getSchemaParamsFromId } from './id-routing'\n\n/**\n * List of items that are in the priority queue and will be rendered first (e.g. scroll target).\n */\nconst priorityQueue = reactive<Set<string>>(new Set())\n/** List of items that are pending to be loaded (in viewport overscan). */\nconst pendingQueue = reactive<Set<string>>(new Set())\n/** List of items that are already loaded and stay mounted (no eviction). */\nconst readyQueue = reactive<Set<string>>(new Set())\n/**\n * Flag to indicate if the lazy bus is currently running\n * Blocks ID changes while running\n */\nconst isRunning = ref(false)\n\n/** How long tryScroll keeps retrying to find the element (ms). */\nconst SCROLL_RETRY_MS = 3000\n\n/** Tracks when the initial load is complete. */\nexport const firstLazyLoadComplete = ref(false)\n\n/**\n * The id of the element we are currently scrolling to (the anchor target).\n *\n * Schema properties live inside collapsible disclosures that are not part of the\n * navigation tree, so the lazy bus cannot expand them the way it expands sidebar\n * parents. Instead we publish the active target here and let each collapsible\n * schema disclosure open itself when its breadcrumb is on the path to the target.\n * This is what makes deep links to hidden (collapsed) schema properties work.\n */\nexport const scrollTargetId = ref<string>('')\n\n/**\n * Clears the scroll target once we are done with it, so a stale target cannot\n * re-open a disclosure the user later collapsed (or that remounts). Guarded by\n * the id so a newer navigation that started during the scroll retry is kept.\n */\nconst clearScrollTarget = (id: string): void => {\n if (scrollTargetId.value === id) {\n scrollTargetId.value = ''\n }\n}\n\n/** List of unique identifiers that are blocking intersection */\nconst intersectionBlockers = reactive<Set<string>>(new Set())\n\nconst onRenderComplete = new Set<() => void>()\n\n/** Cached content heights so placeholders can match when not rendered. */\nconst lazyPlaceholderHeights = reactive<Map<string, number>>(new Map())\n\nexport const getLazyPlaceholderHeight = (id: string): number | undefined => lazyPlaceholderHeights.get(id)\n\nexport const setLazyPlaceholderHeight = (id: string, height: number): void => {\n if (!Number.isFinite(height) || height <= 0) {\n return\n }\n lazyPlaceholderHeights.set(id, Math.round(height))\n}\n\n/** Adds a one time callback to be executed when the lazy bus has finished loading */\nconst addLazyCompleteCallback = (callback: (() => void) | undefined) => {\n if (callback) {\n onRenderComplete.add(callback)\n }\n}\n\ntype UnblockFn = () => void\n\n/**\n * Blocks intersection until the returned unblock callback is run.\n * Prevents scroll jump while we render new lazy content.\n */\nexport const blockIntersection = (): UnblockFn => {\n const blockId = nanoid()\n intersectionBlockers.add(blockId)\n\n /** Unblock uses a small delay to ensure the scroll is complete before enabling intersection */\n return () => setTimeout(() => intersectionBlockers.delete(blockId), 100)\n}\n\n/** If there are any pending blocking operations we disable intersection */\nexport const intersectionEnabled = computed(() => intersectionBlockers.size === 0)\n\n/**\n * Processes the full queue: priority first, then pending. Blocks intersection while\n * rendering so the viewport does not jump. No eviction — items stay in readyQueue.\n */\nconst runLazyBus = () => {\n // We always render the lazy bus when the window is undefined (see useLazyBus)\n if (typeof window === 'undefined') {\n return\n }\n\n if (isRunning.value) {\n return\n }\n\n isRunning.value = true\n\n /**\n * Sets all the pending elements into the ready queue\n * After waiting for Vue to update the DOM we execute the callbacks and unblock intersection\n */\n const processQueue = async () => {\n const priorityIds = [...priorityQueue]\n const pendingIds = [...pendingQueue]\n\n if (priorityIds.length === 0 && pendingIds.length === 0) {\n onRenderComplete.forEach((fn) => fn())\n onRenderComplete.clear()\n isRunning.value = false\n firstLazyLoadComplete.value = true\n return\n }\n\n for (const id of priorityIds) {\n readyQueue.add(id)\n priorityQueue.delete(id)\n }\n for (const id of pendingIds) {\n readyQueue.add(id)\n pendingQueue.delete(id)\n }\n\n await nextTick()\n\n onRenderComplete.forEach((fn) => fn())\n onRenderComplete.clear()\n isRunning.value = false\n firstLazyLoadComplete.value = true\n }\n\n if (window.requestIdleCallback) {\n window.requestIdleCallback(processQueue, { timeout: 1500 })\n } else {\n // biome-ignore lint/nursery/noFloatingPromises: Expected floating promise\n nextTick(processQueue)\n }\n}\n\n/**\n * Run the lazy bus when the queue changes and is not currently running\n * Debounce so that multiple changes to the queue are batched together\n *\n * We must run when the priority queue changes because we rely on finish callbacks\n * anytime we request potentially lazy elements. If we don't run when the priority queue changes\n * we may not have a finish callback even though the element is set to load.\n */\nwatchDebounced(\n [() => pendingQueue.size, () => priorityQueue.size, () => isRunning.value],\n () => {\n if ((pendingQueue.size > 0 || priorityQueue.size > 0) && !isRunning.value) {\n runLazyBus()\n }\n },\n { debounce: 300, maxWait: 1500 },\n)\n\n/**\n * We only make elements pending if they are not already in the priority or ready queue\n */\nconst addToPendingQueue = (id: string | undefined) => {\n if (id && !readyQueue.has(id) && !priorityQueue.has(id)) {\n pendingQueue.add(id)\n }\n}\n\n/**\n * Add elements to the priority queue for immediate rendering.\n * We allow adding items already in readyQueue so that callbacks are still triggered,\n * but processQueue will skip actual re-rendering for items already ready.\n */\nexport const addToPriorityQueue = (id: string | undefined) => {\n if (id && !priorityQueue.has(id)) {\n priorityQueue.add(id)\n }\n}\n\n/**\n * Request an item to be rendered (e.g. when it re-enters the overscan zone).\n */\nexport const requestLazyRender = (id: string | undefined, priority = false): void => {\n if (!id || readyQueue.has(id)) {\n return\n }\n if (priority) {\n addToPriorityQueue(id)\n } else {\n addToPendingQueue(id)\n }\n if (!isRunning.value) {\n runLazyBus()\n }\n}\n\n/**\n * Schedules a single run of the lazy bus so that documents with no Lazy components\n * (e.g. no operations, tags, or models) still get firstLazyLoadComplete set and the\n * full-viewport placeholder can be hidden. Call from content root on mount.\n */\nexport const scheduleInitialLoadComplete = (): void => {\n if (typeof window === 'undefined') {\n return\n }\n const delay = 400\n window.setTimeout(() => runLazyBus(), delay)\n}\n\n/** When an element is unmounted we remove it from all queues */\nconst resetLazyElement = (id: string) => {\n priorityQueue.delete(id)\n pendingQueue.delete(id)\n readyQueue.delete(id)\n lazyPlaceholderHeights.delete(id)\n}\n\n// ---------------------------------------------------------------------------\n\n/**\n * Tracks the lazy loading state of an element.\n * Use isReady (or expanded) to decide whether to render the slot or show a placeholder.\n * The element is only added to the queue when it enters the viewport overscan (see Lazy.vue).\n */\nexport function useLazyBus(id: string) {\n onBeforeUnmount(() => {\n resetLazyElement(id)\n })\n\n return {\n isReady: computed(() => typeof window === 'undefined' || priorityQueue.has(id) || readyQueue.has(id)),\n }\n}\n\n/**\n * Scroll to a possibly lazy-loaded element. Expands parents and adds target (and\n * parents) to the priority queue, then scrolls after Vue has flushed.\n */\nexport const scrollToLazy = (\n id: string,\n setExpanded: (id: string, value: boolean) => void,\n getEntryById: (id: string) => { id: string; parent?: { id: string }; children?: { id: string }[] } | undefined,\n) => {\n const item = getEntryById(id)\n\n /**\n * If the element is lazy we must freeze the element so that it does not move until after the next lazy bus run\n * If the element never loads then the scroll onFailure callback will be run to unfreeze the element\n *\n * If the readyQueue does not have the item we must freeze it while it renders\n * If the item has lazy children we must freeze the item while the children are (potentially) loaded\n */\n const isLazy = !readyQueue.has(id) || item?.children?.some((child) => !readyQueue.has(child.id))\n\n const unfreeze = isLazy ? freeze(id) : undefined\n addLazyCompleteCallback(unfreeze)\n\n // Disable intersection while we scroll to the element\n const unblock = blockIntersection()\n const { rawId } = getSchemaParamsFromId(id)\n\n // Publish the target so collapsible schema disclosures on the path can open\n // themselves. Schema properties are not in the navigation tree, so this is the\n // only way the scroll target inside a collapsed schema becomes reachable.\n scrollTargetId.value = id\n\n addToPriorityQueue(id)\n addToPriorityQueue(rawId)\n\n // When there are children we ensure the first 2 are loaded\n if (item?.children) {\n item.children.slice(0, 2).forEach((child) => addToPriorityQueue(child.id))\n }\n\n // When there are sibling items we attempt to load the next 2 to better fill the viewport\n if (item?.parent) {\n const parent = getEntryById(item.parent.id)\n const elementIdx = parent?.children?.findIndex((child) => child.id === id)\n if (elementIdx !== undefined && elementIdx >= 0) {\n parent?.children?.slice(elementIdx, elementIdx + 2).forEach((child) => addToPriorityQueue(child.id))\n }\n }\n\n setExpanded(rawId, true)\n /**\n * Recursively expand the parents and set them as a loading priority\n * This ensures all parents will be immediately loaded and open\n */\n const addParents = (currentId: string) => {\n const parent = getEntryById(currentId)?.parent\n if (parent) {\n addToPriorityQueue(parent.id)\n setExpanded(parent.id, true)\n addParents(parent.id)\n }\n }\n /** Must use the rawId as schema params are not in the navigation tree */\n addParents(rawId)\n\n void nextTick(() => {\n tryScroll(id, Date.now() + SCROLL_RETRY_MS, unblock, unfreeze)\n })\n}\n\n/**\n * Tiny wrapper around the scrollIntoView API\n * Retries up to the stopTime in case the element is not yet rendered\n *\n * @param id - The id of the element to scroll to\n * @param stopTime - The time to stop retrying in unix milliseconds\n */\nconst tryScroll = (id: string, stopTime: number, onComplete: UnblockFn, onFailure?: () => void): void => {\n const element = document.getElementById(id)\n if (element) {\n element.scrollIntoView({ block: 'start' })\n clearScrollTarget(id)\n onComplete()\n } else if (Date.now() < stopTime) {\n requestAnimationFrame(() => tryScroll(id, stopTime, onComplete, onFailure))\n } else {\n // If the scroll has expired we enable intersection again\n clearScrollTarget(id)\n onComplete()\n onFailure?.()\n }\n}\n\nconst freeze = (id: string): (() => void) => {\n let stop = false\n\n /**\n * Runs until the stop flag is set\n * Executes the final frame after stop changes to true\n */\n const runFrame = (stopAfterFrame: boolean) => {\n const element = document.getElementById(id)\n if (element) {\n element.scrollIntoView({ block: 'start' })\n }\n if (!stopAfterFrame) {\n requestAnimationFrame(() => runFrame(stop))\n }\n }\n\n runFrame(false)\n\n return () => {\n stop = true\n }\n}\n"],"mappings":";;;;;;;;AASA,IAAM,gBAAgB,yBAAsB,IAAI,IAAI,CAAC;;AAErD,IAAM,eAAe,yBAAsB,IAAI,IAAI,CAAC;;AAEpD,IAAM,aAAa,yBAAsB,IAAI,IAAI,CAAC;;;;;AAKlD,IAAM,YAAY,IAAI,KAAK;;AAG3B,IAAM,kBAAkB;;AAGxB,IAAa,wBAAwB,IAAI,KAAK;;;;;;;;;;AAW9C,IAAa,iBAAiB,IAAY,EAAE;;;;;;AAO5C,IAAM,qBAAqB,OAAqB;CAC9C,IAAI,eAAe,UAAU,IAC3B,eAAe,QAAQ;AAE3B;;AAGA,IAAM,uBAAuB,yBAAsB,IAAI,I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W;EACX,YAAY;CACd;AACF;AAEA,IAAM,UAAU,OAA6B;CAC3C,IAAI,OAAO;;;;;CAMX,MAAM,YAAY,mBAA4B;EAC5C,MAAM,UAAU,SAAS,eAAe,EAAE;EAC1C,IAAI,SACF,QAAQ,eAAe,EAAE,OAAO,QAAQ,CAAC;EAE3C,IAAI,CAAC,gBACH,4BAA4B,SAAS,IAAI,CAAC;CAE9C;CAEA,SAAS,KAAK;CAEd,aAAa;EACX,OAAO;CACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"load-from-perssistance.js","names":[],"sources":["../../src/helpers/load-from-perssistance.ts"],"sourcesContent":["import { isSelectedClient } from '@scalar/blocks/code-example'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\n\nimport { authStorage, clientStorage } from '@/helpers/storage'\n\n/**\n * Loads the default HTTP client from storage and applies it to the workspace.\n * Only updates if no default client is already set. Accepts both built-in client\n * ids and custom sample ids (e.g. `custom/python`) so a custom selection persists.\n */\nexport const loadClientFromStorage = (store: WorkspaceStore): void => {\n const storedClient = clientStorage().get()\n\n if (isSelectedClient(storedClient) && !store.workspace['x-scalar-default-client']) {\n store.update('x-scalar-default-client', storedClient)\n }\n}\n\n/**\n * Loads the authentication data from storage and applies it to the workspace.\n * Only updates if no authentication data is already set.\n */\nexport const loadAuthFromStorage = (store: WorkspaceStore, slug: string): void => {\n const authPersistence = authStorage()\n const auth = authPersistence.getAuth(slug)\n store.auth.load({ [slug]: auth })\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,yBAAyB,UAAgC;CACpE,MAAM,eAAe,eAAe,CAAC,KAAK;AAE1C,KAAI,iBAAiB,aAAa,IAAI,CAAC,MAAM,UAAU,2BACrD,OAAM,OAAO,2BAA2B,aAAa;;;;;;AAQzD,IAAa,uBAAuB,OAAuB,SAAuB;CAEhF,MAAM,OADkB,aAAa,CACR,QAAQ,KAAK;AAC1C,OAAM,KAAK,KAAK,GAAG,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"load-from-perssistance.js","names":[],"sources":["../../src/helpers/load-from-perssistance.ts"],"sourcesContent":["import { isSelectedClient } from '@scalar/blocks/code-example'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\n\nimport { authStorage, clientStorage } from '@/helpers/storage'\n\n/**\n * Loads the default HTTP client from storage and applies it to the workspace.\n * Only updates if no default client is already set. Accepts both built-in client\n * ids and custom sample ids (e.g. `custom/python`) so a custom selection persists.\n */\nexport const loadClientFromStorage = (store: WorkspaceStore): void => {\n const storedClient = clientStorage().get()\n\n if (isSelectedClient(storedClient) && !store.workspace['x-scalar-default-client']) {\n store.update('x-scalar-default-client', storedClient)\n }\n}\n\n/**\n * Loads the authentication data from storage and applies it to the workspace.\n * Only updates if no authentication data is already set.\n */\nexport const loadAuthFromStorage = (store: WorkspaceStore, slug: string): void => {\n const authPersistence = authStorage()\n const auth = authPersistence.getAuth(slug)\n store.auth.load({ [slug]: auth })\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,yBAAyB,UAAgC;CACpE,MAAM,eAAe,cAAc,CAAC,CAAC,IAAI;CAEzC,IAAI,iBAAiB,YAAY,KAAK,CAAC,MAAM,UAAU,4BACrD,MAAM,OAAO,2BAA2B,YAAY;AAExD;;;;;AAMA,IAAa,uBAAuB,OAAuB,SAAuB;CAEhF,MAAM,OADkB,YACX,CAAA,CAAgB,QAAQ,IAAI;CACzC,MAAM,KAAK,KAAK,GAAG,OAAO,KAAK,CAAC;AAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"map-config-plugins.js","names":[],"sources":["../../src/helpers/map-config-plugins.ts"],"sourcesContent":["import { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { buildRequest, getEnvironmentVariables } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { type ComputedRef, watch } from 'vue'\n\n/**\n * Maps API reference configuration callbacks to client plugins.\n *\n * This function transforms the onBeforeRequest, onRequestBuilt, and onRequestSent\n * callbacks into the new plugin hook system. The mapping is reactive, so changes\n * to the configuration will automatically update the plugin hooks.\n *\n * Note: onRequestBuilt is mapped to the requestBuilt hook so the callback receives\n * the exact fetch Request that is sent over the wire. Mutating its headers modifies\n * the outgoing request, and hashing its body produces a hash that matches what the\n * server receives (a rebuilt multipart body would get a different boundary).\n *\n * Note: onRequestSent is mapped to responseReceived hook. This is not a perfect\n * one-to-one mapping, but it maintains backward compatibility with the old API.\n * The old callback receives only the URL string, while the new hook receives\n * the full response object.\n *\n * @param config - Reactive configuration object containing optional hook callbacks\n * @returns Array containing a single plugin with the mapped hooks\n */\nexport const mapConfigPlugins = (\n config: ComputedRef<ApiReferenceConfiguration>,\n environment: ComputedRef<XScalarEnvironment>,\n): ClientPlugin[] => {\n // Create a new plugin with the hooks which is going to be updated by the watcher when config changes\n const plugin: ClientPlugin = { hooks: {} }\n\n watch(\n [\n () => config.value.onBeforeRequest,\n () => config.value.onRequestBuilt,\n () => config.value.onRequestSent,\n () => environment.value,\n ],\n ([onBeforeRequest, onRequestBuilt, onRequestSent, environment]) => {\n // Get the environment variables for the current environment\n const envVariables = getEnvironmentVariables(environment)\n\n // Initialize the hooks object if it doesn't exist\n if (!plugin.hooks) {\n plugin.hooks = {}\n }\n\n plugin.hooks.beforeRequest = onBeforeRequest\n ? async (payload) => {\n const built = buildRequest(payload.requestBuilder, {\n envVariables,\n allowMissingRequestServerBase: true,\n })\n if (!built.ok) {\n console.error(\n '[@scalar/api-reference] onBeforeRequest was not run because the request could not be built:',\n built.message ?? built.error,\n )\n return\n }\n await onBeforeRequest({\n // We need to build the request to get the fetch `Request`\n request: buildSafeBodyRequest(...built.data.requestPayload),\n requestBuilder: payload.requestBuilder,\n envVariables,\n })\n }\n : undefined\n\n /**\n * Maps onRequestBuilt to the requestBuilt hook. The payload request is the\n * exact fetch Request that will be sent, so header mutations apply and body\n * hashes match what goes over the wire.\n */\n plugin.hooks.requestBuilt = onRequestBuilt\n ? async (payload) => {\n await onRequestBuilt({\n request: payload.request,\n requestBuilder: payload.requestBuilder,\n envVariables,\n })\n }\n : undefined\n\n /**\n * Maps onRequestSent to responseReceived hook.\n * The old API only passed the URL string, so we extract it from the request.\n */\n plugin.hooks.responseReceived = onRequestSent\n ? (payload) => {\n onRequestSent(payload.request.url)\n }\n : undefined\n },\n { immediate: true },\n )\n\n return [plugin]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAa,oBACX,QACA,gBACmB;CAEnB,MAAM,SAAuB,EAAE,OAAO,EAAE,EAAE;AAE1C,OACE;QACQ,OAAO,MAAM;QACb,OAAO,MAAM;QACb,OAAO,MAAM;QACb,YAAY;EACnB,GACA,CAAC,iBAAiB,gBAAgB,eAAe,iBAAiB;EAEjE,MAAM,eAAe,wBAAwB,YAAY;AAGzD,MAAI,CAAC,OAAO,MACV,QAAO,QAAQ,EAAE;AAGnB,SAAO,MAAM,gBAAgB,kBACzB,OAAO,YAAY;GACjB,MAAM,QAAQ,aAAa,QAAQ,gBAAgB;IACjD;IACA,+BAA+B;IAChC,CAAC;AACF,OAAI,CAAC,MAAM,IAAI;AACb,YAAQ,MACN,+FACA,MAAM,WAAW,MAAM,MACxB;AACD;;AAEF,SAAM,gBAAgB;IAEpB,SAAS,qBAAqB,GAAG,MAAM,KAAK,eAAe;IAC3D,gBAAgB,QAAQ;IACxB;IACD,CAAC;MAEJ,KAAA;;;;;;AAOJ,SAAO,MAAM,eAAe,iBACxB,OAAO,YAAY;AACjB,SAAM,eAAe;IACnB,SAAS,QAAQ;IACjB,gBAAgB,QAAQ;IACxB;IACD,CAAC;MAEJ,KAAA;;;;;AAMJ,SAAO,MAAM,mBAAmB,iBAC3B,YAAY;AACX,iBAAc,QAAQ,QAAQ,IAAI;MAEpC,KAAA;IAEN,EAAE,WAAW,MAAM,CACpB;AAED,QAAO,CAAC,OAAO"}
1
+ {"version":3,"file":"map-config-plugins.js","names":[],"sources":["../../src/helpers/map-config-plugins.ts"],"sourcesContent":["import { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\nimport { buildRequest, getEnvironmentVariables } from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { type ComputedRef, watch } from 'vue'\n\n/**\n * Maps API reference configuration callbacks to client plugins.\n *\n * This function transforms the onBeforeRequest, onRequestBuilt, and onRequestSent\n * callbacks into the new plugin hook system. The mapping is reactive, so changes\n * to the configuration will automatically update the plugin hooks.\n *\n * Note: onRequestBuilt is mapped to the requestBuilt hook so the callback receives\n * the exact fetch Request that is sent over the wire. Mutating its headers modifies\n * the outgoing request, and hashing its body produces a hash that matches what the\n * server receives (a rebuilt multipart body would get a different boundary).\n *\n * Note: onRequestSent is mapped to responseReceived hook. This is not a perfect\n * one-to-one mapping, but it maintains backward compatibility with the old API.\n * The old callback receives only the URL string, while the new hook receives\n * the full response object.\n *\n * @param config - Reactive configuration object containing optional hook callbacks\n * @returns Array containing a single plugin with the mapped hooks\n */\nexport const mapConfigPlugins = (\n config: ComputedRef<ApiReferenceConfiguration>,\n environment: ComputedRef<XScalarEnvironment>,\n): ClientPlugin[] => {\n // Create a new plugin with the hooks which is going to be updated by the watcher when config changes\n const plugin: ClientPlugin = { hooks: {} }\n\n watch(\n [\n () => config.value.onBeforeRequest,\n () => config.value.onRequestBuilt,\n () => config.value.onRequestSent,\n () => environment.value,\n ],\n ([onBeforeRequest, onRequestBuilt, onRequestSent, environment]) => {\n // Get the environment variables for the current environment\n const envVariables = getEnvironmentVariables(environment)\n\n // Initialize the hooks object if it doesn't exist\n if (!plugin.hooks) {\n plugin.hooks = {}\n }\n\n plugin.hooks.beforeRequest = onBeforeRequest\n ? async (payload) => {\n const built = buildRequest(payload.requestBuilder, {\n envVariables,\n allowMissingRequestServerBase: true,\n })\n if (!built.ok) {\n console.error(\n '[@scalar/api-reference] onBeforeRequest was not run because the request could not be built:',\n built.message ?? built.error,\n )\n return\n }\n await onBeforeRequest({\n // We need to build the request to get the fetch `Request`\n request: buildSafeBodyRequest(...built.data.requestPayload),\n requestBuilder: payload.requestBuilder,\n envVariables,\n })\n }\n : undefined\n\n /**\n * Maps onRequestBuilt to the requestBuilt hook. The payload request is the\n * exact fetch Request that will be sent, so header mutations apply and body\n * hashes match what goes over the wire.\n */\n plugin.hooks.requestBuilt = onRequestBuilt\n ? async (payload) => {\n await onRequestBuilt({\n request: payload.request,\n requestBuilder: payload.requestBuilder,\n envVariables,\n })\n }\n : undefined\n\n /**\n * Maps onRequestSent to responseReceived hook.\n * The old API only passed the URL string, so we extract it from the request.\n */\n plugin.hooks.responseReceived = onRequestSent\n ? (payload) => {\n onRequestSent(payload.request.url)\n }\n : undefined\n },\n { immediate: true },\n )\n\n return [plugin]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAa,oBACX,QACA,gBACmB;CAEnB,MAAM,SAAuB,EAAE,OAAO,CAAC,EAAE;CAEzC,MACE;QACQ,OAAO,MAAM;QACb,OAAO,MAAM;QACb,OAAO,MAAM;QACb,YAAY;CACpB,IACC,CAAC,iBAAiB,gBAAgB,eAAe,iBAAiB;EAEjE,MAAM,eAAe,wBAAwB,WAAW;EAGxD,IAAI,CAAC,OAAO,OACV,OAAO,QAAQ,CAAC;EAGlB,OAAO,MAAM,gBAAgB,kBACzB,OAAO,YAAY;GACjB,MAAM,QAAQ,aAAa,QAAQ,gBAAgB;IACjD;IACA,+BAA+B;GACjC,CAAC;GACD,IAAI,CAAC,MAAM,IAAI;IACb,QAAQ,MACN,+FACA,MAAM,WAAW,MAAM,KACzB;IACA;GACF;GACA,MAAM,gBAAgB;IAEpB,SAAS,qBAAqB,GAAG,MAAM,KAAK,cAAc;IAC1D,gBAAgB,QAAQ;IACxB;GACF,CAAC;EACH,IACA,KAAA;;;;;;EAOJ,OAAO,MAAM,eAAe,iBACxB,OAAO,YAAY;GACjB,MAAM,eAAe;IACnB,SAAS,QAAQ;IACjB,gBAAgB,QAAQ;IACxB;GACF,CAAC;EACH,IACA,KAAA;;;;;EAMJ,OAAO,MAAM,mBAAmB,iBAC3B,YAAY;GACX,cAAc,QAAQ,QAAQ,GAAG;EACnC,IACA,KAAA;CACN,GACA,EAAE,WAAW,KAAK,CACpB;CAEA,OAAO,CAAC,MAAM;AAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"map-config-to-workspace-store.js","names":[],"sources":["../../src/helpers/map-config-to-workspace-store.ts"],"sourcesContent":["import { isClient } from '@scalar/blocks/code-example'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { useSeoMeta } from '@unhead/vue'\nimport { useFavicon } from '@vueuse/core'\nimport { type MaybeRefOrGetter, type Ref, computed, toValue, watch } from 'vue'\n\nexport const mapConfigToWorkspaceStore = ({\n config,\n store,\n isDarkMode,\n}: {\n config: MaybeRefOrGetter<ApiReferenceConfigurationRaw>\n store: WorkspaceStore\n isDarkMode: Ref<boolean>\n}) => {\n // Update the workspace store if default client changes\n watch(\n () => toValue(config).defaultHttpClient,\n (newValue) => {\n if (newValue) {\n const { targetKey, clientKey } = newValue\n\n const clientId = `${targetKey}/${clientKey}`\n if (isClient(clientId)) {\n store.update('x-scalar-default-client', clientId)\n }\n }\n },\n { immediate: true },\n )\n\n /** Update the dark mode state when props change */\n watch(\n () => toValue(config).darkMode,\n (isDark) => store.update('x-scalar-color-mode', isDark ? 'dark' : 'light'),\n )\n\n // Temporary mapping of isDarkMode until we update the standalone component\n watch(\n () => isDarkMode.value,\n (newIsDark) => store.update('x-scalar-color-mode', newIsDark ? 'dark' : 'light'),\n { immediate: true },\n )\n\n if (toValue(config).metaData) {\n useSeoMeta(toValue(config).metaData)\n }\n\n // Update the active proxy when the proxyUrl changes\n watch(\n () => toValue(config).proxyUrl,\n (newProxyUrl) => store.update('x-scalar-active-proxy', newProxyUrl),\n { immediate: true },\n )\n\n const favicon = computed(() => toValue(config).favicon)\n useFavicon(favicon)\n}\n"],"mappings":";;;;;AAOA,IAAa,6BAA6B,EACxC,QACA,OACA,iBAKI;AAEJ,aACQ,QAAQ,OAAO,CAAC,oBACrB,aAAa;AACZ,MAAI,UAAU;GACZ,MAAM,EAAE,WAAW,cAAc;GAEjC,MAAM,WAAW,GAAG,UAAU,GAAG;AACjC,OAAI,SAAS,SAAS,CACpB,OAAM,OAAO,2BAA2B,SAAS;;IAIvD,EAAE,WAAW,MAAM,CACpB;;AAGD,aACQ,QAAQ,OAAO,CAAC,WACrB,WAAW,MAAM,OAAO,uBAAuB,SAAS,SAAS,QAAQ,CAC3E;AAGD,aACQ,WAAW,QAChB,cAAc,MAAM,OAAO,uBAAuB,YAAY,SAAS,QAAQ,EAChF,EAAE,WAAW,MAAM,CACpB;AAED,KAAI,QAAQ,OAAO,CAAC,SAClB,YAAW,QAAQ,OAAO,CAAC,SAAS;AAItC,aACQ,QAAQ,OAAO,CAAC,WACrB,gBAAgB,MAAM,OAAO,yBAAyB,YAAY,EACnE,EAAE,WAAW,MAAM,CACpB;AAGD,YADgB,eAAe,QAAQ,OAAO,CAAC,QAAQ,CACpC"}
1
+ {"version":3,"file":"map-config-to-workspace-store.js","names":[],"sources":["../../src/helpers/map-config-to-workspace-store.ts"],"sourcesContent":["import { isClient } from '@scalar/blocks/code-example'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { useSeoMeta } from '@unhead/vue'\nimport { useFavicon } from '@vueuse/core'\nimport { type MaybeRefOrGetter, type Ref, computed, toValue, watch } from 'vue'\n\nexport const mapConfigToWorkspaceStore = ({\n config,\n store,\n isDarkMode,\n}: {\n config: MaybeRefOrGetter<ApiReferenceConfigurationRaw>\n store: WorkspaceStore\n isDarkMode: Ref<boolean>\n}) => {\n // Update the workspace store if default client changes\n watch(\n () => toValue(config).defaultHttpClient,\n (newValue) => {\n if (newValue) {\n const { targetKey, clientKey } = newValue\n\n const clientId = `${targetKey}/${clientKey}`\n if (isClient(clientId)) {\n store.update('x-scalar-default-client', clientId)\n }\n }\n },\n { immediate: true },\n )\n\n /** Update the dark mode state when props change */\n watch(\n () => toValue(config).darkMode,\n (isDark) => store.update('x-scalar-color-mode', isDark ? 'dark' : 'light'),\n )\n\n // Temporary mapping of isDarkMode until we update the standalone component\n watch(\n () => isDarkMode.value,\n (newIsDark) => store.update('x-scalar-color-mode', newIsDark ? 'dark' : 'light'),\n { immediate: true },\n )\n\n if (toValue(config).metaData) {\n useSeoMeta(toValue(config).metaData)\n }\n\n // Update the active proxy when the proxyUrl changes\n watch(\n () => toValue(config).proxyUrl,\n (newProxyUrl) => store.update('x-scalar-active-proxy', newProxyUrl),\n { immediate: true },\n )\n\n const favicon = computed(() => toValue(config).favicon)\n useFavicon(favicon)\n}\n"],"mappings":";;;;;AAOA,IAAa,6BAA6B,EACxC,QACA,OACA,iBAKI;CAEJ,YACQ,QAAQ,MAAM,CAAC,CAAC,oBACrB,aAAa;EACZ,IAAI,UAAU;GACZ,MAAM,EAAE,WAAW,cAAc;GAEjC,MAAM,WAAW,GAAG,UAAU,GAAG;GACjC,IAAI,SAAS,QAAQ,GACnB,MAAM,OAAO,2BAA2B,QAAQ;EAEpD;CACF,GACA,EAAE,WAAW,KAAK,CACpB;;CAGA,YACQ,QAAQ,MAAM,CAAC,CAAC,WACrB,WAAW,MAAM,OAAO,uBAAuB,SAAS,SAAS,OAAO,CAC3E;CAGA,YACQ,WAAW,QAChB,cAAc,MAAM,OAAO,uBAAuB,YAAY,SAAS,OAAO,GAC/E,EAAE,WAAW,KAAK,CACpB;CAEA,IAAI,QAAQ,MAAM,CAAC,CAAC,UAClB,WAAW,QAAQ,MAAM,CAAC,CAAC,QAAQ;CAIrC,YACQ,QAAQ,MAAM,CAAC,CAAC,WACrB,gBAAgB,MAAM,OAAO,yBAAyB,WAAW,GAClE,EAAE,WAAW,KAAK,CACpB;CAGA,WADgB,eAAe,QAAQ,MAAM,CAAC,CAAC,OACpC,CAAO;AACpB"}
@@ -61,6 +61,6 @@ var addSlugAndTitle = (source, index = 0, slug) => {
61
61
  };
62
62
  };
63
63
  //#endregion
64
- export { normalizeConfigurations };
64
+ export { normalizeConfigurations, normalizeContent };
65
65
 
66
66
  //# sourceMappingURL=normalize-configurations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-configurations.js","names":[],"sources":["../../src/helpers/normalize-configurations.ts"],"sourcesContent":["import { slugger } from '@scalar/helpers/string/slugger'\nimport { parseJsonOrYaml } from '@scalar/oas-utils/helpers'\nimport { apiReferenceConfigurationWithSourceSchema } from '@scalar/schemas/api-reference'\nimport {\n type AnyApiReferenceConfiguration,\n type ApiReferenceConfigurationRaw,\n type ApiReferenceConfigurationWithSource,\n isConfigurationWithSources,\n} from '@scalar/types/api-reference'\n\n/** Processed API Reference Configuration\n *\n * Creates the required title and slug for the API Reference.\n * Separate the source into a dedicated object\n * Returns the raw configuration to pass to components\n */\nexport type NormalizedConfiguration = {\n title: string\n slug: string\n config: ApiReferenceConfigurationRaw\n default: boolean\n agent: ApiReferenceConfigurationWithSource['agent']\n source: { url: string; content?: never } | { content: Record<string, unknown>; url?: never }\n}\n\ntype NormalizedConfigurations = Record<string, NormalizedConfiguration>\n\ntype ConfigWithRequiredSource = Omit<ApiReferenceConfigurationWithSource, 'url' | 'content'> &\n ({ url: string; content?: never } | { content: Record<string, unknown>; url?: never })\n\nconst isConfigWithRequiredSource = (input: ApiReferenceConfigurationWithSource): input is ConfigWithRequiredSource => {\n return !!input.url?.trim() || !!input.content\n}\n\n/**\n * Take any configuration and return a flat array of configurations.\n */\nexport const normalizeConfigurations = (\n configuration: AnyApiReferenceConfiguration | undefined,\n): NormalizedConfigurations => {\n const { slug } = slugger()\n\n const normalized: NormalizedConfigurations = {}\n\n if (!configuration) {\n return normalized\n }\n\n const configList = Array.isArray(configuration) ? configuration : [configuration]\n\n configList\n /** Create a flat array of configurations with their document source data integrated. */\n .flatMap((c) => {\n // Check if this config has a 'sources' array property\n if (isConfigurationWithSources(c)) {\n // Destructure to separate sources array from other config properties\n const { sources: configSources, ...rest } = c\n\n // For each source in the array:\n // - Merge the source with the parent config properties\n // - Handle undefined sources by returning empty array via ?? []\n return configSources?.map((source) => ({ ...rest, ...source })) ?? []\n }\n\n // If config doesn't have sources array, treat the config itself as a source\n return [c]\n })\n .map((source) => apiReferenceConfigurationWithSourceSchema(source) as ApiReferenceConfigurationWithSource)\n /** Filter out configurations that failed validation or don't have a url or content */\n .filter(isConfigWithRequiredSource)\n /** Add required attributes to the source */\n .map((source, index) => addSlugAndTitle(source, index, slug))\n /** Separate the configuration and sources by slug */\n .forEach((c) => {\n const { url, content, ...config } = c\n normalized[c.slug] = {\n config,\n title: c.title,\n slug: c.slug,\n default: !!c?.default,\n agent: c.agent,\n source: content ? { content: normalizeContent(content) ?? {} } : { url },\n }\n })\n\n // Process them and return normalized\n return normalized\n}\n\n/** Normalize content into a JS object or return null if it is falsey */\nexport const normalizeContent = (\n content: string | Record<string, unknown> | (() => string | Record<string, unknown>),\n): Record<string, unknown> | null => {\n if (!content) {\n return null\n }\n\n if (typeof content === 'function') {\n return normalizeContent(content())\n }\n\n if (typeof content === 'string') {\n return parseJsonOrYaml(content)\n }\n\n return content\n}\n\n/** Process a single spec configuration so that it has a title and a slug */\nconst addSlugAndTitle = (\n source: ConfigWithRequiredSource,\n index = 0,\n slug: (v: string) => string,\n): ConfigWithRequiredSource & { slug: string; title: string } => {\n // Case 1: Title exists, generate slug from it\n if (source.title) {\n return {\n ...source,\n slug: source.slug || slug(source.title),\n title: source.title,\n }\n }\n\n // Case 2: Slug exists but no title, use slug as title\n if (source.slug) {\n return {\n ...source,\n slug: slug(source.slug),\n title: source.slug,\n }\n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GAAG;EACH,MAAM,OAAO,QAAQ,KAAK,OAAO,MAAM;EACvC,OAAO,OAAO;EACf;AAIH,KAAI,OAAO,KACT,QAAO;EACL,GAAG;EACH,MAAM,KAAK,OAAO,KAAK;EACvB,OAAO,OAAO;EACf;AAIH,QAAO;EACL,GAAG;EACH,MAAM,OAAO,QAAQ;EACrB,OAAO,QAAQ,QAAQ;EACxB"}
1
+ {"version":3,"file":"normalize-configurations.js","names":[],"sources":["../../src/helpers/normalize-configurations.ts"],"sourcesContent":["import { slugger } from '@scalar/helpers/string/slugger'\nimport { parseJsonOrYaml } from '@scalar/oas-utils/helpers'\nimport { apiReferenceConfigurationWithSourceSchema } from '@scalar/schemas/api-reference'\nimport {\n type AnyApiReferenceConfiguration,\n type ApiReferenceConfigurationRaw,\n type ApiReferenceConfigurationWithSource,\n isConfigurationWithSources,\n} from '@scalar/types/api-reference'\n\n/** Processed API Reference Configuration\n *\n * Creates the required title and slug for the API Reference.\n * Separate the source into a dedicated object\n * Returns the raw configuration to pass to components\n */\nexport type NormalizedConfiguration = {\n title: string\n slug: string\n config: ApiReferenceConfigurationRaw\n default: boolean\n agent: ApiReferenceConfigurationWithSource['agent']\n source: { url: string; content?: never } | { content: Record<string, unknown>; url?: never }\n}\n\ntype NormalizedConfigurations = Record<string, NormalizedConfiguration>\n\ntype ConfigWithRequiredSource = Omit<ApiReferenceConfigurationWithSource, 'url' | 'content'> &\n ({ url: string; content?: never } | { content: Record<string, unknown>; url?: never })\n\nconst isConfigWithRequiredSource = (input: ApiReferenceConfigurationWithSource): input is ConfigWithRequiredSource => {\n return !!input.url?.trim() || !!input.content\n}\n\n/**\n * Take any configuration and return a flat array of configurations.\n */\nexport const normalizeConfigurations = (\n configuration: AnyApiReferenceConfiguration | undefined,\n): NormalizedConfigurations => {\n const { slug } = slugger()\n\n const normalized: NormalizedConfigurations = {}\n\n if (!configuration) {\n return normalized\n }\n\n const configList = Array.isArray(configuration) ? configuration : [configuration]\n\n configList\n /** Create a flat array of configurations with their document source data integrated. */\n .flatMap((c) => {\n // Check if this config has a 'sources' array property\n if (isConfigurationWithSources(c)) {\n // Destructure to separate sources array from other config properties\n const { sources: configSources, ...rest } = c\n\n // For each source in the array:\n // - Merge the source with the parent config properties\n // - Handle undefined sources by returning empty array via ?? []\n return configSources?.map((source) => ({ ...rest, ...source })) ?? []\n }\n\n // If config doesn't have sources array, treat the config itself as a source\n return [c]\n })\n .map((source) => apiReferenceConfigurationWithSourceSchema(source) as ApiReferenceConfigurationWithSource)\n /** Filter out configurations that failed validation or don't have a url or content */\n .filter(isConfigWithRequiredSource)\n /** Add required attributes to the source */\n .map((source, index) => addSlugAndTitle(source, index, slug))\n /** Separate the configuration and sources by slug */\n .forEach((c) => {\n const { url, content, ...config } = c\n normalized[c.slug] = {\n config,\n title: c.title,\n slug: c.slug,\n default: !!c?.default,\n agent: c.agent,\n source: content ? { content: normalizeContent(content) ?? {} } : { url },\n }\n })\n\n // Process them and return normalized\n return normalized\n}\n\n/** Normalize content into a JS object or return null if it is falsey */\nexport const normalizeContent = (\n content: string | Record<string, unknown> | (() => string | Record<string, unknown>),\n): Record<string, unknown> | null => {\n if (!content) {\n return null\n }\n\n if (typeof content === 'function') {\n return normalizeContent(content())\n }\n\n if (typeof content === 'string') {\n return parseJsonOrYaml(content)\n }\n\n return content\n}\n\n/** Process a single spec configuration so that it has a title and a slug */\nconst addSlugAndTitle = (\n source: ConfigWithRequiredSource,\n index = 0,\n slug: (v: string) => string,\n): ConfigWithRequiredSource & { slug: string; title: string } => {\n // Case 1: Title exists, generate slug from it\n if (source.title) {\n return {\n ...source,\n slug: source.slug || slug(source.title),\n title: source.title,\n }\n }\n\n // Case 2: Slug exists but no title, use slug as title\n if (source.slug) {\n return {\n ...source,\n slug: slug(source.slug),\n title: source.slug,\n }\n }\n\n // Case 3: Neither exists, use index\n return {\n ...source,\n slug: `api-${index + 1}`,\n title: `API #${index + 1}`,\n }\n}\n"],"mappings":";;;;;AA8BA,IAAM,8BAA8B,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O;CAChB;CAIF,IAAI,OAAO,MACT,OAAO;EACL,GAAG;EACH,MAAM,KAAK,OAAO,IAAI;EACtB,OAAO,OAAO;CAChB;CAIF,OAAO;EACL,GAAG;EACH,MAAM,OAAO,QAAQ;EACrB,OAAO,QAAQ,QAAQ;CACzB;AACF"}
@@ -37,7 +37,12 @@ export declare function extractSchemaFieldNames(schema: SchemaObject | undefined
37
37
  */
38
38
  export declare function extractSchemaDescriptions(schema: SchemaObject | undefined): string[];
39
39
  /**
40
- * Deep merge for objects
40
+ * Deep merge for objects.
41
+ *
42
+ * OpenAPI documents are untrusted input and can carry keys like `__proto__`, `constructor`, or
43
+ * `prototype` (a schema is free to describe a property named `constructor`). Those keys are merged
44
+ * as ordinary own data, so nothing is silently dropped, but the merge never writes through the
45
+ * prototype chain, which would otherwise pollute `Object.prototype` for every object on the page.
41
46
  */
42
47
  export declare function deepMerge(source: Record<any, any>, target: Record<any, any>): Record<any, any>;
43
48
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/helpers/openapi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,EAEb,MAAM,8DAA8D,CAAA;AAmFrE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,aAAa,CAAC,eAAe,CAAC,EAAE,GAAG,MAAM,EAAE,CAS5F;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,aAAa,CAAC,eAAe,CAAC,EAAE,GAAG,MAAM,EAAE,CASnG;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,EAAE,CAQ1E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,EAAE,CAU5E;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EA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,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAe9F;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,mBA4BvF"}
@@ -65,7 +65,8 @@ function forEachRequestBodyProperty(operation, visit) {
65
65
  function extractParameterNames(parameters) {
66
66
  const names = [];
67
67
  parameters.forEach((parameter) => {
68
- pushUnique(names, getResolvedRef(parameter)?.name);
68
+ const resolved = getResolvedRef(parameter);
69
+ pushUnique(names, resolved?.name);
69
70
  });
70
71
  return names;
71
72
  }
@@ -77,7 +78,8 @@ function extractParameterNames(parameters) {
77
78
  function extractParameterDescriptions(parameters) {
78
79
  const descriptions = [];
79
80
  parameters.forEach((parameter) => {
80
- pushUnique(descriptions, getResolvedRef(parameter)?.description);
81
+ const resolved = getResolvedRef(parameter);
82
+ pushUnique(descriptions, resolved?.description);
81
83
  });
82
84
  return descriptions;
83
85
  }
@@ -134,13 +136,42 @@ function extractSchemaDescriptions(schema) {
134
136
  return descriptions;
135
137
  }
136
138
  /**
137
- * Deep merge for objects
139
+ * Assigns a value as an ordinary own, enumerable data property.
140
+ *
141
+ * `target.__proto__ = value` runs the prototype setter instead of creating a property, so a
142
+ * document with a `__proto__` key could otherwise change the prototype of the merged object.
143
+ * Defining the property explicitly keeps a key with that name as plain data.
144
+ */
145
+ var defineOwnProperty = (target, key, value) => {
146
+ if (key === "__proto__") Object.defineProperty(target, key, {
147
+ value,
148
+ writable: true,
149
+ enumerable: true,
150
+ configurable: true
151
+ });
152
+ else target[key] = value;
153
+ };
154
+ /**
155
+ * Whether `target` already has its own mergeable object under `key`.
156
+ *
157
+ * Only an own object is a safe merge target. Reaching an inherited property — every object inherits
158
+ * `constructor`, and `__proto__` resolves to an accessor on `Object.prototype` — would let a
159
+ * document walk up to `Object.prototype` and add a property to every object on the page.
160
+ */
161
+ var hasOwnObject = (target, key) => Object.hasOwn(target, key) && target[key] !== null && typeof target[key] === "object";
162
+ /**
163
+ * Deep merge for objects.
164
+ *
165
+ * OpenAPI documents are untrusted input and can carry keys like `__proto__`, `constructor`, or
166
+ * `prototype` (a schema is free to describe a property named `constructor`). Those keys are merged
167
+ * as ordinary own data, so nothing is silently dropped, but the merge never writes through the
168
+ * prototype chain, which would otherwise pollute `Object.prototype` for every object on the page.
138
169
  */
139
170
  function deepMerge(source, target) {
140
171
  for (const [key, val] of Object.entries(source)) if (val !== null && typeof val === "object") {
141
- target[key] ??= new val.__proto__.constructor();
172
+ if (!hasOwnObject(target, key)) defineOwnProperty(target, key, Array.isArray(val) ? [] : {});
142
173
  deepMerge(val, target[key]);
143
- } else if (typeof val !== "undefined") target[key] = val;
174
+ } else if (typeof val !== "undefined") defineOwnProperty(target, key, val);
144
175
  return target;
145
176
  }
146
177
  /**
@@ -170,6 +201,6 @@ function createEmptySpecification(partialSpecification) {
170
201
  return emptySpecification;
171
202
  }
172
203
  //#endregion
173
- export { createEmptySpecification, extractBodyDescriptions, extractBodyFieldNames, extractParameterDescriptions, extractParameterNames, extractSchemaDescriptions, extractSchemaFieldNames };
204
+ export { createEmptySpecification, deepMerge, extractBodyDescriptions, extractBodyFieldNames, extractParameterDescriptions, extractParameterNames, extractSchemaDescriptions, extractSchemaFieldNames };
174
205
 
175
206
  //# sourceMappingURL=openapi.js.map