@scalar/api-client 2.14.1 → 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 +176 -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 +81 -65
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -23
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +29 -38
- 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 +202 -160
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +60 -51
- 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 +2 -2
- 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/RequestTable.vue.d.ts +2 -4
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +3 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +146 -147
- 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/create-parameter-handlers.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +21 -15
- 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 +4 -15
- 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 +117 -71
- 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 +16 -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 +81 -65
- 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 +9 -5
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +51 -46
- 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 +130 -143
- 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 +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +216 -106
- 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/ItemDecorator.vue.d.ts +22 -0
- package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/ItemDecorator.vue.js +138 -0
- package/dist/v2/features/app/components/ItemDecorator.vue2.js +4 -0
- 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/features/app/hooks/use-workspace-client-app-events.js +156 -0
- 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/command-palette/components/CommandPaletteExample.vue.d.ts +8 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +76 -68
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +8 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +83 -75
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +32 -34
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +16 -0
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +24 -21
- 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/features/settings/DocumentSettings.vue.js +2 -2
- package/dist/v2/features/settings/DocumentSettings.vue2.js +1 -1
- 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/helpers/storage.d.ts.map +1 -1
- package/dist/v2/helpers/storage.js +5 -5
- 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 +19 -19
- 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-client-events.js +0 -112
- 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
|
@@ -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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./DocumentSettings.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-cda64f02"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -71,8 +71,8 @@ const U = { class: "flex flex-col gap-12" }, C = { class: "flex flex-col gap-2"
|
|
|
71
71
|
], -1)),
|
|
72
72
|
n(o(y), {
|
|
73
73
|
class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
|
|
74
|
-
variant: "danger",
|
|
75
74
|
disabled: l.isDraftDocument,
|
|
75
|
+
variant: "danger",
|
|
76
76
|
onClick: b
|
|
77
77
|
}, {
|
|
78
78
|
default: m(() => [...t[6] || (t[6] = [
|
|
@@ -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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { xScalarEnvironmentSchema as r } from "@scalar/workspace-store/schemas/extensions/document/x-scalar-environments";
|
|
2
|
+
import { coerceValue as a } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
3
|
+
const s = (e, o) => {
|
|
4
|
+
if (e === null)
|
|
5
|
+
return a(r, {});
|
|
6
|
+
const n = e.workspace["x-scalar-active-environment"];
|
|
7
|
+
if (!n)
|
|
8
|
+
return a(r, {});
|
|
9
|
+
const t = e.workspace["x-scalar-environments"]?.[n] ?? {
|
|
10
|
+
variables: []
|
|
11
|
+
}, i = o?.["x-scalar-environments"]?.[n] ?? {
|
|
12
|
+
variables: []
|
|
13
|
+
};
|
|
14
|
+
return a(r, {
|
|
15
|
+
...t,
|
|
16
|
+
...i,
|
|
17
|
+
variables: [...t.variables, ...i.variables]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
s as getActiveEnvironment
|
|
22
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace';
|
|
3
|
-
import type {
|
|
3
|
+
import type { UseAppSidebarReturn } from '../../v2/features/app/hooks/use-app-sidebar.js';
|
|
4
4
|
/**
|
|
5
5
|
* Returns display details for a tab in the API client UI.
|
|
6
6
|
* Determines the title and icon to use based on workspace, document, path, and method.
|
|
@@ -35,7 +35,7 @@ export declare const getTabDetails: ({ workspace, document, path, method, getEnt
|
|
|
35
35
|
document?: string;
|
|
36
36
|
path?: string;
|
|
37
37
|
method?: HttpMethod;
|
|
38
|
-
getEntryByLocation:
|
|
38
|
+
getEntryByLocation: UseAppSidebarReturn["getEntryByLocation"];
|
|
39
39
|
}) => {
|
|
40
40
|
title: string;
|
|
41
41
|
icon?: Tab["icon"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-tab-details.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-tab-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAE/E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"get-tab-details.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-tab-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,GAAI,4DAM3B;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,kBAAkB,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAA;CAC9D,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAoCtC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
|
|
2
2
|
const r = {
|
|
3
|
-
Enter: { event: "operation:send:request", modifiers: ["default"] },
|
|
3
|
+
Enter: { event: "operation:send:request:hotkey", modifiers: ["default"] },
|
|
4
4
|
b: { event: "ui:toggle:sidebar", modifiers: ["default"] },
|
|
5
5
|
p: { event: "ui:open:command-palette", modifiers: ["shiftKey"] },
|
|
6
6
|
l: { event: "ui:focus:address-bar", modifiers: ["default"] }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
/** A type representing the hooks that a client plugin can define */
|
|
4
|
+
export type ClientPluginHooks = {
|
|
5
|
+
beforeRequest: (payload: Request) => Request | Promise<Request>;
|
|
6
|
+
responseReceived: (payload: {
|
|
7
|
+
response: Response;
|
|
8
|
+
request: Request;
|
|
9
|
+
operation: OperationObject;
|
|
10
|
+
}) => void | Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
/** A type representing the components that a client plugin can define */
|
|
13
|
+
export type ClientPluginComponents = {
|
|
14
|
+
request: Component;
|
|
15
|
+
response: Component;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* ClientPlugin is used to extend the API Client with custom hooks and UI components.
|
|
19
|
+
*
|
|
20
|
+
* Example usage:
|
|
21
|
+
*
|
|
22
|
+
* const myPlugin: ClientPlugin = {
|
|
23
|
+
* hooks: {
|
|
24
|
+
* beforeRequest: (request) => {
|
|
25
|
+
* // Modify the request before it is sent
|
|
26
|
+
* request.headers.set('X-Custom-Header', 'foo');
|
|
27
|
+
* return request;
|
|
28
|
+
* },
|
|
29
|
+
* responseReceived: async (response, operation) => {
|
|
30
|
+
* // Handle post-response logic
|
|
31
|
+
* const data = await response.json();
|
|
32
|
+
* console.log('Received:', data, 'for operation:', operation.operationId);
|
|
33
|
+
* }
|
|
34
|
+
* },
|
|
35
|
+
* components: {
|
|
36
|
+
* request: MyRequestComponent, // Custom Vue component for rendering the request section
|
|
37
|
+
* response: MyResponseComponent // Custom Vue component for rendering the response section
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
*/
|
|
41
|
+
export type ClientPlugin = {
|
|
42
|
+
hooks?: Partial<ClientPluginHooks>;
|
|
43
|
+
components?: Partial<ClientPluginComponents>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Maps hook names to their expected payload types.
|
|
47
|
+
* This ensures type safety when executing hooks with their corresponding payloads.
|
|
48
|
+
* Derived from the ClientPlugin hooks definition.
|
|
49
|
+
*/
|
|
50
|
+
type HookPayloadMap = {
|
|
51
|
+
[K in keyof ClientPluginHooks]: Parameters<ClientPluginHooks[K]>[0];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Execute any hook with type-safe payload handling.
|
|
55
|
+
* The payload type is inferred from the hook name to ensure correct usage.
|
|
56
|
+
*/
|
|
57
|
+
export declare const executeHook: <K extends keyof HookPayloadMap>(payload: HookPayloadMap[K], hookName: K, plugins: ClientPlugin[]) => Promise<HookPayloadMap[K]>;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,gBAAgB,EAAE,CAAC,OAAO,EAAE;QAC1B,QAAQ,EAAE,QAAQ,CAAA;QAClB,OAAO,EAAE,OAAO,CAAA;QAChB,SAAS,EAAE,eAAe,CAAA;KAC3B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B,CAAA;AAED,yEAAyE;AACzE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,KAAK,cAAc,GAAG;KACnB,CAAC,IAAI,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,SAAS,MAAM,cAAc,EAC9D,SAAS,cAAc,CAAC,CAAC,CAAC,EAC1B,UAAU,CAAC,EACX,SAAS,YAAY,EAAE,KACtB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAY3B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/storage.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;oCACoB,MAAM,KAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/storage.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;oCACoB,MAAM,KAAG,IAAI;IAQpC;;OAEG;gCACc,MAAM,GAAG,IAAI;CAGtB,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { safeLocalStorage as
|
|
2
|
-
const
|
|
1
|
+
import { safeLocalStorage as e } from "@scalar/helpers/object/local-storage";
|
|
2
|
+
const r = "scalar.currentPath", o = {
|
|
3
3
|
/**
|
|
4
4
|
* We keep the currently active path so we can reload it if needed
|
|
5
5
|
*/
|
|
6
|
-
setCurrentPath: (
|
|
7
|
-
t().setItem(
|
|
6
|
+
setCurrentPath: (t) => {
|
|
7
|
+
t !== "/" && e().setItem(r, t);
|
|
8
8
|
},
|
|
9
9
|
/**
|
|
10
10
|
* Retrieve the last active path
|
|
11
11
|
*/
|
|
12
|
-
getLastPath: () =>
|
|
12
|
+
getLastPath: () => e().getItem(r)
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
15
|
o as workspaceStorage
|