@scalar/api-reference 1.32.10 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/dist/browser/standalone.js +15385 -15039
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
- package/dist/components/Anchor/Anchor.vue.js +50 -5
- package/dist/components/Anchor/Anchor.vue2.js +2 -42
- package/dist/components/ApiReference.vue.js +6 -6
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +6 -6
- package/dist/components/ApiReferenceLayout.vue2.js +107 -104
- package/dist/components/ApiReferenceLayout.vue3.js +4 -0
- package/dist/components/ApiReferenceLayout.vue4.js +4 -0
- package/dist/components/ApiReferenceLayout.vue5.js +4 -0
- package/dist/components/ApiReferenceLayout.vue6.js +4 -0
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Badge/Badge.vue2.js +4 -0
- package/dist/components/ClassicHeader.vue.js +1 -1
- package/dist/components/ClassicHeader.vue2.js +4 -0
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +14 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +3 -3
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +74 -84
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue3.js +4 -0
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts +8 -0
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +81 -80
- package/dist/components/Content/ClientLibraries/ClientSelector.vue3.js +4 -0
- package/dist/components/Content/ClientLibraries/featured-clients.d.ts +11 -0
- package/dist/components/Content/ClientLibraries/featured-clients.d.ts.map +1 -0
- package/dist/components/Content/ClientLibraries/featured-clients.js +17 -0
- package/dist/components/Content/Content.vue.d.ts +5 -6
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +49 -6
- package/dist/components/Content/Content.vue2.js +2 -160
- package/dist/components/Content/Content.vue3.js +5 -0
- package/dist/components/Content/Introduction/Description.vue.js +1 -1
- package/dist/components/Content/Introduction/Description.vue3.js +4 -0
- package/dist/components/Content/Introduction/Introduction.vue.d.ts +7 -17
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +3 -3
- package/dist/components/Content/Introduction/Introduction.vue2.js +103 -150
- package/dist/components/Content/Introduction/Introduction.vue3.js +4 -0
- package/dist/components/Content/Introduction/IntroductionSection.vue.d.ts +25 -0
- package/dist/components/Content/Introduction/IntroductionSection.vue.d.ts.map +1 -0
- package/dist/components/Content/Introduction/IntroductionSection.vue.js +7 -0
- package/dist/components/Content/Introduction/IntroductionSection.vue2.js +159 -0
- package/dist/components/Content/Introduction/IntroductionSection.vue3.js +4 -0
- package/dist/components/Content/Models/{ModelsAccordion.vue.d.ts → ClassicLayout.vue.d.ts} +2 -2
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -0
- package/dist/components/Content/Models/ClassicLayout.vue.js +7 -0
- package/dist/components/Content/Models/{ModelsAccordion.vue2.js → ClassicLayout.vue2.js} +30 -30
- package/dist/components/Content/Models/ClassicLayout.vue3.js +4 -0
- package/dist/components/Content/Models/Models.vue.d.ts +3 -1
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +38 -5
- package/dist/components/Content/Models/Models.vue2.js +2 -114
- package/dist/components/Content/Models/ModernLayout.vue.d.ts +7 -0
- package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -0
- package/dist/components/Content/Models/ModernLayout.vue.js +7 -0
- package/dist/components/Content/Models/ModernLayout.vue2.js +100 -0
- package/dist/components/Content/Models/ModernLayout.vue3.js +4 -0
- package/dist/components/Content/Models/index.d.ts +0 -1
- package/dist/components/Content/Models/index.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +21 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -0
- package/dist/components/Content/Operations/TraversedEntry.vue.js +95 -0
- package/dist/components/Content/Operations/TraversedEntry.vue2.js +4 -0
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts +17 -0
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -0
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +56 -0
- package/dist/components/Content/Operations/TraversedEntryContainer.vue2.js +4 -0
- package/dist/components/Content/Operations/index.d.ts +2 -0
- package/dist/components/Content/Operations/index.d.ts.map +1 -0
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue3.js +4 -0
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue3.js +4 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +63 -68
- package/dist/components/Content/Schema/SchemaEnumValues.vue3.js +4 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +4 -4
- package/dist/components/Content/Schema/SchemaHeading.vue2.js +23 -22
- package/dist/components/Content/Schema/SchemaHeading.vue3.js +4 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +34 -33
- package/dist/components/Content/Schema/SchemaProperty.vue3.js +4 -0
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue3.js +4 -0
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue3.js +4 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +26 -23
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue3.js +4 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +59 -52
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +24 -20
- package/dist/components/Content/Schema/helpers/schema-name.d.ts +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/{Tag/TagAccordion.vue.d.ts → Tags/ClassicLayout.vue.d.ts} +3 -3
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts.map +1 -0
- package/dist/components/Content/Tags/ClassicLayout.vue.js +7 -0
- package/dist/components/Content/Tags/ClassicLayout.vue2.js +51 -0
- package/dist/components/Content/Tags/ClassicLayout.vue3.js +4 -0
- package/dist/components/Content/{Tag/TagSection.vue.d.ts → Tags/ModernLayout.vue.d.ts} +17 -13
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts.map +1 -0
- package/dist/components/Content/Tags/ModernLayout.vue.js +7 -0
- package/dist/components/Content/Tags/ModernLayout.vue2.js +69 -0
- package/dist/components/Content/Tags/ModernLayout.vue3.js +4 -0
- package/dist/components/Content/Tags/Tag.vue.d.ts +25 -0
- package/dist/components/Content/Tags/Tag.vue.d.ts.map +1 -0
- package/dist/components/Content/Tags/Tag.vue.js +27 -0
- package/dist/components/Content/{Tag/Tag.vue.d.ts → Tags/TagSection.vue.d.ts} +3 -6
- package/dist/components/Content/Tags/TagSection.vue.d.ts.map +1 -0
- package/dist/components/Content/Tags/TagSection.vue.js +104 -0
- package/dist/components/Content/Tags/TagSection.vue2.js +4 -0
- package/dist/components/Content/Tags/index.d.ts +2 -0
- package/dist/components/Content/Tags/index.d.ts.map +1 -0
- package/dist/components/GettingStarted.vue.js +1 -1
- package/dist/components/GettingStarted.vue3.js +4 -0
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +8 -6
- package/dist/components/{Content/Lazy → Lazy}/Lazy.vue.d.ts +1 -10
- package/dist/components/Lazy/Lazy.vue.d.ts.map +1 -0
- package/dist/components/Lazy/Lazy.vue2.js +25 -0
- package/dist/components/Lazy/index.d.ts +3 -0
- package/dist/components/Lazy/index.d.ts.map +1 -0
- package/dist/components/Lazy/lazyBus.d.ts +8 -0
- package/dist/components/Lazy/lazyBus.d.ts.map +1 -0
- package/dist/components/Lazy/lazyBus.js +7 -0
- package/dist/components/LinkList/LinkList.vue.d.ts +3 -1
- package/dist/components/LinkList/LinkList.vue.d.ts.map +1 -1
- package/dist/components/LinkList/LinkList.vue.js +5 -10
- package/dist/components/LinkList/LinkList.vue2.js +32 -0
- package/dist/components/LinkList/LinkList.vue3.js +4 -0
- package/dist/components/LoadingSkeleton.vue.d.ts.map +1 -1
- package/dist/components/LoadingSkeleton.vue.js +3 -3
- package/dist/components/LoadingSkeleton.vue3.js +4 -0
- package/dist/components/MobileHeader.vue.js +1 -1
- package/dist/components/MobileHeader.vue3.js +4 -0
- package/dist/components/OperationPath.vue.js +1 -1
- package/dist/components/OperationPath.vue3.js +4 -0
- package/dist/components/{Content/Tag → OperationsList}/OperationsList.vue.d.ts +2 -5
- package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -0
- package/dist/components/OperationsList/OperationsList.vue.js +7 -0
- package/dist/components/OperationsList/OperationsList.vue2.js +60 -0
- package/dist/components/OperationsList/OperationsList.vue3.js +4 -0
- package/dist/components/{Content/Tag → OperationsList}/OperationsListItem.vue.d.ts +2 -4
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -0
- package/dist/components/OperationsList/OperationsListItem.vue.js +7 -0
- package/dist/components/OperationsList/OperationsListItem.vue2.js +63 -0
- package/dist/components/OperationsList/OperationsListItem.vue3.js +4 -0
- package/dist/components/OperationsList/index.d.ts +2 -0
- package/dist/components/OperationsList/index.d.ts.map +1 -0
- package/dist/components/ScreenReader.vue.js +1 -1
- package/dist/components/ScreenReader.vue3.js +4 -0
- package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
- package/dist/components/Section/CompactSection.vue.js +3 -3
- package/dist/components/Section/CompactSection.vue2.js +35 -36
- package/dist/components/Section/CompactSection.vue3.js +4 -0
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/Section/Section.vue3.js +4 -0
- package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.js +3 -3
- package/dist/components/Section/SectionAccordion.vue2.js +42 -36
- package/dist/components/Section/SectionAccordion.vue3.js +4 -0
- package/dist/components/Section/SectionColumn.vue.js +1 -1
- package/dist/components/Section/SectionColumn.vue2.js +4 -0
- package/dist/components/Section/SectionColumns.vue.js +1 -1
- package/dist/components/Section/SectionColumns.vue2.js +4 -0
- package/dist/components/Section/SectionContainer.vue.d.ts +9 -2
- package/dist/components/Section/SectionContainer.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainer.vue.js +5 -11
- package/dist/components/Section/SectionContainer.vue2.js +18 -0
- package/dist/components/Section/SectionContainer.vue3.js +4 -0
- package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +3 -3
- package/dist/components/Section/SectionContainerAccordion.vue3.js +4 -0
- package/dist/components/Section/SectionContent.vue.js +1 -1
- package/dist/components/Section/SectionContent.vue3.js +4 -0
- package/dist/components/Section/SectionHeader.vue.js +1 -1
- package/dist/components/Section/SectionHeader.vue3.js +4 -0
- package/dist/components/Section/SectionHeaderTag.vue.js +1 -1
- package/dist/components/Section/SectionHeaderTag.vue3.js +4 -0
- package/dist/components/SectionFlare/SectionFlare.vue.d.ts +3 -0
- package/dist/components/SectionFlare/SectionFlare.vue.d.ts.map +1 -0
- package/dist/components/SectionFlare/SectionFlare.vue.js +13 -0
- package/dist/components/SectionFlare/SectionFlare.vue2.js +4 -0
- package/dist/components/SectionFlare/index.d.ts +2 -0
- package/dist/components/SectionFlare/index.d.ts.map +1 -0
- package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +3 -3
- package/dist/components/ShowMoreButton.vue2.js +12 -12
- package/dist/components/ShowMoreButton.vue3.js +4 -0
- package/dist/features/Operation/Operation.vue.d.ts +5 -1
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +55 -38
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +28 -30
- package/dist/features/Operation/components/ParameterHeaders.vue.js +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue3.js +4 -0
- package/dist/features/Operation/components/ParameterList.vue.js +1 -1
- package/dist/features/Operation/components/ParameterList.vue3.js +4 -0
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue2.js +31 -29
- package/dist/features/Operation/components/ParameterListItem.vue3.js +4 -0
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue3.js +4 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +9 -9
- package/dist/features/Operation/components/callbacks/Callback.vue3.js +4 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +20 -28
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +6 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +77 -62
- package/dist/features/Operation/layouts/ClassicLayout.vue3.js +4 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +6 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +3 -3
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +94 -81
- package/dist/features/Operation/layouts/ModernLayout.vue3.js +4 -0
- package/dist/features/Search/SearchModal.vue.js +4 -4
- package/dist/features/Search/SearchModal.vue2.js +9 -9
- package/dist/features/Search/SearchModal.vue3.js +4 -0
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/api-client-modal/useApiClient.d.ts +414 -354
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/download-link/DownloadLink.vue.js +2 -2
- package/dist/features/download-link/DownloadLink.vue3.js +4 -0
- package/dist/features/example-responses/ExampleResponse.vue.d.ts +4 -2
- package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +3 -3
- package/dist/features/example-responses/ExampleResponse.vue2.js +15 -14
- package/dist/features/example-responses/ExampleResponse.vue3.js +4 -0
- package/dist/features/example-responses/ExampleResponseTab.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTab.vue3.js +4 -0
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue3.js +4 -0
- package/dist/features/example-responses/ExampleResponses.vue.d.ts +3 -2
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +4 -4
- package/dist/features/example-responses/ExampleResponses.vue2.js +107 -104
- package/dist/features/example-responses/ExampleResponses.vue3.js +4 -0
- package/dist/features/info-object/License.vue.d.ts.map +1 -1
- package/dist/features/info-object/License.vue.js +18 -15
- package/dist/features/sidebar/components/Sidebar.vue.js +3 -3
- package/dist/features/sidebar/components/Sidebar.vue3.js +4 -0
- package/dist/features/sidebar/components/SidebarElement.vue.js +3 -3
- package/dist/features/sidebar/components/SidebarElement.vue3.js +4 -0
- package/dist/features/sidebar/components/SidebarGroup.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarGroup.vue3.js +4 -0
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue3.js +4 -0
- package/dist/features/sidebar/helpers/create-sidebar.js +12 -12
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue3.js +4 -0
- package/dist/features/traverse-schema/index.d.ts +2 -1
- package/dist/features/traverse-schema/index.d.ts.map +1 -1
- package/dist/helpers/test-utils.d.ts +51 -0
- package/dist/helpers/test-utils.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -21
- package/dist/style.css +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +83 -93
- package/dist/v2/ApiReferenceWorkspace.vue2.js +4 -0
- package/dist/v2/ApiReferenceWorkspace.vue3.js +1 -1
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue2.js +32 -29
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +4 -13
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +3 -3
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +185 -181
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue3.js +4 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +1 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +1 -0
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts +12 -13
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.js +28 -30
- package/dist/v2/blocks/scalar-request-example-block/types.d.ts +11 -3
- package/dist/v2/blocks/scalar-request-example-block/types.d.ts.map +1 -1
- package/package.json +19 -19
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts +0 -16
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts.map +0 -1
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.js +0 -36
- package/dist/components/Content/Lazy/Lazy.vue.d.ts.map +0 -1
- package/dist/components/Content/Lazy/Lazy.vue2.js +0 -22
- package/dist/components/Content/Lazy/Loading.vue.d.ts +0 -18
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +0 -1
- package/dist/components/Content/Lazy/Loading.vue.js +0 -163
- package/dist/components/Content/Lazy/Loading.vue3.js +0 -5
- package/dist/components/Content/Lazy/index.d.ts +0 -3
- package/dist/components/Content/Lazy/index.d.ts.map +0 -1
- package/dist/components/Content/Lazy/lazyBus.d.ts +0 -4
- package/dist/components/Content/Lazy/lazyBus.d.ts.map +0 -1
- package/dist/components/Content/Lazy/lazyBus.js +0 -5
- package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +0 -1
- package/dist/components/Content/Models/ModelsAccordion.vue.js +0 -7
- package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +0 -1
- package/dist/components/Content/Tag/OperationsList.vue.js +0 -7
- package/dist/components/Content/Tag/OperationsList.vue2.js +0 -58
- package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +0 -1
- package/dist/components/Content/Tag/OperationsListItem.vue.js +0 -7
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +0 -67
- package/dist/components/Content/Tag/Tag.vue.d.ts.map +0 -1
- package/dist/components/Content/Tag/Tag.vue.js +0 -99
- package/dist/components/Content/Tag/TagAccordion.vue.d.ts.map +0 -1
- package/dist/components/Content/Tag/TagAccordion.vue.js +0 -7
- package/dist/components/Content/Tag/TagAccordion.vue2.js +0 -50
- package/dist/components/Content/Tag/TagList.vue.d.ts +0 -22
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +0 -1
- package/dist/components/Content/Tag/TagList.vue.js +0 -73
- package/dist/components/Content/Tag/TagList.vue2.js +0 -4
- package/dist/components/Content/Tag/TagSection.vue.d.ts.map +0 -1
- package/dist/components/Content/Tag/TagSection.vue.js +0 -7
- package/dist/components/Content/Tag/TagSection.vue2.js +0 -67
- package/dist/components/Content/Tag/index.d.ts +0 -3
- package/dist/components/Content/Tag/index.d.ts.map +0 -1
- package/dist/stores/useHttpClientStore.d.ts +0 -43
- package/dist/stores/useHttpClientStore.d.ts.map +0 -1
- package/dist/stores/useHttpClientStore.js +0 -70
- package/dist/v2/hooks/useStore.d.ts +0 -9
- package/dist/v2/hooks/useStore.d.ts.map +0 -1
- package/dist/v2/hooks/useStore.js +0 -14
- /package/dist/components/Content/{Tag → Tags}/Tag.vue2.js +0 -0
- /package/dist/components/{Content/Lazy → Lazy}/Lazy.vue.js +0 -0
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarCard as
|
|
3
|
-
import { freezeElement as
|
|
4
|
-
import { ScalarIconCaretDown as
|
|
5
|
-
import { isReference as
|
|
6
|
-
import { findClient as
|
|
7
|
-
import {
|
|
1
|
+
import { defineComponent as N, computed as i, ref as g, watch as R, useId as z, createBlock as S, createCommentVNode as b, openBlock as m, unref as s, withCtx as r, createVNode as n, createSlots as H, createElementVNode as v, createElementBlock as q, renderSlot as h, toDisplayString as K } from "vue";
|
|
2
|
+
import { ScalarCard as $, ScalarCardHeader as M, ScalarCombobox as W, ScalarButton as D, ScalarCardSection as E, ScalarCodeBlock as F, ScalarCardFooter as U } from "@scalar/components";
|
|
3
|
+
import { freezeElement as A } from "@scalar/helpers/dom/freeze-element";
|
|
4
|
+
import { ScalarIconCaretDown as G } from "@scalar/icons";
|
|
5
|
+
import { isReference as J } from "@scalar/workspace-store/schemas/v3.1/type-guard";
|
|
6
|
+
import { findClient as V } from "../helpers/find-client.js";
|
|
7
|
+
import { generateCustomId as B } from "../helpers/generate-client-options.js";
|
|
8
8
|
import { generateCodeSnippet as P } from "../helpers/generate-code-snippet.js";
|
|
9
9
|
import { getSecrets as Q } from "../helpers/get-secrets.js";
|
|
10
10
|
import X from "./ExamplePicker.vue2.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
import { emitCustomEvent as V } from "../../../events/definitions.js";
|
|
15
|
-
const _ = ["innerHTML"], ee = { class: "text-base" }, te = ["id"], le = {
|
|
11
|
+
import T from "../../../../components/HttpMethod/HttpMethod.vue.js";
|
|
12
|
+
import { emitCustomEvent as O } from "../../../events/definitions.js";
|
|
13
|
+
const Y = ["innerHTML"], Z = { class: "text-base font-normal" }, _ = ["id"], ee = {
|
|
16
14
|
key: 0,
|
|
17
15
|
class: "request-card-footer-addon"
|
|
18
|
-
},
|
|
19
|
-
...
|
|
16
|
+
}, te = { class: "request-header" }, le = {}, ve = /* @__PURE__ */ N({
|
|
17
|
+
...le,
|
|
20
18
|
__name: "RequestExample",
|
|
21
19
|
props: {
|
|
22
|
-
|
|
20
|
+
clientOptions: {},
|
|
23
21
|
selectedClient: {},
|
|
24
22
|
selectedServer: { default: () => ({ url: "/" }) },
|
|
25
23
|
selectedContentType: {},
|
|
@@ -29,199 +27,205 @@ const _ = ["innerHTML"], ee = { class: "text-base" }, te = ["id"], le = {
|
|
|
29
27
|
path: {},
|
|
30
28
|
operation: {},
|
|
31
29
|
fallback: { type: Boolean },
|
|
32
|
-
generateLabel: { type: Function }
|
|
33
|
-
hideClientSelector: { type: Boolean, default: !1 }
|
|
30
|
+
generateLabel: { type: Function }
|
|
34
31
|
},
|
|
35
|
-
setup(
|
|
36
|
-
const c =
|
|
37
|
-
var
|
|
38
|
-
if (
|
|
32
|
+
setup(o) {
|
|
33
|
+
const c = i(() => {
|
|
34
|
+
var a, p;
|
|
35
|
+
if (J(o.operation.requestBody))
|
|
39
36
|
return {};
|
|
40
|
-
const t = ((
|
|
41
|
-
return ((
|
|
42
|
-
}),
|
|
43
|
-
|
|
44
|
-
),
|
|
37
|
+
const t = ((a = o.operation.requestBody) == null ? void 0 : a.content) ?? {}, e = o.selectedContentType || Object.keys(t)[0];
|
|
38
|
+
return ((p = t[e]) == null ? void 0 : p.examples) ?? {};
|
|
39
|
+
}), y = g(
|
|
40
|
+
o.selectedExample ?? Object.keys(c.value)[0]
|
|
41
|
+
), C = i(() => [
|
|
45
42
|
"x-custom-examples",
|
|
46
43
|
"x-codeSamples",
|
|
47
44
|
"x-code-samples"
|
|
48
45
|
].flatMap(
|
|
49
|
-
(e) =>
|
|
50
|
-
)), f =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
(e) => o.operation[e] ?? []
|
|
47
|
+
)), f = i(() => C.value.length ? [
|
|
48
|
+
{
|
|
49
|
+
label: "Code Examples",
|
|
50
|
+
options: C.value.map((e) => {
|
|
51
|
+
const l = B(e), a = e.label || e.lang || l;
|
|
52
|
+
return {
|
|
53
|
+
id: l,
|
|
54
|
+
lang: e.lang || "plaintext",
|
|
55
|
+
title: a,
|
|
56
|
+
label: a
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
...o.clientOptions
|
|
61
|
+
] : o.clientOptions), u = g(
|
|
62
|
+
V(f.value, o.selectedClient) ?? null
|
|
54
63
|
);
|
|
55
|
-
|
|
56
|
-
() =>
|
|
64
|
+
R(
|
|
65
|
+
() => o.selectedClient,
|
|
57
66
|
(t) => {
|
|
58
|
-
const e =
|
|
59
|
-
e && (
|
|
67
|
+
const e = V(f.value, t);
|
|
68
|
+
e && (u.value = e);
|
|
60
69
|
}
|
|
61
70
|
);
|
|
62
|
-
const
|
|
63
|
-
var t;
|
|
71
|
+
const k = i(() => {
|
|
72
|
+
var t, e, l;
|
|
64
73
|
try {
|
|
65
|
-
if (
|
|
66
|
-
return ((
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
if ((t = u.value) != null && t.id.startsWith("custom"))
|
|
75
|
+
return ((e = C.value.find(
|
|
76
|
+
(I) => {
|
|
77
|
+
var x;
|
|
78
|
+
return B(I) === ((x = u.value) == null ? void 0 : x.id);
|
|
79
|
+
}
|
|
80
|
+
)) == null ? void 0 : e.source) ?? "Custom example not found";
|
|
81
|
+
const a = c.value[y.value || ""], p = (a == null ? void 0 : a.value) ?? (a == null ? void 0 : a.summary);
|
|
70
82
|
return P({
|
|
71
|
-
clientId:
|
|
72
|
-
operation:
|
|
73
|
-
method:
|
|
74
|
-
server:
|
|
75
|
-
securitySchemes:
|
|
76
|
-
contentType:
|
|
77
|
-
path:
|
|
78
|
-
example:
|
|
83
|
+
clientId: (l = u.value) == null ? void 0 : l.id,
|
|
84
|
+
operation: o.operation,
|
|
85
|
+
method: o.method,
|
|
86
|
+
server: o.selectedServer,
|
|
87
|
+
securitySchemes: o.securitySchemes,
|
|
88
|
+
contentType: o.selectedContentType,
|
|
89
|
+
path: o.path,
|
|
90
|
+
example: p
|
|
79
91
|
});
|
|
80
|
-
} catch (
|
|
81
|
-
return console.error("[generateSnippet]",
|
|
92
|
+
} catch (a) {
|
|
93
|
+
return console.error("[generateSnippet]", a), "";
|
|
82
94
|
}
|
|
83
|
-
}),
|
|
95
|
+
}), w = i(() => Q(o.securitySchemes)), d = g(null), L = (t) => {
|
|
84
96
|
var e;
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
97
|
+
if (d.value) {
|
|
98
|
+
const l = A(d.value.$el);
|
|
87
99
|
setTimeout(() => {
|
|
88
|
-
|
|
100
|
+
l();
|
|
89
101
|
}, 300);
|
|
90
102
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
103
|
+
u.value = t, t.id.startsWith("custom") || O((e = d.value) == null ? void 0 : e.$el, "scalar-update-selected-client", t.id);
|
|
104
|
+
}, j = z();
|
|
105
|
+
return (t, e) => k.value ? (m(), S(s($), {
|
|
106
|
+
key: 0,
|
|
107
|
+
class: "request-card dark-mode",
|
|
108
|
+
ref_key: "elem",
|
|
109
|
+
ref: d
|
|
110
|
+
}, {
|
|
111
|
+
default: r(() => [
|
|
112
|
+
n(s(M), { class: "pr-2.5" }, H({
|
|
113
|
+
default: r(() => [
|
|
114
|
+
e[3] || (e[3] = v("span", { class: "sr-only" }, "Request Example for", -1)),
|
|
115
|
+
n(s(T), {
|
|
116
|
+
as: "span",
|
|
117
|
+
class: "request-method",
|
|
118
|
+
method: t.method
|
|
119
|
+
}, null, 8, ["method"]),
|
|
120
|
+
t.generateLabel ? (m(), q("span", {
|
|
121
|
+
key: 0,
|
|
122
|
+
innerHTML: t.generateLabel()
|
|
123
|
+
}, null, 8, Y)) : h(t.$slots, "header", { key: 1 }, void 0, !0)
|
|
124
|
+
]),
|
|
125
|
+
_: 2
|
|
126
|
+
}, [
|
|
127
|
+
f.value.length ? {
|
|
128
|
+
name: "actions",
|
|
129
|
+
fn: r(() => [
|
|
130
|
+
n(s(W), {
|
|
131
|
+
class: "max-h-80",
|
|
132
|
+
modelValue: u.value,
|
|
133
|
+
options: f.value,
|
|
134
|
+
teleport: "",
|
|
135
|
+
placement: "bottom-end",
|
|
136
|
+
"onUpdate:modelValue": e[0] || (e[0] = (l) => L(l))
|
|
137
|
+
}, {
|
|
138
|
+
default: r(() => [
|
|
139
|
+
n(s(D), {
|
|
140
|
+
"data-testid": "client-picker",
|
|
141
|
+
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5",
|
|
142
|
+
fullWidth: "",
|
|
143
|
+
variant: "ghost"
|
|
144
|
+
}, {
|
|
145
|
+
default: r(() => [
|
|
146
|
+
v("span", Z, K(u.value.title), 1),
|
|
147
|
+
n(s(G), {
|
|
148
|
+
weight: "bold",
|
|
149
|
+
class: "ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100"
|
|
150
|
+
})
|
|
151
|
+
]),
|
|
152
|
+
_: 1
|
|
153
|
+
})
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}, 8, ["modelValue", "options"])
|
|
125
157
|
]),
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
teleport: "",
|
|
136
|
-
placement: "bottom-end",
|
|
137
|
-
"onUpdate:modelValue": e[0] || (e[0] = (s) => L(s))
|
|
138
|
-
}, {
|
|
139
|
-
default: n(() => [
|
|
140
|
-
o(l(H), {
|
|
141
|
-
"data-testid": "client-picker",
|
|
142
|
-
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-2 px-1",
|
|
143
|
-
fullWidth: "",
|
|
144
|
-
variant: "ghost"
|
|
145
|
-
}, {
|
|
146
|
-
default: n(() => [
|
|
147
|
-
h("span", ee, R(r.value.title), 1),
|
|
148
|
-
o(l(U), { class: "size-3.5" })
|
|
149
|
-
]),
|
|
150
|
-
_: 1
|
|
151
|
-
})
|
|
152
|
-
]),
|
|
153
|
-
_: 1
|
|
154
|
-
}, 8, ["modelValue", "options"])
|
|
155
|
-
]),
|
|
156
|
-
key: "0"
|
|
157
|
-
}
|
|
158
|
-
]), 1024),
|
|
159
|
-
o(l(q), { class: "request-editor-section custom-scroll p-0" }, {
|
|
160
|
-
default: n(() => [
|
|
161
|
-
h("div", {
|
|
162
|
-
id: `${l(w)}-example`,
|
|
158
|
+
key: "0"
|
|
159
|
+
} : void 0
|
|
160
|
+
]), 1024),
|
|
161
|
+
n(s(E), { class: "request-editor-section custom-scroll p-0" }, {
|
|
162
|
+
default: r(() => {
|
|
163
|
+
var l;
|
|
164
|
+
return [
|
|
165
|
+
v("div", {
|
|
166
|
+
id: `${s(j)}-example`,
|
|
163
167
|
class: "code-snippet"
|
|
164
168
|
}, [
|
|
165
|
-
|
|
169
|
+
n(s(F), {
|
|
166
170
|
class: "bg-b-2 !min-h-full -outline-offset-2",
|
|
167
|
-
content:
|
|
168
|
-
hideCredentials:
|
|
169
|
-
lang:
|
|
171
|
+
content: k.value,
|
|
172
|
+
hideCredentials: w.value,
|
|
173
|
+
lang: (l = u.value) == null ? void 0 : l.lang,
|
|
170
174
|
lineNumbers: ""
|
|
171
175
|
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
172
|
-
], 8,
|
|
173
|
-
]
|
|
174
|
-
_: 1
|
|
176
|
+
], 8, _)
|
|
177
|
+
];
|
|
175
178
|
}),
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
]),
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
]),
|
|
215
|
-
|
|
179
|
+
_: 1
|
|
180
|
+
}),
|
|
181
|
+
Object.keys(c.value).length || t.$slots.footer ? (m(), S(s(U), {
|
|
182
|
+
key: 0,
|
|
183
|
+
class: "request-card-footer bg-b-3"
|
|
184
|
+
}, {
|
|
185
|
+
default: r(() => [
|
|
186
|
+
Object.keys(c.value).length ? (m(), q("div", ee, [
|
|
187
|
+
n(X, {
|
|
188
|
+
examples: c.value,
|
|
189
|
+
modelValue: y.value,
|
|
190
|
+
"onUpdate:modelValue": [
|
|
191
|
+
e[1] || (e[1] = (l) => y.value = l),
|
|
192
|
+
e[2] || (e[2] = (l) => {
|
|
193
|
+
var a;
|
|
194
|
+
return s(O)((a = d.value) == null ? void 0 : a.$el, "scalar-update-selected-example", l);
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
}, null, 8, ["examples", "modelValue"])
|
|
198
|
+
])) : b("", !0),
|
|
199
|
+
h(t.$slots, "footer", {}, void 0, !0)
|
|
200
|
+
]),
|
|
201
|
+
_: 3
|
|
202
|
+
})) : b("", !0)
|
|
203
|
+
]),
|
|
204
|
+
_: 3
|
|
205
|
+
}, 512)) : t.fallback ? (m(), S(s($), {
|
|
206
|
+
key: 1,
|
|
207
|
+
class: "request-card dark-mode"
|
|
208
|
+
}, {
|
|
209
|
+
default: r(() => [
|
|
210
|
+
n(s(E), { class: "request-card-simple" }, {
|
|
211
|
+
default: r(() => [
|
|
212
|
+
v("div", te, [
|
|
213
|
+
n(s(T), {
|
|
214
|
+
as: "span",
|
|
215
|
+
class: "request-method",
|
|
216
|
+
method: t.method
|
|
217
|
+
}, null, 8, ["method"]),
|
|
218
|
+
h(t.$slots, "header", {}, void 0, !0)
|
|
216
219
|
]),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
h(t.$slots, "footer", {}, void 0, !0)
|
|
221
|
+
]),
|
|
222
|
+
_: 3
|
|
223
|
+
})
|
|
224
|
+
]),
|
|
225
|
+
_: 3
|
|
226
|
+
})) : b("", !0);
|
|
223
227
|
}
|
|
224
228
|
});
|
|
225
229
|
export {
|
|
226
|
-
|
|
230
|
+
ve as default
|
|
227
231
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ClientOption, ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
|
|
2
2
|
import { type AvailableClients } from '@scalar/snippetz';
|
|
3
|
+
export declare const DEFAULT_CLIENT = "shell/curl";
|
|
3
4
|
/** Type guard to check if a string is a valid client id */
|
|
4
5
|
export declare const isClient: (id: any) => id is AvailableClients[number];
|
|
5
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-client.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/find-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACrG,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"find-client.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/find-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACrG,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAE3E,eAAO,MAAM,cAAc,eAAe,CAAA;AAE1C,2DAA2D;AAC3D,eAAO,MAAM,QAAQ,OAAQ,GAAG,KAAG,EAAE,IAAI,gBAAgB,CAAC,MAAM,CAAmC,CAAA;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,UAAU,iBACP,iBAAiB,EAAE,aACtB,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,KAC9C,YAwBF,CAAA"}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import type { ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
|
|
2
2
|
import type { XCodeSample } from '@scalar/openapi-types/schemas/extensions';
|
|
3
|
-
import {
|
|
3
|
+
import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
4
4
|
/** Helper to generate an ID for custom code samples */
|
|
5
5
|
export declare const generateCustomId: (example: XCodeSample) => string;
|
|
6
6
|
/**
|
|
7
|
-
* Generates client options for the request example block by
|
|
8
|
-
*
|
|
9
|
-
* client options that can be used to generate code
|
|
10
|
-
* languages and frameworks.
|
|
7
|
+
* Generates client options for the request example block by filtering and organizing
|
|
8
|
+
* built-in snippets based on the hiddenClients configuration. This function creates
|
|
9
|
+
* a structured list of available client options that can be used to generate code
|
|
10
|
+
* examples for different programming languages and frameworks.
|
|
11
11
|
*
|
|
12
|
-
* The function filters built-in clients based on the
|
|
13
|
-
* groups them by their category (e.g., JavaScript, Python, etc.).
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @returns Array of client option groups, each containing a label and array of client options
|
|
12
|
+
* The function filters built-in clients based on the hiddenClients parameter and
|
|
13
|
+
* groups them by their category (e.g., JavaScript, Python, etc.). The hiddenClients
|
|
14
|
+
* parameter supports multiple formats:
|
|
15
|
+
* - boolean: true to hide all clients
|
|
16
|
+
* - array: ['fetch', 'axios'] to hide specific clients across all categories
|
|
17
|
+
* - object: { node: true, python: ['requests'] } to hide entire categories or specific clients within categories
|
|
19
18
|
*/
|
|
20
|
-
export declare const generateClientOptions: (
|
|
19
|
+
export declare const generateClientOptions: (hiddenClients: ApiReferenceConfiguration["hiddenClients"]) => ClientOptionGroup[];
|
|
21
20
|
//# sourceMappingURL=generate-client-options.d.ts.map
|
package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-client-options.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/generate-client-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;
|
|
1
|
+
{"version":3,"file":"generate-client-options.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/generate-client-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAE3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAG5E,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,YAAa,WAAW,WAA6B,CAAA;AAElF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,kBACjB,yBAAyB,CAAC,eAAe,CAAC,KACxD,iBAAiB,EAwDnB,CAAA"}
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import { snippetz as
|
|
2
|
-
import { capitalize as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
label: t.title,
|
|
16
|
-
options: n
|
|
17
|
-
};
|
|
18
|
-
}), s = l.map((t) => {
|
|
19
|
-
const n = f(t), e = t.label || t.lang || n;
|
|
1
|
+
import { snippetz as l } from "@scalar/snippetz";
|
|
2
|
+
import { capitalize as o } from "vue";
|
|
3
|
+
const y = (t) => `custom/${t.lang}`, m = (t) => t === !0 ? [] : l().clients().flatMap((e) => {
|
|
4
|
+
const n = e.clients.flatMap((r) => {
|
|
5
|
+
const c = `${e.key}/${r.client}`;
|
|
6
|
+
if (Array.isArray(t) && t.includes(r.client))
|
|
7
|
+
return [];
|
|
8
|
+
if (typeof t == "object" && t !== null) {
|
|
9
|
+
const i = t[e.key];
|
|
10
|
+
if (i === !0)
|
|
11
|
+
return [];
|
|
12
|
+
if (Array.isArray(i) && i.includes(r.client))
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
20
15
|
return {
|
|
21
|
-
id:
|
|
22
|
-
lang:
|
|
23
|
-
title: e
|
|
24
|
-
label:
|
|
16
|
+
id: c,
|
|
17
|
+
lang: r.client === "curl" ? "curl" : e.key,
|
|
18
|
+
title: `${o(e.title)} ${r.title}`,
|
|
19
|
+
label: r.title,
|
|
20
|
+
targetKey: e.key,
|
|
21
|
+
targetTitle: e.title,
|
|
22
|
+
clientKey: r.client
|
|
25
23
|
};
|
|
26
24
|
});
|
|
27
|
-
return
|
|
28
|
-
label:
|
|
29
|
-
options:
|
|
30
|
-
}
|
|
31
|
-
};
|
|
25
|
+
return n.length === 0 ? [] : {
|
|
26
|
+
label: e.title,
|
|
27
|
+
options: n
|
|
28
|
+
};
|
|
29
|
+
});
|
|
32
30
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
m as generateClientOptions,
|
|
32
|
+
y as generateCustomId
|
|
35
33
|
};
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import type { ScalarComboboxOption, ScalarComboboxOptionGroup } from '@scalar/components';
|
|
2
|
-
import type { TargetId } from '@scalar/snippetz';
|
|
2
|
+
import type { AvailableClients, ClientId, TargetId } from '@scalar/snippetz';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a client option in the request example block.
|
|
5
5
|
* Extends the base combobox option with language-specific information
|
|
6
6
|
* for generating code examples in different programming languages.
|
|
7
7
|
*/
|
|
8
8
|
export type ClientOption = ScalarComboboxOption & {
|
|
9
|
-
/**
|
|
9
|
+
/** A more specific ID */
|
|
10
|
+
id: AvailableClients[number];
|
|
11
|
+
/** Programming language or tool for code generation (e.g., 'javascript', 'python', 'curl') */
|
|
10
12
|
lang: TargetId | 'curl' | 'plaintext';
|
|
11
|
-
/**
|
|
13
|
+
/** Title shows when the client is selected in the dropdown */
|
|
12
14
|
title: string;
|
|
15
|
+
/** Target key for the client, differs from the lang due to the curl thing */
|
|
16
|
+
targetKey: TargetId;
|
|
17
|
+
/** Title of the target */
|
|
18
|
+
targetTitle: string;
|
|
19
|
+
/** Client key for the client */
|
|
20
|
+
clientKey: ClientId<TargetId>;
|
|
13
21
|
};
|
|
14
22
|
/**
|
|
15
23
|
* Augments the base combobox option group with ClientOptions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE5E;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG;IAChD,yBAAyB;IACzB,EAAE,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC5B,8FAA8F;IAC9F,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;IACrC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,SAAS,EAAE,QAAQ,CAAA;IACnB,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,gCAAgC;IAChC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;CAC9B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,GAAG;IAC3E,wDAAwD;IACxD,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA"}
|