@scalar/api-reference 1.64.0 → 1.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/AsyncApiServerSelector.vue.script.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js +1 -1
- package/dist/blocks/scalar-asyncapi-server-selector-block/components/Selector.vue.script.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js +2 -2
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/AsyncApiSidebarFilters.vue.script.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/components/SidebarFilter.vue.script.js.map +1 -1
- package/dist/blocks/scalar-asyncapi-sidebar-filters-block/helpers/filter-async-api-navigation.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +1 -3
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js +13 -27
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +37 -25
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -1
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +10 -4
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/IntroductionLoading.vue.script.js.map +1 -1
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js +1 -1
- package/dist/blocks/scalar-info-block/components/SpecificationVersion.vue.script.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js +16 -9
- package/dist/blocks/scalar-sdk-installation-instructions/components/SdkInstallationInstructions.vue.script.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/helpers/language-icon.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/helpers/renderable-sdks.js.map +1 -1
- package/dist/blocks/scalar-sdk-installation-instructions/helpers/visible-tab-count.js.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js +1 -1
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts.map +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +1 -1
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -1
- package/dist/browser/chunks/AgentScalarChatInterface-2lNB6wO-.js +27 -0
- package/dist/browser/chunks/ScalarTextInput.vue-DVmXRWbS.js +27 -0
- package/dist/browser/chunks/{basic-shape-diamond.svg-BTEOT1FL.js → basic-shape-diamond.svg-o5eiY2I7.js} +2 -2
- package/dist/browser/chunks/{basic-shape-hexagon.svg-BSPzaCgF.js → basic-shape-hexagon.svg-CGuS7mbd.js} +2 -2
- package/dist/browser/chunks/{basic-shape-primary-circle-ellipse-round.svg-DKmZ8UUU.js → basic-shape-primary-circle-ellipse-round.svg-DDIpXiBm.js} +2 -2
- package/dist/browser/chunks/{basic-shape-primary-square-rectangle.svg-n2YRykHD.js → basic-shape-primary-square-rectangle.svg-DzVEJHMB.js} +2 -2
- package/dist/browser/chunks/{basic-shape-shield.svg-Bec9cJDA.js → basic-shape-shield.svg-BZzapRqv.js} +2 -2
- package/dist/browser/chunks/browser-CTPPEMEL.js +129 -0
- package/dist/browser/chunks/{computer-device-desktop-monitor.svg-m6j893Hb.js → computer-device-desktop-monitor.svg-OSM05r1I.js} +2 -2
- package/dist/browser/chunks/{computer-device-desktop.svg-Dk1VVO7k.js → computer-device-desktop.svg-BMFzGZ27.js} +2 -2
- package/dist/browser/chunks/{computer-device-laptop.svg-BNGVUCYS.js → computer-device-laptop.svg-CMAjzuB-.js} +2 -2
- 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
- package/dist/browser/chunks/{computer-device-mobile-phone-android-samsung.svg-D8ExpMpL.js → computer-device-mobile-phone-android-samsung.svg-gbMJLjJw.js} +2 -2
- 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
- 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
- package/dist/browser/chunks/{computer-device-mobile-tablet-touch.svg-DQ2oTvOG.js → computer-device-mobile-tablet-touch.svg-Zi88BP4L.js} +2 -2
- package/dist/browser/chunks/{computer-device-mobile-tablet.svg-DCr0XlRc.js → computer-device-mobile-tablet.svg-C1ggisWP.js} +2 -2
- package/dist/browser/chunks/{computer-device-network-ethernet-cat6.svg-AK9l0iOl.js → computer-device-network-ethernet-cat6.svg-BIUymdC1.js} +2 -2
- package/dist/browser/chunks/{computer-device-network-lan-www.svg-gUIdFBlE.js → computer-device-network-lan-www.svg-CoFUlIVO.js} +2 -2
- package/dist/browser/chunks/{computer-device-network-wifi-connection.svg-Be-EMm4e.js → computer-device-network-wifi-connection.svg-DeWsacxI.js} +2 -2
- package/dist/browser/chunks/{computer-device-network-wifi-router.svg-Dc2VzyqK.js → computer-device-network-wifi-router.svg-BjpZEot4.js} +2 -2
- package/dist/browser/chunks/{ecology-science-erlenmeyer-flask.svg-DHgy7Jfd.js → ecology-science-erlenmeyer-flask.svg-ftjGGirE.js} +2 -2
- package/dist/browser/chunks/{image-flash-lightning.svg-EETR_y1q.js → image-flash-lightning.svg-DYQ0W4Fi.js} +2 -2
- package/dist/browser/chunks/{image-picture-flower.svg-DN1AYzJU.js → image-picture-flower.svg-Bfe5SVDf.js} +2 -2
- package/dist/browser/chunks/{interface-alert-exclamation-diamond.svg-C5NozMV_.js → interface-alert-exclamation-diamond.svg-D1HePDNM.js} +2 -2
- package/dist/browser/chunks/{interface-alert-exclamation-triangle-warning.svg-DaAg2fF5.js → interface-alert-exclamation-triangle-warning.svg-CILUsxBC.js} +2 -2
- package/dist/browser/chunks/{interface-alert-information-circle.svg-ckkkt9Mv.js → interface-alert-information-circle.svg-9LrbJM5J.js} +2 -2
- package/dist/browser/chunks/{interface-award-crown.svg-pjvn9hY-.js → interface-award-crown.svg-DllWgiU1.js} +2 -2
- package/dist/browser/chunks/{interface-bookmark.svg-BK9HKQBT.js → interface-bookmark-tag.svg-Dc-JL-Kc.js} +2 -2
- package/dist/browser/chunks/{interface-bookmark-tag.svg-r2r-lQq4.js → interface-bookmark.svg-Dc-JL-Kc.js} +2 -2
- package/dist/browser/chunks/{interface-calendar-date-one.svg-DNnF0M1I.js → interface-calendar-date-one.svg-DO2jelhF.js} +2 -2
- package/dist/browser/chunks/{interface-content-book-open-pages.svg-CQj_w9Vp.js → interface-content-book-open-pages.svg-BJjMjIgA.js} +2 -2
- package/dist/browser/chunks/{interface-content-book-page.svg-DppoeJRe.js → interface-content-book-page.svg-C6rKB2fs.js} +2 -2
- package/dist/browser/chunks/{interface-content-file.svg-CvcD7OiY.js → interface-content-file.svg-CS0q2FKx.js} +2 -2
- package/dist/browser/chunks/{interface-content-folder.svg-BmtS5I9A.js → interface-content-folder.svg-CThTWsJX.js} +2 -2
- package/dist/browser/chunks/{interface-copy-clipboard.svg-Be6EI50X.js → interface-copy-clipboard.svg-DdN67cLv.js} +2 -2
- package/dist/browser/chunks/{interface-edit-attachment.svg-G5TKzpWX.js → interface-edit-attachment.svg-Ciizphuh.js} +2 -2
- package/dist/browser/chunks/{interface-edit-binocular.svg-jzL-DvGB.js → interface-edit-binocular.svg-Dw1nDqmL.js} +2 -2
- package/dist/browser/chunks/{interface-edit-magic-wand.svg-BOTlymvp.js → interface-edit-magic-wand.svg-BYS0jm_E.js} +2 -2
- package/dist/browser/chunks/{interface-edit-tool-paint-roller.svg-s9dwryx7.js → interface-edit-tool-paint-roller.svg-NioSHZC2.js} +2 -2
- package/dist/browser/chunks/{interface-edit-tool-pencil.svg-C7v0dbB3.js → interface-edit-tool-pencil.svg-P87QFlat.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-award.svg-CYHUgUG0.js → interface-favorite-award.svg-DBBAChSi.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-flag.svg-C10zlKOb.js → interface-favorite-flag.svg-HlhPomHY.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-heart.svg-eoduXxlz.js → interface-favorite-heart.svg-Cqu2GYDo.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-star.svg-BSmxJetr.js → interface-favorite-star.svg-BD4JY_J2.js} +2 -2
- package/dist/browser/chunks/{interface-favorite-stars-sparkles.svg-JTFLj3Ls.js → interface-favorite-stars-sparkles.svg-BXi6aO8q.js} +2 -2
- package/dist/browser/chunks/{interface-hierarchy-flowchart.svg-Cg_Wy0kN.js → interface-hierarchy-flowchart.svg-CDEVSsD4.js} +2 -2
- package/dist/browser/chunks/{interface-home-house.svg-DytoGRnv.js → interface-home-house.svg-DJetUjwj.js} +2 -2
- package/dist/browser/chunks/{interface-hyperlink.svg-CuEfmmQI.js → interface-hyperlink.svg-DJ1LREmz.js} +2 -2
- package/dist/browser/chunks/{interface-lighting-brightness.svg-DSK0h_Pa.js → interface-lighting-brightness.svg-TGKAaHYV.js} +2 -2
- package/dist/browser/chunks/{interface-lock-closed.svg-Cn6TaLYv.js → interface-lock-closed.svg-3hehWr3i.js} +2 -2
- package/dist/browser/chunks/{interface-lock-open-unlock.svg-CVkG5-9W.js → interface-lock-open-unlock.svg-CuXKcv1m.js} +2 -2
- package/dist/browser/chunks/{interface-login-key.svg-y-cwwXjN.js → interface-login-key.svg-Chwvvywd.js} +2 -2
- package/dist/browser/chunks/{interface-search.svg-S-puVFJB.js → interface-search.svg-JDE3fk0u.js} +2 -2
- package/dist/browser/chunks/{interface-setting-cog.svg-CTH4_lLg.js → interface-setting-cog.svg-BBCkeh4K.js} +2 -2
- package/dist/browser/chunks/{interface-share-megaphone-bullhorn.svg-Pbp39MyC.js → interface-share-megaphone-bullhorn.svg-CDdxF-4y.js} +2 -2
- package/dist/browser/chunks/{interface-share-rocket.svg-BgCsIRZO.js → interface-share-rocket.svg-DSbdn_o7.js} +2 -2
- package/dist/browser/chunks/{interface-share-satellite.svg-DAMN9d5G.js → interface-share-satellite.svg-CefBVZvY.js} +2 -2
- package/dist/browser/chunks/{interface-share-space-ship.svg-Dt-Mejxk.js → interface-share-space-ship.svg-tFA2dsSU.js} +2 -2
- package/dist/browser/chunks/{interface-share.svg-vFYTXSti.js → interface-share.svg-BpOGopyv.js} +2 -2
- package/dist/browser/chunks/{interface-signal-square.svg-DNG4LpAe.js → interface-signal-square.svg-BcX_BoaC.js} +2 -2
- package/dist/browser/chunks/{interface-time-clock-circle.svg-Bpz-nLxo.js → interface-time-clock-circle.svg-C8B_L_RM.js} +2 -2
- package/dist/browser/chunks/{interface-time-hour-glass.svg-D7agfKsH.js → interface-time-hour-glass.svg-qw-oeoVn.js} +2 -2
- package/dist/browser/chunks/{interface-users-multiple.svg-CkPJBBnG.js → interface-users-multiple.svg-Cs13Eewq.js} +2 -2
- package/dist/browser/chunks/{interface-weather-moon.svg-CaTZFMPO.js → interface-weather-moon.svg-CV-oDTae.js} +2 -2
- package/dist/browser/chunks/{mail-chat-bubble-square.svg-DC8RIihp.js → mail-chat-bubble-square.svg-dpauJhin.js} +2 -2
- package/dist/browser/chunks/{mail-send-email-paper-airplane.svg-D8OLs9jz.js → mail-send-email-paper-airplane.svg-BBofxojL.js} +2 -2
- package/dist/browser/chunks/{mail-send-envelope.svg-CV33h5Sx.js → mail-send-envelope.svg-DyENgYOI.js} +2 -2
- package/dist/browser/chunks/modal-70ibkEHi.js +102 -0
- package/dist/browser/chunks/{money-cashier-receipt.svg-CJL8C2gs.js → money-cashier-receipt.svg-dNTr5aio.js} +2 -2
- package/dist/browser/chunks/{money-currency-dollar-pay.svg-VdBplCTx.js → money-currency-dollar-pay.svg-1ZESPtFY.js} +2 -2
- package/dist/browser/chunks/{money-graph-arrow-increase.svg-DcRov3zk.js → money-graph-arrow-increase.svg-kEZ2u2z2.js} +2 -2
- package/dist/browser/chunks/{money-graph-bar-chart-increase.svg-Cc7KxjX-.js → money-graph-bar-chart-increase.svg-B-t2UWB3.js} +2 -2
- package/dist/browser/chunks/{nature-ecology-leaf.svg-DR3cTZxt.js → nature-ecology-leaf.svg-DZ2GJV8m.js} +2 -2
- package/dist/browser/chunks/{phone-telephone.svg-DyY0gUlk.js → phone-telephone.svg-C12QjpN7.js} +2 -2
- package/dist/browser/chunks/{programming-bug.svg-BHLT-Qhp.js → programming-bug.svg-wLTsruN9.js} +2 -2
- package/dist/browser/chunks/{programming-cloud.svg-B6YW33ba.js → programming-cloud.svg-3XU6dNUg.js} +2 -2
- package/dist/browser/chunks/{programming-computer-database-server.svg-B6o5Sdn-.js → programming-computer-database-server.svg-B1JrHSPd.js} +2 -2
- package/dist/browser/chunks/{programming-computer-database.svg-Cl7OVtpJ.js → programming-computer-database.svg-BxHSuFl7.js} +2 -2
- package/dist/browser/chunks/{programming-module-four-layout.svg-BQrerL1x.js → programming-module-four-layout.svg-CeV35q45.js} +2 -2
- package/dist/browser/chunks/{programming-module-three.svg-B2KTQzBM.js → programming-module-three.svg-YIBpLt45.js} +2 -2
- package/dist/browser/chunks/{programming-module.svg-CiID7kPm.js → programming-module.svg-CU_pEibI.js} +2 -2
- package/dist/browser/chunks/{programming-script-code.svg-D1M5rtkN.js → programming-script-code.svg-CLzinmHT.js} +2 -2
- package/dist/browser/chunks/runtime-core.esm-bundler-CqqEw5ds.js +17 -0
- package/dist/browser/chunks/{shopping-cart.svg-BEegiIR9.js → shopping-cart.svg-Brzddu3K.js} +2 -2
- package/dist/browser/chunks/{shopping-gift-present.svg-BUHwuLix.js → shopping-gift-present.svg-l2K48g7L.js} +2 -2
- package/dist/browser/chunks/{shopping-shipping-box-parcel-package.svg-D6fxWdYx.js → shopping-shipping-box-parcel-package.svg-DesGopPo.js} +2 -2
- package/dist/browser/chunks/{tag-new-circle.svg-jsg1bGs0.js → tag-new-circle.svg-DE-VaLZU.js} +2 -2
- package/dist/browser/chunks/{travel-map-earth-globe.svg-ClbMiU-f.js → travel-map-earth-globe.svg-DLaOMzx6.js} +2 -2
- package/dist/browser/chunks/vendor-BcTep96u.js +306 -0
- package/dist/browser/standalone.esm.js +22 -20
- package/dist/browser/standalone.js +256 -254
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js +1 -1
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js +1 -1
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.js +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -1
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +47 -32
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -1
- package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
- package/dist/components/Anchor/Anchor.vue.script.js +1 -1
- package/dist/components/Anchor/Anchor.vue.script.js.map +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js +2 -2
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js.map +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReference.vue.js.map +1 -1
- package/dist/components/ApiReference.vue.script.js +55 -22
- package/dist/components/ApiReference.vue.script.js.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Badge/Badge.vue.script.js +1 -1
- package/dist/components/Badge/Badge.vue.script.js.map +1 -1
- package/dist/components/ClassicHeader.vue.js +1 -1
- package/dist/components/ClassicHeader.vue.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.js +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiLabels.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js +1 -1
- package/dist/components/Content/AsyncApi/AsyncApiTraversedEntry.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.js +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.script.js +1 -1
- package/dist/components/Content/AsyncApi/Channel.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/ChannelsList.vue.js +1 -1
- package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js +1 -1
- package/dist/components/Content/AsyncApi/ChannelsList.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.js +1 -1
- package/dist/components/Content/AsyncApi/Message.vue.script.js +2 -2
- package/dist/components/Content/AsyncApi/Message.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/Operation.vue.d.ts.map +1 -1
- package/dist/components/Content/AsyncApi/Operation.vue.js +1 -1
- package/dist/components/Content/AsyncApi/Operation.vue.script.js +1 -1
- package/dist/components/Content/AsyncApi/Operation.vue.script.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/adapt-async-api-parameters.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/async-api-render-options.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/filter-children-by-type.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/get-async-api-labels.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/get-async-api-required-security.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/pick-heading.js.map +1 -1
- package/dist/components/Content/AsyncApi/helpers/resolve-async-api-nodes.js.map +1 -1
- package/dist/components/Content/AsyncApi/index.d.ts +3 -0
- package/dist/components/Content/AsyncApi/index.d.ts.map +1 -1
- package/dist/components/Content/Auth/Auth.vue.script.js +1 -1
- package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
- package/dist/components/Content/Content.vue.script.js +1 -1
- package/dist/components/Content/Content.vue.script.js.map +1 -1
- package/dist/components/Content/Models/Model.vue.script.js +1 -1
- package/dist/components/Content/Models/Model.vue.script.js.map +1 -1
- package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelTag.vue.script.js +2 -2
- package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.script.js +1 -1
- package/dist/components/Content/Models/components/ClassicLayout.vue.script.js.map +1 -1
- package/dist/components/Content/Models/components/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/components/ModernLayout.vue.script.js +1 -1
- package/dist/components/Content/Models/components/ModernLayout.vue.script.js.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/LinkButton.vue.js +1 -1
- package/dist/components/Content/Schema/LinkButton.vue.js.map +1 -1
- package/dist/components/Content/Schema/RenderString.vue.script.js +1 -1
- package/dist/components/Content/Schema/RenderString.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.script.js +5 -13
- package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js +9 -3
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +6 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +6 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -1
- package/dist/components/Content/Schema/helpers/dynamic-scope.js.map +1 -1
- package/dist/components/Content/Schema/helpers/format-example.js.map +1 -1
- package/dist/components/Content/Schema/helpers/format-value.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-enum-values.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-property-description.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-ref-name.d.ts +16 -0
- package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/get-ref-name.js +28 -1
- package/dist/components/Content/Schema/helpers/get-ref-name.js.map +1 -1
- package/dist/components/Content/Schema/helpers/get-schema-type.js.map +1 -1
- package/dist/components/Content/Schema/helpers/has-complex-array-items.js.map +1 -1
- package/dist/components/Content/Schema/helpers/is-empty-schema-object.js.map +1 -1
- package/dist/components/Content/Schema/helpers/is-model-linkable.d.ts +15 -0
- package/dist/components/Content/Schema/helpers/is-model-linkable.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/is-model-linkable.js +22 -0
- package/dist/components/Content/Schema/helpers/is-model-linkable.js.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.js.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +3 -3
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -1
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js.map +1 -1
- package/dist/components/Content/Schema/helpers/partition-all-of-compositions.js.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-composition.js.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-cycle.js.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts +6 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +5 -4
- package/dist/components/Content/Schema/helpers/schema-name.js.map +1 -1
- package/dist/components/Content/Schema/helpers/should-display-description.js.map +1 -1
- package/dist/components/Content/Schema/helpers/should-display-heading.js.map +1 -1
- package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js.map +1 -1
- package/dist/components/Content/Schema/helpers/sort-property-names.js.map +1 -1
- package/dist/components/Content/Schema/types.d.ts +7 -0
- package/dist/components/Content/Schema/types.d.ts.map +1 -1
- package/dist/components/Content/Tags/Tag.vue.script.js +1 -1
- package/dist/components/Content/Tags/Tag.vue.script.js.map +1 -1
- package/dist/components/Content/Tags/components/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/components/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +1 -1
- package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js.map +1 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.script.js +1 -1
- package/dist/components/Content/Tags/components/ModernLayout.vue.script.js.map +1 -1
- package/dist/components/Content/Tags/components/TagSection.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/components/TagSection.vue.script.js +1 -1
- package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -1
- package/dist/components/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.js +1 -1
- package/dist/components/GettingStarted.vue.js.map +1 -1
- package/dist/components/GettingStarted.vue.script.js +4 -3
- package/dist/components/GettingStarted.vue.script.js.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -1
- package/dist/components/IntersectionObserver.vue.script.js +10 -7
- package/dist/components/IntersectionObserver.vue.script.js.map +1 -1
- package/dist/components/Lazy/Lazy.vue.script.js +2 -2
- package/dist/components/Lazy/Lazy.vue.script.js.map +1 -1
- package/dist/components/LinkList/LinkList.vue.js +1 -1
- package/dist/components/LinkList/LinkList.vue.script.js +1 -1
- package/dist/components/LinkList/LinkList.vue.script.js.map +1 -1
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.script.js +4 -4
- package/dist/components/MobileHeader.vue.script.js.map +1 -1
- package/dist/components/OperationPath.vue.d.ts.map +1 -1
- package/dist/components/OperationPath.vue.js +1 -1
- package/dist/components/OperationPath.vue.script.js +1 -1
- package/dist/components/OperationPath.vue.script.js.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.script.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.script.js +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.script.js.map +1 -1
- package/dist/components/RenderPlugins/RenderPluginView.vue.script.js +1 -1
- package/dist/components/RenderPlugins/RenderPluginView.vue.script.js.map +1 -1
- package/dist/components/RenderPlugins/RenderPlugins.vue.script.js +1 -1
- package/dist/components/RenderPlugins/RenderPlugins.vue.script.js.map +1 -1
- package/dist/components/ScreenReader.vue.js +1 -1
- package/dist/components/ScreenReader.vue.script.js +2 -2
- package/dist/components/ScreenReader.vue.script.js.map +1 -1
- package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
- package/dist/components/Section/CompactSection.vue.js +1 -1
- package/dist/components/Section/CompactSection.vue.script.js +1 -1
- package/dist/components/Section/CompactSection.vue.script.js.map +1 -1
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/Section/Section.vue.script.js +1 -1
- package/dist/components/Section/Section.vue.script.js.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.js +1 -1
- package/dist/components/Section/SectionAccordion.vue.script.js +1 -1
- package/dist/components/Section/SectionAccordion.vue.script.js.map +1 -1
- package/dist/components/Section/SectionColumn.vue.js +1 -1
- package/dist/components/Section/SectionColumn.vue.js.map +1 -1
- package/dist/components/Section/SectionColumns.vue.js +1 -1
- package/dist/components/Section/SectionColumns.vue.js.map +1 -1
- package/dist/components/Section/SectionContainer.vue.js +1 -1
- package/dist/components/Section/SectionContainer.vue.script.js +2 -2
- package/dist/components/Section/SectionContainer.vue.script.js.map +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.script.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.script.js.map +1 -1
- package/dist/components/Section/SectionContent.vue.js +1 -1
- package/dist/components/Section/SectionContent.vue.js.map +1 -1
- package/dist/components/Section/SectionHeader.vue.js +1 -1
- package/dist/components/Section/SectionHeader.vue.script.js +2 -2
- package/dist/components/Section/SectionHeader.vue.script.js.map +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.js +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.script.js +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.script.js.map +1 -1
- package/dist/components/SectionFlare/SectionFlare.vue.js +1 -1
- package/dist/components/SectionFlare/SectionFlare.vue.js.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue.script.js +1 -1
- package/dist/components/ShowMoreButton.vue.script.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -1
- package/dist/features/Operation/Operation.vue.script.js +1 -1
- package/dist/features/Operation/Operation.vue.script.js.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +2 -2
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -1
- package/dist/features/Operation/components/Header.vue.d.ts +2 -0
- package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Header.vue.js.map +1 -1
- package/dist/features/Operation/components/Header.vue.script.js +4 -2
- package/dist/features/Operation/components/Header.vue.script.js.map +1 -1
- package/dist/features/Operation/components/Headers.vue.d.ts +2 -0
- package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/Headers.vue.js.map +1 -1
- package/dist/features/Operation/components/Headers.vue.script.js +5 -2
- package/dist/features/Operation/components/Headers.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.script.js +4 -4
- package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.script.js +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -1
- package/dist/features/Operation/components/OperationScopes.vue.script.js +1 -1
- package/dist/features/Operation/components/OperationScopes.vue.script.js.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.script.js +1 -1
- package/dist/features/Operation/components/ParameterList.vue.script.js.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.script.js +4 -1
- package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.script.js +12 -3
- package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadge.vue.script.js.map +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadgeScheme.vue.script.js +1 -1
- package/dist/features/Operation/components/SecurityRequirementBadgeScheme.vue.script.js.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.script.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.script.js.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -1
- package/dist/features/Operation/components/helpers/get-parameter-examples.js.map +1 -1
- package/dist/features/Operation/helpers/filter-selected-security.js.map +1 -1
- package/dist/features/Operation/helpers/flatten-deep-object-query-parameter.js.map +1 -1
- package/dist/features/Operation/helpers/get-required-security.js.map +1 -1
- package/dist/features/Operation/helpers/operation-stability.js.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
- package/dist/features/Operation/request-body-composition-index.js.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.script.js +1 -1
- package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -1
- package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchModal.vue.js +1 -1
- package/dist/features/Search/components/SearchModal.vue.script.js +1 -1
- package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -1
- package/dist/features/Search/components/SearchResult.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchResult.vue.js.map +1 -1
- package/dist/features/Search/components/SearchResult.vue.script.js +3 -3
- package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -1
- package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -1
- package/dist/features/Search/helpers/create-search-index.js.map +1 -1
- package/dist/features/Search/hooks/useSearchIndex.js.map +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.js +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -1
- package/dist/features/developer-tools/DeveloperTools.vue.script.js +2 -2
- package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +3 -3
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +4 -3
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +2 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +4 -3
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.d.ts.map +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +1 -1
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +1 -1
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +2 -2
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +1 -1
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponseTab.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTab.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleResponseTab.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
- package/dist/features/example-responses/ExampleSchema.vue.script.js +1 -1
- package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -1
- package/dist/features/example-responses/helpers/has-response-content.js.map +1 -1
- package/dist/features/example-responses/helpers/normalize-mime-type-object.js.map +1 -1
- package/dist/features/example-responses/helpers/normalize-mime-type.js.map +1 -1
- package/dist/features/external-docs/ExternalDocs.vue.d.ts.map +1 -1
- package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -1
- package/dist/features/external-docs/ExternalDocs.vue.script.js +25 -13
- package/dist/features/external-docs/ExternalDocs.vue.script.js.map +1 -1
- package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
- package/dist/features/info-object/Contact.vue.js.map +1 -1
- package/dist/features/info-object/Contact.vue.script.js +10 -4
- package/dist/features/info-object/Contact.vue.script.js.map +1 -1
- package/dist/features/info-object/InfoLink.vue.d.ts.map +1 -1
- package/dist/features/info-object/InfoLink.vue.js.map +1 -1
- package/dist/features/info-object/InfoLink.vue.script.js +17 -5
- package/dist/features/info-object/InfoLink.vue.script.js.map +1 -1
- package/dist/features/info-object/License.vue.d.ts.map +1 -1
- package/dist/features/info-object/License.vue.js.map +1 -1
- package/dist/features/info-object/License.vue.script.js +11 -5
- package/dist/features/info-object/License.vue.script.js.map +1 -1
- package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
- package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
- package/dist/features/info-object/TermsOfService.vue.script.js +10 -4
- package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
- package/dist/features/localization/locales/ar.js.map +1 -1
- package/dist/features/localization/locales/de.js.map +1 -1
- package/dist/features/localization/locales/en.js.map +1 -1
- package/dist/features/localization/locales/es.js.map +1 -1
- package/dist/features/localization/locales/fr.js.map +1 -1
- package/dist/features/localization/locales/pt.d.ts +229 -0
- package/dist/features/localization/locales/pt.d.ts.map +1 -0
- package/dist/features/localization/locales/pt.js +227 -0
- package/dist/features/localization/locales/pt.js.map +1 -0
- package/dist/features/localization/locales/ru.js.map +1 -1
- package/dist/features/localization/locales/zh-cn.js.map +1 -1
- package/dist/features/localization/translations.d.ts +228 -0
- package/dist/features/localization/translations.d.ts.map +1 -1
- package/dist/features/localization/translations.js +4 -2
- package/dist/features/localization/translations.js.map +1 -1
- package/dist/features/localization/use-localization.js.map +1 -1
- package/dist/features/multiple-documents/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js +1 -1
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js.map +1 -1
- package/dist/features/specification-extension/SpecificationExtension.vue.script.js +1 -1
- package/dist/features/specification-extension/SpecificationExtension.vue.script.js.map +1 -1
- package/dist/features/specification-extension/helpers.js.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.script.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -1
- package/dist/features/x-badges/XBadges.vue.d.ts.map +1 -1
- package/dist/features/x-badges/XBadges.vue.script.js +1 -1
- package/dist/features/x-badges/XBadges.vue.script.js.map +1 -1
- package/dist/helpers/build-models-index.d.ts +15 -0
- package/dist/helpers/build-models-index.d.ts.map +1 -0
- package/dist/helpers/build-models-index.js +28 -0
- package/dist/helpers/build-models-index.js.map +1 -0
- package/dist/helpers/color-mode.js.map +1 -1
- package/dist/helpers/download.js.map +1 -1
- package/dist/helpers/get-async-api-message-payload-schema.js.map +1 -1
- package/dist/helpers/get-async-api-model-schema.js.map +1 -1
- package/dist/helpers/id-routing.d.ts +18 -4
- package/dist/helpers/id-routing.d.ts.map +1 -1
- package/dist/helpers/id-routing.js +67 -20
- package/dist/helpers/id-routing.js.map +1 -1
- package/dist/helpers/is-introduction-entry.js.map +1 -1
- package/dist/helpers/lazy-bus.js.map +1 -1
- package/dist/helpers/load-from-perssistance.js.map +1 -1
- package/dist/helpers/map-config-plugins.js.map +1 -1
- package/dist/helpers/map-config-to-workspace-store.js.map +1 -1
- package/dist/helpers/normalize-configurations.js +1 -1
- package/dist/helpers/normalize-configurations.js.map +1 -1
- package/dist/helpers/openapi.d.ts +6 -1
- package/dist/helpers/openapi.d.ts.map +1 -1
- package/dist/helpers/openapi.js +37 -6
- package/dist/helpers/openapi.js.map +1 -1
- package/dist/helpers/safe-deep-clone.js.map +1 -1
- package/dist/helpers/storage.d.ts +16 -0
- package/dist/helpers/storage.d.ts.map +1 -1
- package/dist/helpers/storage.js +14 -0
- package/dist/helpers/storage.js.map +1 -1
- package/dist/helpers/upload-temp-document.js.map +1 -1
- package/dist/hooks/use-agent.js.map +1 -1
- package/dist/hooks/use-intersection.js.map +1 -1
- package/dist/plugins/hooks/usePluginManager.js.map +1 -1
- package/dist/plugins/persistence-plugin.js +6 -1
- package/dist/plugins/persistence-plugin.js.map +1 -1
- package/dist/plugins/plugin-manager.js +35 -0
- package/dist/plugins/plugin-manager.js.map +1 -1
- package/dist/plugins/posthog/index.js.map +1 -1
- package/dist/standalone/lib/html-api.js.map +1 -1
- package/dist/standalone/lib/load-plugins-from-urls.js.map +1 -1
- package/dist/style.css +1419 -1316
- package/dist/vue-styles.css +918 -831
- package/package.json +27 -27
- package/dist/browser/chunks/AgentScalarChatInterface-C8lX3RCo.js +0 -27
- package/dist/browser/chunks/ScalarTextInput.vue-Xf60Nwf-.js +0 -27
- package/dist/browser/chunks/browser-67K6wmG9.js +0 -129
- package/dist/browser/chunks/modal-B8Opb61-.js +0 -15
- package/dist/browser/chunks/modal-Dcl-Y2Zk.js +0 -99
- package/dist/browser/chunks/runtime-core.esm-bundler-Byrbbu5Q.js +0 -17
- package/dist/browser/chunks/vendor-CBP43oHJ.js +0 -306
- package/dist/features/Operation/helpers/should-ignore-entity.d.ts +0 -8
- package/dist/features/Operation/helpers/should-ignore-entity.d.ts.map +0 -1
- package/dist/features/Operation/helpers/should-ignore-entity.js +0 -9
- package/dist/features/Operation/helpers/should-ignore-entity.js.map +0 -1
|
@@ -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,
|
|
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 (!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;;;AAIzB,YAAW,MAAM;AAEZ,gBAAe;AAClB,YAAU,IAAI,KAAK,KAAK,GAAG,iBAAiB,SAAS,SAAS;GAC9D;;;;;;;;;AAUJ,IAAM,aAAa,IAAY,UAAkB,YAAuB,cAAiC;CACvG,MAAM,UAAU,SAAS,eAAe,GAAG;AAC3C,KAAI,SAAS;AACX,UAAQ,eAAe,EAAE,OAAO,SAAS,CAAC;AAC1C,oBAAkB,GAAG;AACrB,cAAY;YACH,KAAK,KAAK,GAAG,SACtB,6BAA4B,UAAU,IAAI,UAAU,YAAY,UAAU,CAAC;MACtE;AAEL,oBAAkB,GAAG;AACrB,cAAY;AACZ,eAAa;;;AAIjB,IAAM,UAAU,OAA6B;CAC3C,IAAI,OAAO;;;;;CAMX,MAAM,YAAY,mBAA4B;EAC5C,MAAM,UAAU,SAAS,eAAe,GAAG;AAC3C,MAAI,QACF,SAAQ,eAAe,EAAE,OAAO,SAAS,CAAC;AAE5C,MAAI,CAAC,eACH,6BAA4B,SAAS,KAAK,CAAC;;AAI/C,UAAS,MAAM;AAEf,cAAa;AACX,SAAO"}
|
|
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,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,IAAI,CAAC;AAE5D,IAAM,mCAAmB,IAAI,IAAgB;;AAG7C,IAAM,yBAAyB,yBAA8B,IAAI,IAAI,CAAC;AAEtE,IAAa,4BAA4B,OAAmC,uBAAuB,IAAI,EAAE;AAEzG,IAAa,4BAA4B,IAAY,WAAyB;CAC5E,IAAI,CAAC,OAAO,SAAS,MAAM,KAAK,UAAU,GACxC;CAEF,uBAAuB,IAAI,IAAI,KAAK,MAAM,MAAM,CAAC;AACnD;;AAGA,IAAM,2BAA2B,aAAuC;CACtE,IAAI,UACF,iBAAiB,IAAI,QAAQ;AAEjC;;;;;AAQA,IAAa,0BAAqC;CAChD,MAAM,UAAU,OAAO;CACvB,qBAAqB,IAAI,OAAO;;CAGhC,aAAa,iBAAiB,q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AE;EACzE,IAAI,eAAe,KAAA,KAAa,cAAc,GAC5C,QAAQ,UAAU,MAAM,YAAY,aAAa,CAAC,CAAC,CAAC,SAAS,UAAU,mBAAmB,MAAM,EAAE,CAAC;CAEvG;CAEA,YAAY,OAAO,IAAI;;;;;CAKvB,MAAM,cAAc,cAAsB;EACxC,MAAM,SAAS,aAAa,SAAS,CAAC,EAAE;EACxC,IAAI,QAAQ;GACV,mBAAmB,OAAO,EAAE;GAC5B,YAAY,OAAO,IAAI,IAAI;GAC3B,WAAW,OAAO,EAAE;EACtB;CACF;;CAEA,WAAW,KAAK;CAEhB,eAAoB;EAClB,UAAU,IAAI,KAAK,IAAI,IAAI,iBAAiB,SAAS,QAAQ;CAC/D,CAAC;AACH;;;;;;;;AASA,IAAM,aAAa,IAAY,UAAkB,YAAuB,cAAiC;CACvG,MAAM,UAAU,SAAS,eAAe,EAAE;CAC1C,IAAI,SAAS;EACX,QAAQ,eAAe,EAAE,OAAO,QAAQ,CAAC;EACzC,kBAAkB,EAAE;EACpB,WAAW;CACb,OAAO,IAAI,KAAK,IAAI,IAAI,UACtB,4BAA4B,UAAU,IAAI,UAAU,YAAY,SAAS,CAAC;MACrE;EAEL,kBAAkB,EAAE;EACpB,WAAW;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,
|
|
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,
|
|
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;
|
|
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"}
|
|
@@ -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 }\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,UAAkF;
|
|
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 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,SAC+D;CAE/D,IAAI,OAAO,OACT,OAAO;EACL,GAAG;EACH,MAAM,OAAO,QAAQ,KAAK,OAAO,KAAK;EACtC,OAAO,OAAO;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;AA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E,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"}
|
package/dist/helpers/openapi.js
CHANGED
|
@@ -65,7 +65,8 @@ function forEachRequestBodyProperty(operation, visit) {
|
|
|
65
65
|
function extractParameterNames(parameters) {
|
|
66
66
|
const names = [];
|
|
67
67
|
parameters.forEach((parameter) => {
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
|
172
|
+
if (!hasOwnObject(target, key)) defineOwnProperty(target, key, Array.isArray(val) ? [] : {});
|
|
142
173
|
deepMerge(val, target[key]);
|
|
143
|
-
} else if (typeof val !== "undefined") target
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.js","names":[],"sources":["../../src/helpers/openapi.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n MediaTypeObject,\n OpenApiDocument,\n OperationObject,\n ParameterObject,\n ReferenceType,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isObjectSchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\nconst isSchemaObject = (value: unknown): value is SchemaObject => typeof value === 'object' && value !== null\n\n/**\n * Resolves a schema reference from workspace-store to a SchemaObject.\n * Returns undefined when a reference exists but has not been resolved yet.\n */\nfunction resolveSchemaRef(ref: SchemaReferenceType<SchemaObject>): SchemaObject | undefined {\n if (typeof ref === 'object' && ref !== null && '$ref' in ref) {\n return isSchemaObject(ref['$ref-value']) ? ref['$ref-value'] : undefined\n }\n\n return ref\n}\n\nfunction pushUnique(target: string[], value: string | undefined): void {\n if (!value) {\n return\n }\n if (!target.includes(value)) {\n target.push(value)\n }\n}\n\ntype CollectOptions = {\n visit: (key: string, schema: SchemaObject | undefined) => void\n visited: Set<SchemaObject>\n maxPropertyDepth: number\n}\n\n/**\n * Recursively visits every property of a schema, descending transparently through composition\n * keywords (`oneOf`, `anyOf`, `allOf`) and one level into nested object properties.\n *\n * Composition is treated as transparent — a `oneOf` of two object variants is *the same level* as a\n * single object, just expressed as multiple shapes. Property nesting is capped to keep the index\n * focused on shallow, commonly-searched fields. A visited-set keyed by resolved-schema identity\n * guards against recursive (`Tree → Tree`) schemas.\n */\nfunction collectSchemaProperties(schema: SchemaObject | undefined, options: CollectOptions, propertyDepth = 0): void {\n if (!schema || options.visited.has(schema)) {\n return\n }\n options.visited.add(schema)\n\n const variants = [...(schema.oneOf ?? []), ...(schema.anyOf ?? []), ...(schema.allOf ?? [])]\n variants.forEach((variantRef) => {\n collectSchemaProperties(resolveSchemaRef(variantRef), options, propertyDepth)\n })\n\n if (isObjectSchema(schema) && schema.properties) {\n Object.entries(schema.properties).forEach(([key, propRef]) => {\n const property = resolveSchemaRef(propRef)\n options.visit(key, property)\n if (propertyDepth + 1 < options.maxPropertyDepth) {\n collectSchemaProperties(property, options, propertyDepth + 1)\n }\n })\n }\n}\n\n/**\n * Walks the request body schemas of an operation and yields each property schema with its key.\n */\nfunction forEachRequestBodyProperty(\n operation: OperationObject,\n visit: (key: string, schema: SchemaObject | undefined) => void,\n): void {\n const content = getResolvedRef(operation?.requestBody)?.content\n if (!content) {\n return\n }\n\n const visited = new Set<SchemaObject>()\n Object.values(content).forEach((media) => {\n const resolvedMedia = getResolvedRef(media) as MediaTypeObject | undefined\n const schema = getResolvedRef(resolvedMedia?.schema)\n collectSchemaProperties(schema, { visit, visited, maxPropertyDepth: 2 })\n })\n}\n\n/**\n * Extracts the names of every parameter on an operation.\n *\n * The returned strings contain only parameter names (e.g. `userId`, `limit`) so they can be indexed\n * as a high-signal field for search. Filter-style metadata like `REQUIRED`, `optional`, `query` and\n * the schema type are intentionally excluded — those tokens dilute fuzzy matches and produce false\n * positives for queries like `query` or `integer`.\n */\nexport function extractParameterNames(parameters: ReferenceType<ParameterObject>[]): string[] {\n const names: string[] = []\n\n parameters.forEach((parameter) => {\n const resolved = getResolvedRef(parameter)\n pushUnique(names, resolved?.name)\n })\n\n return names\n}\n\n/**\n * Extracts the descriptions of every parameter on an operation.\n *\n * Kept separate from parameter names so the search index can weight each independently.\n */\nexport function extractParameterDescriptions(parameters: ReferenceType<ParameterObject>[]): string[] {\n const descriptions: string[] = []\n\n parameters.forEach((parameter) => {\n const resolved = getResolvedRef(parameter)\n pushUnique(descriptions, resolved?.description)\n })\n\n return descriptions\n}\n\n/**\n * Extracts the names of properties from the request body schema(s) of an operation.\n *\n * Walks every media type and includes both top-level and one level of nested property names so\n * common fields like `email` or `username` surface in search regardless of how the body is shaped.\n */\nexport function extractBodyFieldNames(operation: OperationObject): string[] {\n const names: string[] = []\n\n forEachRequestBodyProperty(operation, (key) => {\n pushUnique(names, key)\n })\n\n return names\n}\n\n/**\n * Extracts the descriptions of properties from the request body schema(s) of an operation.\n */\nexport function extractBodyDescriptions(operation: OperationObject): string[] {\n const descriptions: string[] = []\n\n forEachRequestBodyProperty(operation, (_key, schema) => {\n if (schema && 'description' in schema && typeof schema.description === 'string') {\n pushUnique(descriptions, schema.description)\n }\n })\n\n return descriptions\n}\n\n/**\n * Extracts the property names of a schema for the search index.\n *\n * Same depth and composition behavior as `extractBodyFieldNames` — descends transparently through\n * `oneOf`/`anyOf`/`allOf`, walks one level into nested object properties, dedupes.\n */\nexport function extractSchemaFieldNames(schema: SchemaObject | undefined): string[] {\n const names: string[] = []\n collectSchemaProperties(schema, {\n visit: (key) => pushUnique(names, key),\n visited: new Set<SchemaObject>(),\n maxPropertyDepth: 2,\n })\n return names\n}\n\n/**\n * Extracts the property descriptions of a schema for the search index.\n */\nexport function extractSchemaDescriptions(schema: SchemaObject | undefined): string[] {\n const descriptions: string[] = []\n collectSchemaProperties(schema, {\n visit: (_key, propertySchema) => {\n if (propertySchema && 'description' in propertySchema && typeof propertySchema.description === 'string') {\n pushUnique(descriptions, propertySchema.description)\n }\n },\n visited: new Set<SchemaObject>(),\n maxPropertyDepth: 2,\n })\n return descriptions\n}\n\n/**\n * Deep merge for objects\n */\nexport function deepMerge(source: Record<any, any>, target: Record<any, any>) {\n for (const [key, val] of Object.entries(source)) {\n if (val !== null && typeof val === 'object') {\n target[key] ??= new val.__proto__.constructor()\n deepMerge(val, target[key])\n } else if (typeof val !== 'undefined') {\n target[key] = val\n }\n }\n\n return target\n}\n\n/**\n * Creates an empty specification object.\n * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.\n */\nexport function createEmptySpecification(partialSpecification?: Partial<OpenApiDocument>) {\n const emptySpecification = {\n openapi: '3.1.0',\n info: {\n title: '',\n description: '',\n termsOfService: '',\n version: '',\n license: {\n name: '',\n url: '',\n },\n contact: {\n email: '',\n },\n },\n servers: [],\n tags: [],\n 'x-scalar-original-document-hash': '',\n }\n\n if (!partialSpecification) {\n return emptySpecification as OpenApiDocument\n }\n\n deepMerge(partialSpecification, emptySpecification)\n\n return emptySpecification as OpenApiDocument\n}\n"],"mappings":";;;AAYA,IAAM,kBAAkB,UAA0C,OAAO,UAAU,YAAY,UAAU;;;;;AAMzG,SAAS,iBAAiB,KAAkE;AAC1F,KAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,UAAU,IACvD,QAAO,eAAe,IAAI,cAAc,GAAG,IAAI,gBAAgB,KAAA;AAGjE,QAAO;;AAGT,SAAS,WAAW,QAAkB,OAAiC;AACrE,KAAI,CAAC,MACH;AAEF,KAAI,CAAC,OAAO,SAAS,MAAM,CACzB,QAAO,KAAK,MAAM;;;;;;;;;;;AAmBtB,SAAS,wBAAwB,QAAkC,SAAyB,gBAAgB,GAAS;AACnH,KAAI,CAAC,UAAU,QAAQ,QAAQ,IAAI,OAAO,CACxC;AAEF,SAAQ,QAAQ,IAAI,OAAO;AAEV;EAAC,GAAI,OAAO,SAAS,EAAE;EAAG,GAAI,OAAO,SAAS,EAAE;EAAG,GAAI,OAAO,SAAS,EAAE;EAAE,CACnF,SAAS,eAAe;AAC/B,0BAAwB,iBAAiB,WAAW,EAAE,SAAS,cAAc;GAC7E;AAEF,KAAI,eAAe,OAAO,IAAI,OAAO,WACnC,QAAO,QAAQ,OAAO,WAAW,CAAC,SAAS,CAAC,KAAK,aAAa;EAC5D,MAAM,WAAW,iBAAiB,QAAQ;AAC1C,UAAQ,MAAM,KAAK,SAAS;AAC5B,MAAI,gBAAgB,IAAI,QAAQ,iBAC9B,yBAAwB,UAAU,SAAS,gBAAgB,EAAE;GAE/D;;;;;AAON,SAAS,2BACP,WACA,OACM;CACN,MAAM,UAAU,eAAe,WAAW,YAAY,EAAE;AACxD,KAAI,CAAC,QACH;CAGF,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;AACF,QAAO;;;;;AAMT,SAAgB,UAAU,QAA0B,QAA0B;AAC5E,MAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,OAAO,CAC7C,KAAI,QAAQ,QAAQ,OAAO,QAAQ,UAAU;AAC3C,SAAO,SAAS,IAAI,IAAI,UAAU,aAAa;AAC/C,YAAU,KAAK,OAAO,KAAK;YAClB,OAAO,QAAQ,YACxB,QAAO,OAAO;AAIlB,QAAO;;;;;;AAOT,SAAgB,yBAAyB,sBAAiD;CACxF,MAAM,qBAAqB;EACzB,SAAS;EACT,MAAM;GACJ,OAAO;GACP,aAAa;GACb,gBAAgB;GAChB,SAAS;GACT,SAAS;IACP,MAAM;IACN,KAAK;IACN;GACD,SAAS,EACP,OAAO,IACR;GACF;EACD,SAAS,EAAE;EACX,MAAM,EAAE;EACR,mCAAmC;EACpC;AAED,KAAI,CAAC,qBACH,QAAO;AAGT,WAAU,sBAAsB,mBAAmB;AAEnD,QAAO"}
|
|
1
|
+
{"version":3,"file":"openapi.js","names":[],"sources":["../../src/helpers/openapi.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type {\n MediaTypeObject,\n OpenApiDocument,\n OperationObject,\n ParameterObject,\n ReferenceType,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isObjectSchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\nconst isSchemaObject = (value: unknown): value is SchemaObject => typeof value === 'object' && value !== null\n\n/**\n * Resolves a schema reference from workspace-store to a SchemaObject.\n * Returns undefined when a reference exists but has not been resolved yet.\n */\nfunction resolveSchemaRef(ref: SchemaReferenceType<SchemaObject>): SchemaObject | undefined {\n if (typeof ref === 'object' && ref !== null && '$ref' in ref) {\n return isSchemaObject(ref['$ref-value']) ? ref['$ref-value'] : undefined\n }\n\n return ref\n}\n\nfunction pushUnique(target: string[], value: string | undefined): void {\n if (!value) {\n return\n }\n if (!target.includes(value)) {\n target.push(value)\n }\n}\n\ntype CollectOptions = {\n visit: (key: string, schema: SchemaObject | undefined) => void\n visited: Set<SchemaObject>\n maxPropertyDepth: number\n}\n\n/**\n * Recursively visits every property of a schema, descending transparently through composition\n * keywords (`oneOf`, `anyOf`, `allOf`) and one level into nested object properties.\n *\n * Composition is treated as transparent — a `oneOf` of two object variants is *the same level* as a\n * single object, just expressed as multiple shapes. Property nesting is capped to keep the index\n * focused on shallow, commonly-searched fields. A visited-set keyed by resolved-schema identity\n * guards against recursive (`Tree → Tree`) schemas.\n */\nfunction collectSchemaProperties(schema: SchemaObject | undefined, options: CollectOptions, propertyDepth = 0): void {\n if (!schema || options.visited.has(schema)) {\n return\n }\n options.visited.add(schema)\n\n const variants = [...(schema.oneOf ?? []), ...(schema.anyOf ?? []), ...(schema.allOf ?? [])]\n variants.forEach((variantRef) => {\n collectSchemaProperties(resolveSchemaRef(variantRef), options, propertyDepth)\n })\n\n if (isObjectSchema(schema) && schema.properties) {\n Object.entries(schema.properties).forEach(([key, propRef]) => {\n const property = resolveSchemaRef(propRef)\n options.visit(key, property)\n if (propertyDepth + 1 < options.maxPropertyDepth) {\n collectSchemaProperties(property, options, propertyDepth + 1)\n }\n })\n }\n}\n\n/**\n * Walks the request body schemas of an operation and yields each property schema with its key.\n */\nfunction forEachRequestBodyProperty(\n operation: OperationObject,\n visit: (key: string, schema: SchemaObject | undefined) => void,\n): void {\n const content = getResolvedRef(operation?.requestBody)?.content\n if (!content) {\n return\n }\n\n const visited = new Set<SchemaObject>()\n Object.values(content).forEach((media) => {\n const resolvedMedia = getResolvedRef(media) as MediaTypeObject | undefined\n const schema = getResolvedRef(resolvedMedia?.schema)\n collectSchemaProperties(schema, { visit, visited, maxPropertyDepth: 2 })\n })\n}\n\n/**\n * Extracts the names of every parameter on an operation.\n *\n * The returned strings contain only parameter names (e.g. `userId`, `limit`) so they can be indexed\n * as a high-signal field for search. Filter-style metadata like `REQUIRED`, `optional`, `query` and\n * the schema type are intentionally excluded — those tokens dilute fuzzy matches and produce false\n * positives for queries like `query` or `integer`.\n */\nexport function extractParameterNames(parameters: ReferenceType<ParameterObject>[]): string[] {\n const names: string[] = []\n\n parameters.forEach((parameter) => {\n const resolved = getResolvedRef(parameter)\n pushUnique(names, resolved?.name)\n })\n\n return names\n}\n\n/**\n * Extracts the descriptions of every parameter on an operation.\n *\n * Kept separate from parameter names so the search index can weight each independently.\n */\nexport function extractParameterDescriptions(parameters: ReferenceType<ParameterObject>[]): string[] {\n const descriptions: string[] = []\n\n parameters.forEach((parameter) => {\n const resolved = getResolvedRef(parameter)\n pushUnique(descriptions, resolved?.description)\n })\n\n return descriptions\n}\n\n/**\n * Extracts the names of properties from the request body schema(s) of an operation.\n *\n * Walks every media type and includes both top-level and one level of nested property names so\n * common fields like `email` or `username` surface in search regardless of how the body is shaped.\n */\nexport function extractBodyFieldNames(operation: OperationObject): string[] {\n const names: string[] = []\n\n forEachRequestBodyProperty(operation, (key) => {\n pushUnique(names, key)\n })\n\n return names\n}\n\n/**\n * Extracts the descriptions of properties from the request body schema(s) of an operation.\n */\nexport function extractBodyDescriptions(operation: OperationObject): string[] {\n const descriptions: string[] = []\n\n forEachRequestBodyProperty(operation, (_key, schema) => {\n if (schema && 'description' in schema && typeof schema.description === 'string') {\n pushUnique(descriptions, schema.description)\n }\n })\n\n return descriptions\n}\n\n/**\n * Extracts the property names of a schema for the search index.\n *\n * Same depth and composition behavior as `extractBodyFieldNames` — descends transparently through\n * `oneOf`/`anyOf`/`allOf`, walks one level into nested object properties, dedupes.\n */\nexport function extractSchemaFieldNames(schema: SchemaObject | undefined): string[] {\n const names: string[] = []\n collectSchemaProperties(schema, {\n visit: (key) => pushUnique(names, key),\n visited: new Set<SchemaObject>(),\n maxPropertyDepth: 2,\n })\n return names\n}\n\n/**\n * Extracts the property descriptions of a schema for the search index.\n */\nexport function extractSchemaDescriptions(schema: SchemaObject | undefined): string[] {\n const descriptions: string[] = []\n collectSchemaProperties(schema, {\n visit: (_key, propertySchema) => {\n if (propertySchema && 'description' in propertySchema && typeof propertySchema.description === 'string') {\n pushUnique(descriptions, propertySchema.description)\n }\n },\n visited: new Set<SchemaObject>(),\n maxPropertyDepth: 2,\n })\n return descriptions\n}\n\n/**\n * Assigns a value as an ordinary own, enumerable data property.\n *\n * `target.__proto__ = value` runs the prototype setter instead of creating a property, so a\n * document with a `__proto__` key could otherwise change the prototype of the merged object.\n * Defining the property explicitly keeps a key with that name as plain data.\n */\nconst defineOwnProperty = (target: Record<any, any>, key: string, value: unknown): void => {\n if (key === '__proto__') {\n Object.defineProperty(target, key, { value, writable: true, enumerable: true, configurable: true })\n } else {\n target[key] = value\n }\n}\n\n/**\n * Whether `target` already has its own mergeable object under `key`.\n *\n * Only an own object is a safe merge target. Reaching an inherited property — every object inherits\n * `constructor`, and `__proto__` resolves to an accessor on `Object.prototype` — would let a\n * document walk up to `Object.prototype` and add a property to every object on the page.\n */\nconst hasOwnObject = (target: Record<any, any>, key: string): boolean =>\n Object.hasOwn(target, key) && target[key] !== null && typeof target[key] === 'object'\n\n/**\n * Deep merge for objects.\n *\n * OpenAPI documents are untrusted input and can carry keys like `__proto__`, `constructor`, or\n * `prototype` (a schema is free to describe a property named `constructor`). Those keys are merged\n * as ordinary own data, so nothing is silently dropped, but the merge never writes through the\n * prototype chain, which would otherwise pollute `Object.prototype` for every object on the page.\n */\nexport function deepMerge(source: Record<any, any>, target: Record<any, any>): Record<any, any> {\n for (const [key, val] of Object.entries(source)) {\n if (val !== null && typeof val === 'object') {\n if (!hasOwnObject(target, key)) {\n // Match the shape of the source value rather than reaching through its prototype, which\n // also keeps objects created with a `null` prototype from throwing.\n defineOwnProperty(target, key, Array.isArray(val) ? [] : {})\n }\n deepMerge(val, target[key])\n } else if (typeof val !== 'undefined') {\n defineOwnProperty(target, key, val)\n }\n }\n\n return target\n}\n\n/**\n * Creates an empty specification object.\n * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.\n */\nexport function createEmptySpecification(partialSpecification?: Partial<OpenApiDocument>) {\n const emptySpecification = {\n openapi: '3.1.0',\n info: {\n title: '',\n description: '',\n termsOfService: '',\n version: '',\n license: {\n name: '',\n url: '',\n },\n contact: {\n email: '',\n },\n },\n servers: [],\n tags: [],\n 'x-scalar-original-document-hash': '',\n }\n\n if (!partialSpecification) {\n return emptySpecification as OpenApiDocument\n }\n\n deepMerge(partialSpecification, emptySpecification)\n\n return emptySpecification as OpenApiDocument\n}\n"],"mappings":";;;AAYA,IAAM,kBAAkB,UAA0C,OAAO,UAAU,YAAY,UAAU;;;;;AAMzG,SAAS,iBAAiB,KAAkE;CAC1F,IAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,UAAU,KACvD,OAAO,eAAe,IAAI,aAAa,IAAI,IAAI,gBAAgB,KAAA;CAGjE,OAAO;AACT;AAEA,SAAS,WAAW,QAAkB,OAAiC;CACrE,IAAI,CAAC,OACH;CAEF,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO,KAAK,KAAK;AAErB;;;;;;;;;;AAiBA,SAAS,wBAAwB,QAAkC,SAAyB,gBAAgB,GAAS;CACnH,IAAI,CAAC,UAAU,QAAQ,QAAQ,IAAI,MAAM,GACvC;CAEF,QAAQ,QAAQ,IAAI,MAAM;CAG1B;EADkB,GAAI,OAAO,SAAS,CAAC;EAAI,GAAI,OAAO,SAAS,CAAC;EAAI,GAAI,OAAO,SAAS,CAAC;CACzF,CAAA,CAAS,SAAS,eAAe;EAC/B,wBAAwB,iBAAiB,UAAU,GAAG,SAAS,aAAa;CAC9E,CAAC;CAED,IAAI,eAAe,MAAM,KAAK,OAAO,YACnC,OAAO,QAAQ,OAAO,UAAU,CAAC,CAAC,SAAS,CAAC,KAAK,aAAa;EAC5D,MAAM,WAAW,iBAAiB,OAAO;EACzC,QAAQ,MAAM,KAAK,QAAQ;EAC3B,IAAI,gBAAgB,IAAI,QAAQ,kBAC9B,wBAAwB,UAAU,SAAS,gBAAgB,CAAC;CAEhE,CA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
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-deep-clone.js","names":[],"sources":["../../src/helpers/safe-deep-clone.ts"],"sourcesContent":["import { deepClone } from '@scalar/workspace-store/helpers/deep-clone'\n\n/**\n * Deep-clones plain data for use where mutation must not affect the source.\n *\n * In the browser we use `structuredClone`, which preserves `Date`, `Map`, `Set`,\n * typed arrays, and other structured types. During SSR there is no `window`, so\n * we fall back to `JSON.parse(JSON.stringify(...))`, which only supports JSON\n * values (functions, `undefined` in objects, symbols, etc. are dropped or altered).\n *\n * @example\n * ```ts\n * const copy = safeDeepClone(spec)\n * copy.info.title = 'Draft'\n * // original spec is unchanged\n * ```\n */\nexport const safeDeepClone = <T>(value: T): T => {\n if (typeof window === 'undefined') {\n return deepClone(value)\n }\n return window.structuredClone(value) as T\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAa,iBAAoB,UAAgB;
|
|
1
|
+
{"version":3,"file":"safe-deep-clone.js","names":[],"sources":["../../src/helpers/safe-deep-clone.ts"],"sourcesContent":["import { deepClone } from '@scalar/workspace-store/helpers/deep-clone'\n\n/**\n * Deep-clones plain data for use where mutation must not affect the source.\n *\n * In the browser we use `structuredClone`, which preserves `Date`, `Map`, `Set`,\n * typed arrays, and other structured types. During SSR there is no `window`, so\n * we fall back to `JSON.parse(JSON.stringify(...))`, which only supports JSON\n * values (functions, `undefined` in objects, symbols, etc. are dropped or altered).\n *\n * @example\n * ```ts\n * const copy = safeDeepClone(spec)\n * copy.info.title = 'Draft'\n * // original spec is unchanged\n * ```\n */\nexport const safeDeepClone = <T>(value: T): T => {\n if (typeof window === 'undefined') {\n return deepClone(value)\n }\n return window.structuredClone(value) as T\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAa,iBAAoB,UAAgB;CAC/C,IAAI,OAAO,WAAW,aACpB,OAAO,UAAU,KAAK;CAExB,OAAO,OAAO,gBAAgB,KAAK;AACrC"}
|
|
@@ -120,6 +120,10 @@ export declare const authStorage: () => {
|
|
|
120
120
|
'x-scalar-secret-auth-url'?: string | undefined;
|
|
121
121
|
} & {
|
|
122
122
|
'x-scalar-secret-token-url'?: string | undefined;
|
|
123
|
+
} & {
|
|
124
|
+
'x-order'?: number | undefined;
|
|
125
|
+
} & {
|
|
126
|
+
'x-scalar-ignore'?: boolean | undefined;
|
|
123
127
|
} & {
|
|
124
128
|
authorizationUrl: string;
|
|
125
129
|
} & {
|
|
@@ -150,6 +154,10 @@ export declare const authStorage: () => {
|
|
|
150
154
|
'x-scalar-secret-auth-url'?: string | undefined;
|
|
151
155
|
} & {
|
|
152
156
|
'x-scalar-secret-token-url'?: string | undefined;
|
|
157
|
+
} & {
|
|
158
|
+
'x-order'?: number | undefined;
|
|
159
|
+
} & {
|
|
160
|
+
'x-scalar-ignore'?: boolean | undefined;
|
|
153
161
|
} & {
|
|
154
162
|
tokenUrl: string;
|
|
155
163
|
} & {
|
|
@@ -187,6 +195,10 @@ export declare const authStorage: () => {
|
|
|
187
195
|
'x-scalar-secret-auth-url'?: string | undefined;
|
|
188
196
|
} & {
|
|
189
197
|
'x-scalar-secret-token-url'?: string | undefined;
|
|
198
|
+
} & {
|
|
199
|
+
'x-order'?: number | undefined;
|
|
200
|
+
} & {
|
|
201
|
+
'x-scalar-ignore'?: boolean | undefined;
|
|
190
202
|
} & {
|
|
191
203
|
tokenUrl: string;
|
|
192
204
|
} & {
|
|
@@ -221,6 +233,10 @@ export declare const authStorage: () => {
|
|
|
221
233
|
'x-scalar-secret-auth-url'?: string | undefined;
|
|
222
234
|
} & {
|
|
223
235
|
'x-scalar-secret-token-url'?: string | undefined;
|
|
236
|
+
} & {
|
|
237
|
+
'x-order'?: number | undefined;
|
|
238
|
+
} & {
|
|
239
|
+
'x-scalar-ignore'?: boolean | undefined;
|
|
224
240
|
} & {
|
|
225
241
|
authorizationUrl: string;
|
|
226
242
|
tokenUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/helpers/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,uCAAuC,CAAA;AAM7E;;;GAGG;AACH,eAAO,MAAM,aAAa;IAGtB;;OAEG;;IAIH;;;OAGG;iBACU,MAAM;CAItB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAMpB;;OAEG;oBACa,MAAM
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/helpers/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,uCAAuC,CAAA;AAM7E;;;GAGG;AACH,eAAO,MAAM,aAAa;IAGtB;;OAEG;;IAIH;;;OAGG;iBACU,MAAM;CAItB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAMpB;;OAEG;oBACa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAItB;;;OAGG;oBACa,MAAM,SAAS,IAAI;CAItC,CAAA"}
|
package/dist/helpers/storage.js
CHANGED
|
@@ -10,9 +10,16 @@ var storage = safeLocalStorage();
|
|
|
10
10
|
var clientStorage = () => {
|
|
11
11
|
const key = REFERENCE_LS_KEYS.SELECTED_CLIENT;
|
|
12
12
|
return {
|
|
13
|
+
/**
|
|
14
|
+
* Gets the stored selected client from local storage.
|
|
15
|
+
*/
|
|
13
16
|
get: () => {
|
|
14
17
|
return storage.getItem(key);
|
|
15
18
|
},
|
|
19
|
+
/**
|
|
20
|
+
* Stores the selected client value in local storage.
|
|
21
|
+
* @param value The value to store
|
|
22
|
+
*/
|
|
16
23
|
set: (value) => {
|
|
17
24
|
storage.setItem(key, value);
|
|
18
25
|
}
|
|
@@ -28,9 +35,16 @@ var authStorage = () => {
|
|
|
28
35
|
return `${REFERENCE_LS_KEYS.AUTH}-${slug}`;
|
|
29
36
|
};
|
|
30
37
|
return {
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves and coerces the authentication schemes stored in local storage.
|
|
40
|
+
*/
|
|
31
41
|
getAuth: (slug) => {
|
|
32
42
|
return coerceValue(AuthSchema, JSON.parse(storage.getItem(getKey(slug)) ?? "{}"));
|
|
33
43
|
},
|
|
44
|
+
/**
|
|
45
|
+
* Stores the authentication schemes in local storage.
|
|
46
|
+
* @param value The Auth object to stringify and store.
|
|
47
|
+
*/
|
|
34
48
|
setAuth: (slug, value) => {
|
|
35
49
|
storage.setItem(getKey(slug), JSON.stringify(value));
|
|
36
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","names":[],"sources":["../../src/helpers/storage.ts"],"sourcesContent":["import { REFERENCE_LS_KEYS, safeLocalStorage } from '@scalar/helpers/object/local-storage'\nimport { type Auth, AuthSchema } from '@scalar/workspace-store/entities/auth'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\n\n// Local storage helper instance, safely wrapped.\nconst storage = safeLocalStorage()\n\n/**\n * Provides an interface to store and retrieve the selected client value\n * in local storage.\n */\nexport const clientStorage = () => {\n const key = REFERENCE_LS_KEYS.SELECTED_CLIENT\n return {\n /**\n * Gets the stored selected client from local storage.\n */\n get: () => {\n return storage.getItem(key)\n },\n /**\n * Stores the selected client value in local storage.\n * @param value The value to store\n */\n set: (value: string) => {\n storage.setItem(key, value as string)\n },\n }\n}\n\n/**\n * Provides an interface to store and retrieve authentication scheme\n * information in local storage, including both the available schemes and\n * the user's selected schemes.\n */\nexport const authStorage = () => {\n const getKey = (slug: string) => {\n return `${REFERENCE_LS_KEYS.AUTH}-${slug}`\n }\n\n return {\n /**\n * Retrieves and coerces the authentication schemes stored in local storage.\n */\n getAuth: (slug: string) => {\n const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? '{}')\n return coerceValue(AuthSchema, parsed)\n },\n /**\n * Stores the authentication schemes in local storage.\n * @param value The Auth object to stringify and store.\n */\n setAuth: (slug: string, value: Auth) => {\n storage.setItem(getKey(slug), JSON.stringify(value))\n },\n }\n}\n"],"mappings":";;;;AAKA,IAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"storage.js","names":[],"sources":["../../src/helpers/storage.ts"],"sourcesContent":["import { REFERENCE_LS_KEYS, safeLocalStorage } from '@scalar/helpers/object/local-storage'\nimport { type Auth, AuthSchema } from '@scalar/workspace-store/entities/auth'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\n\n// Local storage helper instance, safely wrapped.\nconst storage = safeLocalStorage()\n\n/**\n * Provides an interface to store and retrieve the selected client value\n * in local storage.\n */\nexport const clientStorage = () => {\n const key = REFERENCE_LS_KEYS.SELECTED_CLIENT\n return {\n /**\n * Gets the stored selected client from local storage.\n */\n get: () => {\n return storage.getItem(key)\n },\n /**\n * Stores the selected client value in local storage.\n * @param value The value to store\n */\n set: (value: string) => {\n storage.setItem(key, value as string)\n },\n }\n}\n\n/**\n * Provides an interface to store and retrieve authentication scheme\n * information in local storage, including both the available schemes and\n * the user's selected schemes.\n */\nexport const authStorage = () => {\n const getKey = (slug: string) => {\n return `${REFERENCE_LS_KEYS.AUTH}-${slug}`\n }\n\n return {\n /**\n * Retrieves and coerces the authentication schemes stored in local storage.\n */\n getAuth: (slug: string) => {\n const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? '{}')\n return coerceValue(AuthSchema, parsed)\n },\n /**\n * Stores the authentication schemes in local storage.\n * @param value The Auth object to stringify and store.\n */\n setAuth: (slug: string, value: Auth) => {\n storage.setItem(getKey(slug), JSON.stringify(value))\n },\n }\n}\n"],"mappings":";;;;AAKA,IAAM,UAAU,iBAAiB;;;;;AAMjC,IAAa,sBAAsB;CACjC,MAAM,MAAM,kBAAkB;CAC9B,OAAO;;;;EAIL,WAAW;GACT,OAAO,QAAQ,QAAQ,GAAG;EAC5B;;;;;EAKA,MAAM,UAAkB;GACtB,QAAQ,QAAQ,KAAK,KAAe;EACtC;CACF;AACF;;;;;;AAOA,IAAa,oBAAoB;CAC/B,MAAM,UAAU,SAAiB;EAC/B,OAAO,GAAG,kBAAkB,KAAK,GAAG;CACtC;CAEA,OAAO;;;;EAIL,UAAU,SAAiB;GAEzB,OAAO,YAAY,YADJ,KAAK,MAAM,QAAQ,QAAQ,OAAO,IAAI,CAAC,KAAK,IAC5B,CAAM;EACvC;;;;;EAKA,UAAU,MAAc,UAAgB;GACtC,QAAQ,QAAQ,OAAO,IAAI,GAAG,KAAK,UAAU,KAAK,CAAC;EACrD;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-temp-document.js","names":[],"sources":["../../src/helpers/upload-temp-document.ts"],"sourcesContent":["import { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport type { ExternalUrls } from '@scalar/types/api-reference'\n\n/** Type guard for the response body */\nfunction isResponseBody(data: unknown): data is { url: string } {\n return !!data && typeof data === 'object' && 'url' in data && typeof (data as any).url === 'string'\n}\n\n/** Upload a document and return a temporary URL */\nexport async function uploadTempDocument(\n document: string,\n urls: Pick<ExternalUrls, 'proxyUrl' | 'apiBaseUrl'>,\n): Promise<string> {\n const body = JSON.stringify({ document })\n const uploadUrl = `${urls.apiBaseUrl}/core/share/upload/apis`\n\n // Proxy the request to avoid localhost CORS issues\n const response = await fetch(redirectToProxy(urls.proxyUrl, uploadUrl), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body,\n })\n\n if (!response.ok) {\n throw new Error(` Failed to generate temporary link, server responded with ${response.status}`)\n }\n const data = (await response.json()) as unknown\n\n if (!isResponseBody(data)) {\n throw new Error('Failed to generate temporary link, invalid response from server')\n }\n\n return data.url\n}\n"],"mappings":";;;AAIA,SAAS,eAAe,MAAwC;
|
|
1
|
+
{"version":3,"file":"upload-temp-document.js","names":[],"sources":["../../src/helpers/upload-temp-document.ts"],"sourcesContent":["import { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport type { ExternalUrls } from '@scalar/types/api-reference'\n\n/** Type guard for the response body */\nfunction isResponseBody(data: unknown): data is { url: string } {\n return !!data && typeof data === 'object' && 'url' in data && typeof (data as any).url === 'string'\n}\n\n/** Upload a document and return a temporary URL */\nexport async function uploadTempDocument(\n document: string,\n urls: Pick<ExternalUrls, 'proxyUrl' | 'apiBaseUrl'>,\n): Promise<string> {\n const body = JSON.stringify({ document })\n const uploadUrl = `${urls.apiBaseUrl}/core/share/upload/apis`\n\n // Proxy the request to avoid localhost CORS issues\n const response = await fetch(redirectToProxy(urls.proxyUrl, uploadUrl), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body,\n })\n\n if (!response.ok) {\n throw new Error(` Failed to generate temporary link, server responded with ${response.status}`)\n }\n const data = (await response.json()) as unknown\n\n if (!isResponseBody(data)) {\n throw new Error('Failed to generate temporary link, invalid response from server')\n }\n\n return data.url\n}\n"],"mappings":";;;AAIA,SAAS,eAAe,MAAwC;CAC9D,OAAO,CAAC,CAAC,QAAQ,OAAO,SAAS,YAAY,SAAS,QAAQ,OAAQ,KAAa,QAAQ;AAC7F;;AAGA,eAAsB,mBACpB,UACA,MACiB;CACjB,MAAM,OAAO,KAAK,UAAU,EAAE,SAAS,CAAC;CACxC,MAAM,YAAY,GAAG,KAAK,WAAW;CAGrC,MAAM,WAAW,MAAM,MAAM,gBAAgB,KAAK,UAAU,SAAS,GAAG;EACtE,QAAQ;EACR,SAAS,EAAE,gBAAgB,mBAAmB;EAC9C;CACF,CAAC;CAED,IAAI,CAAC,SAAS,IACZ,MAAM,IAAI,MAAM,6DAA6D,SAAS,QAAQ;CAEhG,MAAM,OAAQ,MAAM,SAAS,KAAK;CAElC,IAAI,CAAC,eAAe,IAAI,GACtB,MAAM,IAAI,MAAM,iEAAiE;CAGnF,OAAO,KAAK;AACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-agent.js","names":[],"sources":["../../src/hooks/use-agent.ts"],"sourcesContent":["import { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport type { ComputedRef, Ref } from 'vue'\nimport { type InjectionKey, computed, inject, ref } from 'vue'\n\ntype UseAgentOptions = {\n /** Optional. When provided, controls whether the agent UI is enabled (e.g. from doc config). Defaults to isLocalUrl. */\n agentEnabled?: ComputedRef<boolean>\n}\n\ntype UseAgentReturn = {\n showAgent: Ref<boolean>\n agentEnabled: ComputedRef<boolean>\n /** Ref used to pass a prefill message into the agent when opening. Cleared on close. */\n prefilledMessage: Ref<string>\n openAgent: (message?: string) => void\n closeAgent: () => void\n toggleAgent: () => void\n}\n\nexport const AGENT_CONTEXT_SYMBOL = Symbol() as InjectionKey<UseAgentReturn>\n\n/**\n * Module-level ref so useAgentContext() can resolve context even when inject fails\n * (e.g. async component boundary or mount order). Set when ApiReference calls useAgent().\n */\nconst agentStateRef: Ref<UseAgentReturn | null> = ref(null)\n\n/**\n * Hook for agent visibility and enabled state.\n * Call from the API Reference root (e.g. ApiReference.vue) with options to create the state, then provide it so descendants can inject it.\n *\n * Returns:\n * - showAgent: whether the agent panel is visible\n * - agentEnabled: whether the agent is enabled\n * - openAgent, closeAgent, toggleAgent: imperative controls\n */\nexport function useAgent(options: UseAgentOptions): UseAgentReturn {\n const showAgent = ref(false)\n const prefilledMessage = ref('')\n\n const agentEnabled = options.agentEnabled ?? computed(() => isLocalUrl(window.location.href))\n\n const openAgent = (message?: string) => {\n prefilledMessage.value = message ?? ''\n showAgent.value = true\n }\n\n const closeAgent = () => {\n showAgent.value = false\n prefilledMessage.value = ''\n }\n\n const toggleAgent = () => {\n showAgent.value = !showAgent.value\n if (!showAgent.value) {\n prefilledMessage.value = ''\n }\n }\n\n const state: UseAgentReturn = {\n showAgent,\n agentEnabled,\n prefilledMessage,\n openAgent,\n closeAgent,\n toggleAgent,\n }\n agentStateRef.value = state\n return state\n}\n\n/**\n * Inject the agent context provided by ApiReference.\n * Falls back to module-level state when inject is undefined (e.g. async boundary or mount order).\n * Use in descendant components (e.g. AskAgentButton) to open the agent or check if it is enabled.\n *\n * Returns a computed ref; use v-if=\"agentContext?.agentEnabled\" so the button only renders when context exists and agent is enabled.\n */\nexport function useAgentContext(): ComputedRef<UseAgentReturn | undefined> {\n const injected = inject(AGENT_CONTEXT_SYMBOL, undefined)\n return computed((): UseAgentReturn | undefined => injected ?? agentStateRef.value ?? undefined)\n}\n"],"mappings":";;;AAmBA,IAAa,uBAAuB,
|
|
1
|
+
{"version":3,"file":"use-agent.js","names":[],"sources":["../../src/hooks/use-agent.ts"],"sourcesContent":["import { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport type { ComputedRef, Ref } from 'vue'\nimport { type InjectionKey, computed, inject, ref } from 'vue'\n\ntype UseAgentOptions = {\n /** Optional. When provided, controls whether the agent UI is enabled (e.g. from doc config). Defaults to isLocalUrl. */\n agentEnabled?: ComputedRef<boolean>\n}\n\ntype UseAgentReturn = {\n showAgent: Ref<boolean>\n agentEnabled: ComputedRef<boolean>\n /** Ref used to pass a prefill message into the agent when opening. Cleared on close. */\n prefilledMessage: Ref<string>\n openAgent: (message?: string) => void\n closeAgent: () => void\n toggleAgent: () => void\n}\n\nexport const AGENT_CONTEXT_SYMBOL = Symbol() as InjectionKey<UseAgentReturn>\n\n/**\n * Module-level ref so useAgentContext() can resolve context even when inject fails\n * (e.g. async component boundary or mount order). Set when ApiReference calls useAgent().\n */\nconst agentStateRef: Ref<UseAgentReturn | null> = ref(null)\n\n/**\n * Hook for agent visibility and enabled state.\n * Call from the API Reference root (e.g. ApiReference.vue) with options to create the state, then provide it so descendants can inject it.\n *\n * Returns:\n * - showAgent: whether the agent panel is visible\n * - agentEnabled: whether the agent is enabled\n * - openAgent, closeAgent, toggleAgent: imperative controls\n */\nexport function useAgent(options: UseAgentOptions): UseAgentReturn {\n const showAgent = ref(false)\n const prefilledMessage = ref('')\n\n const agentEnabled = options.agentEnabled ?? computed(() => isLocalUrl(window.location.href))\n\n const openAgent = (message?: string) => {\n prefilledMessage.value = message ?? ''\n showAgent.value = true\n }\n\n const closeAgent = () => {\n showAgent.value = false\n prefilledMessage.value = ''\n }\n\n const toggleAgent = () => {\n showAgent.value = !showAgent.value\n if (!showAgent.value) {\n prefilledMessage.value = ''\n }\n }\n\n const state: UseAgentReturn = {\n showAgent,\n agentEnabled,\n prefilledMessage,\n openAgent,\n closeAgent,\n toggleAgent,\n }\n agentStateRef.value = state\n return state\n}\n\n/**\n * Inject the agent context provided by ApiReference.\n * Falls back to module-level state when inject is undefined (e.g. async boundary or mount order).\n * Use in descendant components (e.g. AskAgentButton) to open the agent or check if it is enabled.\n *\n * Returns a computed ref; use v-if=\"agentContext?.agentEnabled\" so the button only renders when context exists and agent is enabled.\n */\nexport function useAgentContext(): ComputedRef<UseAgentReturn | undefined> {\n const injected = inject(AGENT_CONTEXT_SYMBOL, undefined)\n return computed((): UseAgentReturn | undefined => injected ?? agentStateRef.value ?? undefined)\n}\n"],"mappings":";;;AAmBA,IAAa,uBAAuB,OAAO;;;;;AAM3C,IAAM,gBAA4C,IAAI,IAAI;;;;;;;;;;AAW1D,SAAgB,SAAS,SAA0C;CACjE,MAAM,YAAY,IAAI,KAAK;CAC3B,MAAM,mBAAmB,IAAI,EAAE;CAE/B,MAAM,eAAe,QAAQ,gBAAgB,eAAe,WAAW,OAAO,SAAS,IAAI,CAAC;CAE5F,MAAM,aAAa,YAAqB;EACtC,iBAAiB,QAAQ,WAAW;EACpC,UAAU,QAAQ;CACpB;CAEA,MAAM,mBAAmB;EACvB,UAAU,QAAQ;EAClB,iBAAiB,QAAQ;CAC3B;CAEA,MAAM,oBAAoB;EACxB,UAAU,QAAQ,CAAC,UAAU;EAC7B,IAAI,CAAC,UAAU,OACb,iBAAiB,QAAQ;CAE7B;CAEA,MAAM,QAAwB;EAC5B;EACA;EACA;EACA;EACA;EACA;CACF;CACA,cAAc,QAAQ;CACtB,OAAO;AACT;;;;;;;;AASA,SAAgB,kBAA2D;CACzE,MAAM,WAAW,OAAO,sBAAsB,KAAA,CAAS;CACvD,OAAO,eAA2C,YAAY,cAAc,SAAS,KAAA,CAAS;AAChG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-intersection.js","names":[],"sources":["../../src/hooks/use-intersection.ts"],"sourcesContent":["import { useIntersectionObserver } from '@vueuse/core'\nimport { type TemplateRef, onMounted } from 'vue'\n\n/**\n * Shrinks the observation root to a thin horizontal strip at the vertical middle of\n * the viewport (~2% of viewport height). Emits only while the target overlaps that line.\n */\nconst VIEWPORT_VERTICAL_CENTER_ROOT_MARGIN = '-49% 0px -49% 0px'\n\ntype UseIntersectionOptions = {\n /** Called when the element stops intersecting. */\n onExit?: () => void\n /**\n * Whether to immediately fire the intersection as soon as the element is on the screen.\n *\n * When false (default) we use a root margin that is 2% of the viewport height on the middle of the viewport.\n */\n immediate?: boolean\n}\n\nexport const useIntersection = (\n el: TemplateRef<HTMLElement | undefined>,\n onIntersect: () => void,\n options?: UseIntersectionOptions,\n) => {\n onMounted(() => {\n const observerOptions = {\n rootMargin: options?.immediate ? '0px 0px 0px 0px' : VIEWPORT_VERTICAL_CENTER_ROOT_MARGIN,\n threshold: 0,\n } as const\n\n if (el.value) {\n useIntersectionObserver(\n el,\n ([entry]) => {\n if (entry?.isIntersecting) {\n onIntersect()\n } else {\n options?.onExit?.()\n }\n },\n observerOptions,\n )\n }\n })\n}\n"],"mappings":";;;;;;;AAOA,IAAM,uCAAuC;AAa7C,IAAa,mBACX,IACA,aACA,YACG;
|
|
1
|
+
{"version":3,"file":"use-intersection.js","names":[],"sources":["../../src/hooks/use-intersection.ts"],"sourcesContent":["import { useIntersectionObserver } from '@vueuse/core'\nimport { type TemplateRef, onMounted } from 'vue'\n\n/**\n * Shrinks the observation root to a thin horizontal strip at the vertical middle of\n * the viewport (~2% of viewport height). Emits only while the target overlaps that line.\n */\nconst VIEWPORT_VERTICAL_CENTER_ROOT_MARGIN = '-49% 0px -49% 0px'\n\ntype UseIntersectionOptions = {\n /** Called when the element stops intersecting. */\n onExit?: () => void\n /**\n * Whether to immediately fire the intersection as soon as the element is on the screen.\n *\n * When false (default) we use a root margin that is 2% of the viewport height on the middle of the viewport.\n */\n immediate?: boolean\n}\n\nexport const useIntersection = (\n el: TemplateRef<HTMLElement | undefined>,\n onIntersect: () => void,\n options?: UseIntersectionOptions,\n) => {\n onMounted(() => {\n const observerOptions = {\n rootMargin: options?.immediate ? '0px 0px 0px 0px' : VIEWPORT_VERTICAL_CENTER_ROOT_MARGIN,\n threshold: 0,\n } as const\n\n if (el.value) {\n useIntersectionObserver(\n el,\n ([entry]) => {\n if (entry?.isIntersecting) {\n onIntersect()\n } else {\n options?.onExit?.()\n }\n },\n observerOptions,\n )\n }\n })\n}\n"],"mappings":";;;;;;;AAOA,IAAM,uCAAuC;AAa7C,IAAa,mBACX,IACA,aACA,YACG;CACH,gBAAgB;EACd,MAAM,kBAAkB;GACtB,YAAY,SAAS,YAAY,oBAAoB;GACrD,WAAW;EACb;EAEA,IAAI,GAAG,OACL,wBACE,KACC,CAAC,WAAW;GACX,IAAI,OAAO,gBACT,YAAY;QAEZ,SAAS,SAAS;EAEtB,GACA,eACF;CAEJ,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePluginManager.js","names":[],"sources":["../../../src/plugins/hooks/usePluginManager.ts"],"sourcesContent":["import { type PluginManager, createPluginManager } from '@/plugins/plugin-manager'\nimport { type InjectionKey, inject } from 'vue'\n\nexport const PLUGIN_MANAGER_SYMBOL = Symbol() as InjectionKey<PluginManager>\n\n/**\n * Hook to access the plugin manager\n */\nexport const usePluginManager = (): PluginManager => {\n const manager = inject(PLUGIN_MANAGER_SYMBOL)\n\n // No plugin manager provided, creating a new one.\n if (!manager) {\n return createPluginManager({})\n }\n\n return manager\n}\n"],"mappings":";;;AAGA,IAAa,wBAAwB,
|
|
1
|
+
{"version":3,"file":"usePluginManager.js","names":[],"sources":["../../../src/plugins/hooks/usePluginManager.ts"],"sourcesContent":["import { type PluginManager, createPluginManager } from '@/plugins/plugin-manager'\nimport { type InjectionKey, inject } from 'vue'\n\nexport const PLUGIN_MANAGER_SYMBOL = Symbol() as InjectionKey<PluginManager>\n\n/**\n * Hook to access the plugin manager\n */\nexport const usePluginManager = (): PluginManager => {\n const manager = inject(PLUGIN_MANAGER_SYMBOL)\n\n // No plugin manager provided, creating a new one.\n if (!manager) {\n return createPluginManager({})\n }\n\n return manager\n}\n"],"mappings":";;;AAGA,IAAa,wBAAwB,OAAO;;;;AAK5C,IAAa,yBAAwC;CACnD,MAAM,UAAU,OAAO,qBAAqB;CAG5C,IAAI,CAAC,SACH,OAAO,oBAAoB,CAAC,CAAC;CAG/B,OAAO;AACT"}
|
|
@@ -15,7 +15,12 @@ var persistencePlugin = ({ debounceDelay = 500, maxWait = 1e4, persistAuth = fal
|
|
|
15
15
|
if (typeof persistAuth === "function") return persistAuth();
|
|
16
16
|
return persistAuth;
|
|
17
17
|
};
|
|
18
|
-
return { hooks: {
|
|
18
|
+
return { hooks: {
|
|
19
|
+
/**
|
|
20
|
+
* Handles all workspace state change events.
|
|
21
|
+
* Each write is debounced by a key to prevent frequent writes for the same entity.
|
|
22
|
+
*/
|
|
23
|
+
onWorkspaceStateChanges(event) {
|
|
19
24
|
if (event.type === "meta") {
|
|
20
25
|
const defaultClient = event.value["x-scalar-default-client"];
|
|
21
26
|
if (defaultClient !== void 0) execute("x-scalar-default-client", () => clientPersistence.set(defaultClient));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence-plugin.js","names":[],"sources":["../../src/plugins/persistence-plugin.ts"],"sourcesContent":["import { debounce } from '@scalar/helpers/general/debounce'\nimport type { WorkspacePlugin } from '@scalar/workspace-store/workspace-plugin'\n\nimport { authStorage, clientStorage } from '@/helpers/storage'\n\n/**\n * Plugin to persist workspace state changes with debounced writes.\n */\nexport const persistencePlugin = ({\n debounceDelay = 500,\n maxWait = 10000,\n persistAuth = false,\n}: {\n debounceDelay?: number\n /** Maximum time in milliseconds to wait before forcing execution, even with continuous calls. */\n maxWait?: number\n /**\n * Determines whether authentication details should be persisted.\n * Accepts a boolean or a function that returns a boolean.\n * Allows for conditional persistence logic, e.g., based on environment or user settings.\n */\n persistAuth?: boolean | (() => boolean)\n}): WorkspacePlugin => {\n // Debounced execute function for batching similar state changes\n const { execute } = debounce({ delay: debounceDelay, maxWait })\n const authPersistence = authStorage()\n const clientPersistence = clientStorage()\n\n const getPersistAuth = () => {\n if (typeof persistAuth === 'function') {\n return persistAuth()\n }\n\n return persistAuth\n }\n\n return {\n hooks: {\n /**\n * Handles all workspace state change events.\n * Each write is debounced by a key to prevent frequent writes for the same entity.\n */\n onWorkspaceStateChanges(event) {\n // If the event is for workspace meta data, debounce by workspaceId\n if (event.type === 'meta') {\n // Persist the meta fields\n const defaultClient = event.value['x-scalar-default-client']\n if (defaultClient !== undefined) {\n execute('x-scalar-default-client', () => clientPersistence.set(defaultClient))\n }\n return\n }\n\n // Persist auth and [server](TODO)\n // Use event.documentName as both the debounce key and the storage key so that\n // concurrent auth changes across multiple documents do not clobber each other and\n // the correct slug is used even when the active document has already changed.\n if (getPersistAuth() && event.type === 'auth') {\n execute(`auth-${event.documentName}`, () => authPersistence.setAuth(event.documentName, event.value))\n }\n\n // No action for other event types\n return\n },\n },\n }\n}\n"],"mappings":";;;;;;AAQA,IAAa,qBAAqB,EAChC,gBAAgB,KAChB,UAAU,KACV,cAAc,YAWO;CAErB,MAAM,EAAE,YAAY,SAAS;EAAE,OAAO;EAAe;
|
|
1
|
+
{"version":3,"file":"persistence-plugin.js","names":[],"sources":["../../src/plugins/persistence-plugin.ts"],"sourcesContent":["import { debounce } from '@scalar/helpers/general/debounce'\nimport type { WorkspacePlugin } from '@scalar/workspace-store/workspace-plugin'\n\nimport { authStorage, clientStorage } from '@/helpers/storage'\n\n/**\n * Plugin to persist workspace state changes with debounced writes.\n */\nexport const persistencePlugin = ({\n debounceDelay = 500,\n maxWait = 10000,\n persistAuth = false,\n}: {\n debounceDelay?: number\n /** Maximum time in milliseconds to wait before forcing execution, even with continuous calls. */\n maxWait?: number\n /**\n * Determines whether authentication details should be persisted.\n * Accepts a boolean or a function that returns a boolean.\n * Allows for conditional persistence logic, e.g., based on environment or user settings.\n */\n persistAuth?: boolean | (() => boolean)\n}): WorkspacePlugin => {\n // Debounced execute function for batching similar state changes\n const { execute } = debounce({ delay: debounceDelay, maxWait })\n const authPersistence = authStorage()\n const clientPersistence = clientStorage()\n\n const getPersistAuth = () => {\n if (typeof persistAuth === 'function') {\n return persistAuth()\n }\n\n return persistAuth\n }\n\n return {\n hooks: {\n /**\n * Handles all workspace state change events.\n * Each write is debounced by a key to prevent frequent writes for the same entity.\n */\n onWorkspaceStateChanges(event) {\n // If the event is for workspace meta data, debounce by workspaceId\n if (event.type === 'meta') {\n // Persist the meta fields\n const defaultClient = event.value['x-scalar-default-client']\n if (defaultClient !== undefined) {\n execute('x-scalar-default-client', () => clientPersistence.set(defaultClient))\n }\n return\n }\n\n // Persist auth and [server](TODO)\n // Use event.documentName as both the debounce key and the storage key so that\n // concurrent auth changes across multiple documents do not clobber each other and\n // the correct slug is used even when the active document has already changed.\n if (getPersistAuth() && event.type === 'auth') {\n execute(`auth-${event.documentName}`, () => authPersistence.setAuth(event.documentName, event.value))\n }\n\n // No action for other event types\n return\n },\n },\n }\n}\n"],"mappings":";;;;;;AAQA,IAAa,qBAAqB,EAChC,gBAAgB,KAChB,UAAU,KACV,cAAc,YAWO;CAErB,MAAM,EAAE,YAAY,SAAS;EAAE,OAAO;EAAe;CAAQ,CAAC;CAC9D,MAAM,kBAAkB,YAAY;CACpC,MAAM,oBAAoB,cAAc;CAExC,MAAM,uBAAuB;EAC3B,IAAI,OAAO,gBAAgB,YACzB,OAAO,YAAY;EAGrB,OAAO;CACT;CAEA,OAAO,EACL,OAAO;;;;;AAKL,wBAAwB,OAAO;EAE7B,IAAI,MAAM,SAAS,QAAQ;GAEzB,MAAM,gBAAgB,MAAM,MAAM;GAClC,IAAI,kBAAkB,KAAA,GACpB,QAAQ,iCAAiC,kBAAkB,IAAI,aAAa,CAAC;GAE/E;EACF;EAMA,IAAI,eAAe,KAAK,MAAM,SAAS,QACrC,QAAQ,QAAQ,MAAM,sBAAsB,gBAAgB,QAAQ,MAAM,cAAc,MAAM,KAAK,CAAC;CAKxG,EACF,EACF;AACF"}
|