@scalar/api-reference 1.36.1 → 1.37.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 +63 -0
- package/dist/browser/standalone.js +26246 -25660
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceContent.vue.d.ts +34 -0
- package/dist/components/ApiReferenceContent.vue.d.ts.map +1 -0
- package/dist/components/ApiReferenceContent.vue.js +8 -0
- package/dist/components/ApiReferenceContent.vue2.js +148 -0
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +239 -219
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/featured-clients.d.ts +1 -1
- package/dist/components/Content/ClientLibraries/featured-clients.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.d.ts +21 -3
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +132 -95
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts +4 -2
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue.js +2 -2
- package/dist/components/Content/Models/ClassicLayout.vue2.js +28 -28
- package/dist/components/Content/Models/Models.vue.d.ts +10 -2
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +25 -27
- package/dist/components/Content/Models/ModernLayout.vue.d.ts +6 -2
- package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Models/ModernLayout.vue2.js +30 -29
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +20 -6
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +58 -46
- package/dist/components/Content/Operations/get-current-index.d.ts +1 -1
- package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +24 -24
- package/dist/components/Content/Schema/helpers/get-ref-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/get-ref-name.js +9 -7
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +15 -14
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue.js +2 -2
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts +3 -1
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue2.js +34 -30
- package/dist/components/Content/Tags/Tag.vue.d.ts +3 -1
- package/dist/components/Content/Tags/Tag.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/Tag.vue.js +14 -12
- package/dist/components/Content/Tags/TagSection.vue.d.ts +2 -1
- package/dist/components/Content/Tags/TagSection.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/TagSection.vue.js +49 -52
- package/dist/components/OperationsList/OperationsList.vue.d.ts +1 -1
- package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.js +2 -2
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +2 -2
- package/dist/components/ShowMoreButton.vue.d.ts +1 -0
- package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +2 -2
- package/dist/components/ShowMoreButton.vue2.js +12 -12
- package/dist/consts/urls.d.ts +17 -0
- package/dist/consts/urls.d.ts.map +1 -0
- package/dist/consts/urls.js +7 -0
- package/dist/features/Operation/Operation.vue.d.ts +21 -9
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +42 -53
- package/dist/features/Operation/components/Header.vue.d.ts +2 -2
- package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Header.vue.js +9 -8
- package/dist/features/Operation/components/Headers.vue.d.ts +2 -2
- package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/Headers.vue2.js +35 -33
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +4 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +37 -31
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +5 -1
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +16 -17
- package/dist/features/Operation/components/ParameterList.vue.d.ts +6 -2
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +17 -19
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +6 -2
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue2.js +64 -65
- package/dist/features/Operation/components/RequestBody.vue.d.ts +4 -0
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/RequestBody.vue2.js +65 -65
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +4 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +2 -2
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +29 -22
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +6 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +18 -16
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +11 -5
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +3 -3
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +99 -90
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +12 -5
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +99 -87
- package/dist/features/Search/helpers/create-search-index.d.ts +2 -1
- package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
- package/dist/features/Search/types.d.ts +1 -1
- package/dist/features/Search/types.d.ts.map +1 -1
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/api-client-modal/ApiClientModal.vue.js +23 -26
- package/dist/features/api-client-modal/useApiClient.d.ts +3032 -2888
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentFetcher.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentFetcher.js +13 -11
- package/dist/features/document-source/hooks/useDocumentSource.d.ts +1 -1
- package/dist/features/document-source/hooks/useDocumentSource.d.ts.map +1 -1
- 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 +26 -18
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
- package/dist/features/example-responses/ExampleResponses.vue2.js +53 -53
- package/dist/features/multiple-documents/useMultipleDocuments.d.ts +11 -6
- package/dist/features/multiple-documents/useMultipleDocuments.d.ts.map +1 -1
- package/dist/features/multiple-documents/useMultipleDocuments.js +57 -48
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
- package/dist/features/test-request-button/TestRequestButton.vue2.js +15 -21
- package/dist/features/toolbar/ApiReferenceToolbar.vue.d.ts +16 -0
- package/dist/features/toolbar/ApiReferenceToolbar.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbar.vue.js +43 -0
- package/dist/features/toolbar/ApiReferenceToolbar.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarBlurb.vue.d.ts +13 -0
- package/dist/features/toolbar/ApiReferenceToolbarBlurb.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarBlurb.vue.js +12 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfig.vue.d.ts +14 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfig.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfig.vue.js +95 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfig.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayout.vue.d.ts +10 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayout.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayout.vue.js +27 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayout.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts +25 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayoutOptions.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayoutOptions.vue.js +123 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigLayoutOptions.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigTheme.vue.d.ts +11 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigTheme.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigTheme.vue.js +41 -0
- package/dist/features/toolbar/ApiReferenceToolbarConfigTheme.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarPopover.vue.d.ts +26 -0
- package/dist/features/toolbar/ApiReferenceToolbarPopover.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarPopover.vue.js +46 -0
- package/dist/features/toolbar/ApiReferenceToolbarPopover.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarRegisterButton.vue.d.ts +25 -0
- package/dist/features/toolbar/ApiReferenceToolbarRegisterButton.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarRegisterButton.vue.js +58 -0
- package/dist/features/toolbar/ApiReferenceToolbarRegisterButton.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarSdks.vue.d.ts +7 -0
- package/dist/features/toolbar/ApiReferenceToolbarSdks.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarSdks.vue.js +84 -0
- package/dist/features/toolbar/ApiReferenceToolbarSdks.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarShare.vue.d.ts +7 -0
- package/dist/features/toolbar/ApiReferenceToolbarShare.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarShare.vue.js +42 -0
- package/dist/features/toolbar/ApiReferenceToolbarShare.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.d.ts +7 -0
- package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.js +56 -0
- package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue2.js +4 -0
- package/dist/{v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts → features/toolbar/ApiReferenceToolbarShareTemporary.vue.d.ts} +6 -6
- package/dist/features/toolbar/ApiReferenceToolbarShareTemporary.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarShareTemporary.vue.js +83 -0
- package/dist/features/toolbar/ApiReferenceToolbarShareTemporary.vue2.js +4 -0
- package/dist/features/toolbar/ApiReferenceToolbarTitle.vue.d.ts +3 -0
- package/dist/features/toolbar/ApiReferenceToolbarTitle.vue.d.ts.map +1 -0
- package/dist/features/toolbar/ApiReferenceToolbarTitle.vue.js +51 -0
- package/dist/features/toolbar/ApiReferenceToolbarTitle.vue2.js +4 -0
- package/dist/features/toolbar/uploadTempDocument.d.ts +3 -0
- package/dist/features/toolbar/uploadTempDocument.d.ts.map +1 -0
- package/dist/features/toolbar/uploadTempDocument.js +21 -0
- package/dist/helpers/test-utils.d.ts +3 -365
- package/dist/helpers/test-utils.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts +4 -2
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +31 -27
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -19
- package/dist/style.css +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts +6 -6
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +93 -79
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +2 -2
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +11 -11
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +2 -2
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +10 -10
- package/dist/v2/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/helpers/featured-clients.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.d.ts +3 -0
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.js +2 -2
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue2.js +32 -31
- package/dist/v2/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +15 -8
- package/dist/v2/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-info-block/components/InfoBlock.vue.js +25 -20
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts +8 -7
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +27 -32
- package/dist/v2/blocks/scalar-server-selector-block/components/Selector.vue.d.ts +2 -22
- package/dist/v2/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts +8 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.js +2 -2
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue2.js +70 -65
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts +9 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.js +2 -2
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue2.js +60 -57
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts +3 -365
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts +3 -183
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts.map +1 -1
- package/dist/v2/helpers/map-configuration.d.ts +22 -22
- package/dist/v2/helpers/map-configuration.d.ts.map +1 -1
- package/package.json +21 -18
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts +0 -13
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +0 -1
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +0 -52
- package/dist/components/Content/Operations/TraversedEntryContainer.vue2.js +0 -4
- package/dist/components/Content/Operations/index.d.ts +0 -2
- package/dist/components/Content/Operations/index.d.ts.map +0 -1
- package/dist/hooks/useConfig.d.ts +0 -9
- package/dist/hooks/useConfig.d.ts.map +0 -1
- package/dist/hooks/useConfig.js +0 -10
- package/dist/legacy/stores/index.d.ts +0 -2
- package/dist/legacy/stores/index.d.ts.map +0 -1
- package/dist/legacy/stores/useExampleStore.d.ts +0 -5
- package/dist/legacy/stores/useExampleStore.d.ts.map +0 -1
- package/dist/legacy/stores/useExampleStore.js +0 -8
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.js +0 -4
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue2.js +0 -55
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +0 -79
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +0 -7
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +0 -236
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +0 -41
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +0 -22
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts +0 -20
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.js +0 -33
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts +0 -17
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.js +0 -26
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts +0 -4
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +0 -10
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts +0 -3
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-request-example-block/types.d.ts +0 -29
- package/dist/v2/blocks/scalar-request-example-block/types.d.ts.map +0 -1
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { defineComponent as D, computed as u, ref as k, watch as H, useId as I, createBlock as h, createCommentVNode as m, openBlock as i, unref as o, withCtx as n, createVNode as s, createSlots as N, createElementVNode as y, createElementBlock as S, renderSlot as C, toDisplayString as z } from "vue";
|
|
2
|
-
import { ScalarCard as E, ScalarCardHeader as K, ScalarCombobox as M, ScalarButton as F, ScalarCardSection as q, ScalarCodeBlock as U, ScalarCardFooter as A } from "@scalar/components";
|
|
3
|
-
import { freezeElement as G } from "@scalar/helpers/dom/freeze-element";
|
|
4
|
-
import { ScalarIconCaretDown as J } from "@scalar/icons";
|
|
5
|
-
import { operationToHar as P } from "@scalar/oas-utils/helpers/operation-to-har";
|
|
6
|
-
import { emitCustomEvent as T } from "@scalar/workspace-store/events";
|
|
7
|
-
import { getResolvedRef as Q } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
8
|
-
import { getResolvedRefDeep as $ } from "../../../../features/example-responses/helpers/get-resolved-ref-deep.js";
|
|
9
|
-
import { findClient as j } from "../helpers/find-client.js";
|
|
10
|
-
import { generateCustomId as B } from "../helpers/generate-client-options.js";
|
|
11
|
-
import { generateCodeSnippet as X } from "../helpers/generate-code-snippet.js";
|
|
12
|
-
import { getSecrets as Y } from "../helpers/get-secrets.js";
|
|
13
|
-
import Z from "./ExamplePicker.vue2.js";
|
|
14
|
-
import V from "../../../../components/HttpMethod/HttpMethod.vue.js";
|
|
15
|
-
const _ = ["innerHTML"], ee = { class: "text-base font-normal" }, te = ["id"], le = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "request-card-footer-addon"
|
|
18
|
-
}, oe = { class: "request-header" }, ae = {}, be = /* @__PURE__ */ D({
|
|
19
|
-
...ae,
|
|
20
|
-
__name: "RequestExample",
|
|
21
|
-
props: {
|
|
22
|
-
clientOptions: {},
|
|
23
|
-
selectedClient: {},
|
|
24
|
-
selectedServer: { default: () => ({ url: "/" }) },
|
|
25
|
-
selectedContentType: {},
|
|
26
|
-
selectedExample: {},
|
|
27
|
-
securitySchemes: { default: () => [] },
|
|
28
|
-
method: {},
|
|
29
|
-
path: {},
|
|
30
|
-
operation: {},
|
|
31
|
-
fallback: { type: Boolean },
|
|
32
|
-
generateLabel: { type: Function },
|
|
33
|
-
isWebhook: { type: Boolean }
|
|
34
|
-
},
|
|
35
|
-
setup(l) {
|
|
36
|
-
const c = u(() => {
|
|
37
|
-
const e = Q(l.operation.requestBody)?.content ?? {}, t = l.selectedContentType || Object.keys(e)[0];
|
|
38
|
-
return e[t]?.examples ?? {};
|
|
39
|
-
}), f = k(
|
|
40
|
-
l.selectedExample ?? Object.keys(c.value)[0]
|
|
41
|
-
), b = u(() => [
|
|
42
|
-
"x-custom-examples",
|
|
43
|
-
"x-codeSamples",
|
|
44
|
-
"x-code-samples"
|
|
45
|
-
].flatMap((t) => l.operation[t] ?? [])), p = u(() => b.value.length ? [
|
|
46
|
-
{
|
|
47
|
-
label: "Code Examples",
|
|
48
|
-
options: b.value.map((t) => {
|
|
49
|
-
const a = B(t), v = t.label || t.lang || a;
|
|
50
|
-
return {
|
|
51
|
-
id: a,
|
|
52
|
-
lang: t.lang || "plaintext",
|
|
53
|
-
title: v,
|
|
54
|
-
label: v
|
|
55
|
-
};
|
|
56
|
-
})
|
|
57
|
-
},
|
|
58
|
-
...l.clientOptions
|
|
59
|
-
] : l.clientOptions), r = k(
|
|
60
|
-
j(p.value, l.selectedClient) ?? null
|
|
61
|
-
);
|
|
62
|
-
H(
|
|
63
|
-
() => l.selectedClient,
|
|
64
|
-
(e) => {
|
|
65
|
-
const t = j(p.value, e);
|
|
66
|
-
t && (r.value = t);
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
const g = u(() => {
|
|
70
|
-
if (!l.isWebhook) return null;
|
|
71
|
-
try {
|
|
72
|
-
const e = c.value[f.value || ""], t = $(e), a = t?.value ?? t?.summary;
|
|
73
|
-
return P({ operation: l.operation, method: l.method, path: l.path, example: a });
|
|
74
|
-
} catch (e) {
|
|
75
|
-
return console.error("[webhookHar]", e), null;
|
|
76
|
-
}
|
|
77
|
-
}), x = u(() => {
|
|
78
|
-
try {
|
|
79
|
-
if (r.value?.id.startsWith("custom"))
|
|
80
|
-
return b.value.find(
|
|
81
|
-
(v) => B(v) === r.value?.id
|
|
82
|
-
)?.source ?? "Custom example not found";
|
|
83
|
-
const e = c.value[f.value || ""], t = $(e), a = t?.value ?? t?.summary;
|
|
84
|
-
return l.isWebhook ? g.value?.postData?.text ?? "" : X({
|
|
85
|
-
clientId: r.value?.id,
|
|
86
|
-
operation: l.operation,
|
|
87
|
-
method: l.method,
|
|
88
|
-
server: l.selectedServer,
|
|
89
|
-
securitySchemes: l.securitySchemes,
|
|
90
|
-
contentType: l.selectedContentType,
|
|
91
|
-
path: l.path,
|
|
92
|
-
example: a
|
|
93
|
-
});
|
|
94
|
-
} catch (e) {
|
|
95
|
-
return console.error("[generateSnippet]", e), "";
|
|
96
|
-
}
|
|
97
|
-
}), w = u(() => l.isWebhook ? O.value : r.value?.lang), O = u(() => {
|
|
98
|
-
if (!g.value?.postData) return "json";
|
|
99
|
-
const e = g.value.postData.mimeType;
|
|
100
|
-
return e?.includes("json") ? "json" : e?.includes("xml") ? "xml" : e?.includes("yaml") || e?.includes("yml") ? "yaml" : e?.includes("text/plain") ? "text" : "json";
|
|
101
|
-
}), W = u(() => Y(l.securitySchemes)), d = k(null), L = (e) => {
|
|
102
|
-
if (d.value) {
|
|
103
|
-
const t = G(d.value.$el);
|
|
104
|
-
setTimeout(() => {
|
|
105
|
-
t();
|
|
106
|
-
}, 300);
|
|
107
|
-
}
|
|
108
|
-
r.value = e, e.id.startsWith("custom") || T(d.value?.$el, "scalar-update-selected-client", e.id);
|
|
109
|
-
}, R = I();
|
|
110
|
-
return (e, t) => x.value ? (i(), h(o(E), {
|
|
111
|
-
key: 0,
|
|
112
|
-
ref_key: "elem",
|
|
113
|
-
ref: d,
|
|
114
|
-
class: "request-card dark-mode"
|
|
115
|
-
}, {
|
|
116
|
-
default: n(() => [
|
|
117
|
-
s(o(K), { class: "pr-2.5" }, N({
|
|
118
|
-
default: n(() => [
|
|
119
|
-
t[3] || (t[3] = y("span", { class: "sr-only" }, "Request Example for", -1)),
|
|
120
|
-
s(o(V), {
|
|
121
|
-
as: "span",
|
|
122
|
-
class: "request-method",
|
|
123
|
-
method: e.method
|
|
124
|
-
}, null, 8, ["method"]),
|
|
125
|
-
e.generateLabel ? (i(), S("span", {
|
|
126
|
-
key: 0,
|
|
127
|
-
innerHTML: e.generateLabel()
|
|
128
|
-
}, null, 8, _)) : m("", !0),
|
|
129
|
-
C(e.$slots, "header", {}, void 0, !0)
|
|
130
|
-
]),
|
|
131
|
-
_: 2
|
|
132
|
-
}, [
|
|
133
|
-
!e.isWebhook && p.value.length ? {
|
|
134
|
-
name: "actions",
|
|
135
|
-
fn: n(() => [
|
|
136
|
-
s(o(M), {
|
|
137
|
-
class: "max-h-80",
|
|
138
|
-
modelValue: r.value,
|
|
139
|
-
options: p.value,
|
|
140
|
-
placement: "bottom-end",
|
|
141
|
-
teleport: "",
|
|
142
|
-
"onUpdate:modelValue": t[0] || (t[0] = (a) => L(a))
|
|
143
|
-
}, {
|
|
144
|
-
default: n(() => [
|
|
145
|
-
s(o(F), {
|
|
146
|
-
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5",
|
|
147
|
-
"data-testid": "client-picker",
|
|
148
|
-
fullWidth: "",
|
|
149
|
-
variant: "ghost"
|
|
150
|
-
}, {
|
|
151
|
-
default: n(() => [
|
|
152
|
-
y("span", ee, z(r.value.title), 1),
|
|
153
|
-
s(o(J), {
|
|
154
|
-
class: "ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
155
|
-
weight: "bold"
|
|
156
|
-
})
|
|
157
|
-
]),
|
|
158
|
-
_: 1
|
|
159
|
-
})
|
|
160
|
-
]),
|
|
161
|
-
_: 1
|
|
162
|
-
}, 8, ["modelValue", "options"])
|
|
163
|
-
]),
|
|
164
|
-
key: "0"
|
|
165
|
-
} : void 0
|
|
166
|
-
]), 1024),
|
|
167
|
-
s(o(q), { class: "request-editor-section custom-scroll p-0" }, {
|
|
168
|
-
default: n(() => [
|
|
169
|
-
y("div", {
|
|
170
|
-
id: `${o(R)}-example`,
|
|
171
|
-
class: "code-snippet"
|
|
172
|
-
}, [
|
|
173
|
-
s(o(U), {
|
|
174
|
-
class: "bg-b-2 !min-h-full -outline-offset-2",
|
|
175
|
-
content: x.value,
|
|
176
|
-
hideCredentials: W.value,
|
|
177
|
-
lang: w.value,
|
|
178
|
-
lineNumbers: ""
|
|
179
|
-
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
180
|
-
], 8, te)
|
|
181
|
-
]),
|
|
182
|
-
_: 1
|
|
183
|
-
}),
|
|
184
|
-
Object.keys(c.value).length > 1 || e.$slots.footer ? (i(), h(o(A), {
|
|
185
|
-
key: 0,
|
|
186
|
-
class: "request-card-footer bg-b-3"
|
|
187
|
-
}, {
|
|
188
|
-
default: n(() => [
|
|
189
|
-
Object.keys(c.value).length > 1 ? (i(), S("div", le, [
|
|
190
|
-
Object.keys(c.value).length ? (i(), h(Z, {
|
|
191
|
-
key: 0,
|
|
192
|
-
modelValue: f.value,
|
|
193
|
-
"onUpdate:modelValue": [
|
|
194
|
-
t[1] || (t[1] = (a) => f.value = a),
|
|
195
|
-
t[2] || (t[2] = (a) => o(T)(
|
|
196
|
-
d.value?.$el,
|
|
197
|
-
"scalar-update-selected-example",
|
|
198
|
-
a
|
|
199
|
-
))
|
|
200
|
-
],
|
|
201
|
-
examples: c.value
|
|
202
|
-
}, null, 8, ["modelValue", "examples"])) : m("", !0)
|
|
203
|
-
])) : m("", !0),
|
|
204
|
-
C(e.$slots, "footer", {}, void 0, !0)
|
|
205
|
-
]),
|
|
206
|
-
_: 3
|
|
207
|
-
})) : m("", !0)
|
|
208
|
-
]),
|
|
209
|
-
_: 3
|
|
210
|
-
}, 512)) : e.fallback ? (i(), h(o(E), {
|
|
211
|
-
key: 1,
|
|
212
|
-
class: "request-card dark-mode"
|
|
213
|
-
}, {
|
|
214
|
-
default: n(() => [
|
|
215
|
-
s(o(q), { class: "request-card-simple" }, {
|
|
216
|
-
default: n(() => [
|
|
217
|
-
y("div", oe, [
|
|
218
|
-
s(o(V), {
|
|
219
|
-
as: "span",
|
|
220
|
-
class: "request-method",
|
|
221
|
-
method: e.method
|
|
222
|
-
}, null, 8, ["method"]),
|
|
223
|
-
C(e.$slots, "header", {}, void 0, !0)
|
|
224
|
-
]),
|
|
225
|
-
C(e.$slots, "footer", {}, void 0, !0)
|
|
226
|
-
]),
|
|
227
|
-
_: 3
|
|
228
|
-
})
|
|
229
|
-
]),
|
|
230
|
-
_: 3
|
|
231
|
-
})) : m("", !0);
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
export {
|
|
235
|
-
be as default
|
|
236
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ClientOption, ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
|
|
2
|
-
import { type AvailableClients } from '@scalar/snippetz';
|
|
3
|
-
export declare const DEFAULT_CLIENT = "shell/curl";
|
|
4
|
-
/** Type guard to check if a string is a valid client id */
|
|
5
|
-
export declare const isClient: (id: any) => id is AvailableClients[number];
|
|
6
|
-
/**
|
|
7
|
-
* Finds and returns the appropriate client option from a list of client option groups.
|
|
8
|
-
*
|
|
9
|
-
* This function is used to determine which client should be initially selected in the
|
|
10
|
-
* request example block. It prioritizes a specific client ID if provided, otherwise
|
|
11
|
-
* falls back to the first available option.
|
|
12
|
-
*
|
|
13
|
-
* @param options - Array of client option groups, each containing a label and array of client options
|
|
14
|
-
* @param id - Optional client identifier to search for (e.g., 'js/fetch', 'python/requests')
|
|
15
|
-
|
|
16
|
-
* @returns The selected client option. If a specific ID is provided and found, returns that client.
|
|
17
|
-
* If the ID is not found or not provided, returns the first available client option.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* const clientGroups = [
|
|
22
|
-
* {
|
|
23
|
-
* label: 'JavaScript',
|
|
24
|
-
* options: [
|
|
25
|
-
* { id: 'js/fetch', label: 'Fetch API', lang: 'js' },
|
|
26
|
-
* { id: 'js/axios', label: 'Axios', lang: 'js' }
|
|
27
|
-
* ]
|
|
28
|
-
* }
|
|
29
|
-
* ]
|
|
30
|
-
*
|
|
31
|
-
* // Find specific client
|
|
32
|
-
* const client = findClient(clientGroups, 'js/fetch')
|
|
33
|
-
* // Returns: { id: 'js/fetch', label: 'Fetch API', lang: 'js' }
|
|
34
|
-
*
|
|
35
|
-
* // Find first available client
|
|
36
|
-
* const firstClient = findClient(clientGroups)
|
|
37
|
-
* // Returns: { id: 'js/fetch', label: 'Fetch API', lang: 'js' }
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export declare const findClient: (clientGroups: ClientOptionGroup[], clientId?: AvailableClients[number] | undefined) => ClientOption;
|
|
41
|
-
//# sourceMappingURL=find-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAI,IAAI,GAAG,KAAG,EAAE,IAAI,gBAAgB,CAAC,MAAM,CAAmC,CAAA;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,UAAU,GACrB,cAAc,iBAAiB,EAAE,EACjC,WAAW,gBAAgB,CAAC,MAAM,CAAC,GAAG,SAAS,KAC9C,YAwBF,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AVAILABLE_CLIENTS as f } from "@scalar/snippetz";
|
|
2
|
-
const c = "shell/curl", d = (o) => f.includes(o), u = (o, s) => {
|
|
3
|
-
const r = o[0]?.options[0];
|
|
4
|
-
if (s)
|
|
5
|
-
for (const i of o) {
|
|
6
|
-
const t = i.options.find((n) => n.id === s);
|
|
7
|
-
if (t)
|
|
8
|
-
return t;
|
|
9
|
-
}
|
|
10
|
-
if (!r?.id.startsWith("custom"))
|
|
11
|
-
for (const i of o) {
|
|
12
|
-
const t = i.options.find((n) => n.id === c);
|
|
13
|
-
if (t)
|
|
14
|
-
return t;
|
|
15
|
-
}
|
|
16
|
-
return r;
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
c as DEFAULT_CLIENT,
|
|
20
|
-
u as findClient,
|
|
21
|
-
d as isClient
|
|
22
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ClientOptionGroup } from '../../../../v2/blocks/scalar-request-example-block/types';
|
|
2
|
-
import type { XCodeSample } from '@scalar/openapi-types/schemas/extensions';
|
|
3
|
-
import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
4
|
-
/** Helper to generate an ID for custom code samples */
|
|
5
|
-
export declare const generateCustomId: (example: XCodeSample) => string;
|
|
6
|
-
/**
|
|
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
|
-
*
|
|
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
|
|
18
|
-
*/
|
|
19
|
-
export declare const generateClientOptions: (hiddenClients: ApiReferenceConfiguration["hiddenClients"]) => ClientOptionGroup[];
|
|
20
|
-
//# sourceMappingURL=generate-client-options.d.ts.map
|
package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,GAAI,SAAS,WAAW,WAA6B,CAAA;AAElF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,GAChC,eAAe,yBAAyB,CAAC,eAAe,CAAC,KACxD,iBAAiB,EAwDnB,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
}
|
|
15
|
-
return {
|
|
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
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
return n.length === 0 ? [] : {
|
|
26
|
-
label: e.title,
|
|
27
|
-
options: n
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
export {
|
|
31
|
-
m as generateClientOptions,
|
|
32
|
-
y as generateCustomId
|
|
33
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { AvailableClients } from '@scalar/snippetz';
|
|
2
|
-
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
3
|
-
import type { ServerObject, OperationObject, SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
4
|
-
type Props = {
|
|
5
|
-
clientId: AvailableClients[number];
|
|
6
|
-
operation: OperationObject;
|
|
7
|
-
example: unknown;
|
|
8
|
-
method: HttpMethod;
|
|
9
|
-
path: string;
|
|
10
|
-
contentType?: string | undefined;
|
|
11
|
-
server?: ServerObject | undefined;
|
|
12
|
-
securitySchemes?: SecuritySchemeObject[] | undefined;
|
|
13
|
-
};
|
|
14
|
-
/** Generate the code snippet for the selected example OR operation */
|
|
15
|
-
export declare const generateCodeSnippet: ({ clientId, operation, method, path, example, contentType, server, securitySchemes, }: Props) => string;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=generate-code-snippet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,kBAAkB,CAAA;AAG5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,oBAAoB,EACrB,MAAM,8DAA8D,CAAA;AAErE,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAClC,SAAS,EAAE,eAAe,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;IACjC,eAAe,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAA;CACrD,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,uFASjC,KAAK,KAAG,MAmBV,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { operationToHar as f } from "@scalar/oas-utils/helpers/operation-to-har";
|
|
2
|
-
import { getSnippet as l } from "@scalar/api-client/views/Components/CodeSnippet";
|
|
3
|
-
const K = ({
|
|
4
|
-
clientId: r,
|
|
5
|
-
operation: t,
|
|
6
|
-
method: o,
|
|
7
|
-
path: n,
|
|
8
|
-
example: p,
|
|
9
|
-
contentType: i,
|
|
10
|
-
server: a,
|
|
11
|
-
securitySchemes: s
|
|
12
|
-
}) => {
|
|
13
|
-
const c = f({
|
|
14
|
-
operation: t,
|
|
15
|
-
contentType: i,
|
|
16
|
-
method: o,
|
|
17
|
-
path: n,
|
|
18
|
-
server: a,
|
|
19
|
-
securitySchemes: s,
|
|
20
|
-
example: p
|
|
21
|
-
}), [g, m] = r.split("/"), [e, d] = l(g, m, c);
|
|
22
|
-
return e ? e.message ?? "Error generating code snippet" : d;
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
K as generateCodeSnippet
|
|
26
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
-
/** Extract secrets from security schemes */
|
|
3
|
-
export declare const getSecrets: (securitySchemes: SecuritySchemeObject[]) => string[];
|
|
4
|
-
//# sourceMappingURL=get-secrets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-request-example-block/helpers/get-secrets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAGxG,4CAA4C;AAC5C,eAAO,MAAM,UAAU,GAAI,iBAAiB,oBAAoB,EAAE,KAAG,MAAM,EAqBvD,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { encode as e } from "js-base64";
|
|
2
|
-
const l = (t) => t.flatMap((r) => r.type === "apiKey" ? r["x-scalar-secret-token"] : r?.type === "http" ? [
|
|
3
|
-
r["x-scalar-secret-token"],
|
|
4
|
-
r["x-scalar-secret-username"],
|
|
5
|
-
r["x-scalar-secret-password"],
|
|
6
|
-
e(`${r["x-scalar-secret-username"]}:${r["x-scalar-secret-password"]}`)
|
|
7
|
-
] : r.type === "oauth2" ? Object.values(r.flows).map((a) => a["x-scalar-secret-token"]) : []).filter(Boolean);
|
|
8
|
-
export {
|
|
9
|
-
l as getSecrets
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-request-example-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ScalarComboboxOption, ScalarComboboxOptionGroup } from '@scalar/components';
|
|
2
|
-
import type { AvailableClients, ClientId, TargetId } from '@scalar/snippetz';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a client option in the request example block.
|
|
5
|
-
* Extends the base combobox option with language-specific information
|
|
6
|
-
* for generating code examples in different programming languages.
|
|
7
|
-
*/
|
|
8
|
-
export type ClientOption = ScalarComboboxOption & {
|
|
9
|
-
/** A more specific ID */
|
|
10
|
-
id: AvailableClients[number];
|
|
11
|
-
/** Programming language or tool for code generation (e.g., 'javascript', 'python', 'curl') */
|
|
12
|
-
lang: TargetId | 'curl' | 'plaintext';
|
|
13
|
-
/** Title shows when the client is selected in the dropdown */
|
|
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>;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Augments the base combobox option group with ClientOptions
|
|
24
|
-
*/
|
|
25
|
-
export type ClientOptionGroup = Omit<ScalarComboboxOptionGroup, 'options'> & {
|
|
26
|
-
/** Array of client options that belong to this group */
|
|
27
|
-
options: ClientOption[];
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|