@scalar/api-client 2.15.0 → 2.17.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 +150 -0
- package/dist/hooks/useResponseBody.js +6 -6
- package/dist/libs/errors.d.ts +1 -0
- package/dist/libs/errors.d.ts.map +1 -1
- package/dist/libs/errors.js +1 -0
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +41 -35
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +28 -38
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +84 -45
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -11
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +28 -35
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +10 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +22 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +31 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +31 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +3 -9
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +56 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +10 -3
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-security.js +46 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +45 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.js +66 -0
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +9 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts +16 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +4 -0
- package/dist/v2/blocks/operation-block/helpers/get-delimiter.js +17 -0
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +9 -3
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +21 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +53 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.js +120 -0
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +89 -110
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +8 -13
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +22 -28
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +19 -8
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +30 -24
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +12 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +20 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts +10 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +4 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +14 -12
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +191 -169
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +10 -10
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +2 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +15 -19
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +2 -2
- package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/types.d.ts +16 -0
- package/dist/v2/blocks/operation-code-sample/types.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +15 -10
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +158 -125
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +59 -50
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +148 -149
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +13 -3
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
- package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
- package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +0 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +97 -87
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
- 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 +59 -56
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +26 -24
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +44 -43
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +7 -6
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/code-input/CodeInput.vue2.js +61 -59
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
- package/dist/v2/components/resize/index.d.ts +0 -1
- package/dist/v2/components/resize/index.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -5
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +49 -47
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.d.ts +3 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +128 -139
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue2.js +103 -80
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
- package/dist/v2/features/app/helpers/routes.d.ts +32 -6
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +25 -16
- package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
- package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
- package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
- package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
- package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
- package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
- package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
- package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
- package/dist/v2/{hooks/use-workspace-client-events.js → features/app/hooks/use-workspace-client-app-events.js} +48 -45
- package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
- package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
- package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
- package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
- package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
- package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
- package/dist/v2/features/collection/components/Environment.vue.js +32 -1
- package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
- package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
- package/dist/v2/features/collection/components/Servers.vue.js +142 -2
- package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
- package/dist/v2/features/collection/components/Settings.vue.js +58 -2
- package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
- package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +1 -1
- package/dist/v2/features/modal/Modal.vue2.js +118 -31
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +59 -28
- package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
- package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
- package/dist/v2/features/operation/index.d.ts +0 -1
- package/dist/v2/features/operation/index.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
- package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
- package/dist/v2/helpers/generate-location-id.d.ts +19 -0
- package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
- package/dist/v2/helpers/generate-location-id.js +10 -0
- package/dist/v2/helpers/get-active-environment.d.ts +5 -0
- package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
- package/dist/v2/helpers/get-active-environment.js +22 -0
- package/dist/v2/helpers/get-tab-details.d.ts +2 -2
- package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/v2/helpers/plugins.d.ts +59 -0
- package/dist/v2/helpers/plugins.d.ts.map +1 -0
- package/dist/v2/helpers/plugins.js +11 -0
- package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
- package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
- package/dist/v2/hooks/use-scroll-lock.js +21 -0
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +18 -18
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
- package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
- package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
- package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
- package/dist/v2/hooks/use-sync-path.js +0 -51
- package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
- package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
- package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
- package/dist/v2/plugins.d.ts +0 -44
- package/dist/v2/plugins.d.ts.map +0 -1
- /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
- /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
- /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
|
+
import { createSidebarState } from '@scalar/sidebar';
|
|
3
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
4
|
+
import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
|
|
5
|
+
import { type ComputedRef } from 'vue';
|
|
6
|
+
import type { RoutePayload } from '../../../../v2/features/modal/helpers/resolve-route-parameters.js';
|
|
7
|
+
export type UseModalSidebarReturn = {
|
|
8
|
+
handleSelectItem: (id: string) => void;
|
|
9
|
+
state: ReturnType<typeof createSidebarState<TraversedEntry>>;
|
|
10
|
+
getEntryByLocation: (location: {
|
|
11
|
+
document: string;
|
|
12
|
+
path?: string;
|
|
13
|
+
method?: HttpMethod;
|
|
14
|
+
example?: string;
|
|
15
|
+
}) => TraversedEntry | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* useSidebarState - Custom hook to manage the sidebar state and navigation logic in the Scalar API client
|
|
19
|
+
*
|
|
20
|
+
* This composable manages the sidebar structure, synchronizes selection state
|
|
21
|
+
* with the current route, and provides a handler for selecting sidebar items.
|
|
22
|
+
*
|
|
23
|
+
* Example usage:
|
|
24
|
+
*
|
|
25
|
+
* const { handleSelectItem, sidebarState } = useSidebarState({
|
|
26
|
+
* workspaceStore,
|
|
27
|
+
* workspaceSlug,
|
|
28
|
+
* documentSlug,
|
|
29
|
+
* path,
|
|
30
|
+
* method,
|
|
31
|
+
* exampleName,
|
|
32
|
+
* })
|
|
33
|
+
*/
|
|
34
|
+
export declare const useModalSidebar: ({ workspaceStore, documentSlug, path, method, exampleName, route, }: {
|
|
35
|
+
workspaceStore: WorkspaceStore | null;
|
|
36
|
+
documentSlug: ComputedRef<string | undefined>;
|
|
37
|
+
path: ComputedRef<string | undefined>;
|
|
38
|
+
method: ComputedRef<HttpMethod | undefined>;
|
|
39
|
+
exampleName: ComputedRef<string | undefined>;
|
|
40
|
+
route: (payload: RoutePayload) => void;
|
|
41
|
+
}) => UseModalSidebarReturn;
|
|
42
|
+
//# sourceMappingURL=use-modal-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-modal-sidebar.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/modal/hooks/use-modal-sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAuC,MAAM,iBAAiB,CAAA;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAAE,KAAK,WAAW,EAA4B,MAAM,KAAK,CAAA;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAA;AAGxF,MAAM,MAAM,qBAAqB,GAAG;IAClC,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,KAAK,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAA;IAC5D,kBAAkB,EAAE,CAAC,QAAQ,EAAE;QAC7B,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,UAAU,CAAA;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,KAAK,cAAc,GAAG,SAAS,CAAA;CACjC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,GAAI,qEAO7B;IACD,cAAc,EAAE,cAAc,GAAG,IAAI,CAAA;IACrC,YAAY,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC7C,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;CACvC,KAAG,qBAwJH,CAAA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { createSidebarState as S, generateReverseIndex as v, getChildEntry as I } from "@scalar/sidebar";
|
|
2
|
+
import { getParentEntry as l } from "@scalar/workspace-store/navigation";
|
|
3
|
+
import { computed as h, toValue as p, watch as b } from "vue";
|
|
4
|
+
import { generateLocationId as m } from "../../../helpers/generate-location-id.js";
|
|
5
|
+
const k = ({
|
|
6
|
+
workspaceStore: u,
|
|
7
|
+
documentSlug: o,
|
|
8
|
+
path: x,
|
|
9
|
+
method: y,
|
|
10
|
+
exampleName: f,
|
|
11
|
+
route: E
|
|
12
|
+
}) => {
|
|
13
|
+
const s = h(
|
|
14
|
+
() => u?.workspace.documents[p(o) ?? ""]?.["x-scalar-navigation"]?.children ?? []
|
|
15
|
+
), t = S(s), i = h(
|
|
16
|
+
() => v({
|
|
17
|
+
items: s.value,
|
|
18
|
+
nestedKey: "children",
|
|
19
|
+
filter: (e) => e.type === "operation" || e.type === "example",
|
|
20
|
+
getId: (e) => {
|
|
21
|
+
const r = l("operation", e);
|
|
22
|
+
return m({
|
|
23
|
+
document: p(o) ?? "",
|
|
24
|
+
path: r?.path,
|
|
25
|
+
method: r?.method,
|
|
26
|
+
example: e.type === "example" ? e.name : void 0
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
), c = (e) => {
|
|
31
|
+
const r = i.value.get(
|
|
32
|
+
m({
|
|
33
|
+
document: e.document,
|
|
34
|
+
path: e.path,
|
|
35
|
+
method: e.method,
|
|
36
|
+
example: e.example
|
|
37
|
+
})
|
|
38
|
+
);
|
|
39
|
+
return r || i.value.get(
|
|
40
|
+
m({
|
|
41
|
+
document: e.document,
|
|
42
|
+
path: e.path,
|
|
43
|
+
method: e.method
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
}, g = (e) => {
|
|
47
|
+
const r = t.getEntryById(e);
|
|
48
|
+
if (!r) {
|
|
49
|
+
console.warn(`Could not find sidebar entry with id ${e} to select`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (r.type === "operation" || r.type === "example") {
|
|
53
|
+
if (t.isSelected(e)) {
|
|
54
|
+
t.setExpanded(e, !t.isExpanded(e));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const a = l("operation", r), n = I("example", r);
|
|
58
|
+
return n ? (t.setSelected(n.id), t.setExpanded(n.id, !0)) : t.setSelected(e), a ? E({
|
|
59
|
+
documentSlug: p(o),
|
|
60
|
+
path: a.path,
|
|
61
|
+
method: a.method,
|
|
62
|
+
example: n?.name ?? "default"
|
|
63
|
+
}) : void 0;
|
|
64
|
+
}
|
|
65
|
+
t.setExpanded(e, !t.isExpanded(e));
|
|
66
|
+
};
|
|
67
|
+
return b(
|
|
68
|
+
[o, x, y, f],
|
|
69
|
+
([e, r, a, n]) => {
|
|
70
|
+
if (!e) {
|
|
71
|
+
t.setSelected(null);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const d = c({
|
|
75
|
+
document: e,
|
|
76
|
+
path: r,
|
|
77
|
+
method: a,
|
|
78
|
+
example: n
|
|
79
|
+
});
|
|
80
|
+
d && (t.setSelected(d.id), t.setExpanded(d.id, !0));
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
immediate: !0
|
|
84
|
+
}
|
|
85
|
+
), {
|
|
86
|
+
handleSelectItem: g,
|
|
87
|
+
state: t,
|
|
88
|
+
getEntryByLocation: c
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
k as useModalSidebar
|
|
93
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModalState } from '@scalar/components';
|
|
2
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
|
+
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
|
|
5
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
6
|
+
import type { UseModalSidebarReturn } from '../../../../v2/features/modal/hooks/use-modal-sidebar.js';
|
|
7
|
+
/**
|
|
8
|
+
* Top level event handling for the modal client
|
|
9
|
+
*/
|
|
10
|
+
export declare const useWorkspaceClientModalEvents: ({ eventBus, document, isSidebarOpen, sidebarState, modalState, workspaceStore, }: {
|
|
11
|
+
eventBus: WorkspaceEventBus;
|
|
12
|
+
document: ComputedRef<WorkspaceDocument | null>;
|
|
13
|
+
isSidebarOpen: Ref<boolean>;
|
|
14
|
+
sidebarState: UseModalSidebarReturn;
|
|
15
|
+
modalState: ModalState;
|
|
16
|
+
workspaceStore: WorkspaceStore;
|
|
17
|
+
}) => void;
|
|
18
|
+
//# sourceMappingURL=use-workspace-client-modal-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-workspace-client-modal-events.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/modal/hooks/use-workspace-client-modal-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAuBvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAExF;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,kFAO3C;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,YAAY,EAAE,qBAAqB,CAAA;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,cAAc,EAAE,cAAc,CAAA;CAC/B,SAgEA,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { deleteSecurityScheme as d, updateSelectedAuthTab as i, updateSecurityScheme as u, updateSelectedScopes as s, updateSelectedSecuritySchemes as y, addServer as c, updateServer as v, deleteServer as S, updateServerVariables as h, updateSelectedServer as n, addOperationParameter as R, updateOperationParameter as q, deleteOperationParameter as w, deleteAllOperationParameters as m, updateOperationRequestBodyContentType as O, updateOperationRequestBodyExample as f, addOperationRequestBodyFormRow as P, updateOperationRequestBodyFormRow as b, deleteOperationRequestBodyFormRow as k, updateSelectedClient as x } from "@scalar/workspace-store/mutators";
|
|
2
|
+
const F = ({
|
|
3
|
+
eventBus: a,
|
|
4
|
+
document: r,
|
|
5
|
+
isSidebarOpen: o,
|
|
6
|
+
sidebarState: t,
|
|
7
|
+
modalState: l,
|
|
8
|
+
workspaceStore: p
|
|
9
|
+
}) => {
|
|
10
|
+
a.on("scroll-to:nav-item", ({ id: e }) => t.handleSelectItem(e)), a.on("auth:delete:security-scheme", (e) => d(r.value, e)), a.on("auth:update:active-index", (e) => i(r.value, e)), a.on("auth:update:security-scheme", (e) => u(r.value, e)), a.on("auth:update:selected-scopes", (e) => s(r.value, e)), a.on(
|
|
11
|
+
"auth:update:selected-security-schemes",
|
|
12
|
+
async (e) => await y(r.value, e)
|
|
13
|
+
), a.on("server:add:server", () => c(r.value)), a.on("server:update:server", (e) => v(r.value, e)), a.on("server:delete:server", (e) => S(r.value, e)), a.on("server:update:variables", (e) => h(r.value, e)), a.on("server:update:selected", (e) => n(r.value, e)), a.on("operation:add:parameter", (e) => R(r.value, e)), a.on("operation:update:parameter", (e) => q(r.value, e)), a.on("operation:delete:parameter", (e) => w(r.value, e)), a.on("operation:delete-all:parameters", (e) => m(r.value, e)), a.on(
|
|
14
|
+
"operation:update:requestBody:contentType",
|
|
15
|
+
(e) => O(r.value, e)
|
|
16
|
+
), a.on("operation:update:requestBody:value", (e) => {
|
|
17
|
+
f(r.value, e);
|
|
18
|
+
}), a.on("operation:add:requestBody:formRow", (e) => {
|
|
19
|
+
P(r.value, e);
|
|
20
|
+
}), a.on(
|
|
21
|
+
"operation:update:requestBody:formRow",
|
|
22
|
+
(e) => b(r.value, e)
|
|
23
|
+
), a.on(
|
|
24
|
+
"operation:delete:requestBody:formRow",
|
|
25
|
+
(e) => k(r.value, e)
|
|
26
|
+
), a.on("ui:toggle:sidebar", () => o.value = !o.value), a.on("ui:close:client-modal", () => l.hide()), a.on("workspace:update:selected-client", (e) => x(p.workspace, e));
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
F as useWorkspaceClientModalEvents
|
|
30
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AA2KA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;;AACH,wBAmOC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getResolvedRef as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as h, computed as a, onMounted as p, watch as y, createBlock as f, createElementBlock as k, openBlock as s, unref as n, createElementVNode as S } from "vue";
|
|
2
|
+
import { getResolvedRef as g } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
3
|
+
import { useRouter as w } from "vue-router";
|
|
4
|
+
import { getOperationHeader as B } from "./helpers/get-operation-header.js";
|
|
5
|
+
import { getSecurityRequirements as C } from "./helpers/get-security-requirements.js";
|
|
6
|
+
import { getSelectedSecurity as R } from "./helpers/get-selected-security.js";
|
|
7
|
+
import x from "../../blocks/operation-block/OperationBlock.vue.js";
|
|
8
|
+
const N = {
|
|
7
9
|
key: 1,
|
|
8
10
|
class: "flex h-full w-full items-center justify-center"
|
|
9
|
-
},
|
|
10
|
-
...
|
|
11
|
+
}, q = {}, O = /* @__PURE__ */ h({
|
|
12
|
+
...q,
|
|
11
13
|
__name: "Operation",
|
|
12
14
|
props: {
|
|
13
15
|
documentSlug: {},
|
|
@@ -19,53 +21,82 @@ const g = {
|
|
|
19
21
|
exampleName: {},
|
|
20
22
|
environment: {},
|
|
21
23
|
workspaceStore: {},
|
|
22
|
-
activeWorkspace: {}
|
|
24
|
+
activeWorkspace: {},
|
|
25
|
+
plugins: {}
|
|
23
26
|
},
|
|
24
27
|
setup(e) {
|
|
25
|
-
const
|
|
26
|
-
() => e.path && e.method ?
|
|
27
|
-
),
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const o = a(
|
|
29
|
+
() => e.path && e.method ? g(e.document?.paths?.[e.path]?.[e.method]) ?? null : null
|
|
30
|
+
), u = a(() => [
|
|
31
|
+
...e.workspaceStore.workspace?.["x-scalar-cookies"] ?? [],
|
|
32
|
+
...e.document?.["x-scalar-cookies"] ?? []
|
|
33
|
+
]), m = a(
|
|
30
34
|
() => e.document?.servers?.find(
|
|
31
35
|
({ url: t }) => t === e.document?.["x-scalar-selected-server"]
|
|
32
36
|
) ?? null
|
|
33
37
|
);
|
|
34
|
-
|
|
38
|
+
p(() => {
|
|
35
39
|
typeof e.document?.["x-scalar-selected-server"] > "u" && e.document?.servers?.[0]?.url && e.eventBus.emit("server:update:selected", { url: e.document.servers[0].url });
|
|
36
|
-
})
|
|
37
|
-
|
|
40
|
+
}), y(
|
|
41
|
+
o,
|
|
42
|
+
(t) => {
|
|
43
|
+
t && e.path && e.method && !B({
|
|
44
|
+
operation: t,
|
|
45
|
+
name: "Accept",
|
|
46
|
+
type: "header"
|
|
47
|
+
}) && e.eventBus.emit("operation:add:parameter", {
|
|
48
|
+
type: "header",
|
|
49
|
+
meta: { method: e.method, path: e.path, exampleKey: e.exampleName ?? "default" },
|
|
50
|
+
payload: {
|
|
51
|
+
key: "Accept",
|
|
52
|
+
value: "*/*",
|
|
53
|
+
isDisabled: !1
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
{ immediate: !0 }
|
|
58
|
+
);
|
|
59
|
+
const l = a(
|
|
60
|
+
() => C(e.document, o.value)
|
|
61
|
+
), c = a(
|
|
62
|
+
() => R(e.document, o.value, l.value)
|
|
63
|
+
), i = a(() => e.document?.["x-scalar-set-operation-security"] ? {
|
|
38
64
|
type: "operation",
|
|
39
65
|
path: e.path ?? "",
|
|
40
66
|
method: e.method ?? "get"
|
|
41
67
|
} : {
|
|
42
68
|
type: "document"
|
|
43
|
-
}),
|
|
44
|
-
return (t,
|
|
69
|
+
}), d = "2.17.0", v = w();
|
|
70
|
+
return (t, r) => t.path && t.method && t.exampleName && o.value ? (s(), f(n(x), {
|
|
45
71
|
key: 0,
|
|
46
|
-
appVersion:
|
|
47
|
-
authMeta:
|
|
72
|
+
appVersion: n(d),
|
|
73
|
+
authMeta: i.value,
|
|
74
|
+
documentUrl: t.document?.["x-scalar-original-source-url"],
|
|
48
75
|
environment: t.environment,
|
|
49
76
|
eventBus: t.eventBus,
|
|
50
77
|
exampleKey: t.exampleName,
|
|
78
|
+
globalCookies: u.value,
|
|
51
79
|
history: [],
|
|
80
|
+
httpClients: t.workspaceStore.config["x-scalar-reference-config"]?.httpClients,
|
|
52
81
|
layout: t.layout,
|
|
53
82
|
method: t.method,
|
|
54
|
-
operation:
|
|
83
|
+
operation: o.value,
|
|
55
84
|
path: t.path,
|
|
56
|
-
plugins:
|
|
57
|
-
|
|
85
|
+
plugins: t.plugins,
|
|
86
|
+
proxyUrl: t.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
|
|
87
|
+
securityRequirements: l.value,
|
|
58
88
|
securitySchemes: t.document?.components?.securitySchemes ?? {},
|
|
89
|
+
selectedClient: t.workspaceStore.workspace["x-scalar-default-client"],
|
|
59
90
|
selectedSecurity: c.value,
|
|
60
91
|
server: m.value,
|
|
61
92
|
servers: t.document?.servers ?? [],
|
|
62
93
|
totalPerformedRequests: 0,
|
|
63
|
-
"onUpdate:servers":
|
|
64
|
-
}, null, 8, ["appVersion", "authMeta", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "
|
|
65
|
-
|
|
94
|
+
"onUpdate:servers": r[0] || (r[0] = (U) => n(v).push({ name: "document.servers" }))
|
|
95
|
+
}, null, 8, ["appVersion", "authMeta", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "httpClients", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "server", "servers"])) : (s(), k("div", N, [...r[1] || (r[1] = [
|
|
96
|
+
S("span", { class: "text-c-3" }, "Select an operation to view details", -1)
|
|
66
97
|
])]));
|
|
67
98
|
}
|
|
68
99
|
});
|
|
69
100
|
export {
|
|
70
|
-
|
|
101
|
+
O as default
|
|
71
102
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
|
|
2
|
+
import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/parameter';
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves a parameter from an operation's parameters by name and type ('in').
|
|
5
|
+
* This is typically used to find a particular header, query, path, or cookie parameter.
|
|
6
|
+
*
|
|
7
|
+
* @param operation - The operation object containing the parameters array.
|
|
8
|
+
* @param name - The name of the parameter to search for (case-insensitive).
|
|
9
|
+
* @param type - The parameter location (e.g., 'header', 'query', 'path', 'cookie').
|
|
10
|
+
* @returns The found parameter object, or null if not found.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getOperationHeader: ({ operation, name, type, }: {
|
|
13
|
+
operation: OperationObject;
|
|
14
|
+
name: string;
|
|
15
|
+
type: ParameterObject["in"];
|
|
16
|
+
}) => import("@scalar/workspace-store/schemas/v3.1/strict/reference").ReferenceType<ParameterObject> | null;
|
|
17
|
+
//# sourceMappingURL=get-operation-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-operation-header.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-operation-header.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,4BAIhC;IACD,SAAS,EAAE,eAAe,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;CAC5B,0GAOA,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
const m = ({
|
|
3
|
+
operation: r,
|
|
4
|
+
name: o,
|
|
5
|
+
type: t
|
|
6
|
+
}) => r.parameters?.find((a) => {
|
|
7
|
+
const e = n(a);
|
|
8
|
+
return e.in === t && e.name.toLowerCase() === o.toLowerCase();
|
|
9
|
+
}) ?? null;
|
|
10
|
+
export {
|
|
11
|
+
m as getOperationHeader
|
|
12
|
+
};
|
|
@@ -8,5 +8,5 @@ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/stric
|
|
|
8
8
|
*
|
|
9
9
|
* Otherwise we generally go operation -> document security.
|
|
10
10
|
*/
|
|
11
|
-
export declare const getSecurityRequirements: (document: OpenApiDocument | null, operation
|
|
11
|
+
export declare const getSecurityRequirements: (document: OpenApiDocument | null, operation: OperationObject | null) => Partial<Record<string, string[]>>[];
|
|
12
12
|
//# sourceMappingURL=get-security-requirements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-security-requirements.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,eAAe,GAAG,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"get-security-requirements.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,eAAe,GAAG,IAAI,EAAE,WAAW,eAAe,GAAG,IAAI,wCAY1G,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OpenApiDocument, OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
/** Get the selected security for an operation or document, with defaults to the requirements */
|
|
3
|
+
export declare const getSelectedSecurity: (document: OpenApiDocument | null, operation: OperationObject | null, securityRequirements: NonNullable<OpenApiDocument["security"]>) => {
|
|
4
|
+
selectedIndex: number;
|
|
5
|
+
selectedSchemes: import("@scalar/workspace-store/schemas/v3.1/strict/security-requirement").SecurityRequirementObject[];
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=get-selected-security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAIpH,gGAAgG;AAChG,eAAO,MAAM,mBAAmB,GAC9B,UAAU,eAAe,GAAG,IAAI,EAChC,WAAW,eAAe,GAAG,IAAI,EACjC,sBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;;;CA6B/D,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isAuthOptional as r } from "../../../blocks/scalar-auth-selector-block/helpers/is-auth-optional.js";
|
|
2
|
+
const a = (e, t, s) => {
|
|
3
|
+
const c = s[0];
|
|
4
|
+
if (e?.["x-scalar-set-operation-security"]) {
|
|
5
|
+
if (t?.["x-scalar-selected-security"])
|
|
6
|
+
return t?.["x-scalar-selected-security"];
|
|
7
|
+
} else if (e?.["x-scalar-selected-security"])
|
|
8
|
+
return e?.["x-scalar-selected-security"];
|
|
9
|
+
return r(s) || !c ? {
|
|
10
|
+
selectedIndex: -1,
|
|
11
|
+
selectedSchemes: []
|
|
12
|
+
} : {
|
|
13
|
+
selectedIndex: 0,
|
|
14
|
+
selectedSchemes: [c]
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
a as getSelectedSecurity
|
|
19
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/components/SearchModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/components/SearchModal.vue"],"names":[],"mappings":"AAkJA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAQxE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AAoPF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SearchModal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-0c30b37a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,95 +1,96 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarModal as
|
|
3
|
-
import { nanoid as
|
|
1
|
+
import { defineComponent as $, ref as g, watch as I, computed as k, createBlock as w, openBlock as c, unref as l, withKeys as d, withModifiers as i, withCtx as m, createElementVNode as s, createVNode as b, isRef as x, createElementBlock as B, Fragment as V, renderList as C, createTextVNode as N, toDisplayString as K } from "vue";
|
|
2
|
+
import { ScalarModal as M, ScalarSearchInput as q, ScalarSearchResultList as D } from "@scalar/components";
|
|
3
|
+
import { nanoid as E } from "nanoid";
|
|
4
4
|
import { useSearchIndex as L } from "../hooks/use-search-index.js";
|
|
5
5
|
import F from "./SearchResult.vue.js";
|
|
6
6
|
const P = {
|
|
7
7
|
class: "mb-0 flex flex-col",
|
|
8
8
|
role: "search"
|
|
9
|
-
}, G = /* @__PURE__ */
|
|
9
|
+
}, G = /* @__PURE__ */ $({
|
|
10
10
|
__name: "SearchModal",
|
|
11
11
|
props: {
|
|
12
12
|
modalState: {},
|
|
13
13
|
documents: {},
|
|
14
14
|
eventBus: {}
|
|
15
15
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const v =
|
|
18
|
-
|
|
19
|
-
() =>
|
|
16
|
+
setup(u) {
|
|
17
|
+
const v = E(), p = `${v}-search-result`, f = `${v}-search-instructions`, { query: r, results: o } = L(() => u.documents), a = g(void 0);
|
|
18
|
+
I(
|
|
19
|
+
() => u.modalState.open,
|
|
20
20
|
(t) => {
|
|
21
|
-
t && (
|
|
21
|
+
t && (r.value = "");
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
const S = (t) => {
|
|
25
|
-
const e = t === "up" ? -1 : 1,
|
|
26
|
-
typeof
|
|
25
|
+
const e = t === "up" ? -1 : 1, n = o.value.length;
|
|
26
|
+
typeof a.value == "number" ? a.value = (a.value + e + n) % n : a.value = e === -1 ? n - 1 : 0;
|
|
27
27
|
};
|
|
28
28
|
function h(t) {
|
|
29
|
-
if (typeof t != "number" || !
|
|
29
|
+
if (typeof t != "number" || !o.value[t])
|
|
30
30
|
return;
|
|
31
|
-
const e =
|
|
32
|
-
|
|
31
|
+
const e = o.value[t];
|
|
32
|
+
u.modalState.hide(), u.eventBus.emit("scroll-to:nav-item", { id: e.item.id });
|
|
33
33
|
}
|
|
34
|
-
const R =
|
|
35
|
-
const t =
|
|
34
|
+
const R = k(() => {
|
|
35
|
+
const t = o.value[a.value ?? -1];
|
|
36
36
|
return t ? `search-result-${t.item.id}` : void 0;
|
|
37
37
|
});
|
|
38
|
-
return (t, e) => (
|
|
38
|
+
return (t, e) => (c(), w(l(M), {
|
|
39
39
|
"aria-label": "Reference Search",
|
|
40
40
|
state: t.modalState,
|
|
41
|
-
variant: "search"
|
|
41
|
+
variant: "search",
|
|
42
|
+
onKeydown: e[5] || (e[5] = d(i((n) => t.modalState.hide(), ["stop"]), ["esc"]))
|
|
42
43
|
}, {
|
|
43
|
-
default:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
modelValue:
|
|
47
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
44
|
+
default: m(() => [
|
|
45
|
+
s("div", P, [
|
|
46
|
+
b(l(q), {
|
|
47
|
+
modelValue: l(r),
|
|
48
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => x(r) ? r.value = n : null),
|
|
48
49
|
"aria-activedescendant": R.value,
|
|
49
50
|
"aria-autocomplete": "list",
|
|
50
51
|
"aria-controls": p,
|
|
51
52
|
"aria-describedby": f,
|
|
52
53
|
role: "combobox",
|
|
53
|
-
onBlur: e[1] || (e[1] = (
|
|
54
|
+
onBlur: e[1] || (e[1] = (n) => a.value = void 0),
|
|
54
55
|
onKeydown: [
|
|
55
|
-
e[2] || (e[2] =
|
|
56
|
-
e[3] || (e[3] =
|
|
57
|
-
e[4] || (e[4] =
|
|
56
|
+
e[2] || (e[2] = d(i((n) => S("down"), ["stop", "prevent"]), ["down"])),
|
|
57
|
+
e[3] || (e[3] = d(i(() => h(a.value), ["stop", "prevent"]), ["enter"])),
|
|
58
|
+
e[4] || (e[4] = d(i((n) => S("up"), ["stop", "prevent"]), ["up"]))
|
|
58
59
|
]
|
|
59
60
|
}, null, 8, ["modelValue", "aria-activedescendant"])
|
|
60
61
|
]),
|
|
61
|
-
|
|
62
|
+
b(l(D), {
|
|
62
63
|
id: p,
|
|
63
64
|
"aria-label": "Reference Search Results",
|
|
64
65
|
class: "custom-scroll p-1 pt-0",
|
|
65
|
-
noResults: !
|
|
66
|
+
noResults: !l(o).length
|
|
66
67
|
}, {
|
|
67
|
-
query:
|
|
68
|
-
N(
|
|
68
|
+
query: m(() => [
|
|
69
|
+
N(K(l(r)), 1)
|
|
69
70
|
]),
|
|
70
|
-
default:
|
|
71
|
-
(
|
|
72
|
-
id: `search-result-${
|
|
73
|
-
key:
|
|
74
|
-
isSelected:
|
|
75
|
-
result:
|
|
76
|
-
onClick:
|
|
71
|
+
default: m(() => [
|
|
72
|
+
(c(!0), B(V, null, C(l(o), (n, y) => (c(), w(F, {
|
|
73
|
+
id: `search-result-${n.item.id}`,
|
|
74
|
+
key: n.refIndex,
|
|
75
|
+
isSelected: a.value === y,
|
|
76
|
+
result: n,
|
|
77
|
+
onClick: i(() => h(y), ["prevent"])
|
|
77
78
|
}, null, 8, ["id", "isSelected", "result", "onClick"]))), 128))
|
|
78
79
|
]),
|
|
79
80
|
_: 1
|
|
80
81
|
}, 8, ["noResults"]),
|
|
81
|
-
|
|
82
|
+
s("div", {
|
|
82
83
|
id: f,
|
|
83
84
|
class: "ref-search-meta"
|
|
84
|
-
}, [...e[
|
|
85
|
-
|
|
85
|
+
}, [...e[6] || (e[6] = [
|
|
86
|
+
s("span", {
|
|
86
87
|
"aria-hidden": "true",
|
|
87
88
|
class: "contents"
|
|
88
89
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
s("span", null, "↑↓ Navigate"),
|
|
91
|
+
s("span", null, "⏎ Select")
|
|
91
92
|
], -1),
|
|
92
|
-
|
|
93
|
+
s("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)
|
|
93
94
|
])])
|
|
94
95
|
]),
|
|
95
96
|
_: 1
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
|
+
/**
|
|
3
|
+
* Generates a unique string ID for an API location, based on the document, path, method, and example.
|
|
4
|
+
* Filters out undefined values and serializes the composite array into a stable string.
|
|
5
|
+
*
|
|
6
|
+
* @param params - An object containing document, path, method, and optional example name.
|
|
7
|
+
* @returns A stringified array representing the unique location identifier.
|
|
8
|
+
*
|
|
9
|
+
* Example:
|
|
10
|
+
* generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })
|
|
11
|
+
* // => '["mydoc","/users","get","default"]'
|
|
12
|
+
*/
|
|
13
|
+
export declare const generateLocationId: ({ document, path, method, example, }: {
|
|
14
|
+
document: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
method?: HttpMethod;
|
|
17
|
+
example?: string;
|
|
18
|
+
}) => string;
|
|
19
|
+
//# sourceMappingURL=generate-location-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-location-id.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/generate-location-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,sCAKhC;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,WAEA,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
|
+
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
|
|
3
|
+
import { type XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
4
|
+
export declare const getActiveEnvironment: (workspace: WorkspaceStore | null, document: WorkspaceDocument | null) => XScalarEnvironment;
|
|
5
|
+
//# sourceMappingURL=get-active-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-active-environment.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-active-environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,2EAA2E,CAAA;AAGlF,eAAO,MAAM,oBAAoB,GAC/B,WAAW,cAAc,GAAG,IAAI,EAChC,UAAU,iBAAiB,GAAG,IAAI,KACjC,kBAsBF,CAAA"}
|