@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":"format-value.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/format-value.ts"],"sourcesContent":["/**\n * Converts a value to a string that can be displayed in the UI.\n */\nexport function formatValue(value: unknown): string | number {\n if (Array.isArray(value)) {\n return `[${value\n .map((item) => {\n if (typeof item === 'string') {\n return `\"${item.toString().trim()}\"`\n }\n\n if (typeof item === 'object') {\n return JSON.stringify(item)\n }\n\n if (item === undefined) {\n return 'undefined'\n }\n\n if (item === null) {\n return 'null'\n }\n\n return item\n })\n .join(', ')}]`\n }\n\n if (value === null) {\n return 'null'\n }\n\n if (typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n if (value === undefined) {\n return 'undefined'\n }\n\n if (typeof value === 'string') {\n return value.trim()\n }\n\n return value.toString().trim()\n}\n"],"mappings":";;;;AAGA,SAAgB,YAAY,OAAiC;
|
|
1
|
+
{"version":3,"file":"format-value.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/format-value.ts"],"sourcesContent":["/**\n * Converts a value to a string that can be displayed in the UI.\n */\nexport function formatValue(value: unknown): string | number {\n if (Array.isArray(value)) {\n return `[${value\n .map((item) => {\n if (typeof item === 'string') {\n return `\"${item.toString().trim()}\"`\n }\n\n if (typeof item === 'object') {\n return JSON.stringify(item)\n }\n\n if (item === undefined) {\n return 'undefined'\n }\n\n if (item === null) {\n return 'null'\n }\n\n return item\n })\n .join(', ')}]`\n }\n\n if (value === null) {\n return 'null'\n }\n\n if (typeof value === 'object') {\n return JSON.stringify(value)\n }\n\n if (value === undefined) {\n return 'undefined'\n }\n\n if (typeof value === 'string') {\n return value.trim()\n }\n\n return value.toString().trim()\n}\n"],"mappings":";;;;AAGA,SAAgB,YAAY,OAAiC;CAC3D,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,IAAI,MACR,KAAK,SAAS;EACb,IAAI,OAAO,SAAS,UAClB,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,KAAK,EAAE;EAGpC,IAAI,OAAO,SAAS,UAClB,OAAO,KAAK,UAAU,IAAI;EAG5B,IAAI,SAAS,KAAA,GACX,OAAO;EAGT,IAAI,SAAS,MACX,OAAO;EAGT,OAAO;CACT,CAAC,CAAC,CACD,KAAK,IAAI,EAAE;CAGhB,IAAI,UAAU,MACZ,OAAO;CAGT,IAAI,OAAO,UAAU,UACnB,OAAO,KAAK,UAAU,KAAK;CAG7B,IAAI,UAAU,KAAA,GACZ,OAAO;CAGT,IAAI,OAAO,UAAU,UACnB,OAAO,MAAM,KAAK;CAGpB,OAAO,MAAM,SAAS,CAAC,CAAC,KAAK;AAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-compositions-to-render.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-compositions-to-render.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { OpenApiDocument, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\nimport { getRefName } from './get-ref-name'\nimport { type CompositionKeyword, compositions } from './schema-composition'\nimport { shouldRenderArrayItemComposition } from './should-render-array-item-composition'\n\ntype CompositionToRender = {\n composition: CompositionKeyword\n value: SchemaObject\n}\n\ntype DocumentSchemaLookup = Pick<OpenApiDocument, 'components'>\n\nconst normalizeDiscriminatorMappingRef = (value: string) =>\n value.startsWith('#/') || value.includes('/') ? value : `#/components/schemas/${value}`\n\n/**\n * Builds a synthetic `oneOf` composition from a `discriminator.mapping` when the\n * schema declares a mapping but no explicit `oneOf`/`anyOf`. This is the shape\n * NSwag emits for polymorphic types, where the base type is a plain object with\n * a discriminator mapping pointing at the concrete variants.\n *\n * Returns `null` when there is nothing to infer (an explicit composition is\n * already present, no document to resolve refs against, or no resolvable refs).\n */\nexport const inferDiscriminatorMappingComposition = (\n value: SchemaObject,\n document?: DocumentSchemaLookup,\n): SchemaObject | null => {\n if (value.oneOf || value.anyOf || !document?.components?.schemas) {\n return null\n }\n\n const refs = Object.values(value.discriminator?.mapping ?? {})\n .filter((mappingValue): mappingValue is string => typeof mappingValue === 'string')\n .map((mappingValue) => {\n const ref = normalizeDiscriminatorMappingRef(mappingValue)\n const refName = getRefName(ref)\n const refValue = refName ? resolve.schema(document.components?.schemas?.[refName]) : undefined\n\n if (!refValue) {\n return undefined\n }\n\n return {\n $ref: ref,\n '$ref-value': refValue,\n }\n })\n .filter(isDefined)\n\n if (refs.length === 0) {\n return null\n }\n\n return {\n ...resolve.schema(value),\n oneOf: refs as NonNullable<SchemaObject['oneOf']>,\n }\n}\n\n/**\n * Computes which compositions should be rendered and with which values\n *\n * @param value - The schema object to check for compositions\n * @returns Array of compositions to render with their values\n */\nexport const getCompositionsToRender = (\n value: SchemaObject | undefined,\n document?: DocumentSchemaLookup,\n): CompositionToRender[] => {\n if (!value) {\n return []\n }\n\n const inferredDiscriminatorComposition = inferDiscriminatorMappingComposition(value, document)\n\n return compositions\n .map((composition) => {\n if (composition === 'oneOf' && inferredDiscriminatorComposition) {\n return {\n composition,\n value: inferredDiscriminatorComposition,\n }\n }\n\n // Check for array item-level composition first (more specific case)\n if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) {\n return {\n composition,\n value: resolve.schema(value.items),\n }\n }\n\n // Check for property-level composition\n if (value[composition]) {\n // Skip if array items have this composition (even if complex/not rendered)\n const hasArrayItemComposition =\n isArraySchema(value) && value.items && typeof value.items === 'object' && composition in value.items\n\n if (!hasArrayItemComposition) {\n return {\n composition,\n value: resolve.schema(value),\n }\n }\n }\n\n return null\n })\n .filter(isDefined)\n}\n"],"mappings":";;;;;;;AAgBA,IAAM,oCAAoC,UACxC,MAAM,WAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"get-compositions-to-render.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-compositions-to-render.ts"],"sourcesContent":["import { isDefined } from '@scalar/helpers/array/is-defined'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { OpenApiDocument, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\nimport { getRefName } from './get-ref-name'\nimport { type CompositionKeyword, compositions } from './schema-composition'\nimport { shouldRenderArrayItemComposition } from './should-render-array-item-composition'\n\ntype CompositionToRender = {\n composition: CompositionKeyword\n value: SchemaObject\n}\n\ntype DocumentSchemaLookup = Pick<OpenApiDocument, 'components'>\n\nconst normalizeDiscriminatorMappingRef = (value: string) =>\n value.startsWith('#/') || value.includes('/') ? value : `#/components/schemas/${value}`\n\n/**\n * Builds a synthetic `oneOf` composition from a `discriminator.mapping` when the\n * schema declares a mapping but no explicit `oneOf`/`anyOf`. This is the shape\n * NSwag emits for polymorphic types, where the base type is a plain object with\n * a discriminator mapping pointing at the concrete variants.\n *\n * Returns `null` when there is nothing to infer (an explicit composition is\n * already present, no document to resolve refs against, or no resolvable refs).\n */\nexport const inferDiscriminatorMappingComposition = (\n value: SchemaObject,\n document?: DocumentSchemaLookup,\n): SchemaObject | null => {\n if (value.oneOf || value.anyOf || !document?.components?.schemas) {\n return null\n }\n\n const refs = Object.values(value.discriminator?.mapping ?? {})\n .filter((mappingValue): mappingValue is string => typeof mappingValue === 'string')\n .map((mappingValue) => {\n const ref = normalizeDiscriminatorMappingRef(mappingValue)\n const refName = getRefName(ref)\n const refValue = refName ? resolve.schema(document.components?.schemas?.[refName]) : undefined\n\n if (!refValue) {\n return undefined\n }\n\n return {\n $ref: ref,\n '$ref-value': refValue,\n }\n })\n .filter(isDefined)\n\n if (refs.length === 0) {\n return null\n }\n\n return {\n ...resolve.schema(value),\n oneOf: refs as NonNullable<SchemaObject['oneOf']>,\n }\n}\n\n/**\n * Computes which compositions should be rendered and with which values\n *\n * @param value - The schema object to check for compositions\n * @returns Array of compositions to render with their values\n */\nexport const getCompositionsToRender = (\n value: SchemaObject | undefined,\n document?: DocumentSchemaLookup,\n): CompositionToRender[] => {\n if (!value) {\n return []\n }\n\n const inferredDiscriminatorComposition = inferDiscriminatorMappingComposition(value, document)\n\n return compositions\n .map((composition) => {\n if (composition === 'oneOf' && inferredDiscriminatorComposition) {\n return {\n composition,\n value: inferredDiscriminatorComposition,\n }\n }\n\n // Check for array item-level composition first (more specific case)\n if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) {\n return {\n composition,\n value: resolve.schema(value.items),\n }\n }\n\n // Check for property-level composition\n if (value[composition]) {\n // Skip if array items have this composition (even if complex/not rendered)\n const hasArrayItemComposition =\n isArraySchema(value) && value.items && typeof value.items === 'object' && composition in value.items\n\n if (!hasArrayItemComposition) {\n return {\n composition,\n value: resolve.schema(value),\n }\n }\n }\n\n return null\n })\n .filter(isDefined)\n}\n"],"mappings":";;;;;;;AAgBA,IAAM,oCAAoC,UACxC,MAAM,WAAW,IAAI,KAAK,MAAM,SAAS,GAAG,IAAI,QAAQ,wBAAwB;;;;;;;;;;AAWlF,IAAa,wCACX,OACA,aACwB;CACxB,IAAI,MAAM,SAAS,MAAM,SAAS,CAAC,UAAU,YAAY,SACvD,OAAO;CAGT,MAAM,OAAO,OAAO,OAAO,MAAM,eAAe,WAAW,CAAC,CAAC,CAAC,CAC3D,QAAQ,iBAAyC,OAAO,iBAAiB,QAAQ,CAAC,CAClF,KAAK,iBAAiB;EACrB,MAAM,MAAM,iCAAiC,YAAY;EACzD,MAAM,UAAU,WAAW,GAAG;EAC9B,MAAM,WAAW,UAAU,QAAQ,OAAO,SAAS,YAAY,UAAU,QAAQ,IAAI,KAAA;EAErF,IAAI,CAAC,UACH;EAGF,OAAO;GACL,MAAM;GACN,cAAc;EAChB;CACF,CAAC,CAAC,CACD,OAAO,SAAS;CAEnB,IAAI,KAAK,WAAW,GAClB,OAAO;CAGT,OAAO;EACL,GAAG,QAAQ,OAAO,KAAK;EACvB,OAAO;CACT;AACF;;;;;;;AAQA,IAAa,2BACX,OACA,aAC0B;CAC1B,IAAI,CAAC,OACH,OAAO,CAAC;CAGV,MAAM,mCAAmC,qCAAqC,OAAO,QAAQ;CAE7F,OAAO,aACJ,KAAK,gBAAgB;EACpB,IAAI,gBAAgB,WAAW,kCAC7B,OAAO;GACL;GACA,OAAO;EACT;EAIF,IAAI,iCAAiC,OAAO,WAAW,KAAK,cAAc,KAAK,KAAK,MAAM,OACxF,OAAO;GACL;GACA,OAAO,QAAQ,OAAO,MAAM,KAAK;EACnC;EAIF,IAAI,MAAM;OAKJ,EAFF,cAAc,KAAK,KAAK,MAAM,SAAS,OAAO,MAAM,UAAU,YAAY,eAAe,MAAM,QAG/F,OAAO;IACL;IACA,OAAO,QAAQ,OAAO,KAAK;GAC7B;EAAA;EAIJ,OAAO;CACT,CAAC,CAAC,CACD,OAAO,SAAS;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-enum-values.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-enum-values.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Extract enum values from schema or array items\n *\n * @param value - The schema object to extract enum values from\n * @returns Array of enum values, or empty array if no enum found\n */\nexport const getEnumValues = (value: SchemaObject | undefined): unknown[] => {\n if (!value) {\n return []\n }\n\n // Check for enum directly on the schema\n if (value.enum) {\n return value.enum\n }\n\n // Check for enum in array items (resolving $ref if present)\n if (isArraySchema(value) && typeof value.items === 'object') {\n const resolvedItems = resolve.schema(value.items)\n if (resolvedItems && 'enum' in resolvedItems && resolvedItems.enum) {\n return resolvedItems.enum\n }\n }\n\n return []\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,iBAAiB,UAA+C;
|
|
1
|
+
{"version":3,"file":"get-enum-values.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-enum-values.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Extract enum values from schema or array items\n *\n * @param value - The schema object to extract enum values from\n * @returns Array of enum values, or empty array if no enum found\n */\nexport const getEnumValues = (value: SchemaObject | undefined): unknown[] => {\n if (!value) {\n return []\n }\n\n // Check for enum directly on the schema\n if (value.enum) {\n return value.enum\n }\n\n // Check for enum in array items (resolving $ref if present)\n if (isArraySchema(value) && typeof value.items === 'object') {\n const resolvedItems = resolve.schema(value.items)\n if (resolvedItems && 'enum' in resolvedItems && resolvedItems.enum) {\n return resolvedItems.enum\n }\n }\n\n return []\n}\n"],"mappings":";;;;;;;;;AAUA,IAAa,iBAAiB,UAA+C;CAC3E,IAAI,CAAC,OACH,OAAO,CAAC;CAIV,IAAI,MAAM,MACR,OAAO,MAAM;CAIf,IAAI,cAAc,KAAK,KAAK,OAAO,MAAM,UAAU,UAAU;EAC3D,MAAM,gBAAgB,QAAQ,OAAO,MAAM,KAAK;EAChD,IAAI,iBAAiB,UAAU,iBAAiB,cAAc,MAC5D,OAAO,cAAc;CAEzB;CAEA,OAAO,CAAC;AACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-property-description.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-property-description.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isSchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n// Type descriptions for built-in types\nconst TYPE_DESCRIPTIONS: Record<string, Record<string, string>> = {\n integer: {\n _default: 'Integer numbers.',\n int32: 'Signed 32-bit integers (commonly used integer type).',\n int64: 'Signed 64-bit integers (long type).',\n },\n string: {\n 'date': 'full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21',\n 'date-time': 'the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z',\n 'password': 'a hint to UIs to mask the input',\n 'base64': 'base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==',\n 'byte': 'base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==',\n 'binary': 'binary data, used to describe files',\n },\n} as const\n\n/**\n * Generate property description from type/format\n *\n * @param value - The schema object to generate description from\n * @returns Description string or null if no description available\n */\nexport const getPropertyDescription = (value: SchemaObject | undefined): string | null => {\n if (!isSchema(value)) {\n return null\n }\n /** Just grab the first type from the array if it's an array */\n const type = Array.isArray(value.type) ? value.type[0] : value.type\n if (!type) {\n return null\n }\n\n const typeDescriptions = TYPE_DESCRIPTIONS[type]\n if (!typeDescriptions) {\n return null\n }\n\n const format =\n ('format' in value && value.format) || ('contentEncoding' in value && value.contentEncoding) || '_default'\n return typeDescriptions[format] ?? null\n}\n"],"mappings":";;AAIA,IAAM,oBAA4D;CAChE,SAAS;EACP,UAAU;EACV,OAAO;EACP,OAAO;
|
|
1
|
+
{"version":3,"file":"get-property-description.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-property-description.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isSchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n// Type descriptions for built-in types\nconst TYPE_DESCRIPTIONS: Record<string, Record<string, string>> = {\n integer: {\n _default: 'Integer numbers.',\n int32: 'Signed 32-bit integers (commonly used integer type).',\n int64: 'Signed 64-bit integers (long type).',\n },\n string: {\n 'date': 'full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21',\n 'date-time': 'the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z',\n 'password': 'a hint to UIs to mask the input',\n 'base64': 'base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==',\n 'byte': 'base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==',\n 'binary': 'binary data, used to describe files',\n },\n} as const\n\n/**\n * Generate property description from type/format\n *\n * @param value - The schema object to generate description from\n * @returns Description string or null if no description available\n */\nexport const getPropertyDescription = (value: SchemaObject | undefined): string | null => {\n if (!isSchema(value)) {\n return null\n }\n /** Just grab the first type from the array if it's an array */\n const type = Array.isArray(value.type) ? value.type[0] : value.type\n if (!type) {\n return null\n }\n\n const typeDescriptions = TYPE_DESCRIPTIONS[type]\n if (!typeDescriptions) {\n return null\n }\n\n const format =\n ('format' in value && value.format) || ('contentEncoding' in value && value.contentEncoding) || '_default'\n return typeDescriptions[format] ?? null\n}\n"],"mappings":";;AAIA,IAAM,oBAA4D;CAChE,SAAS;EACP,UAAU;EACV,OAAO;EACP,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,UAAU;EACV,QAAQ;EACR,UAAU;CACZ;AACF;;;;;;;AAQA,IAAa,0BAA0B,UAAmD;CACxF,IAAI,CAAC,SAAS,KAAK,GACjB,OAAO;;CAGT,MAAM,OAAO,MAAM,QAAQ,MAAM,IAAI,IAAI,MAAM,KAAK,KAAK,MAAM;CAC/D,IAAI,CAAC,MACH,OAAO;CAGT,MAAM,mBAAmB,kBAAkB;CAC3C,IAAI,CAAC,kBACH,OAAO;CAKT,OAAO,iBADJ,YAAY,SAAS,MAAM,UAAY,qBAAqB,SAAS,MAAM,mBAAoB,eAC/D;AACrC"}
|
|
@@ -6,4 +6,20 @@
|
|
|
6
6
|
* @example SchemaName from #/components/schemas/SchemaName
|
|
7
7
|
*/
|
|
8
8
|
export declare const getRefName: (ref: string) => string | null | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the models-section key for a `$ref`, but only when the ref actually
|
|
11
|
+
* targets `#/components/schemas/`.
|
|
12
|
+
*
|
|
13
|
+
* The models index used for navigation is built exclusively from
|
|
14
|
+
* `components.schemas`, so a ref into any other bucket (`parameters`,
|
|
15
|
+
* `responses`, ...) or an external file (`./other.yaml#/Foo`) has no navigable
|
|
16
|
+
* target. Returning `null` for those keeps the name visible as plain text while
|
|
17
|
+
* avoiding a dead link.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* getSchemaRefName('#/components/schemas/Planet') // 'Planet'
|
|
21
|
+
* getSchemaRefName('#/components/parameters/Planet') // null
|
|
22
|
+
* getSchemaRefName('./planets.yaml#/Planet') // null
|
|
23
|
+
*/
|
|
24
|
+
export declare const getSchemaRefName: (ref: string) => string | null;
|
|
9
25
|
//# sourceMappingURL=get-ref-name.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ref-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,8BAWrC,CAAA"}
|
|
1
|
+
{"version":3,"file":"get-ref-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,8BAWrC,CAAA;AASD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,IAWvD,CAAA"}
|
|
@@ -13,7 +13,34 @@ var getRefName = (ref) => {
|
|
|
13
13
|
if (match) return match[1];
|
|
14
14
|
return null;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Matches a local reference that points at `#/components/schemas/<name>` and
|
|
18
|
+
* captures the schema name. Intentionally strict: only refs that resolve to a
|
|
19
|
+
* navigable model in `components.schemas` should be linkable.
|
|
20
|
+
*/
|
|
21
|
+
var COMPONENTS_SCHEMAS_REF = /^#\/components\/schemas\/([^/]+)$/;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the models-section key for a `$ref`, but only when the ref actually
|
|
24
|
+
* targets `#/components/schemas/`.
|
|
25
|
+
*
|
|
26
|
+
* The models index used for navigation is built exclusively from
|
|
27
|
+
* `components.schemas`, so a ref into any other bucket (`parameters`,
|
|
28
|
+
* `responses`, ...) or an external file (`./other.yaml#/Foo`) has no navigable
|
|
29
|
+
* target. Returning `null` for those keeps the name visible as plain text while
|
|
30
|
+
* avoiding a dead link.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* getSchemaRefName('#/components/schemas/Planet') // 'Planet'
|
|
34
|
+
* getSchemaRefName('#/components/parameters/Planet') // null
|
|
35
|
+
* getSchemaRefName('./planets.yaml#/Planet') // null
|
|
36
|
+
*/
|
|
37
|
+
var getSchemaRefName = (ref) => {
|
|
38
|
+
if (!ref) return null;
|
|
39
|
+
const match = ref.match(COMPONENTS_SCHEMAS_REF);
|
|
40
|
+
if (match?.[1]) return decodeURIComponent(match[1]);
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
16
43
|
//#endregion
|
|
17
|
-
export { getRefName };
|
|
44
|
+
export { getRefName, getSchemaRefName };
|
|
18
45
|
|
|
19
46
|
//# sourceMappingURL=get-ref-name.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-ref-name.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\n\n/**\n * Gets the \"name\" of the schema from the ref path\n * TODO: this will change so fix it when the new refs are out\n * Then add tests\n *\n * @example SchemaName from #/components/schemas/SchemaName\n */\nexport const getRefName = (ref: string) => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(REGEX.REF_NAME)\n if (match) {\n return match[1]\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;AASA,IAAa,cAAc,QAAgB;
|
|
1
|
+
{"version":3,"file":"get-ref-name.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\n\n/**\n * Gets the \"name\" of the schema from the ref path\n * TODO: this will change so fix it when the new refs are out\n * Then add tests\n *\n * @example SchemaName from #/components/schemas/SchemaName\n */\nexport const getRefName = (ref: string) => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(REGEX.REF_NAME)\n if (match) {\n return match[1]\n }\n\n return null\n}\n\n/**\n * Matches a local reference that points at `#/components/schemas/<name>` and\n * captures the schema name. Intentionally strict: only refs that resolve to a\n * navigable model in `components.schemas` should be linkable.\n */\nconst COMPONENTS_SCHEMAS_REF = /^#\\/components\\/schemas\\/([^/]+)$/\n\n/**\n * Gets the models-section key for a `$ref`, but only when the ref actually\n * targets `#/components/schemas/`.\n *\n * The models index used for navigation is built exclusively from\n * `components.schemas`, so a ref into any other bucket (`parameters`,\n * `responses`, ...) or an external file (`./other.yaml#/Foo`) has no navigable\n * target. Returning `null` for those keeps the name visible as plain text while\n * avoiding a dead link.\n *\n * @example\n * getSchemaRefName('#/components/schemas/Planet') // 'Planet'\n * getSchemaRefName('#/components/parameters/Planet') // null\n * getSchemaRefName('./planets.yaml#/Planet') // null\n */\nexport const getSchemaRefName = (ref: string): string | null => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(COMPONENTS_SCHEMAS_REF)\n if (match?.[1]) {\n return decodeURIComponent(match[1])\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;AASA,IAAa,cAAc,QAAgB;CACzC,IAAI,CAAC,KACH,OAAO;CAGT,MAAM,QAAQ,IAAI,MAAM,MAAM,QAAQ;CACtC,IAAI,OACF,OAAO,MAAM;CAGf,OAAO;AACT;;;;;;AAOA,IAAM,yBAAyB;;;;;;;;;;;;;;;;AAiB/B,IAAa,oBAAoB,QAA+B;CAC9D,IAAI,CAAC,KACH,OAAO;CAGT,MAAM,QAAQ,IAAI,MAAM,sBAAsB;CAC9C,IAAI,QAAQ,IACV,OAAO,mBAAmB,MAAM,EAAE;CAGpC,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-schema-type.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Formats an array type string with proper wrapping for union types.\n */\nconst formatArrayType = (itemType: string): string => {\n if (!itemType) {\n return 'array'\n }\n\n const wrappedItemType = itemType.includes(' | ') ? `(${itemType})` : itemType\n return `array ${wrappedItemType}[]`\n}\n\n/**\n * Handles array type processing for both single array types and union types containing array.\n */\nconst processArrayType = (value: Extract<SchemaObject, { type: 'array' }>, isUnionType: boolean = false): string => {\n if (!value.items) {\n return 'array'\n }\n\n const itemType = getSchemaType(resolve.schema(value.items))\n const baseType = formatArrayType(itemType)\n\n if (isUnionType) {\n return baseType\n }\n\n // Handle nullable arrays for non-union types\n return (value as any).nullable ? `${baseType} | null` : baseType\n}\n\n/**\n * Computes the structural type for a schema.\n * This helper always returns type information, never schema titles or ref names.\n *\n * Priority order:\n * 1. const values\n * 2. Array types (with special handling for items)\n * 3. type with contentEncoding\n * 4. raw type\n */\nexport const getSchemaType = (valueOrRef: SchemaObject | ReferenceType<SchemaObject>): string => {\n // Early return for falsy values\n if (!valueOrRef) {\n return ''\n }\n\n const value = resolve.schema(valueOrRef)\n\n // Handle const values first (highest priority)\n if (value.const !== undefined) {\n return 'const'\n }\n\n // Handle union types (array of types)\n if ('type' in value && Array.isArray(value.type)) {\n // Special case: union types containing 'array'\n // TODO: Correctly type array of types in SchemaObject\n if (value.type.includes('array') && (value as Extract<SchemaObject, { type: 'array' }>).items) {\n const arrayType = processArrayType(value as Extract<SchemaObject, { type: 'array' }>, true)\n const otherTypes = value.type.filter((t) => t !== 'array')\n\n return otherTypes.length > 0 ? `${arrayType} | ${otherTypes.join(' | ')}` : arrayType\n }\n\n // Regular union types\n return value.type.join(' | ')\n }\n\n // Handle single array type\n if (isArraySchema(value)) {\n return processArrayType(value, false)\n }\n\n // Handle type with content encoding\n if ('type' in value && value.type && value.contentEncoding) {\n return `${value.type} • ${value.contentEncoding}`\n }\n\n // Fallback to raw type\n return 'type' in value ? (value.type as string) : ''\n}\n"],"mappings":";;;;;;AAOA,IAAM,mBAAmB,aAA6B;
|
|
1
|
+
{"version":3,"file":"get-schema-type.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Formats an array type string with proper wrapping for union types.\n */\nconst formatArrayType = (itemType: string): string => {\n if (!itemType) {\n return 'array'\n }\n\n const wrappedItemType = itemType.includes(' | ') ? `(${itemType})` : itemType\n return `array ${wrappedItemType}[]`\n}\n\n/**\n * Handles array type processing for both single array types and union types containing array.\n */\nconst processArrayType = (value: Extract<SchemaObject, { type: 'array' }>, isUnionType: boolean = false): string => {\n if (!value.items) {\n return 'array'\n }\n\n const itemType = getSchemaType(resolve.schema(value.items))\n const baseType = formatArrayType(itemType)\n\n if (isUnionType) {\n return baseType\n }\n\n // Handle nullable arrays for non-union types\n return (value as any).nullable ? `${baseType} | null` : baseType\n}\n\n/**\n * Computes the structural type for a schema.\n * This helper always returns type information, never schema titles or ref names.\n *\n * Priority order:\n * 1. const values\n * 2. Array types (with special handling for items)\n * 3. type with contentEncoding\n * 4. raw type\n */\nexport const getSchemaType = (valueOrRef: SchemaObject | ReferenceType<SchemaObject>): string => {\n // Early return for falsy values\n if (!valueOrRef) {\n return ''\n }\n\n const value = resolve.schema(valueOrRef)\n\n // Handle const values first (highest priority)\n if (value.const !== undefined) {\n return 'const'\n }\n\n // Handle union types (array of types)\n if ('type' in value && Array.isArray(value.type)) {\n // Special case: union types containing 'array'\n // TODO: Correctly type array of types in SchemaObject\n if (value.type.includes('array') && (value as Extract<SchemaObject, { type: 'array' }>).items) {\n const arrayType = processArrayType(value as Extract<SchemaObject, { type: 'array' }>, true)\n const otherTypes = value.type.filter((t) => t !== 'array')\n\n return otherTypes.length > 0 ? `${arrayType} | ${otherTypes.join(' | ')}` : arrayType\n }\n\n // Regular union types\n return value.type.join(' | ')\n }\n\n // Handle single array type\n if (isArraySchema(value)) {\n return processArrayType(value, false)\n }\n\n // Handle type with content encoding\n if ('type' in value && value.type && value.contentEncoding) {\n return `${value.type} • ${value.contentEncoding}`\n }\n\n // Fallback to raw type\n return 'type' in value ? (value.type as string) : ''\n}\n"],"mappings":";;;;;;AAOA,IAAM,mBAAmB,aAA6B;CACpD,IAAI,CAAC,UACH,OAAO;CAIT,OAAO,SADiB,SAAS,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,SACrC;AAClC;;;;AAKA,IAAM,oBAAoB,OAAiD,cAAuB,UAAkB;CAClH,IAAI,CAAC,MAAM,OACT,OAAO;CAIT,MAAM,WAAW,gBADA,cAAc,QAAQ,OAAO,MAAM,KAAK,CACxB,CAAQ;CAEzC,IAAI,aACF,OAAO;CAIT,OAAQ,MAAc,WAAW,GAAG,SAAS,WAAW;AAC1D;;;;;;;;;;;AAYA,IAAa,iBAAiB,eAAmE;CAE/F,IAAI,CAAC,YACH,OAAO;CAGT,MAAM,QAAQ,QAAQ,OAAO,UAAU;CAGvC,IAAI,MAAM,UAAU,KAAA,GAClB,OAAO;CAIT,IAAI,UAAU,SAAS,MAAM,QAAQ,MAAM,IAAI,GAAG;EAGhD,IAAI,MAAM,KAAK,SAAS,OAAO,KAAM,MAAmD,OAAO;GAC7F,MAAM,YAAY,iBAAiB,OAAmD,IAAI;GAC1F,MAAM,aAAa,MAAM,KAAK,QAAQ,MAAM,MAAM,OAAO;GAEzD,OAAO,WAAW,SAAS,IAAI,GAAG,UAAU,KAAK,WAAW,KAAK,KAAK,MAAM;EAC9E;EAGA,OAAO,MAAM,KAAK,KAAK,KAAK;CAC9B;CAGA,IAAI,cAAc,KAAK,GACrB,OAAO,iBAAiB,OAAO,KAAK;CAItC,IAAI,UAAU,SAAS,MAAM,QAAQ,MAAM,iBACzC,OAAO,GAAG,MAAM,KAAK,KAAK,MAAM;CAIlC,OAAO,UAAU,QAAS,MAAM,OAAkB;AACpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-complex-array-items.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/has-complex-array-items.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/** Composition keywords that indicate complex schema structure */\nconst COMPOSITION_KEYWORDS = ['allOf', 'oneOf', 'anyOf'] as const\n\n/**\n * Checks if a schema has object type (either explicit type: 'object' or has properties)\n */\nconst isObjectType = (schema: SchemaObject): boolean => {\n // Check for explicit object type\n if ('type' in schema && schema.type) {\n if (Array.isArray(schema.type)) {\n return schema.type.includes('object')\n }\n return schema.type === 'object'\n }\n\n // Check for properties (implicit object type)\n return 'properties' in schema\n}\n\n/**\n * Checks if a schema has complex features (refs, compositions, discriminators)\n */\nconst hasComplexFeatures = (schema: SchemaObject): boolean =>\n '$ref' in schema || 'discriminator' in schema || COMPOSITION_KEYWORDS.some((keyword) => keyword in schema)\n\n/**\n * Checks if nested array items are complex\n */\nconst hasComplexNestedArrayItems = (items: SchemaObject): boolean => {\n if (!isArraySchema(items) || typeof items.items !== 'object') {\n return false\n }\n\n // Check for $ref in original nested items before resolving\n if ('$ref' in items.items) {\n return true\n }\n\n const nestedItems = getResolvedRef(items.items)\n if (!nestedItems) {\n return false\n }\n\n // Check if nested items are complex (objects, refs, compositions, or further nested arrays)\n return isObjectType(nestedItems) || hasComplexFeatures(nestedItems) || isArraySchema(nestedItems)\n}\n\n/**\n * Checks if array items have complex structure\n * like: objects, references, discriminators, compositions, or nested arrays with complex items\n *\n * @param value - The schema object to check\n * @returns true if the array has complex items, false otherwise\n */\nexport const hasComplexArrayItems = (value: SchemaObject | undefined): boolean => {\n // Early return for invalid inputs\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return false\n }\n\n // Check for $ref in original items before resolving (in case ref can't be resolved)\n if ('$ref' in value.items) {\n return true\n }\n\n const items = getResolvedRef(value.items)\n if (!items) {\n return false\n }\n\n // Check for complex features (refs, compositions, discriminators)\n if (hasComplexFeatures(items)) {\n return true\n }\n\n // Check if items are objects\n if (isObjectType(items)) {\n return true\n }\n\n // Check if items are nested arrays with complex items\n return hasComplexNestedArrayItems(items)\n}\n"],"mappings":";;;;AAKA,IAAM,uBAAuB;CAAC;CAAS;CAAS;
|
|
1
|
+
{"version":3,"file":"has-complex-array-items.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/has-complex-array-items.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/** Composition keywords that indicate complex schema structure */\nconst COMPOSITION_KEYWORDS = ['allOf', 'oneOf', 'anyOf'] as const\n\n/**\n * Checks if a schema has object type (either explicit type: 'object' or has properties)\n */\nconst isObjectType = (schema: SchemaObject): boolean => {\n // Check for explicit object type\n if ('type' in schema && schema.type) {\n if (Array.isArray(schema.type)) {\n return schema.type.includes('object')\n }\n return schema.type === 'object'\n }\n\n // Check for properties (implicit object type)\n return 'properties' in schema\n}\n\n/**\n * Checks if a schema has complex features (refs, compositions, discriminators)\n */\nconst hasComplexFeatures = (schema: SchemaObject): boolean =>\n '$ref' in schema || 'discriminator' in schema || COMPOSITION_KEYWORDS.some((keyword) => keyword in schema)\n\n/**\n * Checks if nested array items are complex\n */\nconst hasComplexNestedArrayItems = (items: SchemaObject): boolean => {\n if (!isArraySchema(items) || typeof items.items !== 'object') {\n return false\n }\n\n // Check for $ref in original nested items before resolving\n if ('$ref' in items.items) {\n return true\n }\n\n const nestedItems = getResolvedRef(items.items)\n if (!nestedItems) {\n return false\n }\n\n // Check if nested items are complex (objects, refs, compositions, or further nested arrays)\n return isObjectType(nestedItems) || hasComplexFeatures(nestedItems) || isArraySchema(nestedItems)\n}\n\n/**\n * Checks if array items have complex structure\n * like: objects, references, discriminators, compositions, or nested arrays with complex items\n *\n * @param value - The schema object to check\n * @returns true if the array has complex items, false otherwise\n */\nexport const hasComplexArrayItems = (value: SchemaObject | undefined): boolean => {\n // Early return for invalid inputs\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return false\n }\n\n // Check for $ref in original items before resolving (in case ref can't be resolved)\n if ('$ref' in value.items) {\n return true\n }\n\n const items = getResolvedRef(value.items)\n if (!items) {\n return false\n }\n\n // Check for complex features (refs, compositions, discriminators)\n if (hasComplexFeatures(items)) {\n return true\n }\n\n // Check if items are objects\n if (isObjectType(items)) {\n return true\n }\n\n // Check if items are nested arrays with complex items\n return hasComplexNestedArrayItems(items)\n}\n"],"mappings":";;;;AAKA,IAAM,uBAAuB;CAAC;CAAS;CAAS;AAAO;;;;AAKvD,IAAM,gBAAgB,WAAkC;CAEtD,IAAI,UAAU,UAAU,OAAO,MAAM;EACnC,IAAI,MAAM,QAAQ,OAAO,IAAI,GAC3B,OAAO,OAAO,KAAK,SAAS,QAAQ;EAEtC,OAAO,OAAO,SAAS;CACzB;CAGA,OAAO,gBAAgB;AACzB;;;;AAKA,IAAM,sBAAsB,WAC1B,UAAU,UAAU,mBAAmB,UAAU,qBAAqB,MAAM,YAAY,WAAW,MAAM;;;;AAK3G,IAAM,8BAA8B,UAAiC;CACnE,IAAI,CAAC,cAAc,KAAK,KAAK,OAAO,MAAM,UAAU,UAClD,OAAO;CAIT,IAAI,UAAU,MAAM,OAClB,OAAO;CAGT,MAAM,cAAc,eAAe,MAAM,KAAK;CAC9C,IAAI,CAAC,aACH,OAAO;CAIT,OAAO,aAAa,WAAW,KAAK,mBAAmB,WAAW,KAAK,cAAc,WAAW;AAClG;;;;;;;;AASA,IAAa,wBAAwB,UAA6C;CAEhF,IAAI,CAAC,SAAS,CAAC,cAAc,KAAK,KAAK,OAAO,MAAM,UAAU,UAC5D,OAAO;CAIT,IAAI,UAAU,MAAM,OAClB,OAAO;CAGT,MAAM,QAAQ,eAAe,MAAM,KAAK;CACxC,IAAI,CAAC,OACH,OAAO;CAIT,IAAI,mBAAmB,KAAK,GAC1B,OAAO;CAIT,IAAI,aAAa,KAAK,GACpB,OAAO;CAIT,OAAO,2BAA2B,KAAK;AACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty-schema-object.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/is-empty-schema-object.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\n\n/**\n * Determines if the given schema is an empty object schema.\n * An empty object schema is defined as a schema with type 'object'\n * and no defined properties, no additionalProperties (or set to false), and no patternProperties.\n */\nexport const isEmptySchemaObject = (schema: SchemaObject | undefined): boolean => {\n if (!isTypeObject(schema)) {\n return false\n }\n\n const hasNoProperties = Object.keys(schema.properties ?? {}).length === 0\n const hasNoAdditionalProperties = schema.additionalProperties === undefined || schema.additionalProperties === false\n const hasNoPatternProperties = Object.keys(schema.patternProperties ?? {}).length === 0\n\n return hasNoProperties && hasNoAdditionalProperties && hasNoPatternProperties\n}\n"],"mappings":";;;;;;;AASA,IAAa,uBAAuB,WAA8C;
|
|
1
|
+
{"version":3,"file":"is-empty-schema-object.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/is-empty-schema-object.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\n\n/**\n * Determines if the given schema is an empty object schema.\n * An empty object schema is defined as a schema with type 'object'\n * and no defined properties, no additionalProperties (or set to false), and no patternProperties.\n */\nexport const isEmptySchemaObject = (schema: SchemaObject | undefined): boolean => {\n if (!isTypeObject(schema)) {\n return false\n }\n\n const hasNoProperties = Object.keys(schema.properties ?? {}).length === 0\n const hasNoAdditionalProperties = schema.additionalProperties === undefined || schema.additionalProperties === false\n const hasNoPatternProperties = Object.keys(schema.patternProperties ?? {}).length === 0\n\n return hasNoProperties && hasNoAdditionalProperties && hasNoPatternProperties\n}\n"],"mappings":";;;;;;;AASA,IAAa,uBAAuB,WAA8C;CAChF,IAAI,CAAC,aAAa,MAAM,GACtB,OAAO;CAGT,MAAM,kBAAkB,OAAO,KAAK,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,WAAW;CACxE,MAAM,4BAA4B,OAAO,yBAAyB,KAAA,KAAa,OAAO,yBAAyB;CAC/G,MAAM,yBAAyB,OAAO,KAAK,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC,WAAW;CAEtF,OAAO,mBAAmB,6BAA6B;AACzD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SchemaOptions } from '../types';
|
|
2
|
+
/** The slice of schema options needed to decide whether a model name renders as a link. */
|
|
3
|
+
export type ModelLinkOptions = Pick<SchemaOptions, 'hideModels' | 'document'>;
|
|
4
|
+
/**
|
|
5
|
+
* A model name normally links to its entry in the models section. It should render as plain
|
|
6
|
+
* text when there is nothing to scroll to:
|
|
7
|
+
*
|
|
8
|
+
* - the whole models section is hidden via `hideModels`, or
|
|
9
|
+
* - the referenced schema itself is hidden via `x-internal` / `x-scalar-ignore`.
|
|
10
|
+
*
|
|
11
|
+
* The hidden check mirrors how the sidebar decides which schemas to drop (see `traverseSchemas`),
|
|
12
|
+
* so the link only shows when the model actually exists in the models section.
|
|
13
|
+
*/
|
|
14
|
+
export declare const isModelLinkable: (schemaKey: string | null | undefined, { hideModels, document }: ModelLinkOptions) => boolean;
|
|
15
|
+
//# sourceMappingURL=is-model-linkable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-model-linkable.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/is-model-linkable.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,2FAA2F;AAC3F,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,UAAU,CAAC,CAAA;AAE7E;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,0BAA0B,gBAAgB,KACzC,OAQF,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getResolvedRef, mergeSiblingReferences } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { isHidden } from "@scalar/workspace-store/helpers/is-hidden";
|
|
3
|
+
//#region src/components/Content/Schema/helpers/is-model-linkable.ts
|
|
4
|
+
/**
|
|
5
|
+
* A model name normally links to its entry in the models section. It should render as plain
|
|
6
|
+
* text when there is nothing to scroll to:
|
|
7
|
+
*
|
|
8
|
+
* - the whole models section is hidden via `hideModels`, or
|
|
9
|
+
* - the referenced schema itself is hidden via `x-internal` / `x-scalar-ignore`.
|
|
10
|
+
*
|
|
11
|
+
* The hidden check mirrors how the sidebar decides which schemas to drop (see `traverseSchemas`),
|
|
12
|
+
* so the link only shows when the model actually exists in the models section.
|
|
13
|
+
*/
|
|
14
|
+
var isModelLinkable = (schemaKey, { hideModels, document }) => {
|
|
15
|
+
if (!schemaKey || hideModels) return false;
|
|
16
|
+
const schema = document?.components?.schemas?.[schemaKey];
|
|
17
|
+
return !isHidden(getResolvedRef(schema, mergeSiblingReferences));
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { isModelLinkable };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=is-model-linkable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-model-linkable.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/is-model-linkable.ts"],"sourcesContent":["import { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { isHidden } from '@scalar/workspace-store/helpers/is-hidden'\n\nimport type { SchemaOptions } from '../types'\n\n/** The slice of schema options needed to decide whether a model name renders as a link. */\nexport type ModelLinkOptions = Pick<SchemaOptions, 'hideModels' | 'document'>\n\n/**\n * A model name normally links to its entry in the models section. It should render as plain\n * text when there is nothing to scroll to:\n *\n * - the whole models section is hidden via `hideModels`, or\n * - the referenced schema itself is hidden via `x-internal` / `x-scalar-ignore`.\n *\n * The hidden check mirrors how the sidebar decides which schemas to drop (see `traverseSchemas`),\n * so the link only shows when the model actually exists in the models section.\n */\nexport const isModelLinkable = (\n schemaKey: string | null | undefined,\n { hideModels, document }: ModelLinkOptions,\n): boolean => {\n if (!schemaKey || hideModels) {\n return false\n }\n\n const schema = document?.components?.schemas?.[schemaKey]\n\n return !isHidden(getResolvedRef(schema, mergeSiblingReferences))\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAa,mBACX,WACA,EAAE,YAAY,eACF;CACZ,IAAI,CAAC,aAAa,YAChB,OAAO;CAGT,MAAM,SAAS,UAAU,YAAY,UAAU;CAE/C,OAAO,CAAC,SAAS,eAAe,QAAQ,sBAAsB,CAAC;AACjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-type-object.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/is-type-object.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/*\n * Checks whether a JSON schema is of type object\n */\nexport const isTypeObject = (schema: unknown): schema is Extract<SchemaObject, { type: 'object' }> => {\n // null, primitive types, arrays\n if (schema === null || typeof schema !== 'object' || Array.isArray(schema)) {\n return false\n }\n\n // Check for composition keywords - if present, this should be handled by composition logic\n const hasComposition = 'oneOf' in schema || 'anyOf' in schema || 'allOf' in schema || 'not' in schema\n\n // If it has composition keywords, it should not be treated as a simple object schema\n if (hasComposition) {\n return false\n }\n\n const hasType = 'type' in schema\n\n // Handle union types (type: ['object', 'null'])\n if (hasType && Array.isArray(schema.type)) {\n return schema.type.includes('object')\n }\n\n const hasTypeObject = hasType && schema.type === 'object'\n\n // type: object\n if (hasTypeObject) {\n return true\n }\n\n // type: string, number, boolean, array, etc.\n if (hasType && !hasTypeObject) {\n return false\n }\n\n const hasProperties = 'properties' in schema\n const hasAdditionalProperties = 'additionalProperties' in schema\n const hasPatternProperties = 'patternProperties' in schema\n\n return hasProperties || hasAdditionalProperties || hasPatternProperties\n}\n"],"mappings":";AAKA,IAAa,gBAAgB,WAAyE;
|
|
1
|
+
{"version":3,"file":"is-type-object.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/is-type-object.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/*\n * Checks whether a JSON schema is of type object\n */\nexport const isTypeObject = (schema: unknown): schema is Extract<SchemaObject, { type: 'object' }> => {\n // null, primitive types, arrays\n if (schema === null || typeof schema !== 'object' || Array.isArray(schema)) {\n return false\n }\n\n // Check for composition keywords - if present, this should be handled by composition logic\n const hasComposition = 'oneOf' in schema || 'anyOf' in schema || 'allOf' in schema || 'not' in schema\n\n // If it has composition keywords, it should not be treated as a simple object schema\n if (hasComposition) {\n return false\n }\n\n const hasType = 'type' in schema\n\n // Handle union types (type: ['object', 'null'])\n if (hasType && Array.isArray(schema.type)) {\n return schema.type.includes('object')\n }\n\n const hasTypeObject = hasType && schema.type === 'object'\n\n // type: object\n if (hasTypeObject) {\n return true\n }\n\n // type: string, number, boolean, array, etc.\n if (hasType && !hasTypeObject) {\n return false\n }\n\n const hasProperties = 'properties' in schema\n const hasAdditionalProperties = 'additionalProperties' in schema\n const hasPatternProperties = 'patternProperties' in schema\n\n return hasProperties || hasAdditionalProperties || hasPatternProperties\n}\n"],"mappings":";AAKA,IAAa,gBAAgB,WAAyE;CAEpG,IAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,GACvE,OAAO;CAOT,IAHuB,WAAW,UAAU,WAAW,UAAU,WAAW,UAAU,SAAS,QAI7F,OAAO;CAGT,MAAM,UAAU,UAAU;CAG1B,IAAI,WAAW,MAAM,QAAQ,OAAO,IAAI,GACtC,OAAO,OAAO,KAAK,SAAS,QAAQ;CAGtC,MAAM,gBAAgB,WAAW,OAAO,SAAS;CAGjD,IAAI,eACF,OAAO;CAIT,IAAI,WAAW,CAAC,eACd,OAAO;CAGT,MAAM,gBAAgB,gBAAgB;CACtC,MAAM,0BAA0B,0BAA0B;CAC1D,MAAM,uBAAuB,uBAAuB;CAEpD,OAAO,iBAAiB,2BAA2B;AACrD"}
|
|
@@ -9,7 +9,7 @@ import { objectKeys } from "@scalar/helpers/object/object-keys";
|
|
|
9
9
|
* annotations a later subschema is expected to override an earlier one — matching
|
|
10
10
|
* OpenAPI/JSON Schema tooling like Swagger UI.
|
|
11
11
|
*/
|
|
12
|
-
var LAST_WINS_KEYS = new Set(["description", "title"]);
|
|
12
|
+
var LAST_WINS_KEYS = /* @__PURE__ */ new Set(["description", "title"]);
|
|
13
13
|
/**
|
|
14
14
|
* Merges multiple OpenAPI schema objects into a single schema object.
|
|
15
15
|
* Handles nested allOf compositions and merges properties recursively.
|
|
@@ -52,7 +52,7 @@ var mergeSchemaIntoResult = (result, schema, override = false, seenRefs = /* @__
|
|
|
52
52
|
const value = getResolvedRef(schema[key]);
|
|
53
53
|
if (value === void 0) continue;
|
|
54
54
|
if (key === "required") {
|
|
55
|
-
if (Array.isArray(value) && value.length > 0) if (result.required?.length) result.required = [
|
|
55
|
+
if (Array.isArray(value) && value.length > 0) if (result.required?.length) result.required = [.../* @__PURE__ */ new Set([...result.required, ...value])];
|
|
56
56
|
else result.required = value.slice();
|
|
57
57
|
} else if (key === "properties") {
|
|
58
58
|
if (value && typeof value === "object") {
|
|
@@ -77,7 +77,7 @@ var mergeSchemaIntoResult = (result, schema, override = false, seenRefs = /* @__
|
|
|
77
77
|
} else if (!("items" in result)) result.items = items;
|
|
78
78
|
}
|
|
79
79
|
} else if (key === "enum") {
|
|
80
|
-
if (Array.isArray(value) && value.length > 0) result.enum = [
|
|
80
|
+
if (Array.isArray(value) && value.length > 0) result.enum = [.../* @__PURE__ */ new Set([...result.enum || [], ...value])];
|
|
81
81
|
} else if (key === "oneOf" || key === "anyOf") {
|
|
82
82
|
if (Array.isArray(value) && value.length > 0 && (override || result[key] === void 0)) result[key] = value;
|
|
83
83
|
} else if (key === "allOf") continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-all-of-schemas.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"sourcesContent":["import { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Schema keywords whose value should reflect the *last* occurrence when merging\n * `allOf` members. Most keywords keep the first occurrence, but for human-facing\n * annotations a later subschema is expected to override an earlier one — matching\n * OpenAPI/JSON Schema tooling like Swagger UI.\n */\nconst LAST_WINS_KEYS = new Set<string>(['description', 'title'])\n\n/**\n * Merges multiple OpenAPI schema objects into a single schema object.\n * Handles nested allOf compositions and merges properties recursively.\n *\n * @param schemas - Array of OpenAPI schema objects to merge\n * @param rootSchema - Optional root schema to merge with the result\n * @param seenRefs - `$ref` strings already being merged higher in the call stack\n * @returns Merged schema object\n */\nexport const mergeAllOfSchemas = (\n schemas: SchemaObject | undefined,\n rootSchema?: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n // Handle max depth, empty or invalid input\n if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) {\n return rootSchema || ({} as SchemaObject)\n }\n\n // Initialize result object once\n const result = {} as SchemaObject\n\n // Extract base schema properties (everything except allOf)\n const { allOf: _, ...baseSchema } = schemas\n\n // Process allOf schemas first\n for (const _schema of schemas.allOf) {\n if (!_schema || typeof _schema !== 'object') {\n continue\n }\n\n // Resolve ref if present\n const schema = resolve.schema(_schema)\n\n // Handle nested allOf recursively\n if (schema.allOf) {\n const nestedMerged = mergeAllOfSchemas(schema, undefined, seenRefs)\n mergeSchemaIntoResult(result, nestedMerged, false, seenRefs)\n continue\n }\n\n mergeSchemaIntoResult(result, schema, false, seenRefs)\n }\n\n // Apply base schema properties with precedence over allOf properties\n if (Object.keys(baseSchema).length > 0) {\n mergeSchemaIntoResult(result, baseSchema, true, seenRefs)\n }\n\n // Process root schema last if provided\n if (rootSchema && typeof rootSchema === 'object') {\n if (rootSchema.allOf) {\n const nestedMerged = mergeAllOfSchemas(rootSchema, undefined, seenRefs)\n mergeSchemaIntoResult(result, nestedMerged, true, seenRefs)\n } else {\n mergeSchemaIntoResult(result, rootSchema, true, seenRefs)\n }\n }\n\n return result\n}\n\n/**\n * Efficiently merges a source schema into a target result object.\n * Handles all schema merging logic in a single optimized function.\n *\n * @param result - The target schema object to merge into\n * @param schema - The source schema object to merge from\n * @param override - Whether to override existing properties (default: false)\n */\nconst mergeSchemaIntoResult = (\n result: SchemaObject,\n schema: SchemaObject,\n override: boolean = false,\n seenRefs: Set<string> = new Set(),\n): void => {\n // Early return if schema is empty\n const schemaKeys = objectKeys(schema)\n if (schemaKeys.length === 0) {\n return\n }\n\n // Loop through all schema properties and handle them appropriately\n for (const key of schemaKeys) {\n const value = getResolvedRef(schema[key]) as any\n\n if (value === undefined) {\n continue\n }\n\n // Required\n if ((key as string) === 'required') {\n // Merge required fields with deduplication\n if (Array.isArray(value) && value.length > 0) {\n // @ts-expect-error\n if (result.required?.length) {\n // @ts-expect-error\n result.required = [...new Set([...result.required, ...value])]\n } else {\n // @ts-expect-error\n result.required = value.slice()\n }\n }\n }\n // Properties\n else if ((key as string) === 'properties') {\n // Merge properties recursively\n if (value && typeof value === 'object') {\n // @ts-expect-error\n if (!result.properties) {\n // @ts-expect-error\n result.properties = {}\n }\n\n // @ts-expect-error\n mergePropertiesIntoResult(result.properties, value, seenRefs)\n }\n }\n // Items\n else if ((key as string) === 'items') {\n // Handle items (for both arrays and objects with items)\n const items = resolve.schema(value)\n if (items) {\n if (isArraySchema(schema)) {\n // @ts-expect-error\n if (!result.items) {\n // @ts-expect-error\n result.items = {}\n }\n\n // Handle allOf within array items\n if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items, undefined, seenRefs)\n // @ts-expect-error\n Object.assign(result.items, mergedItems)\n } else {\n // @ts-expect-error\n mergeItemsIntoResult(getResolvedRef(result.items), items, seenRefs)\n }\n }\n // For non-array types with items.allOf, merge into properties\n else if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items, undefined, seenRefs)\n if ('properties' in mergedItems) {\n if (!('properties' in result)) {\n // @ts-expect-error\n result.properties = {}\n }\n\n 'properties' in result && mergePropertiesIntoResult(result.properties, mergedItems.properties, seenRefs)\n }\n }\n // For non-array types without allOf, still set items if not already set\n else if (!('items' in result)) {\n // @ts-expect-error\n result.items = items\n }\n }\n }\n // Enum\n else if (key === 'enum') {\n if (Array.isArray(value) && value.length > 0) {\n result.enum = [...new Set([...(result.enum || []), ...value])]\n }\n }\n // OneOf/AnyOf\n else if (key === 'oneOf' || key === 'anyOf') {\n // Preserve the composition itself so its variants keep rendering as a\n // selector. Flattening the option properties into the parent would drop\n // the variant structure entirely and silently lose branches that have no\n // top-level `properties` (for example branches that are themselves an\n // `allOf`). The sibling `allOf` members stay on `result` as base\n // properties, which the Schema component renders above the selector.\n if (Array.isArray(value) && value.length > 0 && (override || result[key] === undefined)) {\n result[key] = value\n }\n }\n // Skip allOf as it's handled at a higher level\n else if (key === 'allOf') {\n continue\n }\n // For all other properties, preserve the first occurrence or override if specified.\n // Annotation keywords (see LAST_WINS_KEYS) always take the latest value so a later\n // allOf member can override an earlier one.\n else {\n if (override || LAST_WINS_KEYS.has(key as string) || result[key] === undefined) {\n result[key] = value\n }\n }\n }\n}\n\n/**\n * Efficiently merges properties into a result object without creating new objects.\n */\nconst mergePropertiesIntoResult = (\n result: Extract<SchemaObject, { type: 'object' }>['properties'],\n properties: Extract<SchemaObject, { type: 'object' }>['properties'],\n seenRefs: Set<string> = new Set(),\n): void => {\n const propertyKeys = Object.keys(properties ?? {})\n if (!properties || !result || propertyKeys.length === 0) {\n return\n }\n\n for (const key of propertyKeys) {\n const schema = resolve.schema(properties[key])\n if (!schema) {\n delete result[key]\n continue\n }\n\n if (typeof schema !== 'object') {\n result[key] = schema\n continue\n }\n\n if (!result[key]) {\n // Break self-referential cycles reached through `allOf`. When a brand-new\n // property's `$ref` is already being merged higher in the call stack,\n // keep the raw reference instead of recursing into its `allOf` forever.\n // This mirrors the guard in the \"merge existing property\" branch below and\n // covers schemas that point back at themselves through an `allOf` member\n // (e.g. a node whose `self` property $refs the node, which is an allOf).\n const rawProperty = properties[key]\n const newSchemaRef = (rawProperty as { $ref?: string })?.$ref\n if (rawProperty && typeof newSchemaRef === 'string' && seenRefs.has(newSchemaRef)) {\n result[key] = rawProperty\n continue\n }\n const nextNewSeenRefs = typeof newSchemaRef === 'string' ? new Set(seenRefs).add(newSchemaRef) : seenRefs\n\n // Handle new property with allOf\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas(schema, undefined, nextNewSeenRefs)\n } else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) {\n result[key] = {\n ...schema,\n items: mergeAllOfSchemas(resolve.schema(schema.items), undefined, seenRefs),\n }\n } else if (properties[key]) {\n result[key] = properties[key]\n }\n continue\n }\n\n // Merge existing property\n const existing = resolve.schema(result[key])\n\n // Break self-referential cycles: when this property's `$ref` is already\n // being merged higher in the call stack, keep the partially merged existing\n // schema instead of recursing into it again. This mirrors the guard in\n // `mergeItems` and covers schemas that point back at themselves through a\n // plain object property (e.g. a tree node whose `parent` $refs the node).\n const schemaRef = (schema as { $ref?: string }).$ref\n if (typeof schemaRef === 'string' && seenRefs.has(schemaRef)) {\n result[key] = existing\n continue\n }\n const nextSeenRefs = typeof schemaRef === 'string' ? new Set(seenRefs).add(schemaRef) : seenRefs\n\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] } as SchemaObject, undefined, nextSeenRefs)\n } else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {\n const existingItems = resolve.schema(existing.items)\n result[key] = {\n ...existing,\n type: 'array',\n items: existingItems\n ? mergeItems(existingItems, resolve.schema(schema.items), nextSeenRefs)\n : resolve.schema(schema.items),\n }\n } else {\n // Create merged object with properties handled separately\n if ('properties' in existing && 'properties' in schema) {\n const merged = { ...existing, ...schema }\n merged.properties = { ...existing.properties }\n mergePropertiesIntoResult(merged.properties, schema.properties, nextSeenRefs)\n result[key] = merged\n }\n // Simple merge without property recursion\n else {\n result[key] = { ...schema, ...existing }\n }\n }\n }\n}\n\n/**\n * Efficiently merges array items into a result object.\n */\nconst mergeItemsIntoResult = (result: SchemaObject, items: SchemaObject, seenRefs: Set<string> = new Set()): void => {\n // Handle allOf in items\n if (items.allOf || result.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (result.allOf) {\n for (const schema of result.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(result)\n }\n\n if (items.allOf) {\n for (const schema of items.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(items)\n }\n\n const merged = mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject, undefined, seenRefs)\n Object.assign(result, merged)\n return\n }\n\n // Regular merge\n Object.assign(result, items)\n\n // Merge properties if both have them\n if ('properties' in result && 'properties' in items) {\n mergePropertiesIntoResult(result.properties, items.properties, seenRefs)\n }\n}\n\n/**\n * Helper function for merging items that returns a new object.\n */\nconst mergeItems = (\n existing: SchemaObject,\n incoming: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n const incomingRef = (incoming as { $ref?: string }).$ref\n\n if (typeof incomingRef === 'string') {\n if (seenRefs.has(incomingRef)) {\n return existing\n }\n return mergeItemsInner(existing, incoming, new Set(seenRefs).add(incomingRef))\n }\n\n return mergeItemsInner(existing, incoming, seenRefs)\n}\n\nconst mergeItemsInner = (\n existing: SchemaObject,\n incoming: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n // Handle allOf in either schema\n if (existing.allOf || incoming.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (existing.allOf) {\n for (const schema of existing.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(existing)\n }\n\n if (incoming.allOf) {\n for (const schema of incoming.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(incoming)\n }\n\n return mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject, undefined, seenRefs)\n }\n\n const merged = { ...existing, ...incoming }\n\n // Recursively merge properties if both have properties\n if ('properties' in existing && 'properties' in incoming) {\n // @ts-expect-error\n merged.properties = { ...existing.properties }\n // @ts-expect-error\n mergePropertiesIntoResult(merged.properties, incoming.properties, seenRefs)\n }\n\n return merged as SchemaObject\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAM,iBAAiB,IAAI,IAAY,CAAC,eAAe,QAAQ,CAAC;;;;;;;;;;AAWhE,IAAa,qBACX,SACA,YACA,2BAAwB,IAAI,KAAK,KAChB;AAEjB,KAAI,CAAC,SAAS,OAAO,UAAU,CAAC,MAAM,QAAQ,QAAQ,MAAM,CAC1D,QAAO,cAAe,EAAE;CAI1B,MAAM,SAAS,EAAE;CAGjB,MAAM,EAAE,OAAO,GAAG,GAAG,eAAe;AAGpC,MAAK,MAAM,WAAW,QAAQ,OAAO;AACnC,MAAI,CAAC,WAAW,OAAO,YAAY,SACjC;EAIF,MAAM,SAAS,QAAQ,OAAO,QAAQ;AAGtC,MAAI,OAAO,OAAO;AAEhB,yBAAsB,QADD,kBAAkB,QAAQ,KAAA,GAAW,SAAS,EACvB,OAAO,SAAS;AAC5D;;AAGF,wBAAsB,QAAQ,QAAQ,OAAO,SAAS;;AAIxD,KAAI,OAAO,KAAK,WAAW,CAAC,SAAS,EACnC,uBAAsB,QAAQ,YAAY,MAAM,SAAS;AAI3D,KAAI,cAAc,OAAO,eAAe,SACtC,KAAI,WAAW,MAEb,uBAAsB,QADD,kBAAkB,YAAY,KAAA,GAAW,SAAS,EAC3B,MAAM,SAAS;KAE3D,uBAAsB,QAAQ,YAAY,MAAM,SAAS;AAI7D,QAAO;;;;;;;;;;AAWT,IAAM,yBACJ,QACA,QACA,WAAoB,OACpB,2BAAwB,IAAI,KAAK,KACxB;CAET,MAAM,aAAa,WAAW,OAAO;AACrC,KAAI,WAAW,WAAW,EACxB;AAIF,MAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,eAAe,OAAO,KAAK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KAAI,OAAO,gBAAgB,UAAU;AACnC,MAAI,SAAS,IAAI,YAAY,CAC3B,QAAO;AAET,SAAO,gBAAgB,UAAU,UAAU,IAAI,IAAI,SAAS,CAAC,IAAI,YAAY,CAAC;;AAGhF,QAAO,gBAAgB,UAAU,UAAU,SAAS;;AAGtD,IAAM,mBACJ,UACA,UACA,2BAAwB,IAAI,KAAK,KAChB;AAEjB,KAAI,SAAS,SAAS,SAAS,OAAO;EAEpC,MAAM,eAA+B,EAAE;AAEvC,MAAI,SAAS,MACX,MAAK,MAAM,UAAU,SAAS,MAC5B,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,SAAS;AAG7B,MAAI,SAAS,MACX,MAAK,MAAM,UAAU,SAAS,MAC5B,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,SAAS;AAG7B,SAAO,kBAAkB,EAAE,OAAO,cAAc,EAAkB,KAAA,GAAW,SAAS;;CAGxF,MAAM,SAAS;EAAE,GAAG;EAAU,GAAG;EAAU;AAG3C,KAAI,gBAAgB,YAAY,gBAAgB,UAAU;AAExD,SAAO,aAAa,EAAE,GAAG,SAAS,YAAY;AAE9C,4BAA0B,OAAO,YAAY,SAAS,YAAY,SAAS;;AAG7E,QAAO"}
|
|
1
|
+
{"version":3,"file":"merge-all-of-schemas.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"sourcesContent":["import { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Schema keywords whose value should reflect the *last* occurrence when merging\n * `allOf` members. Most keywords keep the first occurrence, but for human-facing\n * annotations a later subschema is expected to override an earlier one — matching\n * OpenAPI/JSON Schema tooling like Swagger UI.\n */\nconst LAST_WINS_KEYS = new Set<string>(['description', 'title'])\n\n/**\n * Merges multiple OpenAPI schema objects into a single schema object.\n * Handles nested allOf compositions and merges properties recursively.\n *\n * @param schemas - Array of OpenAPI schema objects to merge\n * @param rootSchema - Optional root schema to merge with the result\n * @param seenRefs - `$ref` strings already being merged higher in the call stack\n * @returns Merged schema object\n */\nexport const mergeAllOfSchemas = (\n schemas: SchemaObject | undefined,\n rootSchema?: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n // Handle max depth, empty or invalid input\n if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) {\n return rootSchema || ({} as SchemaObject)\n }\n\n // Initialize result object once\n const result = {} as SchemaObject\n\n // Extract base schema properties (everything except allOf)\n const { allOf: _, ...baseSchema } = schemas\n\n // Process allOf schemas first\n for (const _schema of schemas.allOf) {\n if (!_schema || typeof _schema !== 'object') {\n continue\n }\n\n // Resolve ref if present\n const schema = resolve.schema(_schema)\n\n // Handle nested allOf recursively\n if (schema.allOf) {\n const nestedMerged = mergeAllOfSchemas(schema, undefined, seenRefs)\n mergeSchemaIntoResult(result, nestedMerged, false, seenRefs)\n continue\n }\n\n mergeSchemaIntoResult(result, schema, false, seenRefs)\n }\n\n // Apply base schema properties with precedence over allOf properties\n if (Object.keys(baseSchema).length > 0) {\n mergeSchemaIntoResult(result, baseSchema, true, seenRefs)\n }\n\n // Process root schema last if provided\n if (rootSchema && typeof rootSchema === 'object') {\n if (rootSchema.allOf) {\n const nestedMerged = mergeAllOfSchemas(rootSchema, undefined, seenRefs)\n mergeSchemaIntoResult(result, nestedMerged, true, seenRefs)\n } else {\n mergeSchemaIntoResult(result, rootSchema, true, seenRefs)\n }\n }\n\n return result\n}\n\n/**\n * Efficiently merges a source schema into a target result object.\n * Handles all schema merging logic in a single optimized function.\n *\n * @param result - The target schema object to merge into\n * @param schema - The source schema object to merge from\n * @param override - Whether to override existing properties (default: false)\n */\nconst mergeSchemaIntoResult = (\n result: SchemaObject,\n schema: SchemaObject,\n override: boolean = false,\n seenRefs: Set<string> = new Set(),\n): void => {\n // Early return if schema is empty\n const schemaKeys = objectKeys(schema)\n if (schemaKeys.length === 0) {\n return\n }\n\n // Loop through all schema properties and handle them appropriately\n for (const key of schemaKeys) {\n const value = getResolvedRef(schema[key]) as any\n\n if (value === undefined) {\n continue\n }\n\n // Required\n if ((key as string) === 'required') {\n // Merge required fields with deduplication\n if (Array.isArray(value) && value.length > 0) {\n // @ts-expect-error\n if (result.required?.length) {\n // @ts-expect-error\n result.required = [...new Set([...result.required, ...value])]\n } else {\n // @ts-expect-error\n result.required = value.slice()\n }\n }\n }\n // Properties\n else if ((key as string) === 'properties') {\n // Merge properties recursively\n if (value && typeof value === 'object') {\n // @ts-expect-error\n if (!result.properties) {\n // @ts-expect-error\n result.properties = {}\n }\n\n // @ts-expect-error\n mergePropertiesIntoResult(result.properties, value, seenRefs)\n }\n }\n // Items\n else if ((key as string) === 'items') {\n // Handle items (for both arrays and objects with items)\n const items = resolve.schema(value)\n if (items) {\n if (isArraySchema(schema)) {\n // @ts-expect-error\n if (!result.items) {\n // @ts-expect-error\n result.items = {}\n }\n\n // Handle allOf within array items\n if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items, undefined, seenRefs)\n // @ts-expect-error\n Object.assign(result.items, mergedItems)\n } else {\n // @ts-expect-error\n mergeItemsIntoResult(getResolvedRef(result.items), items, seenRefs)\n }\n }\n // For non-array types with items.allOf, merge into properties\n else if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items, undefined, seenRefs)\n if ('properties' in mergedItems) {\n if (!('properties' in result)) {\n // @ts-expect-error\n result.properties = {}\n }\n\n 'properties' in result && mergePropertiesIntoResult(result.properties, mergedItems.properties, seenRefs)\n }\n }\n // For non-array types without allOf, still set items if not already set\n else if (!('items' in result)) {\n // @ts-expect-error\n result.items = items\n }\n }\n }\n // Enum\n else if (key === 'enum') {\n if (Array.isArray(value) && value.length > 0) {\n result.enum = [...new Set([...(result.enum || []), ...value])]\n }\n }\n // OneOf/AnyOf\n else if (key === 'oneOf' || key === 'anyOf') {\n // Preserve the composition itself so its variants keep rendering as a\n // selector. Flattening the option properties into the parent would drop\n // the variant structure entirely and silently lose branches that have no\n // top-level `properties` (for example branches that are themselves an\n // `allOf`). The sibling `allOf` members stay on `result` as base\n // properties, which the Schema component renders above the selector.\n if (Array.isArray(value) && value.length > 0 && (override || result[key] === undefined)) {\n result[key] = value\n }\n }\n // Skip allOf as it's handled at a higher level\n else if (key === 'allOf') {\n continue\n }\n // For all other properties, preserve the first occurrence or override if specified.\n // Annotation keywords (see LAST_WINS_KEYS) always take the latest value so a later\n // allOf member can override an earlier one.\n else {\n if (override || LAST_WINS_KEYS.has(key as string) || result[key] === undefined) {\n result[key] = value\n }\n }\n }\n}\n\n/**\n * Efficiently merges properties into a result object without creating new objects.\n */\nconst mergePropertiesIntoResult = (\n result: Extract<SchemaObject, { type: 'object' }>['properties'],\n properties: Extract<SchemaObject, { type: 'object' }>['properties'],\n seenRefs: Set<string> = new Set(),\n): void => {\n const propertyKeys = Object.keys(properties ?? {})\n if (!properties || !result || propertyKeys.length === 0) {\n return\n }\n\n for (const key of propertyKeys) {\n const schema = resolve.schema(properties[key])\n if (!schema) {\n delete result[key]\n continue\n }\n\n if (typeof schema !== 'object') {\n result[key] = schema\n continue\n }\n\n if (!result[key]) {\n // Break self-referential cycles reached through `allOf`. When a brand-new\n // property's `$ref` is already being merged higher in the call stack,\n // keep the raw reference instead of recursing into its `allOf` forever.\n // This mirrors the guard in the \"merge existing property\" branch below and\n // covers schemas that point back at themselves through an `allOf` member\n // (e.g. a node whose `self` property $refs the node, which is an allOf).\n const rawProperty = properties[key]\n const newSchemaRef = (rawProperty as { $ref?: string })?.$ref\n if (rawProperty && typeof newSchemaRef === 'string' && seenRefs.has(newSchemaRef)) {\n result[key] = rawProperty\n continue\n }\n const nextNewSeenRefs = typeof newSchemaRef === 'string' ? new Set(seenRefs).add(newSchemaRef) : seenRefs\n\n // Handle new property with allOf\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas(schema, undefined, nextNewSeenRefs)\n } else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) {\n result[key] = {\n ...schema,\n items: mergeAllOfSchemas(resolve.schema(schema.items), undefined, seenRefs),\n }\n } else if (properties[key]) {\n result[key] = properties[key]\n }\n continue\n }\n\n // Merge existing property\n const existing = resolve.schema(result[key])\n\n // Break self-referential cycles: when this property's `$ref` is already\n // being merged higher in the call stack, keep the partially merged existing\n // schema instead of recursing into it again. This mirrors the guard in\n // `mergeItems` and covers schemas that point back at themselves through a\n // plain object property (e.g. a tree node whose `parent` $refs the node).\n const schemaRef = (schema as { $ref?: string }).$ref\n if (typeof schemaRef === 'string' && seenRefs.has(schemaRef)) {\n result[key] = existing\n continue\n }\n const nextSeenRefs = typeof schemaRef === 'string' ? new Set(seenRefs).add(schemaRef) : seenRefs\n\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] } as SchemaObject, undefined, nextSeenRefs)\n } else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {\n const existingItems = resolve.schema(existing.items)\n result[key] = {\n ...existing,\n type: 'array',\n items: existingItems\n ? mergeItems(existingItems, resolve.schema(schema.items), nextSeenRefs)\n : resolve.schema(schema.items),\n }\n } else {\n // Create merged object with properties handled separately\n if ('properties' in existing && 'properties' in schema) {\n const merged = { ...existing, ...schema }\n merged.properties = { ...existing.properties }\n mergePropertiesIntoResult(merged.properties, schema.properties, nextSeenRefs)\n result[key] = merged\n }\n // Simple merge without property recursion\n else {\n result[key] = { ...schema, ...existing }\n }\n }\n }\n}\n\n/**\n * Efficiently merges array items into a result object.\n */\nconst mergeItemsIntoResult = (result: SchemaObject, items: SchemaObject, seenRefs: Set<string> = new Set()): void => {\n // Handle allOf in items\n if (items.allOf || result.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (result.allOf) {\n for (const schema of result.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(result)\n }\n\n if (items.allOf) {\n for (const schema of items.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(items)\n }\n\n const merged = mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject, undefined, seenRefs)\n Object.assign(result, merged)\n return\n }\n\n // Regular merge\n Object.assign(result, items)\n\n // Merge properties if both have them\n if ('properties' in result && 'properties' in items) {\n mergePropertiesIntoResult(result.properties, items.properties, seenRefs)\n }\n}\n\n/**\n * Helper function for merging items that returns a new object.\n */\nconst mergeItems = (\n existing: SchemaObject,\n incoming: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n const incomingRef = (incoming as { $ref?: string }).$ref\n\n if (typeof incomingRef === 'string') {\n if (seenRefs.has(incomingRef)) {\n return existing\n }\n return mergeItemsInner(existing, incoming, new Set(seenRefs).add(incomingRef))\n }\n\n return mergeItemsInner(existing, incoming, seenRefs)\n}\n\nconst mergeItemsInner = (\n existing: SchemaObject,\n incoming: SchemaObject,\n seenRefs: Set<string> = new Set(),\n): SchemaObject => {\n // Handle allOf in either schema\n if (existing.allOf || incoming.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (existing.allOf) {\n for (const schema of existing.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(existing)\n }\n\n if (incoming.allOf) {\n for (const schema of incoming.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(incoming)\n }\n\n return mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject, undefined, seenRefs)\n }\n\n const merged = { ...existing, ...incoming }\n\n // Recursively merge properties if both have properties\n if ('properties' in existing && 'properties' in incoming) {\n // @ts-expect-error\n merged.properties = { ...existing.properties }\n // @ts-expect-error\n mergePropertiesIntoResult(merged.properties, incoming.properties, seenRefs)\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ACA,2BAAwB,IAAI,IAAI,MACf;CACjB,MAAM,cAAe,SAA+B;CAEpD,IAAI,OAAO,gBAAgB,UAAU;EACnC,IAAI,SAAS,IAAI,WAAW,GAC1B,OAAO;EAET,OAAO,gBAAgB,UAAU,UAAU,IAAI,IAAI,QAAQ,CAAC,CAAC,IAAI,WAAW,CAAC;CAC/E;CAEA,OAAO,gBAAgB,UAAU,UAAU,QAAQ;AACrD;AAEA,IAAM,mBACJ,UACA,UACA,2BAAwB,IAAI,IAAI,MACf;CAEjB,IAAI,SAAS,SAAS,SAAS,OAAO;EAEpC,MAAM,eAA+B,CAAC;EAEtC,IAAI,SAAS,OACX,KAAK,MAAM,UAAU,SAAS,OAC5B,aAAa,KAAK,QAAQ,OAAO,MAAM,CAAC;OAG1C,aAAa,KAAK,QAAQ;EAG5B,IAAI,SAAS,OACX,KAAK,MAAM,UAAU,SAAS,OAC5B,aAAa,KAAK,QAAQ,OAAO,MAAM,CAAC;OAG1C,aAAa,KAAK,QAAQ;EAG5B,OAAO,kBAAkB,EAAE,OAAO,aAAa,GAAmB,KAAA,GAAW,QAAQ;CACvF;CAEA,MAAM,SAAS;EAAE,GAAG;EAAU,GAAG;CAAS;CAG1C,IAAI,gBAAgB,YAAY,gBAAgB,UAAU;EAExD,OAAO,aAAa,EAAE,GAAG,SAAS,WAAW;EAE7C,0BAA0B,OAAO,YAAY,SAAS,YAAY,QAAQ;CAC5E;CAEA,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimize-value-for-display.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { compositions } from './schema-composition'\n\n/**\n * Shallow-merges schema-like objects, but unions `properties` and `required`\n * instead of letting a later object's `properties`/`required` completely\n * overwrite an earlier one's. Without this, a variant schema (e.g. a `oneOf`\n * branch) that declares its own `properties`/`required` would wipe out the\n * shared base fields factored out at the root (or via a sibling `allOf`)\n * instead of being combined with them (#9657).\n */\nfunction mergeSchemaProperties(...objects: (Record<string, unknown> | undefined)[]): Record<string, unknown> {\n const merged: Record<string, unknown> = {}\n const properties: Record<string, unknown> = {}\n const required = new Set<string>()\n let hasProperties = false\n let hasRequired = false\n\n for (const object of objects) {\n if (!object) {\n continue\n }\n\n for (const [key, val] of Object.entries(object)) {\n if (key === 'properties' && val && typeof val === 'object') {\n Object.assign(properties, val)\n hasProperties = true\n continue\n }\n\n if (key === 'required' && Array.isArray(val)) {\n for (const name of val) {\n required.add(name)\n }\n hasRequired = true\n continue\n }\n\n merged[key] = val\n }\n }\n\n if (hasProperties) {\n merged.properties = properties\n }\n if (hasRequired) {\n merged.required = [...required]\n }\n\n return merged\n}\n\n/**\n * Optimize the value by removing nulls from compositions and merging root properties.\n *\n * TODO: figure out what this does\n */\nexport function optimizeValueForDisplay(value: SchemaObject | undefined): SchemaObject | undefined {\n if (!value || typeof value !== 'object') {\n return value\n }\n\n // Find the composition keyword early to avoid unnecessary work\n const composition = compositions.find((keyword) => keyword in value && keyword !== 'not')\n\n // If there's no relevant composition keyword, return a shallow copy\n if (!composition) {\n return { ...value }\n }\n\n const schemas = value[composition]\n if (!Array.isArray(schemas)) {\n return { ...value }\n }\n\n // Extract root properties efficiently (excluding composition and nullable)\n const { [composition]: _, nullable: originalNullable, ...rootProperties } = value as any\n const hasRootProperties = Object.keys(rootProperties).length > 0\n\n // Check for null schemas and filter them out in one pass\n const { filteredSchemas, hasNullSchema } = schemas.reduce(\n (acc, _schema) => {\n const schema = resolve.schema(_schema)\n\n if ('type' in schema && schema.type === 'null') {\n acc.hasNullSchema = true\n } else {\n acc.filteredSchemas.push(schema)\n }\n return acc\n },\n { filteredSchemas: [] as SchemaObject[], hasNullSchema: false },\n )\n\n // Determine if nullable should be set\n const shouldBeNullable = hasNullSchema || originalNullable === true\n\n // If only one schema remains after filtering, merge with root properties.\n // `properties`/`required` are unioned so sibling properties declared next to\n // the composition (e.g. `properties` alongside a single-`$ref` `allOf`) are\n // kept instead of being overwritten by the member schema's own `properties`.\n // Root-level annotations (title, description, …) win over the member's: they\n // describe the combined schema, not the base it extends.\n if (filteredSchemas.length === 1) {\n const mergedSchema = mergeSchemaProperties(filteredSchemas[0], rootProperties) as SchemaObject\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n mergedSchema.nullable = true\n }\n return mergedSchema\n }\n\n // Check if root properties should be merged into schemas\n const shouldMergeRootProperties =\n (composition === 'oneOf' || composition === 'anyOf') &&\n (hasRootProperties || filteredSchemas.some((schema) => schema.allOf))\n\n if (shouldMergeRootProperties) {\n const mergedSchemas = filteredSchemas.map((_schema) => {\n const schema = resolve.schema(_schema)\n\n // Flatten single-item allOf and merge with root properties\n if (schema.allOf?.length === 1) {\n const { allOf, ...otherProps } = schema\n return mergeSchemaProperties(rootProperties, otherProps, resolve.schema(allOf[0]))\n }\n return mergeSchemaProperties(rootProperties, schema)\n })\n\n // @ts-expect-error - We avoid using coerceValue here as it may be dangerous, so we type cast\n const result = { [composition]: mergedSchemas } as SchemaObject\n if (typeof value.description === 'string') {\n result.description = value.description\n }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n // Return with filtered schemas if any nulls were removed\n if (filteredSchemas.length !== schemas.length) {\n const result: SchemaObject = { ...value, [composition]: filteredSchemas }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n return { ...value }\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAS,sBAAsB,GAAG,SAA2E;CAC3G,MAAM,SAAkC,
|
|
1
|
+
{"version":3,"file":"optimize-value-for-display.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { compositions } from './schema-composition'\n\n/**\n * Shallow-merges schema-like objects, but unions `properties` and `required`\n * instead of letting a later object's `properties`/`required` completely\n * overwrite an earlier one's. Without this, a variant schema (e.g. a `oneOf`\n * branch) that declares its own `properties`/`required` would wipe out the\n * shared base fields factored out at the root (or via a sibling `allOf`)\n * instead of being combined with them (#9657).\n */\nfunction mergeSchemaProperties(...objects: (Record<string, unknown> | undefined)[]): Record<string, unknown> {\n const merged: Record<string, unknown> = {}\n const properties: Record<string, unknown> = {}\n const required = new Set<string>()\n let hasProperties = false\n let hasRequired = false\n\n for (const object of objects) {\n if (!object) {\n continue\n }\n\n for (const [key, val] of Object.entries(object)) {\n if (key === 'properties' && val && typeof val === 'object') {\n Object.assign(properties, val)\n hasProperties = true\n continue\n }\n\n if (key === 'required' && Array.isArray(val)) {\n for (const name of val) {\n required.add(name)\n }\n hasRequired = true\n continue\n }\n\n merged[key] = val\n }\n }\n\n if (hasProperties) {\n merged.properties = properties\n }\n if (hasRequired) {\n merged.required = [...required]\n }\n\n return merged\n}\n\n/**\n * Optimize the value by removing nulls from compositions and merging root properties.\n *\n * TODO: figure out what this does\n */\nexport function optimizeValueForDisplay(value: SchemaObject | undefined): SchemaObject | undefined {\n if (!value || typeof value !== 'object') {\n return value\n }\n\n // Find the composition keyword early to avoid unnecessary work\n const composition = compositions.find((keyword) => keyword in value && keyword !== 'not')\n\n // If there's no relevant composition keyword, return a shallow copy\n if (!composition) {\n return { ...value }\n }\n\n const schemas = value[composition]\n if (!Array.isArray(schemas)) {\n return { ...value }\n }\n\n // Extract root properties efficiently (excluding composition and nullable)\n const { [composition]: _, nullable: originalNullable, ...rootProperties } = value as any\n const hasRootProperties = Object.keys(rootProperties).length > 0\n\n // Check for null schemas and filter them out in one pass\n const { filteredSchemas, hasNullSchema } = schemas.reduce(\n (acc, _schema) => {\n const schema = resolve.schema(_schema)\n\n if ('type' in schema && schema.type === 'null') {\n acc.hasNullSchema = true\n } else {\n acc.filteredSchemas.push(schema)\n }\n return acc\n },\n { filteredSchemas: [] as SchemaObject[], hasNullSchema: false },\n )\n\n // Determine if nullable should be set\n const shouldBeNullable = hasNullSchema || originalNullable === true\n\n // If only one schema remains after filtering, merge with root properties.\n // `properties`/`required` are unioned so sibling properties declared next to\n // the composition (e.g. `properties` alongside a single-`$ref` `allOf`) are\n // kept instead of being overwritten by the member schema's own `properties`.\n // Root-level annotations (title, description, …) win over the member's: they\n // describe the combined schema, not the base it extends.\n if (filteredSchemas.length === 1) {\n const mergedSchema = mergeSchemaProperties(filteredSchemas[0], rootProperties) as SchemaObject\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n mergedSchema.nullable = true\n }\n return mergedSchema\n }\n\n // Check if root properties should be merged into schemas\n const shouldMergeRootProperties =\n (composition === 'oneOf' || composition === 'anyOf') &&\n (hasRootProperties || filteredSchemas.some((schema) => schema.allOf))\n\n if (shouldMergeRootProperties) {\n const mergedSchemas = filteredSchemas.map((_schema) => {\n const schema = resolve.schema(_schema)\n\n // Flatten single-item allOf and merge with root properties\n if (schema.allOf?.length === 1) {\n const { allOf, ...otherProps } = schema\n return mergeSchemaProperties(rootProperties, otherProps, resolve.schema(allOf[0]))\n }\n return mergeSchemaProperties(rootProperties, schema)\n })\n\n // @ts-expect-error - We avoid using coerceValue here as it may be dangerous, so we type cast\n const result = { [composition]: mergedSchemas } as SchemaObject\n if (typeof value.description === 'string') {\n result.description = value.description\n }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n // Return with filtered schemas if any nulls were removed\n if (filteredSchemas.length !== schemas.length) {\n const result: SchemaObject = { ...value, [composition]: filteredSchemas }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n return { ...value }\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAS,sBAAsB,GAAG,SAA2E;CAC3G,MAAM,SAAkC,CAAC;CACzC,MAAM,aAAsC,CAAC;CAC7C,MAAM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B;CAQ/D,IAAI,gBAAgB,WAAW,GAAG;EAChC,MAAM,eAAe,sBAAsB,gBAAgB,IAAI,cAAc;EAC7E,IAAI,kBAEF,aAAa,WAAW;EAE1B,OAAO;CACT;CAOA,KAHG,gBAAgB,WAAW,gBAAgB,aAC3C,qBAAqB,gBAAgB,MAAM,WAAW,OAAO,KAAK,IAEtC;EAC7B,MAAM,gBAAgB,gBAAgB,KAAK,YAAY;GACrD,MAAM,SAAS,QAAQ,OAAO,OAAO;GAGrC,IAAI,OAAO,OAAO,WAAW,GAAG;IAC9B,MAAM,EAAE,OAAO,GAAG,eAAe;IACjC,OAAO,sBAAsB,gBAAgB,YAAY,QAAQ,OAAO,MAAM,EAAE,CAAC;GACnF;GACA,OAAO,sBAAsB,gBAAgB,MAAM;EACrD,CAAC;EAGD,MAAM,SAAS,GAAG,cAAc,cAAc;EAC9C,IAAI,OAAO,MAAM,gBAAgB,UAC/B,OAAO,cAAc,MAAM;EAE7B,IAAI,kBAEF,OAAO,WAAW;EAEpB,OAAO;CACT;CAGA,IAAI,gBAAgB,WAAW,QAAQ,QAAQ;EAC7C,MAAM,SAAuB;GAAE,GAAG;IAAQ,cAAc;EAAgB;EACxE,IAAI,kBAEF,OAAO,WAAW;EAEpB,OAAO;CACT;CAEA,OAAO,EAAE,GAAG,MAAM;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partition-all-of-compositions.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/partition-all-of-compositions.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { mergeAllOfSchemas } from './merge-all-of-schemas'\nimport type { CompositionKeyword } from './schema-composition'\n\ntype ChoiceKeyword = Extract<CompositionKeyword, 'oneOf' | 'anyOf'>\n\n/** An ordered piece of an `allOf`: either a merged object or a choice picker. */\ntype AllOfSegment =\n | { kind: 'object'; schema: SchemaObject }\n | {\n kind: 'choice'\n composition: ChoiceKeyword\n /** A minimal schema carrying only this group's composition, for SchemaComposition */\n value: SchemaObject\n /** Ordinal among choice members, matching the request-example composition key */\n choiceIndex: number\n }\n\nconst CHOICE_KEYWORDS: ChoiceKeyword[] = ['oneOf', 'anyOf']\n\ntype Member =\n | { kind: 'object'; schema: SchemaObject }\n | { kind: 'choice'; composition: ChoiceKeyword; value: SchemaObject }\n\n/**\n * Flattens a member's own (non-composition) properties and every `oneOf`/`anyOf`\n * group it declares — recursing into nested `allOf` — into a flat, ordered list,\n * preserving source order so choice groups stay where they were authored.\n *\n * Pure-constraint keywords (`not`, `if/then/else`) are dropped: they carry no\n * visual variant and Scalar would otherwise render `not` as a bogus picker. The\n * rule still lives in the schema (validation) and in field descriptions.\n */\nconst collectMembers = (schema: SchemaObject, out: Member[], seenRefs: Set<string>): void => {\n const {\n allOf,\n oneOf,\n anyOf,\n not: _not,\n if: _if,\n then: _then,\n else: _else,\n ...rest\n } = schema as SchemaObject & {\n allOf?: unknown[]\n oneOf?: unknown[]\n anyOf?: unknown[]\n not?: unknown\n if?: unknown\n then?: unknown\n else?: unknown\n }\n\n if (Object.keys(rest).length > 0) {\n out.push({ kind: 'object', schema: rest as SchemaObject })\n }\n\n for (const keyword of CHOICE_KEYWORDS) {\n const value = keyword === 'oneOf' ? oneOf : anyOf\n if (Array.isArray(value) && value.length > 0) {\n out.push({ kind: 'choice', composition: keyword, value: { [keyword]: value } as unknown as SchemaObject })\n }\n }\n\n if (Array.isArray(allOf)) {\n for (const rawMember of allOf) {\n if (rawMember && typeof rawMember === 'object') {\n const resolved = resolve.schema(rawMember) as SchemaObject & { $ref?: string }\n // Break `$ref` cycles reached through `allOf` (e.g. a member that\n // references an ancestor). Without this guard a recursive `allOf`\n // schema would recurse forever. `mergeAllOfSchemas` guards the same way.\n const ref = resolved.$ref\n if (typeof ref === 'string') {\n if (seenRefs.has(ref)) {\n continue\n }\n collectMembers(resolved, out, new Set(seenRefs).add(ref))\n } else {\n collectMembers(resolved, out, seenRefs)\n }\n }\n }\n }\n}\n\n/**\n * Splits an `allOf` schema into an ordered list of segments so the renderer can\n * show each `oneOf`/`anyOf` group as its own picker **in the position it was\n * declared**, with the surrounding plain fields around it.\n *\n * `mergeAllOfSchemas` alone keeps only the FIRST `oneOf`/`anyOf` (dropping the\n * 2nd+ groups of an object with several independent mutually-exclusive\n * selections) and, being a merge, also loses the ordering between fields and\n * choices. Walking the members in order fixes both: runs of consecutive object\n * members are merged into one object segment, and each choice member becomes its\n * own picker segment in place.\n */\nexport const partitionAllOfCompositions = (schema: SchemaObject | undefined): { segments: AllOfSegment[] } => {\n if (!schema) {\n return { segments: [] }\n }\n\n // The schema's own (non-composition) keys, minus its top-level `oneOf`/`anyOf`\n // — those are rendered as their own composition by the caller, not here.\n const {\n allOf,\n oneOf: _oneOf,\n anyOf: _anyOf,\n not: _not,\n if: _if,\n then: _then,\n else: _else,\n ...rest\n } = schema as SchemaObject & {\n allOf?: unknown[]\n oneOf?: unknown[]\n anyOf?: unknown[]\n not?: unknown\n if?: unknown\n then?: unknown\n else?: unknown\n }\n\n if (!Array.isArray(allOf)) {\n return { segments: [{ kind: 'object', schema: schema }] }\n }\n\n const members: Member[] = []\n if (Object.keys(rest).length > 0) {\n members.push({ kind: 'object', schema: rest as SchemaObject })\n }\n const seenRefs = new Set<string>()\n for (const rawMember of allOf) {\n if (rawMember && typeof rawMember === 'object') {\n const resolved = resolve.schema(rawMember) as SchemaObject & { $ref?: string }\n const ref = resolved.$ref\n collectMembers(resolved, members, typeof ref === 'string' ? new Set(seenRefs).add(ref) : seenRefs)\n }\n }\n\n // Coalesce consecutive object members into a single merged object segment,\n // keeping choice members as their own segments between them.\n const segments: AllOfSegment[] = []\n let objectRun: SchemaObject[] = []\n let choiceIndex = 0\n\n const flushObjectRun = () => {\n if (objectRun.length === 0) {\n return\n }\n const merged = objectRun.length === 1 ? objectRun[0]! : mergeAllOfSchemas({ allOf: objectRun } as SchemaObject)\n segments.push({ kind: 'object', schema: merged })\n objectRun = []\n }\n\n for (const member of members) {\n if (member.kind === 'object') {\n objectRun.push(member.schema)\n } else {\n flushObjectRun()\n // `choiceIndex` is the ordinal used to build the composition-selection key\n // that syncs each picker with the request example. It MUST stay aligned\n // with the ordinal computed while walking `allOf` in\n // `get-example-from-schema.ts` (`@scalar/workspace-store`), or a picker and\n // its generated example fall out of sync.\n segments.push({\n kind: 'choice',\n composition: member.composition,\n value: member.value,\n choiceIndex: choiceIndex++,\n })\n }\n }\n flushObjectRun()\n\n return { segments }\n}\n"],"mappings":";;;AAoBA,IAAM,kBAAmC,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"partition-all-of-compositions.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/partition-all-of-compositions.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { mergeAllOfSchemas } from './merge-all-of-schemas'\nimport type { CompositionKeyword } from './schema-composition'\n\ntype ChoiceKeyword = Extract<CompositionKeyword, 'oneOf' | 'anyOf'>\n\n/** An ordered piece of an `allOf`: either a merged object or a choice picker. */\ntype AllOfSegment =\n | { kind: 'object'; schema: SchemaObject }\n | {\n kind: 'choice'\n composition: ChoiceKeyword\n /** A minimal schema carrying only this group's composition, for SchemaComposition */\n value: SchemaObject\n /** Ordinal among choice members, matching the request-example composition key */\n choiceIndex: number\n }\n\nconst CHOICE_KEYWORDS: ChoiceKeyword[] = ['oneOf', 'anyOf']\n\ntype Member =\n | { kind: 'object'; schema: SchemaObject }\n | { kind: 'choice'; composition: ChoiceKeyword; value: SchemaObject }\n\n/**\n * Flattens a member's own (non-composition) properties and every `oneOf`/`anyOf`\n * group it declares — recursing into nested `allOf` — into a flat, ordered list,\n * preserving source order so choice groups stay where they were authored.\n *\n * Pure-constraint keywords (`not`, `if/then/else`) are dropped: they carry no\n * visual variant and Scalar would otherwise render `not` as a bogus picker. The\n * rule still lives in the schema (validation) and in field descriptions.\n */\nconst collectMembers = (schema: SchemaObject, out: Member[], seenRefs: Set<string>): void => {\n const {\n allOf,\n oneOf,\n anyOf,\n not: _not,\n if: _if,\n then: _then,\n else: _else,\n ...rest\n } = schema as SchemaObject & {\n allOf?: unknown[]\n oneOf?: unknown[]\n anyOf?: unknown[]\n not?: unknown\n if?: unknown\n then?: unknown\n else?: unknown\n }\n\n if (Object.keys(rest).length > 0) {\n out.push({ kind: 'object', schema: rest as SchemaObject })\n }\n\n for (const keyword of CHOICE_KEYWORDS) {\n const value = keyword === 'oneOf' ? oneOf : anyOf\n if (Array.isArray(value) && value.length > 0) {\n out.push({ kind: 'choice', composition: keyword, value: { [keyword]: value } as unknown as SchemaObject })\n }\n }\n\n if (Array.isArray(allOf)) {\n for (const rawMember of allOf) {\n if (rawMember && typeof rawMember === 'object') {\n const resolved = resolve.schema(rawMember) as SchemaObject & { $ref?: string }\n // Break `$ref` cycles reached through `allOf` (e.g. a member that\n // references an ancestor). Without this guard a recursive `allOf`\n // schema would recurse forever. `mergeAllOfSchemas` guards the same way.\n const ref = resolved.$ref\n if (typeof ref === 'string') {\n if (seenRefs.has(ref)) {\n continue\n }\n collectMembers(resolved, out, new Set(seenRefs).add(ref))\n } else {\n collectMembers(resolved, out, seenRefs)\n }\n }\n }\n }\n}\n\n/**\n * Splits an `allOf` schema into an ordered list of segments so the renderer can\n * show each `oneOf`/`anyOf` group as its own picker **in the position it was\n * declared**, with the surrounding plain fields around it.\n *\n * `mergeAllOfSchemas` alone keeps only the FIRST `oneOf`/`anyOf` (dropping the\n * 2nd+ groups of an object with several independent mutually-exclusive\n * selections) and, being a merge, also loses the ordering between fields and\n * choices. Walking the members in order fixes both: runs of consecutive object\n * members are merged into one object segment, and each choice member becomes its\n * own picker segment in place.\n */\nexport const partitionAllOfCompositions = (schema: SchemaObject | undefined): { segments: AllOfSegment[] } => {\n if (!schema) {\n return { segments: [] }\n }\n\n // The schema's own (non-composition) keys, minus its top-level `oneOf`/`anyOf`\n // — those are rendered as their own composition by the caller, not here.\n const {\n allOf,\n oneOf: _oneOf,\n anyOf: _anyOf,\n not: _not,\n if: _if,\n then: _then,\n else: _else,\n ...rest\n } = schema as SchemaObject & {\n allOf?: unknown[]\n oneOf?: unknown[]\n anyOf?: unknown[]\n not?: unknown\n if?: unknown\n then?: unknown\n else?: unknown\n }\n\n if (!Array.isArray(allOf)) {\n return { segments: [{ kind: 'object', schema: schema }] }\n }\n\n const members: Member[] = []\n if (Object.keys(rest).length > 0) {\n members.push({ kind: 'object', schema: rest as SchemaObject })\n }\n const seenRefs = new Set<string>()\n for (const rawMember of allOf) {\n if (rawMember && typeof rawMember === 'object') {\n const resolved = resolve.schema(rawMember) as SchemaObject & { $ref?: string }\n const ref = resolved.$ref\n collectMembers(resolved, members, typeof ref === 'string' ? new Set(seenRefs).add(ref) : seenRefs)\n }\n }\n\n // Coalesce consecutive object members into a single merged object segment,\n // keeping choice members as their own segments between them.\n const segments: AllOfSegment[] = []\n let objectRun: SchemaObject[] = []\n let choiceIndex = 0\n\n const flushObjectRun = () => {\n if (objectRun.length === 0) {\n return\n }\n const merged = objectRun.length === 1 ? objectRun[0]! : mergeAllOfSchemas({ allOf: objectRun } as SchemaObject)\n segments.push({ kind: 'object', schema: merged })\n objectRun = []\n }\n\n for (const member of members) {\n if (member.kind === 'object') {\n objectRun.push(member.schema)\n } else {\n flushObjectRun()\n // `choiceIndex` is the ordinal used to build the composition-selection key\n // that syncs each picker with the request example. It MUST stay aligned\n // with the ordinal computed while walking `allOf` in\n // `get-example-from-schema.ts` (`@scalar/workspace-store`), or a picker and\n // its generated example fall out of sync.\n segments.push({\n kind: 'choice',\n composition: member.composition,\n value: member.value,\n choiceIndex: choiceIndex++,\n })\n }\n }\n flushObjectRun()\n\n return { segments }\n}\n"],"mappings":";;;AAoBA,IAAM,kBAAmC,CAAC,SAAS,OAAO;;;;;;;;;;AAe1D,IAAM,kBAAkB,QAAsB,KAAe,aAAgC;CAC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,MAAM,aAAa,OACtB,IAAI,aAAa,OAAO,cAAc,UAAU;EAC9C,MAAM,WAAW,QAAQ,OAAO,SAAS;EACzC,MAAM,MAAM,SAAS;EACrB,eAAe,UAAU,SAAS,OAAO,QAAQ,WAAW,IAAI,IAAI,QAAQ,CAAC,CAAC,IAAI,GAAG,IAAI,QAAQ;CACnG;CAKF,MAAM,WAA2B,CAAC;CAClC,IAAI,YAA4B,CAAC;CACjC,IAAI,cAAc;CAElB,MAAM,uBAAuB;EAC3B,IAAI,UAAU,WAAW,GACvB;EAEF,MAAM,SAAS,UAAU,WAAW,IAAI,UAAU,KAAM,kBAAkB,EAAE,OAAO,UAAU,CAAiB;EAC9G,SAAS,KAAK;GAAE,MAAM;GAAU,QAAQ;EAAO,CAAC;EAChD,YAAY,CAAC;CACf;CAEA,KAAK,MAAM,UAAU,SACnB,IAAI,OAAO,SAAS,UAClB,UAAU,KAAK,OAAO,MAAM;MACvB;EACL,eAAe;EAMf,SAAS,KAAK;GACZ,MAAM;GACN,aAAa,OAAO;GACpB,OAAO,OAAO;GACd,aAAa;EACf,CAAC;CACH;CAEF,eAAe;CAEf,OAAO,EAAE,SAAS;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-composition.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-composition.ts"],"sourcesContent":["/** Composition */\nexport type CompositionKeyword = 'oneOf' | 'anyOf' | 'allOf' | 'not'\n\nexport const compositions: CompositionKeyword[] = ['oneOf', 'anyOf', 'allOf', 'not']\n"],"mappings":";AAGA,IAAa,eAAqC;CAAC;CAAS;CAAS;CAAS;
|
|
1
|
+
{"version":3,"file":"schema-composition.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-composition.ts"],"sourcesContent":["/** Composition */\nexport type CompositionKeyword = 'oneOf' | 'anyOf' | 'allOf' | 'not'\n\nexport const compositions: CompositionKeyword[] = ['oneOf', 'anyOf', 'allOf', 'not']\n"],"mappings":";AAGA,IAAa,eAAqC;CAAC;CAAS;CAAS;CAAS;AAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-cycle.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-cycle.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\n\n/**\n * The set of schema \"cycle keys\" for every ancestor on the current render path.\n *\n * Each `Schema` component injects this set, adds its own key, and re-provides\n * it to its descendants. When a node's key is already present in the ancestor\n * set we've hit a cycle (a self-referential schema) and must stop force\n * expanding to avoid rendering forever.\n *\n * See {@link getCycleKey} for how a node's key is derived.\n */\nexport const SCHEMA_ANCESTORS_SYMBOL: InjectionKey<ReadonlySet<unknown>> = Symbol('schema-ancestors')\n\n/**\n * Derive a stable identity for a schema node from its *raw* (unresolved) value.\n *\n * Cycle detection needs a key that is identical every time the same schema is\n * reached along a path, and that survives the shallow copies/merges performed\n * while rendering (which break object identity of the resolved schema).\n *\n * - For `$ref` nodes we use the ref string. Two branches that reference the\n * same component share the string, so a schema that (transitively) references\n * itself is detected as a cycle, while sibling references are not.\n * - For inline schemas there is no ref, so we fall back to the raw object\n * reference. A self-referential inline schema reuses the same object, so\n * object identity catches the cycle.\n *\n * Returns `undefined` for primitives/booleans (e.g. `additionalProperties: true`)\n * which can never form a cycle.\n */\nexport const getCycleKey = (raw: unknown): unknown => {\n if (raw && typeof raw === 'object') {\n if ('$ref' in raw && typeof (raw as { $ref?: unknown }).$ref === 'string') {\n return (raw as { $ref: string }).$ref\n }\n return raw\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,0BAA8D,OAAO,
|
|
1
|
+
{"version":3,"file":"schema-cycle.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-cycle.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\n\n/**\n * The set of schema \"cycle keys\" for every ancestor on the current render path.\n *\n * Each `Schema` component injects this set, adds its own key, and re-provides\n * it to its descendants. When a node's key is already present in the ancestor\n * set we've hit a cycle (a self-referential schema) and must stop force\n * expanding to avoid rendering forever.\n *\n * See {@link getCycleKey} for how a node's key is derived.\n */\nexport const SCHEMA_ANCESTORS_SYMBOL: InjectionKey<ReadonlySet<unknown>> = Symbol('schema-ancestors')\n\n/**\n * Derive a stable identity for a schema node from its *raw* (unresolved) value.\n *\n * Cycle detection needs a key that is identical every time the same schema is\n * reached along a path, and that survives the shallow copies/merges performed\n * while rendering (which break object identity of the resolved schema).\n *\n * - For `$ref` nodes we use the ref string. Two branches that reference the\n * same component share the string, so a schema that (transitively) references\n * itself is detected as a cycle, while sibling references are not.\n * - For inline schemas there is no ref, so we fall back to the raw object\n * reference. A self-referential inline schema reuses the same object, so\n * object identity catches the cycle.\n *\n * Returns `undefined` for primitives/booleans (e.g. `additionalProperties: true`)\n * which can never form a cycle.\n */\nexport const getCycleKey = (raw: unknown): unknown => {\n if (raw && typeof raw === 'object') {\n if ('$ref' in raw && typeof (raw as { $ref?: unknown }).$ref === 'string') {\n return (raw as { $ref: string }).$ref\n }\n return raw\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,0BAA8D,OAAO,kBAAkB;;;;;;;;;;;;;;;;;;AAmBpG,IAAa,eAAe,QAA0B;CACpD,IAAI,OAAO,OAAO,QAAQ,UAAU;EAClC,IAAI,UAAU,OAAO,OAAQ,IAA2B,SAAS,UAC/D,OAAQ,IAAyB;EAEnC,OAAO;CACT;AAGF"}
|
|
@@ -5,7 +5,12 @@ import type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/
|
|
|
5
5
|
* Handles $ref, title, name, type, and schema dictionary lookup
|
|
6
6
|
*/
|
|
7
7
|
export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>) => {
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The key in `components.schemas` (extracted from `$ref`), used for sidebar
|
|
10
|
+
* navigation. Only set when the `$ref` actually targets
|
|
11
|
+
* `#/components/schemas/`; `null` for refs into other component buckets or
|
|
12
|
+
* external files, so those never render a dead link.
|
|
13
|
+
*/
|
|
9
14
|
schemaKey: string | null;
|
|
10
15
|
/** The human-readable name to display (schema.title, schema.name, or ref key). */
|
|
11
16
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAIrH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D;IACD
|
|
1
|
+
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AAIrH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,YAAY,GAAG,mBAAmB,CAAC,YAAY,CAAC,KAC5D;IACD;;;;;OAKG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,IA4BH,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRefName } from "./get-ref-name.js";
|
|
1
|
+
import { getRefName, getSchemaRefName } from "./get-ref-name.js";
|
|
2
2
|
import { resolve } from "@scalar/workspace-store/resolve";
|
|
3
3
|
//#region src/components/Content/Schema/helpers/schema-name.ts
|
|
4
4
|
/**
|
|
@@ -9,7 +9,7 @@ import { resolve } from "@scalar/workspace-store/resolve";
|
|
|
9
9
|
var getModelNameFromSchema = (schemaOrRef) => {
|
|
10
10
|
if (!schemaOrRef) return null;
|
|
11
11
|
const schema = resolve.schema(schemaOrRef);
|
|
12
|
-
const schemaKey = "$ref" in schemaOrRef ?
|
|
12
|
+
const schemaKey = "$ref" in schemaOrRef ? getSchemaRefName(schemaOrRef.$ref) : null;
|
|
13
13
|
if (schema.title) return {
|
|
14
14
|
schemaKey,
|
|
15
15
|
label: schema.title
|
|
@@ -19,9 +19,10 @@ var getModelNameFromSchema = (schemaOrRef) => {
|
|
|
19
19
|
label: schema.name
|
|
20
20
|
};
|
|
21
21
|
if ("$ref" in schemaOrRef) {
|
|
22
|
-
|
|
22
|
+
const label = getRefName(schemaOrRef.$ref);
|
|
23
|
+
if (label) return {
|
|
23
24
|
schemaKey,
|
|
24
|
-
label
|
|
25
|
+
label
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-name.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { getRefName } from './get-ref-name'\n\n/**\n * Extract schema name from various schema formats\n *\n * Handles $ref, title, name, type, and schema dictionary lookup\n */\nexport const getModelNameFromSchema = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): {\n
|
|
1
|
+
{"version":3,"file":"schema-name.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { getRefName, getSchemaRefName } from './get-ref-name'\n\n/**\n * Extract schema name from various schema formats\n *\n * Handles $ref, title, name, type, and schema dictionary lookup\n */\nexport const getModelNameFromSchema = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): {\n /**\n * The key in `components.schemas` (extracted from `$ref`), used for sidebar\n * navigation. Only set when the `$ref` actually targets\n * `#/components/schemas/`; `null` for refs into other component buckets or\n * external files, so those never render a dead link.\n */\n schemaKey: string | null\n /** The human-readable name to display (schema.title, schema.name, or ref key). */\n label: string\n} | null => {\n if (!schemaOrRef) {\n return null\n }\n\n const schema = resolve.schema(schemaOrRef)\n\n // Only refs into `#/components/schemas/` are navigable in the models section.\n const schemaKey = '$ref' in schemaOrRef ? getSchemaRefName(schemaOrRef.$ref) : null\n\n if (schema.title) {\n return { schemaKey, label: schema.title }\n }\n\n if (schema.name) {\n return { schemaKey, label: schema.name }\n }\n\n if ('$ref' in schemaOrRef) {\n // Fall back to the last ref segment as a display label, even for\n // non-schema refs. The name still shows, it just is not a link.\n const label = getRefName(schemaOrRef.$ref)\n if (label) {\n return { schemaKey, label }\n }\n }\n\n return null\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,0BACX,gBAWU;CACV,IAAI,CAAC,aACH,OAAO;CAGT,MAAM,SAAS,QAAQ,OAAO,WAAW;CAGzC,MAAM,YAAY,UAAU,cAAc,iBAAiB,YAAY,IAAI,IAAI;CAE/E,IAAI,OAAO,OACT,OAAO;EAAE;EAAW,OAAO,OAAO;CAAM;CAG1C,IAAI,OAAO,MACT,OAAO;EAAE;EAAW,OAAO,OAAO;CAAK;CAGzC,IAAI,UAAU,aAAa;EAGzB,MAAM,QAAQ,WAAW,YAAY,IAAI;EACzC,IAAI,OACF,OAAO;GAAE;GAAW;EAAM;CAE9B;CAEA,OAAO;AACT"}
|