@scalar/api-reference 1.49.2 → 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 +15 -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.d.ts +1 -1
- 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 +2 -2
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- 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 +5 -5
- 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.d.ts +2 -2
- 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 +12 -12
- 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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { isSchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
2
|
+
//#region src/components/Content/Schema/helpers/get-property-description.ts
|
|
3
|
+
var TYPE_DESCRIPTIONS = {
|
|
4
|
+
integer: {
|
|
5
|
+
_default: "Integer numbers.",
|
|
6
|
+
int32: "Signed 32-bit integers (commonly used integer type).",
|
|
7
|
+
int64: "Signed 64-bit integers (long type)."
|
|
8
|
+
},
|
|
9
|
+
string: {
|
|
10
|
+
"date": "full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21",
|
|
11
|
+
"date-time": "the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z",
|
|
12
|
+
"password": "a hint to UIs to mask the input",
|
|
13
|
+
"base64": "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
|
|
14
|
+
"byte": "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
|
|
15
|
+
"binary": "binary data, used to describe files"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Generate property description from type/format
|
|
20
|
+
*
|
|
21
|
+
* @param value - The schema object to generate description from
|
|
22
|
+
* @returns Description string or null if no description available
|
|
23
|
+
*/
|
|
24
|
+
var getPropertyDescription = (value) => {
|
|
25
|
+
if (!isSchema(value)) return null;
|
|
26
|
+
/** Just grab the first type from the array if it's an array */
|
|
27
|
+
const type = Array.isArray(value.type) ? value.type[0] : value.type;
|
|
28
|
+
if (!type) return null;
|
|
29
|
+
const typeDescriptions = TYPE_DESCRIPTIONS[type];
|
|
30
|
+
if (!typeDescriptions) return null;
|
|
31
|
+
return typeDescriptions["format" in value && value.format || "contentEncoding" in value && value.contentEncoding || "_default"] ?? null;
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { getPropertyDescription };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=get-property-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-property-description.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-property-description.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isSchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n// Type descriptions for built-in types\nconst TYPE_DESCRIPTIONS: Record<string, Record<string, string>> = {\n integer: {\n _default: 'Integer numbers.',\n int32: 'Signed 32-bit integers (commonly used integer type).',\n int64: 'Signed 64-bit integers (long type).',\n },\n string: {\n 'date': 'full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21',\n 'date-time': 'the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z',\n 'password': 'a hint to UIs to mask the input',\n 'base64': 'base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==',\n 'byte': 'base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==',\n 'binary': 'binary data, used to describe files',\n },\n} as const\n\n/**\n * Generate property description from type/format\n *\n * @param value - The schema object to generate description from\n * @returns Description string or null if no description available\n */\nexport const getPropertyDescription = (value: SchemaObject | undefined): string | null => {\n if (!isSchema(value)) {\n return null\n }\n /** Just grab the first type from the array if it's an array */\n const type = Array.isArray(value.type) ? value.type[0] : value.type\n if (!type) {\n return null\n }\n\n const typeDescriptions = TYPE_DESCRIPTIONS[type]\n if (!typeDescriptions) {\n return null\n }\n\n const format =\n ('format' in value && value.format) || ('contentEncoding' in value && value.contentEncoding) || '_default'\n return typeDescriptions[format] ?? null\n}\n"],"mappings":";;AAIA,IAAM,oBAA4D;CAChE,SAAS;EACP,UAAU;EACV,OAAO;EACP,OAAO;EACR;CACD,QAAQ;EACN,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,UAAU;EACV,QAAQ;EACR,UAAU;EACX;CACF;;;;;;;AAQD,IAAa,0BAA0B,UAAmD;AACxF,KAAI,CAAC,SAAS,MAAM,CAClB,QAAO;;CAGT,MAAM,OAAO,MAAM,QAAQ,MAAM,KAAK,GAAG,MAAM,KAAK,KAAK,MAAM;AAC/D,KAAI,CAAC,KACH,QAAO;CAGT,MAAM,mBAAmB,kBAAkB;AAC3C,KAAI,CAAC,iBACH,QAAO;AAKT,QAAO,iBADJ,YAAY,SAAS,MAAM,UAAY,qBAAqB,SAAS,MAAM,mBAAoB,eAC/D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { REGEX } from "@scalar/helpers/regex/regex-helpers";
|
|
2
|
+
//#region src/components/Content/Schema/helpers/get-ref-name.ts
|
|
3
|
+
/**
|
|
4
|
+
* Gets the "name" of the schema from the ref path
|
|
5
|
+
* TODO: this will change so fix it when the new refs are out
|
|
6
|
+
* Then add tests
|
|
7
|
+
*
|
|
8
|
+
* @example SchemaName from #/components/schemas/SchemaName
|
|
9
|
+
*/
|
|
10
|
+
var getRefName = (ref) => {
|
|
11
|
+
if (!ref) return null;
|
|
12
|
+
const match = ref.match(REGEX.REF_NAME);
|
|
13
|
+
if (match) return match[1];
|
|
14
|
+
return null;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { getRefName };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=get-ref-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-ref-name.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-ref-name.ts"],"sourcesContent":["import { REGEX } from '@scalar/helpers/regex/regex-helpers'\n\n/**\n * Gets the \"name\" of the schema from the ref path\n * TODO: this will change so fix it when the new refs are out\n * Then add tests\n *\n * @example SchemaName from #/components/schemas/SchemaName\n */\nexport const getRefName = (ref: string) => {\n if (!ref) {\n return null\n }\n\n const match = ref.match(REGEX.REF_NAME)\n if (match) {\n return match[1]\n }\n\n return null\n}\n"],"mappings":";;;;;;;;;AASA,IAAa,cAAc,QAAgB;AACzC,KAAI,CAAC,IACH,QAAO;CAGT,MAAM,QAAQ,IAAI,MAAM,MAAM,SAAS;AACvC,KAAI,MACF,QAAO,MAAM;AAGf,QAAO"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { resolve } from "@scalar/workspace-store/resolve";
|
|
2
|
+
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
|
+
//#region src/components/Content/Schema/helpers/get-schema-type.ts
|
|
4
|
+
/**
|
|
5
|
+
* Formats an array type string with proper wrapping for union types.
|
|
6
|
+
*/
|
|
7
|
+
var formatArrayType = (itemType) => {
|
|
8
|
+
if (!itemType) return "array";
|
|
9
|
+
return `array ${itemType.includes(" | ") ? `(${itemType})` : itemType}[]`;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Handles array type processing for both single array types and union types containing array.
|
|
13
|
+
*/
|
|
14
|
+
var processArrayType = (value, isUnionType = false) => {
|
|
15
|
+
if (!value.items) return "array";
|
|
16
|
+
const baseType = formatArrayType(getSchemaType(resolve.schema(value.items)));
|
|
17
|
+
if (isUnionType) return baseType;
|
|
18
|
+
return value.nullable ? `${baseType} | null` : baseType;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Computes the structural type for a schema.
|
|
22
|
+
* This helper always returns type information, never schema titles or ref names.
|
|
23
|
+
*
|
|
24
|
+
* Priority order:
|
|
25
|
+
* 1. const values
|
|
26
|
+
* 2. Array types (with special handling for items)
|
|
27
|
+
* 3. type with contentEncoding
|
|
28
|
+
* 4. raw type
|
|
29
|
+
*/
|
|
30
|
+
var getSchemaType = (valueOrRef) => {
|
|
31
|
+
if (!valueOrRef) return "";
|
|
32
|
+
const value = resolve.schema(valueOrRef);
|
|
33
|
+
if (value.const !== void 0) return "const";
|
|
34
|
+
if ("type" in value && Array.isArray(value.type)) {
|
|
35
|
+
if (value.type.includes("array") && value.items) {
|
|
36
|
+
const arrayType = processArrayType(value, true);
|
|
37
|
+
const otherTypes = value.type.filter((t) => t !== "array");
|
|
38
|
+
return otherTypes.length > 0 ? `${arrayType} | ${otherTypes.join(" | ")}` : arrayType;
|
|
39
|
+
}
|
|
40
|
+
return value.type.join(" | ");
|
|
41
|
+
}
|
|
42
|
+
if (isArraySchema(value)) return processArrayType(value, false);
|
|
43
|
+
if ("type" in value && value.type && value.contentEncoding) return `${value.type} • ${value.contentEncoding}`;
|
|
44
|
+
return "type" in value ? value.type : "";
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
export { getSchemaType };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=get-schema-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-schema-type.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/get-schema-type.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { ReferenceType, SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Formats an array type string with proper wrapping for union types.\n */\nconst formatArrayType = (itemType: string): string => {\n if (!itemType) {\n return 'array'\n }\n\n const wrappedItemType = itemType.includes(' | ') ? `(${itemType})` : itemType\n return `array ${wrappedItemType}[]`\n}\n\n/**\n * Handles array type processing for both single array types and union types containing array.\n */\nconst processArrayType = (value: Extract<SchemaObject, { type: 'array' }>, isUnionType: boolean = false): string => {\n if (!value.items) {\n return 'array'\n }\n\n const itemType = getSchemaType(resolve.schema(value.items))\n const baseType = formatArrayType(itemType)\n\n if (isUnionType) {\n return baseType\n }\n\n // Handle nullable arrays for non-union types\n return (value as any).nullable ? `${baseType} | null` : baseType\n}\n\n/**\n * Computes the structural type for a schema.\n * This helper always returns type information, never schema titles or ref names.\n *\n * Priority order:\n * 1. const values\n * 2. Array types (with special handling for items)\n * 3. type with contentEncoding\n * 4. raw type\n */\nexport const getSchemaType = (valueOrRef: SchemaObject | ReferenceType<SchemaObject>): string => {\n // Early return for falsy values\n if (!valueOrRef) {\n return ''\n }\n\n const value = resolve.schema(valueOrRef)\n\n // Handle const values first (highest priority)\n if (value.const !== undefined) {\n return 'const'\n }\n\n // Handle union types (array of types)\n if ('type' in value && Array.isArray(value.type)) {\n // Special case: union types containing 'array'\n // TODO: Correctly type array of types in SchemaObject\n if (value.type.includes('array') && (value as Extract<SchemaObject, { type: 'array' }>).items) {\n const arrayType = processArrayType(value as Extract<SchemaObject, { type: 'array' }>, true)\n const otherTypes = value.type.filter((t) => t !== 'array')\n\n return otherTypes.length > 0 ? `${arrayType} | ${otherTypes.join(' | ')}` : arrayType\n }\n\n // Regular union types\n return value.type.join(' | ')\n }\n\n // Handle single array type\n if (isArraySchema(value)) {\n return processArrayType(value, false)\n }\n\n // Handle type with content encoding\n if ('type' in value && value.type && value.contentEncoding) {\n return `${value.type} • ${value.contentEncoding}`\n }\n\n // Fallback to raw type\n return 'type' in value ? (value.type as string) : ''\n}\n"],"mappings":";;;;;;AAOA,IAAM,mBAAmB,aAA6B;AACpD,KAAI,CAAC,SACH,QAAO;AAIT,QAAO,SADiB,SAAS,SAAS,MAAM,GAAG,IAAI,SAAS,KAAK,SACrC;;;;;AAMlC,IAAM,oBAAoB,OAAiD,cAAuB,UAAkB;AAClH,KAAI,CAAC,MAAM,MACT,QAAO;CAIT,MAAM,WAAW,gBADA,cAAc,QAAQ,OAAO,MAAM,MAAM,CAAC,CACjB;AAE1C,KAAI,YACF,QAAO;AAIT,QAAQ,MAAc,WAAW,GAAG,SAAS,WAAW;;;;;;;;;;;;AAa1D,IAAa,iBAAiB,eAAmE;AAE/F,KAAI,CAAC,WACH,QAAO;CAGT,MAAM,QAAQ,QAAQ,OAAO,WAAW;AAGxC,KAAI,MAAM,UAAU,KAAA,EAClB,QAAO;AAIT,KAAI,UAAU,SAAS,MAAM,QAAQ,MAAM,KAAK,EAAE;AAGhD,MAAI,MAAM,KAAK,SAAS,QAAQ,IAAK,MAAmD,OAAO;GAC7F,MAAM,YAAY,iBAAiB,OAAmD,KAAK;GAC3F,MAAM,aAAa,MAAM,KAAK,QAAQ,MAAM,MAAM,QAAQ;AAE1D,UAAO,WAAW,SAAS,IAAI,GAAG,UAAU,KAAK,WAAW,KAAK,MAAM,KAAK;;AAI9E,SAAO,MAAM,KAAK,KAAK,MAAM;;AAI/B,KAAI,cAAc,MAAM,CACtB,QAAO,iBAAiB,OAAO,MAAM;AAIvC,KAAI,UAAU,SAAS,MAAM,QAAQ,MAAM,gBACzC,QAAO,GAAG,MAAM,KAAK,KAAK,MAAM;AAIlC,QAAO,UAAU,QAAS,MAAM,OAAkB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
|
+
//#region src/components/Content/Schema/helpers/has-complex-array-items.ts
|
|
4
|
+
/** Composition keywords that indicate complex schema structure */
|
|
5
|
+
var COMPOSITION_KEYWORDS = [
|
|
6
|
+
"allOf",
|
|
7
|
+
"oneOf",
|
|
8
|
+
"anyOf"
|
|
9
|
+
];
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a schema has object type (either explicit type: 'object' or has properties)
|
|
12
|
+
*/
|
|
13
|
+
var isObjectType = (schema) => {
|
|
14
|
+
if ("type" in schema && schema.type) {
|
|
15
|
+
if (Array.isArray(schema.type)) return schema.type.includes("object");
|
|
16
|
+
return schema.type === "object";
|
|
17
|
+
}
|
|
18
|
+
return "properties" in schema;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Checks if a schema has complex features (refs, compositions, discriminators)
|
|
22
|
+
*/
|
|
23
|
+
var hasComplexFeatures = (schema) => "$ref" in schema || "discriminator" in schema || COMPOSITION_KEYWORDS.some((keyword) => keyword in schema);
|
|
24
|
+
/**
|
|
25
|
+
* Checks if nested array items are complex
|
|
26
|
+
*/
|
|
27
|
+
var hasComplexNestedArrayItems = (items) => {
|
|
28
|
+
if (!isArraySchema(items) || typeof items.items !== "object") return false;
|
|
29
|
+
if ("$ref" in items.items) return true;
|
|
30
|
+
const nestedItems = getResolvedRef(items.items);
|
|
31
|
+
if (!nestedItems) return false;
|
|
32
|
+
return isObjectType(nestedItems) || hasComplexFeatures(nestedItems) || isArraySchema(nestedItems);
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Checks if array items have complex structure
|
|
36
|
+
* like: objects, references, discriminators, compositions, or nested arrays with complex items
|
|
37
|
+
*
|
|
38
|
+
* @param value - The schema object to check
|
|
39
|
+
* @returns true if the array has complex items, false otherwise
|
|
40
|
+
*/
|
|
41
|
+
var hasComplexArrayItems = (value) => {
|
|
42
|
+
if (!value || !isArraySchema(value) || typeof value.items !== "object") return false;
|
|
43
|
+
if ("$ref" in value.items) return true;
|
|
44
|
+
const items = getResolvedRef(value.items);
|
|
45
|
+
if (!items) return false;
|
|
46
|
+
if (hasComplexFeatures(items)) return true;
|
|
47
|
+
if (isObjectType(items)) return true;
|
|
48
|
+
return hasComplexNestedArrayItems(items);
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { hasComplexArrayItems };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=has-complex-array-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-complex-array-items.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/has-complex-array-items.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/** Composition keywords that indicate complex schema structure */\nconst COMPOSITION_KEYWORDS = ['allOf', 'oneOf', 'anyOf'] as const\n\n/**\n * Checks if a schema has object type (either explicit type: 'object' or has properties)\n */\nconst isObjectType = (schema: SchemaObject): boolean => {\n // Check for explicit object type\n if ('type' in schema && schema.type) {\n if (Array.isArray(schema.type)) {\n return schema.type.includes('object')\n }\n return schema.type === 'object'\n }\n\n // Check for properties (implicit object type)\n return 'properties' in schema\n}\n\n/**\n * Checks if a schema has complex features (refs, compositions, discriminators)\n */\nconst hasComplexFeatures = (schema: SchemaObject): boolean =>\n '$ref' in schema || 'discriminator' in schema || COMPOSITION_KEYWORDS.some((keyword) => keyword in schema)\n\n/**\n * Checks if nested array items are complex\n */\nconst hasComplexNestedArrayItems = (items: SchemaObject): boolean => {\n if (!isArraySchema(items) || typeof items.items !== 'object') {\n return false\n }\n\n // Check for $ref in original nested items before resolving\n if ('$ref' in items.items) {\n return true\n }\n\n const nestedItems = getResolvedRef(items.items)\n if (!nestedItems) {\n return false\n }\n\n // Check if nested items are complex (objects, refs, compositions, or further nested arrays)\n return isObjectType(nestedItems) || hasComplexFeatures(nestedItems) || isArraySchema(nestedItems)\n}\n\n/**\n * Checks if array items have complex structure\n * like: objects, references, discriminators, compositions, or nested arrays with complex items\n *\n * @param value - The schema object to check\n * @returns true if the array has complex items, false otherwise\n */\nexport const hasComplexArrayItems = (value: SchemaObject | undefined): boolean => {\n // Early return for invalid inputs\n if (!value || !isArraySchema(value) || typeof value.items !== 'object') {\n return false\n }\n\n // Check for $ref in original items before resolving (in case ref can't be resolved)\n if ('$ref' in value.items) {\n return true\n }\n\n const items = getResolvedRef(value.items)\n if (!items) {\n return false\n }\n\n // Check for complex features (refs, compositions, discriminators)\n if (hasComplexFeatures(items)) {\n return true\n }\n\n // Check if items are objects\n if (isObjectType(items)) {\n return true\n }\n\n // Check if items are nested arrays with complex items\n return hasComplexNestedArrayItems(items)\n}\n"],"mappings":";;;;AAKA,IAAM,uBAAuB;CAAC;CAAS;CAAS;CAAQ;;;;AAKxD,IAAM,gBAAgB,WAAkC;AAEtD,KAAI,UAAU,UAAU,OAAO,MAAM;AACnC,MAAI,MAAM,QAAQ,OAAO,KAAK,CAC5B,QAAO,OAAO,KAAK,SAAS,SAAS;AAEvC,SAAO,OAAO,SAAS;;AAIzB,QAAO,gBAAgB;;;;;AAMzB,IAAM,sBAAsB,WAC1B,UAAU,UAAU,mBAAmB,UAAU,qBAAqB,MAAM,YAAY,WAAW,OAAO;;;;AAK5G,IAAM,8BAA8B,UAAiC;AACnE,KAAI,CAAC,cAAc,MAAM,IAAI,OAAO,MAAM,UAAU,SAClD,QAAO;AAIT,KAAI,UAAU,MAAM,MAClB,QAAO;CAGT,MAAM,cAAc,eAAe,MAAM,MAAM;AAC/C,KAAI,CAAC,YACH,QAAO;AAIT,QAAO,aAAa,YAAY,IAAI,mBAAmB,YAAY,IAAI,cAAc,YAAY;;;;;;;;;AAUnG,IAAa,wBAAwB,UAA6C;AAEhF,KAAI,CAAC,SAAS,CAAC,cAAc,MAAM,IAAI,OAAO,MAAM,UAAU,SAC5D,QAAO;AAIT,KAAI,UAAU,MAAM,MAClB,QAAO;CAGT,MAAM,QAAQ,eAAe,MAAM,MAAM;AACzC,KAAI,CAAC,MACH,QAAO;AAIT,KAAI,mBAAmB,MAAM,CAC3B,QAAO;AAIT,KAAI,aAAa,MAAM,CACrB,QAAO;AAIT,QAAO,2BAA2B,MAAM"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isTypeObject } from "./is-type-object.js";
|
|
2
|
+
//#region src/components/Content/Schema/helpers/is-empty-schema-object.ts
|
|
3
|
+
/**
|
|
4
|
+
* Determines if the given schema is an empty object schema.
|
|
5
|
+
* An empty object schema is defined as a schema with type 'object'
|
|
6
|
+
* and no defined properties, no additionalProperties (or set to false), and no patternProperties.
|
|
7
|
+
*/
|
|
8
|
+
var isEmptySchemaObject = (schema) => {
|
|
9
|
+
if (!isTypeObject(schema)) return false;
|
|
10
|
+
const hasNoProperties = Object.keys(schema.properties ?? {}).length === 0;
|
|
11
|
+
const hasNoAdditionalProperties = schema.additionalProperties === void 0 || schema.additionalProperties === false;
|
|
12
|
+
const hasNoPatternProperties = Object.keys(schema.patternProperties ?? {}).length === 0;
|
|
13
|
+
return hasNoProperties && hasNoAdditionalProperties && hasNoPatternProperties;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isEmptySchemaObject };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=is-empty-schema-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-empty-schema-object.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/is-empty-schema-object.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { isTypeObject } from '@/components/Content/Schema/helpers/is-type-object'\n\n/**\n * Determines if the given schema is an empty object schema.\n * An empty object schema is defined as a schema with type 'object'\n * and no defined properties, no additionalProperties (or set to false), and no patternProperties.\n */\nexport const isEmptySchemaObject = (schema: SchemaObject | undefined): boolean => {\n if (!isTypeObject(schema)) {\n return false\n }\n\n const hasNoProperties = Object.keys(schema.properties ?? {}).length === 0\n const hasNoAdditionalProperties = schema.additionalProperties === undefined || schema.additionalProperties === false\n const hasNoPatternProperties = Object.keys(schema.patternProperties ?? {}).length === 0\n\n return hasNoProperties && hasNoAdditionalProperties && hasNoPatternProperties\n}\n"],"mappings":";;;;;;;AASA,IAAa,uBAAuB,WAA8C;AAChF,KAAI,CAAC,aAAa,OAAO,CACvB,QAAO;CAGT,MAAM,kBAAkB,OAAO,KAAK,OAAO,cAAc,EAAE,CAAC,CAAC,WAAW;CACxE,MAAM,4BAA4B,OAAO,yBAAyB,KAAA,KAAa,OAAO,yBAAyB;CAC/G,MAAM,yBAAyB,OAAO,KAAK,OAAO,qBAAqB,EAAE,CAAC,CAAC,WAAW;AAEtF,QAAO,mBAAmB,6BAA6B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/components/Content/Schema/helpers/is-type-object.ts
|
|
2
|
+
var isTypeObject = (schema) => {
|
|
3
|
+
if (schema === null || typeof schema !== "object" || Array.isArray(schema)) return false;
|
|
4
|
+
if ("oneOf" in schema || "anyOf" in schema || "allOf" in schema || "not" in schema) return false;
|
|
5
|
+
const hasType = "type" in schema;
|
|
6
|
+
if (hasType && Array.isArray(schema.type)) return schema.type.includes("object");
|
|
7
|
+
const hasTypeObject = hasType && schema.type === "object";
|
|
8
|
+
if (hasTypeObject) return true;
|
|
9
|
+
if (hasType && !hasTypeObject) return false;
|
|
10
|
+
const hasProperties = "properties" in schema;
|
|
11
|
+
const hasAdditionalProperties = "additionalProperties" in schema;
|
|
12
|
+
const hasPatternProperties = "patternProperties" in schema;
|
|
13
|
+
return hasProperties || hasAdditionalProperties || hasPatternProperties;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isTypeObject };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=is-type-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-type-object.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/is-type-object.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/*\n * Checks whether a JSON schema is of type object\n */\nexport const isTypeObject = (schema: unknown): schema is Extract<SchemaObject, { type: 'object' }> => {\n // null, primitive types, arrays\n if (schema === null || typeof schema !== 'object' || Array.isArray(schema)) {\n return false\n }\n\n // Check for composition keywords - if present, this should be handled by composition logic\n const hasComposition = 'oneOf' in schema || 'anyOf' in schema || 'allOf' in schema || 'not' in schema\n\n // If it has composition keywords, it should not be treated as a simple object schema\n if (hasComposition) {\n return false\n }\n\n const hasType = 'type' in schema\n\n // Handle union types (type: ['object', 'null'])\n if (hasType && Array.isArray(schema.type)) {\n return schema.type.includes('object')\n }\n\n const hasTypeObject = hasType && schema.type === 'object'\n\n // type: object\n if (hasTypeObject) {\n return true\n }\n\n // type: string, number, boolean, array, etc.\n if (hasType && !hasTypeObject) {\n return false\n }\n\n const hasProperties = 'properties' in schema\n const hasAdditionalProperties = 'additionalProperties' in schema\n const hasPatternProperties = 'patternProperties' in schema\n\n return hasProperties || hasAdditionalProperties || hasPatternProperties\n}\n"],"mappings":";AAKA,IAAa,gBAAgB,WAAyE;AAEpG,KAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,MAAM,QAAQ,OAAO,CACxE,QAAO;AAOT,KAHuB,WAAW,UAAU,WAAW,UAAU,WAAW,UAAU,SAAS,OAI7F,QAAO;CAGT,MAAM,UAAU,UAAU;AAG1B,KAAI,WAAW,MAAM,QAAQ,OAAO,KAAK,CACvC,QAAO,OAAO,KAAK,SAAS,SAAS;CAGvC,MAAM,gBAAgB,WAAW,OAAO,SAAS;AAGjD,KAAI,cACF,QAAO;AAIT,KAAI,WAAW,CAAC,cACd,QAAO;CAGT,MAAM,gBAAgB,gBAAgB;CACtC,MAAM,0BAA0B,0BAA0B;CAC1D,MAAM,uBAAuB,uBAAuB;AAEpD,QAAO,iBAAiB,2BAA2B"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { resolve } from "@scalar/workspace-store/resolve";
|
|
3
|
+
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
4
|
+
import { objectKeys } from "@scalar/helpers/object/object-keys";
|
|
5
|
+
//#region src/components/Content/Schema/helpers/merge-all-of-schemas.ts
|
|
6
|
+
/**
|
|
7
|
+
* Merges multiple OpenAPI schema objects into a single schema object.
|
|
8
|
+
* Handles nested allOf compositions and merges properties recursively.
|
|
9
|
+
*
|
|
10
|
+
* @param schemas - Array of OpenAPI schema objects to merge
|
|
11
|
+
* @param rootSchema - Optional root schema to merge with the result
|
|
12
|
+
* @returns Merged schema object
|
|
13
|
+
*/
|
|
14
|
+
var mergeAllOfSchemas = (schemas, rootSchema) => {
|
|
15
|
+
if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) return rootSchema || {};
|
|
16
|
+
const result = {};
|
|
17
|
+
const { allOf: _, ...baseSchema } = schemas;
|
|
18
|
+
for (const _schema of schemas.allOf) {
|
|
19
|
+
if (!_schema || typeof _schema !== "object") continue;
|
|
20
|
+
const schema = resolve.schema(_schema);
|
|
21
|
+
if (schema.allOf) {
|
|
22
|
+
mergeSchemaIntoResult(result, mergeAllOfSchemas(schema));
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
mergeSchemaIntoResult(result, schema);
|
|
26
|
+
}
|
|
27
|
+
if (Object.keys(baseSchema).length > 0) mergeSchemaIntoResult(result, baseSchema, true);
|
|
28
|
+
if (rootSchema && typeof rootSchema === "object") if (rootSchema.allOf) mergeSchemaIntoResult(result, mergeAllOfSchemas(rootSchema), true);
|
|
29
|
+
else mergeSchemaIntoResult(result, rootSchema, true);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Efficiently merges a source schema into a target result object.
|
|
34
|
+
* Handles all schema merging logic in a single optimized function.
|
|
35
|
+
*
|
|
36
|
+
* @param result - The target schema object to merge into
|
|
37
|
+
* @param schema - The source schema object to merge from
|
|
38
|
+
* @param override - Whether to override existing properties (default: false)
|
|
39
|
+
*/
|
|
40
|
+
var mergeSchemaIntoResult = (result, schema, override = false) => {
|
|
41
|
+
const schemaKeys = objectKeys(schema);
|
|
42
|
+
if (schemaKeys.length === 0) return;
|
|
43
|
+
for (const key of schemaKeys) {
|
|
44
|
+
const value = getResolvedRef(schema[key]);
|
|
45
|
+
if (value === void 0) continue;
|
|
46
|
+
if (key === "required") {
|
|
47
|
+
if (Array.isArray(value) && value.length > 0) if (result.required?.length) result.required = [...new Set([...result.required, ...value])];
|
|
48
|
+
else result.required = value.slice();
|
|
49
|
+
} else if (key === "properties") {
|
|
50
|
+
if (value && typeof value === "object") {
|
|
51
|
+
if (!result.properties) result.properties = {};
|
|
52
|
+
mergePropertiesIntoResult(result.properties, value);
|
|
53
|
+
}
|
|
54
|
+
} else if (key === "items") {
|
|
55
|
+
const items = resolve.schema(value);
|
|
56
|
+
if (items) {
|
|
57
|
+
if (isArraySchema(schema)) {
|
|
58
|
+
if (!result.items) result.items = {};
|
|
59
|
+
if (items.allOf) {
|
|
60
|
+
const mergedItems = mergeAllOfSchemas(items);
|
|
61
|
+
Object.assign(result.items, mergedItems);
|
|
62
|
+
} else mergeItemsIntoResult(getResolvedRef(result.items), items);
|
|
63
|
+
} else if (items.allOf) {
|
|
64
|
+
const mergedItems = mergeAllOfSchemas(items);
|
|
65
|
+
if ("properties" in mergedItems) {
|
|
66
|
+
if (!("properties" in result)) result.properties = {};
|
|
67
|
+
"properties" in result && mergePropertiesIntoResult(result.properties, mergedItems.properties);
|
|
68
|
+
}
|
|
69
|
+
} else if (!("items" in result)) result.items = items;
|
|
70
|
+
}
|
|
71
|
+
} else if (key === "enum") {
|
|
72
|
+
if (Array.isArray(value) && value.length > 0) result.enum = [...new Set([...result.enum || [], ...value])];
|
|
73
|
+
} else if (key === "oneOf" || key === "anyOf") {
|
|
74
|
+
if (Array.isArray(value)) {
|
|
75
|
+
if (!("properties" in result)) result.properties = {};
|
|
76
|
+
for (const _option of value) {
|
|
77
|
+
const option = resolve.schema(_option);
|
|
78
|
+
if (option && "properties" in option && "properties" in result) mergePropertiesIntoResult(result.properties, option.properties);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
} else if (key === "allOf") continue;
|
|
82
|
+
else if (override || result[key] === void 0) result[key] = value;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Efficiently merges properties into a result object without creating new objects.
|
|
87
|
+
*/
|
|
88
|
+
var mergePropertiesIntoResult = (result, properties) => {
|
|
89
|
+
const propertyKeys = Object.keys(properties ?? {});
|
|
90
|
+
if (!properties || !result || propertyKeys.length === 0) return;
|
|
91
|
+
for (const key of propertyKeys) {
|
|
92
|
+
const schema = resolve.schema(properties[key]);
|
|
93
|
+
if (!schema) {
|
|
94
|
+
delete result[key];
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (typeof schema !== "object") {
|
|
98
|
+
result[key] = schema;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (!result[key]) {
|
|
102
|
+
if (schema.allOf) result[key] = mergeAllOfSchemas(schema);
|
|
103
|
+
else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) result[key] = {
|
|
104
|
+
...schema,
|
|
105
|
+
items: mergeAllOfSchemas(resolve.schema(schema.items))
|
|
106
|
+
};
|
|
107
|
+
else if (properties[key]) result[key] = properties[key];
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const existing = resolve.schema(result[key]);
|
|
111
|
+
if (schema.allOf) result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] });
|
|
112
|
+
else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {
|
|
113
|
+
const existingItems = resolve.schema(existing.items);
|
|
114
|
+
result[key] = {
|
|
115
|
+
...existing,
|
|
116
|
+
type: "array",
|
|
117
|
+
items: existingItems ? mergeItems(existingItems, resolve.schema(schema.items)) : resolve.schema(schema.items)
|
|
118
|
+
};
|
|
119
|
+
} else if ("properties" in existing && "properties" in schema) {
|
|
120
|
+
const merged = {
|
|
121
|
+
...existing,
|
|
122
|
+
...schema
|
|
123
|
+
};
|
|
124
|
+
merged.properties = { ...existing.properties };
|
|
125
|
+
mergePropertiesIntoResult(merged.properties, schema.properties);
|
|
126
|
+
result[key] = merged;
|
|
127
|
+
} else result[key] = {
|
|
128
|
+
...schema,
|
|
129
|
+
...existing
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Efficiently merges array items into a result object.
|
|
135
|
+
*/
|
|
136
|
+
var mergeItemsIntoResult = (result, items) => {
|
|
137
|
+
if (items.allOf || result.allOf) {
|
|
138
|
+
const allOfSchemas = [];
|
|
139
|
+
if (result.allOf) for (const schema of result.allOf) allOfSchemas.push(resolve.schema(schema));
|
|
140
|
+
else allOfSchemas.push(result);
|
|
141
|
+
if (items.allOf) for (const schema of items.allOf) allOfSchemas.push(resolve.schema(schema));
|
|
142
|
+
else allOfSchemas.push(items);
|
|
143
|
+
const merged = mergeAllOfSchemas({ allOf: allOfSchemas });
|
|
144
|
+
Object.assign(result, merged);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
Object.assign(result, items);
|
|
148
|
+
if ("properties" in result && "properties" in items) mergePropertiesIntoResult(result.properties, items.properties);
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Helper function for merging items that returns a new object.
|
|
152
|
+
*/
|
|
153
|
+
var mergeItems = (existing, incoming) => {
|
|
154
|
+
if (existing.allOf || incoming.allOf) {
|
|
155
|
+
const allOfSchemas = [];
|
|
156
|
+
if (existing.allOf) for (const schema of existing.allOf) allOfSchemas.push(resolve.schema(schema));
|
|
157
|
+
else allOfSchemas.push(existing);
|
|
158
|
+
if (incoming.allOf) for (const schema of incoming.allOf) allOfSchemas.push(resolve.schema(schema));
|
|
159
|
+
else allOfSchemas.push(incoming);
|
|
160
|
+
return mergeAllOfSchemas({ allOf: allOfSchemas });
|
|
161
|
+
}
|
|
162
|
+
const merged = {
|
|
163
|
+
...existing,
|
|
164
|
+
...incoming
|
|
165
|
+
};
|
|
166
|
+
if ("properties" in existing && "properties" in incoming) {
|
|
167
|
+
merged.properties = { ...existing.properties };
|
|
168
|
+
mergePropertiesIntoResult(merged.properties, incoming.properties);
|
|
169
|
+
}
|
|
170
|
+
return merged;
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
export { mergeAllOfSchemas };
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=merge-all-of-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-all-of-schemas.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/merge-all-of-schemas.ts"],"sourcesContent":["import { objectKeys } from '@scalar/helpers/object/object-keys'\nimport { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/**\n * Merges multiple OpenAPI schema objects into a single schema object.\n * Handles nested allOf compositions and merges properties recursively.\n *\n * @param schemas - Array of OpenAPI schema objects to merge\n * @param rootSchema - Optional root schema to merge with the result\n * @returns Merged schema object\n */\nexport const mergeAllOfSchemas = (schemas: SchemaObject | undefined, rootSchema?: SchemaObject): SchemaObject => {\n // Handle max depth, empty or invalid input\n if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) {\n return rootSchema || ({} as SchemaObject)\n }\n\n // Initialize result object once\n const result = {} as SchemaObject\n\n // Extract base schema properties (everything except allOf)\n const { allOf: _, ...baseSchema } = schemas\n\n // Process allOf schemas first\n for (const _schema of schemas.allOf) {\n if (!_schema || typeof _schema !== 'object') {\n continue\n }\n\n // Resolve ref if present\n const schema = resolve.schema(_schema)\n\n // Handle nested allOf recursively\n if (schema.allOf) {\n const nestedMerged = mergeAllOfSchemas(schema)\n mergeSchemaIntoResult(result, nestedMerged)\n continue\n }\n\n mergeSchemaIntoResult(result, schema)\n }\n\n // Apply base schema properties with precedence over allOf properties\n if (Object.keys(baseSchema).length > 0) {\n mergeSchemaIntoResult(result, baseSchema, true)\n }\n\n // Process root schema last if provided\n if (rootSchema && typeof rootSchema === 'object') {\n if (rootSchema.allOf) {\n const nestedMerged = mergeAllOfSchemas(rootSchema)\n mergeSchemaIntoResult(result, nestedMerged, true)\n } else {\n mergeSchemaIntoResult(result, rootSchema, true)\n }\n }\n\n return result\n}\n\n/**\n * Efficiently merges a source schema into a target result object.\n * Handles all schema merging logic in a single optimized function.\n *\n * @param result - The target schema object to merge into\n * @param schema - The source schema object to merge from\n * @param override - Whether to override existing properties (default: false)\n */\nconst mergeSchemaIntoResult = (result: SchemaObject, schema: SchemaObject, override: boolean = false): void => {\n // Early return if schema is empty\n const schemaKeys = objectKeys(schema)\n if (schemaKeys.length === 0) {\n return\n }\n\n // Loop through all schema properties and handle them appropriately\n for (const key of schemaKeys) {\n const value = getResolvedRef(schema[key]) as any\n\n if (value === undefined) {\n continue\n }\n\n // Required\n if ((key as string) === 'required') {\n // Merge required fields with deduplication\n if (Array.isArray(value) && value.length > 0) {\n // @ts-expect-error\n if (result.required?.length) {\n // @ts-expect-error\n result.required = [...new Set([...result.required, ...value])]\n } else {\n // @ts-expect-error\n result.required = value.slice()\n }\n }\n }\n // Properties\n else if ((key as string) === 'properties') {\n // Merge properties recursively\n if (value && typeof value === 'object') {\n // @ts-expect-error\n if (!result.properties) {\n // @ts-expect-error\n result.properties = {}\n }\n\n // @ts-expect-error\n mergePropertiesIntoResult(result.properties, value)\n }\n }\n // Items\n else if ((key as string) === 'items') {\n // Handle items (for both arrays and objects with items)\n const items = resolve.schema(value)\n if (items) {\n if (isArraySchema(schema)) {\n // @ts-expect-error\n if (!result.items) {\n // @ts-expect-error\n result.items = {}\n }\n\n // Handle allOf within array items\n if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items)\n // @ts-expect-error\n Object.assign(result.items, mergedItems)\n } else {\n // @ts-expect-error\n mergeItemsIntoResult(getResolvedRef(result.items), items)\n }\n }\n // For non-array types with items.allOf, merge into properties\n else if (items.allOf) {\n const mergedItems = mergeAllOfSchemas(items)\n if ('properties' in mergedItems) {\n if (!('properties' in result)) {\n // @ts-expect-error\n result.properties = {}\n }\n\n 'properties' in result && mergePropertiesIntoResult(result.properties, mergedItems.properties)\n }\n }\n // For non-array types without allOf, still set items if not already set\n else if (!('items' in result)) {\n // @ts-expect-error\n result.items = items\n }\n }\n }\n // Enum\n else if (key === 'enum') {\n if (Array.isArray(value) && value.length > 0) {\n result.enum = [...new Set([...(result.enum || []), ...value])]\n }\n }\n // OneOf/AnyOf\n else if (key === 'oneOf' || key === 'anyOf') {\n // Merge oneOf/anyOf subschema\n if (Array.isArray(value)) {\n if (!('properties' in result)) {\n // @ts-expect-error\n result.properties = {}\n }\n for (const _option of value) {\n const option = resolve.schema(_option)\n if (option && 'properties' in option && 'properties' in result) {\n mergePropertiesIntoResult(result.properties, option.properties)\n }\n }\n }\n }\n // Skip allOf as it's handled at a higher level\n else if (key === 'allOf') {\n continue\n }\n // For all other properties, preserve the first occurrence or override if specified\n else {\n if (override || result[key] === undefined) {\n result[key] = value\n }\n }\n }\n}\n\n/**\n * Efficiently merges properties into a result object without creating new objects.\n */\nconst mergePropertiesIntoResult = (\n result: Extract<SchemaObject, { type: 'object' }>['properties'],\n properties: Extract<SchemaObject, { type: 'object' }>['properties'],\n): void => {\n const propertyKeys = Object.keys(properties ?? {})\n if (!properties || !result || propertyKeys.length === 0) {\n return\n }\n\n for (const key of propertyKeys) {\n const schema = resolve.schema(properties[key])\n if (!schema) {\n delete result[key]\n continue\n }\n\n if (typeof schema !== 'object') {\n result[key] = schema\n continue\n }\n\n if (!result[key]) {\n // Handle new property with allOf\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas(schema)\n } else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) {\n result[key] = {\n ...schema,\n items: mergeAllOfSchemas(resolve.schema(schema.items)),\n }\n } else if (properties[key]) {\n result[key] = properties[key]\n }\n continue\n }\n\n // Merge existing property\n const existing = resolve.schema(result[key])\n\n if (schema.allOf) {\n result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] } as SchemaObject)\n } else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {\n const existingItems = resolve.schema(existing.items)\n result[key] = {\n ...existing,\n type: 'array',\n items: existingItems ? mergeItems(existingItems, resolve.schema(schema.items)) : resolve.schema(schema.items),\n }\n } else {\n // Create merged object with properties handled separately\n if ('properties' in existing && 'properties' in schema) {\n const merged = { ...existing, ...schema }\n merged.properties = { ...existing.properties }\n mergePropertiesIntoResult(merged.properties, schema.properties)\n result[key] = merged\n }\n // Simple merge without property recursion\n else {\n result[key] = { ...schema, ...existing }\n }\n }\n }\n}\n\n/**\n * Efficiently merges array items into a result object.\n */\nconst mergeItemsIntoResult = (result: SchemaObject, items: SchemaObject): void => {\n // Handle allOf in items\n if (items.allOf || result.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (result.allOf) {\n for (const schema of result.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(result)\n }\n\n if (items.allOf) {\n for (const schema of items.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(items)\n }\n\n const merged = mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject)\n Object.assign(result, merged)\n return\n }\n\n // Regular merge\n Object.assign(result, items)\n\n // Merge properties if both have them\n if ('properties' in result && 'properties' in items) {\n mergePropertiesIntoResult(result.properties, items.properties)\n }\n}\n\n/**\n * Helper function for merging items that returns a new object.\n */\nconst mergeItems = (existing: SchemaObject, incoming: SchemaObject): SchemaObject => {\n // Handle allOf in either schema\n if (existing.allOf || incoming.allOf) {\n // Build array without spreads for better performance\n const allOfSchemas: SchemaObject[] = []\n\n if (existing.allOf) {\n for (const schema of existing.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(existing)\n }\n\n if (incoming.allOf) {\n for (const schema of incoming.allOf) {\n allOfSchemas.push(resolve.schema(schema))\n }\n } else {\n allOfSchemas.push(incoming)\n }\n\n return mergeAllOfSchemas({ allOf: allOfSchemas } as SchemaObject)\n }\n\n const merged = { ...existing, ...incoming }\n\n // Recursively merge properties if both have properties\n if ('properties' in existing && 'properties' in incoming) {\n // @ts-expect-error\n merged.properties = { ...existing.properties }\n // @ts-expect-error\n mergePropertiesIntoResult(merged.properties, incoming.properties)\n }\n\n return merged as SchemaObject\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAa,qBAAqB,SAAmC,eAA4C;AAE/G,KAAI,CAAC,SAAS,OAAO,UAAU,CAAC,MAAM,QAAQ,QAAQ,MAAM,CAC1D,QAAO,cAAe,EAAE;CAI1B,MAAM,SAAS,EAAE;CAGjB,MAAM,EAAE,OAAO,GAAG,GAAG,eAAe;AAGpC,MAAK,MAAM,WAAW,QAAQ,OAAO;AACnC,MAAI,CAAC,WAAW,OAAO,YAAY,SACjC;EAIF,MAAM,SAAS,QAAQ,OAAO,QAAQ;AAGtC,MAAI,OAAO,OAAO;AAEhB,yBAAsB,QADD,kBAAkB,OAAO,CACH;AAC3C;;AAGF,wBAAsB,QAAQ,OAAO;;AAIvC,KAAI,OAAO,KAAK,WAAW,CAAC,SAAS,EACnC,uBAAsB,QAAQ,YAAY,KAAK;AAIjD,KAAI,cAAc,OAAO,eAAe,SACtC,KAAI,WAAW,MAEb,uBAAsB,QADD,kBAAkB,WAAW,EACN,KAAK;KAEjD,uBAAsB,QAAQ,YAAY,KAAK;AAInD,QAAO;;;;;;;;;;AAWT,IAAM,yBAAyB,QAAsB,QAAsB,WAAoB,UAAgB;CAE7G,MAAM,aAAa,WAAW,OAAO;AACrC,KAAI,WAAW,WAAW,EACxB;AAIF,MAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,eAAe,OAAO,KAAK;AAEzC,MAAI,UAAU,KAAA,EACZ;AAIF,MAAK,QAAmB;OAElB,MAAM,QAAQ,MAAM,IAAI,MAAM,SAAS,EAEzC,KAAI,OAAO,UAAU,OAEnB,QAAO,WAAW,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,OAAO,UAAU,GAAG,MAAM,CAAC,CAAC;OAG9D,QAAO,WAAW,MAAM,OAAO;aAK3B,QAAmB;OAEvB,SAAS,OAAO,UAAU,UAAU;AAEtC,QAAI,CAAC,OAAO,WAEV,QAAO,aAAa,EAAE;AAIxB,8BAA0B,OAAO,YAAY,MAAM;;aAI7C,QAAmB,SAAS;GAEpC,MAAM,QAAQ,QAAQ,OAAO,MAAM;AACnC,OAAI;QACE,cAAc,OAAO,EAAE;AAEzB,SAAI,CAAC,OAAO,MAEV,QAAO,QAAQ,EAAE;AAInB,SAAI,MAAM,OAAO;MACf,MAAM,cAAc,kBAAkB,MAAM;AAE5C,aAAO,OAAO,OAAO,OAAO,YAAY;WAGxC,sBAAqB,eAAe,OAAO,MAAM,EAAE,MAAM;eAIpD,MAAM,OAAO;KACpB,MAAM,cAAc,kBAAkB,MAAM;AAC5C,SAAI,gBAAgB,aAAa;AAC/B,UAAI,EAAE,gBAAgB,QAEpB,QAAO,aAAa,EAAE;AAGxB,sBAAgB,UAAU,0BAA0B,OAAO,YAAY,YAAY,WAAW;;eAIzF,EAAE,WAAW,QAEpB,QAAO,QAAQ;;aAKZ,QAAQ;OACX,MAAM,QAAQ,MAAM,IAAI,MAAM,SAAS,EACzC,QAAO,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAI,OAAO,QAAQ,EAAE,EAAG,GAAG,MAAM,CAAC,CAAC;aAIzD,QAAQ,WAAW,QAAQ;OAE9B,MAAM,QAAQ,MAAM,EAAE;AACxB,QAAI,EAAE,gBAAgB,QAEpB,QAAO,aAAa,EAAE;AAExB,SAAK,MAAM,WAAW,OAAO;KAC3B,MAAM,SAAS,QAAQ,OAAO,QAAQ;AACtC,SAAI,UAAU,gBAAgB,UAAU,gBAAgB,OACtD,2BAA0B,OAAO,YAAY,OAAO,WAAW;;;aAM9D,QAAQ,QACf;WAII,YAAY,OAAO,SAAS,KAAA,EAC9B,QAAO,OAAO;;;;;;AAStB,IAAM,6BACJ,QACA,eACS;CACT,MAAM,eAAe,OAAO,KAAK,cAAc,EAAE,CAAC;AAClD,KAAI,CAAC,cAAc,CAAC,UAAU,aAAa,WAAW,EACpD;AAGF,MAAK,MAAM,OAAO,cAAc;EAC9B,MAAM,SAAS,QAAQ,OAAO,WAAW,KAAK;AAC9C,MAAI,CAAC,QAAQ;AACX,UAAO,OAAO;AACd;;AAGF,MAAI,OAAO,WAAW,UAAU;AAC9B,UAAO,OAAO;AACd;;AAGF,MAAI,CAAC,OAAO,MAAM;AAEhB,OAAI,OAAO,MACT,QAAO,OAAO,kBAAkB,OAAO;YAC9B,cAAc,OAAO,IAAI,QAAQ,OAAO,OAAO,MAAM,EAAE,MAChE,QAAO,OAAO;IACZ,GAAG;IACH,OAAO,kBAAkB,QAAQ,OAAO,OAAO,MAAM,CAAC;IACvD;YACQ,WAAW,KACpB,QAAO,OAAO,WAAW;AAE3B;;EAIF,MAAM,WAAW,QAAQ,OAAO,OAAO,KAAK;AAE5C,MAAI,OAAO,MACT,QAAO,OAAO,kBAAkB,EAAE,OAAO,CAAC,UAAU,GAAG,OAAO,MAAM,EAAE,CAAiB;WAC9E,cAAc,OAAO,IAAI,cAAc,SAAS,IAAI,OAAO,OAAO;GAC3E,MAAM,gBAAgB,QAAQ,OAAO,SAAS,MAAM;AACpD,UAAO,OAAO;IACZ,GAAG;IACH,MAAM;IACN,OAAO,gBAAgB,WAAW,eAAe,QAAQ,OAAO,OAAO,MAAM,CAAC,GAAG,QAAQ,OAAO,OAAO,MAAM;IAC9G;aAGG,gBAAgB,YAAY,gBAAgB,QAAQ;GACtD,MAAM,SAAS;IAAE,GAAG;IAAU,GAAG;IAAQ;AACzC,UAAO,aAAa,EAAE,GAAG,SAAS,YAAY;AAC9C,6BAA0B,OAAO,YAAY,OAAO,WAAW;AAC/D,UAAO,OAAO;QAId,QAAO,OAAO;GAAE,GAAG;GAAQ,GAAG;GAAU;;;;;;AAShD,IAAM,wBAAwB,QAAsB,UAA8B;AAEhF,KAAI,MAAM,SAAS,OAAO,OAAO;EAE/B,MAAM,eAA+B,EAAE;AAEvC,MAAI,OAAO,MACT,MAAK,MAAM,UAAU,OAAO,MAC1B,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,OAAO;AAG3B,MAAI,MAAM,MACR,MAAK,MAAM,UAAU,MAAM,MACzB,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,MAAM;EAG1B,MAAM,SAAS,kBAAkB,EAAE,OAAO,cAAc,CAAiB;AACzE,SAAO,OAAO,QAAQ,OAAO;AAC7B;;AAIF,QAAO,OAAO,QAAQ,MAAM;AAG5B,KAAI,gBAAgB,UAAU,gBAAgB,MAC5C,2BAA0B,OAAO,YAAY,MAAM,WAAW;;;;;AAOlE,IAAM,cAAc,UAAwB,aAAyC;AAEnF,KAAI,SAAS,SAAS,SAAS,OAAO;EAEpC,MAAM,eAA+B,EAAE;AAEvC,MAAI,SAAS,MACX,MAAK,MAAM,UAAU,SAAS,MAC5B,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,SAAS;AAG7B,MAAI,SAAS,MACX,MAAK,MAAM,UAAU,SAAS,MAC5B,cAAa,KAAK,QAAQ,OAAO,OAAO,CAAC;MAG3C,cAAa,KAAK,SAAS;AAG7B,SAAO,kBAAkB,EAAE,OAAO,cAAc,CAAiB;;CAGnE,MAAM,SAAS;EAAE,GAAG;EAAU,GAAG;EAAU;AAG3C,KAAI,gBAAgB,YAAY,gBAAgB,UAAU;AAExD,SAAO,aAAa,EAAE,GAAG,SAAS,YAAY;AAE9C,4BAA0B,OAAO,YAAY,SAAS,WAAW;;AAGnE,QAAO"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { compositions } from "./schema-composition.js";
|
|
2
|
+
import { resolve } from "@scalar/workspace-store/resolve";
|
|
3
|
+
//#region src/components/Content/Schema/helpers/optimize-value-for-display.ts
|
|
4
|
+
/**
|
|
5
|
+
* Optimize the value by removing nulls from compositions and merging root properties.
|
|
6
|
+
*
|
|
7
|
+
* TODO: figure out what this does
|
|
8
|
+
*/
|
|
9
|
+
function optimizeValueForDisplay(value) {
|
|
10
|
+
if (!value || typeof value !== "object") return value;
|
|
11
|
+
const composition = compositions.find((keyword) => keyword in value && keyword !== "not");
|
|
12
|
+
if (!composition) return { ...value };
|
|
13
|
+
const schemas = value[composition];
|
|
14
|
+
if (!Array.isArray(schemas)) return { ...value };
|
|
15
|
+
const { [composition]: _, nullable: originalNullable, ...rootProperties } = value;
|
|
16
|
+
const hasRootProperties = Object.keys(rootProperties).length > 0;
|
|
17
|
+
const { filteredSchemas, hasNullSchema } = schemas.reduce((acc, _schema) => {
|
|
18
|
+
const schema = resolve.schema(_schema);
|
|
19
|
+
if ("type" in schema && schema.type === "null") acc.hasNullSchema = true;
|
|
20
|
+
else acc.filteredSchemas.push(schema);
|
|
21
|
+
return acc;
|
|
22
|
+
}, {
|
|
23
|
+
filteredSchemas: [],
|
|
24
|
+
hasNullSchema: false
|
|
25
|
+
});
|
|
26
|
+
const shouldBeNullable = hasNullSchema || originalNullable === true;
|
|
27
|
+
if (filteredSchemas.length === 1) {
|
|
28
|
+
const mergedSchema = {
|
|
29
|
+
...rootProperties,
|
|
30
|
+
...filteredSchemas[0]
|
|
31
|
+
};
|
|
32
|
+
if (shouldBeNullable) mergedSchema.nullable = true;
|
|
33
|
+
return mergedSchema;
|
|
34
|
+
}
|
|
35
|
+
if ((composition === "oneOf" || composition === "anyOf") && (hasRootProperties || filteredSchemas.some((schema) => schema.allOf))) {
|
|
36
|
+
const mergedSchemas = filteredSchemas.map((_schema) => {
|
|
37
|
+
const schema = resolve.schema(_schema);
|
|
38
|
+
if (schema.allOf?.length === 1) {
|
|
39
|
+
const { allOf, ...otherProps } = schema;
|
|
40
|
+
return {
|
|
41
|
+
...rootProperties,
|
|
42
|
+
...otherProps,
|
|
43
|
+
...resolve.schema(allOf[0])
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
...rootProperties,
|
|
48
|
+
...schema
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const result = { [composition]: mergedSchemas };
|
|
52
|
+
if (shouldBeNullable) result.nullable = true;
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
if (filteredSchemas.length !== schemas.length) {
|
|
56
|
+
const result = {
|
|
57
|
+
...value,
|
|
58
|
+
[composition]: filteredSchemas
|
|
59
|
+
};
|
|
60
|
+
if (shouldBeNullable) result.nullable = true;
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
return { ...value };
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { optimizeValueForDisplay };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=optimize-value-for-display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optimize-value-for-display.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/optimize-value-for-display.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { compositions } from './schema-composition'\n\n/**\n * Optimize the value by removing nulls from compositions and merging root properties.\n *\n * TODO: figure out what this does\n */\nexport function optimizeValueForDisplay(value: SchemaObject | undefined): SchemaObject | undefined {\n if (!value || typeof value !== 'object') {\n return value\n }\n\n // Find the composition keyword early to avoid unnecessary work\n const composition = compositions.find((keyword) => keyword in value && keyword !== 'not')\n\n // If there's no relevant composition keyword, return a shallow copy\n if (!composition) {\n return { ...value }\n }\n\n const schemas = value[composition]\n if (!Array.isArray(schemas)) {\n return { ...value }\n }\n\n // Extract root properties efficiently (excluding composition and nullable)\n const { [composition]: _, nullable: originalNullable, ...rootProperties } = value as any\n const hasRootProperties = Object.keys(rootProperties).length > 0\n\n // Check for null schemas and filter them out in one pass\n const { filteredSchemas, hasNullSchema } = schemas.reduce(\n (acc, _schema) => {\n const schema = resolve.schema(_schema)\n\n if ('type' in schema && schema.type === 'null') {\n acc.hasNullSchema = true\n } else {\n acc.filteredSchemas.push(schema)\n }\n return acc\n },\n { filteredSchemas: [] as SchemaObject[], hasNullSchema: false },\n )\n\n // Determine if nullable should be set\n const shouldBeNullable = hasNullSchema || originalNullable === true\n\n // If only one schema remains after filtering, merge with root properties\n if (filteredSchemas.length === 1) {\n const mergedSchema = { ...rootProperties, ...filteredSchemas[0] }\n if (shouldBeNullable) {\n mergedSchema.nullable = true\n }\n return mergedSchema\n }\n\n // Check if root properties should be merged into schemas\n const shouldMergeRootProperties =\n (composition === 'oneOf' || composition === 'anyOf') &&\n (hasRootProperties || filteredSchemas.some((schema) => schema.allOf))\n\n if (shouldMergeRootProperties) {\n const mergedSchemas = filteredSchemas.map((_schema) => {\n const schema = resolve.schema(_schema)\n\n // Flatten single-item allOf and merge with root properties\n if (schema.allOf?.length === 1) {\n const { allOf, ...otherProps } = schema\n return { ...rootProperties, ...otherProps, ...resolve.schema(allOf[0]) }\n }\n return { ...rootProperties, ...schema }\n })\n\n // @ts-expect-error - We avoid using coerceValue here as it may be dangerous, so we type cast\n const result = { [composition]: mergedSchemas } as SchemaObject\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n // Return with filtered schemas if any nulls were removed\n if (filteredSchemas.length !== schemas.length) {\n const result: SchemaObject = { ...value, [composition]: filteredSchemas }\n if (shouldBeNullable) {\n // @ts-expect-error We use nullable\n result.nullable = true\n }\n return result\n }\n\n return { ...value }\n}\n"],"mappings":";;;;;;;;AAUA,SAAgB,wBAAwB,OAA2D;AACjG,KAAI,CAAC,SAAS,OAAO,UAAU,SAC7B,QAAO;CAIT,MAAM,cAAc,aAAa,MAAM,YAAY,WAAW,SAAS,YAAY,MAAM;AAGzF,KAAI,CAAC,YACH,QAAO,EAAE,GAAG,OAAO;CAGrB,MAAM,UAAU,MAAM;AACtB,KAAI,CAAC,MAAM,QAAQ,QAAQ,CACzB,QAAO,EAAE,GAAG,OAAO;CAIrB,MAAM,GAAG,cAAc,GAAG,UAAU,kBAAkB,GAAG,mBAAmB;CAC5E,MAAM,oBAAoB,OAAO,KAAK,eAAe,CAAC,SAAS;CAG/D,MAAM,EAAE,iBAAiB,kBAAkB,QAAQ,QAChD,KAAK,YAAY;EAChB,MAAM,SAAS,QAAQ,OAAO,QAAQ;AAEtC,MAAI,UAAU,UAAU,OAAO,SAAS,OACtC,KAAI,gBAAgB;MAEpB,KAAI,gBAAgB,KAAK,OAAO;AAElC,SAAO;IAET;EAAE,iBAAiB,EAAE;EAAoB,eAAe;EAAO,CAChE;CAGD,MAAM,mBAAmB,iBAAiB,qBAAqB;AAG/D,KAAI,gBAAgB,WAAW,GAAG;EAChC,MAAM,eAAe;GAAE,GAAG;GAAgB,GAAG,gBAAgB;GAAI;AACjE,MAAI,iBACF,cAAa,WAAW;AAE1B,SAAO;;AAQT,MAHG,gBAAgB,WAAW,gBAAgB,aAC3C,qBAAqB,gBAAgB,MAAM,WAAW,OAAO,MAAM,GAEvC;EAC7B,MAAM,gBAAgB,gBAAgB,KAAK,YAAY;GACrD,MAAM,SAAS,QAAQ,OAAO,QAAQ;AAGtC,OAAI,OAAO,OAAO,WAAW,GAAG;IAC9B,MAAM,EAAE,OAAO,GAAG,eAAe;AACjC,WAAO;KAAE,GAAG;KAAgB,GAAG;KAAY,GAAG,QAAQ,OAAO,MAAM,GAAG;KAAE;;AAE1E,UAAO;IAAE,GAAG;IAAgB,GAAG;IAAQ;IACvC;EAGF,MAAM,SAAS,GAAG,cAAc,eAAe;AAC/C,MAAI,iBAEF,QAAO,WAAW;AAEpB,SAAO;;AAIT,KAAI,gBAAgB,WAAW,QAAQ,QAAQ;EAC7C,MAAM,SAAuB;GAAE,GAAG;IAAQ,cAAc;GAAiB;AACzE,MAAI,iBAEF,QAAO,WAAW;AAEpB,SAAO;;AAGT,QAAO,EAAE,GAAG,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-composition.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-composition.ts"],"sourcesContent":["/** Composition */\nexport type CompositionKeyword = 'oneOf' | 'anyOf' | 'allOf' | 'not'\n\nexport const compositions: CompositionKeyword[] = ['oneOf', 'anyOf', 'allOf', 'not']\n"],"mappings":";AAGA,IAAa,eAAqC;CAAC;CAAS;CAAS;CAAS;CAAM"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getRefName } from "./get-ref-name.js";
|
|
2
|
+
import { resolve } from "@scalar/workspace-store/resolve";
|
|
3
|
+
//#region src/components/Content/Schema/helpers/schema-name.ts
|
|
4
|
+
/**
|
|
5
|
+
* Extract schema name from various schema formats
|
|
6
|
+
*
|
|
7
|
+
* Handles $ref, title, name, type, and schema dictionary lookup
|
|
8
|
+
*/
|
|
9
|
+
var getModelNameFromSchema = (schemaOrRef) => {
|
|
10
|
+
if (!schemaOrRef) return null;
|
|
11
|
+
const schema = resolve.schema(schemaOrRef);
|
|
12
|
+
if (schema.title) return schema.title;
|
|
13
|
+
if (schema.name) return schema.name;
|
|
14
|
+
if ("$ref" in schemaOrRef) {
|
|
15
|
+
const refName = getRefName(schemaOrRef.$ref);
|
|
16
|
+
if (refName) return refName;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { getModelNameFromSchema };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=schema-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-name.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"sourcesContent":["import { resolve } from '@scalar/workspace-store/resolve'\nimport type { SchemaObject, SchemaReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nimport { getRefName } from './get-ref-name'\n\n/**\n * Extract schema name from various schema formats\n *\n * Handles $ref, title, name, type, and schema dictionary lookup\n */\nexport const getModelNameFromSchema = (\n schemaOrRef: SchemaObject | SchemaReferenceType<SchemaObject>,\n): string | null => {\n if (!schemaOrRef) {\n return null\n }\n\n const schema = resolve.schema(schemaOrRef)\n\n // Direct title/name properties - use direct property access for better performance\n if (schema.title) {\n return schema.title\n }\n\n if (schema.name) {\n return schema.name\n }\n\n if ('$ref' in schemaOrRef) {\n // Fall back to the schema key when the referenced schema has no human-friendly name.\n const refName = getRefName(schemaOrRef.$ref)\n if (refName) {\n return refName\n }\n }\n\n return null\n}\n"],"mappings":";;;;;;;;AAUA,IAAa,0BACX,gBACkB;AAClB,KAAI,CAAC,YACH,QAAO;CAGT,MAAM,SAAS,QAAQ,OAAO,YAAY;AAG1C,KAAI,OAAO,MACT,QAAO,OAAO;AAGhB,KAAI,OAAO,KACT,QAAO,OAAO;AAGhB,KAAI,UAAU,aAAa;EAEzB,MAAM,UAAU,WAAW,YAAY,KAAK;AAC5C,MAAI,QACF,QAAO;;AAIX,QAAO"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/components/Content/Schema/helpers/should-display-description.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determine if description should be displayed
|
|
4
|
+
*
|
|
5
|
+
* @param schema - The schema object to check
|
|
6
|
+
* @param propDescription - Optional description from props
|
|
7
|
+
* @returns Description string to display, or null if should not be displayed
|
|
8
|
+
*/
|
|
9
|
+
var shouldDisplayDescription = (schema, propDescription) => {
|
|
10
|
+
if (!schema) return null;
|
|
11
|
+
if (schema.allOf) return null;
|
|
12
|
+
return propDescription || schema.description || null;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { shouldDisplayDescription };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=should-display-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-display-description.js","names":[],"sources":["../../../../../src/components/Content/Schema/helpers/should-display-description.ts"],"sourcesContent":["import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\n/**\n * Determine if description should be displayed\n *\n * @param schema - The schema object to check\n * @param propDescription - Optional description from props\n * @returns Description string to display, or null if should not be displayed\n */\nexport const shouldDisplayDescription = (schema: SchemaObject | undefined, propDescription?: string): string | null => {\n if (!schema) {\n return null\n }\n\n // Don't show description for schemas with compositions to avoid duplicate descriptions\n if (schema.allOf) {\n return null\n }\n\n return propDescription || schema.description || null\n}\n"],"mappings":";;;;;;;;AASA,IAAa,4BAA4B,QAAkC,oBAA4C;AACrH,KAAI,CAAC,OACH,QAAO;AAIT,KAAI,OAAO,MACT,QAAO;AAGT,QAAO,mBAAmB,OAAO,eAAe"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/components/Content/Schema/helpers/should-display-heading.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determine if property heading should be displayed
|
|
4
|
+
*
|
|
5
|
+
* @param schema - The schema object to check
|
|
6
|
+
* @param name - Optional property name
|
|
7
|
+
* @param required - Whether the property is required
|
|
8
|
+
* @returns true if heading should be displayed, false otherwise
|
|
9
|
+
*/
|
|
10
|
+
var shouldDisplayHeading = (schema, name, required = false) => {
|
|
11
|
+
if (name || required) return true;
|
|
12
|
+
if (!schema) return false;
|
|
13
|
+
return schema.deprecated === true || schema.const !== void 0 || schema.enum?.length === 1 || "type" in schema && schema.type !== void 0 || "nullable" in schema && schema.nullable === true || schema.writeOnly === true || schema.readOnly === true;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { shouldDisplayHeading };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=should-display-heading.js.map
|