@scalar/api-reference 1.49.0 → 1.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/AgentScalarChatInterface-MUbtSqMw.js +41 -0
- package/dist/AgentScalarChatInterface-MUbtSqMw.js.map +1 -0
- package/dist/ExternalDocs-phu7GxpZ.js +272 -0
- package/dist/ExternalDocs-phu7GxpZ.js.map +1 -0
- package/dist/MobileHeader-B71jYJdT.js +1373 -0
- package/dist/MobileHeader-B71jYJdT.js.map +1 -0
- package/dist/Operation-CixLVfKd.js +3827 -0
- package/dist/Operation-CixLVfKd.js.map +1 -0
- package/dist/SearchButton-xzhIpMCZ.js +621 -0
- package/dist/SearchButton-xzhIpMCZ.js.map +1 -0
- package/dist/ServerSelector-5y29y2BJ.js +852 -0
- package/dist/ServerSelector-5y29y2BJ.js.map +1 -0
- package/dist/blocks/index.js +3 -10
- package/dist/blocks/scalar-client-selector-block/index.d.ts +1 -1
- package/dist/blocks/scalar-info-block/index.d.ts +2 -2
- package/dist/blocks/scalar-server-selector-block/index.d.ts +1 -1
- package/dist/browser/standalone.js +40759 -34701
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/AgentScalar/index.d.ts +3 -3
- package/dist/components/Anchor/index.d.ts +2 -2
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Content/Auth/index.d.ts +1 -1
- package/dist/components/Content/Models/index.d.ts +2 -2
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.d.ts +1 -1
- package/dist/components/Content/Schema/index.d.ts +4 -4
- package/dist/components/Content/Tags/index.d.ts +1 -1
- package/dist/components/Content/index.d.ts +2 -2
- package/dist/components/HttpMethod/index.d.ts +1 -1
- package/dist/components/LinkList/index.d.ts +1 -1
- package/dist/components/OperationsList/index.d.ts +1 -1
- package/dist/components/RenderPlugins/index.d.ts +1 -1
- package/dist/components/Section/index.d.ts +10 -10
- package/dist/components/SectionFlare/index.d.ts +1 -1
- package/dist/components/index.d.ts +5 -5
- package/dist/components/index.js +102 -42
- package/dist/components/index.js.map +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +1 -1
- 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/ModernLayout.vue.d.ts +1 -1
- package/dist/features/Search/components/SearchResult.vue.d.ts +1 -1
- package/dist/features/Search/helpers/create-fuse-instance.d.ts +1 -1
- package/dist/features/Search/helpers/create-search-index.d.ts +1 -1
- package/dist/features/Search/index.d.ts +2 -2
- package/dist/features/Search/types.d.ts +1 -1
- package/dist/features/developer-tools/index.d.ts +1 -1
- package/dist/features/example-responses/index.d.ts +1 -1
- package/dist/features/external-docs/index.d.ts +1 -1
- package/dist/features/index.d.ts +2 -2
- package/dist/features/index.js +4 -10
- package/dist/features/info-object/index.d.ts +3 -3
- package/dist/features/specification-extension/index.d.ts +2 -2
- package/dist/features/test-request-button/index.d.ts +1 -1
- package/dist/features/x-badges/index.d.ts +1 -1
- package/dist/helpers/download.d.ts +1 -1
- package/dist/helpers/download.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +8 -8
- package/dist/helpers/index.js +3 -24
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +3 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -14
- package/dist/lazy-bus-CV8Ox5hD.js +333 -0
- package/dist/lazy-bus-CV8Ox5hD.js.map +1 -0
- package/dist/normalize-configurations-DcVpOEjD.js +232 -0
- package/dist/normalize-configurations-DcVpOEjD.js.map +1 -0
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/plugins/index.d.ts +3 -3
- package/dist/plugins/index.js +2 -9
- package/dist/plugins-4EyiUD_A.js +80 -0
- package/dist/plugins-4EyiUD_A.js.map +1 -0
- package/dist/src-DqcYVBWI.js +1686 -0
- package/dist/src-DqcYVBWI.js.map +1 -0
- package/dist/ssr.d.ts +2 -2
- package/dist/ssr.js +7 -14
- package/dist/storage--3JuzjCI.js +42 -0
- package/dist/storage--3JuzjCI.js.map +1 -0
- package/dist/style.css +6773 -7332
- package/dist/urls-gPTXGgbj.js +17 -0
- package/dist/urls-gPTXGgbj.js.map +1 -0
- package/dist/use-agent-Bnm1de0n.js +60 -0
- package/dist/use-agent-Bnm1de0n.js.map +1 -0
- package/dist/use-intersection-8QqPi2O-.js +24 -0
- package/dist/use-intersection-8QqPi2O-.js.map +1 -0
- package/package.json +25 -27
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +0 -7
- package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +0 -123
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +0 -7
- package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +0 -142
- package/dist/blocks/scalar-client-selector-block/helpers/featured-clients.js +0 -24
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +0 -63
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +0 -59
- package/dist/blocks/scalar-info-block/components/InfoBlock.vue2.js +0 -4
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/InfoDescription.vue2.js +0 -70
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue.js +0 -38
- package/dist/blocks/scalar-info-block/components/InfoLinks.vue2.js +0 -4
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue.js +0 -38
- package/dist/blocks/scalar-info-block/components/InfoMarkdownSection.vue2.js +0 -4
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue.js +0 -28
- package/dist/blocks/scalar-info-block/components/InfoVersion.vue2.js +0 -4
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/IntroductionCard.vue2.js +0 -19
- package/dist/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +0 -14
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue.js +0 -7
- package/dist/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +0 -112
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue.js +0 -21
- package/dist/blocks/scalar-info-block/components/OpenApiVersion.vue2.js +0 -4
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +0 -76
- package/dist/blocks/scalar-server-selector-block/components/Selector.vue2.js +0 -4
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +0 -72
- package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue2.js +0 -4
- package/dist/components/AgentScalar/AgentScalarButton.vue.js +0 -22
- package/dist/components/AgentScalar/AgentScalarButton.vue2.js +0 -4
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue.js +0 -4
- package/dist/components/AgentScalar/AgentScalarChatInterface.vue2.js +0 -29
- package/dist/components/AgentScalar/AgentScalarDrawer.vue.js +0 -7
- package/dist/components/AgentScalar/AgentScalarDrawer.vue2.js +0 -78
- package/dist/components/AgentScalar/OpenMCPButton.vue.js +0 -7
- package/dist/components/AgentScalar/OpenMCPButton.vue2.js +0 -191
- package/dist/components/Anchor/Anchor.vue.js +0 -51
- package/dist/components/Anchor/Anchor.vue2.js +0 -4
- package/dist/components/Anchor/WithBreadcrumb.vue.js +0 -41
- package/dist/components/Anchor/WithBreadcrumb.vue2.js +0 -4
- package/dist/components/ApiReference.vue.js +0 -10
- package/dist/components/ApiReference.vue2.js +0 -742
- package/dist/components/Badge/Badge.vue.js +0 -7
- package/dist/components/Badge/Badge.vue2.js +0 -26
- package/dist/components/ClassicHeader.vue.js +0 -21
- package/dist/components/Content/Auth/Auth.vue.js +0 -77
- package/dist/components/Content/Auth/Auth.vue2.js +0 -4
- package/dist/components/Content/Auth/helpers/get-default-security.js +0 -55
- package/dist/components/Content/Content.vue.js +0 -171
- package/dist/components/Content/Content.vue3.js +0 -5
- package/dist/components/Content/Models/Model.vue.js +0 -47
- package/dist/components/Content/Models/Model.vue2.js +0 -4
- package/dist/components/Content/Models/ModelTag.vue.js +0 -76
- package/dist/components/Content/Models/ModelTag.vue2.js +0 -4
- package/dist/components/Content/Models/components/ClassicLayout.vue.js +0 -7
- package/dist/components/Content/Models/components/ClassicLayout.vue2.js +0 -78
- package/dist/components/Content/Models/components/ModernLayout.vue.js +0 -61
- package/dist/components/Content/Models/components/ModernLayout.vue2.js +0 -4
- package/dist/components/Content/Operations/TraversedEntry.vue.js +0 -146
- package/dist/components/Content/Operations/TraversedEntry.vue2.js +0 -4
- package/dist/components/Content/Schema/RenderString.vue.js +0 -27
- package/dist/components/Content/Schema/RenderString.vue2.js +0 -4
- package/dist/components/Content/Schema/Schema.vue.js +0 -7
- package/dist/components/Content/Schema/Schema.vue2.js +0 -193
- package/dist/components/Content/Schema/SchemaComposition.vue.js +0 -120
- package/dist/components/Content/Schema/SchemaComposition.vue2.js +0 -4
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +0 -36
- package/dist/components/Content/Schema/SchemaEnums.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaEnums.vue2.js +0 -112
- package/dist/components/Content/Schema/SchemaHeading.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaHeading.vue2.js +0 -61
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue.js +0 -66
- package/dist/components/Content/Schema/SchemaObjectExampleCodeBlock.vue2.js +0 -4
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +0 -120
- package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +0 -4
- package/dist/components/Content/Schema/SchemaProperty.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +0 -236
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaPropertyDefault.vue2.js +0 -45
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue2.js +0 -40
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +0 -80
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +0 -7
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +0 -318
- package/dist/components/Content/Schema/helpers/format-example.js +0 -41
- package/dist/components/Content/Schema/helpers/format-value.js +0 -35
- package/dist/components/Content/Schema/helpers/get-compositions-to-render.js +0 -31
- package/dist/components/Content/Schema/helpers/get-enum-values.js +0 -20
- package/dist/components/Content/Schema/helpers/get-property-description.js +0 -34
- package/dist/components/Content/Schema/helpers/get-ref-name.js +0 -14
- package/dist/components/Content/Schema/helpers/get-schema-type.js +0 -47
- package/dist/components/Content/Schema/helpers/has-complex-array-items.js +0 -48
- package/dist/components/Content/Schema/helpers/is-empty-schema-object.js +0 -13
- package/dist/components/Content/Schema/helpers/is-type-object.js +0 -27
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +0 -215
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +0 -64
- package/dist/components/Content/Schema/helpers/schema-composition.js +0 -4
- package/dist/components/Content/Schema/helpers/schema-name.js +0 -24
- package/dist/components/Content/Schema/helpers/should-display-description.js +0 -12
- package/dist/components/Content/Schema/helpers/should-display-heading.js +0 -12
- package/dist/components/Content/Schema/helpers/should-render-array-item-composition.js +0 -15
- package/dist/components/Content/Schema/helpers/sort-property-names.js +0 -71
- package/dist/components/Content/Tags/Tag.vue.js +0 -46
- package/dist/components/Content/Tags/Tag.vue2.js +0 -4
- package/dist/components/Content/Tags/components/ClassicLayout.vue.js +0 -7
- package/dist/components/Content/Tags/components/ClassicLayout.vue2.js +0 -57
- package/dist/components/Content/Tags/components/ModernLayout.vue.js +0 -7
- package/dist/components/Content/Tags/components/ModernLayout.vue2.js +0 -56
- package/dist/components/Content/Tags/components/TagSection.vue.js +0 -100
- package/dist/components/Content/Tags/components/TagSection.vue2.js +0 -4
- package/dist/components/GettingStarted.vue.js +0 -7
- package/dist/components/GettingStarted.vue2.js +0 -82
- package/dist/components/HttpMethod/HttpMethod.vue.js +0 -34
- package/dist/components/HttpMethod/HttpMethod.vue2.js +0 -4
- package/dist/components/IntersectionObserver.vue.js +0 -55
- package/dist/components/IntersectionObserver.vue2.js +0 -4
- package/dist/components/Lazy/Lazy.vue.js +0 -106
- package/dist/components/Lazy/Lazy.vue2.js +0 -4
- package/dist/components/LinkList/LinkList.vue.js +0 -7
- package/dist/components/LinkList/LinkList.vue2.js +0 -48
- package/dist/components/LoadingSkeleton.vue.js +0 -7
- package/dist/components/LoadingSkeleton.vue2.js +0 -20
- package/dist/components/MobileHeader.vue.js +0 -62
- package/dist/components/MobileHeader.vue2.js +0 -4
- package/dist/components/OperationPath.vue.js +0 -7
- package/dist/components/OperationPath.vue2.js +0 -30
- package/dist/components/OperationsList/OperationsList.vue.js +0 -7
- package/dist/components/OperationsList/OperationsList.vue2.js +0 -61
- package/dist/components/OperationsList/OperationsListItem.vue.js +0 -7
- package/dist/components/OperationsList/OperationsListItem.vue2.js +0 -68
- package/dist/components/RenderPlugins/RenderPlugins.vue.js +0 -43
- package/dist/components/RenderPlugins/RenderPlugins.vue2.js +0 -4
- package/dist/components/ScreenReader.vue.js +0 -7
- package/dist/components/ScreenReader.vue2.js +0 -21
- package/dist/components/Section/CompactSection.vue.js +0 -7
- package/dist/components/Section/CompactSection.vue2.js +0 -60
- package/dist/components/Section/Section.vue.js +0 -7
- package/dist/components/Section/Section.vue2.js +0 -23
- package/dist/components/Section/SectionAccordion.vue.js +0 -7
- package/dist/components/Section/SectionAccordion.vue2.js +0 -76
- package/dist/components/Section/SectionColumn.vue.js +0 -14
- package/dist/components/Section/SectionColumns.vue.js +0 -14
- package/dist/components/Section/SectionContainer.vue.js +0 -7
- package/dist/components/Section/SectionContainer.vue2.js +0 -21
- package/dist/components/Section/SectionContainerAccordion.vue.js +0 -7
- package/dist/components/Section/SectionContainerAccordion.vue2.js +0 -54
- package/dist/components/Section/SectionContent.vue.js +0 -7
- package/dist/components/Section/SectionContent.vue2.js +0 -22
- package/dist/components/Section/SectionHeader.vue.js +0 -7
- package/dist/components/Section/SectionHeader.vue2.js +0 -26
- package/dist/components/Section/SectionHeaderTag.vue.js +0 -7
- package/dist/components/Section/SectionHeaderTag.vue2.js +0 -20
- package/dist/components/SectionFlare/SectionFlare.vue.js +0 -14
- package/dist/components/ShowMoreButton.vue.js +0 -7
- package/dist/components/ShowMoreButton.vue2.js +0 -23
- package/dist/consts/urls.js +0 -16
- package/dist/features/Operation/Operation.vue.js +0 -100
- package/dist/features/Operation/Operation.vue2.js +0 -4
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +0 -88
- package/dist/features/Operation/components/ContentTypeSelect.vue2.js +0 -4
- package/dist/features/Operation/components/Header.vue.js +0 -33
- package/dist/features/Operation/components/Header.vue2.js +0 -4
- package/dist/features/Operation/components/Headers.vue.js +0 -7
- package/dist/features/Operation/components/Headers.vue2.js +0 -71
- package/dist/features/Operation/components/OperationParameters.vue.js +0 -92
- package/dist/features/Operation/components/OperationParameters.vue2.js +0 -4
- package/dist/features/Operation/components/OperationResponses.vue.js +0 -44
- package/dist/features/Operation/components/OperationResponses.vue2.js +0 -4
- package/dist/features/Operation/components/ParameterList.vue.js +0 -50
- package/dist/features/Operation/components/ParameterList.vue2.js +0 -4
- package/dist/features/Operation/components/ParameterListItem.vue.js +0 -7
- package/dist/features/Operation/components/ParameterListItem.vue2.js +0 -163
- package/dist/features/Operation/components/RequestBody.vue.js +0 -7
- package/dist/features/Operation/components/RequestBody.vue2.js +0 -164
- package/dist/features/Operation/components/callbacks/Callback.vue.js +0 -7
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +0 -60
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +0 -63
- package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +0 -4
- package/dist/features/Operation/helpers/filter-selected-security.js +0 -28
- package/dist/features/Operation/helpers/get-first-server.js +0 -25
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +0 -7
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +0 -243
- package/dist/features/Operation/layouts/ModernLayout.vue.js +0 -7
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +0 -256
- package/dist/features/Search/components/SearchButton.vue.js +0 -88
- package/dist/features/Search/components/SearchButton.vue2.js +0 -4
- package/dist/features/Search/components/SearchModal.vue.js +0 -7
- package/dist/features/Search/components/SearchModal.vue2.js +0 -120
- package/dist/features/Search/components/SearchResult.vue.js +0 -84
- package/dist/features/Search/components/SearchResult.vue2.js +0 -4
- package/dist/features/Search/helpers/create-fuse-instance.js +0 -43
- package/dist/features/Search/helpers/create-search-index.js +0 -119
- package/dist/features/Search/hooks/useSearchIndex.js +0 -33
- package/dist/features/ask-agent-button/AskAgentButton.vue.js +0 -7
- package/dist/features/ask-agent-button/AskAgentButton.vue2.js +0 -51
- package/dist/features/developer-tools/DeveloperTools.vue.js +0 -60
- package/dist/features/developer-tools/DeveloperTools.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarBlurb.vue.js +0 -13
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue.js +0 -33
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayout.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue.js +0 -138
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigLayoutOptions.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue.js +0 -66
- package/dist/features/developer-tools/components/ApiReferenceToolbarConfigTheme.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue.js +0 -54
- package/dist/features/developer-tools/components/ApiReferenceToolbarPopover.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue.js +0 -71
- package/dist/features/developer-tools/components/ApiReferenceToolbarRegisterButton.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue.js +0 -63
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareRegister.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue.js +0 -73
- package/dist/features/developer-tools/components/ApiReferenceToolbarShareTemporary.vue2.js +0 -4
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue.js +0 -57
- package/dist/features/developer-tools/components/ApiReferenceToolbarTitle.vue2.js +0 -4
- package/dist/features/developer-tools/components/DeployApiReference.vue.js +0 -35
- package/dist/features/developer-tools/components/DeployApiReference.vue2.js +0 -4
- package/dist/features/developer-tools/components/ModifyConfiguration.vue.js +0 -103
- package/dist/features/developer-tools/components/ModifyConfiguration.vue2.js +0 -4
- package/dist/features/developer-tools/components/ShareApiReference.vue.js +0 -35
- package/dist/features/developer-tools/components/ShareApiReference.vue2.js +0 -4
- package/dist/features/example-responses/ExampleResponse.vue.js +0 -7
- package/dist/features/example-responses/ExampleResponse.vue2.js +0 -61
- package/dist/features/example-responses/ExampleResponseTab.vue.js +0 -7
- package/dist/features/example-responses/ExampleResponseTab.vue2.js +0 -25
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +0 -7
- package/dist/features/example-responses/ExampleResponseTabList.vue2.js +0 -37
- package/dist/features/example-responses/ExampleResponses.vue.js +0 -7
- package/dist/features/example-responses/ExampleResponses.vue2.js +0 -181
- package/dist/features/example-responses/ExampleSchema.vue.js +0 -42
- package/dist/features/example-responses/ExampleSchema.vue2.js +0 -4
- package/dist/features/example-responses/has-response-content.js +0 -28
- package/dist/features/external-docs/ExternalDocs.vue.js +0 -42
- package/dist/features/external-docs/ExternalDocs.vue2.js +0 -4
- package/dist/features/info-object/Contact.vue.js +0 -46
- package/dist/features/info-object/Contact.vue2.js +0 -4
- package/dist/features/info-object/License.vue.js +0 -40
- package/dist/features/info-object/License.vue2.js +0 -4
- package/dist/features/info-object/TermsOfService.vue.js +0 -34
- package/dist/features/info-object/TermsOfService.vue2.js +0 -4
- package/dist/features/multiple-documents/DocumentSelector.vue.js +0 -54
- package/dist/features/multiple-documents/DocumentSelector.vue2.js +0 -4
- package/dist/features/specification-extension/SpecificationExtension.vue.js +0 -4
- package/dist/features/specification-extension/SpecificationExtension.vue2.js +0 -52
- package/dist/features/specification-extension/helpers.js +0 -9
- package/dist/features/test-request-button/TestRequestButton.vue.js +0 -7
- package/dist/features/test-request-button/TestRequestButton.vue2.js +0 -46
- package/dist/features/x-badges/XBadges.vue.js +0 -35
- package/dist/features/x-badges/XBadges.vue2.js +0 -4
- package/dist/helpers/color-mode.js +0 -9
- package/dist/helpers/download.js +0 -45
- package/dist/helpers/id-routing.js +0 -109
- package/dist/helpers/lazy-bus.js +0 -195
- package/dist/helpers/load-from-perssistance.js +0 -17
- package/dist/helpers/map-config-plugins.js +0 -27
- package/dist/helpers/map-config-to-workspace-store.js +0 -45
- package/dist/helpers/normalize-configurations.js +0 -69
- package/dist/helpers/openapi.js +0 -135
- package/dist/helpers/storage.js +0 -47
- package/dist/helpers/upload-temp-document.js +0 -24
- package/dist/hooks/use-agent.js +0 -42
- package/dist/hooks/use-intersection.js +0 -32
- package/dist/plugins/hooks/usePluginManager.js +0 -14
- package/dist/plugins/persistance-plugin.js +0 -48
- package/dist/plugins/plugin-manager.js +0 -39
- package/dist/standalone/lib/html-api.js +0 -81
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { REGEX } from "@scalar/helpers/regex/regex-helpers";
|
|
2
|
-
const getRefName = (ref) => {
|
|
3
|
-
if (!ref) {
|
|
4
|
-
return null;
|
|
5
|
-
}
|
|
6
|
-
const match = ref.match(REGEX.REF_NAME);
|
|
7
|
-
if (match) {
|
|
8
|
-
return match[1];
|
|
9
|
-
}
|
|
10
|
-
return null;
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
getRefName
|
|
14
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { resolve } from "@scalar/workspace-store/resolve";
|
|
2
|
-
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
3
|
-
const formatArrayType = (itemType) => {
|
|
4
|
-
if (!itemType) {
|
|
5
|
-
return "array";
|
|
6
|
-
}
|
|
7
|
-
const wrappedItemType = itemType.includes(" | ") ? `(${itemType})` : itemType;
|
|
8
|
-
return `array ${wrappedItemType}[]`;
|
|
9
|
-
};
|
|
10
|
-
const processArrayType = (value, isUnionType = false) => {
|
|
11
|
-
if (!value.items) {
|
|
12
|
-
return "array";
|
|
13
|
-
}
|
|
14
|
-
const itemType = getSchemaType(resolve.schema(value.items));
|
|
15
|
-
const baseType = formatArrayType(itemType);
|
|
16
|
-
if (isUnionType) {
|
|
17
|
-
return baseType;
|
|
18
|
-
}
|
|
19
|
-
return value.nullable ? `${baseType} | null` : baseType;
|
|
20
|
-
};
|
|
21
|
-
const getSchemaType = (valueOrRef) => {
|
|
22
|
-
if (!valueOrRef) {
|
|
23
|
-
return "";
|
|
24
|
-
}
|
|
25
|
-
const value = resolve.schema(valueOrRef);
|
|
26
|
-
if (value.const !== void 0) {
|
|
27
|
-
return "const";
|
|
28
|
-
}
|
|
29
|
-
if ("type" in value && Array.isArray(value.type)) {
|
|
30
|
-
if (value.type.includes("array") && value.items) {
|
|
31
|
-
const arrayType = processArrayType(value, true);
|
|
32
|
-
const otherTypes = value.type.filter((t) => t !== "array");
|
|
33
|
-
return otherTypes.length > 0 ? `${arrayType} | ${otherTypes.join(" | ")}` : arrayType;
|
|
34
|
-
}
|
|
35
|
-
return value.type.join(" | ");
|
|
36
|
-
}
|
|
37
|
-
if (isArraySchema(value)) {
|
|
38
|
-
return processArrayType(value, false);
|
|
39
|
-
}
|
|
40
|
-
if ("type" in value && value.type && value.contentEncoding) {
|
|
41
|
-
return `${value.type} • ${value.contentEncoding}`;
|
|
42
|
-
}
|
|
43
|
-
return "type" in value ? value.type : "";
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
getSchemaType
|
|
47
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
const COMPOSITION_KEYWORDS = ["allOf", "oneOf", "anyOf"];
|
|
4
|
-
const isObjectType = (schema) => {
|
|
5
|
-
if ("type" in schema && schema.type) {
|
|
6
|
-
if (Array.isArray(schema.type)) {
|
|
7
|
-
return schema.type.includes("object");
|
|
8
|
-
}
|
|
9
|
-
return schema.type === "object";
|
|
10
|
-
}
|
|
11
|
-
return "properties" in schema;
|
|
12
|
-
};
|
|
13
|
-
const hasComplexFeatures = (schema) => "$ref" in schema || "discriminator" in schema || COMPOSITION_KEYWORDS.some((keyword) => keyword in schema);
|
|
14
|
-
const hasComplexNestedArrayItems = (items) => {
|
|
15
|
-
if (!isArraySchema(items) || typeof items.items !== "object") {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
if ("$ref" in items.items) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
const nestedItems = getResolvedRef(items.items);
|
|
22
|
-
if (!nestedItems) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
return isObjectType(nestedItems) || hasComplexFeatures(nestedItems) || isArraySchema(nestedItems);
|
|
26
|
-
};
|
|
27
|
-
const hasComplexArrayItems = (value) => {
|
|
28
|
-
if (!value || !isArraySchema(value) || typeof value.items !== "object") {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
if ("$ref" in value.items) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
const items = getResolvedRef(value.items);
|
|
35
|
-
if (!items) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
if (hasComplexFeatures(items)) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
if (isObjectType(items)) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
return hasComplexNestedArrayItems(items);
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
hasComplexArrayItems
|
|
48
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isTypeObject } from "./is-type-object.js";
|
|
2
|
-
const isEmptySchemaObject = (schema) => {
|
|
3
|
-
if (!isTypeObject(schema)) {
|
|
4
|
-
return false;
|
|
5
|
-
}
|
|
6
|
-
const hasNoProperties = Object.keys(schema.properties ?? {}).length === 0;
|
|
7
|
-
const hasNoAdditionalProperties = schema.additionalProperties === void 0 || schema.additionalProperties === false;
|
|
8
|
-
const hasNoPatternProperties = Object.keys(schema.patternProperties ?? {}).length === 0;
|
|
9
|
-
return hasNoProperties && hasNoAdditionalProperties && hasNoPatternProperties;
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
isEmptySchemaObject
|
|
13
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const isTypeObject = (schema) => {
|
|
2
|
-
if (schema === null || typeof schema !== "object" || Array.isArray(schema)) {
|
|
3
|
-
return false;
|
|
4
|
-
}
|
|
5
|
-
const hasComposition = "oneOf" in schema || "anyOf" in schema || "allOf" in schema || "not" in schema;
|
|
6
|
-
if (hasComposition) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
const hasType = "type" in schema;
|
|
10
|
-
if (hasType && Array.isArray(schema.type)) {
|
|
11
|
-
return schema.type.includes("object");
|
|
12
|
-
}
|
|
13
|
-
const hasTypeObject = hasType && schema.type === "object";
|
|
14
|
-
if (hasTypeObject) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
if (hasType && !hasTypeObject) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
const hasProperties = "properties" in schema;
|
|
21
|
-
const hasAdditionalProperties = "additionalProperties" in schema;
|
|
22
|
-
const hasPatternProperties = "patternProperties" in schema;
|
|
23
|
-
return hasProperties || hasAdditionalProperties || hasPatternProperties;
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
isTypeObject
|
|
27
|
-
};
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { objectKeys } from "@scalar/helpers/object/object-keys";
|
|
2
|
-
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
-
import { resolve } from "@scalar/workspace-store/resolve";
|
|
4
|
-
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
5
|
-
const mergeAllOfSchemas = (schemas, rootSchema) => {
|
|
6
|
-
if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) {
|
|
7
|
-
return rootSchema || {};
|
|
8
|
-
}
|
|
9
|
-
const result = {};
|
|
10
|
-
const { allOf: _, ...baseSchema } = schemas;
|
|
11
|
-
for (const _schema of schemas.allOf) {
|
|
12
|
-
if (!_schema || typeof _schema !== "object") {
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
const schema = resolve.schema(_schema);
|
|
16
|
-
if (schema.allOf) {
|
|
17
|
-
const nestedMerged = mergeAllOfSchemas(schema);
|
|
18
|
-
mergeSchemaIntoResult(result, nestedMerged);
|
|
19
|
-
continue;
|
|
20
|
-
}
|
|
21
|
-
mergeSchemaIntoResult(result, schema);
|
|
22
|
-
}
|
|
23
|
-
if (Object.keys(baseSchema).length > 0) {
|
|
24
|
-
mergeSchemaIntoResult(result, baseSchema, true);
|
|
25
|
-
}
|
|
26
|
-
if (rootSchema && typeof rootSchema === "object") {
|
|
27
|
-
if (rootSchema.allOf) {
|
|
28
|
-
const nestedMerged = mergeAllOfSchemas(rootSchema);
|
|
29
|
-
mergeSchemaIntoResult(result, nestedMerged, true);
|
|
30
|
-
} else {
|
|
31
|
-
mergeSchemaIntoResult(result, rootSchema, true);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
const mergeSchemaIntoResult = (result, schema, override = false) => {
|
|
37
|
-
const schemaKeys = objectKeys(schema);
|
|
38
|
-
if (schemaKeys.length === 0) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
for (const key of schemaKeys) {
|
|
42
|
-
const value = getResolvedRef(schema[key]);
|
|
43
|
-
if (value === void 0) {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
if (key === "required") {
|
|
47
|
-
if (Array.isArray(value) && value.length > 0) {
|
|
48
|
-
if (result.required?.length) {
|
|
49
|
-
result.required = [.../* @__PURE__ */ new Set([...result.required, ...value])];
|
|
50
|
-
} else {
|
|
51
|
-
result.required = value.slice();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
} else if (key === "properties") {
|
|
55
|
-
if (value && typeof value === "object") {
|
|
56
|
-
if (!result.properties) {
|
|
57
|
-
result.properties = {};
|
|
58
|
-
}
|
|
59
|
-
mergePropertiesIntoResult(result.properties, value);
|
|
60
|
-
}
|
|
61
|
-
} else if (key === "items") {
|
|
62
|
-
const items = resolve.schema(value);
|
|
63
|
-
if (items) {
|
|
64
|
-
if (isArraySchema(schema)) {
|
|
65
|
-
if (!result.items) {
|
|
66
|
-
result.items = {};
|
|
67
|
-
}
|
|
68
|
-
if (items.allOf) {
|
|
69
|
-
const mergedItems = mergeAllOfSchemas(items);
|
|
70
|
-
Object.assign(result.items, mergedItems);
|
|
71
|
-
} else {
|
|
72
|
-
mergeItemsIntoResult(getResolvedRef(result.items), items);
|
|
73
|
-
}
|
|
74
|
-
} else if (items.allOf) {
|
|
75
|
-
const mergedItems = mergeAllOfSchemas(items);
|
|
76
|
-
if ("properties" in mergedItems) {
|
|
77
|
-
if (!("properties" in result)) {
|
|
78
|
-
result.properties = {};
|
|
79
|
-
}
|
|
80
|
-
"properties" in result && mergePropertiesIntoResult(result.properties, mergedItems.properties);
|
|
81
|
-
}
|
|
82
|
-
} else if (!("items" in result)) {
|
|
83
|
-
result.items = items;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
} else if (key === "enum") {
|
|
87
|
-
if (Array.isArray(value) && value.length > 0) {
|
|
88
|
-
result.enum = [.../* @__PURE__ */ new Set([...result.enum || [], ...value])];
|
|
89
|
-
}
|
|
90
|
-
} else if (key === "oneOf" || key === "anyOf") {
|
|
91
|
-
if (Array.isArray(value)) {
|
|
92
|
-
if (!("properties" in result)) {
|
|
93
|
-
result.properties = {};
|
|
94
|
-
}
|
|
95
|
-
for (const _option of value) {
|
|
96
|
-
const option = resolve.schema(_option);
|
|
97
|
-
if (option && "properties" in option && "properties" in result) {
|
|
98
|
-
mergePropertiesIntoResult(result.properties, option.properties);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
} else if (key === "allOf") {
|
|
103
|
-
continue;
|
|
104
|
-
} else {
|
|
105
|
-
if (override || result[key] === void 0) {
|
|
106
|
-
result[key] = value;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const mergePropertiesIntoResult = (result, properties) => {
|
|
112
|
-
const propertyKeys = Object.keys(properties ?? {});
|
|
113
|
-
if (!properties || !result || propertyKeys.length === 0) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
for (const key of propertyKeys) {
|
|
117
|
-
const schema = resolve.schema(properties[key]);
|
|
118
|
-
if (!schema) {
|
|
119
|
-
delete result[key];
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
if (typeof schema !== "object") {
|
|
123
|
-
result[key] = schema;
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
if (!result[key]) {
|
|
127
|
-
if (schema.allOf) {
|
|
128
|
-
result[key] = mergeAllOfSchemas(schema);
|
|
129
|
-
} else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) {
|
|
130
|
-
result[key] = {
|
|
131
|
-
...schema,
|
|
132
|
-
items: mergeAllOfSchemas(resolve.schema(schema.items))
|
|
133
|
-
};
|
|
134
|
-
} else if (properties[key]) {
|
|
135
|
-
result[key] = properties[key];
|
|
136
|
-
}
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
const existing = resolve.schema(result[key]);
|
|
140
|
-
if (schema.allOf) {
|
|
141
|
-
result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] });
|
|
142
|
-
} else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {
|
|
143
|
-
const existingItems = resolve.schema(existing.items);
|
|
144
|
-
result[key] = {
|
|
145
|
-
...existing,
|
|
146
|
-
type: "array",
|
|
147
|
-
items: existingItems ? mergeItems(existingItems, resolve.schema(schema.items)) : resolve.schema(schema.items)
|
|
148
|
-
};
|
|
149
|
-
} else {
|
|
150
|
-
if ("properties" in existing && "properties" in schema) {
|
|
151
|
-
const merged = { ...existing, ...schema };
|
|
152
|
-
merged.properties = { ...existing.properties };
|
|
153
|
-
mergePropertiesIntoResult(merged.properties, schema.properties);
|
|
154
|
-
result[key] = merged;
|
|
155
|
-
} else {
|
|
156
|
-
result[key] = { ...schema, ...existing };
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
const mergeItemsIntoResult = (result, items) => {
|
|
162
|
-
if (items.allOf || result.allOf) {
|
|
163
|
-
const allOfSchemas = [];
|
|
164
|
-
if (result.allOf) {
|
|
165
|
-
for (const schema of result.allOf) {
|
|
166
|
-
allOfSchemas.push(resolve.schema(schema));
|
|
167
|
-
}
|
|
168
|
-
} else {
|
|
169
|
-
allOfSchemas.push(result);
|
|
170
|
-
}
|
|
171
|
-
if (items.allOf) {
|
|
172
|
-
for (const schema of items.allOf) {
|
|
173
|
-
allOfSchemas.push(resolve.schema(schema));
|
|
174
|
-
}
|
|
175
|
-
} else {
|
|
176
|
-
allOfSchemas.push(items);
|
|
177
|
-
}
|
|
178
|
-
const merged = mergeAllOfSchemas({ allOf: allOfSchemas });
|
|
179
|
-
Object.assign(result, merged);
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
Object.assign(result, items);
|
|
183
|
-
if ("properties" in result && "properties" in items) {
|
|
184
|
-
mergePropertiesIntoResult(result.properties, items.properties);
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
const mergeItems = (existing, incoming) => {
|
|
188
|
-
if (existing.allOf || incoming.allOf) {
|
|
189
|
-
const allOfSchemas = [];
|
|
190
|
-
if (existing.allOf) {
|
|
191
|
-
for (const schema of existing.allOf) {
|
|
192
|
-
allOfSchemas.push(resolve.schema(schema));
|
|
193
|
-
}
|
|
194
|
-
} else {
|
|
195
|
-
allOfSchemas.push(existing);
|
|
196
|
-
}
|
|
197
|
-
if (incoming.allOf) {
|
|
198
|
-
for (const schema of incoming.allOf) {
|
|
199
|
-
allOfSchemas.push(resolve.schema(schema));
|
|
200
|
-
}
|
|
201
|
-
} else {
|
|
202
|
-
allOfSchemas.push(incoming);
|
|
203
|
-
}
|
|
204
|
-
return mergeAllOfSchemas({ allOf: allOfSchemas });
|
|
205
|
-
}
|
|
206
|
-
const merged = { ...existing, ...incoming };
|
|
207
|
-
if ("properties" in existing && "properties" in incoming) {
|
|
208
|
-
merged.properties = { ...existing.properties };
|
|
209
|
-
mergePropertiesIntoResult(merged.properties, incoming.properties);
|
|
210
|
-
}
|
|
211
|
-
return merged;
|
|
212
|
-
};
|
|
213
|
-
export {
|
|
214
|
-
mergeAllOfSchemas
|
|
215
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { resolve } from "@scalar/workspace-store/resolve";
|
|
2
|
-
import { compositions } from "./schema-composition.js";
|
|
3
|
-
function optimizeValueForDisplay(value) {
|
|
4
|
-
if (!value || typeof value !== "object") {
|
|
5
|
-
return value;
|
|
6
|
-
}
|
|
7
|
-
const composition = compositions.find((keyword) => keyword in value && keyword !== "not");
|
|
8
|
-
if (!composition) {
|
|
9
|
-
return { ...value };
|
|
10
|
-
}
|
|
11
|
-
const schemas = value[composition];
|
|
12
|
-
if (!Array.isArray(schemas)) {
|
|
13
|
-
return { ...value };
|
|
14
|
-
}
|
|
15
|
-
const { [composition]: _, nullable: originalNullable, ...rootProperties } = value;
|
|
16
|
-
const hasRootProperties = Object.keys(rootProperties).length > 0;
|
|
17
|
-
const { filteredSchemas, hasNullSchema } = schemas.reduce(
|
|
18
|
-
(acc, _schema) => {
|
|
19
|
-
const schema = resolve.schema(_schema);
|
|
20
|
-
if ("type" in schema && schema.type === "null") {
|
|
21
|
-
acc.hasNullSchema = true;
|
|
22
|
-
} else {
|
|
23
|
-
acc.filteredSchemas.push(schema);
|
|
24
|
-
}
|
|
25
|
-
return acc;
|
|
26
|
-
},
|
|
27
|
-
{ filteredSchemas: [], hasNullSchema: false }
|
|
28
|
-
);
|
|
29
|
-
const shouldBeNullable = hasNullSchema || originalNullable === true;
|
|
30
|
-
if (filteredSchemas.length === 1) {
|
|
31
|
-
const mergedSchema = { ...rootProperties, ...filteredSchemas[0] };
|
|
32
|
-
if (shouldBeNullable) {
|
|
33
|
-
mergedSchema.nullable = true;
|
|
34
|
-
}
|
|
35
|
-
return mergedSchema;
|
|
36
|
-
}
|
|
37
|
-
const shouldMergeRootProperties = (composition === "oneOf" || composition === "anyOf") && (hasRootProperties || filteredSchemas.some((schema) => schema.allOf));
|
|
38
|
-
if (shouldMergeRootProperties) {
|
|
39
|
-
const mergedSchemas = filteredSchemas.map((_schema) => {
|
|
40
|
-
const schema = resolve.schema(_schema);
|
|
41
|
-
if (schema.allOf?.length === 1) {
|
|
42
|
-
const { allOf, ...otherProps } = schema;
|
|
43
|
-
return { ...rootProperties, ...otherProps, ...resolve.schema(allOf[0]) };
|
|
44
|
-
}
|
|
45
|
-
return { ...rootProperties, ...schema };
|
|
46
|
-
});
|
|
47
|
-
const result = { [composition]: mergedSchemas };
|
|
48
|
-
if (shouldBeNullable) {
|
|
49
|
-
result.nullable = true;
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
if (filteredSchemas.length !== schemas.length) {
|
|
54
|
-
const result = { ...value, [composition]: filteredSchemas };
|
|
55
|
-
if (shouldBeNullable) {
|
|
56
|
-
result.nullable = true;
|
|
57
|
-
}
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
return { ...value };
|
|
61
|
-
}
|
|
62
|
-
export {
|
|
63
|
-
optimizeValueForDisplay
|
|
64
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { resolve } from "@scalar/workspace-store/resolve";
|
|
2
|
-
import { getRefName } from "./get-ref-name.js";
|
|
3
|
-
const getModelNameFromSchema = (schemaOrRef) => {
|
|
4
|
-
if (!schemaOrRef) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
const schema = resolve.schema(schemaOrRef);
|
|
8
|
-
if (schema.title) {
|
|
9
|
-
return schema.title;
|
|
10
|
-
}
|
|
11
|
-
if (schema.name) {
|
|
12
|
-
return schema.name;
|
|
13
|
-
}
|
|
14
|
-
if ("$ref" in schemaOrRef) {
|
|
15
|
-
const refName = getRefName(schemaOrRef.$ref);
|
|
16
|
-
if (refName) {
|
|
17
|
-
return refName;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
getModelNameFromSchema
|
|
24
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const shouldDisplayHeading = (schema, name, required = false) => {
|
|
2
|
-
if (name || required) {
|
|
3
|
-
return true;
|
|
4
|
-
}
|
|
5
|
-
if (!schema) {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
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;
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
shouldDisplayHeading
|
|
12
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isArraySchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
2
|
-
import { hasComplexArrayItems } from "./has-complex-array-items.js";
|
|
3
|
-
const shouldRenderArrayItemComposition = (schema, composition) => {
|
|
4
|
-
if (!schema || !isArraySchema(schema)) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
const items = schema.items;
|
|
8
|
-
if (!items || typeof items !== "object" || !(composition in items)) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
return !hasComplexArrayItems(schema);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
shouldRenderArrayItemComposition
|
|
15
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { resolve } from "@scalar/workspace-store/resolve";
|
|
2
|
-
import { isTypeObject } from "./is-type-object.js";
|
|
3
|
-
const reduceNamesToObject = (names, properties) => names.reduce((acc, name) => {
|
|
4
|
-
const prop = properties?.[name];
|
|
5
|
-
if (prop) {
|
|
6
|
-
acc[name] = prop;
|
|
7
|
-
}
|
|
8
|
-
return acc;
|
|
9
|
-
}, {});
|
|
10
|
-
const sortPropertyNames = (schema, discriminator, {
|
|
11
|
-
hideReadOnly = false,
|
|
12
|
-
hideWriteOnly = false,
|
|
13
|
-
orderSchemaPropertiesBy = "alpha",
|
|
14
|
-
orderRequiredPropertiesFirst = true
|
|
15
|
-
} = {}) => {
|
|
16
|
-
if (!isTypeObject(schema) || !schema.properties) {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
const propertyNames = Object.keys(schema.properties);
|
|
20
|
-
const requiredPropertiesSet = new Set(schema.required || []);
|
|
21
|
-
return propertyNames.sort((a, b) => {
|
|
22
|
-
const aDiscriminator = a === discriminator?.propertyName;
|
|
23
|
-
const bDiscriminator = b === discriminator?.propertyName;
|
|
24
|
-
const aRequired = requiredPropertiesSet.has(a);
|
|
25
|
-
const bRequired = requiredPropertiesSet.has(b);
|
|
26
|
-
if (aDiscriminator && !bDiscriminator) {
|
|
27
|
-
return -1;
|
|
28
|
-
}
|
|
29
|
-
if (!aDiscriminator && bDiscriminator) {
|
|
30
|
-
return 1;
|
|
31
|
-
}
|
|
32
|
-
const aSchema = schema.properties?.[a];
|
|
33
|
-
const bSchema = schema.properties?.[b];
|
|
34
|
-
const aOrder = aSchema && typeof aSchema === "object" && "x-order" in aSchema ? aSchema["x-order"] : void 0;
|
|
35
|
-
const bOrder = bSchema && typeof bSchema === "object" && "x-order" in bSchema ? bSchema["x-order"] : void 0;
|
|
36
|
-
if (aOrder !== void 0 && bOrder !== void 0) {
|
|
37
|
-
return Number(aOrder) - Number(bOrder);
|
|
38
|
-
}
|
|
39
|
-
if (aOrder !== void 0 && bOrder === void 0) {
|
|
40
|
-
return -1;
|
|
41
|
-
}
|
|
42
|
-
if (aOrder === void 0 && bOrder !== void 0) {
|
|
43
|
-
return 1;
|
|
44
|
-
}
|
|
45
|
-
if (orderRequiredPropertiesFirst) {
|
|
46
|
-
if (aRequired && !bRequired) {
|
|
47
|
-
return -1;
|
|
48
|
-
}
|
|
49
|
-
if (!aRequired && bRequired) {
|
|
50
|
-
return 1;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (orderSchemaPropertiesBy === "alpha") {
|
|
54
|
-
return a.localeCompare(b);
|
|
55
|
-
}
|
|
56
|
-
return 0;
|
|
57
|
-
}).filter((property) => {
|
|
58
|
-
const resolved = schema.properties && resolve.schema(schema.properties[property]);
|
|
59
|
-
if (hideReadOnly && resolved?.readOnly === true) {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
if (hideWriteOnly && resolved?.writeOnly === true) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
return true;
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
reduceNamesToObject,
|
|
70
|
-
sortPropertyNames
|
|
71
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createBlock, openBlock, withCtx, renderSlot } from "vue";
|
|
2
|
-
import ClassicLayout from "./components/ClassicLayout.vue.js";
|
|
3
|
-
import ModernLayout from "./components/ModernLayout.vue.js";
|
|
4
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
-
__name: "Tag",
|
|
6
|
-
props: {
|
|
7
|
-
tag: {},
|
|
8
|
-
layout: {},
|
|
9
|
-
moreThanOneTag: { type: Boolean },
|
|
10
|
-
isLoading: { type: Boolean },
|
|
11
|
-
isCollapsed: { type: Boolean },
|
|
12
|
-
eventBus: {}
|
|
13
|
-
},
|
|
14
|
-
setup(__props) {
|
|
15
|
-
return (_ctx, _cache) => {
|
|
16
|
-
return __props.layout === "classic" ? (openBlock(), createBlock(ClassicLayout, {
|
|
17
|
-
key: 0,
|
|
18
|
-
eventBus: __props.eventBus,
|
|
19
|
-
isCollapsed: __props.isCollapsed,
|
|
20
|
-
layout: __props.layout,
|
|
21
|
-
tag: __props.tag
|
|
22
|
-
}, {
|
|
23
|
-
default: withCtx(() => [
|
|
24
|
-
renderSlot(_ctx.$slots, "default")
|
|
25
|
-
]),
|
|
26
|
-
_: 3
|
|
27
|
-
}, 8, ["eventBus", "isCollapsed", "layout", "tag"])) : (openBlock(), createBlock(ModernLayout, {
|
|
28
|
-
key: 1,
|
|
29
|
-
eventBus: __props.eventBus,
|
|
30
|
-
isCollapsed: __props.isCollapsed,
|
|
31
|
-
isLoading: __props.isLoading,
|
|
32
|
-
layout: __props.layout,
|
|
33
|
-
moreThanOneTag: __props.moreThanOneTag,
|
|
34
|
-
tag: __props.tag
|
|
35
|
-
}, {
|
|
36
|
-
default: withCtx(() => [
|
|
37
|
-
renderSlot(_ctx.$slots, "default")
|
|
38
|
-
]),
|
|
39
|
-
_: 3
|
|
40
|
-
}, 8, ["eventBus", "isCollapsed", "isLoading", "layout", "moreThanOneTag", "tag"]));
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export {
|
|
45
|
-
_sfc_main as default
|
|
46
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _sfc_main from "./ClassicLayout.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const ClassicLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1124be5d"]]);
|
|
5
|
-
export {
|
|
6
|
-
ClassicLayout as default
|
|
7
|
-
};
|