@scalar/api-reference 1.49.3 → 1.49.4
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 +9 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/blocks/index.js +4 -2
- 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 +9 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js +106 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.script.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +9 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js +121 -0
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.script.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js +27 -0
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js.map +1 -0
- package/dist/blocks/scalar-client-selector-block/index.d.ts +1 -1
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +9 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js +55 -0
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js +69 -0
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +9 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js +68 -0
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js +40 -0
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js +35 -0
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js +25 -0
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +9 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js +15 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +14 -0
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +9 -0
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js +92 -0
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +7 -0
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js.map +1 -0
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.script.js +19 -0
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.script.js.map +1 -0
- package/dist/blocks/scalar-info-block/index.d.ts +2 -2
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +7 -0
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js.map +1 -0
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js +71 -0
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.script.js.map +1 -0
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +7 -0
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js.map +1 -0
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js +69 -0
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.script.js.map +1 -0
- package/dist/blocks/scalar-server-selector-block/index.d.ts +1 -1
- package/dist/browser/standalone.js +35377 -34973
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/AgentScalar/AgentScalarButton.vue.js +7 -0
- package/dist/components/AgentScalar/AgentScalarButton.vue.js.map +1 -0
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js +21 -0
- package/dist/components/AgentScalar/AgentScalarButton.vue.script.js.map +1 -0
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js +7 -0
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js.map +1 -0
- package/dist/{AgentScalarChatInterface-MUbtSqMw.js → components/AgentScalar/AgentScalarChatInterface.vue.script.js} +5 -6
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.script.js.map +1 -0
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts +0 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.d.ts.map +1 -1
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +9 -0
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js.map +1 -0
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js +65 -0
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.script.js.map +1 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.js +9 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.js.map +1 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js +184 -0
- package/dist/components/AgentScalar/OpenMCPButton.vue.script.js.map +1 -0
- package/dist/components/AgentScalar/index.d.ts +3 -3
- package/dist/components/Anchor/Anchor.vue.js +7 -0
- package/dist/components/Anchor/Anchor.vue.js.map +1 -0
- package/dist/components/Anchor/Anchor.vue.script.js +40 -0
- package/dist/components/Anchor/Anchor.vue.script.js.map +1 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.js +7 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.js.map +1 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js +32 -0
- package/dist/components/Anchor/WithBreadcrumb.vue.script.js.map +1 -0
- package/dist/components/Anchor/index.d.ts +2 -2
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +12 -0
- package/dist/components/ApiReference.vue.js.map +1 -0
- package/dist/components/ApiReference.vue.script.js +662 -0
- package/dist/components/ApiReference.vue.script.js.map +1 -0
- package/dist/components/Badge/Badge.vue.js +9 -0
- package/dist/components/Badge/Badge.vue.js.map +1 -0
- package/dist/components/Badge/Badge.vue.script.js +22 -0
- package/dist/components/Badge/Badge.vue.script.js.map +1 -0
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/ClassicHeader.vue.js +16 -0
- package/dist/components/ClassicHeader.vue.js.map +1 -0
- package/dist/components/Content/Auth/Auth.vue.js +7 -0
- package/dist/components/Content/Auth/Auth.vue.js.map +1 -0
- package/dist/components/Content/Auth/Auth.vue.script.js +70 -0
- package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -0
- package/dist/components/Content/Auth/helpers/get-default-security.js +64 -0
- package/dist/components/Content/Auth/helpers/get-default-security.js.map +1 -0
- package/dist/components/Content/Auth/index.d.ts +1 -1
- package/dist/components/Content/Content.vue.js +8 -0
- package/dist/components/Content/Content.vue.js.map +1 -0
- package/dist/components/Content/Content.vue.script.js +192 -0
- package/dist/components/Content/Content.vue.script.js.map +1 -0
- package/dist/components/Content/Models/Model.vue.js +7 -0
- package/dist/components/Content/Models/Model.vue.js.map +1 -0
- package/dist/components/Content/Models/Model.vue.script.js +61 -0
- package/dist/components/Content/Models/Model.vue.script.js.map +1 -0
- package/dist/components/Content/Models/ModelTag.vue.js +7 -0
- package/dist/components/Content/Models/ModelTag.vue.js.map +1 -0
- package/dist/components/Content/Models/ModelTag.vue.script.js +69 -0
- package/dist/components/Content/Models/ModelTag.vue.script.js.map +1 -0
- package/dist/components/Content/Models/components/ClassicLayout.vue.js +9 -0
- package/dist/components/Content/Models/components/ClassicLayout.vue.js.map +1 -0
- package/dist/components/Content/Models/components/ClassicLayout.vue.script.js +81 -0
- package/dist/components/Content/Models/components/ClassicLayout.vue.script.js.map +1 -0
- package/dist/components/Content/Models/components/ModernLayout.vue.js +7 -0
- package/dist/components/Content/Models/components/ModernLayout.vue.js.map +1 -0
- package/dist/components/Content/Models/components/ModernLayout.vue.script.js +66 -0
- package/dist/components/Content/Models/components/ModernLayout.vue.script.js.map +1 -0
- package/dist/components/Content/Models/index.d.ts +2 -2
- package/dist/components/Content/Operations/TraversedEntry.vue.js +7 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js +213 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/RenderString.vue.js +7 -0
- package/dist/components/Content/Schema/RenderString.vue.js.map +1 -0
- package/dist/components/Content/Schema/RenderString.vue.script.js +36 -0
- package/dist/components/Content/Schema/RenderString.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/Schema.vue.js +9 -0
- package/dist/components/Content/Schema/Schema.vue.js.map +1 -0
- package/dist/components/Content/Schema/Schema.vue.script.js +184 -0
- package/dist/components/Content/Schema/Schema.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js +146 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js +29 -0
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js +108 -0
- package/dist/components/Content/Schema/SchemaEnums.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js +45 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js +55 -0
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js +161 -0
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js +256 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js +35 -0
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js +30 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js +67 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +9 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js +251 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.script.js.map +1 -0
- package/dist/components/Content/Schema/helpers/format-example.js +26 -0
- package/dist/components/Content/Schema/helpers/format-example.js.map +1 -0
- package/dist/components/Content/Schema/helpers/format-value.js +22 -0
- package/dist/components/Content/Schema/helpers/format-value.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +1 -1
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +32 -0
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-enum-values.js +22 -0
- package/dist/components/Content/Schema/helpers/get-enum-values.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-property-description.js +36 -0
- package/dist/components/Content/Schema/helpers/get-property-description.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-ref-name.js +19 -0
- package/dist/components/Content/Schema/helpers/get-ref-name.js.map +1 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.js +49 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.js.map +1 -0
- package/dist/components/Content/Schema/helpers/has-complex-array-items.js +53 -0
- package/dist/components/Content/Schema/helpers/has-complex-array-items.js.map +1 -0
- package/dist/components/Content/Schema/helpers/is-empty-schema-object.js +18 -0
- package/dist/components/Content/Schema/helpers/is-empty-schema-object.js.map +1 -0
- package/dist/components/Content/Schema/helpers/is-type-object.js +18 -0
- package/dist/components/Content/Schema/helpers/is-type-object.js.map +1 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +175 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js.map +1 -0
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +68 -0
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js.map +1 -0
- package/dist/components/Content/Schema/helpers/schema-composition.js +11 -0
- package/dist/components/Content/Schema/helpers/schema-composition.js.map +1 -0
- package/dist/components/Content/Schema/helpers/schema-name.js +23 -0
- package/dist/components/Content/Schema/helpers/schema-name.js.map +1 -0
- package/dist/components/Content/Schema/helpers/should-display-description.js +17 -0
- package/dist/components/Content/Schema/helpers/should-display-description.js.map +1 -0
- package/dist/components/Content/Schema/helpers/should-display-heading.js +18 -0
- package/dist/components/Content/Schema/helpers/should-display-heading.js.map +1 -0
- package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js +20 -0
- package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js.map +1 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.js +45 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.js.map +1 -0
- package/dist/components/Content/Schema/index.d.ts +4 -4
- package/dist/components/Content/Tags/Tag.vue.js +7 -0
- package/dist/components/Content/Tags/Tag.vue.js.map +1 -0
- package/dist/components/Content/Tags/Tag.vue.script.js +56 -0
- package/dist/components/Content/Tags/Tag.vue.script.js.map +1 -0
- package/dist/components/Content/Tags/components/ClassicLayout.vue.js +9 -0
- package/dist/components/Content/Tags/components/ClassicLayout.vue.js.map +1 -0
- package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +49 -0
- package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js.map +1 -0
- package/dist/components/Content/Tags/components/ModernLayout.vue.js +9 -0
- package/dist/components/Content/Tags/components/ModernLayout.vue.js.map +1 -0
- package/dist/components/Content/Tags/components/ModernLayout.vue.script.js +63 -0
- package/dist/components/Content/Tags/components/ModernLayout.vue.script.js.map +1 -0
- package/dist/components/Content/Tags/components/TagSection.vue.js +7 -0
- package/dist/components/Content/Tags/components/TagSection.vue.js.map +1 -0
- package/dist/components/Content/Tags/components/TagSection.vue.script.js +78 -0
- package/dist/components/Content/Tags/components/TagSection.vue.script.js.map +1 -0
- package/dist/components/Content/Tags/index.d.ts +1 -1
- package/dist/components/Content/index.d.ts +2 -2
- package/dist/components/GettingStarted.vue.js +9 -0
- package/dist/components/GettingStarted.vue.js.map +1 -0
- package/dist/components/GettingStarted.vue.script.js +71 -0
- package/dist/components/GettingStarted.vue.script.js.map +1 -0
- package/dist/components/HttpMethod/HttpMethod.vue.js +7 -0
- package/dist/components/HttpMethod/HttpMethod.vue.js.map +1 -0
- package/dist/components/HttpMethod/HttpMethod.vue.script.js +33 -0
- package/dist/components/HttpMethod/HttpMethod.vue.script.js.map +1 -0
- package/dist/components/HttpMethod/index.d.ts +1 -1
- package/dist/components/IntersectionObserver.vue.js +7 -0
- package/dist/components/IntersectionObserver.vue.js.map +1 -0
- package/dist/components/IntersectionObserver.vue.script.js +45 -0
- package/dist/components/IntersectionObserver.vue.script.js.map +1 -0
- package/dist/components/Lazy/Lazy.vue.js +7 -0
- package/dist/components/Lazy/Lazy.vue.js.map +1 -0
- package/dist/components/Lazy/Lazy.vue.script.js +101 -0
- package/dist/components/Lazy/Lazy.vue.script.js.map +1 -0
- package/dist/components/LinkList/LinkList.vue.js +9 -0
- package/dist/components/LinkList/LinkList.vue.js.map +1 -0
- package/dist/components/LinkList/LinkList.vue.script.js +53 -0
- package/dist/components/LinkList/LinkList.vue.script.js.map +1 -0
- package/dist/components/LinkList/index.d.ts +1 -1
- package/dist/components/LoadingSkeleton.vue.js +9 -0
- package/dist/components/LoadingSkeleton.vue.js.map +1 -0
- package/dist/components/LoadingSkeleton.vue.script.js +20 -0
- package/dist/components/LoadingSkeleton.vue.script.js.map +1 -0
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.js +7 -0
- package/dist/components/MobileHeader.vue.js.map +1 -0
- package/dist/components/MobileHeader.vue.script.js +43 -0
- package/dist/components/MobileHeader.vue.script.js.map +1 -0
- package/dist/components/OperationPath.vue.js +9 -0
- package/dist/components/OperationPath.vue.js.map +1 -0
- package/dist/components/OperationPath.vue.script.js +24 -0
- package/dist/components/OperationPath.vue.script.js.map +1 -0
- package/dist/components/OperationsList/OperationsList.vue.js +9 -0
- package/dist/components/OperationsList/OperationsList.vue.js.map +1 -0
- package/dist/components/OperationsList/OperationsList.vue.script.js +49 -0
- package/dist/components/OperationsList/OperationsList.vue.script.js.map +1 -0
- package/dist/components/OperationsList/OperationsListItem.vue.js +9 -0
- package/dist/components/OperationsList/OperationsListItem.vue.js.map +1 -0
- package/dist/components/OperationsList/OperationsListItem.vue.script.js +51 -0
- package/dist/components/OperationsList/OperationsListItem.vue.script.js.map +1 -0
- package/dist/components/OperationsList/index.d.ts +1 -1
- package/dist/components/RenderPlugins/RenderPlugins.vue.js +7 -0
- package/dist/components/RenderPlugins/RenderPlugins.vue.js.map +1 -0
- package/dist/components/RenderPlugins/RenderPlugins.vue.script.js +44 -0
- package/dist/components/RenderPlugins/RenderPlugins.vue.script.js.map +1 -0
- package/dist/components/RenderPlugins/index.d.ts +1 -1
- package/dist/components/ScreenReader.vue.js +9 -0
- package/dist/components/ScreenReader.vue.js.map +1 -0
- package/dist/components/ScreenReader.vue.script.js +22 -0
- package/dist/components/ScreenReader.vue.script.js.map +1 -0
- package/dist/components/Section/CompactSection.vue.js +9 -0
- package/dist/components/Section/CompactSection.vue.js.map +1 -0
- package/dist/components/Section/CompactSection.vue.script.js +56 -0
- package/dist/components/Section/CompactSection.vue.script.js.map +1 -0
- package/dist/components/Section/Section.vue.js +9 -0
- package/dist/components/Section/Section.vue.js.map +1 -0
- package/dist/components/Section/Section.vue.script.js +23 -0
- package/dist/components/Section/Section.vue.script.js.map +1 -0
- package/dist/components/Section/SectionAccordion.vue.js +9 -0
- package/dist/components/Section/SectionAccordion.vue.js.map +1 -0
- package/dist/components/Section/SectionAccordion.vue.script.js +60 -0
- package/dist/components/Section/SectionAccordion.vue.script.js.map +1 -0
- package/dist/components/Section/SectionColumn.vue.js +14 -0
- package/dist/components/Section/SectionColumn.vue.js.map +1 -0
- package/dist/components/Section/SectionColumns.vue.js +14 -0
- package/dist/components/Section/SectionColumns.vue.js.map +1 -0
- package/dist/components/Section/SectionContainer.vue.js +9 -0
- package/dist/components/Section/SectionContainer.vue.js.map +1 -0
- package/dist/components/Section/SectionContainer.vue.script.js +19 -0
- package/dist/components/Section/SectionContainer.vue.script.js.map +1 -0
- package/dist/components/Section/SectionContainerAccordion.vue.js +9 -0
- package/dist/components/Section/SectionContainerAccordion.vue.js.map +1 -0
- package/dist/components/Section/SectionContainerAccordion.vue.script.js +40 -0
- package/dist/components/Section/SectionContainerAccordion.vue.script.js.map +1 -0
- package/dist/components/Section/SectionContent.vue.js +9 -0
- package/dist/components/Section/SectionContent.vue.js.map +1 -0
- package/dist/components/Section/SectionContent.vue.script.js +23 -0
- package/dist/components/Section/SectionContent.vue.script.js.map +1 -0
- package/dist/components/Section/SectionHeader.vue.js +9 -0
- package/dist/components/Section/SectionHeader.vue.js.map +1 -0
- package/dist/components/Section/SectionHeader.vue.script.js +23 -0
- package/dist/components/Section/SectionHeader.vue.script.js.map +1 -0
- package/dist/components/Section/SectionHeaderTag.vue.js +9 -0
- package/dist/components/Section/SectionHeaderTag.vue.js.map +1 -0
- package/dist/components/Section/SectionHeaderTag.vue.script.js +18 -0
- package/dist/components/Section/SectionHeaderTag.vue.script.js.map +1 -0
- package/dist/components/Section/index.d.ts +10 -10
- package/dist/components/SectionFlare/SectionFlare.vue.js +14 -0
- package/dist/components/SectionFlare/SectionFlare.vue.js.map +1 -0
- package/dist/components/SectionFlare/index.d.ts +1 -1
- package/dist/components/ShowMoreButton.vue.js +9 -0
- package/dist/components/ShowMoreButton.vue.js.map +1 -0
- package/dist/components/ShowMoreButton.vue.script.js +22 -0
- package/dist/components/ShowMoreButton.vue.script.js.map +1 -0
- package/dist/components/index.d.ts +5 -5
- package/dist/components/index.js +20 -102
- package/dist/{urls-gPTXGgbj.js → consts/urls.js} +2 -2
- package/dist/consts/urls.js.map +1 -0
- package/dist/features/Operation/Operation.vue.js +7 -0
- package/dist/features/Operation/Operation.vue.js.map +1 -0
- package/dist/features/Operation/Operation.vue.script.js +115 -0
- package/dist/features/Operation/Operation.vue.script.js.map +1 -0
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +7 -0
- package/dist/features/Operation/components/ContentTypeSelect.vue.js.map +1 -0
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js +75 -0
- package/dist/features/Operation/components/ContentTypeSelect.vue.script.js.map +1 -0
- package/dist/features/Operation/components/Header.vue.js +7 -0
- package/dist/features/Operation/components/Header.vue.js.map +1 -0
- package/dist/features/Operation/components/Header.vue.script.js +42 -0
- package/dist/features/Operation/components/Header.vue.script.js.map +1 -0
- package/dist/features/Operation/components/Headers.vue.js +9 -0
- package/dist/features/Operation/components/Headers.vue.js.map +1 -0
- package/dist/features/Operation/components/Headers.vue.script.js +58 -0
- package/dist/features/Operation/components/Headers.vue.script.js.map +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +7 -0
- package/dist/features/Operation/components/OperationParameters.vue.js.map +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.script.js +108 -0
- package/dist/features/Operation/components/OperationParameters.vue.script.js.map +1 -0
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +7 -0
- package/dist/features/Operation/components/OperationResponses.vue.js.map +1 -0
- package/dist/features/Operation/components/OperationResponses.vue.script.js +48 -0
- package/dist/features/Operation/components/OperationResponses.vue.script.js.map +1 -0
- package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +7 -0
- package/dist/features/Operation/components/ParameterList.vue.js.map +1 -0
- package/dist/features/Operation/components/ParameterList.vue.script.js +53 -0
- package/dist/features/Operation/components/ParameterList.vue.script.js.map +1 -0
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +9 -0
- package/dist/features/Operation/components/ParameterListItem.vue.js.map +1 -0
- package/dist/features/Operation/components/ParameterListItem.vue.script.js +161 -0
- package/dist/features/Operation/components/ParameterListItem.vue.script.js.map +1 -0
- package/dist/features/Operation/components/RequestBody.vue.js +9 -0
- package/dist/features/Operation/components/RequestBody.vue.js.map +1 -0
- package/dist/features/Operation/components/RequestBody.vue.script.js +154 -0
- package/dist/features/Operation/components/RequestBody.vue.script.js.map +1 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +9 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.js.map +1 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.script.js +62 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.script.js.map +1 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +7 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js.map +1 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js +67 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.script.js.map +1 -0
- package/dist/features/Operation/helpers/filter-selected-security.js +30 -0
- package/dist/features/Operation/helpers/filter-selected-security.js.map +1 -0
- package/dist/features/Operation/helpers/get-first-server.js +27 -0
- package/dist/features/Operation/helpers/get-first-server.js.map +1 -0
- package/dist/features/Operation/index.d.ts +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +9 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js +243 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +9 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js +243 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -0
- package/dist/features/Search/components/SearchButton.vue.js +7 -0
- package/dist/features/Search/components/SearchButton.vue.js.map +1 -0
- package/dist/features/Search/components/SearchButton.vue.script.js +77 -0
- package/dist/features/Search/components/SearchButton.vue.script.js.map +1 -0
- package/dist/features/Search/components/SearchModal.vue.js +9 -0
- package/dist/features/Search/components/SearchModal.vue.js.map +1 -0
- package/dist/features/Search/components/SearchModal.vue.script.js +115 -0
- package/dist/features/Search/components/SearchModal.vue.script.js.map +1 -0
- package/dist/features/Search/components/SearchResult.vue.js +7 -0
- package/dist/features/Search/components/SearchResult.vue.js.map +1 -0
- package/dist/features/Search/components/SearchResult.vue.script.js +69 -0
- package/dist/features/Search/components/SearchResult.vue.script.js.map +1 -0
- package/dist/features/Search/helpers/create-fuse-instance.js +52 -0
- package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -0
- package/dist/features/Search/helpers/create-search-index.js +127 -0
- package/dist/features/Search/helpers/create-search-index.js.map +1 -0
- package/dist/features/Search/hooks/useSearchIndex.js +31 -0
- package/dist/features/Search/hooks/useSearchIndex.js.map +1 -0
- package/dist/features/Search/index.d.ts +2 -2
- package/dist/features/Search/types.d.ts +1 -1
- package/dist/features/ask-agent-button/AskAgentButton.vue.js +9 -0
- package/dist/features/ask-agent-button/AskAgentButton.vue.js.map +1 -0
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js +49 -0
- package/dist/features/ask-agent-button/AskAgentButton.vue.script.js.map +1 -0
- package/dist/features/developer-tools/DeveloperTools.vue.js +7 -0
- package/dist/features/developer-tools/DeveloperTools.vue.js.map +1 -0
- package/dist/features/developer-tools/DeveloperTools.vue.script.js +49 -0
- package/dist/features/developer-tools/DeveloperTools.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +13 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js +38 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js +112 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js +60 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js +35 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js +68 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js +80 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js +66 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js +7 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js +44 -0
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.js +7 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.js.map +1 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js +26 -0
- package/dist/features/developer-tools/components/DeployApiReference.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.js +7 -0
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js +86 -0
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.script.js.map +1 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.js +7 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.js.map +1 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js +26 -0
- package/dist/features/developer-tools/components/ShareApiReference.vue.script.js.map +1 -0
- package/dist/features/developer-tools/index.d.ts +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +9 -0
- package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleResponse.vue.script.js +56 -0
- package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.js +9 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.script.js +21 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.script.js.map +1 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +9 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.script.js +31 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.script.js.map +1 -0
- package/dist/features/example-responses/ExampleResponses.vue.js +9 -0
- package/dist/features/example-responses/ExampleResponses.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleResponses.vue.script.js +157 -0
- package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -0
- package/dist/features/example-responses/ExampleSchema.vue.js +7 -0
- package/dist/features/example-responses/ExampleSchema.vue.js.map +1 -0
- package/dist/features/example-responses/ExampleSchema.vue.script.js +42 -0
- package/dist/features/example-responses/ExampleSchema.vue.script.js.map +1 -0
- package/dist/features/example-responses/has-response-content.js +37 -0
- package/dist/features/example-responses/has-response-content.js.map +1 -0
- package/dist/features/example-responses/index.d.ts +1 -1
- package/dist/features/external-docs/ExternalDocs.vue.js +7 -0
- package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -0
- package/dist/features/external-docs/ExternalDocs.vue.script.js +37 -0
- package/dist/features/external-docs/ExternalDocs.vue.script.js.map +1 -0
- package/dist/features/external-docs/index.d.ts +1 -1
- package/dist/features/index.d.ts +2 -2
- package/dist/features/index.js +4 -3
- package/dist/features/info-object/Contact.vue.js +7 -0
- package/dist/features/info-object/Contact.vue.js.map +1 -0
- package/dist/features/info-object/Contact.vue.script.js +37 -0
- package/dist/features/info-object/Contact.vue.script.js.map +1 -0
- package/dist/features/info-object/License.vue.js +7 -0
- package/dist/features/info-object/License.vue.js.map +1 -0
- package/dist/features/info-object/License.vue.script.js +32 -0
- package/dist/features/info-object/License.vue.script.js.map +1 -0
- package/dist/features/info-object/TermsOfService.vue.js +7 -0
- package/dist/features/info-object/TermsOfService.vue.js.map +1 -0
- package/dist/features/info-object/TermsOfService.vue.script.js +29 -0
- package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -0
- package/dist/features/info-object/index.d.ts +3 -3
- package/dist/features/multiple-documents/DocumentSelector.vue.js +7 -0
- package/dist/features/multiple-documents/DocumentSelector.vue.js.map +1 -0
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js +48 -0
- package/dist/features/multiple-documents/DocumentSelector.vue.script.js.map +1 -0
- package/dist/features/specification-extension/SpecificationExtension.vue.js +7 -0
- package/dist/features/specification-extension/SpecificationExtension.vue.js.map +1 -0
- package/dist/features/specification-extension/SpecificationExtension.vue.script.js +56 -0
- package/dist/features/specification-extension/SpecificationExtension.vue.script.js.map +1 -0
- package/dist/features/specification-extension/helpers.js +15 -0
- package/dist/features/specification-extension/helpers.js.map +1 -0
- package/dist/features/specification-extension/index.d.ts +2 -2
- package/dist/features/test-request-button/TestRequestButton.vue.js +9 -0
- package/dist/features/test-request-button/TestRequestButton.vue.js.map +1 -0
- package/dist/features/test-request-button/TestRequestButton.vue.script.js +47 -0
- package/dist/features/test-request-button/TestRequestButton.vue.script.js.map +1 -0
- package/dist/features/test-request-button/index.d.ts +1 -1
- package/dist/features/x-badges/XBadges.vue.js +7 -0
- package/dist/features/x-badges/XBadges.vue.js.map +1 -0
- package/dist/features/x-badges/XBadges.vue.script.js +31 -0
- package/dist/features/x-badges/XBadges.vue.script.js.map +1 -0
- package/dist/features/x-badges/index.d.ts +1 -1
- package/dist/helpers/color-mode.js +15 -0
- package/dist/helpers/color-mode.js.map +1 -0
- package/dist/helpers/download.js +77 -0
- package/dist/helpers/download.js.map +1 -0
- package/dist/helpers/id-routing.js +107 -0
- package/dist/helpers/id-routing.js.map +1 -0
- package/dist/helpers/index.d.ts +8 -8
- package/dist/helpers/index.js +8 -2
- package/dist/{lazy-bus-CV8Ox5hD.js → helpers/lazy-bus.js} +3 -106
- package/dist/helpers/lazy-bus.js.map +1 -0
- package/dist/helpers/load-from-perssistance.js +23 -0
- package/dist/helpers/load-from-perssistance.js.map +1 -0
- package/dist/helpers/map-config-plugins.js +44 -0
- package/dist/helpers/map-config-plugins.js.map +1 -0
- package/dist/helpers/map-config-to-workspace-store.js +24 -0
- package/dist/helpers/map-config-to-workspace-store.js.map +1 -0
- package/dist/helpers/normalize-configurations.js +66 -0
- package/dist/helpers/normalize-configurations.js.map +1 -0
- package/dist/helpers/openapi.js +132 -0
- package/dist/helpers/openapi.js.map +1 -0
- package/dist/{storage--3JuzjCI.js → helpers/storage.js} +2 -2
- package/dist/helpers/storage.js.map +1 -0
- package/dist/helpers/upload-temp-document.js +24 -0
- package/dist/helpers/upload-temp-document.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +2 -2
- package/dist/{use-agent-Bnm1de0n.js → hooks/use-agent.js} +2 -2
- package/dist/hooks/use-agent.js.map +1 -0
- package/dist/{use-intersection-8QqPi2O-.js → hooks/use-intersection.js} +2 -2
- package/dist/hooks/use-intersection.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/plugins/hooks/usePluginManager.js +16 -0
- package/dist/plugins/hooks/usePluginManager.js.map +1 -0
- package/dist/plugins/index.d.ts +3 -3
- package/dist/plugins/index.js +3 -1
- package/dist/plugins/persistance-plugin.js +39 -0
- package/dist/plugins/persistance-plugin.js.map +1 -0
- package/dist/plugins/plugin-manager.js +32 -0
- package/dist/plugins/plugin-manager.js.map +1 -0
- package/dist/ssr.js +6 -6
- package/dist/standalone/lib/html-api.js +73 -0
- package/dist/standalone/lib/html-api.js.map +1 -0
- package/dist/style.css +7878 -6432
- package/package.json +11 -11
- package/dist/AgentScalarChatInterface-MUbtSqMw.js.map +0 -1
- package/dist/ExternalDocs-phu7GxpZ.js +0 -272
- package/dist/ExternalDocs-phu7GxpZ.js.map +0 -1
- package/dist/MobileHeader-DAm6yQX0.js +0 -1373
- package/dist/MobileHeader-DAm6yQX0.js.map +0 -1
- package/dist/Operation-CvpVIkc3.js +0 -3829
- package/dist/Operation-CvpVIkc3.js.map +0 -1
- package/dist/SearchButton-xzhIpMCZ.js +0 -621
- package/dist/SearchButton-xzhIpMCZ.js.map +0 -1
- package/dist/ServerSelector-5y29y2BJ.js +0 -852
- package/dist/ServerSelector-5y29y2BJ.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/lazy-bus-CV8Ox5hD.js.map +0 -1
- package/dist/normalize-configurations-DcVpOEjD.js +0 -232
- package/dist/normalize-configurations-DcVpOEjD.js.map +0 -1
- package/dist/plugins-4EyiUD_A.js +0 -80
- package/dist/plugins-4EyiUD_A.js.map +0 -1
- package/dist/src-DJwsRvMU.js +0 -1686
- package/dist/src-DJwsRvMU.js.map +0 -1
- package/dist/storage--3JuzjCI.js.map +0 -1
- package/dist/urls-gPTXGgbj.js.map +0 -1
- package/dist/use-agent-Bnm1de0n.js.map +0 -1
- package/dist/use-intersection-8QqPi2O-.js.map +0 -1
|
@@ -1,110 +1,7 @@
|
|
|
1
|
+
import { getSchemaParamsFromId } from "./id-routing.js";
|
|
1
2
|
import { computed, nextTick, onBeforeUnmount, reactive, ref } from "vue";
|
|
2
3
|
import { watchDebounced } from "@vueuse/core";
|
|
3
4
|
import { nanoid } from "nanoid";
|
|
4
|
-
//#region src/helpers/id-routing.ts
|
|
5
|
-
var sanitizeBasePath = (basePath) => {
|
|
6
|
-
return basePath.replace(/^\/+|\/+$/g, "");
|
|
7
|
-
};
|
|
8
|
-
var isHashBasePath = (basePath) => basePath.startsWith("#");
|
|
9
|
-
var sanitizeHashBasePath = (basePath) => {
|
|
10
|
-
return basePath.replace(/^#+/, "").replace(/\/+$/g, "");
|
|
11
|
-
};
|
|
12
|
-
var applySlugPrefix = (base, slugPrefix) => {
|
|
13
|
-
return slugPrefix ? `${slugPrefix}${base ? "/" : ""}${base}` : base;
|
|
14
|
-
};
|
|
15
|
-
var stripBasePathPrefix = (value, basePath) => {
|
|
16
|
-
if (value === basePath) return "";
|
|
17
|
-
if (value.startsWith(`${basePath}/`)) return value.slice(basePath.length + 1);
|
|
18
|
-
return null;
|
|
19
|
-
};
|
|
20
|
-
/** Extracts an element id from the hash when using hash routing */
|
|
21
|
-
var getIdFromHash = (location, slugPrefix) => {
|
|
22
|
-
const url = typeof location === "string" ? new URL(location) : location;
|
|
23
|
-
return applySlugPrefix(decodeURIComponent(url.hash.slice(1)), slugPrefix);
|
|
24
|
-
};
|
|
25
|
-
/** Extracts an element id from the path when using path routing */
|
|
26
|
-
var getIdFromPath = (location, basePath, slugPrefix) => {
|
|
27
|
-
const url = typeof location === "string" ? new URL(location) : location;
|
|
28
|
-
const sanitized = sanitizeBasePath(basePath);
|
|
29
|
-
const basePathWithSlash = sanitized ? `/${sanitized.split("/").map((segment) => encodeURIComponent(segment)).join("/")}` : "";
|
|
30
|
-
if (url.pathname.startsWith(basePathWithSlash)) {
|
|
31
|
-
const remainder = url.pathname.slice(basePathWithSlash.length);
|
|
32
|
-
return applySlugPrefix(decodeURIComponent(remainder.startsWith("/") ? remainder.slice(1) : remainder), slugPrefix);
|
|
33
|
-
}
|
|
34
|
-
return slugPrefix ?? "";
|
|
35
|
-
};
|
|
36
|
-
/** Extracts an element id from a hash-prefixed basePath */
|
|
37
|
-
var getIdFromHashBasePath = (location, basePath, slugPrefix) => {
|
|
38
|
-
const url = typeof location === "string" ? new URL(location) : location;
|
|
39
|
-
const remainder = stripBasePathPrefix(decodeURIComponent(url.hash.slice(1)), sanitizeHashBasePath(basePath));
|
|
40
|
-
if (remainder !== null) return applySlugPrefix(remainder, slugPrefix);
|
|
41
|
-
return slugPrefix ?? "";
|
|
42
|
-
};
|
|
43
|
-
/** Determines whether a URL matches the provided basePath. */
|
|
44
|
-
var matchesBasePath = (location, basePath) => {
|
|
45
|
-
const url = typeof location === "string" ? new URL(location) : location;
|
|
46
|
-
if (isHashBasePath(basePath)) {
|
|
47
|
-
const hash = decodeURIComponent(url.hash);
|
|
48
|
-
return hash === basePath || hash.startsWith(`${basePath}/`);
|
|
49
|
-
}
|
|
50
|
-
const sanitized = sanitizeBasePath(basePath);
|
|
51
|
-
const basePathWithSlash = sanitized ? `/${sanitized.split("/").map((segment) => encodeURIComponent(segment)).join("/")}` : "";
|
|
52
|
-
return url.pathname === basePathWithSlash || url.pathname.startsWith(`${basePathWithSlash}/`);
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Extracts a navigation id from a URL based on the routing type
|
|
56
|
-
*
|
|
57
|
-
* @param url - The URL to extract the id from
|
|
58
|
-
* @param basePath - The base path used in path routing
|
|
59
|
-
* @param slugPrefix - If the document slug is not expected in the URL then we must prefix it
|
|
60
|
-
*/
|
|
61
|
-
var getIdFromUrl = (url, basePath, slugPrefix) => {
|
|
62
|
-
if (typeof basePath !== "string") return getIdFromHash(url, slugPrefix);
|
|
63
|
-
return isHashBasePath(basePath) ? getIdFromHashBasePath(url, basePath, slugPrefix) : getIdFromPath(url, basePath, slugPrefix);
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Strips the first segment from an id and preserves trailing slashes
|
|
67
|
-
* Used in single-document mode where the document slug is not needed in the URL
|
|
68
|
-
*
|
|
69
|
-
* @param id - The full id to process
|
|
70
|
-
* @returns The id with the first segment removed, preserving trailing slash if present
|
|
71
|
-
*/
|
|
72
|
-
var stripFirstSegment = (id) => {
|
|
73
|
-
const hasTrailingSlash = id.endsWith("/");
|
|
74
|
-
const result = id.split("/").filter(Boolean).slice(1).join("/");
|
|
75
|
-
return hasTrailingSlash && result ? `${result}/` : result;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Generate a new URL and applies the ID to the path or hash
|
|
79
|
-
* depending on the type of routing used
|
|
80
|
-
*
|
|
81
|
-
* @param id - The id to apply to the URL
|
|
82
|
-
* @param basePath - The base path used in path routing
|
|
83
|
-
* @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id
|
|
84
|
-
*/
|
|
85
|
-
var makeUrlFromId = (_id, basePath, isMultiDocument) => {
|
|
86
|
-
if (typeof window === "undefined") return;
|
|
87
|
-
/** When there is only 1 document we don't need to include the document name in the URL */
|
|
88
|
-
const id = isMultiDocument ? _id : stripFirstSegment(_id);
|
|
89
|
-
const url = new URL(window.location.href);
|
|
90
|
-
if (typeof basePath === "string") if (isHashBasePath(basePath)) url.hash = [sanitizeHashBasePath(basePath), id].filter(Boolean).join("/");
|
|
91
|
-
else url.pathname = `${sanitizeBasePath(basePath)}/${id}`;
|
|
92
|
-
else url.hash = id;
|
|
93
|
-
return url;
|
|
94
|
-
};
|
|
95
|
-
/** Extracts the schema parameters from the id if they are present */
|
|
96
|
-
var getSchemaParamsFromId = (id) => {
|
|
97
|
-
const matcher = id.match(/(.*)(\.body\.|\.path\.|\.query\.|\.header\.)(.*)/);
|
|
98
|
-
if (matcher && typeof matcher[1] === "string" && typeof matcher[2] === "string") return {
|
|
99
|
-
rawId: matcher[1],
|
|
100
|
-
params: matcher[2].slice(1) + matcher[3]
|
|
101
|
-
};
|
|
102
|
-
return {
|
|
103
|
-
rawId: id,
|
|
104
|
-
params: ""
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
//#endregion
|
|
108
5
|
//#region src/helpers/lazy-bus.ts
|
|
109
6
|
/**
|
|
110
7
|
* List of items that are in the priority queue and will be rendered first (e.g. scroll target).
|
|
@@ -328,6 +225,6 @@ var freeze = (id) => {
|
|
|
328
225
|
};
|
|
329
226
|
};
|
|
330
227
|
//#endregion
|
|
331
|
-
export {
|
|
228
|
+
export { addToPriorityQueue, blockIntersection, firstLazyLoadComplete, getLazyPlaceholderHeight, intersectionEnabled, requestLazyRender, scheduleInitialLoadComplete, scrollToLazy, setLazyPlaceholderHeight, useLazyBus };
|
|
332
229
|
|
|
333
|
-
//# sourceMappingURL=lazy-bus
|
|
230
|
+
//# sourceMappingURL=lazy-bus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-bus.js","names":[],"sources":["../../src/helpers/lazy-bus.ts"],"sourcesContent":["import { watchDebounced } from '@vueuse/core'\nimport { nanoid } from 'nanoid'\nimport { computed, nextTick, onBeforeUnmount, reactive, ref } from 'vue'\n\nimport { getSchemaParamsFromId } from './id-routing'\n\n/**\n * List of items that are in the priority queue and will be rendered first (e.g. scroll target).\n */\nconst priorityQueue = reactive<Set<string>>(new Set())\n/** List of items that are pending to be loaded (in viewport overscan). */\nconst pendingQueue = reactive<Set<string>>(new Set())\n/** List of items that are already loaded and stay mounted (no eviction). */\nconst readyQueue = reactive<Set<string>>(new Set())\n/**\n * Flag to indicate if the lazy bus is currently running\n * Blocks ID changes while running\n */\nconst isRunning = ref(false)\n\n/** How long tryScroll keeps retrying to find the element (ms). */\nconst SCROLL_RETRY_MS = 3000\n\n/** Tracks when the initial load is complete. */\nexport const firstLazyLoadComplete = ref(false)\n\n/** List of unique identifiers that are blocking intersection */\nconst intersectionBlockers = reactive<Set<string>>(new Set())\n\nconst onRenderComplete = new Set<() => void>()\n\n/** Cached content heights so placeholders can match when not rendered. */\nconst lazyPlaceholderHeights = reactive<Map<string, number>>(new Map())\n\nexport const getLazyPlaceholderHeight = (id: string): number | undefined => lazyPlaceholderHeights.get(id)\n\nexport const setLazyPlaceholderHeight = (id: string, height: number): void => {\n if (!Number.isFinite(height) || height <= 0) {\n return\n }\n lazyPlaceholderHeights.set(id, Math.round(height))\n}\n\n/** Adds a one time callback to be executed when the lazy bus has finished loading */\nconst addLazyCompleteCallback = (callback: (() => void) | undefined) => {\n if (callback) {\n onRenderComplete.add(callback)\n }\n}\n\ntype UnblockFn = () => void\n\n/**\n * Blocks intersection until the returned unblock callback is run.\n * Prevents scroll jump while we render new lazy content.\n */\nexport const blockIntersection = (): UnblockFn => {\n const blockId = nanoid()\n intersectionBlockers.add(blockId)\n\n /** Unblock uses a small delay to ensure the scroll is complete before enabling intersection */\n return () => setTimeout(() => intersectionBlockers.delete(blockId), 100)\n}\n\n/** If there are any pending blocking operations we disable intersection */\nexport const intersectionEnabled = computed(() => intersectionBlockers.size === 0)\n\n/**\n * Processes the full queue: priority first, then pending. Blocks intersection while\n * rendering so the viewport does not jump. No eviction — items stay in readyQueue.\n */\nconst runLazyBus = () => {\n // We always render the lazy bus when the window is undefined (see useLazyBus)\n if (typeof window === 'undefined') {\n return\n }\n\n if (isRunning.value) {\n return\n }\n\n isRunning.value = true\n\n /**\n * Sets all the pending elements into the ready queue\n * After waiting for Vue to update the DOM we execute the callbacks and unblock intersection\n */\n const processQueue = async () => {\n const priorityIds = [...priorityQueue]\n const pendingIds = [...pendingQueue]\n\n if (priorityIds.length === 0 && pendingIds.length === 0) {\n onRenderComplete.forEach((fn) => fn())\n onRenderComplete.clear()\n isRunning.value = false\n firstLazyLoadComplete.value = true\n return\n }\n\n for (const id of priorityIds) {\n readyQueue.add(id)\n priorityQueue.delete(id)\n }\n for (const id of pendingIds) {\n readyQueue.add(id)\n pendingQueue.delete(id)\n }\n\n await nextTick()\n\n onRenderComplete.forEach((fn) => fn())\n onRenderComplete.clear()\n isRunning.value = false\n firstLazyLoadComplete.value = true\n }\n\n if (window.requestIdleCallback) {\n window.requestIdleCallback(processQueue, { timeout: 1500 })\n } else {\n // biome-ignore lint/nursery/noFloatingPromises: Expected floating promise\n nextTick(processQueue)\n }\n}\n\n/**\n * Run the lazy bus when the queue changes and is not currently running\n * Debounce so that multiple changes to the queue are batched together\n *\n * We must run when the priority queue changes because we rely on finish callbacks\n * anytime we request potentially lazy elements. If we don't run when the priority queue changes\n * we may not have a finish callback even though the element is set to load.\n */\nwatchDebounced(\n [() => pendingQueue.size, () => priorityQueue.size, () => isRunning.value],\n () => {\n if ((pendingQueue.size > 0 || priorityQueue.size > 0) && !isRunning.value) {\n runLazyBus()\n }\n },\n { debounce: 300, maxWait: 1500 },\n)\n\n/**\n * We only make elements pending if they are not already in the priority or ready queue\n */\nconst addToPendingQueue = (id: string | undefined) => {\n if (id && !readyQueue.has(id) && !priorityQueue.has(id)) {\n pendingQueue.add(id)\n }\n}\n\n/**\n * Add elements to the priority queue for immediate rendering.\n * We allow adding items already in readyQueue so that callbacks are still triggered,\n * but processQueue will skip actual re-rendering for items already ready.\n */\nexport const addToPriorityQueue = (id: string | undefined) => {\n if (id && !priorityQueue.has(id)) {\n priorityQueue.add(id)\n }\n}\n\n/**\n * Request an item to be rendered (e.g. when it re-enters the overscan zone).\n */\nexport const requestLazyRender = (id: string | undefined, priority = false): void => {\n if (!id || readyQueue.has(id)) {\n return\n }\n if (priority) {\n addToPriorityQueue(id)\n } else {\n addToPendingQueue(id)\n }\n if (!isRunning.value) {\n runLazyBus()\n }\n}\n\n/**\n * Schedules a single run of the lazy bus so that documents with no Lazy components\n * (e.g. no operations, tags, or models) still get firstLazyLoadComplete set and the\n * full-viewport placeholder can be hidden. Call from content root on mount.\n */\nexport const scheduleInitialLoadComplete = (): void => {\n if (typeof window === 'undefined') {\n return\n }\n const delay = 400\n window.setTimeout(() => runLazyBus(), delay)\n}\n\n/** When an element is unmounted we remove it from all queues */\nconst resetLazyElement = (id: string) => {\n priorityQueue.delete(id)\n pendingQueue.delete(id)\n readyQueue.delete(id)\n lazyPlaceholderHeights.delete(id)\n}\n\n// ---------------------------------------------------------------------------\n\n/**\n * Tracks the lazy loading state of an element.\n * Use isReady (or expanded) to decide whether to render the slot or show a placeholder.\n * The element is only added to the queue when it enters the viewport overscan (see Lazy.vue).\n */\nexport function useLazyBus(id: string) {\n onBeforeUnmount(() => {\n resetLazyElement(id)\n })\n\n return {\n isReady: computed(() => typeof window === 'undefined' || priorityQueue.has(id) || readyQueue.has(id)),\n }\n}\n\n/**\n * Scroll to a possibly lazy-loaded element. Expands parents and adds target (and\n * parents) to the priority queue, then scrolls after Vue has flushed.\n */\nexport const scrollToLazy = (\n id: string,\n setExpanded: (id: string, value: boolean) => void,\n getEntryById: (id: string) => { id: string; parent?: { id: string }; children?: { id: string }[] } | undefined,\n) => {\n const item = getEntryById(id)\n\n /**\n * If the element is lazy we must freeze the element so that it does not move until after the next lazy bus run\n * If the element never loads then the scroll onFailure callback will be run to unfreeze the element\n *\n * If the readyQueue does not have the item we must freeze it while it renders\n * If the item has lazy children we must freeze the item while the children are (potentially) loaded\n */\n const isLazy = !readyQueue.has(id) || item?.children?.some((child) => !readyQueue.has(child.id))\n\n const unfreeze = isLazy ? freeze(id) : undefined\n addLazyCompleteCallback(unfreeze)\n\n // Disable intersection while we scroll to the element\n const unblock = blockIntersection()\n const { rawId } = getSchemaParamsFromId(id)\n\n addToPriorityQueue(id)\n addToPriorityQueue(rawId)\n\n // When there are children we ensure the first 2 are loaded\n if (item?.children) {\n item.children.slice(0, 2).forEach((child) => addToPriorityQueue(child.id))\n }\n\n // When there are sibling items we attempt to load the next 2 to better fill the viewport\n if (item?.parent) {\n const parent = getEntryById(item.parent.id)\n const elementIdx = parent?.children?.findIndex((child) => child.id === id)\n if (elementIdx !== undefined && elementIdx >= 0) {\n parent?.children?.slice(elementIdx, elementIdx + 2).forEach((child) => addToPriorityQueue(child.id))\n }\n }\n\n setExpanded(rawId, true)\n /**\n * Recursively expand the parents and set them as a loading priority\n * This ensures all parents will be immediately loaded and open\n */\n const addParents = (currentId: string) => {\n const parent = getEntryById(currentId)?.parent\n if (parent) {\n addToPriorityQueue(parent.id)\n setExpanded(parent.id, true)\n addParents(parent.id)\n }\n }\n /** Must use the rawId as schema params are not in the navigation tree */\n addParents(rawId)\n\n void nextTick(() => {\n tryScroll(id, Date.now() + SCROLL_RETRY_MS, unblock, unfreeze)\n })\n}\n\n/**\n * Tiny wrapper around the scrollIntoView API\n * Retries up to the stopTime in case the element is not yet rendered\n *\n * @param id - The id of the element to scroll to\n * @param stopTime - The time to stop retrying in unix milliseconds\n */\nconst tryScroll = (id: string, stopTime: number, onComplete: UnblockFn, onFailure?: () => void): void => {\n const element = document.getElementById(id)\n if (element) {\n element.scrollIntoView({ block: 'start' })\n onComplete()\n } else if (Date.now() < stopTime) {\n requestAnimationFrame(() => tryScroll(id, stopTime, onComplete, onFailure))\n } else {\n // If the scroll has expired we enable intersection again\n onComplete()\n onFailure?.()\n }\n}\n\nconst freeze = (id: string): (() => void) => {\n let stop = false\n\n /**\n * Runs until the stop flag is set\n * Executes the final frame after stop changes to true\n */\n const runFrame = (stopAfterFrame: boolean) => {\n const element = document.getElementById(id)\n if (element) {\n element.scrollIntoView({ block: 'start' })\n }\n if (!stopAfterFrame) {\n requestAnimationFrame(() => runFrame(stop))\n }\n }\n\n runFrame(false)\n\n return () => {\n stop = true\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { authStorage, clientStorage } from "./storage.js";
|
|
2
|
+
import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
|
|
3
|
+
//#region src/helpers/load-from-perssistance.ts
|
|
4
|
+
/**
|
|
5
|
+
* Loads the default HTTP client from storage and applies it to the workspace.
|
|
6
|
+
* Only updates if no default client is already set.
|
|
7
|
+
*/
|
|
8
|
+
var loadClientFromStorage = (store) => {
|
|
9
|
+
const storedClient = clientStorage().get();
|
|
10
|
+
if (isClient(storedClient) && !store.workspace["x-scalar-default-client"]) store.update("x-scalar-default-client", storedClient);
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Loads the authentication data from storage and applies it to the workspace.
|
|
14
|
+
* Only updates if no authentication data is already set.
|
|
15
|
+
*/
|
|
16
|
+
var loadAuthFromStorage = (store, slug) => {
|
|
17
|
+
const auth = authStorage().getAuth(slug);
|
|
18
|
+
store.auth.load({ [slug]: auth });
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { loadAuthFromStorage, loadClientFromStorage };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=load-from-perssistance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-from-perssistance.js","names":[],"sources":["../../src/helpers/load-from-perssistance.ts"],"sourcesContent":["import { isClient } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\n\nimport { authStorage, clientStorage } from '@/helpers/storage'\n\n/**\n * Loads the default HTTP client from storage and applies it to the workspace.\n * Only updates if no default client is already set.\n */\nexport const loadClientFromStorage = (store: WorkspaceStore): void => {\n const storedClient = clientStorage().get()\n\n if (isClient(storedClient) && !store.workspace['x-scalar-default-client']) {\n store.update('x-scalar-default-client', storedClient)\n }\n}\n\n/**\n * Loads the authentication data from storage and applies it to the workspace.\n * Only updates if no authentication data is already set.\n */\nexport const loadAuthFromStorage = (store: WorkspaceStore, slug: string): void => {\n const authPersistence = authStorage()\n const auth = authPersistence.getAuth(slug)\n store.auth.load({ [slug]: auth })\n}\n"],"mappings":";;;;;;;AASA,IAAa,yBAAyB,UAAgC;CACpE,MAAM,eAAe,eAAe,CAAC,KAAK;AAE1C,KAAI,SAAS,aAAa,IAAI,CAAC,MAAM,UAAU,2BAC7C,OAAM,OAAO,2BAA2B,aAAa;;;;;;AAQzD,IAAa,uBAAuB,OAAuB,SAAuB;CAEhF,MAAM,OADkB,aAAa,CACR,QAAQ,KAAK;AAC1C,OAAM,KAAK,KAAK,GAAG,OAAO,MAAM,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { watch } from "vue";
|
|
2
|
+
//#region src/helpers/map-config-plugins.ts
|
|
3
|
+
/**
|
|
4
|
+
* Maps API reference configuration callbacks to client plugins.
|
|
5
|
+
*
|
|
6
|
+
* This function transforms the legacy onBeforeRequest and onRequestSent callbacks
|
|
7
|
+
* into the new plugin hook system. The mapping is reactive, so changes to the
|
|
8
|
+
* configuration will automatically update the plugin hooks.
|
|
9
|
+
*
|
|
10
|
+
* Note: onRequestSent is mapped to responseReceived hook. This is not a perfect
|
|
11
|
+
* one-to-one mapping, but it maintains backward compatibility with the old API.
|
|
12
|
+
* The old callback receives only the URL string, while the new hook receives
|
|
13
|
+
* the full response object.
|
|
14
|
+
*
|
|
15
|
+
* @param config - Reactive configuration object containing optional hook callbacks
|
|
16
|
+
* @returns Array containing a single plugin with the mapped hooks
|
|
17
|
+
*/
|
|
18
|
+
var mapConfigPlugins = (config) => {
|
|
19
|
+
const plugin = { hooks: {} };
|
|
20
|
+
watch([() => config.value.onBeforeRequest, () => config.value.onRequestSent], ([onBeforeRequest, onRequestSent]) => {
|
|
21
|
+
if (!plugin.hooks) plugin.hooks = {};
|
|
22
|
+
plugin.hooks.beforeRequest = onBeforeRequest ? async (payload) => {
|
|
23
|
+
const result = await onBeforeRequest(payload);
|
|
24
|
+
/**
|
|
25
|
+
* When the callback returns void (for side-effect only callbacks like logging),
|
|
26
|
+
* we return the original payload to keep the request pipeline working.
|
|
27
|
+
*/
|
|
28
|
+
if (result === void 0) return payload;
|
|
29
|
+
return result;
|
|
30
|
+
} : void 0;
|
|
31
|
+
/**
|
|
32
|
+
* Maps onRequestSent to responseReceived hook.
|
|
33
|
+
* The old API only passed the URL string, so we extract it from the request.
|
|
34
|
+
*/
|
|
35
|
+
plugin.hooks.responseReceived = onRequestSent ? (payload) => {
|
|
36
|
+
onRequestSent(payload.request.url);
|
|
37
|
+
} : void 0;
|
|
38
|
+
}, { immediate: true });
|
|
39
|
+
return [plugin];
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { mapConfigPlugins };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=map-config-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-config-plugins.js","names":[],"sources":["../../src/helpers/map-config-plugins.ts"],"sourcesContent":["import type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport { type ComputedRef, watch } from 'vue'\n\n/**\n * Maps API reference configuration callbacks to client plugins.\n *\n * This function transforms the legacy onBeforeRequest and onRequestSent callbacks\n * into the new plugin hook system. The mapping is reactive, so changes to the\n * configuration will automatically update the plugin hooks.\n *\n * Note: onRequestSent is mapped to responseReceived hook. This is not a perfect\n * one-to-one mapping, but it maintains backward compatibility with the old API.\n * The old callback receives only the URL string, while the new hook receives\n * the full response object.\n *\n * @param config - Reactive configuration object containing optional hook callbacks\n * @returns Array containing a single plugin with the mapped hooks\n */\nexport const mapConfigPlugins = (config: ComputedRef<ApiReferenceConfigurationRaw>): ClientPlugin[] => {\n const plugin: ClientPlugin = { hooks: {} }\n\n watch(\n [() => config.value.onBeforeRequest, () => config.value.onRequestSent],\n ([onBeforeRequest, onRequestSent]) => {\n if (!plugin.hooks) {\n plugin.hooks = {}\n }\n\n plugin.hooks.beforeRequest = onBeforeRequest\n ? async (payload) => {\n const result = await onBeforeRequest(payload)\n\n /**\n * When the callback returns void (for side-effect only callbacks like logging),\n * we return the original payload to keep the request pipeline working.\n */\n if (result === undefined) {\n return payload\n }\n\n return result\n }\n : undefined\n\n /**\n * Maps onRequestSent to responseReceived hook.\n * The old API only passed the URL string, so we extract it from the request.\n */\n plugin.hooks.responseReceived = onRequestSent\n ? (payload) => {\n onRequestSent(payload.request.url)\n }\n : undefined\n },\n { immediate: true },\n )\n\n return [plugin]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,IAAa,oBAAoB,WAAsE;CACrG,MAAM,SAAuB,EAAE,OAAO,EAAE,EAAE;AAE1C,OACE,OAAO,OAAO,MAAM,uBAAuB,OAAO,MAAM,cAAc,GACrE,CAAC,iBAAiB,mBAAmB;AACpC,MAAI,CAAC,OAAO,MACV,QAAO,QAAQ,EAAE;AAGnB,SAAO,MAAM,gBAAgB,kBACzB,OAAO,YAAY;GACjB,MAAM,SAAS,MAAM,gBAAgB,QAAQ;;;;;AAM7C,OAAI,WAAW,KAAA,EACb,QAAO;AAGT,UAAO;MAET,KAAA;;;;;AAMJ,SAAO,MAAM,mBAAmB,iBAC3B,YAAY;AACX,iBAAc,QAAQ,QAAQ,IAAI;MAEpC,KAAA;IAEN,EAAE,WAAW,MAAM,CACpB;AAED,QAAO,CAAC,OAAO"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { computed, toValue, watch } from "vue";
|
|
2
|
+
import { useFavicon } from "@vueuse/core";
|
|
3
|
+
import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
|
|
4
|
+
import { useSeoMeta } from "@unhead/vue";
|
|
5
|
+
//#region src/helpers/map-config-to-workspace-store.ts
|
|
6
|
+
var mapConfigToWorkspaceStore = ({ config, store, isDarkMode }) => {
|
|
7
|
+
watch(() => toValue(config).defaultHttpClient, (newValue) => {
|
|
8
|
+
if (newValue) {
|
|
9
|
+
const { targetKey, clientKey } = newValue;
|
|
10
|
+
const clientId = `${targetKey}/${clientKey}`;
|
|
11
|
+
if (isClient(clientId)) store.update("x-scalar-default-client", clientId);
|
|
12
|
+
}
|
|
13
|
+
}, { immediate: true });
|
|
14
|
+
/** Update the dark mode state when props change */
|
|
15
|
+
watch(() => toValue(config).darkMode, (isDark) => store.update("x-scalar-color-mode", isDark ? "dark" : "light"));
|
|
16
|
+
watch(() => isDarkMode.value, (newIsDark) => store.update("x-scalar-color-mode", newIsDark ? "dark" : "light"), { immediate: true });
|
|
17
|
+
if (toValue(config).metaData) useSeoMeta(toValue(config).metaData);
|
|
18
|
+
watch(() => toValue(config).proxyUrl, (newProxyUrl) => store.update("x-scalar-active-proxy", newProxyUrl), { immediate: true });
|
|
19
|
+
useFavicon(computed(() => toValue(config).favicon));
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { mapConfigToWorkspaceStore };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=map-config-to-workspace-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-config-to-workspace-store.js","names":[],"sources":["../../src/helpers/map-config-to-workspace-store.ts"],"sourcesContent":["import { isClient } from '@scalar/api-client/v2/blocks/operation-code-sample'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport { useSeoMeta } from '@unhead/vue'\nimport { useFavicon } from '@vueuse/core'\nimport { type MaybeRefOrGetter, type Ref, computed, toValue, watch } from 'vue'\n\nexport const mapConfigToWorkspaceStore = ({\n config,\n store,\n isDarkMode,\n}: {\n config: MaybeRefOrGetter<ApiReferenceConfigurationRaw>\n store: WorkspaceStore\n isDarkMode: Ref<boolean>\n}) => {\n // Update the workspace store if default client changes\n watch(\n () => toValue(config).defaultHttpClient,\n (newValue) => {\n if (newValue) {\n const { targetKey, clientKey } = newValue\n\n const clientId = `${targetKey}/${clientKey}`\n if (isClient(clientId)) {\n store.update('x-scalar-default-client', clientId)\n }\n }\n },\n { immediate: true },\n )\n\n /** Update the dark mode state when props change */\n watch(\n () => toValue(config).darkMode,\n (isDark) => store.update('x-scalar-color-mode', isDark ? 'dark' : 'light'),\n )\n\n // Temporary mapping of isDarkMode until we update the standalone component\n watch(\n () => isDarkMode.value,\n (newIsDark) => store.update('x-scalar-color-mode', newIsDark ? 'dark' : 'light'),\n { immediate: true },\n )\n\n if (toValue(config).metaData) {\n useSeoMeta(toValue(config).metaData)\n }\n\n // Update the active proxy when the proxyUrl changes\n watch(\n () => toValue(config).proxyUrl,\n (newProxyUrl) => store.update('x-scalar-active-proxy', newProxyUrl),\n { immediate: true },\n )\n\n const favicon = computed(() => toValue(config).favicon)\n useFavicon(favicon)\n}\n"],"mappings":";;;;;AAOA,IAAa,6BAA6B,EACxC,QACA,OACA,iBAKI;AAEJ,aACQ,QAAQ,OAAO,CAAC,oBACrB,aAAa;AACZ,MAAI,UAAU;GACZ,MAAM,EAAE,WAAW,cAAc;GAEjC,MAAM,WAAW,GAAG,UAAU,GAAG;AACjC,OAAI,SAAS,SAAS,CACpB,OAAM,OAAO,2BAA2B,SAAS;;IAIvD,EAAE,WAAW,MAAM,CACpB;;AAGD,aACQ,QAAQ,OAAO,CAAC,WACrB,WAAW,MAAM,OAAO,uBAAuB,SAAS,SAAS,QAAQ,CAC3E;AAGD,aACQ,WAAW,QAChB,cAAc,MAAM,OAAO,uBAAuB,YAAY,SAAS,QAAQ,EAChF,EAAE,WAAW,MAAM,CACpB;AAED,KAAI,QAAQ,OAAO,CAAC,SAClB,YAAW,QAAQ,OAAO,CAAC,SAAS;AAItC,aACQ,QAAQ,OAAO,CAAC,WACrB,gBAAgB,MAAM,OAAO,yBAAyB,YAAY,EACnE,EAAE,WAAW,MAAM,CACpB;AAGD,YADgB,eAAe,QAAQ,OAAO,CAAC,QAAQ,CACpC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { apiReferenceConfigurationWithSourceSchema, isConfigurationWithSources } from "@scalar/types/api-reference";
|
|
2
|
+
import { parseJsonOrYaml } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import GithubSlugger from "github-slugger";
|
|
4
|
+
//#region src/helpers/normalize-configurations.ts
|
|
5
|
+
/**
|
|
6
|
+
* Take any configuration and return a flat array of configurations.
|
|
7
|
+
*/
|
|
8
|
+
var normalizeConfigurations = (configuration) => {
|
|
9
|
+
const slugger = new GithubSlugger();
|
|
10
|
+
const normalized = {};
|
|
11
|
+
if (!configuration) return normalized;
|
|
12
|
+
(Array.isArray(configuration) ? configuration : [configuration]).flatMap((c) => {
|
|
13
|
+
if (isConfigurationWithSources(c)) {
|
|
14
|
+
const { sources: configSources, ...rest } = c;
|
|
15
|
+
return configSources?.map((source) => ({
|
|
16
|
+
...rest,
|
|
17
|
+
...source
|
|
18
|
+
})) ?? [];
|
|
19
|
+
}
|
|
20
|
+
return [c];
|
|
21
|
+
}).map((source) => {
|
|
22
|
+
/** Validation with migrate deprecated attributes to their new format */
|
|
23
|
+
const validated = apiReferenceConfigurationWithSourceSchema.safeParse(source);
|
|
24
|
+
return validated.success ? validated.data : null;
|
|
25
|
+
}).filter((c) => !!c && (!!c.url || !!c.content)).map((source, index) => addSlugAndTitle(source, index, slugger)).forEach((c) => {
|
|
26
|
+
const { url, content, ...config } = c;
|
|
27
|
+
normalized[c.slug] = {
|
|
28
|
+
config,
|
|
29
|
+
title: c.title,
|
|
30
|
+
slug: c.slug,
|
|
31
|
+
default: !!c?.default,
|
|
32
|
+
agent: c.agent,
|
|
33
|
+
source: content ? { content: normalizeContent(content) ?? {} } : { url }
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
return normalized;
|
|
37
|
+
};
|
|
38
|
+
/** Normalize content into a JS object or return null if it is falsey */
|
|
39
|
+
var normalizeContent = (content) => {
|
|
40
|
+
if (!content) return null;
|
|
41
|
+
if (typeof content === "function") return normalizeContent(content());
|
|
42
|
+
if (typeof content === "string") return parseJsonOrYaml(content);
|
|
43
|
+
return content;
|
|
44
|
+
};
|
|
45
|
+
/** Process a single spec configuration so that it has a title and a slug */
|
|
46
|
+
var addSlugAndTitle = (source, index = 0, slugger) => {
|
|
47
|
+
if (source.title) return {
|
|
48
|
+
...source,
|
|
49
|
+
slug: source.slug || slugger.slug(source.title),
|
|
50
|
+
title: source.title
|
|
51
|
+
};
|
|
52
|
+
if (source.slug) return {
|
|
53
|
+
...source,
|
|
54
|
+
slug: slugger.slug(source.slug),
|
|
55
|
+
title: source.slug
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
...source,
|
|
59
|
+
slug: `api-${index + 1}`,
|
|
60
|
+
title: `API #${index + 1}`
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { normalizeConfigurations };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=normalize-configurations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-configurations.js","names":[],"sources":["../../src/helpers/normalize-configurations.ts"],"sourcesContent":["import { parseJsonOrYaml } from '@scalar/oas-utils/helpers'\nimport {\n type AnyApiReferenceConfiguration,\n type ApiReferenceConfigurationRaw,\n type ApiReferenceConfigurationWithSource,\n apiReferenceConfigurationWithSourceSchema,\n isConfigurationWithSources,\n} from '@scalar/types/api-reference'\nimport GithubSlugger from 'github-slugger'\n\n/** Processed API Reference Configuration\n *\n * Creates the required title and slug for the API Reference.\n * Separate the source into a dedicated object\n * Returns the raw configuration to pass to components\n */\nexport type NormalizedConfiguration = {\n title: string\n slug: string\n config: ApiReferenceConfigurationRaw\n default: boolean\n agent: ApiReferenceConfigurationWithSource['agent']\n source: { url: string; content?: never } | { content: Record<string, unknown>; url?: never }\n}\n\ntype NormalizedConfigurations = Record<string, NormalizedConfiguration>\n\ntype ConfigWithRequiredSource = Omit<ApiReferenceConfigurationWithSource, 'url' | 'content'> &\n ({ url: string; content?: never } | { content: Record<string, unknown>; url?: never })\n\n/**\n * Take any configuration and return a flat array of configurations.\n */\nexport const normalizeConfigurations = (\n configuration: AnyApiReferenceConfiguration | undefined,\n): NormalizedConfigurations => {\n const slugger = new GithubSlugger()\n\n const normalized: NormalizedConfigurations = {}\n\n if (!configuration) {\n return normalized\n }\n\n const configList = Array.isArray(configuration) ? configuration : [configuration]\n\n configList\n /** Create a flat array of configurations with their document source data integrated. */\n .flatMap((c) => {\n // Check if this config has a 'sources' array property\n if (isConfigurationWithSources(c)) {\n // Destructure to separate sources array from other config properties\n const { sources: configSources, ...rest } = c\n\n // For each source in the array:\n // - Merge the source with the parent config properties\n // - Handle undefined sources by returning empty array via ?? []\n return configSources?.map((source) => ({ ...rest, ...source })) ?? []\n }\n\n // If config doesn't have sources array, treat the config itself as a source\n return [c]\n })\n .map((source) => {\n /** Validation with migrate deprecated attributes to their new format */\n const validated = apiReferenceConfigurationWithSourceSchema.safeParse(source)\n return validated.success ? validated.data : null\n })\n /** Filter out configurations that failed validation or don't have a url or content */\n .filter((c): c is ConfigWithRequiredSource => !!c && (!!c.url || !!c.content))\n /** Add required attributes to the source */\n .map((source, index) => addSlugAndTitle(source, index, slugger))\n /** Separate the configuration and sources by slug */\n .forEach((c) => {\n const { url, content, ...config } = c\n normalized[c.slug] = {\n config,\n title: c.title,\n slug: c.slug,\n default: !!c?.default,\n agent: c.agent,\n source: content ? { content: normalizeContent(content) ?? {} } : { url },\n }\n })\n\n // Process them and return normalized\n return normalized\n}\n\n/** Normalize content into a JS object or return null if it is falsey */\nexport const normalizeContent = (\n content: string | Record<string, unknown> | (() => string | Record<string, unknown>),\n): Record<string, unknown> | null => {\n if (!content) {\n return null\n }\n\n if (typeof content === 'function') {\n return normalizeContent(content())\n }\n\n if (typeof content === 'string') {\n return parseJsonOrYaml(content)\n }\n\n return content\n}\n\n/** Process a single spec configuration so that it has a title and a slug */\nconst addSlugAndTitle = (\n source: ConfigWithRequiredSource,\n index = 0,\n slugger: GithubSlugger,\n): ConfigWithRequiredSource & { slug: string; title: string } => {\n // Case 1: Title exists, generate slug from it\n if (source.title) {\n return {\n ...source,\n slug: source.slug || slugger.slug(source.title),\n title: source.title,\n }\n }\n\n // Case 2: Slug exists but no title, use slug as title\n if (source.slug) {\n return {\n ...source,\n slug: slugger.slug(source.slug),\n title: source.slug,\n }\n }\n\n // Case 3: Neither exists, use index\n return {\n ...source,\n slug: `api-${index + 1}`,\n title: `API #${index + 1}`,\n }\n}\n"],"mappings":";;;;;;;AAiCA,IAAa,2BACX,kBAC6B;CAC7B,MAAM,UAAU,IAAI,eAAe;CAEnC,MAAM,aAAuC,EAAE;AAE/C,KAAI,CAAC,cACH,QAAO;AAKT,EAFmB,MAAM,QAAQ,cAAc,GAAG,gBAAgB,CAAC,cAAc,EAI9E,SAAS,MAAM;AAEd,MAAI,2BAA2B,EAAE,EAAE;GAEjC,MAAM,EAAE,SAAS,eAAe,GAAG,SAAS;AAK5C,UAAO,eAAe,KAAK,YAAY;IAAE,GAAG;IAAM,GAAG;IAAQ,EAAE,IAAI,EAAE;;AAIvE,SAAO,CAAC,EAAE;GACV,CACD,KAAK,WAAW;;EAEf,MAAM,YAAY,0CAA0C,UAAU,OAAO;AAC7E,SAAO,UAAU,UAAU,UAAU,OAAO;GAC5C,CAED,QAAQ,MAAqC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS,CAE7E,KAAK,QAAQ,UAAU,gBAAgB,QAAQ,OAAO,QAAQ,CAAC,CAE/D,SAAS,MAAM;EACd,MAAM,EAAE,KAAK,SAAS,GAAG,WAAW;AACpC,aAAW,EAAE,QAAQ;GACnB;GACA,OAAO,EAAE;GACT,MAAM,EAAE;GACR,SAAS,CAAC,CAAC,GAAG;GACd,OAAO,EAAE;GACT,QAAQ,UAAU,EAAE,SAAS,iBAAiB,QAAQ,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK;GACzE;GACD;AAGJ,QAAO;;;AAIT,IAAa,oBACX,YACmC;AACnC,KAAI,CAAC,QACH,QAAO;AAGT,KAAI,OAAO,YAAY,WACrB,QAAO,iBAAiB,SAAS,CAAC;AAGpC,KAAI,OAAO,YAAY,SACrB,QAAO,gBAAgB,QAAQ;AAGjC,QAAO;;;AAIT,IAAM,mBACJ,QACA,QAAQ,GACR,YAC+D;AAE/D,KAAI,OAAO,MACT,QAAO;EACL,GAAG;EACH,MAAM,OAAO,QAAQ,QAAQ,KAAK,OAAO,MAAM;EAC/C,OAAO,OAAO;EACf;AAIH,KAAI,OAAO,KACT,QAAO;EACL,GAAG;EACH,MAAM,QAAQ,KAAK,OAAO,KAAK;EAC/B,OAAO,OAAO;EACf;AAIH,QAAO;EACL,GAAG;EACH,MAAM,OAAO,QAAQ;EACrB,OAAO,QAAQ,QAAQ;EACxB"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { isObjectSchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
|
+
import { isDereferenced } from "@scalar/openapi-types/helpers";
|
|
4
|
+
//#region src/helpers/openapi.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves a schema reference from workspace-store to a SchemaObject.
|
|
7
|
+
* Bridges SchemaReferenceType (which uses '$ref-value': unknown) to NodeInput (which uses '$ref-value': SchemaObject).
|
|
8
|
+
*/
|
|
9
|
+
function resolveSchemaRef(ref) {
|
|
10
|
+
return getResolvedRef(ref);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Formats a property object into a string.
|
|
14
|
+
*/
|
|
15
|
+
function formatProperty(key, obj) {
|
|
16
|
+
let output = key;
|
|
17
|
+
const isRequired = obj.required?.includes(key);
|
|
18
|
+
output += isRequired ? " REQUIRED " : " optional ";
|
|
19
|
+
const propRef = obj.properties[key];
|
|
20
|
+
if (!propRef) return output;
|
|
21
|
+
const property = resolveSchemaRef(propRef);
|
|
22
|
+
if (property && typeof property === "object" && "type" in property) {
|
|
23
|
+
output += property.type ?? "";
|
|
24
|
+
if ("description" in property && typeof property.description === "string") output += " " + property.description;
|
|
25
|
+
}
|
|
26
|
+
return output;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Recursively logs the properties of an object.
|
|
30
|
+
*/
|
|
31
|
+
function recursiveLogger(obj) {
|
|
32
|
+
const results = ["Body"];
|
|
33
|
+
const schema = getResolvedRef(obj?.schema);
|
|
34
|
+
if (!schema || !isObjectSchema(schema) || !schema.properties) return results;
|
|
35
|
+
const properties = schema.properties;
|
|
36
|
+
const schemaWithProps = {
|
|
37
|
+
properties,
|
|
38
|
+
required: schema.required
|
|
39
|
+
};
|
|
40
|
+
Object.keys(properties).forEach((key) => {
|
|
41
|
+
if (!obj.schema) return;
|
|
42
|
+
results.push(formatProperty(key, schemaWithProps));
|
|
43
|
+
const propRef = properties[key];
|
|
44
|
+
if (!propRef) return;
|
|
45
|
+
const property = resolveSchemaRef(propRef);
|
|
46
|
+
if (property && isObjectSchema(property) && property.properties) {
|
|
47
|
+
const nestedProperties = property.properties;
|
|
48
|
+
Object.keys(nestedProperties).forEach((subKey) => {
|
|
49
|
+
const ref = nestedProperties[subKey];
|
|
50
|
+
if (!ref) return;
|
|
51
|
+
const nested = resolveSchemaRef(ref);
|
|
52
|
+
const typeStr = nested && typeof nested === "object" && "type" in nested ? nested.type ?? "" : "";
|
|
53
|
+
results.push(`${subKey} ${typeStr}`);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return results;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Extracts the request body from an operation.
|
|
61
|
+
*/
|
|
62
|
+
function extractRequestBody(operation) {
|
|
63
|
+
try {
|
|
64
|
+
const media = getResolvedRef(operation?.requestBody)?.content?.["application/json"];
|
|
65
|
+
if (!media) throw new Error("Body not found");
|
|
66
|
+
return recursiveLogger(media);
|
|
67
|
+
} catch (_error) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Deep merge for objects
|
|
73
|
+
*/
|
|
74
|
+
function deepMerge(source, target) {
|
|
75
|
+
for (const [key, val] of Object.entries(source)) if (val !== null && typeof val === "object") {
|
|
76
|
+
target[key] ??= new val.__proto__.constructor();
|
|
77
|
+
deepMerge(val, target[key]);
|
|
78
|
+
} else if (typeof val !== "undefined") target[key] = val;
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Creates an empty specification object.
|
|
83
|
+
* The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
|
|
84
|
+
*/
|
|
85
|
+
function createEmptySpecification(partialSpecification) {
|
|
86
|
+
return deepMerge(partialSpecification ?? {}, {
|
|
87
|
+
info: {
|
|
88
|
+
title: "",
|
|
89
|
+
description: "",
|
|
90
|
+
termsOfService: "",
|
|
91
|
+
version: "",
|
|
92
|
+
license: {
|
|
93
|
+
name: "",
|
|
94
|
+
url: ""
|
|
95
|
+
},
|
|
96
|
+
contact: { email: "" }
|
|
97
|
+
},
|
|
98
|
+
servers: [],
|
|
99
|
+
tags: []
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* This function creates a parameter map from an Operation Object, that's easier to consume.
|
|
104
|
+
*
|
|
105
|
+
* TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it?
|
|
106
|
+
*/
|
|
107
|
+
function createParameterMap(operation) {
|
|
108
|
+
const map = {
|
|
109
|
+
path: [],
|
|
110
|
+
query: [],
|
|
111
|
+
header: [],
|
|
112
|
+
cookie: [],
|
|
113
|
+
body: [],
|
|
114
|
+
formData: []
|
|
115
|
+
};
|
|
116
|
+
const parameters = operation.parameters ?? [];
|
|
117
|
+
if (parameters) parameters.forEach((parameter) => {
|
|
118
|
+
if (!isDereferenced(parameter)) return;
|
|
119
|
+
if (typeof parameter === "object" && parameter !== null && "$ref" in parameter) return;
|
|
120
|
+
if (parameter.in === "path") map.path.push(parameter);
|
|
121
|
+
else if (parameter.in === "query") map.query.push(parameter);
|
|
122
|
+
else if (parameter.in === "header") map.header.push(parameter);
|
|
123
|
+
else if (parameter.in === "cookie") map.cookie.push(parameter);
|
|
124
|
+
else if (parameter.in === "body") map.body.push(parameter);
|
|
125
|
+
else if (parameter.in === "formData") map.formData.push(parameter);
|
|
126
|
+
});
|
|
127
|
+
return map;
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
export { createEmptySpecification, createParameterMap, extractRequestBody };
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=openapi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.js","names":[],"sources":["../../src/helpers/openapi.ts"],"sourcesContent":["import type { OpenAPI } from '@scalar/openapi-types'\nimport { isDereferenced } from '@scalar/openapi-types/helpers'\nimport { type NodeInput, getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.1/strict/media-type'\nimport type {\n OperationObject,\n ParameterObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isObjectSchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/** Object schema shape with properties, used when logging request body. */\ntype ObjectSchemaWithProperties = {\n properties: Record<string, SchemaReferenceType<SchemaObject>>\n required?: string[]\n}\n\n/**\n * Resolves a schema reference from workspace-store to a SchemaObject.\n * Bridges SchemaReferenceType (which uses '$ref-value': unknown) to NodeInput (which uses '$ref-value': SchemaObject).\n */\nfunction resolveSchemaRef(ref: SchemaReferenceType<SchemaObject>): SchemaObject {\n return getResolvedRef(ref as NodeInput<SchemaObject>)\n}\n\n/**\n * Formats a property object into a string.\n */\nfunction formatProperty(key: string, obj: ObjectSchemaWithProperties): string {\n let output = key\n const isRequired = obj.required?.includes(key)\n output += isRequired ? ' REQUIRED ' : ' optional '\n const propRef = obj.properties[key]\n if (!propRef) return output\n const property = resolveSchemaRef(propRef)\n\n // Check existence before accessing\n if (property && typeof property === 'object' && 'type' in property) {\n output += (property as { type?: string }).type ?? ''\n if ('description' in property && typeof (property as { description?: string }).description === 'string') {\n output += ' ' + (property as { description: string }).description\n }\n }\n\n return output\n}\n\n/**\n * Recursively logs the properties of an object.\n */\nfunction recursiveLogger(obj: MediaTypeObject): string[] {\n const results: string[] = ['Body']\n const schema = getResolvedRef(obj?.schema)\n\n if (!schema || !isObjectSchema(schema) || !schema.properties) {\n return results\n }\n\n const properties = schema.properties\n const schemaWithProps: ObjectSchemaWithProperties = {\n properties,\n required: schema.required,\n }\n Object.keys(properties).forEach((key) => {\n if (!obj.schema) {\n return\n }\n\n results.push(formatProperty(key, schemaWithProps))\n\n const propRef = properties[key]\n if (!propRef) return\n const property = resolveSchemaRef(propRef)\n if (property && isObjectSchema(property) && property.properties) {\n const nestedProperties = property.properties\n Object.keys(nestedProperties).forEach((subKey) => {\n const ref = nestedProperties[subKey]\n if (!ref) return\n const nested = resolveSchemaRef(ref)\n const typeStr =\n nested && typeof nested === 'object' && 'type' in nested ? ((nested as { type?: string }).type ?? '') : ''\n results.push(`${subKey} ${typeStr}`)\n })\n }\n })\n\n return results\n}\n\n/**\n * Extracts the request body from an operation.\n */\nexport function extractRequestBody(operation: OperationObject): string[] | boolean {\n try {\n // TODO: Wait… there's more than just 'application/json' (https://github.com/scalar/scalar/issues/6427)\n const media = getResolvedRef(operation?.requestBody)?.content?.['application/json']\n if (!media) {\n throw new Error('Body not found')\n }\n\n return recursiveLogger(media)\n } catch (_error) {\n return false\n }\n}\n\n/**\n * Deep merge for objects\n */\nexport function deepMerge(source: Record<any, any>, target: Record<any, any>) {\n for (const [key, val] of Object.entries(source)) {\n if (val !== null && typeof val === 'object') {\n target[key] ??= new val.__proto__.constructor()\n deepMerge(val, target[key])\n } else if (typeof val !== 'undefined') {\n target[key] = val\n }\n }\n\n return target\n}\n\n/**\n * Creates an empty specification object.\n * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.\n */\nexport function createEmptySpecification(partialSpecification?: Partial<OpenAPI.Document>) {\n return deepMerge(partialSpecification ?? {}, {\n info: {\n title: '',\n description: '',\n termsOfService: '',\n version: '',\n license: {\n name: '',\n url: '',\n },\n contact: {\n email: '',\n },\n },\n servers: [],\n tags: [],\n }) as OpenAPI.Document\n}\n\nexport type ParameterMap = {\n path: ParameterObject[]\n query: ParameterObject[]\n header: ParameterObject[]\n cookie: ParameterObject[]\n body: ParameterObject[]\n formData: ParameterObject[]\n}\n\n/**\n * This function creates a parameter map from an Operation Object, that's easier to consume.\n *\n * TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it?\n */\nexport function createParameterMap(operation: OperationObject) {\n const map: ParameterMap = {\n path: [],\n query: [],\n header: [],\n cookie: [],\n body: [],\n formData: [],\n }\n\n // TODO: They are not passed to the function, so we don't need to deal with them yet, but we should.\n // @see https://github.com/scalar/scalar/issues/6428\n // if (operation.pathParameters) {\n // operation.pathParameters.forEach((parameter: OpenAPIV3_1.ParameterObject) => {\n // if (parameter.in === 'path') {\n // map.path.push(parameter)\n // } else if (parameter.in === 'query') {\n // map.query.push(parameter)\n // } else if (parameter.in === 'header') {\n // map.header.push(parameter)\n // } else if (parameter.in === 'cookie') {\n // map.cookie.push(parameter)\n // } else if (parameter.in === 'body') {\n // map.body.push(parameter)\n // } else if (parameter.in === 'formData') {\n // map.formData.push(parameter)\n // }\n // })\n // }\n\n const parameters = operation.parameters ?? []\n\n if (parameters) {\n parameters.forEach((parameter) => {\n if (!isDereferenced<ParameterObject>(parameter)) {\n return\n }\n\n if (typeof parameter === 'object' && parameter !== null && '$ref' in parameter) {\n return\n }\n\n if (parameter.in === 'path') {\n map.path.push(parameter)\n } else if (parameter.in === 'query') {\n map.query.push(parameter)\n } else if (parameter.in === 'header') {\n map.header.push(parameter)\n } else if (parameter.in === 'cookie') {\n map.cookie.push(parameter)\n } else if (parameter.in === 'body') {\n map.body.push(parameter)\n } else if (parameter.in === 'formData') {\n map.formData.push(parameter)\n }\n })\n }\n\n return map\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","names":[],"sources":["../../src/helpers/storage.ts"],"sourcesContent":["import { REFERENCE_LS_KEYS, safeLocalStorage } from '@scalar/helpers/object/local-storage'\nimport { type Auth, AuthSchema } from '@scalar/workspace-store/entities/auth'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\n\n// Local storage helper instance, safely wrapped.\nconst storage = safeLocalStorage()\n\n/**\n * Provides an interface to store and retrieve the selected client value\n * in local storage.\n */\nexport const clientStorage = () => {\n const key = REFERENCE_LS_KEYS.SELECTED_CLIENT\n return {\n /**\n * Gets the stored selected client from local storage.\n */\n get: () => {\n return storage.getItem(key)\n },\n /**\n * Stores the selected client value in local storage.\n * @param value The value to store\n */\n set: (value: string) => {\n storage.setItem(key, value as string)\n },\n }\n}\n\n/**\n * Provides an interface to store and retrieve authentication scheme\n * information in local storage, including both the available schemes and\n * the user's selected schemes.\n */\nexport const authStorage = () => {\n const getKey = (slug: string) => {\n return `${REFERENCE_LS_KEYS.AUTH}-${slug}`\n }\n\n return {\n /**\n * Retrieves and coerces the authentication schemes stored in local storage.\n */\n getAuth: (slug: string) => {\n const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? '{}')\n return coerceValue(AuthSchema, parsed)\n },\n /**\n * Stores the authentication schemes in local storage.\n * @param value The Auth object to stringify and store.\n */\n setAuth: (slug: string, value: Auth) => {\n storage.setItem(getKey(slug), JSON.stringify(value))\n },\n }\n}\n"],"mappings":";;;;AAKA,IAAM,UAAU,kBAAkB;;;;;AAMlC,IAAa,sBAAsB;CACjC,MAAM,MAAM,kBAAkB;AAC9B,QAAO;EAIL,WAAW;AACT,UAAO,QAAQ,QAAQ,IAAI;;EAM7B,MAAM,UAAkB;AACtB,WAAQ,QAAQ,KAAK,MAAgB;;EAExC;;;;;;;AAQH,IAAa,oBAAoB;CAC/B,MAAM,UAAU,SAAiB;AAC/B,SAAO,GAAG,kBAAkB,KAAK,GAAG;;AAGtC,QAAO;EAIL,UAAU,SAAiB;AAEzB,UAAO,YAAY,YADJ,KAAK,MAAM,QAAQ,QAAQ,OAAO,KAAK,CAAC,IAAI,KAAK,CAC1B;;EAMxC,UAAU,MAAc,UAAgB;AACtC,WAAQ,QAAQ,OAAO,KAAK,EAAE,KAAK,UAAU,MAAM,CAAC;;EAEvD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PROXY_URL, UPLOAD_TEMP_API_URL } from "../consts/urls.js";
|
|
2
|
+
import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
|
|
3
|
+
//#region src/helpers/upload-temp-document.ts
|
|
4
|
+
/** Type guard for the response body */
|
|
5
|
+
function isResponseBody(data) {
|
|
6
|
+
return !!data && typeof data === "object" && "url" in data && typeof data.url === "string";
|
|
7
|
+
}
|
|
8
|
+
/** Upload a document and return a temporary URL */
|
|
9
|
+
async function uploadTempDocument(document) {
|
|
10
|
+
const body = JSON.stringify({ document });
|
|
11
|
+
const response = await fetch(redirectToProxy(PROXY_URL, UPLOAD_TEMP_API_URL), {
|
|
12
|
+
method: "POST",
|
|
13
|
+
headers: { "Content-Type": "application/json" },
|
|
14
|
+
body
|
|
15
|
+
});
|
|
16
|
+
if (!response.ok) throw new Error(` Failed to generate temporary link, server responded with ${response.status}`);
|
|
17
|
+
const data = await response.json();
|
|
18
|
+
if (!isResponseBody(data)) throw new Error("Failed to generate temporary link, invalid response from server");
|
|
19
|
+
return data.url;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { uploadTempDocument };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=upload-temp-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-temp-document.js","names":[],"sources":["../../src/helpers/upload-temp-document.ts"],"sourcesContent":["import { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\n\nimport { PROXY_URL, UPLOAD_TEMP_API_URL } from '@/consts/urls'\n\n/** Type guard for the response body */\nfunction isResponseBody(data: unknown): data is { url: string } {\n return !!data && typeof data === 'object' && 'url' in data && typeof (data as any).url === 'string'\n}\n\n/** Upload a document and return a temporary URL */\nexport async function uploadTempDocument(document: string): Promise<string> {\n const body = JSON.stringify({ document })\n\n // Proxy the request to avoid localhost CORS issues\n const response = await fetch(redirectToProxy(PROXY_URL, UPLOAD_TEMP_API_URL), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body,\n })\n\n if (!response.ok) {\n throw new Error(` Failed to generate temporary link, server responded with ${response.status}`)\n }\n const data = (await response.json()) as unknown\n\n if (!isResponseBody(data)) {\n throw new Error('Failed to generate temporary link, invalid response from server')\n }\n\n return data.url\n}\n"],"mappings":";;;;AAKA,SAAS,eAAe,MAAwC;AAC9D,QAAO,CAAC,CAAC,QAAQ,OAAO,SAAS,YAAY,SAAS,QAAQ,OAAQ,KAAa,QAAQ;;;AAI7F,eAAsB,mBAAmB,UAAmC;CAC1E,MAAM,OAAO,KAAK,UAAU,EAAE,UAAU,CAAC;CAGzC,MAAM,WAAW,MAAM,MAAM,gBAAgB,WAAW,oBAAoB,EAAE;EAC5E,QAAQ;EACR,SAAS,EAAE,gBAAgB,oBAAoB;EAC/C;EACD,CAAC;AAEF,KAAI,CAAC,SAAS,GACZ,OAAM,IAAI,MAAM,6DAA6D,SAAS,SAAS;CAEjG,MAAM,OAAQ,MAAM,SAAS,MAAM;AAEnC,KAAI,CAAC,eAAe,KAAK,CACvB,OAAM,IAAI,MAAM,kEAAkE;AAGpF,QAAO,KAAK"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AGENT_CONTEXT_SYMBOL, useAgent, useAgentContext, } from './use-agent';
|
|
2
|
-
export { useIntersection } from './use-intersection';
|
|
1
|
+
export { AGENT_CONTEXT_SYMBOL, useAgent, useAgentContext, } from './use-agent.js';
|
|
2
|
+
export { useIntersection } from './use-intersection.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AGENT_CONTEXT_SYMBOL, useAgent, useAgentContext } from "./use-agent.js";
|
|
2
|
+
import { useIntersection } from "./use-intersection.js";
|
|
3
3
|
export { AGENT_CONTEXT_SYMBOL, useAgent, useAgentContext, useIntersection };
|
|
@@ -55,6 +55,6 @@ function useAgentContext() {
|
|
|
55
55
|
return computed(() => injected ?? agentStateRef.value ?? void 0);
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
|
-
export { useAgent
|
|
58
|
+
export { AGENT_CONTEXT_SYMBOL, useAgent, useAgentContext };
|
|
59
59
|
|
|
60
|
-
//# sourceMappingURL=use-agent
|
|
60
|
+
//# sourceMappingURL=use-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-agent.js","names":[],"sources":["../../src/hooks/use-agent.ts"],"sourcesContent":["import { isLocalUrl } from '@scalar/helpers/url/is-local-url'\nimport type { ComputedRef, Ref } from 'vue'\nimport { type InjectionKey, computed, inject, ref } from 'vue'\n\ntype UseAgentOptions = {\n /** Optional. When provided, controls whether the agent UI is enabled (e.g. from doc config). Defaults to isLocalUrl. */\n agentEnabled?: ComputedRef<boolean>\n}\n\ntype UseAgentReturn = {\n showAgent: Ref<boolean>\n agentEnabled: ComputedRef<boolean>\n /** Ref used to pass a prefill message into the agent when opening. Cleared on close. */\n prefilledMessage: Ref<string>\n openAgent: (message?: string) => void\n closeAgent: () => void\n toggleAgent: () => void\n}\n\nexport const AGENT_CONTEXT_SYMBOL = Symbol() as InjectionKey<UseAgentReturn>\n\n/**\n * Module-level ref so useAgentContext() can resolve context even when inject fails\n * (e.g. async component boundary or mount order). Set when ApiReference calls useAgent().\n */\nconst agentStateRef: Ref<UseAgentReturn | null> = ref(null)\n\n/**\n * Hook for agent visibility and enabled state.\n * Call from the API Reference root (e.g. ApiReference.vue) with options to create the state, then provide it so descendants can inject it.\n *\n * Returns:\n * - showAgent: whether the agent panel is visible\n * - agentEnabled: whether the agent is enabled\n * - openAgent, closeAgent, toggleAgent: imperative controls\n */\nexport function useAgent(options: UseAgentOptions): UseAgentReturn {\n const showAgent = ref(false)\n const prefilledMessage = ref('')\n\n const agentEnabled = options.agentEnabled ?? computed(() => isLocalUrl(window.location.href))\n\n const openAgent = (message?: string) => {\n prefilledMessage.value = message ?? ''\n showAgent.value = true\n }\n\n const closeAgent = () => {\n showAgent.value = false\n prefilledMessage.value = ''\n }\n\n const toggleAgent = () => {\n showAgent.value = !showAgent.value\n if (!showAgent.value) {\n prefilledMessage.value = ''\n }\n }\n\n const state: UseAgentReturn = {\n showAgent,\n agentEnabled,\n prefilledMessage,\n openAgent,\n closeAgent,\n toggleAgent,\n }\n agentStateRef.value = state\n return state\n}\n\n/**\n * Inject the agent context provided by ApiReference.\n * Falls back to module-level state when inject is undefined (e.g. async boundary or mount order).\n * Use in descendant components (e.g. AskAgentButton) to open the agent or check if it is enabled.\n *\n * Returns a computed ref; use v-if=\"agentContext?.agentEnabled\" so the button only renders when context exists and agent is enabled.\n */\nexport function useAgentContext(): ComputedRef<UseAgentReturn | undefined> {\n const injected = inject(AGENT_CONTEXT_SYMBOL, undefined)\n return computed((): UseAgentReturn | undefined => injected ?? agentStateRef.value ?? undefined)\n}\n"],"mappings":";;;AAmBA,IAAa,uBAAuB,QAAQ;;;;;AAM5C,IAAM,gBAA4C,IAAI,KAAK;;;;;;;;;;AAW3D,SAAgB,SAAS,SAA0C;CACjE,MAAM,YAAY,IAAI,MAAM;CAC5B,MAAM,mBAAmB,IAAI,GAAG;CAEhC,MAAM,eAAe,QAAQ,gBAAgB,eAAe,WAAW,OAAO,SAAS,KAAK,CAAC;CAE7F,MAAM,aAAa,YAAqB;AACtC,mBAAiB,QAAQ,WAAW;AACpC,YAAU,QAAQ;;CAGpB,MAAM,mBAAmB;AACvB,YAAU,QAAQ;AAClB,mBAAiB,QAAQ;;CAG3B,MAAM,oBAAoB;AACxB,YAAU,QAAQ,CAAC,UAAU;AAC7B,MAAI,CAAC,UAAU,MACb,kBAAiB,QAAQ;;CAI7B,MAAM,QAAwB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACD;AACD,eAAc,QAAQ;AACtB,QAAO;;;;;;;;;AAUT,SAAgB,kBAA2D;CACzE,MAAM,WAAW,OAAO,sBAAsB,KAAA,EAAU;AACxD,QAAO,eAA2C,YAAY,cAAc,SAAS,KAAA,EAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-intersection.js","names":[],"sources":["../../src/hooks/use-intersection.ts"],"sourcesContent":["import { useIntersectionObserver } from '@vueuse/core'\nimport { type TemplateRef, onMounted } from 'vue'\n\nexport const useIntersection = (el: TemplateRef<HTMLElement | undefined>, onIntersect: () => void) => {\n const calculateRootMargin = (element: HTMLElement) => {\n const height = element.offsetHeight\n // Use of a margin on height to ensure sooner intersection detection.\n return `${height / 2}px 0px ${height / 2}px 0px`\n }\n\n const calculateThreshold = (element: HTMLElement) => {\n const height = element.offsetHeight\n // Favor larger threshold if the element is smaller that the screen\n // to ensure that it is selected\n return height < window.innerHeight ? 0.8 : 0.5\n }\n\n onMounted(() => {\n if (el.value) {\n const options = {\n rootMargin: calculateRootMargin(el.value),\n threshold: calculateThreshold(el.value),\n }\n\n useIntersectionObserver(\n el,\n ([entry]) => {\n if (entry?.isIntersecting) {\n onIntersect()\n }\n },\n options,\n )\n }\n })\n}\n"],"mappings":";;;AAGA,IAAa,mBAAmB,IAA0C,gBAA4B;CACpG,MAAM,uBAAuB,YAAyB;EACpD,MAAM,SAAS,QAAQ;AAEvB,SAAO,GAAG,SAAS,EAAE,SAAS,SAAS,EAAE;;CAG3C,MAAM,sBAAsB,YAAyB;AAInD,SAHe,QAAQ,eAGP,OAAO,cAAc,KAAM;;AAG7C,iBAAgB;AACd,MAAI,GAAG,MAML,yBACE,KACC,CAAC,WAAW;AACX,OAAI,OAAO,eACT,cAAa;KATH;GACd,YAAY,oBAAoB,GAAG,MAAM;GACzC,WAAW,mBAAmB,GAAG,MAAM;GACxC,CAUA;GAEH"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AnyApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
2
2
|
export type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
3
|
-
export { default as ApiReference } from './components/ApiReference.vue';
|
|
4
|
-
export { default as GettingStarted } from './components/GettingStarted.vue';
|
|
3
|
+
export { default as ApiReference } from './components/ApiReference.vue.js';
|
|
4
|
+
export { default as GettingStarted } from './components/GettingStarted.vue.js';
|
|
5
5
|
export { SearchButton, SearchModal } from './features/Search';
|
|
6
|
-
export { createEmptySpecification } from './helpers/openapi';
|
|
7
|
-
export { createApiReference } from './standalone/lib/html-api';
|
|
6
|
+
export { createEmptySpecification } from './helpers/openapi.js';
|
|
7
|
+
export { createApiReference } from './standalone/lib/html-api.js';
|
|
8
8
|
export type ReferenceProps = {
|
|
9
9
|
configuration?: AnyApiReferenceConfiguration;
|
|
10
10
|
};
|