@scalar/api-reference 1.48.8 → 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 +40 -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 +40748 -34662
- 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/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Content/Auth/index.d.ts +1 -1
- package/dist/components/Content/Content.vue.d.ts +2 -4
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelTag.vue.d.ts +3 -3
- package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/index.d.ts +2 -2
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- 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/SchemaProperty.vue.d.ts.map +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/components/ModernLayout.vue.d.ts +2 -2
- package/dist/components/Content/Tags/components/ModernLayout.vue.d.ts.map +1 -1
- 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/Lazy/Lazy.vue.d.ts +3 -0
- package/dist/components/Lazy/Lazy.vue.d.ts.map +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/ask-agent-button/AskAgentButton.vue.d.ts.map +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/id-routing.d.ts +4 -0
- package/dist/helpers/id-routing.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +8 -8
- package/dist/helpers/index.js +3 -24
- package/dist/helpers/lazy-bus.d.ts +19 -19
- package/dist/helpers/lazy-bus.d.ts.map +1 -1
- 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 +6840 -7397
- 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 -744
- 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 -177
- 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 -82
- 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 -145
- 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 -228
- 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 -64
- 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 -17
- 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 -47
- 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 -63
- package/dist/helpers/lazy-bus.js +0 -160
- 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
|
@@ -0,0 +1,3827 @@
|
|
|
1
|
+
import { r as useAgentContext } from "./use-agent-Bnm1de0n.js";
|
|
2
|
+
import { a as SectionHeader_default, c as SectionColumn_default, d as _plugin_vue_export_helper_default, i as SectionHeaderTag_default, l as Section_default, n as LinkList_default, o as SectionContent_default, r as SpecificationExtension_default, s as SectionColumns_default, t as ExternalDocs_default, u as Badge_default } from "./ExternalDocs-phu7GxpZ.js";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRef, toValue, unref, useId, useModel, vModelCheckbox, vModelText, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
4
|
+
import { Disclosure, DisclosureButton, DisclosurePanel, Tab, TabGroup, TabList } from "@headlessui/vue";
|
|
5
|
+
import { ScalarButton, ScalarCard, ScalarCardFooter, ScalarCardHeader, ScalarCardSection, ScalarCodeBlock, ScalarErrorBoundary, ScalarIcon, ScalarIconButton, ScalarListbox, ScalarMarkdown, ScalarMarkdownSummary, ScalarVirtualText, ScalarWrappingText, cva, useBindCx } from "@scalar/components";
|
|
6
|
+
import { useClipboard } from "@scalar/use-hooks/useClipboard";
|
|
7
|
+
import { useElementHover } from "@vueuse/core";
|
|
8
|
+
import { ScalarIconArrowUp, ScalarIconCaretDown, ScalarIconCaretRight, ScalarIconCopy, ScalarIconHash, ScalarIconLink, ScalarIconPlay, ScalarIconPlus, ScalarIconSparkle, ScalarIconWebhooksLogo } from "@scalar/icons";
|
|
9
|
+
import { getObjectKeys, getOperationStability, getOperationStabilityColor, isOperationDeprecated, normalizeMimeTypeObject, shouldIgnoreEntity } from "@scalar/oas-utils/helpers";
|
|
10
|
+
import { ExamplePicker, OperationCodeSample, getExampleFromSchema, getResolvedRefDeep } from "@scalar/api-client/v2/blocks/operation-code-sample";
|
|
11
|
+
import { combineParams, getSelectedSecurity } from "@scalar/api-client/v2/features/operation";
|
|
12
|
+
import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
13
|
+
import { resolve } from "@scalar/workspace-store/resolve";
|
|
14
|
+
import { isArraySchema, isNumberSchema, isSchema, isStringSchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
|
|
15
|
+
import { isDefined } from "@scalar/helpers/array/is-defined";
|
|
16
|
+
import { objectKeys } from "@scalar/helpers/object/object-keys";
|
|
17
|
+
import { REGEX } from "@scalar/helpers/regex/regex-helpers";
|
|
18
|
+
import { getHttpMethodInfo } from "@scalar/helpers/http/http-info";
|
|
19
|
+
import { normalizeHttpMethod } from "@scalar/helpers/http/normalize-http-method";
|
|
20
|
+
import { getExample, getSecuritySchemes } from "@scalar/api-client/v2/blocks/operation-block";
|
|
21
|
+
import { prettyPrintJson } from "@scalar/helpers/json/pretty-print-json";
|
|
22
|
+
import { isHttpMethod } from "@scalar/helpers/http/is-http-method";
|
|
23
|
+
import { objectEntries } from "@scalar/helpers/object/object-entries";
|
|
24
|
+
//#region src/components/Section/SectionAccordion.vue?vue&type=script&setup=true&lang.ts
|
|
25
|
+
var _hoisted_1$26 = { class: "section-accordion-button-content" };
|
|
26
|
+
var _hoisted_2$20 = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "section-accordion-button-actions"
|
|
29
|
+
};
|
|
30
|
+
var _hoisted_3$15 = {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "section-accordion-description"
|
|
33
|
+
};
|
|
34
|
+
var _hoisted_4$10 = { class: "section-accordion-content-card" };
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/Section/SectionAccordion.vue
|
|
37
|
+
var SectionAccordion_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
38
|
+
__name: "SectionAccordion",
|
|
39
|
+
props: {
|
|
40
|
+
transparent: { type: Boolean },
|
|
41
|
+
modelValue: { type: Boolean }
|
|
42
|
+
},
|
|
43
|
+
emits: ["update:modelValue"],
|
|
44
|
+
setup(__props, { emit: __emit }) {
|
|
45
|
+
const emit = __emit;
|
|
46
|
+
const button = ref();
|
|
47
|
+
const isHovered = useElementHover(button);
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return openBlock(), createBlock(unref(Disclosure), {
|
|
50
|
+
as: "section",
|
|
51
|
+
class: normalizeClass(["section-accordion", { "section-accordion-transparent": __props.transparent }])
|
|
52
|
+
}, {
|
|
53
|
+
default: withCtx(() => [createVNode(unref(DisclosureButton), {
|
|
54
|
+
ref_key: "button",
|
|
55
|
+
ref: button,
|
|
56
|
+
class: "section-accordion-button",
|
|
57
|
+
onClick: _cache[0] || (_cache[0] = () => emit("update:modelValue", !__props.modelValue))
|
|
58
|
+
}, {
|
|
59
|
+
default: withCtx(() => [
|
|
60
|
+
createElementVNode("div", _hoisted_1$26, [renderSlot(_ctx.$slots, "title", {}, void 0, true)]),
|
|
61
|
+
_ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_2$20, [renderSlot(_ctx.$slots, "actions", { active: unref(isHovered) || __props.modelValue }, void 0, true)])) : createCommentVNode("", true),
|
|
62
|
+
createVNode(unref(ScalarIconCaretRight), { class: normalizeClass(["section-accordion-chevron size-4.5 transition-transform", { "rotate-90": __props.modelValue }]) }, null, 8, ["class"])
|
|
63
|
+
]),
|
|
64
|
+
_: 3
|
|
65
|
+
}, 512), __props.modelValue ? (openBlock(), createBlock(unref(DisclosurePanel), {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "section-accordion-content",
|
|
68
|
+
static: ""
|
|
69
|
+
}, {
|
|
70
|
+
default: withCtx(() => [_ctx.$slots.description ? (openBlock(), createElementBlock("div", _hoisted_3$15, [renderSlot(_ctx.$slots, "description", {}, void 0, true)])) : createCommentVNode("", true), createElementVNode("div", _hoisted_4$10, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])]),
|
|
71
|
+
_: 3
|
|
72
|
+
})) : createCommentVNode("", true)]),
|
|
73
|
+
_: 3
|
|
74
|
+
}, 8, ["class"]);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}), [["__scopeId", "data-v-ff689b94"]]);
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/components/ScreenReader.vue?vue&type=script&setup=true&lang.ts
|
|
80
|
+
var _hoisted_1$25 = {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "screenreader-only"
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/ScreenReader.vue
|
|
86
|
+
var ScreenReader_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
87
|
+
__name: "ScreenReader",
|
|
88
|
+
props: { if: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: true
|
|
91
|
+
} },
|
|
92
|
+
setup(__props) {
|
|
93
|
+
return (_ctx, _cache) => {
|
|
94
|
+
return _ctx.$props.if ? (openBlock(), createElementBlock("span", _hoisted_1$25, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])) : renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}), [["__scopeId", "data-v-df2e1026"]]);
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/Anchor/Anchor.vue?vue&type=script&setup=true&lang.ts
|
|
100
|
+
var _hoisted_1$24 = ["id"];
|
|
101
|
+
var _hoisted_2$19 = { class: "relative" };
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/Anchor/Anchor.vue
|
|
104
|
+
var Anchor_default = /* @__PURE__ */ defineComponent({
|
|
105
|
+
__name: "Anchor",
|
|
106
|
+
emits: ["copyAnchorUrl"],
|
|
107
|
+
setup(__props, { emit: __emit }) {
|
|
108
|
+
const emit = __emit;
|
|
109
|
+
const labelId = useId();
|
|
110
|
+
const { cx } = useBindCx();
|
|
111
|
+
return (_ctx, _cache) => {
|
|
112
|
+
return openBlock(), createElementBlock("span", normalizeProps(guardReactiveProps(unref(cx)("group/heading word-break-all relative"))), [createElementVNode("span", {
|
|
113
|
+
id: unref(labelId),
|
|
114
|
+
class: "contents"
|
|
115
|
+
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$24), createElementVNode("span", _hoisted_2$19, [_cache[2] || (_cache[2] = createElementVNode("span", null, "", -1)), createVNode(unref(ScalarButton), {
|
|
116
|
+
"aria-describedby": unref(labelId),
|
|
117
|
+
class: "absolute top-1/2 left-0 inline-block h-fit -translate-y-1/2 px-1.5 py-1 opacity-0 group-hover/heading:opacity-100 group-has-focus-visible/heading:opacity-100",
|
|
118
|
+
variant: "ghost",
|
|
119
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => emit("copyAnchorUrl"), ["stop"]))
|
|
120
|
+
}, {
|
|
121
|
+
default: withCtx(() => [createVNode(unref(ScalarIconHash), {
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
class: "size-4.5"
|
|
124
|
+
}), createVNode(ScreenReader_default, null, {
|
|
125
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Copy link", -1)])]),
|
|
126
|
+
_: 1
|
|
127
|
+
})]),
|
|
128
|
+
_: 1
|
|
129
|
+
}, 8, ["aria-describedby"])])], 16);
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/components/Anchor/WithBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
135
|
+
var _hoisted_1$23 = ["id"];
|
|
136
|
+
var _hoisted_2$18 = { class: "sr-only" };
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/components/Anchor/WithBreadcrumb.vue
|
|
139
|
+
var WithBreadcrumb_default = /* @__PURE__ */ defineComponent({
|
|
140
|
+
__name: "WithBreadcrumb",
|
|
141
|
+
props: {
|
|
142
|
+
breadcrumb: {},
|
|
143
|
+
eventBus: {}
|
|
144
|
+
},
|
|
145
|
+
setup(__props) {
|
|
146
|
+
return (_ctx, _cache) => {
|
|
147
|
+
return __props.breadcrumb && __props.breadcrumb.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
148
|
+
key: 0,
|
|
149
|
+
id: __props.breadcrumb.join("."),
|
|
150
|
+
class: "relative scroll-mt-24"
|
|
151
|
+
}, [renderSlot(_ctx.$slots, "default"), createElementVNode("button", {
|
|
152
|
+
class: "text-c-3 hover:text-c-1 absolute -top-2 -left-4.5 flex h-[calc(100%+16px)] w-4.5 cursor-pointer items-center justify-center pr-1.5 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",
|
|
153
|
+
type: "button",
|
|
154
|
+
onClick: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.breadcrumb.join(".") }))
|
|
155
|
+
}, [createVNode(unref(ScalarIconLink), {
|
|
156
|
+
class: "size-3",
|
|
157
|
+
weight: "bold"
|
|
158
|
+
}), createElementVNode("span", _hoisted_2$18, [renderSlot(_ctx.$slots, "sr-label", {}, () => [_cache[1] || (_cache[1] = createTextVNode("Copy link to ", -1)), renderSlot(_ctx.$slots, "default")])])])], 8, _hoisted_1$23)) : renderSlot(_ctx.$slots, "default", { key: 1 });
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/features/specification-extension/helpers.ts
|
|
164
|
+
/**
|
|
165
|
+
* Utility function to extract all keys starting with 'x-' (OpenAPI extensions) from an object.
|
|
166
|
+
*
|
|
167
|
+
* @param object - The object from which to extract extension keys.
|
|
168
|
+
* @returns An object containing only the entries whose keys start with 'x-'.
|
|
169
|
+
*/
|
|
170
|
+
var getXKeysFromObject = (object) => {
|
|
171
|
+
if (!object) return {};
|
|
172
|
+
return Object.fromEntries(Object.entries(object).filter(([key]) => key.startsWith("x-")));
|
|
173
|
+
};
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/components/Content/Schema/helpers/is-type-object.ts
|
|
176
|
+
var isTypeObject = (schema) => {
|
|
177
|
+
if (schema === null || typeof schema !== "object" || Array.isArray(schema)) return false;
|
|
178
|
+
if ("oneOf" in schema || "anyOf" in schema || "allOf" in schema || "not" in schema) return false;
|
|
179
|
+
const hasType = "type" in schema;
|
|
180
|
+
if (hasType && Array.isArray(schema.type)) return schema.type.includes("object");
|
|
181
|
+
const hasTypeObject = hasType && schema.type === "object";
|
|
182
|
+
if (hasTypeObject) return true;
|
|
183
|
+
if (hasType && !hasTypeObject) return false;
|
|
184
|
+
const hasProperties = "properties" in schema;
|
|
185
|
+
const hasAdditionalProperties = "additionalProperties" in schema;
|
|
186
|
+
const hasPatternProperties = "patternProperties" in schema;
|
|
187
|
+
return hasProperties || hasAdditionalProperties || hasPatternProperties;
|
|
188
|
+
};
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/components/Content/Schema/helpers/is-empty-schema-object.ts
|
|
191
|
+
/**
|
|
192
|
+
* Determines if the given schema is an empty object schema.
|
|
193
|
+
* An empty object schema is defined as a schema with type 'object'
|
|
194
|
+
* and no defined properties, no additionalProperties (or set to false), and no patternProperties.
|
|
195
|
+
*/
|
|
196
|
+
var isEmptySchemaObject = (schema) => {
|
|
197
|
+
if (!isTypeObject(schema)) return false;
|
|
198
|
+
const hasNoProperties = Object.keys(schema.properties ?? {}).length === 0;
|
|
199
|
+
const hasNoAdditionalProperties = schema.additionalProperties === void 0 || schema.additionalProperties === false;
|
|
200
|
+
const hasNoPatternProperties = Object.keys(schema.patternProperties ?? {}).length === 0;
|
|
201
|
+
return hasNoProperties && hasNoAdditionalProperties && hasNoPatternProperties;
|
|
202
|
+
};
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/components/Content/Schema/SchemaHeading.vue?vue&type=script&setup=true&lang.ts
|
|
205
|
+
var _hoisted_1$22 = {
|
|
206
|
+
key: 0,
|
|
207
|
+
class: "schema-type"
|
|
208
|
+
};
|
|
209
|
+
var _hoisted_2$17 = ["title"];
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/components/Content/Schema/SchemaHeading.vue
|
|
212
|
+
var SchemaHeading_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
213
|
+
__name: "SchemaHeading",
|
|
214
|
+
props: {
|
|
215
|
+
value: {},
|
|
216
|
+
name: {}
|
|
217
|
+
},
|
|
218
|
+
setup(__props) {
|
|
219
|
+
/** Generate a failsafe type from the properties when we don't have one */
|
|
220
|
+
const failsafeType = computed(() => {
|
|
221
|
+
if ("type" in __props.value) return __props.value.type;
|
|
222
|
+
if (__props.value.enum) return "enum";
|
|
223
|
+
if (isArraySchema(__props.value) && __props.value.items) return "array";
|
|
224
|
+
if (isTypeObject(__props.value) && (__props.value.properties || __props.value.additionalProperties)) return "object";
|
|
225
|
+
return "unknown";
|
|
226
|
+
});
|
|
227
|
+
return (_ctx, _cache) => {
|
|
228
|
+
return typeof __props.value === "object" ? (openBlock(), createElementBlock("span", _hoisted_1$22, [createElementVNode("span", {
|
|
229
|
+
class: "schema-type-icon",
|
|
230
|
+
title: "type" in __props.value && typeof __props.value.type === "string" ? __props.value.type : "type" in __props.value && Array.isArray(__props.value.type) ? __props.value.type.join(" | ") : "unknown type"
|
|
231
|
+
}, [
|
|
232
|
+
unref(isTypeObject)(__props.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" {} ")], 64)) : createCommentVNode("", true),
|
|
233
|
+
unref(isArraySchema)(__props.value) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" [] ")], 64)) : createCommentVNode("", true),
|
|
234
|
+
__props.value.enum ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(" enum ")], 64)) : createCommentVNode("", true)
|
|
235
|
+
], 8, _hoisted_2$17), __props.name ? (openBlock(), createBlock(unref(ScalarWrappingText), {
|
|
236
|
+
key: 0,
|
|
237
|
+
text: __props.name,
|
|
238
|
+
preset: "property"
|
|
239
|
+
}, null, 8, ["text"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(failsafeType.value), 1)], 64))])) : createCommentVNode("", true);
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}), [["__scopeId", "data-v-70cb5c13"]]);
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/components/Content/Schema/helpers/sort-property-names.ts
|
|
245
|
+
/** Take a list of property names and reduce it back into an object */
|
|
246
|
+
var reduceNamesToObject = (names, properties) => names.reduce((acc, name) => {
|
|
247
|
+
const prop = properties?.[name];
|
|
248
|
+
if (prop) acc[name] = prop;
|
|
249
|
+
return acc;
|
|
250
|
+
}, {});
|
|
251
|
+
/** Sort property names in an object schema */
|
|
252
|
+
var sortPropertyNames = (schema, discriminator, { hideReadOnly = false, hideWriteOnly = false, orderSchemaPropertiesBy = "alpha", orderRequiredPropertiesFirst = true } = {}) => {
|
|
253
|
+
if (!isTypeObject(schema) || !schema.properties) return [];
|
|
254
|
+
const propertyNames = Object.keys(schema.properties);
|
|
255
|
+
const requiredPropertiesSet = new Set(schema.required || []);
|
|
256
|
+
return propertyNames.sort((a, b) => {
|
|
257
|
+
const aDiscriminator = a === discriminator?.propertyName;
|
|
258
|
+
const bDiscriminator = b === discriminator?.propertyName;
|
|
259
|
+
const aRequired = requiredPropertiesSet.has(a);
|
|
260
|
+
const bRequired = requiredPropertiesSet.has(b);
|
|
261
|
+
if (aDiscriminator && !bDiscriminator) return -1;
|
|
262
|
+
if (!aDiscriminator && bDiscriminator) return 1;
|
|
263
|
+
const aSchema = schema.properties?.[a];
|
|
264
|
+
const bSchema = schema.properties?.[b];
|
|
265
|
+
const aOrder = aSchema && typeof aSchema === "object" && "x-order" in aSchema ? aSchema["x-order"] : void 0;
|
|
266
|
+
const bOrder = bSchema && typeof bSchema === "object" && "x-order" in bSchema ? bSchema["x-order"] : void 0;
|
|
267
|
+
if (aOrder !== void 0 && bOrder !== void 0) return Number(aOrder) - Number(bOrder);
|
|
268
|
+
if (aOrder !== void 0 && bOrder === void 0) return -1;
|
|
269
|
+
if (aOrder === void 0 && bOrder !== void 0) return 1;
|
|
270
|
+
if (orderRequiredPropertiesFirst) {
|
|
271
|
+
if (aRequired && !bRequired) return -1;
|
|
272
|
+
if (!aRequired && bRequired) return 1;
|
|
273
|
+
}
|
|
274
|
+
if (orderSchemaPropertiesBy === "alpha") return a.localeCompare(b);
|
|
275
|
+
return 0;
|
|
276
|
+
}).filter((property) => {
|
|
277
|
+
const resolved = schema.properties && resolve.schema(schema.properties[property]);
|
|
278
|
+
if (hideReadOnly && resolved?.readOnly === true) return false;
|
|
279
|
+
if (hideWriteOnly && resolved?.writeOnly === true) return false;
|
|
280
|
+
return true;
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region src/components/Content/Schema/helpers/schema-composition.ts
|
|
285
|
+
var compositions = [
|
|
286
|
+
"oneOf",
|
|
287
|
+
"anyOf",
|
|
288
|
+
"allOf",
|
|
289
|
+
"not"
|
|
290
|
+
];
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/components/Content/Schema/helpers/has-complex-array-items.ts
|
|
293
|
+
/** Composition keywords that indicate complex schema structure */
|
|
294
|
+
var COMPOSITION_KEYWORDS = [
|
|
295
|
+
"allOf",
|
|
296
|
+
"oneOf",
|
|
297
|
+
"anyOf"
|
|
298
|
+
];
|
|
299
|
+
/**
|
|
300
|
+
* Checks if a schema has object type (either explicit type: 'object' or has properties)
|
|
301
|
+
*/
|
|
302
|
+
var isObjectType = (schema) => {
|
|
303
|
+
if ("type" in schema && schema.type) {
|
|
304
|
+
if (Array.isArray(schema.type)) return schema.type.includes("object");
|
|
305
|
+
return schema.type === "object";
|
|
306
|
+
}
|
|
307
|
+
return "properties" in schema;
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Checks if a schema has complex features (refs, compositions, discriminators)
|
|
311
|
+
*/
|
|
312
|
+
var hasComplexFeatures = (schema) => "$ref" in schema || "discriminator" in schema || COMPOSITION_KEYWORDS.some((keyword) => keyword in schema);
|
|
313
|
+
/**
|
|
314
|
+
* Checks if nested array items are complex
|
|
315
|
+
*/
|
|
316
|
+
var hasComplexNestedArrayItems = (items) => {
|
|
317
|
+
if (!isArraySchema(items) || typeof items.items !== "object") return false;
|
|
318
|
+
if ("$ref" in items.items) return true;
|
|
319
|
+
const nestedItems = getResolvedRef(items.items);
|
|
320
|
+
if (!nestedItems) return false;
|
|
321
|
+
return isObjectType(nestedItems) || hasComplexFeatures(nestedItems) || isArraySchema(nestedItems);
|
|
322
|
+
};
|
|
323
|
+
/**
|
|
324
|
+
* Checks if array items have complex structure
|
|
325
|
+
* like: objects, references, discriminators, compositions, or nested arrays with complex items
|
|
326
|
+
*
|
|
327
|
+
* @param value - The schema object to check
|
|
328
|
+
* @returns true if the array has complex items, false otherwise
|
|
329
|
+
*/
|
|
330
|
+
var hasComplexArrayItems = (value) => {
|
|
331
|
+
if (!value || !isArraySchema(value) || typeof value.items !== "object") return false;
|
|
332
|
+
if ("$ref" in value.items) return true;
|
|
333
|
+
const items = getResolvedRef(value.items);
|
|
334
|
+
if (!items) return false;
|
|
335
|
+
if (hasComplexFeatures(items)) return true;
|
|
336
|
+
if (isObjectType(items)) return true;
|
|
337
|
+
return hasComplexNestedArrayItems(items);
|
|
338
|
+
};
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region src/components/Content/Schema/helpers/should-render-array-item-composition.ts
|
|
341
|
+
/**
|
|
342
|
+
* Check if array item composition should be rendered
|
|
343
|
+
*
|
|
344
|
+
* @param schema - The schema object to check
|
|
345
|
+
* @param composition - The composition keyword to check for
|
|
346
|
+
* @returns true if array item composition should be rendered, false otherwise
|
|
347
|
+
*/
|
|
348
|
+
var shouldRenderArrayItemComposition = (schema, composition) => {
|
|
349
|
+
if (!schema || !isArraySchema(schema)) return false;
|
|
350
|
+
const items = schema.items;
|
|
351
|
+
if (!items || typeof items !== "object" || !(composition in items)) return false;
|
|
352
|
+
return !hasComplexArrayItems(schema);
|
|
353
|
+
};
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/components/Content/Schema/helpers/get-compositions-to-render.ts
|
|
356
|
+
/**
|
|
357
|
+
* Computes which compositions should be rendered and with which values
|
|
358
|
+
*
|
|
359
|
+
* @param value - The schema object to check for compositions
|
|
360
|
+
* @returns Array of compositions to render with their values
|
|
361
|
+
*/
|
|
362
|
+
var getCompositionsToRender = (value) => {
|
|
363
|
+
if (!value) return [];
|
|
364
|
+
return compositions.map((composition) => {
|
|
365
|
+
if (shouldRenderArrayItemComposition(value, composition) && isArraySchema(value) && value.items) return {
|
|
366
|
+
composition,
|
|
367
|
+
value: resolve.schema(value.items)
|
|
368
|
+
};
|
|
369
|
+
if (value[composition]) {
|
|
370
|
+
if (!(isArraySchema(value) && value.items && typeof value.items === "object" && composition in value.items)) return {
|
|
371
|
+
composition,
|
|
372
|
+
value: resolve.schema(value)
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
return null;
|
|
376
|
+
}).filter(isDefined);
|
|
377
|
+
};
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/components/Content/Schema/helpers/get-enum-values.ts
|
|
380
|
+
/**
|
|
381
|
+
* Extract enum values from schema or array items
|
|
382
|
+
*
|
|
383
|
+
* @param value - The schema object to extract enum values from
|
|
384
|
+
* @returns Array of enum values, or empty array if no enum found
|
|
385
|
+
*/
|
|
386
|
+
var getEnumValues = (value) => {
|
|
387
|
+
if (!value) return [];
|
|
388
|
+
if (value.enum) return value.enum;
|
|
389
|
+
if (isArraySchema(value) && typeof value.items === "object") {
|
|
390
|
+
const resolvedItems = resolve.schema(value.items);
|
|
391
|
+
if (resolvedItems && "enum" in resolvedItems && resolvedItems.enum) return resolvedItems.enum;
|
|
392
|
+
}
|
|
393
|
+
return [];
|
|
394
|
+
};
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/components/Content/Schema/helpers/get-property-description.ts
|
|
397
|
+
var TYPE_DESCRIPTIONS = {
|
|
398
|
+
integer: {
|
|
399
|
+
_default: "Integer numbers.",
|
|
400
|
+
int32: "Signed 32-bit integers (commonly used integer type).",
|
|
401
|
+
int64: "Signed 64-bit integers (long type)."
|
|
402
|
+
},
|
|
403
|
+
string: {
|
|
404
|
+
"date": "full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21",
|
|
405
|
+
"date-time": "the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z",
|
|
406
|
+
"password": "a hint to UIs to mask the input",
|
|
407
|
+
"base64": "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
|
|
408
|
+
"byte": "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
|
|
409
|
+
"binary": "binary data, used to describe files"
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Generate property description from type/format
|
|
414
|
+
*
|
|
415
|
+
* @param value - The schema object to generate description from
|
|
416
|
+
* @returns Description string or null if no description available
|
|
417
|
+
*/
|
|
418
|
+
var getPropertyDescription = (value) => {
|
|
419
|
+
if (!isSchema(value)) return null;
|
|
420
|
+
/** Just grab the first type from the array if it's an array */
|
|
421
|
+
const type = Array.isArray(value.type) ? value.type[0] : value.type;
|
|
422
|
+
if (!type) return null;
|
|
423
|
+
const typeDescriptions = TYPE_DESCRIPTIONS[type];
|
|
424
|
+
if (!typeDescriptions) return null;
|
|
425
|
+
return typeDescriptions["format" in value && value.format || "contentEncoding" in value && value.contentEncoding || "_default"] ?? null;
|
|
426
|
+
};
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region src/components/Content/Schema/helpers/optimize-value-for-display.ts
|
|
429
|
+
/**
|
|
430
|
+
* Optimize the value by removing nulls from compositions and merging root properties.
|
|
431
|
+
*
|
|
432
|
+
* TODO: figure out what this does
|
|
433
|
+
*/
|
|
434
|
+
function optimizeValueForDisplay(value) {
|
|
435
|
+
if (!value || typeof value !== "object") return value;
|
|
436
|
+
const composition = compositions.find((keyword) => keyword in value && keyword !== "not");
|
|
437
|
+
if (!composition) return { ...value };
|
|
438
|
+
const schemas = value[composition];
|
|
439
|
+
if (!Array.isArray(schemas)) return { ...value };
|
|
440
|
+
const { [composition]: _, nullable: originalNullable, ...rootProperties } = value;
|
|
441
|
+
const hasRootProperties = Object.keys(rootProperties).length > 0;
|
|
442
|
+
const { filteredSchemas, hasNullSchema } = schemas.reduce((acc, _schema) => {
|
|
443
|
+
const schema = resolve.schema(_schema);
|
|
444
|
+
if ("type" in schema && schema.type === "null") acc.hasNullSchema = true;
|
|
445
|
+
else acc.filteredSchemas.push(schema);
|
|
446
|
+
return acc;
|
|
447
|
+
}, {
|
|
448
|
+
filteredSchemas: [],
|
|
449
|
+
hasNullSchema: false
|
|
450
|
+
});
|
|
451
|
+
const shouldBeNullable = hasNullSchema || originalNullable === true;
|
|
452
|
+
if (filteredSchemas.length === 1) {
|
|
453
|
+
const mergedSchema = {
|
|
454
|
+
...rootProperties,
|
|
455
|
+
...filteredSchemas[0]
|
|
456
|
+
};
|
|
457
|
+
if (shouldBeNullable) mergedSchema.nullable = true;
|
|
458
|
+
return mergedSchema;
|
|
459
|
+
}
|
|
460
|
+
if ((composition === "oneOf" || composition === "anyOf") && (hasRootProperties || filteredSchemas.some((schema) => schema.allOf))) {
|
|
461
|
+
const mergedSchemas = filteredSchemas.map((_schema) => {
|
|
462
|
+
const schema = resolve.schema(_schema);
|
|
463
|
+
if (schema.allOf?.length === 1) {
|
|
464
|
+
const { allOf, ...otherProps } = schema;
|
|
465
|
+
return {
|
|
466
|
+
...rootProperties,
|
|
467
|
+
...otherProps,
|
|
468
|
+
...resolve.schema(allOf[0])
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
return {
|
|
472
|
+
...rootProperties,
|
|
473
|
+
...schema
|
|
474
|
+
};
|
|
475
|
+
});
|
|
476
|
+
const result = { [composition]: mergedSchemas };
|
|
477
|
+
if (shouldBeNullable) result.nullable = true;
|
|
478
|
+
return result;
|
|
479
|
+
}
|
|
480
|
+
if (filteredSchemas.length !== schemas.length) {
|
|
481
|
+
const result = {
|
|
482
|
+
...value,
|
|
483
|
+
[composition]: filteredSchemas
|
|
484
|
+
};
|
|
485
|
+
if (shouldBeNullable) result.nullable = true;
|
|
486
|
+
return result;
|
|
487
|
+
}
|
|
488
|
+
return { ...value };
|
|
489
|
+
}
|
|
490
|
+
//#endregion
|
|
491
|
+
//#region src/components/Content/Schema/helpers/should-display-description.ts
|
|
492
|
+
/**
|
|
493
|
+
* Determine if description should be displayed
|
|
494
|
+
*
|
|
495
|
+
* @param schema - The schema object to check
|
|
496
|
+
* @param propDescription - Optional description from props
|
|
497
|
+
* @returns Description string to display, or null if should not be displayed
|
|
498
|
+
*/
|
|
499
|
+
var shouldDisplayDescription = (schema, propDescription) => {
|
|
500
|
+
if (!schema) return null;
|
|
501
|
+
if (schema.allOf) return null;
|
|
502
|
+
return propDescription || schema.description || null;
|
|
503
|
+
};
|
|
504
|
+
//#endregion
|
|
505
|
+
//#region src/components/Content/Schema/helpers/should-display-heading.ts
|
|
506
|
+
/**
|
|
507
|
+
* Determine if property heading should be displayed
|
|
508
|
+
*
|
|
509
|
+
* @param schema - The schema object to check
|
|
510
|
+
* @param name - Optional property name
|
|
511
|
+
* @param required - Whether the property is required
|
|
512
|
+
* @returns true if heading should be displayed, false otherwise
|
|
513
|
+
*/
|
|
514
|
+
var shouldDisplayHeading = (schema, name, required = false) => {
|
|
515
|
+
if (name || required) return true;
|
|
516
|
+
if (!schema) return false;
|
|
517
|
+
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;
|
|
518
|
+
};
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region src/components/Content/Schema/helpers/get-schema-type.ts
|
|
521
|
+
/**
|
|
522
|
+
* Formats an array type string with proper wrapping for union types.
|
|
523
|
+
*/
|
|
524
|
+
var formatArrayType = (itemType) => {
|
|
525
|
+
if (!itemType) return "array";
|
|
526
|
+
return `array ${itemType.includes(" | ") ? `(${itemType})` : itemType}[]`;
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* Handles array type processing for both single array types and union types containing array.
|
|
530
|
+
*/
|
|
531
|
+
var processArrayType = (value, isUnionType = false) => {
|
|
532
|
+
if (!value.items) return "array";
|
|
533
|
+
const baseType = formatArrayType(getSchemaType(resolve.schema(value.items)));
|
|
534
|
+
if (isUnionType) return baseType;
|
|
535
|
+
return value.nullable ? `${baseType} | null` : baseType;
|
|
536
|
+
};
|
|
537
|
+
/**
|
|
538
|
+
* Computes the structural type for a schema.
|
|
539
|
+
* This helper always returns type information, never schema titles or ref names.
|
|
540
|
+
*
|
|
541
|
+
* Priority order:
|
|
542
|
+
* 1. const values
|
|
543
|
+
* 2. Array types (with special handling for items)
|
|
544
|
+
* 3. type with contentEncoding
|
|
545
|
+
* 4. raw type
|
|
546
|
+
*/
|
|
547
|
+
var getSchemaType = (valueOrRef) => {
|
|
548
|
+
if (!valueOrRef) return "";
|
|
549
|
+
const value = resolve.schema(valueOrRef);
|
|
550
|
+
if (value.const !== void 0) return "const";
|
|
551
|
+
if ("type" in value && Array.isArray(value.type)) {
|
|
552
|
+
if (value.type.includes("array") && value.items) {
|
|
553
|
+
const arrayType = processArrayType(value, true);
|
|
554
|
+
const otherTypes = value.type.filter((t) => t !== "array");
|
|
555
|
+
return otherTypes.length > 0 ? `${arrayType} | ${otherTypes.join(" | ")}` : arrayType;
|
|
556
|
+
}
|
|
557
|
+
return value.type.join(" | ");
|
|
558
|
+
}
|
|
559
|
+
if (isArraySchema(value)) return processArrayType(value, false);
|
|
560
|
+
if ("type" in value && value.type && value.contentEncoding) return `${value.type} • ${value.contentEncoding}`;
|
|
561
|
+
return "type" in value ? value.type : "";
|
|
562
|
+
};
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region src/components/Content/Schema/helpers/merge-all-of-schemas.ts
|
|
565
|
+
/**
|
|
566
|
+
* Merges multiple OpenAPI schema objects into a single schema object.
|
|
567
|
+
* Handles nested allOf compositions and merges properties recursively.
|
|
568
|
+
*
|
|
569
|
+
* @param schemas - Array of OpenAPI schema objects to merge
|
|
570
|
+
* @param rootSchema - Optional root schema to merge with the result
|
|
571
|
+
* @returns Merged schema object
|
|
572
|
+
*/
|
|
573
|
+
var mergeAllOfSchemas = (schemas, rootSchema) => {
|
|
574
|
+
if (!schemas?.allOf?.length || !Array.isArray(schemas.allOf)) return rootSchema || {};
|
|
575
|
+
const result = {};
|
|
576
|
+
const { allOf: _, ...baseSchema } = schemas;
|
|
577
|
+
for (const _schema of schemas.allOf) {
|
|
578
|
+
if (!_schema || typeof _schema !== "object") continue;
|
|
579
|
+
const schema = resolve.schema(_schema);
|
|
580
|
+
if (schema.allOf) {
|
|
581
|
+
mergeSchemaIntoResult(result, mergeAllOfSchemas(schema));
|
|
582
|
+
continue;
|
|
583
|
+
}
|
|
584
|
+
mergeSchemaIntoResult(result, schema);
|
|
585
|
+
}
|
|
586
|
+
if (Object.keys(baseSchema).length > 0) mergeSchemaIntoResult(result, baseSchema, true);
|
|
587
|
+
if (rootSchema && typeof rootSchema === "object") if (rootSchema.allOf) mergeSchemaIntoResult(result, mergeAllOfSchemas(rootSchema), true);
|
|
588
|
+
else mergeSchemaIntoResult(result, rootSchema, true);
|
|
589
|
+
return result;
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* Efficiently merges a source schema into a target result object.
|
|
593
|
+
* Handles all schema merging logic in a single optimized function.
|
|
594
|
+
*
|
|
595
|
+
* @param result - The target schema object to merge into
|
|
596
|
+
* @param schema - The source schema object to merge from
|
|
597
|
+
* @param override - Whether to override existing properties (default: false)
|
|
598
|
+
*/
|
|
599
|
+
var mergeSchemaIntoResult = (result, schema, override = false) => {
|
|
600
|
+
const schemaKeys = objectKeys(schema);
|
|
601
|
+
if (schemaKeys.length === 0) return;
|
|
602
|
+
for (const key of schemaKeys) {
|
|
603
|
+
const value = getResolvedRef(schema[key]);
|
|
604
|
+
if (value === void 0) continue;
|
|
605
|
+
if (key === "required") {
|
|
606
|
+
if (Array.isArray(value) && value.length > 0) if (result.required?.length) result.required = [...new Set([...result.required, ...value])];
|
|
607
|
+
else result.required = value.slice();
|
|
608
|
+
} else if (key === "properties") {
|
|
609
|
+
if (value && typeof value === "object") {
|
|
610
|
+
if (!result.properties) result.properties = {};
|
|
611
|
+
mergePropertiesIntoResult(result.properties, value);
|
|
612
|
+
}
|
|
613
|
+
} else if (key === "items") {
|
|
614
|
+
const items = resolve.schema(value);
|
|
615
|
+
if (items) {
|
|
616
|
+
if (isArraySchema(schema)) {
|
|
617
|
+
if (!result.items) result.items = {};
|
|
618
|
+
if (items.allOf) {
|
|
619
|
+
const mergedItems = mergeAllOfSchemas(items);
|
|
620
|
+
Object.assign(result.items, mergedItems);
|
|
621
|
+
} else mergeItemsIntoResult(getResolvedRef(result.items), items);
|
|
622
|
+
} else if (items.allOf) {
|
|
623
|
+
const mergedItems = mergeAllOfSchemas(items);
|
|
624
|
+
if ("properties" in mergedItems) {
|
|
625
|
+
if (!("properties" in result)) result.properties = {};
|
|
626
|
+
"properties" in result && mergePropertiesIntoResult(result.properties, mergedItems.properties);
|
|
627
|
+
}
|
|
628
|
+
} else if (!("items" in result)) result.items = items;
|
|
629
|
+
}
|
|
630
|
+
} else if (key === "enum") {
|
|
631
|
+
if (Array.isArray(value) && value.length > 0) result.enum = [...new Set([...result.enum || [], ...value])];
|
|
632
|
+
} else if (key === "oneOf" || key === "anyOf") {
|
|
633
|
+
if (Array.isArray(value)) {
|
|
634
|
+
if (!("properties" in result)) result.properties = {};
|
|
635
|
+
for (const _option of value) {
|
|
636
|
+
const option = resolve.schema(_option);
|
|
637
|
+
if (option && "properties" in option && "properties" in result) mergePropertiesIntoResult(result.properties, option.properties);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
} else if (key === "allOf") continue;
|
|
641
|
+
else if (override || result[key] === void 0) result[key] = value;
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
/**
|
|
645
|
+
* Efficiently merges properties into a result object without creating new objects.
|
|
646
|
+
*/
|
|
647
|
+
var mergePropertiesIntoResult = (result, properties) => {
|
|
648
|
+
const propertyKeys = Object.keys(properties ?? {});
|
|
649
|
+
if (!properties || !result || propertyKeys.length === 0) return;
|
|
650
|
+
for (const key of propertyKeys) {
|
|
651
|
+
const schema = resolve.schema(properties[key]);
|
|
652
|
+
if (!schema) {
|
|
653
|
+
delete result[key];
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
if (typeof schema !== "object") {
|
|
657
|
+
result[key] = schema;
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
if (!result[key]) {
|
|
661
|
+
if (schema.allOf) result[key] = mergeAllOfSchemas(schema);
|
|
662
|
+
else if (isArraySchema(schema) && resolve.schema(schema.items)?.allOf) result[key] = {
|
|
663
|
+
...schema,
|
|
664
|
+
items: mergeAllOfSchemas(resolve.schema(schema.items))
|
|
665
|
+
};
|
|
666
|
+
else if (properties[key]) result[key] = properties[key];
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
const existing = resolve.schema(result[key]);
|
|
670
|
+
if (schema.allOf) result[key] = mergeAllOfSchemas({ allOf: [existing, ...schema.allOf] });
|
|
671
|
+
else if (isArraySchema(schema) && isArraySchema(existing) && schema.items) {
|
|
672
|
+
const existingItems = resolve.schema(existing.items);
|
|
673
|
+
result[key] = {
|
|
674
|
+
...existing,
|
|
675
|
+
type: "array",
|
|
676
|
+
items: existingItems ? mergeItems(existingItems, resolve.schema(schema.items)) : resolve.schema(schema.items)
|
|
677
|
+
};
|
|
678
|
+
} else if ("properties" in existing && "properties" in schema) {
|
|
679
|
+
const merged = {
|
|
680
|
+
...existing,
|
|
681
|
+
...schema
|
|
682
|
+
};
|
|
683
|
+
merged.properties = { ...existing.properties };
|
|
684
|
+
mergePropertiesIntoResult(merged.properties, schema.properties);
|
|
685
|
+
result[key] = merged;
|
|
686
|
+
} else result[key] = {
|
|
687
|
+
...schema,
|
|
688
|
+
...existing
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
/**
|
|
693
|
+
* Efficiently merges array items into a result object.
|
|
694
|
+
*/
|
|
695
|
+
var mergeItemsIntoResult = (result, items) => {
|
|
696
|
+
if (items.allOf || result.allOf) {
|
|
697
|
+
const allOfSchemas = [];
|
|
698
|
+
if (result.allOf) for (const schema of result.allOf) allOfSchemas.push(resolve.schema(schema));
|
|
699
|
+
else allOfSchemas.push(result);
|
|
700
|
+
if (items.allOf) for (const schema of items.allOf) allOfSchemas.push(resolve.schema(schema));
|
|
701
|
+
else allOfSchemas.push(items);
|
|
702
|
+
const merged = mergeAllOfSchemas({ allOf: allOfSchemas });
|
|
703
|
+
Object.assign(result, merged);
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
Object.assign(result, items);
|
|
707
|
+
if ("properties" in result && "properties" in items) mergePropertiesIntoResult(result.properties, items.properties);
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* Helper function for merging items that returns a new object.
|
|
711
|
+
*/
|
|
712
|
+
var mergeItems = (existing, incoming) => {
|
|
713
|
+
if (existing.allOf || incoming.allOf) {
|
|
714
|
+
const allOfSchemas = [];
|
|
715
|
+
if (existing.allOf) for (const schema of existing.allOf) allOfSchemas.push(resolve.schema(schema));
|
|
716
|
+
else allOfSchemas.push(existing);
|
|
717
|
+
if (incoming.allOf) for (const schema of incoming.allOf) allOfSchemas.push(resolve.schema(schema));
|
|
718
|
+
else allOfSchemas.push(incoming);
|
|
719
|
+
return mergeAllOfSchemas({ allOf: allOfSchemas });
|
|
720
|
+
}
|
|
721
|
+
const merged = {
|
|
722
|
+
...existing,
|
|
723
|
+
...incoming
|
|
724
|
+
};
|
|
725
|
+
if ("properties" in existing && "properties" in incoming) {
|
|
726
|
+
merged.properties = { ...existing.properties };
|
|
727
|
+
mergePropertiesIntoResult(merged.properties, incoming.properties);
|
|
728
|
+
}
|
|
729
|
+
return merged;
|
|
730
|
+
};
|
|
731
|
+
//#endregion
|
|
732
|
+
//#region src/components/Content/Schema/helpers/get-ref-name.ts
|
|
733
|
+
/**
|
|
734
|
+
* Gets the "name" of the schema from the ref path
|
|
735
|
+
* TODO: this will change so fix it when the new refs are out
|
|
736
|
+
* Then add tests
|
|
737
|
+
*
|
|
738
|
+
* @example SchemaName from #/components/schemas/SchemaName
|
|
739
|
+
*/
|
|
740
|
+
var getRefName = (ref) => {
|
|
741
|
+
if (!ref) return null;
|
|
742
|
+
const match = ref.match(REGEX.REF_NAME);
|
|
743
|
+
if (match) return match[1];
|
|
744
|
+
return null;
|
|
745
|
+
};
|
|
746
|
+
//#endregion
|
|
747
|
+
//#region src/components/Content/Schema/helpers/schema-name.ts
|
|
748
|
+
/**
|
|
749
|
+
* Extract schema name from various schema formats
|
|
750
|
+
*
|
|
751
|
+
* Handles $ref, title, name, type, and schema dictionary lookup
|
|
752
|
+
*/
|
|
753
|
+
var getModelNameFromSchema = (schemaOrRef) => {
|
|
754
|
+
if (!schemaOrRef) return null;
|
|
755
|
+
const schema = resolve.schema(schemaOrRef);
|
|
756
|
+
if (schema.title) return schema.title;
|
|
757
|
+
if (schema.name) return schema.name;
|
|
758
|
+
if ("$ref" in schemaOrRef) {
|
|
759
|
+
const refName = getRefName(schemaOrRef.$ref);
|
|
760
|
+
if (refName) return refName;
|
|
761
|
+
}
|
|
762
|
+
return null;
|
|
763
|
+
};
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region src/components/Content/Schema/SchemaComposition.vue?vue&type=script&setup=true&lang.ts
|
|
766
|
+
var _hoisted_1$21 = { class: "property-rule" };
|
|
767
|
+
var _hoisted_2$16 = {
|
|
768
|
+
class: "composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border px-2.5 py-2.5 pr-3 text-left",
|
|
769
|
+
type: "button"
|
|
770
|
+
};
|
|
771
|
+
var _hoisted_3$14 = { class: "text-c-2" };
|
|
772
|
+
var _hoisted_4$9 = {
|
|
773
|
+
key: 0,
|
|
774
|
+
class: "text-red"
|
|
775
|
+
};
|
|
776
|
+
var _hoisted_5$8 = { class: "composition-panel" };
|
|
777
|
+
//#endregion
|
|
778
|
+
//#region src/components/Content/Schema/SchemaComposition.vue
|
|
779
|
+
var SchemaComposition_default = /* @__PURE__ */ defineComponent({
|
|
780
|
+
__name: "SchemaComposition",
|
|
781
|
+
props: {
|
|
782
|
+
composition: {},
|
|
783
|
+
discriminator: {},
|
|
784
|
+
name: {},
|
|
785
|
+
schema: {},
|
|
786
|
+
level: {},
|
|
787
|
+
compact: {
|
|
788
|
+
type: Boolean,
|
|
789
|
+
default: false
|
|
790
|
+
},
|
|
791
|
+
hideHeading: {
|
|
792
|
+
type: Boolean,
|
|
793
|
+
default: false
|
|
794
|
+
},
|
|
795
|
+
breadcrumb: {},
|
|
796
|
+
eventBus: {},
|
|
797
|
+
options: {}
|
|
798
|
+
},
|
|
799
|
+
setup(__props) {
|
|
800
|
+
const props = __props;
|
|
801
|
+
/** The current composition */
|
|
802
|
+
const composition = computed(() => [props.schema[props.composition]].flat().map((schema) => ({
|
|
803
|
+
value: resolve.schema(schema),
|
|
804
|
+
original: schema
|
|
805
|
+
})).filter((it) => isDefined(it.value)));
|
|
806
|
+
/**
|
|
807
|
+
* Generate listbox options for the composition selector.
|
|
808
|
+
* Each option represents a schema in the composition with a human-readable label.
|
|
809
|
+
* Prefers schema title/name over structural type when present.
|
|
810
|
+
*/
|
|
811
|
+
const listboxOptions = computed(() => composition.value.map((schema, index) => {
|
|
812
|
+
const resolved = resolve.schema(schema.original);
|
|
813
|
+
const label = (getModelNameFromSchema(resolved) ?? getSchemaType(resolved)) || "Schema";
|
|
814
|
+
return {
|
|
815
|
+
id: String(index),
|
|
816
|
+
label
|
|
817
|
+
};
|
|
818
|
+
}));
|
|
819
|
+
/**
|
|
820
|
+
* Two-way computed property for the selected option.
|
|
821
|
+
* Handles conversion between the selected index and the listbox option format.
|
|
822
|
+
*/
|
|
823
|
+
const selectedOption = ref(listboxOptions.value[0]);
|
|
824
|
+
/**
|
|
825
|
+
* Humanize composition keyword name for display.
|
|
826
|
+
* Converts camelCase to Title Case (e.g., oneOf -> One of).
|
|
827
|
+
*/
|
|
828
|
+
const humanizeType = (type) => type.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).toLowerCase().replace(/^(\w)/, (c) => c.toUpperCase());
|
|
829
|
+
/** Inside the currently selected composition */
|
|
830
|
+
const selectedComposition = computed(() => composition.value[Number(selectedOption.value?.id ?? "0")]?.value);
|
|
831
|
+
/** Controls whether the nested schema is displayed */
|
|
832
|
+
const showNestedSchema = ref(false);
|
|
833
|
+
return (_ctx, _cache) => {
|
|
834
|
+
return openBlock(), createElementBlock("div", _hoisted_1$21, [props.composition === "allOf" ? (openBlock(), createBlock(Schema_default, {
|
|
835
|
+
key: 0,
|
|
836
|
+
breadcrumb: __props.breadcrumb,
|
|
837
|
+
compact: __props.compact,
|
|
838
|
+
discriminator: __props.discriminator,
|
|
839
|
+
eventBus: __props.eventBus,
|
|
840
|
+
hideHeading: __props.hideHeading,
|
|
841
|
+
level: __props.level + 1,
|
|
842
|
+
name: __props.name,
|
|
843
|
+
noncollapsible: true,
|
|
844
|
+
options: __props.options,
|
|
845
|
+
schema: unref(mergeAllOfSchemas)(__props.schema)
|
|
846
|
+
}, null, 8, [
|
|
847
|
+
"breadcrumb",
|
|
848
|
+
"compact",
|
|
849
|
+
"discriminator",
|
|
850
|
+
"eventBus",
|
|
851
|
+
"hideHeading",
|
|
852
|
+
"level",
|
|
853
|
+
"name",
|
|
854
|
+
"options",
|
|
855
|
+
"schema"
|
|
856
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(ScalarListbox), {
|
|
857
|
+
modelValue: selectedOption.value,
|
|
858
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedOption.value = $event),
|
|
859
|
+
options: listboxOptions.value,
|
|
860
|
+
resize: ""
|
|
861
|
+
}, {
|
|
862
|
+
default: withCtx(() => [createElementVNode("button", _hoisted_2$16, [
|
|
863
|
+
createElementVNode("span", _hoisted_3$14, toDisplayString(humanizeType(props.composition)), 1),
|
|
864
|
+
createElementVNode("span", { class: normalizeClass(["composition-selector-label text-c-1", { "line-through": selectedComposition.value?.deprecated }]) }, toDisplayString(selectedOption.value?.label || "Schema"), 3),
|
|
865
|
+
selectedComposition.value?.deprecated ? (openBlock(), createElementBlock("div", _hoisted_4$9, " deprecated ")) : createCommentVNode("", true),
|
|
866
|
+
createVNode(unref(ScalarIconCaretDown))
|
|
867
|
+
])]),
|
|
868
|
+
_: 1
|
|
869
|
+
}, 8, ["modelValue", "options"]), createElementVNode("div", _hoisted_5$8, [!showNestedSchema.value && __props.level > 2 ? (openBlock(), createElementBlock("button", {
|
|
870
|
+
key: 0,
|
|
871
|
+
class: "bg-b-1 hover:bg-b-2 text-c-1 flex w-full items-center justify-center gap-2 rounded-b-lg border border-t-0 px-2 py-2 text-sm font-medium transition-colors",
|
|
872
|
+
type: "button",
|
|
873
|
+
onClick: _cache[1] || (_cache[1] = ($event) => showNestedSchema.value = true)
|
|
874
|
+
}, [_cache[2] || (_cache[2] = createTextVNode(" Show Schema Details ", -1)), createVNode(unref(ScalarIconCaretDown), { class: "h-3 w-3" })])) : (openBlock(), createBlock(Schema_default, {
|
|
875
|
+
key: 1,
|
|
876
|
+
breadcrumb: __props.breadcrumb,
|
|
877
|
+
compact: __props.compact,
|
|
878
|
+
discriminator: __props.discriminator,
|
|
879
|
+
eventBus: __props.eventBus,
|
|
880
|
+
hideHeading: __props.hideHeading,
|
|
881
|
+
level: __props.level + 1,
|
|
882
|
+
name: __props.name,
|
|
883
|
+
noncollapsible: true,
|
|
884
|
+
options: __props.options,
|
|
885
|
+
schema: selectedComposition.value
|
|
886
|
+
}, null, 8, [
|
|
887
|
+
"breadcrumb",
|
|
888
|
+
"compact",
|
|
889
|
+
"discriminator",
|
|
890
|
+
"eventBus",
|
|
891
|
+
"hideHeading",
|
|
892
|
+
"level",
|
|
893
|
+
"name",
|
|
894
|
+
"options",
|
|
895
|
+
"schema"
|
|
896
|
+
]))])], 64))]);
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region src/components/Content/Schema/SchemaEnumPropertyItem.vue?vue&type=script&setup=true&lang.ts
|
|
902
|
+
var _hoisted_1$20 = { class: "property-enum-value" };
|
|
903
|
+
var _hoisted_2$15 = { class: "property-enum-value-content" };
|
|
904
|
+
var _hoisted_3$13 = { class: "property-enum-value-label" };
|
|
905
|
+
var _hoisted_4$8 = {
|
|
906
|
+
key: 0,
|
|
907
|
+
class: "property-enum-value-description"
|
|
908
|
+
};
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/components/Content/Schema/SchemaEnumPropertyItem.vue
|
|
911
|
+
var SchemaEnumPropertyItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
912
|
+
__name: "SchemaEnumPropertyItem",
|
|
913
|
+
props: {
|
|
914
|
+
label: {},
|
|
915
|
+
description: {}
|
|
916
|
+
},
|
|
917
|
+
setup(__props) {
|
|
918
|
+
return (_ctx, _cache) => {
|
|
919
|
+
return openBlock(), createElementBlock("li", _hoisted_1$20, [createElementVNode("div", _hoisted_2$15, [createElementVNode("span", _hoisted_3$13, [createVNode(unref(ScalarWrappingText), {
|
|
920
|
+
text: __props.label,
|
|
921
|
+
preset: "property"
|
|
922
|
+
}, null, 8, ["text"])]), __props.description ? (openBlock(), createElementBlock("span", _hoisted_4$8, [createVNode(unref(ScalarMarkdown), { value: __props.description }, null, 8, ["value"])])) : createCommentVNode("", true)])]);
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
}), [["__scopeId", "data-v-f4b54bdd"]]);
|
|
926
|
+
//#endregion
|
|
927
|
+
//#region src/components/Content/Schema/SchemaEnums.vue?vue&type=script&setup=true&lang.ts
|
|
928
|
+
var _hoisted_1$19 = {
|
|
929
|
+
key: 0,
|
|
930
|
+
class: "property-enum"
|
|
931
|
+
};
|
|
932
|
+
var _hoisted_2$14 = {
|
|
933
|
+
key: 0,
|
|
934
|
+
class: "property-enum-property-names"
|
|
935
|
+
};
|
|
936
|
+
var _hoisted_3$12 = {
|
|
937
|
+
key: 1,
|
|
938
|
+
class: "property-enum-property-names"
|
|
939
|
+
};
|
|
940
|
+
var _hoisted_4$7 = { class: "property-enum-values" };
|
|
941
|
+
var _hoisted_5$7 = { key: 1 };
|
|
942
|
+
var ENUM_DISPLAY_THRESHOLD = 9;
|
|
943
|
+
var INITIAL_VISIBLE_COUNT = 5;
|
|
944
|
+
var THIN_SPACE = " ";
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/components/Content/Schema/SchemaEnums.vue
|
|
947
|
+
var SchemaEnums_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
948
|
+
__name: "SchemaEnums",
|
|
949
|
+
props: {
|
|
950
|
+
value: {},
|
|
951
|
+
propertyNames: { type: Boolean }
|
|
952
|
+
},
|
|
953
|
+
setup(__props) {
|
|
954
|
+
const enumValues = computed(() => {
|
|
955
|
+
if (!__props.value) return [];
|
|
956
|
+
return __props.value.enum || isArraySchema(__props.value) && resolve.schema(__props.value.items)?.enum || [];
|
|
957
|
+
});
|
|
958
|
+
/**
|
|
959
|
+
* Determines if we should show the long enum list UI.
|
|
960
|
+
* When there are many enum values, we initially show only a subset.
|
|
961
|
+
*/
|
|
962
|
+
const shouldUseLongListDisplay = computed(() => enumValues.value.length > ENUM_DISPLAY_THRESHOLD);
|
|
963
|
+
const initialVisibleCount = computed(() => shouldUseLongListDisplay.value ? INITIAL_VISIBLE_COUNT : enumValues.value.length);
|
|
964
|
+
const visibleEnumValues = computed(() => enumValues.value.slice(0, initialVisibleCount.value));
|
|
965
|
+
const hiddenEnumValues = computed(() => enumValues.value.slice(initialVisibleCount.value));
|
|
966
|
+
/**
|
|
967
|
+
* Gets the description for an enum value.
|
|
968
|
+
* Supports both array and object formats for x-enumDescriptions.
|
|
969
|
+
*/
|
|
970
|
+
const getEnumValueDescription = (enumValue, index) => {
|
|
971
|
+
const descriptions = __props.value?.["x-enumDescriptions"] ?? __props.value?.["x-enum-descriptions"];
|
|
972
|
+
if (!descriptions) return;
|
|
973
|
+
if (Array.isArray(descriptions)) return descriptions[index];
|
|
974
|
+
if (typeof descriptions === "object" && descriptions !== null) return descriptions[String(enumValue)];
|
|
975
|
+
};
|
|
976
|
+
/**
|
|
977
|
+
* Formats an enum value with its variable name if available.
|
|
978
|
+
* This supports both x-enum-varnames and x-enumNames extensions.
|
|
979
|
+
*/
|
|
980
|
+
const formatEnumValueWithName = (enumValue, index) => {
|
|
981
|
+
const varNames = __props.value?.["x-enum-varnames"] ?? __props.value?.["x-enumNames"];
|
|
982
|
+
const varName = Array.isArray(varNames) ? varNames[index] : void 0;
|
|
983
|
+
return varName ? `${enumValue}${THIN_SPACE}=${THIN_SPACE}${varName}` : String(enumValue);
|
|
984
|
+
};
|
|
985
|
+
/**
|
|
986
|
+
* Controls whether the hidden enum values are visible.
|
|
987
|
+
*/
|
|
988
|
+
const isExpanded = ref(false);
|
|
989
|
+
const toggleExpanded = () => {
|
|
990
|
+
isExpanded.value = !isExpanded.value;
|
|
991
|
+
};
|
|
992
|
+
return (_ctx, _cache) => {
|
|
993
|
+
return enumValues.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$19, [__props.propertyNames ? (openBlock(), createElementBlock("div", _hoisted_2$14, " property names ")) : (openBlock(), createElementBlock("div", _hoisted_3$12, " values ")), createElementVNode("ul", _hoisted_4$7, [
|
|
994
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(visibleEnumValues.value, (enumValue, index) => {
|
|
995
|
+
return openBlock(), createBlock(SchemaEnumPropertyItem_default, {
|
|
996
|
+
key: String(enumValue),
|
|
997
|
+
description: getEnumValueDescription(enumValue, index),
|
|
998
|
+
label: formatEnumValueWithName(enumValue, index)
|
|
999
|
+
}, null, 8, ["description", "label"]);
|
|
1000
|
+
}), 128)),
|
|
1001
|
+
shouldUseLongListDisplay.value && isExpanded.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(hiddenEnumValues.value, (enumValue, index) => {
|
|
1002
|
+
return openBlock(), createBlock(SchemaEnumPropertyItem_default, {
|
|
1003
|
+
key: String(enumValue),
|
|
1004
|
+
description: getEnumValueDescription(enumValue, initialVisibleCount.value + index),
|
|
1005
|
+
label: formatEnumValueWithName(enumValue, initialVisibleCount.value + index)
|
|
1006
|
+
}, null, 8, ["description", "label"]);
|
|
1007
|
+
}), 128)) : createCommentVNode("", true),
|
|
1008
|
+
shouldUseLongListDisplay.value ? (openBlock(), createElementBlock("li", _hoisted_5$7, [createVNode(unref(ScalarButton), {
|
|
1009
|
+
class: "enum-toggle-button my-2 flex h-fit gap-1 rounded-full border py-1.5 pr-2.5 pl-2 leading-none",
|
|
1010
|
+
variant: "ghost",
|
|
1011
|
+
onClick: toggleExpanded
|
|
1012
|
+
}, {
|
|
1013
|
+
default: withCtx(() => [createVNode(unref(ScalarIconPlus), {
|
|
1014
|
+
class: normalizeClass({ "rotate-45": isExpanded.value }),
|
|
1015
|
+
weight: "bold"
|
|
1016
|
+
}, null, 8, ["class"]), createTextVNode(" " + toDisplayString(isExpanded.value ? "Hide values" : "Show all values"), 1)]),
|
|
1017
|
+
_: 1
|
|
1018
|
+
})])) : createCommentVNode("", true)
|
|
1019
|
+
])])) : createCommentVNode("", true);
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
}), [["__scopeId", "data-v-55c01b89"]]);
|
|
1023
|
+
//#endregion
|
|
1024
|
+
//#region src/components/Content/Schema/RenderString.vue
|
|
1025
|
+
var RenderString_default = /* @__PURE__ */ defineComponent({
|
|
1026
|
+
__name: "RenderString",
|
|
1027
|
+
props: { value: {} },
|
|
1028
|
+
setup(__props) {
|
|
1029
|
+
/**
|
|
1030
|
+
* Give this component any data, and it tries to render a meaningful string.
|
|
1031
|
+
*
|
|
1032
|
+
* @example
|
|
1033
|
+
* <RenderString :value="1" /> => "1"
|
|
1034
|
+
* <RenderString :value="true" /> => "true"
|
|
1035
|
+
* <RenderString :value="false" /> => "false"
|
|
1036
|
+
* <RenderString :value="null" /> => "null"
|
|
1037
|
+
* <RenderString :value="undefined" /> => "undefined"
|
|
1038
|
+
* <RenderString :value="{}" /> => "{}"
|
|
1039
|
+
* <RenderString :value="[]" /> => "[]"
|
|
1040
|
+
* <RenderString :value="['a', 'b', 'c']" /> => "['a', 'b', 'c']"
|
|
1041
|
+
* <RenderString :value="() => 'hello'" /> => "() => 'hello'"
|
|
1042
|
+
* <RenderString :value="Symbol('test')" /> => "Symbol(test)"
|
|
1043
|
+
**/
|
|
1044
|
+
const valueAsString = computed(() => {
|
|
1045
|
+
if (__props.value === "") return `''`;
|
|
1046
|
+
if (__props.value === null) return "null";
|
|
1047
|
+
if (__props.value === void 0) return "undefined";
|
|
1048
|
+
return __props.value;
|
|
1049
|
+
});
|
|
1050
|
+
return (_ctx, _cache) => {
|
|
1051
|
+
return toDisplayString(valueAsString.value);
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
//#endregion
|
|
1056
|
+
//#region src/components/Content/Schema/helpers/format-value.ts
|
|
1057
|
+
/**
|
|
1058
|
+
* Converts a value to a string that can be displayed in the UI.
|
|
1059
|
+
*/
|
|
1060
|
+
function formatValue(value) {
|
|
1061
|
+
if (Array.isArray(value)) return `[${value.map((item) => {
|
|
1062
|
+
if (typeof item === "string") return `"${item.toString().trim()}"`;
|
|
1063
|
+
if (typeof item === "object") return JSON.stringify(item);
|
|
1064
|
+
if (item === void 0) return "undefined";
|
|
1065
|
+
if (item === null) return "null";
|
|
1066
|
+
return item;
|
|
1067
|
+
}).join(", ")}]`;
|
|
1068
|
+
if (value === null) return "null";
|
|
1069
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
1070
|
+
if (value === void 0) return "undefined";
|
|
1071
|
+
if (typeof value === "string") return value.trim();
|
|
1072
|
+
return value.toString().trim();
|
|
1073
|
+
}
|
|
1074
|
+
//#endregion
|
|
1075
|
+
//#region src/components/Content/Schema/SchemaPropertyDefault.vue?vue&type=script&setup=true&lang.ts
|
|
1076
|
+
var _hoisted_1$18 = {
|
|
1077
|
+
key: 0,
|
|
1078
|
+
class: "property-default"
|
|
1079
|
+
};
|
|
1080
|
+
var _hoisted_2$13 = { class: "property-default-value-list" };
|
|
1081
|
+
//#endregion
|
|
1082
|
+
//#region src/components/Content/Schema/SchemaPropertyDefault.vue
|
|
1083
|
+
var SchemaPropertyDefault_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1084
|
+
__name: "SchemaPropertyDefault",
|
|
1085
|
+
props: { value: {} },
|
|
1086
|
+
setup(__props) {
|
|
1087
|
+
const { copyToClipboard } = useClipboard();
|
|
1088
|
+
return (_ctx, _cache) => {
|
|
1089
|
+
return __props.value !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$18, [_cache[1] || (_cache[1] = createElementVNode("button", {
|
|
1090
|
+
class: "property-default-label",
|
|
1091
|
+
type: "button"
|
|
1092
|
+
}, [createElementVNode("span", null, "Default")], -1)), createElementVNode("div", _hoisted_2$13, [createElementVNode("button", {
|
|
1093
|
+
class: "property-default-value group",
|
|
1094
|
+
type: "button",
|
|
1095
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(copyToClipboard)(unref(formatValue)(__props.value)))
|
|
1096
|
+
}, [createElementVNode("span", null, toDisplayString(unref(formatValue)(__props.value)), 1), createVNode(unref(ScalarIcon), {
|
|
1097
|
+
class: "group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3",
|
|
1098
|
+
icon: "Clipboard",
|
|
1099
|
+
size: "xs"
|
|
1100
|
+
})])])])) : createCommentVNode("", true);
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
}), [["__scopeId", "data-v-4da5c70a"]]);
|
|
1104
|
+
//#endregion
|
|
1105
|
+
//#region src/components/Content/Schema/SchemaPropertyDetail.vue?vue&type=script&setup=true&lang.ts
|
|
1106
|
+
var _hoisted_1$17 = {
|
|
1107
|
+
key: 0,
|
|
1108
|
+
class: "property-detail-prefix"
|
|
1109
|
+
};
|
|
1110
|
+
var _hoisted_2$12 = {
|
|
1111
|
+
key: 1,
|
|
1112
|
+
class: "property-detail-value"
|
|
1113
|
+
};
|
|
1114
|
+
var _hoisted_3$11 = {
|
|
1115
|
+
key: 2,
|
|
1116
|
+
class: "property-detail-value"
|
|
1117
|
+
};
|
|
1118
|
+
//#endregion
|
|
1119
|
+
//#region src/components/Content/Schema/SchemaPropertyDetail.vue
|
|
1120
|
+
var SchemaPropertyDetail_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1121
|
+
__name: "SchemaPropertyDetail",
|
|
1122
|
+
props: {
|
|
1123
|
+
truncate: { type: Boolean },
|
|
1124
|
+
code: { type: Boolean }
|
|
1125
|
+
},
|
|
1126
|
+
setup(__props) {
|
|
1127
|
+
return (_ctx, _cache) => {
|
|
1128
|
+
return openBlock(), createElementBlock("span", { class: normalizeClass(["property-detail", { "property-detail-truncate": __props.truncate }]) }, [_ctx.$slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_1$17, [renderSlot(_ctx.$slots, "prefix", {}, void 0, true), _cache[0] || (_cache[0] = createTextVNode("\xA0 ", -1))])) : createCommentVNode("", true), __props.code ? (openBlock(), createElementBlock("code", _hoisted_2$12, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])) : (openBlock(), createElementBlock("span", _hoisted_3$11, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]))], 2);
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
}), [["__scopeId", "data-v-1295f965"]]);
|
|
1132
|
+
//#endregion
|
|
1133
|
+
//#region src/components/Content/Schema/helpers/format-example.ts
|
|
1134
|
+
/**
|
|
1135
|
+
* Converts an example value to a string that can be displayed in the UI.
|
|
1136
|
+
*/
|
|
1137
|
+
function formatExample(example) {
|
|
1138
|
+
if (Array.isArray(example)) return `[${example.map((item) => {
|
|
1139
|
+
if (typeof item === "string") return `"${item.toString().trim()}"`;
|
|
1140
|
+
if (typeof item === "object") return JSON.stringify(item);
|
|
1141
|
+
if (item === void 0) return "undefined";
|
|
1142
|
+
if (item === null) return "null";
|
|
1143
|
+
return item;
|
|
1144
|
+
}).join(", ")}]`;
|
|
1145
|
+
if (example === null) return "null";
|
|
1146
|
+
if (typeof example === "object") {
|
|
1147
|
+
if ("value" in example) return example.value;
|
|
1148
|
+
if ("externalValue" in example) return example.externalValue;
|
|
1149
|
+
return JSON.stringify(example);
|
|
1150
|
+
}
|
|
1151
|
+
if (example === void 0) return "undefined";
|
|
1152
|
+
if (typeof example === "string") return example.trim();
|
|
1153
|
+
return example.toString().trim();
|
|
1154
|
+
}
|
|
1155
|
+
//#endregion
|
|
1156
|
+
//#region src/components/Content/Schema/SchemaPropertyExamples.vue?vue&type=script&setup=true&lang.ts
|
|
1157
|
+
var _hoisted_1$16 = {
|
|
1158
|
+
key: 0,
|
|
1159
|
+
class: "property-example"
|
|
1160
|
+
};
|
|
1161
|
+
var _hoisted_2$11 = { class: "property-example-value-list" };
|
|
1162
|
+
var _hoisted_3$10 = {
|
|
1163
|
+
key: 1,
|
|
1164
|
+
class: "property-example"
|
|
1165
|
+
};
|
|
1166
|
+
var _hoisted_4$6 = {
|
|
1167
|
+
class: "property-example-label",
|
|
1168
|
+
type: "button"
|
|
1169
|
+
};
|
|
1170
|
+
var _hoisted_5$6 = { class: "property-example-value-list" };
|
|
1171
|
+
var _hoisted_6$4 = ["onClick"];
|
|
1172
|
+
//#endregion
|
|
1173
|
+
//#region src/components/Content/Schema/SchemaPropertyExamples.vue
|
|
1174
|
+
var SchemaPropertyExamples_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1175
|
+
__name: "SchemaPropertyExamples",
|
|
1176
|
+
props: {
|
|
1177
|
+
examples: {},
|
|
1178
|
+
example: {}
|
|
1179
|
+
},
|
|
1180
|
+
setup(__props) {
|
|
1181
|
+
const { copyToClipboard } = useClipboard();
|
|
1182
|
+
const hasSingleExample = computed(() => isDefined(__props.example));
|
|
1183
|
+
const normalizedExamples = computed(() => {
|
|
1184
|
+
if (__props.examples && typeof __props.examples === "object") return __props.examples;
|
|
1185
|
+
return {};
|
|
1186
|
+
});
|
|
1187
|
+
const hasMultipleExamples = computed(() => Object.keys(normalizedExamples.value).length > 0);
|
|
1188
|
+
const multipleExamplesLabel = computed(() => Object.keys(normalizedExamples.value).length === 1 ? "Example" : "Examples");
|
|
1189
|
+
return (_ctx, _cache) => {
|
|
1190
|
+
return openBlock(), createElementBlock(Fragment, null, [hasSingleExample.value ? (openBlock(), createElementBlock("div", _hoisted_1$16, [_cache[1] || (_cache[1] = createElementVNode("button", {
|
|
1191
|
+
class: "property-example-label",
|
|
1192
|
+
type: "button"
|
|
1193
|
+
}, [createElementVNode("span", null, "Example")], -1)), createElementVNode("div", _hoisted_2$11, [createElementVNode("button", {
|
|
1194
|
+
class: "property-example-value group",
|
|
1195
|
+
type: "button",
|
|
1196
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(copyToClipboard)(unref(formatExample)(__props.example)))
|
|
1197
|
+
}, [createElementVNode("span", null, toDisplayString(unref(formatExample)(__props.example)), 1), createVNode(unref(ScalarIcon), {
|
|
1198
|
+
class: "group-hover:text-c-1 text-c-3 ml-auto min-h-3 min-w-3",
|
|
1199
|
+
icon: "Clipboard",
|
|
1200
|
+
size: "xs"
|
|
1201
|
+
})])])])) : createCommentVNode("", true), hasMultipleExamples.value ? (openBlock(), createElementBlock("div", _hoisted_3$10, [createElementVNode("button", _hoisted_4$6, [createElementVNode("span", null, toDisplayString(multipleExamplesLabel.value), 1)]), createElementVNode("div", _hoisted_5$6, [(openBlock(true), createElementBlock(Fragment, null, renderList(normalizedExamples.value, (ex, key) => {
|
|
1202
|
+
return openBlock(), createElementBlock("button", {
|
|
1203
|
+
key,
|
|
1204
|
+
class: "property-example-value group",
|
|
1205
|
+
type: "button",
|
|
1206
|
+
onClick: ($event) => unref(copyToClipboard)(unref(formatExample)(ex))
|
|
1207
|
+
}, [createElementVNode("span", null, toDisplayString(unref(formatExample)(ex)), 1), createVNode(unref(ScalarIcon), {
|
|
1208
|
+
class: "text-c-3 group-hover:text-c-1 ml-auto min-h-3 min-w-3",
|
|
1209
|
+
icon: "Clipboard",
|
|
1210
|
+
size: "xs"
|
|
1211
|
+
})], 8, _hoisted_6$4);
|
|
1212
|
+
}), 128))])])) : createCommentVNode("", true)], 64);
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
}), [["__scopeId", "data-v-9a5f10a7"]]);
|
|
1216
|
+
//#endregion
|
|
1217
|
+
//#region src/components/Content/Schema/SchemaPropertyHeading.vue?vue&type=script&setup=true&lang.ts
|
|
1218
|
+
var _hoisted_1$15 = { class: "property-heading" };
|
|
1219
|
+
var _hoisted_2$10 = {
|
|
1220
|
+
key: 1,
|
|
1221
|
+
class: "property-discriminator"
|
|
1222
|
+
};
|
|
1223
|
+
var _hoisted_3$9 = {
|
|
1224
|
+
key: 3,
|
|
1225
|
+
class: "property-additional"
|
|
1226
|
+
};
|
|
1227
|
+
var _hoisted_4$5 = {
|
|
1228
|
+
key: 4,
|
|
1229
|
+
class: "property-deprecated"
|
|
1230
|
+
};
|
|
1231
|
+
var _hoisted_5$5 = {
|
|
1232
|
+
key: 5,
|
|
1233
|
+
class: "property-const"
|
|
1234
|
+
};
|
|
1235
|
+
var _hoisted_6$3 = {
|
|
1236
|
+
key: 7,
|
|
1237
|
+
class: "property-write-only"
|
|
1238
|
+
};
|
|
1239
|
+
var _hoisted_7$2 = {
|
|
1240
|
+
key: 8,
|
|
1241
|
+
class: "property-read-only"
|
|
1242
|
+
};
|
|
1243
|
+
var _hoisted_8$2 = {
|
|
1244
|
+
key: 9,
|
|
1245
|
+
class: "property-required"
|
|
1246
|
+
};
|
|
1247
|
+
//#endregion
|
|
1248
|
+
//#region src/components/Content/Schema/SchemaPropertyHeading.vue
|
|
1249
|
+
var SchemaPropertyHeading_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1250
|
+
__name: "SchemaPropertyHeading",
|
|
1251
|
+
props: {
|
|
1252
|
+
value: {},
|
|
1253
|
+
enum: { type: Boolean },
|
|
1254
|
+
isDiscriminator: {
|
|
1255
|
+
type: Boolean,
|
|
1256
|
+
default: false
|
|
1257
|
+
},
|
|
1258
|
+
required: {
|
|
1259
|
+
type: Boolean,
|
|
1260
|
+
default: false
|
|
1261
|
+
},
|
|
1262
|
+
additional: { type: Boolean },
|
|
1263
|
+
withExamples: {
|
|
1264
|
+
type: Boolean,
|
|
1265
|
+
default: true
|
|
1266
|
+
},
|
|
1267
|
+
hideModelNames: {
|
|
1268
|
+
type: Boolean,
|
|
1269
|
+
default: false
|
|
1270
|
+
},
|
|
1271
|
+
modelName: {}
|
|
1272
|
+
},
|
|
1273
|
+
setup(__props) {
|
|
1274
|
+
const props = __props;
|
|
1275
|
+
const valueRef = toRef(props, "value");
|
|
1276
|
+
const constValue = computed(() => {
|
|
1277
|
+
if (!valueRef.value) return;
|
|
1278
|
+
const schema = valueRef.value;
|
|
1279
|
+
if (schema.const !== void 0) return schema.const;
|
|
1280
|
+
if (schema.enum?.length === 1) return schema.enum[0];
|
|
1281
|
+
if (isArraySchema(schema) && schema.items) {
|
|
1282
|
+
const items = resolve.schema(schema.items);
|
|
1283
|
+
if (isDefined(items.const)) return items.const;
|
|
1284
|
+
if (items.enum?.length === 1) return items.enum[0];
|
|
1285
|
+
}
|
|
1286
|
+
});
|
|
1287
|
+
const validationProperties = computed(() => {
|
|
1288
|
+
if (!valueRef.value) return [];
|
|
1289
|
+
const schema = valueRef.value;
|
|
1290
|
+
const properties = [];
|
|
1291
|
+
if (isArraySchema(schema)) {
|
|
1292
|
+
if (schema.minItems || schema.maxItems) properties.push({
|
|
1293
|
+
key: "array-range",
|
|
1294
|
+
value: `${schema.minItems || ""}…${schema.maxItems || ""}`
|
|
1295
|
+
});
|
|
1296
|
+
if (schema.uniqueItems) properties.push({
|
|
1297
|
+
key: "unique-items",
|
|
1298
|
+
value: "unique!"
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
if (isStringSchema(schema)) {
|
|
1302
|
+
if (schema.minLength) properties.push({
|
|
1303
|
+
key: "min-length",
|
|
1304
|
+
prefix: "min length: ",
|
|
1305
|
+
value: schema.minLength
|
|
1306
|
+
});
|
|
1307
|
+
if (schema.maxLength) properties.push({
|
|
1308
|
+
key: "max-length",
|
|
1309
|
+
prefix: "max length: ",
|
|
1310
|
+
value: schema.maxLength
|
|
1311
|
+
});
|
|
1312
|
+
if (schema.pattern) properties.push({
|
|
1313
|
+
key: "pattern",
|
|
1314
|
+
value: schema.pattern,
|
|
1315
|
+
code: true,
|
|
1316
|
+
truncate: true
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
if (isStringSchema(schema) || isNumberSchema(schema)) {
|
|
1320
|
+
if (schema.format) properties.push({
|
|
1321
|
+
key: "format",
|
|
1322
|
+
value: schema.format,
|
|
1323
|
+
truncate: true
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
if (isNumberSchema(schema)) {
|
|
1327
|
+
if (isDefined(schema.exclusiveMinimum)) properties.push({
|
|
1328
|
+
key: "exclusive-minimum",
|
|
1329
|
+
prefix: "greater than: ",
|
|
1330
|
+
value: schema.exclusiveMinimum
|
|
1331
|
+
});
|
|
1332
|
+
if (isDefined(schema.minimum)) properties.push({
|
|
1333
|
+
key: "minimum",
|
|
1334
|
+
prefix: "min: ",
|
|
1335
|
+
value: schema.minimum
|
|
1336
|
+
});
|
|
1337
|
+
if (isDefined(schema.exclusiveMaximum)) properties.push({
|
|
1338
|
+
key: "exclusive-maximum",
|
|
1339
|
+
prefix: "less than: ",
|
|
1340
|
+
value: schema.exclusiveMaximum
|
|
1341
|
+
});
|
|
1342
|
+
if (isDefined(schema.maximum)) properties.push({
|
|
1343
|
+
key: "maximum",
|
|
1344
|
+
prefix: "max: ",
|
|
1345
|
+
value: schema.maximum
|
|
1346
|
+
});
|
|
1347
|
+
if (isDefined(schema.multipleOf)) properties.push({
|
|
1348
|
+
key: "multiple-of",
|
|
1349
|
+
prefix: "multiple of: ",
|
|
1350
|
+
value: schema.multipleOf
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
return properties;
|
|
1354
|
+
});
|
|
1355
|
+
/** Optional schema title/name shown in addition to structural type. */
|
|
1356
|
+
const displayTitle = computed(() => {
|
|
1357
|
+
if (!props.value) return null;
|
|
1358
|
+
if (props.hideModelNames) return null;
|
|
1359
|
+
if (props.modelName) return props.modelName;
|
|
1360
|
+
const modelName = getModelNameFromSchema(props.value);
|
|
1361
|
+
if (modelName) return modelName;
|
|
1362
|
+
if (isArraySchema(props.value) && props.value.items) {
|
|
1363
|
+
const itemName = getModelNameFromSchema(props.value.items);
|
|
1364
|
+
return itemName ? `${itemName}[]` : null;
|
|
1365
|
+
}
|
|
1366
|
+
return null;
|
|
1367
|
+
});
|
|
1368
|
+
/** Check if we should show the type information */
|
|
1369
|
+
const shouldShowType = computed(() => {
|
|
1370
|
+
if (!props.value || !("type" in props.value)) return false;
|
|
1371
|
+
if (props.value.type === "array") return true;
|
|
1372
|
+
return !constValue.value;
|
|
1373
|
+
});
|
|
1374
|
+
/** Get the display type */
|
|
1375
|
+
const displayType = computed(() => {
|
|
1376
|
+
if (!props.value) return "";
|
|
1377
|
+
return getSchemaType(props.value);
|
|
1378
|
+
});
|
|
1379
|
+
const exampleValue = computed(() => {
|
|
1380
|
+
if (isDefined(props.value?.example)) return props.value.example;
|
|
1381
|
+
if (props.value && isArraySchema(props.value)) {
|
|
1382
|
+
const itemsExample = resolve.schema(props.value.items)?.example;
|
|
1383
|
+
return isDefined(itemsExample) ? itemsExample : void 0;
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
return (_ctx, _cache) => {
|
|
1387
|
+
return openBlock(), createElementBlock("div", _hoisted_1$15, [
|
|
1388
|
+
_ctx.$slots.name ? (openBlock(), createElementBlock("div", {
|
|
1389
|
+
key: 0,
|
|
1390
|
+
class: normalizeClass(["property-name", { deprecated: props.value?.deprecated }])
|
|
1391
|
+
}, [renderSlot(_ctx.$slots, "name", {}, void 0, true)], 2)) : createCommentVNode("", true),
|
|
1392
|
+
props.isDiscriminator ? (openBlock(), createElementBlock("div", _hoisted_2$10, " Discriminator ")) : createCommentVNode("", true),
|
|
1393
|
+
props.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1394
|
+
shouldShowType.value ? (openBlock(), createBlock(SchemaPropertyDetail_default, {
|
|
1395
|
+
key: 0,
|
|
1396
|
+
truncate: ""
|
|
1397
|
+
}, {
|
|
1398
|
+
default: withCtx(() => [createVNode(ScreenReader_default, null, {
|
|
1399
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Type: ", -1)])]),
|
|
1400
|
+
_: 1
|
|
1401
|
+
}), createTextVNode(toDisplayString(displayType.value) + toDisplayString(displayTitle.value ? ` · ${displayTitle.value}` : ""), 1)]),
|
|
1402
|
+
_: 1
|
|
1403
|
+
})) : createCommentVNode("", true),
|
|
1404
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(validationProperties.value, (property) => {
|
|
1405
|
+
return openBlock(), createBlock(SchemaPropertyDetail_default, {
|
|
1406
|
+
key: property.key,
|
|
1407
|
+
code: property.code,
|
|
1408
|
+
truncate: property.truncate
|
|
1409
|
+
}, createSlots({
|
|
1410
|
+
default: withCtx(() => [property.key === "format" ? (openBlock(), createBlock(ScreenReader_default, { key: 0 }, {
|
|
1411
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Format:", -1)])]),
|
|
1412
|
+
_: 1
|
|
1413
|
+
})) : property.key === "pattern" ? (openBlock(), createBlock(ScreenReader_default, { key: 1 }, {
|
|
1414
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Pattern: ", -1)])]),
|
|
1415
|
+
_: 1
|
|
1416
|
+
})) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(property.value), 1)]),
|
|
1417
|
+
_: 2
|
|
1418
|
+
}, [property.prefix ? {
|
|
1419
|
+
name: "prefix",
|
|
1420
|
+
fn: withCtx(() => [createTextVNode(toDisplayString(property.prefix), 1)]),
|
|
1421
|
+
key: "0"
|
|
1422
|
+
} : void 0]), 1032, ["code", "truncate"]);
|
|
1423
|
+
}), 128)),
|
|
1424
|
+
props.enum ? (openBlock(), createBlock(SchemaPropertyDetail_default, { key: 1 }, {
|
|
1425
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("enum", -1)])]),
|
|
1426
|
+
_: 1
|
|
1427
|
+
})) : createCommentVNode("", true)
|
|
1428
|
+
], 64)) : createCommentVNode("", true),
|
|
1429
|
+
props.additional ? (openBlock(), createElementBlock("div", _hoisted_3$9, [props.value?.["x-additionalPropertiesName"] ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(props.value["x-additionalPropertiesName"]), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode("additional properties")], 64))])) : createCommentVNode("", true),
|
|
1430
|
+
props.value?.deprecated ? (openBlock(), createElementBlock("div", _hoisted_4$5, [createVNode(unref(Badge_default), null, {
|
|
1431
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("deprecated", -1)])]),
|
|
1432
|
+
_: 1
|
|
1433
|
+
})])) : createCommentVNode("", true),
|
|
1434
|
+
constValue.value !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_5$5, [createVNode(SchemaPropertyDetail_default, { truncate: "" }, {
|
|
1435
|
+
prefix: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("const: ", -1)])]),
|
|
1436
|
+
default: withCtx(() => [createVNode(RenderString_default, { value: constValue.value }, null, 8, ["value"])]),
|
|
1437
|
+
_: 1
|
|
1438
|
+
})])) : (openBlock(), createElementBlock(Fragment, { key: 6 }, [props.value?.nullable === true ? (openBlock(), createBlock(SchemaPropertyDetail_default, { key: 0 }, {
|
|
1439
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode(" nullable ", -1)])]),
|
|
1440
|
+
_: 1
|
|
1441
|
+
})) : createCommentVNode("", true)], 64)),
|
|
1442
|
+
props.value?.writeOnly ? (openBlock(), createElementBlock("div", _hoisted_6$3, " write-only ")) : props.value?.readOnly ? (openBlock(), createElementBlock("div", _hoisted_7$2, " read-only ")) : createCommentVNode("", true),
|
|
1443
|
+
props.required ? (openBlock(), createElementBlock("div", _hoisted_8$2, " required ")) : createCommentVNode("", true),
|
|
1444
|
+
createVNode(SchemaPropertyDefault_default, { value: props.value?.default }, null, 8, ["value"]),
|
|
1445
|
+
props.withExamples ? (openBlock(), createBlock(SchemaPropertyExamples_default, {
|
|
1446
|
+
key: 10,
|
|
1447
|
+
example: exampleValue.value,
|
|
1448
|
+
examples: props.value?.examples
|
|
1449
|
+
}, null, 8, ["example", "examples"])) : createCommentVNode("", true)
|
|
1450
|
+
]);
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
}), [["__scopeId", "data-v-d6007af3"]]);
|
|
1454
|
+
//#endregion
|
|
1455
|
+
//#region src/components/Content/Schema/SchemaProperty.vue?vue&type=script&setup=true&lang.ts
|
|
1456
|
+
var _hoisted_1$14 = {
|
|
1457
|
+
key: 0,
|
|
1458
|
+
class: "property-name-pattern-properties"
|
|
1459
|
+
};
|
|
1460
|
+
var _hoisted_2$9 = {
|
|
1461
|
+
key: 1,
|
|
1462
|
+
class: "property-name-additional-properties"
|
|
1463
|
+
};
|
|
1464
|
+
var _hoisted_3$8 = {
|
|
1465
|
+
key: 1,
|
|
1466
|
+
class: "property-description"
|
|
1467
|
+
};
|
|
1468
|
+
var _hoisted_4$4 = {
|
|
1469
|
+
key: 4,
|
|
1470
|
+
class: "children"
|
|
1471
|
+
};
|
|
1472
|
+
var _hoisted_5$4 = {
|
|
1473
|
+
key: 5,
|
|
1474
|
+
class: "children"
|
|
1475
|
+
};
|
|
1476
|
+
//#endregion
|
|
1477
|
+
//#region src/components/Content/Schema/SchemaProperty.vue
|
|
1478
|
+
var SchemaProperty_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1479
|
+
__name: "SchemaProperty",
|
|
1480
|
+
props: {
|
|
1481
|
+
is: {},
|
|
1482
|
+
schema: {},
|
|
1483
|
+
noncollapsible: { type: Boolean },
|
|
1484
|
+
level: { default: 0 },
|
|
1485
|
+
name: {},
|
|
1486
|
+
required: {
|
|
1487
|
+
type: Boolean,
|
|
1488
|
+
default: false
|
|
1489
|
+
},
|
|
1490
|
+
compact: {
|
|
1491
|
+
type: Boolean,
|
|
1492
|
+
default: false
|
|
1493
|
+
},
|
|
1494
|
+
discriminator: {},
|
|
1495
|
+
description: {},
|
|
1496
|
+
hideModelNames: {
|
|
1497
|
+
type: Boolean,
|
|
1498
|
+
default: false
|
|
1499
|
+
},
|
|
1500
|
+
hideHeading: { type: Boolean },
|
|
1501
|
+
modelName: {},
|
|
1502
|
+
variant: {},
|
|
1503
|
+
breadcrumb: {},
|
|
1504
|
+
eventBus: {},
|
|
1505
|
+
options: {},
|
|
1506
|
+
propertyNamesEnum: {}
|
|
1507
|
+
},
|
|
1508
|
+
setup(__props) {
|
|
1509
|
+
const props = __props;
|
|
1510
|
+
/** Simplified composition with `null` type. */
|
|
1511
|
+
const optimizedValue = computed(() => optimizeValueForDisplay(props.schema));
|
|
1512
|
+
const childBreadcrumb = computed(() => props.breadcrumb && props.name ? [...props.breadcrumb, props.name] : void 0);
|
|
1513
|
+
const shouldHaveLink = computed(() => props.level <= 1);
|
|
1514
|
+
/** Checks if array items have complex structure */
|
|
1515
|
+
const hasComplexArrayItemsComputed = computed(() => hasComplexArrayItems(optimizedValue.value));
|
|
1516
|
+
/** Check if enum should be displayed (from value schema or from propertyNames) */
|
|
1517
|
+
const hasEnum = computed(() => enumValues.value.length > 0);
|
|
1518
|
+
/** Determine if object properties should be displayed */
|
|
1519
|
+
const shouldRenderObjectProperties = computed(() => {
|
|
1520
|
+
const value = optimizedValue.value;
|
|
1521
|
+
if (!value) return false;
|
|
1522
|
+
return isTypeObject(value) && ("properties" in value || "additionalProperties" in value);
|
|
1523
|
+
});
|
|
1524
|
+
/** Determine if array of objects should be rendered */
|
|
1525
|
+
const shouldRenderArrayOfObjects = computed(() => {
|
|
1526
|
+
const value = optimizedValue.value;
|
|
1527
|
+
if (!value || !isArraySchema(value) || typeof value.items !== "object") return false;
|
|
1528
|
+
return hasComplexArrayItemsComputed.value;
|
|
1529
|
+
});
|
|
1530
|
+
/** Extract enum values from schema or array items */
|
|
1531
|
+
const enumValues = computed(() => getEnumValues(optimizedValue.value));
|
|
1532
|
+
/** Generate property description from type/format */
|
|
1533
|
+
const propertyDescription = computed(() => getPropertyDescription(optimizedValue.value));
|
|
1534
|
+
/** Determine if description should be displayed */
|
|
1535
|
+
const displayDescription = computed(() => shouldDisplayDescription(optimizedValue.value, props.description));
|
|
1536
|
+
/**
|
|
1537
|
+
* When the property already renders the description, avoid repeating it in the nested object schema card.
|
|
1538
|
+
*/
|
|
1539
|
+
const objectSchemaForChildren = computed(() => {
|
|
1540
|
+
const value = optimizedValue.value;
|
|
1541
|
+
if (!value || !displayDescription.value || !("description" in value)) return value;
|
|
1542
|
+
const { description: _description, ...schemaWithoutDescription } = value;
|
|
1543
|
+
return schemaWithoutDescription;
|
|
1544
|
+
});
|
|
1545
|
+
/** Determine if property heading should be displayed */
|
|
1546
|
+
const shouldDisplayHeadingComputed = computed(() => shouldDisplayHeading(optimizedValue.value, props.name, props.required));
|
|
1547
|
+
/** Computes which compositions should be rendered and with which values */
|
|
1548
|
+
const compositionsToRender = computed(() => getCompositionsToRender(optimizedValue.value));
|
|
1549
|
+
/** Get resolved array items for rendering */
|
|
1550
|
+
const resolvedArrayItems = computed(() => {
|
|
1551
|
+
const value = optimizedValue.value;
|
|
1552
|
+
if (!value || !isArraySchema(value) || typeof value.items !== "object") return;
|
|
1553
|
+
return resolve.schema(value.items);
|
|
1554
|
+
});
|
|
1555
|
+
/** Check if discriminator matches current property */
|
|
1556
|
+
const isDiscriminatorProperty = computed(() => Boolean(props.name && props.discriminator?.propertyName === props.name));
|
|
1557
|
+
return (_ctx, _cache) => {
|
|
1558
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.is ?? "li"), { class: normalizeClass(["property", [`property--level-${__props.level}`, {
|
|
1559
|
+
"property--compact": __props.compact,
|
|
1560
|
+
"property--deprecated": optimizedValue.value?.deprecated
|
|
1561
|
+
}]]) }, {
|
|
1562
|
+
default: withCtx(() => [
|
|
1563
|
+
shouldDisplayHeadingComputed.value ? (openBlock(), createBlock(SchemaPropertyHeading_default, {
|
|
1564
|
+
key: 0,
|
|
1565
|
+
class: "group",
|
|
1566
|
+
enum: hasEnum.value,
|
|
1567
|
+
hideModelNames: __props.hideModelNames,
|
|
1568
|
+
isDiscriminator: isDiscriminatorProperty.value,
|
|
1569
|
+
modelName: __props.modelName,
|
|
1570
|
+
required: __props.required,
|
|
1571
|
+
value: optimizedValue.value
|
|
1572
|
+
}, createSlots({ _: 2 }, [__props.name ? {
|
|
1573
|
+
name: "name",
|
|
1574
|
+
fn: withCtx(() => [createVNode(unref(WithBreadcrumb_default), {
|
|
1575
|
+
breadcrumb: shouldHaveLink.value ? childBreadcrumb.value : void 0,
|
|
1576
|
+
eventBus: __props.eventBus
|
|
1577
|
+
}, {
|
|
1578
|
+
default: withCtx(() => [__props.variant === "patternProperties" ? (openBlock(), createElementBlock("span", _hoisted_1$14, [createVNode(unref(ScalarWrappingText), {
|
|
1579
|
+
preset: "property",
|
|
1580
|
+
text: __props.name
|
|
1581
|
+
}, null, 8, ["text"])])) : __props.variant === "additionalProperties" ? (openBlock(), createElementBlock("span", _hoisted_2$9, [createVNode(unref(ScalarWrappingText), {
|
|
1582
|
+
preset: "property",
|
|
1583
|
+
text: __props.name
|
|
1584
|
+
}, null, 8, ["text"])])) : (openBlock(), createBlock(unref(ScalarWrappingText), {
|
|
1585
|
+
key: 2,
|
|
1586
|
+
preset: "property",
|
|
1587
|
+
text: __props.name
|
|
1588
|
+
}, null, 8, ["text"]))]),
|
|
1589
|
+
_: 1
|
|
1590
|
+
}, 8, ["breadcrumb", "eventBus"])]),
|
|
1591
|
+
key: "0"
|
|
1592
|
+
} : void 0, optimizedValue.value?.example ? {
|
|
1593
|
+
name: "example",
|
|
1594
|
+
fn: withCtx(() => [createTextVNode(" Example: " + toDisplayString(optimizedValue.value.example), 1)]),
|
|
1595
|
+
key: "1"
|
|
1596
|
+
} : void 0]), 1032, [
|
|
1597
|
+
"enum",
|
|
1598
|
+
"hideModelNames",
|
|
1599
|
+
"isDiscriminator",
|
|
1600
|
+
"modelName",
|
|
1601
|
+
"required",
|
|
1602
|
+
"value"
|
|
1603
|
+
])) : createCommentVNode("", true),
|
|
1604
|
+
displayDescription.value || propertyDescription.value ? (openBlock(), createElementBlock("div", _hoisted_3$8, [createVNode(unref(ScalarMarkdown), { value: displayDescription.value || propertyDescription.value || "" }, null, 8, ["value"])])) : createCommentVNode("", true),
|
|
1605
|
+
__props.propertyNamesEnum && __props.propertyNamesEnum.length > 0 ? (openBlock(), createBlock(SchemaEnums_default, {
|
|
1606
|
+
key: 2,
|
|
1607
|
+
propertyNames: "",
|
|
1608
|
+
value: { enum: __props.propertyNamesEnum }
|
|
1609
|
+
}, null, 8, ["value"])) : createCommentVNode("", true),
|
|
1610
|
+
enumValues.value.length > 0 ? (openBlock(), createBlock(SchemaEnums_default, {
|
|
1611
|
+
key: 3,
|
|
1612
|
+
value: optimizedValue.value
|
|
1613
|
+
}, null, 8, ["value"])) : createCommentVNode("", true),
|
|
1614
|
+
shouldRenderObjectProperties.value ? (openBlock(), createElementBlock("div", _hoisted_4$4, [createVNode(Schema_default, {
|
|
1615
|
+
breadcrumb: childBreadcrumb.value,
|
|
1616
|
+
compact: __props.compact,
|
|
1617
|
+
eventBus: __props.eventBus,
|
|
1618
|
+
level: __props.level + 1,
|
|
1619
|
+
name: __props.name,
|
|
1620
|
+
noncollapsible: __props.noncollapsible,
|
|
1621
|
+
options: __props.options,
|
|
1622
|
+
schema: objectSchemaForChildren.value
|
|
1623
|
+
}, null, 8, [
|
|
1624
|
+
"breadcrumb",
|
|
1625
|
+
"compact",
|
|
1626
|
+
"eventBus",
|
|
1627
|
+
"level",
|
|
1628
|
+
"name",
|
|
1629
|
+
"noncollapsible",
|
|
1630
|
+
"options",
|
|
1631
|
+
"schema"
|
|
1632
|
+
])])) : createCommentVNode("", true),
|
|
1633
|
+
shouldRenderArrayOfObjects.value && resolvedArrayItems.value ? (openBlock(), createElementBlock("div", _hoisted_5$4, [createVNode(Schema_default, {
|
|
1634
|
+
compact: __props.compact,
|
|
1635
|
+
eventBus: __props.eventBus,
|
|
1636
|
+
level: __props.level + 1,
|
|
1637
|
+
name: __props.name,
|
|
1638
|
+
noncollapsible: __props.noncollapsible,
|
|
1639
|
+
options: __props.options,
|
|
1640
|
+
schema: unref(resolve).schema(resolvedArrayItems.value)
|
|
1641
|
+
}, null, 8, [
|
|
1642
|
+
"compact",
|
|
1643
|
+
"eventBus",
|
|
1644
|
+
"level",
|
|
1645
|
+
"name",
|
|
1646
|
+
"noncollapsible",
|
|
1647
|
+
"options",
|
|
1648
|
+
"schema"
|
|
1649
|
+
])])) : createCommentVNode("", true),
|
|
1650
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(compositionsToRender.value, (compositionData) => {
|
|
1651
|
+
return openBlock(), createBlock(SchemaComposition_default, {
|
|
1652
|
+
key: compositionData.composition,
|
|
1653
|
+
breadcrumb: __props.breadcrumb,
|
|
1654
|
+
compact: __props.compact,
|
|
1655
|
+
composition: compositionData.composition,
|
|
1656
|
+
discriminator: __props.schema?.discriminator,
|
|
1657
|
+
eventBus: __props.eventBus,
|
|
1658
|
+
hideHeading: __props.hideHeading,
|
|
1659
|
+
level: __props.level,
|
|
1660
|
+
name: __props.name,
|
|
1661
|
+
noncollapsible: __props.noncollapsible,
|
|
1662
|
+
options: __props.options,
|
|
1663
|
+
schema: compositionData.value
|
|
1664
|
+
}, null, 8, [
|
|
1665
|
+
"breadcrumb",
|
|
1666
|
+
"compact",
|
|
1667
|
+
"composition",
|
|
1668
|
+
"discriminator",
|
|
1669
|
+
"eventBus",
|
|
1670
|
+
"hideHeading",
|
|
1671
|
+
"level",
|
|
1672
|
+
"name",
|
|
1673
|
+
"noncollapsible",
|
|
1674
|
+
"options",
|
|
1675
|
+
"schema"
|
|
1676
|
+
]);
|
|
1677
|
+
}), 128)),
|
|
1678
|
+
createVNode(unref(SpecificationExtension_default), { value: optimizedValue.value }, null, 8, ["value"])
|
|
1679
|
+
]),
|
|
1680
|
+
_: 1
|
|
1681
|
+
}, 8, ["class"]);
|
|
1682
|
+
};
|
|
1683
|
+
}
|
|
1684
|
+
}), [["__scopeId", "data-v-6031fee6"]]);
|
|
1685
|
+
//#endregion
|
|
1686
|
+
//#region src/components/Content/Schema/SchemaObjectProperties.vue
|
|
1687
|
+
var SchemaObjectProperties_default = /* @__PURE__ */ defineComponent({
|
|
1688
|
+
__name: "SchemaObjectProperties",
|
|
1689
|
+
props: {
|
|
1690
|
+
schema: {},
|
|
1691
|
+
discriminator: {},
|
|
1692
|
+
compact: { type: Boolean },
|
|
1693
|
+
hideHeading: { type: Boolean },
|
|
1694
|
+
level: {},
|
|
1695
|
+
hideModelNames: { type: Boolean },
|
|
1696
|
+
breadcrumb: {},
|
|
1697
|
+
eventBus: {},
|
|
1698
|
+
options: {}
|
|
1699
|
+
},
|
|
1700
|
+
setup(__props) {
|
|
1701
|
+
/**
|
|
1702
|
+
* Sorts properties by required status first, then alphabetically.
|
|
1703
|
+
* Required properties appear first, followed by optional properties.
|
|
1704
|
+
*/
|
|
1705
|
+
const sortedProperties = computed(() => sortPropertyNames(__props.schema, __props.discriminator, __props.options));
|
|
1706
|
+
/**
|
|
1707
|
+
* Get the display name for additional properties.
|
|
1708
|
+
*
|
|
1709
|
+
* Checks x-additionalPropertiesName extension first, then falls back to the
|
|
1710
|
+
* propertyNames schema title if available.
|
|
1711
|
+
*/
|
|
1712
|
+
const getAdditionalPropertiesName = (_additionalProperties, _propertyNames) => {
|
|
1713
|
+
const additionalProperties = typeof _additionalProperties === "boolean" ? _additionalProperties : resolve.schema(_additionalProperties);
|
|
1714
|
+
if (typeof additionalProperties === "object" && typeof additionalProperties["x-additionalPropertiesName"] === "string" && additionalProperties["x-additionalPropertiesName"].trim().length > 0) return `${additionalProperties["x-additionalPropertiesName"].trim()}`;
|
|
1715
|
+
if (_propertyNames) {
|
|
1716
|
+
const resolved = resolve.schema(_propertyNames);
|
|
1717
|
+
if (resolved?.title) return resolved.title;
|
|
1718
|
+
}
|
|
1719
|
+
return "propertyName";
|
|
1720
|
+
};
|
|
1721
|
+
/**
|
|
1722
|
+
* Extract enum values from the propertyNames schema.
|
|
1723
|
+
*
|
|
1724
|
+
* JSON Schema's propertyNames keyword constrains which keys are valid
|
|
1725
|
+
* in an object with additionalProperties. When it contains an enum,
|
|
1726
|
+
* these are the allowed key names.
|
|
1727
|
+
*/
|
|
1728
|
+
const getPropertyNamesEnum = (_propertyNames) => {
|
|
1729
|
+
if (!_propertyNames) return;
|
|
1730
|
+
const resolved = resolve.schema(_propertyNames);
|
|
1731
|
+
if (resolved && "enum" in resolved && Array.isArray(resolved.enum) && resolved.enum.length > 0) return resolved.enum;
|
|
1732
|
+
};
|
|
1733
|
+
/** Enum values for the property keys, derived from propertyNames if present. */
|
|
1734
|
+
const additionalPropertiesEnum = computed(() => {
|
|
1735
|
+
if (!isTypeObject(__props.schema) || !__props.schema.additionalProperties) return;
|
|
1736
|
+
return getPropertyNamesEnum(__props.schema.propertyNames);
|
|
1737
|
+
});
|
|
1738
|
+
/**
|
|
1739
|
+
* Get the value for additional properties.
|
|
1740
|
+
*
|
|
1741
|
+
* When additionalProperties is true or an empty object, it should render as { type: 'anything' }.
|
|
1742
|
+
*/
|
|
1743
|
+
const getAdditionalPropertiesValue = (additionalProperties) => {
|
|
1744
|
+
if (additionalProperties === true || typeof additionalProperties === "object" && Object.keys(additionalProperties).length === 0 || typeof additionalProperties !== "object" || !("type" in additionalProperties)) return {
|
|
1745
|
+
type: "anything",
|
|
1746
|
+
...typeof additionalProperties === "object" ? additionalProperties : {}
|
|
1747
|
+
};
|
|
1748
|
+
return additionalProperties;
|
|
1749
|
+
};
|
|
1750
|
+
return (_ctx, _cache) => {
|
|
1751
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1752
|
+
unref(isTypeObject)(__props.schema) && __props.schema.properties ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(sortedProperties.value, (property) => {
|
|
1753
|
+
return openBlock(), createBlock(SchemaProperty_default, {
|
|
1754
|
+
key: property,
|
|
1755
|
+
breadcrumb: __props.breadcrumb,
|
|
1756
|
+
compact: __props.compact,
|
|
1757
|
+
discriminator: __props.discriminator,
|
|
1758
|
+
eventBus: __props.eventBus,
|
|
1759
|
+
hideHeading: __props.hideHeading,
|
|
1760
|
+
hideModelNames: __props.hideModelNames,
|
|
1761
|
+
level: __props.level,
|
|
1762
|
+
name: property,
|
|
1763
|
+
options: __props.options,
|
|
1764
|
+
required: __props.schema.required?.includes(property),
|
|
1765
|
+
schema: unref(resolve).schema(__props.schema.properties[property])
|
|
1766
|
+
}, null, 8, [
|
|
1767
|
+
"breadcrumb",
|
|
1768
|
+
"compact",
|
|
1769
|
+
"discriminator",
|
|
1770
|
+
"eventBus",
|
|
1771
|
+
"hideHeading",
|
|
1772
|
+
"hideModelNames",
|
|
1773
|
+
"level",
|
|
1774
|
+
"name",
|
|
1775
|
+
"options",
|
|
1776
|
+
"required",
|
|
1777
|
+
"schema"
|
|
1778
|
+
]);
|
|
1779
|
+
}), 128)) : createCommentVNode("", true),
|
|
1780
|
+
unref(isTypeObject)(__props.schema) && __props.schema.patternProperties ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(Object.entries(__props.schema.patternProperties), ([key, property]) => {
|
|
1781
|
+
return openBlock(), createBlock(SchemaProperty_default, {
|
|
1782
|
+
key,
|
|
1783
|
+
breadcrumb: __props.breadcrumb,
|
|
1784
|
+
compact: __props.compact,
|
|
1785
|
+
discriminator: __props.discriminator,
|
|
1786
|
+
eventBus: __props.eventBus,
|
|
1787
|
+
hideHeading: __props.hideHeading,
|
|
1788
|
+
hideModelNames: __props.hideModelNames,
|
|
1789
|
+
level: __props.level,
|
|
1790
|
+
name: key,
|
|
1791
|
+
options: __props.options,
|
|
1792
|
+
schema: unref(resolve).schema(property)
|
|
1793
|
+
}, null, 8, [
|
|
1794
|
+
"breadcrumb",
|
|
1795
|
+
"compact",
|
|
1796
|
+
"discriminator",
|
|
1797
|
+
"eventBus",
|
|
1798
|
+
"hideHeading",
|
|
1799
|
+
"hideModelNames",
|
|
1800
|
+
"level",
|
|
1801
|
+
"name",
|
|
1802
|
+
"options",
|
|
1803
|
+
"schema"
|
|
1804
|
+
]);
|
|
1805
|
+
}), 128)) : createCommentVNode("", true),
|
|
1806
|
+
unref(isTypeObject)(__props.schema) && __props.schema.additionalProperties ? (openBlock(), createBlock(SchemaProperty_default, {
|
|
1807
|
+
key: 2,
|
|
1808
|
+
breadcrumb: __props.breadcrumb,
|
|
1809
|
+
compact: __props.compact,
|
|
1810
|
+
discriminator: __props.discriminator,
|
|
1811
|
+
eventBus: __props.eventBus,
|
|
1812
|
+
hideHeading: __props.hideHeading,
|
|
1813
|
+
hideModelNames: __props.hideModelNames,
|
|
1814
|
+
level: __props.level,
|
|
1815
|
+
name: getAdditionalPropertiesName(__props.schema.additionalProperties, __props.schema.propertyNames),
|
|
1816
|
+
noncollapsible: "",
|
|
1817
|
+
options: __props.options,
|
|
1818
|
+
propertyNamesEnum: additionalPropertiesEnum.value,
|
|
1819
|
+
schema: getAdditionalPropertiesValue(__props.schema.additionalProperties),
|
|
1820
|
+
variant: "additionalProperties"
|
|
1821
|
+
}, null, 8, [
|
|
1822
|
+
"breadcrumb",
|
|
1823
|
+
"compact",
|
|
1824
|
+
"discriminator",
|
|
1825
|
+
"eventBus",
|
|
1826
|
+
"hideHeading",
|
|
1827
|
+
"hideModelNames",
|
|
1828
|
+
"level",
|
|
1829
|
+
"name",
|
|
1830
|
+
"options",
|
|
1831
|
+
"propertyNamesEnum",
|
|
1832
|
+
"schema"
|
|
1833
|
+
])) : createCommentVNode("", true)
|
|
1834
|
+
], 64);
|
|
1835
|
+
};
|
|
1836
|
+
}
|
|
1837
|
+
});
|
|
1838
|
+
//#endregion
|
|
1839
|
+
//#region src/components/Content/Schema/Schema.vue?vue&type=script&setup=true&lang.ts
|
|
1840
|
+
var _hoisted_1$13 = {
|
|
1841
|
+
key: 0,
|
|
1842
|
+
class: "schema-card-description"
|
|
1843
|
+
};
|
|
1844
|
+
var _hoisted_2$8 = {
|
|
1845
|
+
key: 1,
|
|
1846
|
+
class: "pt-2"
|
|
1847
|
+
};
|
|
1848
|
+
var _hoisted_3$7 = {
|
|
1849
|
+
key: 0,
|
|
1850
|
+
class: "schema-properties"
|
|
1851
|
+
};
|
|
1852
|
+
//#endregion
|
|
1853
|
+
//#region src/components/Content/Schema/Schema.vue
|
|
1854
|
+
var Schema_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
1855
|
+
__name: "Schema",
|
|
1856
|
+
props: {
|
|
1857
|
+
schema: {},
|
|
1858
|
+
level: { default: 0 },
|
|
1859
|
+
name: {},
|
|
1860
|
+
compact: { type: Boolean },
|
|
1861
|
+
noncollapsible: {
|
|
1862
|
+
type: Boolean,
|
|
1863
|
+
default: false
|
|
1864
|
+
},
|
|
1865
|
+
hideHeading: { type: Boolean },
|
|
1866
|
+
additionalProperties: { type: Boolean },
|
|
1867
|
+
hideModelNames: {
|
|
1868
|
+
type: Boolean,
|
|
1869
|
+
default: false
|
|
1870
|
+
},
|
|
1871
|
+
discriminator: {},
|
|
1872
|
+
breadcrumb: {},
|
|
1873
|
+
eventBus: {},
|
|
1874
|
+
options: {}
|
|
1875
|
+
},
|
|
1876
|
+
setup(__props) {
|
|
1877
|
+
/**
|
|
1878
|
+
* Determines whether to show the collapse/expand toggle button.
|
|
1879
|
+
* We hide the toggle for non-collapsible schemas and root-level schemas.
|
|
1880
|
+
*/
|
|
1881
|
+
const shouldShowToggle = computed(() => {
|
|
1882
|
+
return !__props.noncollapsible && __props.level > 0;
|
|
1883
|
+
});
|
|
1884
|
+
/** Gets the description to show for the schema */
|
|
1885
|
+
const schemaDescription = computed(() => {
|
|
1886
|
+
if (__props.schema?.allOf && __props.schema.allOf.length > 0 && __props.name === "Request Body") return __props.schema.description || __props.schema.allOf[0]?.description || null;
|
|
1887
|
+
if (!__props.schema?.description || typeof __props.schema.description !== "string") return null;
|
|
1888
|
+
if (__props.schema.oneOf || __props.schema.anyOf) return null;
|
|
1889
|
+
if (__props.schema.enum) return null;
|
|
1890
|
+
if (!("properties" in __props.schema) && !("patternProperties" in __props.schema) && !("additionalProperties" in __props.schema)) return null;
|
|
1891
|
+
return __props.schema.description;
|
|
1892
|
+
});
|
|
1893
|
+
const handleClick = (e) => __props.noncollapsible && e.stopPropagation();
|
|
1894
|
+
return (_ctx, _cache) => {
|
|
1895
|
+
return typeof __props.schema === "object" && Object.keys(__props.schema).length ? (openBlock(), createBlock(unref(Disclosure), {
|
|
1896
|
+
key: 0,
|
|
1897
|
+
defaultOpen: __props.noncollapsible
|
|
1898
|
+
}, {
|
|
1899
|
+
default: withCtx(({ open }) => [createElementVNode("div", { class: normalizeClass(["schema-card", [
|
|
1900
|
+
`schema-card--level-${__props.level}`,
|
|
1901
|
+
{
|
|
1902
|
+
"schema-card--compact": __props.compact,
|
|
1903
|
+
"schema-card--open": open
|
|
1904
|
+
},
|
|
1905
|
+
{ "border-t": __props.additionalProperties && open }
|
|
1906
|
+
]]) }, [
|
|
1907
|
+
schemaDescription.value ? (openBlock(), createElementBlock("div", _hoisted_1$13, [createVNode(unref(ScalarMarkdown), { value: schemaDescription.value }, null, 8, ["value"])])) : createCommentVNode("", true),
|
|
1908
|
+
unref(isEmptySchemaObject)(__props.schema) ? (openBlock(), createElementBlock("div", _hoisted_2$8, " Empty object ")) : createCommentVNode("", true),
|
|
1909
|
+
createElementVNode("div", { class: normalizeClass(["schema-properties", { "schema-properties-open": open }]) }, [__props.additionalProperties ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3$7, [createVNode(unref(DisclosureButton), {
|
|
1910
|
+
as: "button",
|
|
1911
|
+
class: "schema-card-title schema-card-title--compact",
|
|
1912
|
+
onClickCapture: handleClick
|
|
1913
|
+
}, {
|
|
1914
|
+
default: withCtx(() => [
|
|
1915
|
+
createVNode(unref(ScalarIcon), {
|
|
1916
|
+
class: "schema-card-title-icon",
|
|
1917
|
+
icon: "Add",
|
|
1918
|
+
size: "sm"
|
|
1919
|
+
}),
|
|
1920
|
+
_cache[0] || (_cache[0] = createTextVNode(" Show additional properties ", -1)),
|
|
1921
|
+
__props.name ? (openBlock(), createBlock(ScreenReader_default, { key: 0 }, {
|
|
1922
|
+
default: withCtx(() => [createTextVNode("for " + toDisplayString(__props.name), 1)]),
|
|
1923
|
+
_: 1
|
|
1924
|
+
})) : createCommentVNode("", true)
|
|
1925
|
+
]),
|
|
1926
|
+
_: 1
|
|
1927
|
+
})], 512)), [[vShow, !open]]) : shouldShowToggle.value ? withDirectives((openBlock(), createBlock(unref(DisclosureButton), {
|
|
1928
|
+
key: 1,
|
|
1929
|
+
as: __props.noncollapsible ? "div" : "button",
|
|
1930
|
+
class: normalizeClass(["schema-card-title", { "schema-card-title--compact": __props.compact }]),
|
|
1931
|
+
style: normalizeStyle({ top: `calc(var(--refs-viewport-offset) + calc(var(--schema-title-height) * ${__props.level}))` }),
|
|
1932
|
+
onClickCapture: handleClick
|
|
1933
|
+
}, {
|
|
1934
|
+
default: withCtx(() => [__props.compact ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1935
|
+
createVNode(unref(ScalarIcon), {
|
|
1936
|
+
class: normalizeClass(["schema-card-title-icon", { "schema-card-title-icon--open": open }]),
|
|
1937
|
+
icon: "Add",
|
|
1938
|
+
size: "sm"
|
|
1939
|
+
}, null, 8, ["class"]),
|
|
1940
|
+
open ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" Hide " + toDisplayString(__props.schema?.title ?? "Child Attributes"), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" Show " + toDisplayString(__props.schema?.title ?? "Child Attributes"), 1)], 64)),
|
|
1941
|
+
__props.name ? (openBlock(), createBlock(ScreenReader_default, { key: 2 }, {
|
|
1942
|
+
default: withCtx(() => [createTextVNode("for " + toDisplayString(__props.name), 1)]),
|
|
1943
|
+
_: 1
|
|
1944
|
+
})) : createCommentVNode("", true)
|
|
1945
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(ScalarIcon), {
|
|
1946
|
+
class: normalizeClass(["schema-card-title-icon", { "schema-card-title-icon--open": open }]),
|
|
1947
|
+
icon: "Add",
|
|
1948
|
+
size: "sm"
|
|
1949
|
+
}, null, 8, ["class"]), createVNode(SchemaHeading_default, {
|
|
1950
|
+
name: __props.schema?.title ?? __props.name,
|
|
1951
|
+
value: __props.schema
|
|
1952
|
+
}, null, 8, ["name", "value"])], 64))]),
|
|
1953
|
+
_: 2
|
|
1954
|
+
}, 1032, [
|
|
1955
|
+
"as",
|
|
1956
|
+
"class",
|
|
1957
|
+
"style"
|
|
1958
|
+
])), [[vShow, !__props.hideHeading && !(__props.noncollapsible && __props.compact)]]) : createCommentVNode("", true), !__props.additionalProperties || open ? (openBlock(), createBlock(unref(DisclosurePanel), {
|
|
1959
|
+
key: 2,
|
|
1960
|
+
as: "ul",
|
|
1961
|
+
static: !shouldShowToggle.value
|
|
1962
|
+
}, {
|
|
1963
|
+
default: withCtx(() => [unref(isTypeObject)(__props.schema) ? (openBlock(), createBlock(SchemaObjectProperties_default, {
|
|
1964
|
+
key: 0,
|
|
1965
|
+
breadcrumb: __props.breadcrumb,
|
|
1966
|
+
compact: __props.compact,
|
|
1967
|
+
discriminator: __props.discriminator,
|
|
1968
|
+
eventBus: __props.eventBus,
|
|
1969
|
+
hideHeading: __props.hideHeading,
|
|
1970
|
+
hideModelNames: __props.hideModelNames,
|
|
1971
|
+
level: __props.level + 1,
|
|
1972
|
+
options: __props.options,
|
|
1973
|
+
schema: __props.schema
|
|
1974
|
+
}, null, 8, [
|
|
1975
|
+
"breadcrumb",
|
|
1976
|
+
"compact",
|
|
1977
|
+
"discriminator",
|
|
1978
|
+
"eventBus",
|
|
1979
|
+
"hideHeading",
|
|
1980
|
+
"hideModelNames",
|
|
1981
|
+
"level",
|
|
1982
|
+
"options",
|
|
1983
|
+
"schema"
|
|
1984
|
+
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [__props.schema ? (openBlock(), createBlock(SchemaProperty_default, {
|
|
1985
|
+
key: 0,
|
|
1986
|
+
breadcrumb: __props.breadcrumb,
|
|
1987
|
+
compact: __props.compact,
|
|
1988
|
+
eventBus: __props.eventBus,
|
|
1989
|
+
hideHeading: __props.hideHeading,
|
|
1990
|
+
hideModelNames: __props.hideModelNames,
|
|
1991
|
+
level: __props.level,
|
|
1992
|
+
options: __props.options,
|
|
1993
|
+
schema: __props.schema
|
|
1994
|
+
}, null, 8, [
|
|
1995
|
+
"breadcrumb",
|
|
1996
|
+
"compact",
|
|
1997
|
+
"eventBus",
|
|
1998
|
+
"hideHeading",
|
|
1999
|
+
"hideModelNames",
|
|
2000
|
+
"level",
|
|
2001
|
+
"options",
|
|
2002
|
+
"schema"
|
|
2003
|
+
])) : createCommentVNode("", true)], 64))]),
|
|
2004
|
+
_: 1
|
|
2005
|
+
}, 8, ["static"])) : createCommentVNode("", true)], 2)
|
|
2006
|
+
], 2)]),
|
|
2007
|
+
_: 1
|
|
2008
|
+
}, 8, ["defaultOpen"])) : createCommentVNode("", true);
|
|
2009
|
+
};
|
|
2010
|
+
}
|
|
2011
|
+
}), [["__scopeId", "data-v-d9bd8110"]]);
|
|
2012
|
+
//#endregion
|
|
2013
|
+
//#region src/components/HttpMethod/HttpMethod.vue
|
|
2014
|
+
var HttpMethod_default = /* @__PURE__ */ defineComponent({
|
|
2015
|
+
__name: "HttpMethod",
|
|
2016
|
+
props: {
|
|
2017
|
+
as: {},
|
|
2018
|
+
property: {},
|
|
2019
|
+
short: { type: Boolean },
|
|
2020
|
+
method: {}
|
|
2021
|
+
},
|
|
2022
|
+
setup(__props) {
|
|
2023
|
+
const props = __props;
|
|
2024
|
+
/** Grabs the method info object which contains abbreviation, color, and background color etc */
|
|
2025
|
+
const httpMethodInfo = computed(() => getHttpMethodInfo(String(props.method || "")));
|
|
2026
|
+
/** Full method name */
|
|
2027
|
+
const normalized = computed(() => normalizeHttpMethod(props.method));
|
|
2028
|
+
return (_ctx, _cache) => {
|
|
2029
|
+
return openBlock(), createBlock(resolveDynamicComponent(__props.as ?? "span"), {
|
|
2030
|
+
class: "uppercase",
|
|
2031
|
+
style: normalizeStyle({ [__props.property || "color"]: httpMethodInfo.value.colorVar })
|
|
2032
|
+
}, {
|
|
2033
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default"), createTextVNode(" " + toDisplayString(__props.short ? httpMethodInfo.value.short : normalized.value), 1)]),
|
|
2034
|
+
_: 3
|
|
2035
|
+
}, 8, ["style"]);
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
});
|
|
2039
|
+
//#endregion
|
|
2040
|
+
//#region src/features/Operation/helpers/filter-selected-security.ts
|
|
2041
|
+
/** Builds a quick cache key from the sorted object keys */
|
|
2042
|
+
var getKey = (requirement) => Object.keys(requirement).sort().join(",");
|
|
2043
|
+
/**
|
|
2044
|
+
* Find the intersection between which security is selected on the document and what this operation requires
|
|
2045
|
+
*
|
|
2046
|
+
* If there is no overlap, we return the first requirement
|
|
2047
|
+
*/
|
|
2048
|
+
var filterSelectedSecurity = (document, operation, selectedSecurityDocument, selectedSecurityOperation, securitySchemes = {}) => {
|
|
2049
|
+
const securityRequirements = operation?.security ?? document.security ?? [];
|
|
2050
|
+
/** The selected security keys for the document */
|
|
2051
|
+
const selectedSecurity = getSelectedSecurity(selectedSecurityDocument, selectedSecurityOperation, securityRequirements);
|
|
2052
|
+
/** Build a set for O(1) lookup */
|
|
2053
|
+
const requirementSet = new Set(securityRequirements.map((r) => getKey(r)));
|
|
2054
|
+
const selectedRequirement = selectedSecurity.selectedSchemes[selectedSecurity.selectedIndex];
|
|
2055
|
+
if (selectedRequirement && requirementSet.has(getKey(selectedRequirement))) return getSecuritySchemes(securitySchemes, [selectedRequirement]);
|
|
2056
|
+
for (const selected of selectedSecurity.selectedSchemes) if (requirementSet.has(getKey(selected))) return getSecuritySchemes(securitySchemes, [selected]);
|
|
2057
|
+
/**
|
|
2058
|
+
* If we are selected security on the document,
|
|
2059
|
+
* we should show the first requirement of the operation to show auth is required
|
|
2060
|
+
*/
|
|
2061
|
+
if (operation?.security?.length) return getSecuritySchemes(securitySchemes, securityRequirements.slice(0, 1));
|
|
2062
|
+
return [];
|
|
2063
|
+
};
|
|
2064
|
+
//#endregion
|
|
2065
|
+
//#region src/features/Operation/helpers/get-first-server.ts
|
|
2066
|
+
/**
|
|
2067
|
+
* Iterate through all available servers and pick the first one
|
|
2068
|
+
*
|
|
2069
|
+
* @example
|
|
2070
|
+
* getFirstServer([operation.servers, pathItem.servers, server])
|
|
2071
|
+
*/
|
|
2072
|
+
var getFirstServer = (...availableServers) => {
|
|
2073
|
+
for (const serverSource of availableServers) {
|
|
2074
|
+
if (!serverSource) continue;
|
|
2075
|
+
if (!Array.isArray(serverSource)) {
|
|
2076
|
+
const resolvedServer = getResolvedRef(serverSource);
|
|
2077
|
+
if (resolvedServer?.url) return resolvedServer;
|
|
2078
|
+
continue;
|
|
2079
|
+
}
|
|
2080
|
+
for (const server of serverSource) {
|
|
2081
|
+
const resolvedServer = getResolvedRef(server);
|
|
2082
|
+
if (resolvedServer?.url) return resolvedServer;
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
return null;
|
|
2086
|
+
};
|
|
2087
|
+
//#endregion
|
|
2088
|
+
//#region src/components/OperationPath.vue?vue&type=script&setup=true&lang.ts
|
|
2089
|
+
var _hoisted_1$12 = { key: 0 };
|
|
2090
|
+
//#endregion
|
|
2091
|
+
//#region src/components/OperationPath.vue
|
|
2092
|
+
var OperationPath_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2093
|
+
__name: "OperationPath",
|
|
2094
|
+
props: {
|
|
2095
|
+
path: {},
|
|
2096
|
+
deprecated: { type: Boolean }
|
|
2097
|
+
},
|
|
2098
|
+
setup(__props) {
|
|
2099
|
+
const props = __props;
|
|
2100
|
+
const isVariable = (part) => part.startsWith("{") && part.endsWith("}");
|
|
2101
|
+
const pathParts = computed(() => props.path.split(/({[^}]+})/));
|
|
2102
|
+
return (_ctx, _cache) => {
|
|
2103
|
+
return openBlock(), createElementBlock("span", { class: normalizeClass(["operation-path", { deprecated: __props.deprecated }]) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(pathParts.value, (part, i) => {
|
|
2104
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [isVariable(part) ? (openBlock(), createElementBlock("em", _hoisted_1$12, toDisplayString(part), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part), 1)], 64))], 64);
|
|
2105
|
+
}), 128))], 2);
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2108
|
+
}), [["__scopeId", "data-v-ec6c8861"]]);
|
|
2109
|
+
//#endregion
|
|
2110
|
+
//#region src/features/example-responses/ExampleSchema.vue?vue&type=script&setup=true&lang.ts
|
|
2111
|
+
var VIRTUALIZATION_THRESHOLD$1 = 2e4;
|
|
2112
|
+
//#endregion
|
|
2113
|
+
//#region src/features/example-responses/ExampleSchema.vue
|
|
2114
|
+
var ExampleSchema_default = /* @__PURE__ */ defineComponent({
|
|
2115
|
+
__name: "ExampleSchema",
|
|
2116
|
+
props: {
|
|
2117
|
+
id: {},
|
|
2118
|
+
schema: {}
|
|
2119
|
+
},
|
|
2120
|
+
setup(__props) {
|
|
2121
|
+
const schemaContent = computed(() => {
|
|
2122
|
+
if (!__props.schema) return;
|
|
2123
|
+
return prettyPrintJson(getResolvedRefDeep(__props.schema));
|
|
2124
|
+
});
|
|
2125
|
+
const shouldVirtualizeSchema = computed(() => {
|
|
2126
|
+
return (schemaContent.value?.length ?? 0) > VIRTUALIZATION_THRESHOLD$1;
|
|
2127
|
+
});
|
|
2128
|
+
return (_ctx, _cache) => {
|
|
2129
|
+
return !shouldVirtualizeSchema.value ? (openBlock(), createBlock(unref(ScalarCodeBlock), {
|
|
2130
|
+
key: 0,
|
|
2131
|
+
id: __props.id,
|
|
2132
|
+
class: "bg-b-2",
|
|
2133
|
+
lang: "json",
|
|
2134
|
+
prettyPrintedContent: schemaContent.value ?? ""
|
|
2135
|
+
}, null, 8, ["id", "prettyPrintedContent"])) : (openBlock(), createBlock(unref(ScalarVirtualText), {
|
|
2136
|
+
key: 1,
|
|
2137
|
+
id: __props.id,
|
|
2138
|
+
containerClass: "custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen",
|
|
2139
|
+
contentClass: "language-plaintext whitespace-pre font-code text-base",
|
|
2140
|
+
lineHeight: 20,
|
|
2141
|
+
text: schemaContent.value ?? ""
|
|
2142
|
+
}, null, 8, ["id", "text"]));
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2145
|
+
});
|
|
2146
|
+
//#endregion
|
|
2147
|
+
//#region src/features/example-responses/ExampleResponse.vue?vue&type=script&setup=true&lang.ts
|
|
2148
|
+
var _hoisted_1$11 = {
|
|
2149
|
+
key: 2,
|
|
2150
|
+
class: "empty-state"
|
|
2151
|
+
};
|
|
2152
|
+
var VIRTUALIZATION_THRESHOLD = 2e4;
|
|
2153
|
+
//#endregion
|
|
2154
|
+
//#region src/features/example-responses/ExampleResponse.vue
|
|
2155
|
+
var ExampleResponse_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2156
|
+
__name: "ExampleResponse",
|
|
2157
|
+
props: {
|
|
2158
|
+
response: {},
|
|
2159
|
+
example: {}
|
|
2160
|
+
},
|
|
2161
|
+
setup(__props) {
|
|
2162
|
+
/** Get content from the appropriate source */
|
|
2163
|
+
const getContent = () => {
|
|
2164
|
+
if (__props.example !== void 0) return getResolvedRefDeep(__props.example)?.value ?? "";
|
|
2165
|
+
if (__props.response?.schema) return getExampleFromSchema(getResolvedRef(__props.response.schema), {
|
|
2166
|
+
emptyString: "string",
|
|
2167
|
+
mode: "read"
|
|
2168
|
+
});
|
|
2169
|
+
};
|
|
2170
|
+
/** Pre-pretty printed content string, avoids multiple pretty prints*/
|
|
2171
|
+
const prettyPrintedContent = computed(() => {
|
|
2172
|
+
const content = getContent();
|
|
2173
|
+
if (content === void 0) return;
|
|
2174
|
+
return prettyPrintJson(content);
|
|
2175
|
+
});
|
|
2176
|
+
const shouldVirtualize = computed(() => {
|
|
2177
|
+
if (prettyPrintedContent.value === void 0) return false;
|
|
2178
|
+
return prettyPrintedContent.value.length > VIRTUALIZATION_THRESHOLD;
|
|
2179
|
+
});
|
|
2180
|
+
return (_ctx, _cache) => {
|
|
2181
|
+
return prettyPrintedContent.value !== void 0 && !shouldVirtualize.value ? (openBlock(), createBlock(unref(ScalarCodeBlock), {
|
|
2182
|
+
key: 0,
|
|
2183
|
+
class: "bg-b-2",
|
|
2184
|
+
lang: "json",
|
|
2185
|
+
prettyPrintedContent: prettyPrintedContent.value
|
|
2186
|
+
}, null, 8, ["prettyPrintedContent"])) : prettyPrintedContent.value !== void 0 && shouldVirtualize.value ? (openBlock(), createBlock(unref(ScalarVirtualText), {
|
|
2187
|
+
key: 1,
|
|
2188
|
+
containerClass: "custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen",
|
|
2189
|
+
contentClass: "language-plaintext whitespace-pre font-code text-base",
|
|
2190
|
+
lineHeight: 20,
|
|
2191
|
+
text: prettyPrintedContent.value
|
|
2192
|
+
}, null, 8, ["text"])) : (openBlock(), createElementBlock("div", _hoisted_1$11, " No Body "));
|
|
2193
|
+
};
|
|
2194
|
+
}
|
|
2195
|
+
}), [["__scopeId", "data-v-dcf1403d"]]);
|
|
2196
|
+
//#endregion
|
|
2197
|
+
//#region src/features/example-responses/ExampleResponseTab.vue
|
|
2198
|
+
var ExampleResponseTab_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2199
|
+
__name: "ExampleResponseTab",
|
|
2200
|
+
setup(__props) {
|
|
2201
|
+
return (_ctx, _cache) => {
|
|
2202
|
+
return openBlock(), createBlock(unref(Tab), { as: "template" }, {
|
|
2203
|
+
default: withCtx(({ selected }) => [createElementVNode("button", {
|
|
2204
|
+
class: normalizeClass(["tab", { "tab-selected": selected }]),
|
|
2205
|
+
type: "button"
|
|
2206
|
+
}, [createElementVNode("span", null, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 2)]),
|
|
2207
|
+
_: 3
|
|
2208
|
+
});
|
|
2209
|
+
};
|
|
2210
|
+
}
|
|
2211
|
+
}), [["__scopeId", "data-v-804dba49"]]);
|
|
2212
|
+
//#endregion
|
|
2213
|
+
//#region src/features/example-responses/ExampleResponseTabList.vue
|
|
2214
|
+
var ExampleResponseTabList_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2215
|
+
__name: "ExampleResponseTabList",
|
|
2216
|
+
emits: ["change"],
|
|
2217
|
+
setup(__props, { emit: __emit }) {
|
|
2218
|
+
const emit = __emit;
|
|
2219
|
+
const changeTab = (index) => {
|
|
2220
|
+
emit("change", index);
|
|
2221
|
+
};
|
|
2222
|
+
return (_ctx, _cache) => {
|
|
2223
|
+
return openBlock(), createBlock(unref(ScalarCardHeader), { class: "scalar-card-header scalar-card-header-tabs" }, {
|
|
2224
|
+
actions: withCtx(() => [renderSlot(_ctx.$slots, "actions", {}, void 0, true)]),
|
|
2225
|
+
default: withCtx(() => [createVNode(unref(TabGroup), { onChange: changeTab }, {
|
|
2226
|
+
default: withCtx(() => [createVNode(unref(TabList), { class: "tab-list custom-scroll" }, {
|
|
2227
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
|
|
2228
|
+
_: 3
|
|
2229
|
+
})]),
|
|
2230
|
+
_: 3
|
|
2231
|
+
})]),
|
|
2232
|
+
_: 3
|
|
2233
|
+
});
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
}), [["__scopeId", "data-v-fec8fbbb"]]);
|
|
2237
|
+
//#endregion
|
|
2238
|
+
//#region src/features/example-responses/has-response-content.ts
|
|
2239
|
+
/**
|
|
2240
|
+
* Checks if a media type object has any displayable content.
|
|
2241
|
+
* This includes having a schema, a single example, or multiple examples.
|
|
2242
|
+
*
|
|
2243
|
+
* Note: We use explicit property checks for `example` because falsy values
|
|
2244
|
+
* like `0`, `false`, and `""` are valid JSON examples that should be displayed.
|
|
2245
|
+
* We still treat `null` as "no content" since it explicitly indicates absence.
|
|
2246
|
+
*/
|
|
2247
|
+
function hasMediaTypeContent(mediaType) {
|
|
2248
|
+
if (!mediaType) return false;
|
|
2249
|
+
const hasSchema = Boolean(mediaType.schema);
|
|
2250
|
+
const hasExample = "example" in mediaType && mediaType.example !== null;
|
|
2251
|
+
const hasExamples = Boolean(mediaType.examples);
|
|
2252
|
+
return hasSchema || hasExample || hasExamples;
|
|
2253
|
+
}
|
|
2254
|
+
function isResponseKey(responseKey) {
|
|
2255
|
+
return responseKey === "default" || /^[1-5][0-9]{2}$/.test(responseKey) || /^[1-5]XX$/.test(responseKey);
|
|
2256
|
+
}
|
|
2257
|
+
/**
|
|
2258
|
+
* Checks if a response object has body content (schema, example, or examples).
|
|
2259
|
+
* Looks through common media types in priority order.
|
|
2260
|
+
*/
|
|
2261
|
+
function hasResponseContent(response, responseKey) {
|
|
2262
|
+
if (responseKey !== void 0) {
|
|
2263
|
+
if (!isResponseKey(responseKey)) return false;
|
|
2264
|
+
return Boolean(response);
|
|
2265
|
+
}
|
|
2266
|
+
const normalizedContent = normalizeMimeTypeObject(response?.content);
|
|
2267
|
+
const keys = getObjectKeys(normalizedContent ?? {});
|
|
2268
|
+
return hasMediaTypeContent(normalizedContent?.["application/json"] ?? normalizedContent?.["application/xml"] ?? normalizedContent?.["text/plain"] ?? normalizedContent?.["text/html"] ?? normalizedContent?.["*/*"] ?? normalizedContent?.[keys[0] ?? ""]);
|
|
2269
|
+
}
|
|
2270
|
+
//#endregion
|
|
2271
|
+
//#region src/features/example-responses/ExampleResponses.vue?vue&type=script&setup=true&lang.ts
|
|
2272
|
+
var _hoisted_1$10 = {
|
|
2273
|
+
key: 1,
|
|
2274
|
+
class: "scalar-card-checkbox"
|
|
2275
|
+
};
|
|
2276
|
+
var _hoisted_2$7 = ["aria-controls"];
|
|
2277
|
+
var _hoisted_3$6 = { class: "response-description" };
|
|
2278
|
+
//#endregion
|
|
2279
|
+
//#region src/features/example-responses/ExampleResponses.vue
|
|
2280
|
+
var ExampleResponses_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2281
|
+
__name: "ExampleResponses",
|
|
2282
|
+
props: { responses: {} },
|
|
2283
|
+
setup(__props) {
|
|
2284
|
+
const id = useId();
|
|
2285
|
+
const { copyToClipboard } = useClipboard();
|
|
2286
|
+
const orderedStatusCodes = computed(() => Object.keys(__props.responses ?? {}).sort());
|
|
2287
|
+
const statusCodesWithContent = computed(() => orderedStatusCodes.value.filter((statusCode) => hasResponseContent(getResolvedRef(__props.responses?.[statusCode]), statusCode)));
|
|
2288
|
+
const selectedResponseIndex = ref(0);
|
|
2289
|
+
/**
|
|
2290
|
+
* Clamp the selected index when the filtered list shrinks.
|
|
2291
|
+
* Without this, the index can become out of bounds and cause a mismatch
|
|
2292
|
+
* between the visible tabs and the displayed content.
|
|
2293
|
+
*
|
|
2294
|
+
* We also reset `selectedExampleKey` to match the behavior of `changeTab`,
|
|
2295
|
+
* since the new response may not have the same example keys.
|
|
2296
|
+
*/
|
|
2297
|
+
watch(statusCodesWithContent, (codes) => {
|
|
2298
|
+
if (codes.length === 0) {
|
|
2299
|
+
selectedResponseIndex.value = 0;
|
|
2300
|
+
selectedExampleKey.value = "";
|
|
2301
|
+
} else if (selectedResponseIndex.value >= codes.length) {
|
|
2302
|
+
selectedResponseIndex.value = codes.length - 1;
|
|
2303
|
+
selectedExampleKey.value = "";
|
|
2304
|
+
}
|
|
2305
|
+
});
|
|
2306
|
+
const currentResponse = computed(() => {
|
|
2307
|
+
const currentStatusCode = toValue(statusCodesWithContent)[toValue(selectedResponseIndex)] ?? "";
|
|
2308
|
+
return getResolvedRef(__props.responses?.[currentStatusCode]);
|
|
2309
|
+
});
|
|
2310
|
+
const currentResponseContent = computed(() => {
|
|
2311
|
+
const normalizedContent = normalizeMimeTypeObject(currentResponse.value?.content);
|
|
2312
|
+
/** All the keys of the normalized content */
|
|
2313
|
+
const keys = getObjectKeys(normalizedContent ?? {});
|
|
2314
|
+
return normalizedContent?.["application/json"] ?? normalizedContent?.["application/xml"] ?? normalizedContent?.["text/plain"] ?? normalizedContent?.["text/html"] ?? normalizedContent?.["*/*"] ?? normalizedContent?.[keys[0] ?? ""] ?? void 0;
|
|
2315
|
+
});
|
|
2316
|
+
const hasMultipleExamples = computed(() => !!currentResponseContent.value?.examples && Object.keys(currentResponseContent.value?.examples ?? {}).length > 1);
|
|
2317
|
+
const selectedExampleKey = ref(Object.keys(currentResponseContent.value?.examples ?? {})[0] ?? "");
|
|
2318
|
+
/** Get the current example to display */
|
|
2319
|
+
const currentExample = computed(() => {
|
|
2320
|
+
if (!currentResponseContent.value) return;
|
|
2321
|
+
if (hasMultipleExamples.value && selectedExampleKey.value) return currentResponseContent.value.examples?.[selectedExampleKey.value];
|
|
2322
|
+
return getExample(currentResponseContent.value, void 0, void 0);
|
|
2323
|
+
});
|
|
2324
|
+
const changeTab = (index) => {
|
|
2325
|
+
selectedResponseIndex.value = index;
|
|
2326
|
+
selectedExampleKey.value = "";
|
|
2327
|
+
};
|
|
2328
|
+
const showSchema = ref(false);
|
|
2329
|
+
return (_ctx, _cache) => {
|
|
2330
|
+
return statusCodesWithContent.value.length ? (openBlock(), createBlock(unref(ScalarCard), {
|
|
2331
|
+
key: 0,
|
|
2332
|
+
"aria-label": "Example Responses",
|
|
2333
|
+
class: "response-card",
|
|
2334
|
+
role: "region"
|
|
2335
|
+
}, {
|
|
2336
|
+
default: withCtx(() => [
|
|
2337
|
+
createVNode(ExampleResponseTabList_default, { onChange: changeTab }, {
|
|
2338
|
+
actions: withCtx(() => [currentResponseContent.value?.example ? (openBlock(), createElementBlock("button", {
|
|
2339
|
+
key: 0,
|
|
2340
|
+
class: "code-copy",
|
|
2341
|
+
type: "button",
|
|
2342
|
+
onClick: _cache[0] || (_cache[0] = () => unref(copyToClipboard)(currentResponseContent.value?.example))
|
|
2343
|
+
}, [createVNode(unref(ScalarIcon), {
|
|
2344
|
+
icon: "Clipboard",
|
|
2345
|
+
width: "12px"
|
|
2346
|
+
})])) : createCommentVNode("", true), currentResponseContent.value?.schema ? (openBlock(), createElementBlock("label", _hoisted_1$10, [
|
|
2347
|
+
_cache[4] || (_cache[4] = createTextVNode(" Show Schema ", -1)),
|
|
2348
|
+
withDirectives(createElementVNode("input", {
|
|
2349
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => showSchema.value = $event),
|
|
2350
|
+
"aria-controls": unref(id),
|
|
2351
|
+
class: "scalar-card-checkbox-input",
|
|
2352
|
+
type: "checkbox"
|
|
2353
|
+
}, null, 8, _hoisted_2$7), [[vModelCheckbox, showSchema.value]]),
|
|
2354
|
+
_cache[5] || (_cache[5] = createElementVNode("span", { class: "scalar-card-checkbox-checkmark" }, null, -1))
|
|
2355
|
+
])) : createCommentVNode("", true)]),
|
|
2356
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(statusCodesWithContent.value, (statusCode) => {
|
|
2357
|
+
return openBlock(), createBlock(ExampleResponseTab_default, {
|
|
2358
|
+
key: statusCode,
|
|
2359
|
+
"aria-controls": unref(id)
|
|
2360
|
+
}, {
|
|
2361
|
+
default: withCtx(() => [createVNode(ScreenReader_default, null, {
|
|
2362
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("Status:", -1)])]),
|
|
2363
|
+
_: 1
|
|
2364
|
+
}), createTextVNode(" " + toDisplayString(statusCode), 1)]),
|
|
2365
|
+
_: 2
|
|
2366
|
+
}, 1032, ["aria-controls"]);
|
|
2367
|
+
}), 128))]),
|
|
2368
|
+
_: 1
|
|
2369
|
+
}),
|
|
2370
|
+
createVNode(unref(ScalarCardSection), { class: "grid flex-1" }, {
|
|
2371
|
+
default: withCtx(() => [currentResponseContent.value?.schema && showSchema.value ? (openBlock(), createBlock(ExampleSchema_default, {
|
|
2372
|
+
key: 0,
|
|
2373
|
+
id: unref(id),
|
|
2374
|
+
schema: currentResponseContent.value?.schema
|
|
2375
|
+
}, null, 8, ["id", "schema"])) : (openBlock(), createBlock(ExampleResponse_default, {
|
|
2376
|
+
key: 1,
|
|
2377
|
+
id: unref(id),
|
|
2378
|
+
example: currentExample.value,
|
|
2379
|
+
response: currentResponseContent.value
|
|
2380
|
+
}, null, 8, [
|
|
2381
|
+
"id",
|
|
2382
|
+
"example",
|
|
2383
|
+
"response"
|
|
2384
|
+
]))]),
|
|
2385
|
+
_: 1
|
|
2386
|
+
}),
|
|
2387
|
+
currentResponse.value?.description || hasMultipleExamples.value ? (openBlock(), createBlock(unref(ScalarCardFooter), {
|
|
2388
|
+
key: 0,
|
|
2389
|
+
class: "response-card-footer"
|
|
2390
|
+
}, {
|
|
2391
|
+
default: withCtx(() => [hasMultipleExamples.value ? (openBlock(), createBlock(unref(ExamplePicker), {
|
|
2392
|
+
key: 0,
|
|
2393
|
+
modelValue: selectedExampleKey.value,
|
|
2394
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selectedExampleKey.value = $event),
|
|
2395
|
+
class: "response-example-selector px-0",
|
|
2396
|
+
examples: currentResponseContent.value?.examples
|
|
2397
|
+
}, null, 8, ["modelValue", "examples"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$6, [currentResponse.value?.description ? (openBlock(), createBlock(unref(ScalarMarkdown), {
|
|
2398
|
+
key: 0,
|
|
2399
|
+
class: "response-description-markdown",
|
|
2400
|
+
value: currentResponse.value.description
|
|
2401
|
+
}, null, 8, ["value"])) : createCommentVNode("", true)])]),
|
|
2402
|
+
_: 1
|
|
2403
|
+
})) : createCommentVNode("", true)
|
|
2404
|
+
]),
|
|
2405
|
+
_: 1
|
|
2406
|
+
})) : createCommentVNode("", true);
|
|
2407
|
+
};
|
|
2408
|
+
}
|
|
2409
|
+
}), [["__scopeId", "data-v-5b8a574c"]]);
|
|
2410
|
+
//#endregion
|
|
2411
|
+
//#region src/features/Operation/components/ContentTypeSelect.vue
|
|
2412
|
+
var ContentTypeSelect_default = /* @__PURE__ */ defineComponent({
|
|
2413
|
+
inheritAttrs: false,
|
|
2414
|
+
__name: "ContentTypeSelect",
|
|
2415
|
+
props: /* @__PURE__ */ mergeModels({ content: {} }, {
|
|
2416
|
+
"modelValue": { required: true },
|
|
2417
|
+
"modelModifiers": {}
|
|
2418
|
+
}),
|
|
2419
|
+
emits: ["update:modelValue"],
|
|
2420
|
+
setup(__props) {
|
|
2421
|
+
/** The selected content type with two-way binding */
|
|
2422
|
+
const selectedContentType = useModel(__props, "modelValue");
|
|
2423
|
+
const contentTypes = computed(() => Object.keys(__props.content ?? {}));
|
|
2424
|
+
const selectedOption = computed({
|
|
2425
|
+
get: () => options.value.find((option) => option.id === selectedContentType.value),
|
|
2426
|
+
set: (option) => {
|
|
2427
|
+
if (option) selectedContentType.value = option.id;
|
|
2428
|
+
}
|
|
2429
|
+
});
|
|
2430
|
+
const options = computed(() => {
|
|
2431
|
+
return contentTypes.value.map((type) => ({
|
|
2432
|
+
id: type,
|
|
2433
|
+
label: type
|
|
2434
|
+
}));
|
|
2435
|
+
});
|
|
2436
|
+
const contentTypeSelect = cva({
|
|
2437
|
+
base: "font-normal text-c-2 bg-b-1 py-1 flex items-center gap-1 rounded-full text-xs leading-none border",
|
|
2438
|
+
variants: { dropdown: {
|
|
2439
|
+
true: "hover:text-c-1 pl-2 pr-1.5 font-medium cursor-pointer",
|
|
2440
|
+
false: "px-2"
|
|
2441
|
+
} }
|
|
2442
|
+
});
|
|
2443
|
+
return (_ctx, _cache) => {
|
|
2444
|
+
return contentTypes.value.length > 1 ? (openBlock(), createBlock(unref(ScalarListbox), {
|
|
2445
|
+
key: 0,
|
|
2446
|
+
modelValue: selectedOption.value,
|
|
2447
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedOption.value = $event),
|
|
2448
|
+
options: options.value,
|
|
2449
|
+
placement: "bottom-end",
|
|
2450
|
+
teleport: "",
|
|
2451
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"]))
|
|
2452
|
+
}, {
|
|
2453
|
+
default: withCtx(({ open }) => [createVNode(unref(ScalarButton), mergeProps({
|
|
2454
|
+
class: ["h-fit", unref(contentTypeSelect)({ dropdown: true })],
|
|
2455
|
+
variant: "ghost"
|
|
2456
|
+
}, _ctx.$attrs, { onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])) }), {
|
|
2457
|
+
default: withCtx(() => [
|
|
2458
|
+
createVNode(ScreenReader_default, null, {
|
|
2459
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("Selected Content Type:", -1)])]),
|
|
2460
|
+
_: 1
|
|
2461
|
+
}),
|
|
2462
|
+
createElementVNode("span", null, toDisplayString(selectedContentType.value), 1),
|
|
2463
|
+
createVNode(unref(ScalarIconCaretDown), {
|
|
2464
|
+
class: normalizeClass(["size-2.75 transition-transform duration-100", { "rotate-180": open }]),
|
|
2465
|
+
weight: "bold"
|
|
2466
|
+
}, null, 8, ["class"])
|
|
2467
|
+
]),
|
|
2468
|
+
_: 2
|
|
2469
|
+
}, 1040, ["class"])]),
|
|
2470
|
+
_: 1
|
|
2471
|
+
}, 8, ["modelValue", "options"])) : (openBlock(), createElementBlock("div", mergeProps({
|
|
2472
|
+
key: 1,
|
|
2473
|
+
class: ["selected-content-type", unref(contentTypeSelect)({ dropdown: false })]
|
|
2474
|
+
}, _ctx.$attrs, { tabindex: "0" }), [createElementVNode("span", null, toDisplayString(selectedContentType.value), 1)], 16));
|
|
2475
|
+
};
|
|
2476
|
+
}
|
|
2477
|
+
});
|
|
2478
|
+
//#endregion
|
|
2479
|
+
//#region src/features/Operation/components/Header.vue
|
|
2480
|
+
var Header_default = /* @__PURE__ */ defineComponent({
|
|
2481
|
+
__name: "Header",
|
|
2482
|
+
props: {
|
|
2483
|
+
header: {},
|
|
2484
|
+
name: {},
|
|
2485
|
+
breadcrumb: {},
|
|
2486
|
+
eventBus: {},
|
|
2487
|
+
orderSchemaPropertiesBy: {},
|
|
2488
|
+
orderRequiredPropertiesFirst: { type: Boolean }
|
|
2489
|
+
},
|
|
2490
|
+
setup(__props) {
|
|
2491
|
+
return (_ctx, _cache) => {
|
|
2492
|
+
return "schema" in __props.header && __props.header.schema ? (openBlock(), createBlock(SchemaProperty_default, {
|
|
2493
|
+
key: 0,
|
|
2494
|
+
breadcrumb: __props.breadcrumb ? [...__props.breadcrumb, "headers"] : void 0,
|
|
2495
|
+
description: __props.header.description,
|
|
2496
|
+
eventBus: __props.eventBus,
|
|
2497
|
+
name: __props.name,
|
|
2498
|
+
options: {
|
|
2499
|
+
orderRequiredPropertiesFirst: __props.orderRequiredPropertiesFirst,
|
|
2500
|
+
orderSchemaPropertiesBy: __props.orderSchemaPropertiesBy
|
|
2501
|
+
},
|
|
2502
|
+
schema: unref(getResolvedRef)(__props.header.schema)
|
|
2503
|
+
}, null, 8, [
|
|
2504
|
+
"breadcrumb",
|
|
2505
|
+
"description",
|
|
2506
|
+
"eventBus",
|
|
2507
|
+
"name",
|
|
2508
|
+
"options",
|
|
2509
|
+
"schema"
|
|
2510
|
+
])) : createCommentVNode("", true);
|
|
2511
|
+
};
|
|
2512
|
+
}
|
|
2513
|
+
});
|
|
2514
|
+
//#endregion
|
|
2515
|
+
//#region src/features/Operation/components/Headers.vue
|
|
2516
|
+
var Headers_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2517
|
+
__name: "Headers",
|
|
2518
|
+
props: {
|
|
2519
|
+
headers: {},
|
|
2520
|
+
breadcrumb: {},
|
|
2521
|
+
eventBus: {},
|
|
2522
|
+
orderRequiredPropertiesFirst: { type: Boolean },
|
|
2523
|
+
orderSchemaPropertiesBy: {}
|
|
2524
|
+
},
|
|
2525
|
+
setup(__props) {
|
|
2526
|
+
return (_ctx, _cache) => {
|
|
2527
|
+
return openBlock(), createBlock(unref(Disclosure), null, {
|
|
2528
|
+
default: withCtx(({ open }) => [createElementVNode("div", { class: normalizeClass(["headers-card headers-card--compact", [{ "headers-card--open": open }]]) }, [createElementVNode("div", { class: normalizeClass(["headers-properties", { "headers-properties-open": open }]) }, [createVNode(unref(DisclosureButton), {
|
|
2529
|
+
class: "headers-card-title headers-card-title--compact",
|
|
2530
|
+
style: { top: `calc(var(--refs-viewport-offset)))` }
|
|
2531
|
+
}, {
|
|
2532
|
+
default: withCtx(() => [createVNode(unref(ScalarIcon), {
|
|
2533
|
+
class: normalizeClass(["headers-card-title-icon", { "headers-card-title-icon--open": open }]),
|
|
2534
|
+
icon: "Add",
|
|
2535
|
+
size: "sm"
|
|
2536
|
+
}, null, 8, ["class"]), open ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" Hide Headers ")], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(" Show Headers ")], 64))]),
|
|
2537
|
+
_: 2
|
|
2538
|
+
}, 1024), createVNode(unref(DisclosurePanel), null, {
|
|
2539
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.headers, (header, key) => {
|
|
2540
|
+
return openBlock(), createBlock(Header_default, {
|
|
2541
|
+
key,
|
|
2542
|
+
breadcrumb: __props.breadcrumb ? [...__props.breadcrumb, "headers"] : void 0,
|
|
2543
|
+
eventBus: __props.eventBus,
|
|
2544
|
+
header: unref(getResolvedRef)(header),
|
|
2545
|
+
name: key,
|
|
2546
|
+
orderRequiredPropertiesFirst: __props.orderRequiredPropertiesFirst,
|
|
2547
|
+
orderSchemaPropertiesBy: __props.orderSchemaPropertiesBy
|
|
2548
|
+
}, null, 8, [
|
|
2549
|
+
"breadcrumb",
|
|
2550
|
+
"eventBus",
|
|
2551
|
+
"header",
|
|
2552
|
+
"name",
|
|
2553
|
+
"orderRequiredPropertiesFirst",
|
|
2554
|
+
"orderSchemaPropertiesBy"
|
|
2555
|
+
]);
|
|
2556
|
+
}), 128))]),
|
|
2557
|
+
_: 1
|
|
2558
|
+
})], 2)], 2)]),
|
|
2559
|
+
_: 1
|
|
2560
|
+
});
|
|
2561
|
+
};
|
|
2562
|
+
}
|
|
2563
|
+
}), [["__scopeId", "data-v-ab19704d"]]);
|
|
2564
|
+
//#endregion
|
|
2565
|
+
//#region src/features/Operation/components/ParameterListItem.vue?vue&type=script&setup=true&lang.ts
|
|
2566
|
+
var _hoisted_1$9 = { class: "parameter-item group/parameter-item" };
|
|
2567
|
+
var _hoisted_2$6 = { class: "parameter-item-name min-w-0" };
|
|
2568
|
+
var _hoisted_3$5 = {
|
|
2569
|
+
key: 1,
|
|
2570
|
+
class: "flex-1"
|
|
2571
|
+
};
|
|
2572
|
+
//#endregion
|
|
2573
|
+
//#region src/features/Operation/components/ParameterListItem.vue
|
|
2574
|
+
var ParameterListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2575
|
+
__name: "ParameterListItem",
|
|
2576
|
+
props: {
|
|
2577
|
+
parameter: {},
|
|
2578
|
+
name: {},
|
|
2579
|
+
breadcrumb: {},
|
|
2580
|
+
eventBus: {},
|
|
2581
|
+
collapsableItems: { type: Boolean },
|
|
2582
|
+
options: {}
|
|
2583
|
+
},
|
|
2584
|
+
setup(__props) {
|
|
2585
|
+
/** Responses and params may both have a schema */
|
|
2586
|
+
const schema = computed(() => "schema" in __props.parameter && __props.parameter.schema ? getResolvedRef(__props.parameter.schema) : null);
|
|
2587
|
+
/** Response and params may both have content */
|
|
2588
|
+
const content = computed(() => "content" in __props.parameter && __props.parameter.content ? __props.parameter.content : null);
|
|
2589
|
+
const selectedContentType = ref(Object.keys(content.value || {})[0] ?? "");
|
|
2590
|
+
/** Response headers */
|
|
2591
|
+
const headers = computed(() => "headers" in __props.parameter && __props.parameter.headers ? __props.parameter.headers : null);
|
|
2592
|
+
/** Raw schema (possibly with $ref) for the selected content type or param. */
|
|
2593
|
+
const baseSchema = computed(() => content.value ? content.value?.[selectedContentType.value]?.schema : "schema" in __props.parameter && __props.parameter.schema ? __props.parameter.schema : null);
|
|
2594
|
+
/** When the schema is a $ref, preserve its name so the UI can show the ref name instead of just the type. */
|
|
2595
|
+
const schemaModelName = computed(() => {
|
|
2596
|
+
const raw = baseSchema.value;
|
|
2597
|
+
if (!raw) return null;
|
|
2598
|
+
if ("$ref" in raw) return getRefName(raw.$ref);
|
|
2599
|
+
return null;
|
|
2600
|
+
});
|
|
2601
|
+
/** Computed value from the combined schema param and content param */
|
|
2602
|
+
const value = computed(() => {
|
|
2603
|
+
const base = baseSchema.value;
|
|
2604
|
+
const resolvedBase = content.value ? getResolvedRef(base) : schema.value;
|
|
2605
|
+
const deprecated = "deprecated" in __props.parameter ? __props.parameter.deprecated : schema.value?.deprecated;
|
|
2606
|
+
const paramExamples = "examples" in __props.parameter ? __props.parameter.examples : {};
|
|
2607
|
+
const recordExamples = Object.values({
|
|
2608
|
+
...paramExamples,
|
|
2609
|
+
...content.value?.[selectedContentType.value]?.examples
|
|
2610
|
+
});
|
|
2611
|
+
const arrayExamples = schema.value?.examples ?? (recordExamples.length === 0 && "example" in __props.parameter ? [__props.parameter.example] : []);
|
|
2612
|
+
/** Combine param examples with content ones */
|
|
2613
|
+
const examples = [...recordExamples, ...arrayExamples];
|
|
2614
|
+
return {
|
|
2615
|
+
...resolvedBase,
|
|
2616
|
+
deprecated,
|
|
2617
|
+
examples
|
|
2618
|
+
};
|
|
2619
|
+
});
|
|
2620
|
+
/**
|
|
2621
|
+
* Determines whether this parameter item should be rendered as a collapsible disclosure.
|
|
2622
|
+
* Only collapses when collapsableItems is enabled and the parameter has additional
|
|
2623
|
+
* content to display (content types, headers, or schema details).
|
|
2624
|
+
*/
|
|
2625
|
+
const shouldCollapse = computed(() => Boolean(__props.collapsableItems && (content.value || headers.value || schema.value)));
|
|
2626
|
+
return (_ctx, _cache) => {
|
|
2627
|
+
return openBlock(), createElementBlock("li", _hoisted_1$9, [createVNode(unref(Disclosure), null, {
|
|
2628
|
+
default: withCtx(({ open }) => [shouldCollapse.value ? (openBlock(), createBlock(unref(DisclosureButton), {
|
|
2629
|
+
key: 0,
|
|
2630
|
+
class: normalizeClass(["parameter-item-trigger", { "parameter-item-trigger-open": open }])
|
|
2631
|
+
}, {
|
|
2632
|
+
default: withCtx(() => [
|
|
2633
|
+
createElementVNode("div", _hoisted_2$6, [createVNode(unref(ScalarIconCaretRight), {
|
|
2634
|
+
class: normalizeClass(["parameter-item-icon size-3 transition-transform duration-100", { "rotate-90": open }]),
|
|
2635
|
+
weight: "bold"
|
|
2636
|
+
}, null, 8, ["class"]), createElementVNode("div", null, [createVNode(unref(ScalarWrappingText), {
|
|
2637
|
+
preset: "property",
|
|
2638
|
+
text: __props.name
|
|
2639
|
+
}, null, 8, ["text"])])]),
|
|
2640
|
+
!open && __props.parameter.description ? (openBlock(), createBlock(unref(ScalarMarkdownSummary), {
|
|
2641
|
+
key: 0,
|
|
2642
|
+
class: "parameter-item-description-summary min-w-0 flex-1",
|
|
2643
|
+
controlled: "",
|
|
2644
|
+
value: __props.parameter.description
|
|
2645
|
+
}, null, 8, ["value"])) : (openBlock(), createElementBlock("div", _hoisted_3$5)),
|
|
2646
|
+
createElementVNode("div", { class: normalizeClass(["absolute top-[calc(9px+0.5lh)] right-0 z-0 flex -translate-y-1/2 items-center", { "opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100": !open }]) }, [_cache[1] || (_cache[1] = createElementVNode("div", { class: "from-b-1 absolute inset-y-0 -left-6 -z-1 w-8 bg-linear-to-l from-40% to-transparent" }, null, -1)), shouldCollapse.value && content.value ? (openBlock(), createBlock(ContentTypeSelect_default, {
|
|
2647
|
+
key: 0,
|
|
2648
|
+
modelValue: selectedContentType.value,
|
|
2649
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedContentType.value = $event),
|
|
2650
|
+
content: content.value
|
|
2651
|
+
}, null, 8, ["modelValue", "content"])) : createCommentVNode("", true)], 2)
|
|
2652
|
+
]),
|
|
2653
|
+
_: 2
|
|
2654
|
+
}, 1032, ["class"])) : createCommentVNode("", true), createVNode(unref(DisclosurePanel), {
|
|
2655
|
+
class: "parameter-item-container parameter-item-container-markdown",
|
|
2656
|
+
static: !shouldCollapse.value
|
|
2657
|
+
}, {
|
|
2658
|
+
default: withCtx(() => [
|
|
2659
|
+
shouldCollapse.value && __props.parameter.description ? (openBlock(), createBlock(unref(ScalarMarkdown), {
|
|
2660
|
+
key: 0,
|
|
2661
|
+
class: "parameter-item-description",
|
|
2662
|
+
value: __props.parameter.description
|
|
2663
|
+
}, null, 8, ["value"])) : createCommentVNode("", true),
|
|
2664
|
+
headers.value ? (openBlock(), createBlock(Headers_default, {
|
|
2665
|
+
key: 1,
|
|
2666
|
+
breadcrumb: __props.breadcrumb,
|
|
2667
|
+
eventBus: __props.eventBus,
|
|
2668
|
+
headers: headers.value,
|
|
2669
|
+
orderRequiredPropertiesFirst: __props.options.orderRequiredPropertiesFirst,
|
|
2670
|
+
orderSchemaPropertiesBy: __props.options.orderSchemaPropertiesBy
|
|
2671
|
+
}, null, 8, [
|
|
2672
|
+
"breadcrumb",
|
|
2673
|
+
"eventBus",
|
|
2674
|
+
"headers",
|
|
2675
|
+
"orderRequiredPropertiesFirst",
|
|
2676
|
+
"orderSchemaPropertiesBy"
|
|
2677
|
+
])) : createCommentVNode("", true),
|
|
2678
|
+
createVNode(SchemaProperty_default, {
|
|
2679
|
+
is: "div",
|
|
2680
|
+
breadcrumb: __props.breadcrumb,
|
|
2681
|
+
compact: "",
|
|
2682
|
+
description: shouldCollapse.value ? "" : __props.parameter.description,
|
|
2683
|
+
eventBus: __props.eventBus,
|
|
2684
|
+
hideWriteOnly: true,
|
|
2685
|
+
modelName: schemaModelName.value,
|
|
2686
|
+
name: shouldCollapse.value ? "" : __props.name,
|
|
2687
|
+
noncollapsible: true,
|
|
2688
|
+
options: {
|
|
2689
|
+
hideWriteOnly: true,
|
|
2690
|
+
orderRequiredPropertiesFirst: __props.options.orderRequiredPropertiesFirst,
|
|
2691
|
+
orderSchemaPropertiesBy: __props.options.orderSchemaPropertiesBy
|
|
2692
|
+
},
|
|
2693
|
+
required: "required" in __props.parameter && __props.parameter.required,
|
|
2694
|
+
schema: value.value
|
|
2695
|
+
}, null, 8, [
|
|
2696
|
+
"breadcrumb",
|
|
2697
|
+
"description",
|
|
2698
|
+
"eventBus",
|
|
2699
|
+
"modelName",
|
|
2700
|
+
"name",
|
|
2701
|
+
"options",
|
|
2702
|
+
"required",
|
|
2703
|
+
"schema"
|
|
2704
|
+
])
|
|
2705
|
+
]),
|
|
2706
|
+
_: 1
|
|
2707
|
+
}, 8, ["static"])]),
|
|
2708
|
+
_: 1
|
|
2709
|
+
})]);
|
|
2710
|
+
};
|
|
2711
|
+
}
|
|
2712
|
+
}), [["__scopeId", "data-v-d03ca136"]]);
|
|
2713
|
+
//#endregion
|
|
2714
|
+
//#region src/features/Operation/components/ParameterList.vue?vue&type=script&setup=true&lang.ts
|
|
2715
|
+
var _hoisted_1$8 = {
|
|
2716
|
+
key: 0,
|
|
2717
|
+
class: "mt-6"
|
|
2718
|
+
};
|
|
2719
|
+
var _hoisted_2$5 = ["id"];
|
|
2720
|
+
var _hoisted_3$4 = ["aria-labelledby"];
|
|
2721
|
+
//#endregion
|
|
2722
|
+
//#region src/features/Operation/components/ParameterList.vue
|
|
2723
|
+
var ParameterList_default = /* @__PURE__ */ defineComponent({
|
|
2724
|
+
__name: "ParameterList",
|
|
2725
|
+
props: {
|
|
2726
|
+
parameters: {},
|
|
2727
|
+
breadcrumb: {},
|
|
2728
|
+
eventBus: {},
|
|
2729
|
+
collapsableItems: { type: Boolean },
|
|
2730
|
+
options: {}
|
|
2731
|
+
},
|
|
2732
|
+
setup(__props) {
|
|
2733
|
+
/** Accessible id for the heading */
|
|
2734
|
+
const id = useId();
|
|
2735
|
+
return (_ctx, _cache) => {
|
|
2736
|
+
return __props.parameters?.length ? (openBlock(), createElementBlock("div", _hoisted_1$8, [createElementVNode("div", {
|
|
2737
|
+
id: unref(id),
|
|
2738
|
+
class: "text-c-1 mt-3 mb-3 text-lg leading-[1.45] font-medium"
|
|
2739
|
+
}, [renderSlot(_ctx.$slots, "title")], 8, _hoisted_2$5), createElementVNode("ul", {
|
|
2740
|
+
"aria-labelledby": unref(id),
|
|
2741
|
+
class: "mb-3 list-none p-0 text-sm"
|
|
2742
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.parameters, (item) => {
|
|
2743
|
+
return openBlock(), createBlock(ParameterListItem_default, {
|
|
2744
|
+
key: item.name,
|
|
2745
|
+
breadcrumb: __props.breadcrumb,
|
|
2746
|
+
collapsableItems: __props.collapsableItems,
|
|
2747
|
+
eventBus: __props.eventBus,
|
|
2748
|
+
name: item.name,
|
|
2749
|
+
options: __props.options,
|
|
2750
|
+
parameter: item
|
|
2751
|
+
}, null, 8, [
|
|
2752
|
+
"breadcrumb",
|
|
2753
|
+
"collapsableItems",
|
|
2754
|
+
"eventBus",
|
|
2755
|
+
"name",
|
|
2756
|
+
"options",
|
|
2757
|
+
"parameter"
|
|
2758
|
+
]);
|
|
2759
|
+
}), 128))], 8, _hoisted_3$4)])) : createCommentVNode("", true);
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
});
|
|
2763
|
+
//#endregion
|
|
2764
|
+
//#region src/features/Operation/components/RequestBody.vue?vue&type=script&setup=true&lang.ts
|
|
2765
|
+
var _hoisted_1$7 = {
|
|
2766
|
+
key: 0,
|
|
2767
|
+
"aria-label": "Request Body",
|
|
2768
|
+
class: "request-body",
|
|
2769
|
+
role: "group"
|
|
2770
|
+
};
|
|
2771
|
+
var _hoisted_2$4 = { class: "request-body-header" };
|
|
2772
|
+
var _hoisted_3$3 = { class: "request-body-title" };
|
|
2773
|
+
var _hoisted_4$3 = { class: "flex items-center gap-2" };
|
|
2774
|
+
var _hoisted_5$3 = {
|
|
2775
|
+
key: 0,
|
|
2776
|
+
class: "request-body-required"
|
|
2777
|
+
};
|
|
2778
|
+
var _hoisted_6$2 = {
|
|
2779
|
+
key: 0,
|
|
2780
|
+
class: "request-body-description"
|
|
2781
|
+
};
|
|
2782
|
+
var _hoisted_7$1 = {
|
|
2783
|
+
key: 0,
|
|
2784
|
+
class: "request-body-schema"
|
|
2785
|
+
};
|
|
2786
|
+
var _hoisted_8$1 = {
|
|
2787
|
+
key: 1,
|
|
2788
|
+
class: "request-body-schema"
|
|
2789
|
+
};
|
|
2790
|
+
var MAX_VISIBLE_PROPERTIES = 12;
|
|
2791
|
+
//#endregion
|
|
2792
|
+
//#region src/features/Operation/components/RequestBody.vue
|
|
2793
|
+
var RequestBody_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
2794
|
+
__name: "RequestBody",
|
|
2795
|
+
props: {
|
|
2796
|
+
breadcrumb: {},
|
|
2797
|
+
requestBody: {},
|
|
2798
|
+
eventBus: {},
|
|
2799
|
+
options: {}
|
|
2800
|
+
},
|
|
2801
|
+
setup(__props) {
|
|
2802
|
+
/**
|
|
2803
|
+
* The maximum number of properties to show in the request body schema.
|
|
2804
|
+
*/
|
|
2805
|
+
const availableContentTypes = computed(() => Object.keys(__props.requestBody?.content ?? {}));
|
|
2806
|
+
const selectedContentType = ref("application/json");
|
|
2807
|
+
if (__props.requestBody?.content) {
|
|
2808
|
+
if (availableContentTypes.value[0]) selectedContentType.value = availableContentTypes.value[0];
|
|
2809
|
+
}
|
|
2810
|
+
const schema = computed(() => getResolvedRef(__props.requestBody?.content?.[selectedContentType.value]?.schema));
|
|
2811
|
+
/**
|
|
2812
|
+
* Splits schema properties into visible and collapsed sections when there are more than 12 properties.
|
|
2813
|
+
* Returns null for schemas with fewer properties or non-object schemas.
|
|
2814
|
+
*/
|
|
2815
|
+
const partitionedSchema = computed(() => {
|
|
2816
|
+
if (!schema.value || !isTypeObject(schema.value)) return null;
|
|
2817
|
+
const sortedNames = sortPropertyNames(schema.value, schema.value.discriminator, {
|
|
2818
|
+
hideReadOnly: true,
|
|
2819
|
+
orderSchemaPropertiesBy: __props.options.orderSchemaPropertiesBy,
|
|
2820
|
+
orderRequiredPropertiesFirst: __props.options.orderRequiredPropertiesFirst
|
|
2821
|
+
});
|
|
2822
|
+
if (sortedNames.length <= MAX_VISIBLE_PROPERTIES) return null;
|
|
2823
|
+
const { properties, ...schemaMetadata } = schema.value;
|
|
2824
|
+
if (!properties) return null;
|
|
2825
|
+
return {
|
|
2826
|
+
visibleProperties: {
|
|
2827
|
+
...schemaMetadata,
|
|
2828
|
+
properties: reduceNamesToObject(sortedNames.slice(0, MAX_VISIBLE_PROPERTIES), properties)
|
|
2829
|
+
},
|
|
2830
|
+
collapsedProperties: {
|
|
2831
|
+
...schemaMetadata,
|
|
2832
|
+
properties: reduceNamesToObject(sortedNames.slice(MAX_VISIBLE_PROPERTIES), properties)
|
|
2833
|
+
}
|
|
2834
|
+
};
|
|
2835
|
+
});
|
|
2836
|
+
/**
|
|
2837
|
+
* We don't want to render the request body if its completely empty
|
|
2838
|
+
* @example
|
|
2839
|
+
* {
|
|
2840
|
+
* "content": {},
|
|
2841
|
+
* }
|
|
2842
|
+
*/
|
|
2843
|
+
const shouldRenderRequestBody = computed(() => Object.keys(__props.requestBody?.content ?? {}).length > 0 || __props.requestBody?.description || __props.requestBody?.required);
|
|
2844
|
+
return (_ctx, _cache) => {
|
|
2845
|
+
return __props.requestBody && shouldRenderRequestBody.value ? (openBlock(), createElementBlock("div", _hoisted_1$7, [createElementVNode("div", _hoisted_2$4, [
|
|
2846
|
+
createElementVNode("div", _hoisted_3$3, [renderSlot(_ctx.$slots, "title", {}, void 0, true)]),
|
|
2847
|
+
createElementVNode("div", _hoisted_4$3, [__props.requestBody.required ? (openBlock(), createElementBlock("div", _hoisted_5$3, " required ")) : createCommentVNode("", true), createVNode(ContentTypeSelect_default, {
|
|
2848
|
+
modelValue: selectedContentType.value,
|
|
2849
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedContentType.value = $event),
|
|
2850
|
+
content: __props.requestBody.content
|
|
2851
|
+
}, null, 8, ["modelValue", "content"])]),
|
|
2852
|
+
__props.requestBody.description ? (openBlock(), createElementBlock("div", _hoisted_6$2, [createVNode(unref(ScalarMarkdown), { value: __props.requestBody.description }, null, 8, ["value"])])) : createCommentVNode("", true)
|
|
2853
|
+
]), partitionedSchema.value ? (openBlock(), createElementBlock("div", _hoisted_7$1, [createVNode(unref(Schema_default), {
|
|
2854
|
+
breadcrumb: __props.breadcrumb,
|
|
2855
|
+
compact: "",
|
|
2856
|
+
eventBus: __props.eventBus,
|
|
2857
|
+
name: "Request Body",
|
|
2858
|
+
noncollapsible: "",
|
|
2859
|
+
options: {
|
|
2860
|
+
hideReadOnly: true,
|
|
2861
|
+
orderRequiredPropertiesFirst: __props.options.orderRequiredPropertiesFirst,
|
|
2862
|
+
orderSchemaPropertiesBy: __props.options.orderSchemaPropertiesBy
|
|
2863
|
+
},
|
|
2864
|
+
schema: partitionedSchema.value.visibleProperties
|
|
2865
|
+
}, null, 8, [
|
|
2866
|
+
"breadcrumb",
|
|
2867
|
+
"eventBus",
|
|
2868
|
+
"options",
|
|
2869
|
+
"schema"
|
|
2870
|
+
]), createVNode(unref(Schema_default), {
|
|
2871
|
+
additionalProperties: "",
|
|
2872
|
+
breadcrumb: __props.breadcrumb,
|
|
2873
|
+
compact: "",
|
|
2874
|
+
eventBus: __props.eventBus,
|
|
2875
|
+
name: "Request Body",
|
|
2876
|
+
options: {
|
|
2877
|
+
hideReadOnly: true,
|
|
2878
|
+
orderRequiredPropertiesFirst: __props.options.orderRequiredPropertiesFirst,
|
|
2879
|
+
orderSchemaPropertiesBy: __props.options.orderSchemaPropertiesBy
|
|
2880
|
+
},
|
|
2881
|
+
schema: partitionedSchema.value.collapsedProperties
|
|
2882
|
+
}, null, 8, [
|
|
2883
|
+
"breadcrumb",
|
|
2884
|
+
"eventBus",
|
|
2885
|
+
"options",
|
|
2886
|
+
"schema"
|
|
2887
|
+
])])) : schema.value ? (openBlock(), createElementBlock("div", _hoisted_8$1, [createVNode(unref(Schema_default), {
|
|
2888
|
+
breadcrumb: __props.breadcrumb,
|
|
2889
|
+
compact: "",
|
|
2890
|
+
eventBus: __props.eventBus,
|
|
2891
|
+
hideReadOnly: true,
|
|
2892
|
+
name: "Request Body",
|
|
2893
|
+
noncollapsible: "",
|
|
2894
|
+
options: {
|
|
2895
|
+
hideReadOnly: true,
|
|
2896
|
+
orderRequiredPropertiesFirst: __props.options.orderRequiredPropertiesFirst,
|
|
2897
|
+
orderSchemaPropertiesBy: __props.options.orderSchemaPropertiesBy
|
|
2898
|
+
},
|
|
2899
|
+
schema: schema.value
|
|
2900
|
+
}, null, 8, [
|
|
2901
|
+
"breadcrumb",
|
|
2902
|
+
"eventBus",
|
|
2903
|
+
"options",
|
|
2904
|
+
"schema"
|
|
2905
|
+
])])) : createCommentVNode("", true)])) : createCommentVNode("", true);
|
|
2906
|
+
};
|
|
2907
|
+
}
|
|
2908
|
+
}), [["__scopeId", "data-v-17941e59"]]);
|
|
2909
|
+
//#endregion
|
|
2910
|
+
//#region src/features/Operation/components/OperationParameters.vue
|
|
2911
|
+
var OperationParameters_default = /* @__PURE__ */ defineComponent({
|
|
2912
|
+
__name: "OperationParameters",
|
|
2913
|
+
props: {
|
|
2914
|
+
breadcrumb: {},
|
|
2915
|
+
parameters: { default: () => [] },
|
|
2916
|
+
requestBody: {},
|
|
2917
|
+
eventBus: {},
|
|
2918
|
+
options: {}
|
|
2919
|
+
},
|
|
2920
|
+
setup(__props) {
|
|
2921
|
+
/** Use a single loop to reduce parameters by type(in) */
|
|
2922
|
+
const splitParameters = computed(() => (__props.parameters ?? []).reduce((acc, p) => {
|
|
2923
|
+
const parameter = getResolvedRef(p);
|
|
2924
|
+
if (!shouldIgnoreEntity(parameter)) acc[parameter.in].push(parameter);
|
|
2925
|
+
return acc;
|
|
2926
|
+
}, {
|
|
2927
|
+
cookie: [],
|
|
2928
|
+
header: [],
|
|
2929
|
+
path: [],
|
|
2930
|
+
query: []
|
|
2931
|
+
}));
|
|
2932
|
+
return (_ctx, _cache) => {
|
|
2933
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
2934
|
+
createVNode(ParameterList_default, {
|
|
2935
|
+
breadcrumb: __props.breadcrumb ? [...__props.breadcrumb, "path"] : void 0,
|
|
2936
|
+
eventBus: __props.eventBus,
|
|
2937
|
+
options: __props.options,
|
|
2938
|
+
parameters: splitParameters.value["path"]
|
|
2939
|
+
}, {
|
|
2940
|
+
title: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Path Parameters", -1)])]),
|
|
2941
|
+
_: 1
|
|
2942
|
+
}, 8, [
|
|
2943
|
+
"breadcrumb",
|
|
2944
|
+
"eventBus",
|
|
2945
|
+
"options",
|
|
2946
|
+
"parameters"
|
|
2947
|
+
]),
|
|
2948
|
+
createVNode(ParameterList_default, {
|
|
2949
|
+
breadcrumb: __props.breadcrumb ? [...__props.breadcrumb, "query"] : void 0,
|
|
2950
|
+
eventBus: __props.eventBus,
|
|
2951
|
+
options: __props.options,
|
|
2952
|
+
parameters: splitParameters.value["query"]
|
|
2953
|
+
}, {
|
|
2954
|
+
title: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Query Parameters", -1)])]),
|
|
2955
|
+
_: 1
|
|
2956
|
+
}, 8, [
|
|
2957
|
+
"breadcrumb",
|
|
2958
|
+
"eventBus",
|
|
2959
|
+
"options",
|
|
2960
|
+
"parameters"
|
|
2961
|
+
]),
|
|
2962
|
+
createVNode(ParameterList_default, {
|
|
2963
|
+
breadcrumb: __props.breadcrumb ? [...__props.breadcrumb, "headers"] : void 0,
|
|
2964
|
+
eventBus: __props.eventBus,
|
|
2965
|
+
options: __props.options,
|
|
2966
|
+
parameters: splitParameters.value["header"]
|
|
2967
|
+
}, {
|
|
2968
|
+
title: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("Headers", -1)])]),
|
|
2969
|
+
_: 1
|
|
2970
|
+
}, 8, [
|
|
2971
|
+
"breadcrumb",
|
|
2972
|
+
"eventBus",
|
|
2973
|
+
"options",
|
|
2974
|
+
"parameters"
|
|
2975
|
+
]),
|
|
2976
|
+
createVNode(ParameterList_default, {
|
|
2977
|
+
breadcrumb: __props.breadcrumb ? [...__props.breadcrumb, "cookies"] : void 0,
|
|
2978
|
+
eventBus: __props.eventBus,
|
|
2979
|
+
options: __props.options,
|
|
2980
|
+
parameters: splitParameters.value["cookie"]
|
|
2981
|
+
}, {
|
|
2982
|
+
title: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("Cookies", -1)])]),
|
|
2983
|
+
_: 1
|
|
2984
|
+
}, 8, [
|
|
2985
|
+
"breadcrumb",
|
|
2986
|
+
"eventBus",
|
|
2987
|
+
"options",
|
|
2988
|
+
"parameters"
|
|
2989
|
+
]),
|
|
2990
|
+
__props.requestBody ? (openBlock(), createBlock(RequestBody_default, {
|
|
2991
|
+
key: 0,
|
|
2992
|
+
breadcrumb: __props.breadcrumb ? [...__props.breadcrumb, "body"] : void 0,
|
|
2993
|
+
eventBus: __props.eventBus,
|
|
2994
|
+
options: __props.options,
|
|
2995
|
+
requestBody: __props.requestBody
|
|
2996
|
+
}, {
|
|
2997
|
+
title: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("Body", -1)])]),
|
|
2998
|
+
_: 1
|
|
2999
|
+
}, 8, [
|
|
3000
|
+
"breadcrumb",
|
|
3001
|
+
"eventBus",
|
|
3002
|
+
"options",
|
|
3003
|
+
"requestBody"
|
|
3004
|
+
])) : createCommentVNode("", true)
|
|
3005
|
+
], 64);
|
|
3006
|
+
};
|
|
3007
|
+
}
|
|
3008
|
+
});
|
|
3009
|
+
//#endregion
|
|
3010
|
+
//#region src/features/Operation/components/OperationResponses.vue?vue&type=script&setup=true&lang.ts
|
|
3011
|
+
var _hoisted_1$6 = {
|
|
3012
|
+
key: 0,
|
|
3013
|
+
class: "mt-6"
|
|
3014
|
+
};
|
|
3015
|
+
var _hoisted_2$3 = {
|
|
3016
|
+
"aria-label": "Responses",
|
|
3017
|
+
class: "mb-3 list-none p-0 text-sm"
|
|
3018
|
+
};
|
|
3019
|
+
//#endregion
|
|
3020
|
+
//#region src/features/Operation/components/OperationResponses.vue
|
|
3021
|
+
var OperationResponses_default = /* @__PURE__ */ defineComponent({
|
|
3022
|
+
__name: "OperationResponses",
|
|
3023
|
+
props: {
|
|
3024
|
+
responses: {},
|
|
3025
|
+
breadcrumb: {},
|
|
3026
|
+
collapsableItems: { type: Boolean },
|
|
3027
|
+
eventBus: {},
|
|
3028
|
+
options: {}
|
|
3029
|
+
},
|
|
3030
|
+
setup(__props) {
|
|
3031
|
+
return (_ctx, _cache) => {
|
|
3032
|
+
return Object.keys(__props.responses ?? {}).length ? (openBlock(), createElementBlock("div", _hoisted_1$6, [_cache[0] || (_cache[0] = createElementVNode("div", { class: "text-c-1 mt-3 mb-3 leading-[1.45] font-medium" }, "Responses", -1)), createElementVNode("ul", _hoisted_2$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.responses, (response, status) => {
|
|
3033
|
+
return openBlock(), createBlock(ParameterListItem_default, {
|
|
3034
|
+
key: status,
|
|
3035
|
+
breadcrumb: __props.breadcrumb,
|
|
3036
|
+
collapsableItems: __props.collapsableItems,
|
|
3037
|
+
eventBus: __props.eventBus,
|
|
3038
|
+
name: status,
|
|
3039
|
+
options: __props.options,
|
|
3040
|
+
parameter: unref(getResolvedRef)(response)
|
|
3041
|
+
}, null, 8, [
|
|
3042
|
+
"breadcrumb",
|
|
3043
|
+
"collapsableItems",
|
|
3044
|
+
"eventBus",
|
|
3045
|
+
"name",
|
|
3046
|
+
"options",
|
|
3047
|
+
"parameter"
|
|
3048
|
+
]);
|
|
3049
|
+
}), 128))])])) : createCommentVNode("", true);
|
|
3050
|
+
};
|
|
3051
|
+
}
|
|
3052
|
+
});
|
|
3053
|
+
//#endregion
|
|
3054
|
+
//#region src/features/Operation/components/callbacks/Callback.vue?vue&type=script&setup=true&lang.ts
|
|
3055
|
+
var _hoisted_1$5 = { class: "group callback-list-item" };
|
|
3056
|
+
var _hoisted_2$2 = { class: "font-code bg-b-1 callback-sticky-offset callback-list-item-title sticky flex cursor-pointer flex-row items-start gap-2 border-t py-2.5 text-sm group-open:flex-wrap" };
|
|
3057
|
+
var _hoisted_3$2 = { class: "text-c-1 min-w-0 flex-1 truncate text-sm leading-5 font-bold group-open:whitespace-normal" };
|
|
3058
|
+
var _hoisted_4$2 = { class: "text-c-2 font-normal" };
|
|
3059
|
+
var _hoisted_5$2 = { class: "callback-operation-container flex flex-col gap-2" };
|
|
3060
|
+
//#endregion
|
|
3061
|
+
//#region src/features/Operation/components/callbacks/Callback.vue
|
|
3062
|
+
var Callback_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
3063
|
+
__name: "Callback",
|
|
3064
|
+
props: {
|
|
3065
|
+
callback: {},
|
|
3066
|
+
method: {},
|
|
3067
|
+
name: {},
|
|
3068
|
+
url: {},
|
|
3069
|
+
eventBus: {},
|
|
3070
|
+
options: {}
|
|
3071
|
+
},
|
|
3072
|
+
setup(__props) {
|
|
3073
|
+
return (_ctx, _cache) => {
|
|
3074
|
+
return openBlock(), createElementBlock("details", _hoisted_1$5, [createElementVNode("summary", _hoisted_2$2, [
|
|
3075
|
+
createVNode(unref(ScalarIconCaretRight), {
|
|
3076
|
+
class: "callback-list-item-icon text-c-3 group-hover:text-c-1 absolute top-3.5 -left-5 size-3 transition-transform duration-100 group-open:rotate-90",
|
|
3077
|
+
weight: "bold"
|
|
3078
|
+
}),
|
|
3079
|
+
createVNode(unref(HttpMethod_default), {
|
|
3080
|
+
as: "span",
|
|
3081
|
+
class: "request-method py-0.75 font-bold",
|
|
3082
|
+
method: __props.method
|
|
3083
|
+
}, null, 8, ["method"]),
|
|
3084
|
+
createElementVNode("div", _hoisted_3$2, [createTextVNode(toDisplayString(__props.name) + " ", 1), createElementVNode("span", _hoisted_4$2, toDisplayString(__props.url), 1)])
|
|
3085
|
+
]), createElementVNode("div", _hoisted_5$2, [createVNode(OperationParameters_default, {
|
|
3086
|
+
eventBus: __props.eventBus,
|
|
3087
|
+
options: __props.options,
|
|
3088
|
+
parameters: __props.callback.parameters?.map((param) => unref(getResolvedRef)(param)) ?? [],
|
|
3089
|
+
requestBody: unref(getResolvedRef)(__props.callback.requestBody)
|
|
3090
|
+
}, null, 8, [
|
|
3091
|
+
"eventBus",
|
|
3092
|
+
"options",
|
|
3093
|
+
"parameters",
|
|
3094
|
+
"requestBody"
|
|
3095
|
+
]), createVNode(OperationResponses_default, {
|
|
3096
|
+
collapsableItems: false,
|
|
3097
|
+
eventBus: __props.eventBus,
|
|
3098
|
+
options: __props.options,
|
|
3099
|
+
responses: __props.callback.responses
|
|
3100
|
+
}, null, 8, [
|
|
3101
|
+
"eventBus",
|
|
3102
|
+
"options",
|
|
3103
|
+
"responses"
|
|
3104
|
+
])])]);
|
|
3105
|
+
};
|
|
3106
|
+
}
|
|
3107
|
+
}), [["__scopeId", "data-v-df994c31"]]);
|
|
3108
|
+
//#endregion
|
|
3109
|
+
//#region src/features/Operation/components/callbacks/Callbacks.vue?vue&type=script&setup=true&lang.ts
|
|
3110
|
+
var _hoisted_1$4 = {
|
|
3111
|
+
"aria-label": "Callbacks",
|
|
3112
|
+
class: "callbacks-list gap-3",
|
|
3113
|
+
role: "group"
|
|
3114
|
+
};
|
|
3115
|
+
//#endregion
|
|
3116
|
+
//#region src/features/Operation/components/callbacks/Callbacks.vue
|
|
3117
|
+
var Callbacks_default = /* @__PURE__ */ defineComponent({
|
|
3118
|
+
__name: "Callbacks",
|
|
3119
|
+
props: {
|
|
3120
|
+
path: {},
|
|
3121
|
+
callbacks: {},
|
|
3122
|
+
eventBus: {},
|
|
3123
|
+
options: {}
|
|
3124
|
+
},
|
|
3125
|
+
setup(__props) {
|
|
3126
|
+
const flattenedCallbacks = computed(() => {
|
|
3127
|
+
const _callbacks = [];
|
|
3128
|
+
objectEntries(__props.callbacks).forEach(([name, pathItem]) => {
|
|
3129
|
+
objectEntries(getResolvedRef(pathItem)).forEach(([url, methods]) => {
|
|
3130
|
+
if (typeof methods !== "object" || !methods) return;
|
|
3131
|
+
objectEntries(methods).forEach(([callbackMethod, callback]) => {
|
|
3132
|
+
if (!isHttpMethod(callbackMethod)) return;
|
|
3133
|
+
_callbacks.push({
|
|
3134
|
+
name,
|
|
3135
|
+
url,
|
|
3136
|
+
method: callbackMethod,
|
|
3137
|
+
callback
|
|
3138
|
+
});
|
|
3139
|
+
});
|
|
3140
|
+
});
|
|
3141
|
+
});
|
|
3142
|
+
return _callbacks;
|
|
3143
|
+
});
|
|
3144
|
+
return (_ctx, _cache) => {
|
|
3145
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [_cache[0] || (_cache[0] = createElementVNode("div", { class: "callbacks-title text-c-1 my-3 text-lg font-medium" }, " Callbacks ", -1)), (openBlock(true), createElementBlock(Fragment, null, renderList(flattenedCallbacks.value, ({ callback, method, name, url }) => {
|
|
3146
|
+
return openBlock(), createBlock(Callback_default, {
|
|
3147
|
+
key: `${name}-${url}-${method}`,
|
|
3148
|
+
callback,
|
|
3149
|
+
eventBus: __props.eventBus,
|
|
3150
|
+
method,
|
|
3151
|
+
name,
|
|
3152
|
+
options: __props.options,
|
|
3153
|
+
path: __props.path,
|
|
3154
|
+
url
|
|
3155
|
+
}, null, 8, [
|
|
3156
|
+
"callback",
|
|
3157
|
+
"eventBus",
|
|
3158
|
+
"method",
|
|
3159
|
+
"name",
|
|
3160
|
+
"options",
|
|
3161
|
+
"path",
|
|
3162
|
+
"url"
|
|
3163
|
+
]);
|
|
3164
|
+
}), 128))]);
|
|
3165
|
+
};
|
|
3166
|
+
}
|
|
3167
|
+
});
|
|
3168
|
+
//#endregion
|
|
3169
|
+
//#region src/features/test-request-button/TestRequestButton.vue?vue&type=script&setup=true&lang.ts
|
|
3170
|
+
var _hoisted_1$3 = ["method"];
|
|
3171
|
+
//#endregion
|
|
3172
|
+
//#region src/features/test-request-button/TestRequestButton.vue
|
|
3173
|
+
var TestRequestButton_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
3174
|
+
__name: "TestRequestButton",
|
|
3175
|
+
props: {
|
|
3176
|
+
id: {},
|
|
3177
|
+
method: {},
|
|
3178
|
+
path: {},
|
|
3179
|
+
eventBus: {},
|
|
3180
|
+
exampleName: {}
|
|
3181
|
+
},
|
|
3182
|
+
setup(__props) {
|
|
3183
|
+
/** Route via ID and optionally with example name */
|
|
3184
|
+
const handleClick = () => {
|
|
3185
|
+
const payload = {
|
|
3186
|
+
id: __props.id,
|
|
3187
|
+
...__props.exampleName && { exampleName: __props.exampleName }
|
|
3188
|
+
};
|
|
3189
|
+
__props.eventBus.emit("ui:open:client-modal", payload);
|
|
3190
|
+
};
|
|
3191
|
+
return (_ctx, _cache) => {
|
|
3192
|
+
return openBlock(), createElementBlock("button", {
|
|
3193
|
+
class: "show-api-client-button",
|
|
3194
|
+
method: __props.method,
|
|
3195
|
+
type: "button",
|
|
3196
|
+
onClick: withModifiers(handleClick, ["stop"])
|
|
3197
|
+
}, [
|
|
3198
|
+
createVNode(unref(ScalarIconPlay), {
|
|
3199
|
+
class: "size-3",
|
|
3200
|
+
weight: "fill"
|
|
3201
|
+
}),
|
|
3202
|
+
_cache[0] || (_cache[0] = createElementVNode("span", null, "Test Request", -1)),
|
|
3203
|
+
createVNode(ScreenReader_default, null, {
|
|
3204
|
+
default: withCtx(() => [createTextVNode("(" + toDisplayString(__props.method) + " " + toDisplayString(__props.path) + ")", 1)]),
|
|
3205
|
+
_: 1
|
|
3206
|
+
})
|
|
3207
|
+
], 8, _hoisted_1$3);
|
|
3208
|
+
};
|
|
3209
|
+
}
|
|
3210
|
+
}), [["__scopeId", "data-v-342ba62a"]]);
|
|
3211
|
+
//#endregion
|
|
3212
|
+
//#region src/features/x-badges/XBadges.vue
|
|
3213
|
+
var XBadges_default = /* @__PURE__ */ defineComponent({
|
|
3214
|
+
__name: "XBadges",
|
|
3215
|
+
props: {
|
|
3216
|
+
position: {},
|
|
3217
|
+
badges: {}
|
|
3218
|
+
},
|
|
3219
|
+
setup(__props) {
|
|
3220
|
+
const filteredBadges = computed(() => {
|
|
3221
|
+
if (Array.isArray(__props.badges)) return __props.badges.filter((badge) => badge.position === __props.position || __props.position === "after" && !badge.position);
|
|
3222
|
+
return [];
|
|
3223
|
+
});
|
|
3224
|
+
return (_ctx, _cache) => {
|
|
3225
|
+
return filteredBadges.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(filteredBadges.value, (badge) => {
|
|
3226
|
+
return openBlock(), createBlock(unref(Badge_default), {
|
|
3227
|
+
key: badge.name,
|
|
3228
|
+
color: badge.color
|
|
3229
|
+
}, {
|
|
3230
|
+
default: withCtx(() => [createTextVNode(toDisplayString(badge.name), 1)]),
|
|
3231
|
+
_: 2
|
|
3232
|
+
}, 1032, ["color"]);
|
|
3233
|
+
}), 128)) : createCommentVNode("", true);
|
|
3234
|
+
};
|
|
3235
|
+
}
|
|
3236
|
+
});
|
|
3237
|
+
//#endregion
|
|
3238
|
+
//#region src/features/Operation/layouts/ClassicLayout.vue?vue&type=script&setup=true&lang.ts
|
|
3239
|
+
var _hoisted_1$2 = { class: "operation-title" };
|
|
3240
|
+
var _hoisted_2$1 = { class: "operation-details" };
|
|
3241
|
+
var _hoisted_3$1 = { class: "endpoint-label" };
|
|
3242
|
+
var _hoisted_4$1 = { class: "endpoint-label-path" };
|
|
3243
|
+
var _hoisted_5$1 = { class: "endpoint-label-name" };
|
|
3244
|
+
var _hoisted_6$1 = {
|
|
3245
|
+
key: 1,
|
|
3246
|
+
class: "font-code text-sm"
|
|
3247
|
+
};
|
|
3248
|
+
var _hoisted_7 = { class: "endpoint-content" };
|
|
3249
|
+
var _hoisted_8 = { class: "operation-details-card" };
|
|
3250
|
+
var _hoisted_9 = {
|
|
3251
|
+
key: 0,
|
|
3252
|
+
class: "operation-details-card-item"
|
|
3253
|
+
};
|
|
3254
|
+
var _hoisted_10 = { class: "operation-details-card-item" };
|
|
3255
|
+
var _hoisted_11 = { class: "operation-details-card-item" };
|
|
3256
|
+
var _hoisted_12 = {
|
|
3257
|
+
key: 1,
|
|
3258
|
+
class: "operation-details-card-item"
|
|
3259
|
+
};
|
|
3260
|
+
//#endregion
|
|
3261
|
+
//#region src/features/Operation/layouts/ClassicLayout.vue
|
|
3262
|
+
var ClassicLayout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
3263
|
+
__name: "ClassicLayout",
|
|
3264
|
+
props: {
|
|
3265
|
+
id: {},
|
|
3266
|
+
method: {},
|
|
3267
|
+
options: {},
|
|
3268
|
+
path: {},
|
|
3269
|
+
clientOptions: {},
|
|
3270
|
+
isCollapsed: { type: Boolean },
|
|
3271
|
+
isWebhook: { type: Boolean },
|
|
3272
|
+
selectedClient: {},
|
|
3273
|
+
eventBus: {},
|
|
3274
|
+
operation: {},
|
|
3275
|
+
selectedServer: {},
|
|
3276
|
+
selectedSecuritySchemes: {}
|
|
3277
|
+
},
|
|
3278
|
+
setup(__props) {
|
|
3279
|
+
const operationTitle = computed(() => __props.operation.summary || __props.path || "");
|
|
3280
|
+
const operationExtensions = computed(() => getXKeysFromObject(__props.operation));
|
|
3281
|
+
/** Track the currently selected example for passing to the modal */
|
|
3282
|
+
const selectedExampleKey = ref("");
|
|
3283
|
+
const { copyToClipboard } = useClipboard();
|
|
3284
|
+
return (_ctx, _cache) => {
|
|
3285
|
+
return openBlock(), createBlock(unref(SectionAccordion_default), {
|
|
3286
|
+
id: __props.id,
|
|
3287
|
+
"aria-label": operationTitle.value,
|
|
3288
|
+
class: "reference-endpoint",
|
|
3289
|
+
modelValue: !__props.isCollapsed,
|
|
3290
|
+
transparent: "",
|
|
3291
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = (value) => __props.eventBus?.emit("toggle:nav-item", {
|
|
3292
|
+
id: __props.id,
|
|
3293
|
+
open: value
|
|
3294
|
+
}))
|
|
3295
|
+
}, createSlots({
|
|
3296
|
+
title: withCtx(() => [createElementVNode("div", _hoisted_1$2, [createElementVNode("div", _hoisted_2$1, [createVNode(unref(HttpMethod_default), {
|
|
3297
|
+
class: "endpoint-type",
|
|
3298
|
+
method: __props.method,
|
|
3299
|
+
short: ""
|
|
3300
|
+
}, null, 8, ["method"]), createVNode(unref(Anchor_default), {
|
|
3301
|
+
class: "endpoint-anchor",
|
|
3302
|
+
onCopyAnchorUrl: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.id }))
|
|
3303
|
+
}, {
|
|
3304
|
+
default: withCtx(() => [createElementVNode("h3", _hoisted_3$1, [
|
|
3305
|
+
createElementVNode("div", _hoisted_4$1, [createVNode(OperationPath_default, {
|
|
3306
|
+
deprecated: unref(isOperationDeprecated)(__props.operation),
|
|
3307
|
+
path: __props.path
|
|
3308
|
+
}, null, 8, ["deprecated", "path"])]),
|
|
3309
|
+
createElementVNode("div", _hoisted_5$1, toDisplayString(operationTitle.value), 1),
|
|
3310
|
+
unref(getOperationStability)(__props.operation) ? (openBlock(), createBlock(unref(Badge_default), {
|
|
3311
|
+
key: 0,
|
|
3312
|
+
class: normalizeClass(["capitalize", unref(getOperationStabilityColor)(__props.operation)])
|
|
3313
|
+
}, {
|
|
3314
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(getOperationStability)(__props.operation)), 1)]),
|
|
3315
|
+
_: 1
|
|
3316
|
+
}, 8, ["class"])) : createCommentVNode("", true),
|
|
3317
|
+
__props.isWebhook ? (openBlock(), createBlock(unref(Badge_default), {
|
|
3318
|
+
key: 1,
|
|
3319
|
+
class: "font-code text-green flex w-fit items-center justify-center gap-1"
|
|
3320
|
+
}, {
|
|
3321
|
+
default: withCtx(() => [createVNode(unref(ScalarIconWebhooksLogo), { weight: "bold" }), _cache[4] || (_cache[4] = createTextVNode("Webhook ", -1))]),
|
|
3322
|
+
_: 1
|
|
3323
|
+
})) : createCommentVNode("", true),
|
|
3324
|
+
createVNode(unref(XBadges_default), {
|
|
3325
|
+
badges: __props.operation["x-badges"],
|
|
3326
|
+
position: "before"
|
|
3327
|
+
}, null, 8, ["badges"])
|
|
3328
|
+
])]),
|
|
3329
|
+
_: 1
|
|
3330
|
+
})])])]),
|
|
3331
|
+
actions: withCtx(({ active }) => [
|
|
3332
|
+
createVNode(unref(XBadges_default), {
|
|
3333
|
+
badges: __props.operation["x-badges"],
|
|
3334
|
+
position: "after"
|
|
3335
|
+
}, null, 8, ["badges"]),
|
|
3336
|
+
!__props.options.hideTestRequestButton ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [active && !__props.isWebhook ? (openBlock(), createBlock(unref(TestRequestButton_default), {
|
|
3337
|
+
key: 0,
|
|
3338
|
+
id: __props.id,
|
|
3339
|
+
eventBus: __props.eventBus,
|
|
3340
|
+
exampleName: selectedExampleKey.value,
|
|
3341
|
+
method: __props.method,
|
|
3342
|
+
path: __props.path
|
|
3343
|
+
}, null, 8, [
|
|
3344
|
+
"id",
|
|
3345
|
+
"eventBus",
|
|
3346
|
+
"exampleName",
|
|
3347
|
+
"method",
|
|
3348
|
+
"path"
|
|
3349
|
+
])) : (openBlock(), createBlock(unref(ScalarIconPlay), {
|
|
3350
|
+
key: 1,
|
|
3351
|
+
class: "endpoint-try-hint size-4.5"
|
|
3352
|
+
}))], 64)) : createCommentVNode("", true),
|
|
3353
|
+
__props.options.showOperationId && __props.operation.operationId ? (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString(__props.operation.operationId), 1)) : createCommentVNode("", true),
|
|
3354
|
+
createVNode(unref(ScalarIconButton), {
|
|
3355
|
+
class: "endpoint-copy p-0.5",
|
|
3356
|
+
icon: unref(ScalarIconCopy),
|
|
3357
|
+
label: "Copy endpoint URL",
|
|
3358
|
+
size: "xs",
|
|
3359
|
+
variant: "ghost",
|
|
3360
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => unref(copyToClipboard)(__props.path), ["stop"]))
|
|
3361
|
+
}, null, 8, ["icon"])
|
|
3362
|
+
]),
|
|
3363
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_7, [
|
|
3364
|
+
createElementVNode("div", _hoisted_8, [
|
|
3365
|
+
Object.keys(operationExtensions.value).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_9, [createVNode(SpecificationExtension_default, { value: operationExtensions.value }, null, 8, ["value"])])) : createCommentVNode("", true),
|
|
3366
|
+
createElementVNode("div", _hoisted_10, [createVNode(OperationParameters_default, {
|
|
3367
|
+
eventBus: __props.eventBus,
|
|
3368
|
+
options: __props.options,
|
|
3369
|
+
parameters: __props.operation.parameters,
|
|
3370
|
+
requestBody: unref(getResolvedRef)(__props.operation.requestBody)
|
|
3371
|
+
}, null, 8, [
|
|
3372
|
+
"eventBus",
|
|
3373
|
+
"options",
|
|
3374
|
+
"parameters",
|
|
3375
|
+
"requestBody"
|
|
3376
|
+
])]),
|
|
3377
|
+
createElementVNode("div", _hoisted_11, [createVNode(OperationResponses_default, {
|
|
3378
|
+
eventBus: __props.eventBus,
|
|
3379
|
+
options: __props.options,
|
|
3380
|
+
responses: __props.operation.responses
|
|
3381
|
+
}, null, 8, [
|
|
3382
|
+
"eventBus",
|
|
3383
|
+
"options",
|
|
3384
|
+
"responses"
|
|
3385
|
+
])]),
|
|
3386
|
+
__props.operation?.callbacks ? (openBlock(), createElementBlock("div", _hoisted_12, [createVNode(Callbacks_default, {
|
|
3387
|
+
callbacks: __props.operation.callbacks,
|
|
3388
|
+
eventBus: __props.eventBus,
|
|
3389
|
+
options: __props.options,
|
|
3390
|
+
path: __props.path
|
|
3391
|
+
}, null, 8, [
|
|
3392
|
+
"callbacks",
|
|
3393
|
+
"eventBus",
|
|
3394
|
+
"options",
|
|
3395
|
+
"path"
|
|
3396
|
+
])])) : createCommentVNode("", true)
|
|
3397
|
+
]),
|
|
3398
|
+
__props.operation.responses ? (openBlock(), createBlock(unref(ExampleResponses_default), {
|
|
3399
|
+
key: 0,
|
|
3400
|
+
class: "operation-example-card",
|
|
3401
|
+
responses: __props.operation.responses
|
|
3402
|
+
}, null, 8, ["responses"])) : createCommentVNode("", true),
|
|
3403
|
+
createElementVNode("div", null, [__props.operation.externalDocs ? (openBlock(), createBlock(unref(LinkList_default), { key: 0 }, {
|
|
3404
|
+
default: withCtx(() => [createVNode(unref(ExternalDocs_default), { value: __props.operation.externalDocs }, null, 8, ["value"])]),
|
|
3405
|
+
_: 1
|
|
3406
|
+
})) : createCommentVNode("", true), createVNode(unref(ScalarErrorBoundary), null, {
|
|
3407
|
+
default: withCtx(() => [createVNode(unref(OperationCodeSample), {
|
|
3408
|
+
selectedExample: selectedExampleKey.value,
|
|
3409
|
+
"onUpdate:selectedExample": _cache[2] || (_cache[2] = ($event) => selectedExampleKey.value = $event),
|
|
3410
|
+
class: "operation-example-card",
|
|
3411
|
+
clientOptions: __props.clientOptions,
|
|
3412
|
+
eventBus: __props.eventBus,
|
|
3413
|
+
fallback: "",
|
|
3414
|
+
isWebhook: __props.isWebhook,
|
|
3415
|
+
method: __props.method,
|
|
3416
|
+
operation: __props.operation,
|
|
3417
|
+
path: __props.path,
|
|
3418
|
+
securitySchemes: __props.selectedSecuritySchemes,
|
|
3419
|
+
selectedClient: __props.selectedClient,
|
|
3420
|
+
selectedServer: __props.selectedServer
|
|
3421
|
+
}, null, 8, [
|
|
3422
|
+
"selectedExample",
|
|
3423
|
+
"clientOptions",
|
|
3424
|
+
"eventBus",
|
|
3425
|
+
"isWebhook",
|
|
3426
|
+
"method",
|
|
3427
|
+
"operation",
|
|
3428
|
+
"path",
|
|
3429
|
+
"securitySchemes",
|
|
3430
|
+
"selectedClient",
|
|
3431
|
+
"selectedServer"
|
|
3432
|
+
])]),
|
|
3433
|
+
_: 1
|
|
3434
|
+
})])
|
|
3435
|
+
])]),
|
|
3436
|
+
_: 2
|
|
3437
|
+
}, [__props.operation.description ? {
|
|
3438
|
+
name: "description",
|
|
3439
|
+
fn: withCtx(() => [createVNode(unref(ScalarMarkdown), {
|
|
3440
|
+
anchorPrefix: __props.id,
|
|
3441
|
+
"aria-label": "Operation Description",
|
|
3442
|
+
role: "group",
|
|
3443
|
+
transformType: "heading",
|
|
3444
|
+
value: __props.operation.description,
|
|
3445
|
+
withAnchors: "",
|
|
3446
|
+
withImages: ""
|
|
3447
|
+
}, null, 8, ["anchorPrefix", "value"])]),
|
|
3448
|
+
key: "0"
|
|
3449
|
+
} : void 0]), 1032, [
|
|
3450
|
+
"id",
|
|
3451
|
+
"aria-label",
|
|
3452
|
+
"modelValue"
|
|
3453
|
+
]);
|
|
3454
|
+
};
|
|
3455
|
+
}
|
|
3456
|
+
}), [["__scopeId", "data-v-55addca4"]]);
|
|
3457
|
+
//#endregion
|
|
3458
|
+
//#region src/features/ask-agent-button/AskAgentButton.vue?vue&type=script&setup=true&lang.ts
|
|
3459
|
+
var _hoisted_1$1 = {
|
|
3460
|
+
class: "ask-agent-scalar-send",
|
|
3461
|
+
type: "submit"
|
|
3462
|
+
};
|
|
3463
|
+
//#endregion
|
|
3464
|
+
//#region src/features/ask-agent-button/AskAgentButton.vue
|
|
3465
|
+
var AskAgentButton_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
3466
|
+
__name: "AskAgentButton",
|
|
3467
|
+
setup(__props) {
|
|
3468
|
+
const agentContext = useAgentContext();
|
|
3469
|
+
const message = ref("");
|
|
3470
|
+
const inputRef = ref();
|
|
3471
|
+
function handleSubmit() {
|
|
3472
|
+
agentContext.value?.openAgent(message.value);
|
|
3473
|
+
message.value = "";
|
|
3474
|
+
}
|
|
3475
|
+
return (_ctx, _cache) => {
|
|
3476
|
+
return unref(agentContext)?.agentEnabled.value ? (openBlock(), createElementBlock("form", {
|
|
3477
|
+
key: 0,
|
|
3478
|
+
class: "agent-button-container",
|
|
3479
|
+
onClick: _cache[1] || (_cache[1] = ($event) => inputRef.value?.focus()),
|
|
3480
|
+
onSubmit: _cache[2] || (_cache[2] = withModifiers(($event) => handleSubmit(), ["prevent"]))
|
|
3481
|
+
}, [
|
|
3482
|
+
createVNode(unref(ScalarIconSparkle), {
|
|
3483
|
+
class: "size-3 shrink-0",
|
|
3484
|
+
weight: "fill"
|
|
3485
|
+
}),
|
|
3486
|
+
_cache[3] || (_cache[3] = createElementVNode("div", { class: "ask-agent-scalar-input-label" }, "Ask AI Agent", -1)),
|
|
3487
|
+
withDirectives(createElementVNode("input", {
|
|
3488
|
+
ref_key: "inputRef",
|
|
3489
|
+
ref: inputRef,
|
|
3490
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => message.value = $event),
|
|
3491
|
+
class: normalizeClass(["ask-agent-scalar-input", { "ask-agent-scalar-input-not-empty": message.value.length > 0 }]),
|
|
3492
|
+
placeholder: "Ask AI Agent"
|
|
3493
|
+
}, null, 2), [[vModelText, message.value]]),
|
|
3494
|
+
createElementVNode("button", _hoisted_1$1, [createVNode(unref(ScalarIconArrowUp), {
|
|
3495
|
+
class: "size-3",
|
|
3496
|
+
weight: "bold"
|
|
3497
|
+
})])
|
|
3498
|
+
], 32)) : createCommentVNode("", true);
|
|
3499
|
+
};
|
|
3500
|
+
}
|
|
3501
|
+
}), [["__scopeId", "data-v-78f5377c"]]);
|
|
3502
|
+
//#endregion
|
|
3503
|
+
//#region src/features/Operation/layouts/ModernLayout.vue?vue&type=script&setup=true&lang.ts
|
|
3504
|
+
var _hoisted_1 = { class: "flex flex-row justify-between gap-1" };
|
|
3505
|
+
var _hoisted_2 = { class: "flex gap-1" };
|
|
3506
|
+
var _hoisted_3 = { class: "flex gap-1" };
|
|
3507
|
+
var _hoisted_4 = { class: "operation-details" };
|
|
3508
|
+
var _hoisted_5 = { class: "examples" };
|
|
3509
|
+
var _hoisted_6 = { class: "flex" };
|
|
3510
|
+
//#endregion
|
|
3511
|
+
//#region src/features/Operation/layouts/ModernLayout.vue
|
|
3512
|
+
var ModernLayout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
3513
|
+
__name: "ModernLayout",
|
|
3514
|
+
props: {
|
|
3515
|
+
id: {},
|
|
3516
|
+
method: {},
|
|
3517
|
+
options: {},
|
|
3518
|
+
path: {},
|
|
3519
|
+
clientOptions: {},
|
|
3520
|
+
isWebhook: { type: Boolean },
|
|
3521
|
+
selectedClient: {},
|
|
3522
|
+
eventBus: {},
|
|
3523
|
+
operation: {},
|
|
3524
|
+
selectedServer: {},
|
|
3525
|
+
selectedSecuritySchemes: {}
|
|
3526
|
+
},
|
|
3527
|
+
setup(__props) {
|
|
3528
|
+
const operationTitle = computed(() => __props.operation.summary || __props.path || "");
|
|
3529
|
+
const labelId = useId();
|
|
3530
|
+
const operationExtensions = computed(() => getXKeysFromObject(__props.operation));
|
|
3531
|
+
return (_ctx, _cache) => {
|
|
3532
|
+
return openBlock(), createBlock(unref(Section_default), {
|
|
3533
|
+
id: __props.id,
|
|
3534
|
+
"aria-labelledby": unref(labelId),
|
|
3535
|
+
label: operationTitle.value,
|
|
3536
|
+
tabindex: "-1",
|
|
3537
|
+
onIntersecting: _cache[1] || (_cache[1] = () => __props.eventBus?.emit("intersecting:nav-item", { id: __props.id }))
|
|
3538
|
+
}, {
|
|
3539
|
+
default: withCtx(() => [createVNode(unref(SectionContent_default), null, {
|
|
3540
|
+
default: withCtx(() => [
|
|
3541
|
+
createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [
|
|
3542
|
+
__props.options?.showOperationId && __props.operation.operationId ? (openBlock(), createBlock(unref(Badge_default), { key: 0 }, {
|
|
3543
|
+
default: withCtx(() => [createTextVNode(toDisplayString(__props.operation.operationId), 1)]),
|
|
3544
|
+
_: 1
|
|
3545
|
+
})) : createCommentVNode("", true),
|
|
3546
|
+
unref(getOperationStability)(__props.operation) ? (openBlock(), createBlock(unref(Badge_default), {
|
|
3547
|
+
key: 1,
|
|
3548
|
+
class: normalizeClass(["capitalize", unref(getOperationStabilityColor)(__props.operation)])
|
|
3549
|
+
}, {
|
|
3550
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(getOperationStability)(__props.operation)), 1)]),
|
|
3551
|
+
_: 1
|
|
3552
|
+
}, 8, ["class"])) : createCommentVNode("", true),
|
|
3553
|
+
__props.isWebhook ? (openBlock(), createBlock(unref(Badge_default), {
|
|
3554
|
+
key: 2,
|
|
3555
|
+
class: "font-code text-green flex w-fit items-center justify-center gap-1"
|
|
3556
|
+
}, {
|
|
3557
|
+
default: withCtx(() => [createVNode(unref(ScalarIconWebhooksLogo), { weight: "bold" }), _cache[2] || (_cache[2] = createTextVNode("Webhook ", -1))]),
|
|
3558
|
+
_: 1
|
|
3559
|
+
})) : createCommentVNode("", true),
|
|
3560
|
+
createVNode(unref(XBadges_default), {
|
|
3561
|
+
badges: __props.operation["x-badges"],
|
|
3562
|
+
position: "before"
|
|
3563
|
+
}, null, 8, ["badges"])
|
|
3564
|
+
]), createElementVNode("div", _hoisted_3, [createVNode(unref(XBadges_default), {
|
|
3565
|
+
badges: __props.operation["x-badges"],
|
|
3566
|
+
position: "after"
|
|
3567
|
+
}, null, 8, ["badges"])])]),
|
|
3568
|
+
createElementVNode("div", { class: normalizeClass(unref(isOperationDeprecated)(__props.operation) ? "deprecated" : "") }, [createVNode(unref(SectionHeader_default), null, {
|
|
3569
|
+
default: withCtx(() => [createVNode(unref(Anchor_default), { onCopyAnchorUrl: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.id })) }, {
|
|
3570
|
+
default: withCtx(() => [createVNode(unref(SectionHeaderTag_default), {
|
|
3571
|
+
id: unref(labelId),
|
|
3572
|
+
level: 3
|
|
3573
|
+
}, {
|
|
3574
|
+
default: withCtx(() => [createTextVNode(toDisplayString(operationTitle.value), 1)]),
|
|
3575
|
+
_: 1
|
|
3576
|
+
}, 8, ["id"])]),
|
|
3577
|
+
_: 1
|
|
3578
|
+
})]),
|
|
3579
|
+
_: 1
|
|
3580
|
+
})], 2),
|
|
3581
|
+
createVNode(unref(SectionColumns_default), null, {
|
|
3582
|
+
default: withCtx(() => [createVNode(unref(SectionColumn_default), null, {
|
|
3583
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_4, [
|
|
3584
|
+
createVNode(SpecificationExtension_default, { value: operationExtensions.value }, null, 8, ["value"]),
|
|
3585
|
+
createVNode(unref(ScalarMarkdown), {
|
|
3586
|
+
anchorPrefix: __props.id,
|
|
3587
|
+
"aria-label": "Operation Description",
|
|
3588
|
+
role: "group",
|
|
3589
|
+
transformType: "heading",
|
|
3590
|
+
value: __props.operation.description,
|
|
3591
|
+
withAnchors: "",
|
|
3592
|
+
withImages: ""
|
|
3593
|
+
}, null, 8, ["anchorPrefix", "value"]),
|
|
3594
|
+
createVNode(OperationParameters_default, {
|
|
3595
|
+
breadcrumb: [__props.id],
|
|
3596
|
+
eventBus: __props.eventBus,
|
|
3597
|
+
options: __props.options,
|
|
3598
|
+
parameters: __props.operation.parameters,
|
|
3599
|
+
requestBody: unref(getResolvedRef)(__props.operation.requestBody)
|
|
3600
|
+
}, null, 8, [
|
|
3601
|
+
"breadcrumb",
|
|
3602
|
+
"eventBus",
|
|
3603
|
+
"options",
|
|
3604
|
+
"parameters",
|
|
3605
|
+
"requestBody"
|
|
3606
|
+
]),
|
|
3607
|
+
createVNode(OperationResponses_default, {
|
|
3608
|
+
breadcrumb: [__props.id],
|
|
3609
|
+
collapsableItems: !__props.options.expandAllResponses,
|
|
3610
|
+
eventBus: __props.eventBus,
|
|
3611
|
+
options: __props.options,
|
|
3612
|
+
responses: __props.operation.responses
|
|
3613
|
+
}, null, 8, [
|
|
3614
|
+
"breadcrumb",
|
|
3615
|
+
"collapsableItems",
|
|
3616
|
+
"eventBus",
|
|
3617
|
+
"options",
|
|
3618
|
+
"responses"
|
|
3619
|
+
]),
|
|
3620
|
+
createVNode(unref(ScalarErrorBoundary), null, {
|
|
3621
|
+
default: withCtx(() => [__props.operation.callbacks ? (openBlock(), createBlock(Callbacks_default, {
|
|
3622
|
+
key: 0,
|
|
3623
|
+
callbacks: __props.operation.callbacks,
|
|
3624
|
+
class: "mt-6",
|
|
3625
|
+
eventBus: __props.eventBus,
|
|
3626
|
+
options: __props.options,
|
|
3627
|
+
path: __props.path
|
|
3628
|
+
}, null, 8, [
|
|
3629
|
+
"callbacks",
|
|
3630
|
+
"eventBus",
|
|
3631
|
+
"options",
|
|
3632
|
+
"path"
|
|
3633
|
+
])) : createCommentVNode("", true)]),
|
|
3634
|
+
_: 1
|
|
3635
|
+
})
|
|
3636
|
+
])]),
|
|
3637
|
+
_: 1
|
|
3638
|
+
}), createVNode(unref(SectionColumn_default), null, {
|
|
3639
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_5, [
|
|
3640
|
+
__props.operation.externalDocs ? (openBlock(), createBlock(unref(LinkList_default), { key: 0 }, {
|
|
3641
|
+
default: withCtx(() => [createVNode(unref(ExternalDocs_default), { value: __props.operation.externalDocs }, null, 8, ["value"])]),
|
|
3642
|
+
_: 1
|
|
3643
|
+
})) : createCommentVNode("", true),
|
|
3644
|
+
createVNode(unref(ScalarErrorBoundary), null, {
|
|
3645
|
+
default: withCtx(() => [createVNode(unref(OperationCodeSample), {
|
|
3646
|
+
clientOptions: __props.clientOptions,
|
|
3647
|
+
eventBus: __props.eventBus,
|
|
3648
|
+
fallback: "",
|
|
3649
|
+
isWebhook: __props.isWebhook,
|
|
3650
|
+
method: __props.method,
|
|
3651
|
+
operation: __props.operation,
|
|
3652
|
+
path: __props.path,
|
|
3653
|
+
securitySchemes: __props.selectedSecuritySchemes,
|
|
3654
|
+
selectedClient: __props.selectedClient,
|
|
3655
|
+
selectedServer: __props.selectedServer
|
|
3656
|
+
}, createSlots({
|
|
3657
|
+
header: withCtx(() => [createVNode(OperationPath_default, {
|
|
3658
|
+
class: "font-code text-c-2 [&_em]:text-c-1 [&_em]:not-italic",
|
|
3659
|
+
deprecated: __props.operation?.deprecated,
|
|
3660
|
+
path: __props.path
|
|
3661
|
+
}, null, 8, ["deprecated", "path"])]),
|
|
3662
|
+
_: 2
|
|
3663
|
+
}, [!__props.isWebhook ? {
|
|
3664
|
+
name: "footer",
|
|
3665
|
+
fn: withCtx(({ exampleName }) => [createElementVNode("div", _hoisted_6, [createVNode(AskAgentButton_default), !__props.options.hideTestRequestButton ? (openBlock(), createBlock(unref(TestRequestButton_default), {
|
|
3666
|
+
key: 0,
|
|
3667
|
+
id: __props.id,
|
|
3668
|
+
eventBus: __props.eventBus,
|
|
3669
|
+
exampleName,
|
|
3670
|
+
method: __props.method,
|
|
3671
|
+
path: __props.path
|
|
3672
|
+
}, null, 8, [
|
|
3673
|
+
"id",
|
|
3674
|
+
"eventBus",
|
|
3675
|
+
"exampleName",
|
|
3676
|
+
"method",
|
|
3677
|
+
"path"
|
|
3678
|
+
])) : createCommentVNode("", true)])]),
|
|
3679
|
+
key: "0"
|
|
3680
|
+
} : void 0]), 1032, [
|
|
3681
|
+
"clientOptions",
|
|
3682
|
+
"eventBus",
|
|
3683
|
+
"isWebhook",
|
|
3684
|
+
"method",
|
|
3685
|
+
"operation",
|
|
3686
|
+
"path",
|
|
3687
|
+
"securitySchemes",
|
|
3688
|
+
"selectedClient",
|
|
3689
|
+
"selectedServer"
|
|
3690
|
+
])]),
|
|
3691
|
+
_: 1
|
|
3692
|
+
}),
|
|
3693
|
+
createVNode(unref(ScalarErrorBoundary), null, {
|
|
3694
|
+
default: withCtx(() => [__props.operation.responses ? (openBlock(), createBlock(unref(ExampleResponses_default), {
|
|
3695
|
+
key: 0,
|
|
3696
|
+
responses: __props.operation.responses,
|
|
3697
|
+
style: { "margin-top": "12px" }
|
|
3698
|
+
}, null, 8, ["responses"])) : createCommentVNode("", true)]),
|
|
3699
|
+
_: 1
|
|
3700
|
+
})
|
|
3701
|
+
])]),
|
|
3702
|
+
_: 1
|
|
3703
|
+
})]),
|
|
3704
|
+
_: 1
|
|
3705
|
+
})
|
|
3706
|
+
]),
|
|
3707
|
+
_: 1
|
|
3708
|
+
})]),
|
|
3709
|
+
_: 1
|
|
3710
|
+
}, 8, [
|
|
3711
|
+
"id",
|
|
3712
|
+
"aria-labelledby",
|
|
3713
|
+
"label"
|
|
3714
|
+
]);
|
|
3715
|
+
};
|
|
3716
|
+
}
|
|
3717
|
+
}), [["__scopeId", "data-v-3c3c5405"]]);
|
|
3718
|
+
//#endregion
|
|
3719
|
+
//#region src/features/Operation/Operation.vue
|
|
3720
|
+
var Operation_default = /* @__PURE__ */ defineComponent({
|
|
3721
|
+
__name: "Operation",
|
|
3722
|
+
props: {
|
|
3723
|
+
id: {},
|
|
3724
|
+
method: {},
|
|
3725
|
+
options: {},
|
|
3726
|
+
document: {},
|
|
3727
|
+
path: {},
|
|
3728
|
+
pathValue: {},
|
|
3729
|
+
server: {},
|
|
3730
|
+
securitySchemes: {},
|
|
3731
|
+
clientOptions: {},
|
|
3732
|
+
isCollapsed: { type: Boolean },
|
|
3733
|
+
isWebhook: { type: Boolean },
|
|
3734
|
+
selectedClient: {},
|
|
3735
|
+
eventBus: {},
|
|
3736
|
+
authStore: {}
|
|
3737
|
+
},
|
|
3738
|
+
setup(__props) {
|
|
3739
|
+
/**
|
|
3740
|
+
* Operation from the new workspace store, ensure we are de-reference
|
|
3741
|
+
*
|
|
3742
|
+
* Also adds in params from the pathItemObject
|
|
3743
|
+
*/
|
|
3744
|
+
const operation = computed(() => {
|
|
3745
|
+
const entity = getResolvedRef(__props.pathValue?.[__props.method]);
|
|
3746
|
+
if (!entity) return null;
|
|
3747
|
+
const parameters = combineParams(__props.pathValue?.parameters, entity.parameters);
|
|
3748
|
+
return {
|
|
3749
|
+
...entity,
|
|
3750
|
+
parameters
|
|
3751
|
+
};
|
|
3752
|
+
});
|
|
3753
|
+
/**
|
|
3754
|
+
* Determine the effective server for the code examples.
|
|
3755
|
+
*/
|
|
3756
|
+
const selectedServer = computed(() => getFirstServer(operation.value?.servers ?? null, __props.pathValue?.servers ?? null, __props.server));
|
|
3757
|
+
/** We must ensure the selected security schemes are required on this operation */
|
|
3758
|
+
const selectedSecuritySchemes = computed(() => filterSelectedSecurity(__props.document, operation.value, __props.authStore.getAuthSelectedSchemas({
|
|
3759
|
+
type: "document",
|
|
3760
|
+
documentName: __props.document?.["x-scalar-navigation"]?.name ?? ""
|
|
3761
|
+
}), __props.authStore.getAuthSelectedSchemas({
|
|
3762
|
+
type: "operation",
|
|
3763
|
+
documentName: __props.document?.["x-scalar-navigation"]?.name ?? "",
|
|
3764
|
+
path: __props.path,
|
|
3765
|
+
method: __props.method
|
|
3766
|
+
}), __props.securitySchemes));
|
|
3767
|
+
return (_ctx, _cache) => {
|
|
3768
|
+
return operation.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [__props.options.layout === "classic" ? (openBlock(), createBlock(ClassicLayout_default, {
|
|
3769
|
+
key: 0,
|
|
3770
|
+
id: __props.id,
|
|
3771
|
+
clientOptions: __props.clientOptions,
|
|
3772
|
+
eventBus: __props.eventBus,
|
|
3773
|
+
isCollapsed: __props.isCollapsed,
|
|
3774
|
+
isWebhook: __props.isWebhook,
|
|
3775
|
+
method: __props.method,
|
|
3776
|
+
operation: operation.value,
|
|
3777
|
+
options: __props.options,
|
|
3778
|
+
path: __props.path,
|
|
3779
|
+
selectedClient: __props.selectedClient,
|
|
3780
|
+
selectedSecuritySchemes: selectedSecuritySchemes.value,
|
|
3781
|
+
selectedServer: selectedServer.value
|
|
3782
|
+
}, null, 8, [
|
|
3783
|
+
"id",
|
|
3784
|
+
"clientOptions",
|
|
3785
|
+
"eventBus",
|
|
3786
|
+
"isCollapsed",
|
|
3787
|
+
"isWebhook",
|
|
3788
|
+
"method",
|
|
3789
|
+
"operation",
|
|
3790
|
+
"options",
|
|
3791
|
+
"path",
|
|
3792
|
+
"selectedClient",
|
|
3793
|
+
"selectedSecuritySchemes",
|
|
3794
|
+
"selectedServer"
|
|
3795
|
+
])) : (openBlock(), createBlock(ModernLayout_default, {
|
|
3796
|
+
key: 1,
|
|
3797
|
+
id: __props.id,
|
|
3798
|
+
clientOptions: __props.clientOptions,
|
|
3799
|
+
eventBus: __props.eventBus,
|
|
3800
|
+
isWebhook: __props.isWebhook,
|
|
3801
|
+
method: __props.method,
|
|
3802
|
+
operation: operation.value,
|
|
3803
|
+
options: __props.options,
|
|
3804
|
+
path: __props.path,
|
|
3805
|
+
selectedClient: __props.selectedClient,
|
|
3806
|
+
selectedSecuritySchemes: selectedSecuritySchemes.value,
|
|
3807
|
+
selectedServer: selectedServer.value
|
|
3808
|
+
}, null, 8, [
|
|
3809
|
+
"id",
|
|
3810
|
+
"clientOptions",
|
|
3811
|
+
"eventBus",
|
|
3812
|
+
"isWebhook",
|
|
3813
|
+
"method",
|
|
3814
|
+
"operation",
|
|
3815
|
+
"options",
|
|
3816
|
+
"path",
|
|
3817
|
+
"selectedClient",
|
|
3818
|
+
"selectedSecuritySchemes",
|
|
3819
|
+
"selectedServer"
|
|
3820
|
+
]))], 64)) : createCommentVNode("", true);
|
|
3821
|
+
};
|
|
3822
|
+
}
|
|
3823
|
+
});
|
|
3824
|
+
//#endregion
|
|
3825
|
+
export { SchemaHeading_default as a, ScreenReader_default as c, SchemaProperty_default as i, SectionAccordion_default as l, HttpMethod_default as n, getXKeysFromObject as o, Schema_default as r, Anchor_default as s, Operation_default as t };
|
|
3826
|
+
|
|
3827
|
+
//# sourceMappingURL=Operation-CixLVfKd.js.map
|