@scalar/api-reference 1.36.2 → 1.38.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 +83 -0
- package/dist/browser/standalone.js +28796 -26431
- 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/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/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.js +2 -2
- package/dist/components/GettingStarted.vue2.js +22 -22
- 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 +2 -2
- 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/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/esm.d.ts +2 -2
- package/dist/esm.d.ts.map +1 -1
- 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 +2 -2
- package/dist/features/Operation/components/Headers.vue2.js +31 -29
- 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 +3 -3
- 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 +2 -2
- 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 +3039 -2895
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentFetcher.d.ts +2 -2
- 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 +2 -2
- package/dist/features/document-source/hooks/useDocumentSource.d.ts.map +1 -1
- package/dist/features/document-source/hooks/useDocumentSource.js +38 -34
- 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/DocumentSelector.vue.d.ts +2 -2
- package/dist/features/multiple-documents/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/features/multiple-documents/useMultipleDocuments.d.ts +10 -7
- package/dist/features/multiple-documents/useMultipleDocuments.d.ts.map +1 -1
- package/dist/features/multiple-documents/useMultipleDocuments.js +47 -44
- 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.js +18 -18
- package/dist/features/toolbar/ApiReferenceToolbarConfig.vue.js +1 -1
- package/dist/features/toolbar/ApiReferenceToolbarConfigTheme.vue.d.ts +2 -2
- package/dist/features/toolbar/ApiReferenceToolbarPopover.vue.js +1 -1
- package/dist/features/toolbar/ApiReferenceToolbarSdks.vue.js +1 -1
- package/dist/features/toolbar/ApiReferenceToolbarShare.vue.js +8 -8
- package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.d.ts.map +1 -1
- package/dist/features/toolbar/ApiReferenceToolbarShareRegister.vue.js +34 -28
- package/dist/features/toolbar/ApiReferenceToolbarTitle.vue.js +27 -27
- 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/standalone/lib/html-api.d.ts +3 -3
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/register-globals.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +46 -40
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +18 -19
- 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 +2 -2
- 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 +24 -24
- package/dist/v2/helpers/map-configuration.d.ts.map +1 -1
- package/package.json +20 -17
- 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 +0 -14
- 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,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"}
|