@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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* useScrollLock - A Vue composition function to lock and unlock scrolling on a specific element.
|
|
4
|
+
*
|
|
5
|
+
* This hook provides a computed ref that allows you to enable or disable scrolling on a given HTMLElement.
|
|
6
|
+
* Locking sets the element's `overflow` style to `'hidden'`.
|
|
7
|
+
* Unlocking restores the original `overflow` value.
|
|
8
|
+
*
|
|
9
|
+
* The lock state will be automatically cleaned up (unlocked) when the component is unmounted.
|
|
10
|
+
*
|
|
11
|
+
* @param element - MaybeRefOrGetter for the HTMLElement to lock scrolling on. Can be a ref or a function.
|
|
12
|
+
* @returns A computed ref: assign `true` to lock, `false` to unlock, read for current state.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // In your setup():
|
|
17
|
+
* const container = ref<HTMLElement | null>(null)
|
|
18
|
+
* const scrollLock = useScrollLock(container)
|
|
19
|
+
*
|
|
20
|
+
* // To lock scrolling:
|
|
21
|
+
* scrollLock.value = true
|
|
22
|
+
*
|
|
23
|
+
* // To unlock scrolling:
|
|
24
|
+
* scrollLock.value = false
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const useScrollLock: (element: MaybeRefOrGetter<HTMLElement | null | undefined>) => import("vue").WritableComputedRef<boolean, boolean>;
|
|
28
|
+
//# sourceMappingURL=use-scroll-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scroll-lock.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-scroll-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAA2C,MAAM,KAAK,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,aAAa,GAAI,SAAS,gBAAgB,CAAC,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC,wDAiDtF,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ref as s, computed as f, onBeforeUnmount as a, toValue as n } from "vue";
|
|
2
|
+
const v = (l) => {
|
|
3
|
+
const o = s(""), t = s(!1), c = () => {
|
|
4
|
+
const e = n(l);
|
|
5
|
+
e && (o.value = e.style.overflow, e.style.overflow = "hidden");
|
|
6
|
+
}, r = () => {
|
|
7
|
+
const e = n(l);
|
|
8
|
+
e && (o.value !== "" ? e.style.overflow = o.value : e.style.removeProperty("overflow"));
|
|
9
|
+
}, u = f({
|
|
10
|
+
get: () => t.value,
|
|
11
|
+
set: (e) => {
|
|
12
|
+
t.value = e, e ? c() : r();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return a(() => {
|
|
16
|
+
t.value && r();
|
|
17
|
+
}), u;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
v as useScrollLock
|
|
21
|
+
};
|
|
@@ -3,6 +3,8 @@ import type { HarRequest } from '@scalar/snippetz';
|
|
|
3
3
|
import type { EnvVariables } from '../../../../libs/env-helpers.js';
|
|
4
4
|
/**
|
|
5
5
|
* Creates a snippetz-compatible HarRequest from OpenAPI-like store entities
|
|
6
|
+
*
|
|
7
|
+
* @deprecated, can be removed once we've migrated to the new code snippet component
|
|
6
8
|
*/
|
|
7
9
|
export declare const getHarRequest: ({ operation, example, server, securitySchemes, environment, }: {
|
|
8
10
|
operation?: Operation | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/get-har-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/get-har-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAQtD;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,+DAM3B;IACD,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;IAClC,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CACvC,KAAG,UA0GH,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { REGEX as t } from "@scalar/oas-utils/helpers";
|
|
1
2
|
import { buildRequestSecurity as T } from "../../../../libs/send-request/build-request-security.js";
|
|
2
3
|
import { replaceTemplateVariables as a } from "../../../../libs/string-template.js";
|
|
3
|
-
import { REGEX as t } from "@scalar/oas-utils/helpers";
|
|
4
4
|
import { convertToHarRequest as P } from "./convert-to-har-request.js";
|
|
5
5
|
const S = "YOUR_SECRET_TOKEN", O = ({
|
|
6
6
|
operation: d,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** biome-ignore-all lint/performance/noBarrelFile: these are exported publicly */
|
|
2
1
|
export { restoreAuthFromLocalStorage } from './helpers/restore-auth-from-local-storage.js';
|
|
3
2
|
export { default as RequestAuth } from './RequestAuth.vue.js';
|
|
4
3
|
export { default as RequestAuthDataTable } from './RequestAuthDataTable.vue.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAA;AACvF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
33
33
|
}));
|
|
34
34
|
}, f = (o) => {
|
|
35
35
|
o?.createNew && g.name === "request" && d();
|
|
36
|
-
}, v = "2.
|
|
36
|
+
}, v = "2.17.0";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (o, e) => (i(), l("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.
|
|
21
|
+
"version": "2.17.0",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -322,25 +322,25 @@
|
|
|
322
322
|
"yaml": "^2.8.0",
|
|
323
323
|
"zod": "^4.1.11",
|
|
324
324
|
"@scalar/analytics-client": "1.0.1",
|
|
325
|
-
"@scalar/components": "0.16.
|
|
325
|
+
"@scalar/components": "0.16.11",
|
|
326
|
+
"@scalar/helpers": "0.2.4",
|
|
326
327
|
"@scalar/draggable": "0.3.0",
|
|
327
|
-
"@scalar/
|
|
328
|
-
"@scalar/
|
|
329
|
-
"@scalar/
|
|
330
|
-
"@scalar/
|
|
331
|
-
"@scalar/oas-utils": "0.6.7",
|
|
332
|
-
"@scalar/object-utils": "1.2.15",
|
|
328
|
+
"@scalar/icons": "0.5.2",
|
|
329
|
+
"@scalar/import": "0.4.41",
|
|
330
|
+
"@scalar/json-magic": "0.8.8",
|
|
331
|
+
"@scalar/oas-utils": "0.6.11",
|
|
333
332
|
"@scalar/openapi-types": "0.5.3",
|
|
334
|
-
"@scalar/openapi-parser": "0.23.
|
|
335
|
-
"@scalar/
|
|
336
|
-
"@scalar/sidebar": "0.
|
|
337
|
-
"@scalar/
|
|
338
|
-
"@scalar/
|
|
339
|
-
"@scalar/
|
|
340
|
-
"@scalar/
|
|
333
|
+
"@scalar/openapi-parser": "0.23.9",
|
|
334
|
+
"@scalar/object-utils": "1.2.18",
|
|
335
|
+
"@scalar/sidebar": "0.7.1",
|
|
336
|
+
"@scalar/themes": "0.13.26",
|
|
337
|
+
"@scalar/types": "0.5.4",
|
|
338
|
+
"@scalar/use-codemirror": "0.13.5",
|
|
339
|
+
"@scalar/postman-to-openapi": "0.3.52",
|
|
340
|
+
"@scalar/snippetz": "0.6.1",
|
|
341
341
|
"@scalar/use-toasts": "0.9.1",
|
|
342
|
-
"@scalar/
|
|
343
|
-
"@scalar/
|
|
342
|
+
"@scalar/use-hooks": "0.3.3",
|
|
343
|
+
"@scalar/workspace-store": "0.24.1"
|
|
344
344
|
},
|
|
345
345
|
"devDependencies": {
|
|
346
346
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -355,8 +355,8 @@
|
|
|
355
355
|
"vite": "7.1.11",
|
|
356
356
|
"vite-svg-loader": "5.1.0",
|
|
357
357
|
"vitest": "3.2.4",
|
|
358
|
-
"@scalar/
|
|
359
|
-
"@scalar/
|
|
358
|
+
"@scalar/galaxy": "0.5.12",
|
|
359
|
+
"@scalar/build-tooling": "0.4.0"
|
|
360
360
|
},
|
|
361
361
|
"scripts": {
|
|
362
362
|
"build": "scalar-build-vite",
|
package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ParameterObject, RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve an example value for a parameter or requestBody from either `examples` or `content.*.examples`.
|
|
4
|
-
* Or the [deprecated] `example` field.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getExampleValue: (param: ParameterObject | RequestBodyObject, example?: string, contentType?: string) => unknown;
|
|
7
|
-
//# sourceMappingURL=get-example-value.d.ts.map
|
package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-example-value.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAItH;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,eAAe,GAAG,iBAAiB,EAC1C,UAAU,MAAM,EAChB,cAAc,MAAM,KACnB,OA8CF,CAAA"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { getResolvedRefDeep as l } from "../get-resolved-ref-deep.js";
|
|
2
|
-
const f = (e, s, i) => {
|
|
3
|
-
if (s && "examples" in e && e.examples) {
|
|
4
|
-
const n = l(e.examples[s])?.value;
|
|
5
|
-
if (n)
|
|
6
|
-
return n;
|
|
7
|
-
}
|
|
8
|
-
if ("content" in e && e.content) {
|
|
9
|
-
const n = i ?? Object.keys(e.content)[0], t = e.content[n ?? ""];
|
|
10
|
-
if (t?.examples) {
|
|
11
|
-
const x = s ?? Object.keys(t.examples)[0], o = l(t.examples[x ?? ""]);
|
|
12
|
-
if (o)
|
|
13
|
-
return o.value;
|
|
14
|
-
}
|
|
15
|
-
if (t?.example !== void 0)
|
|
16
|
-
return t.example;
|
|
17
|
-
}
|
|
18
|
-
if ("example" in e && e.example !== void 0)
|
|
19
|
-
return e.example;
|
|
20
|
-
if ("examples" in e && e.examples) {
|
|
21
|
-
const n = Object.keys(e.examples)[0] ?? "", t = l(e.examples[n])?.value;
|
|
22
|
-
if (t)
|
|
23
|
-
return t;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
f as getExampleValue
|
|
28
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
-
/**
|
|
3
|
-
* Extract example from parameter object
|
|
4
|
-
*/
|
|
5
|
-
export declare const getParameterExample: (parameter: ParameterObject, exampleKey: string) => import("@scalar/workspace-store/schemas/v3.1/strict/example").ExampleObject | undefined;
|
|
6
|
-
//# sourceMappingURL=get-parameter-example.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-parameter-example.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/get-parameter-example.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAInG;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,WAAW,eAAe,EAAE,YAAY,MAAM,4FAYjF,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
-
import { getParameterContentValue as r } from "./get-parameter-content.js";
|
|
3
|
-
const l = (e, t) => {
|
|
4
|
-
if ("examples" in e && e.examples)
|
|
5
|
-
return n(e.examples[t]);
|
|
6
|
-
const o = r(e);
|
|
7
|
-
if (o?.examples)
|
|
8
|
-
return n(o.examples[t]);
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
l as getParameterExample
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-document-watcher.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-document-watcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAA6C,MAAM,KAAK,CAAA;AA6FtF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,kBAAkB,GAAI,0CAIhC;IACD,YAAY,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAClD,KAAK,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,KAAG,IA6FH,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sidebar-state.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-sidebar-state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAwB,MAAM,iBAAiB,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,KAAK,CAAA;AAGrE,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,8DAM7B;IACD,cAAc,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACvD,aAAa,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACnD,YAAY,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAClD,IAAI,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC1C,MAAM,EAAE,gBAAgB,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAChD,WAAW,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CAClD,KAAG,qBAoOH,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-path.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-sync-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAKvE,OAAO,EAAqB,KAAK,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AAEtG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,eAAO,MAAM,WAAW,GAAI,kDAIzB;IACD,sBAAsB,EAAE,0BAA0B,CAAA;IAClD,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;;CA2IA,CAAA"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ref as m, watch as h } from "vue";
|
|
2
|
-
import { useRoute as v, useRouter as x } from "vue-router";
|
|
3
|
-
import { workspaceStorage as d } from "../helpers/storage.js";
|
|
4
|
-
import { DEFAULT_WORKSPACE as k } from "./use-workspace-selector.js";
|
|
5
|
-
const W = ({
|
|
6
|
-
workspaceSelectorState: e,
|
|
7
|
-
tabsState: u,
|
|
8
|
-
eventBus: l
|
|
9
|
-
}) => {
|
|
10
|
-
const n = v(), p = x(), s = m(!1), f = () => {
|
|
11
|
-
const a = e.store.value;
|
|
12
|
-
if (!a)
|
|
13
|
-
return;
|
|
14
|
-
const t = a.workspace["x-scalar-tabs"], r = a.workspace["x-scalar-active-tab"] ?? 0;
|
|
15
|
-
t?.[r] && (t[r] = u.createTabFromCurrentRoute());
|
|
16
|
-
}, b = async (a) => {
|
|
17
|
-
const t = e.store.value;
|
|
18
|
-
if (!t)
|
|
19
|
-
return;
|
|
20
|
-
const r = t.workspace["x-scalar-tabs"] ?? [], o = t.workspace["x-scalar-active-tab"] ?? 0, c = r[o];
|
|
21
|
-
c && c.path !== n.path && await a?.({ tabPath: c.path });
|
|
22
|
-
}, w = async (a) => {
|
|
23
|
-
e.store.value = null, s.value = !0;
|
|
24
|
-
const t = await e.loadWorkspace(a);
|
|
25
|
-
if (t.success) {
|
|
26
|
-
const { workspace: o } = t, c = o.workspace["x-scalar-active-tab"] ?? 0, i = o.workspace["x-scalar-tabs"]?.[c];
|
|
27
|
-
i && await p.replace(i.path), o.workspace["x-scalar-tabs"] || l.emit("tabs:update:tabs", {
|
|
28
|
-
"x-scalar-tabs": [u.createTabFromCurrentRoute()],
|
|
29
|
-
"x-scalar-active-tab": 0
|
|
30
|
-
}), s.value = !1;
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const r = await e.createWorkspace(k);
|
|
34
|
-
if (s.value = !1, !r)
|
|
35
|
-
return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
|
|
36
|
-
};
|
|
37
|
-
return h(
|
|
38
|
-
[() => n.path],
|
|
39
|
-
async () => {
|
|
40
|
-
d.setCurrentPath(n.path);
|
|
41
|
-
const a = n.params.workspaceSlug;
|
|
42
|
-
if (typeof a == "string" && a !== e.activeWorkspace.value?.id)
|
|
43
|
-
return await w(a);
|
|
44
|
-
await b(f), s.value = !1;
|
|
45
|
-
},
|
|
46
|
-
{ immediate: !0 }
|
|
47
|
-
), { isLoading: s };
|
|
48
|
-
};
|
|
49
|
-
export {
|
|
50
|
-
W as useSyncPath
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-tabs.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAC/E,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAA0B,MAAM,KAAK,CAAA;AAI7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAMzE,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAA;IAChB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACvB,yBAAyB,EAAE,MAAM,GAAG,CAAA;CACrC,CAAA;AAED,KAAK,aAAa,GAAG;IACnB,cAAc,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC1C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,aAAa,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACnD,YAAY,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAClD,IAAI,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC1C,MAAM,EAAE,gBAAgB,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAChD,kBAAkB,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAA;CAChE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,oFAOrB,aAAa,KAAG,aA4DlB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-workspace-client-events.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-workspace-client-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAwC,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAgD7G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,GAAG,EAAW,MAAM,KAAK,CAAA;AAGzD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+DAA+D,CAAA;AACjH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,2FAOtC;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,cAAc,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC1C,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,mBAAmB,EAAE,4BAA4B,CAAA;IACjD,YAAY,EAAE,qBAAqB,CAAA;CACpC,SA6PA,CAAA"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { mergeObjects as v } from "@scalar/workspace-store/helpers/merge-object";
|
|
2
|
-
import { updateActiveProxy as b, updateColorMode as h, updateTheme as y, updateDocumentIcon as f, toggleSecurity as x, updateWatchMode as T, createEmptyDocument as g, upsertEnvironment as w, upsertEnvironmentVariable as O, upsertCookie as R, deleteCookie as q, deleteSecurityScheme as C, updateSelectedAuthTab as E, updateSecurityScheme as k, updateSelectedScopes as P, updateSelectedSecuritySchemes as A, addServer as I, updateServer as F, deleteServer as M, updateServerVariables as N, updateSelectedServer as V, createOperation as D, updateOperationMethod as K, updateOperationPath as L, updateOperationSummary as W, addOperationParameter as j, updateOperationParameter as U, deleteOperationParameter as z, deleteAllOperationParameters as G, updateOperationRequestBodyContentType as H, updateOperationRequestBodyExample as J, addOperationRequestBodyFormRow as Q, updateOperationRequestBodyFormRow as X, deleteOperationRequestBodyFormRow as Y, createTag as Z, addTab as _, closeTab as $, closeOtherTabs as S, focusTab as B, focusLastTab as ee, navigatePreviousTab as ae, navigateNextTab as te, updateTabs as oe } from "@scalar/workspace-store/mutators";
|
|
3
|
-
import { toValue as m } from "vue";
|
|
4
|
-
import { useRouter as re } from "vue-router";
|
|
5
|
-
const ue = ({
|
|
6
|
-
eventBus: a,
|
|
7
|
-
document: t,
|
|
8
|
-
workspaceStore: o,
|
|
9
|
-
isSidebarOpen: u,
|
|
10
|
-
commandPaletteState: c,
|
|
11
|
-
sidebarState: d
|
|
12
|
-
}) => {
|
|
13
|
-
const s = re(), i = (e, r) => {
|
|
14
|
-
const l = m(o);
|
|
15
|
-
return l ? r === "document" ? e.value : l.workspace : null;
|
|
16
|
-
}, n = async () => {
|
|
17
|
-
const e = m(o);
|
|
18
|
-
if (!e)
|
|
19
|
-
return;
|
|
20
|
-
const r = e.workspace["x-scalar-active-tab"] ?? 0, l = e.workspace["x-scalar-tabs"]?.[r];
|
|
21
|
-
l && await s.replace(l.path);
|
|
22
|
-
}, p = (e) => {
|
|
23
|
-
const r = t.value?.["x-scalar-navigation"]?.id;
|
|
24
|
-
if (!r)
|
|
25
|
-
return;
|
|
26
|
-
const l = d.getEntryByLocation({
|
|
27
|
-
document: r,
|
|
28
|
-
path: e.path,
|
|
29
|
-
method: e.method,
|
|
30
|
-
example: e.exampleKey
|
|
31
|
-
});
|
|
32
|
-
(!l || l.type !== "example") && o.value?.buildSidebar(r);
|
|
33
|
-
};
|
|
34
|
-
a.on("scroll-to:nav-item", ({ id: e }) => d.handleSelectItem(e)), a.on(
|
|
35
|
-
"workspace:update:active-proxy",
|
|
36
|
-
(e) => b(o.value?.workspace ?? null, e)
|
|
37
|
-
), a.on(
|
|
38
|
-
"workspace:update:color-mode",
|
|
39
|
-
(e) => h(o.value?.workspace ?? null, e)
|
|
40
|
-
), a.on("workspace:update:theme", (e) => y(o.value?.workspace ?? null, e)), a.on("document:update:icon", (e) => f(t.value, e)), a.on("document:update:info", (e) => t.value && v(t.value.info, e)), a.on("document:toggle:security", () => x(t.value)), a.on("document:update:watch-mode", (e) => T(t.value, e)), a.on("document:create:empty-document", (e) => g(o.value, e)), a.on("environment:upsert:environment", (e) => {
|
|
41
|
-
o.value && w(t.value, o.value.workspace, e);
|
|
42
|
-
}), a.on(
|
|
43
|
-
"environment:delete:environment",
|
|
44
|
-
({ environmentName: e, collectionType: r }) => delete i(t, r)?.["x-scalar-environments"]?.[e]
|
|
45
|
-
), a.on("environment:upsert:environment-variable", (e) => {
|
|
46
|
-
const r = i(t, e.collectionType);
|
|
47
|
-
O(r, e);
|
|
48
|
-
}), a.on(
|
|
49
|
-
"environment:delete:environment-variable",
|
|
50
|
-
({ environmentName: e, index: r, collectionType: l }) => i(t, l)?.["x-scalar-environments"]?.[e]?.variables?.splice(r, 1)
|
|
51
|
-
), a.on("cookie:upsert:cookie", (e) => {
|
|
52
|
-
const r = i(t, e.collectionType);
|
|
53
|
-
R(r, e);
|
|
54
|
-
}), a.on("cookie:delete:cookie", (e) => {
|
|
55
|
-
const r = i(t, e.collectionType);
|
|
56
|
-
q(r, e);
|
|
57
|
-
}), a.on("auth:delete:security-scheme", (e) => C(t.value, e)), a.on("auth:update:active-index", (e) => E(t.value, e)), a.on("auth:update:security-scheme", (e) => k(t.value, e)), a.on("auth:update:selected-scopes", (e) => P(t.value, e)), a.on(
|
|
58
|
-
"auth:update:selected-security-schemes",
|
|
59
|
-
async (e) => await A(t.value, e)
|
|
60
|
-
), a.on("server:add:server", () => I(t.value)), a.on("server:update:server", (e) => F(t.value, e)), a.on("server:delete:server", (e) => M(t.value, e)), a.on("server:update:variables", (e) => N(t.value, e)), a.on("server:update:selected", (e) => V(t.value, e)), a.on("operation:create:operation", (e) => D(o.value, e)), a.on(
|
|
61
|
-
"operation:update:method",
|
|
62
|
-
(e) => K(t.value, o.value, e, (r) => {
|
|
63
|
-
r && s.replace({
|
|
64
|
-
name: "example",
|
|
65
|
-
params: {
|
|
66
|
-
method: e.payload.method,
|
|
67
|
-
pathEncoded: encodeURIComponent(e.meta.path),
|
|
68
|
-
exampleName: e.meta.exampleKey
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
})
|
|
72
|
-
), a.on("operation:update:path", (e) => L(t.value, e)), a.on("operation:update:summary", (e) => W(t.value, e)), a.on("operation:add:parameter", (e) => {
|
|
73
|
-
j(t.value, e), p(e.meta);
|
|
74
|
-
}), a.on("operation:update:parameter", (e) => {
|
|
75
|
-
U(t.value, e), p(e.meta);
|
|
76
|
-
}), a.on("operation:delete:parameter", (e) => z(t.value, e)), a.on("operation:delete-all:parameters", (e) => G(t.value, e)), a.on(
|
|
77
|
-
"operation:update:requestBody:contentType",
|
|
78
|
-
(e) => H(t.value, e)
|
|
79
|
-
), a.on("operation:update:requestBody:value", (e) => {
|
|
80
|
-
J(t.value, e), p(e.meta);
|
|
81
|
-
}), a.on("operation:add:requestBody:formRow", (e) => {
|
|
82
|
-
Q(t.value, e), p(e.meta);
|
|
83
|
-
}), a.on(
|
|
84
|
-
"operation:update:requestBody:formRow",
|
|
85
|
-
(e) => X(t.value, e)
|
|
86
|
-
), a.on(
|
|
87
|
-
"operation:delete:requestBody:formRow",
|
|
88
|
-
(e) => Y(t.value, e)
|
|
89
|
-
), a.on("tag:create:tag", (e) => Z(o.value, e)), a.on("ui:toggle:sidebar", () => u.value = !u.value), a.on(
|
|
90
|
-
"ui:open:command-palette",
|
|
91
|
-
(e) => {
|
|
92
|
-
e ? c.open(e.action, e.payload) : c.open();
|
|
93
|
-
}
|
|
94
|
-
), a.on("tabs:add:tab", async (e) => {
|
|
95
|
-
_(o.value?.workspace ?? null, e), await n();
|
|
96
|
-
}), a.on("tabs:close:tab", async (e) => {
|
|
97
|
-
$(o.value?.workspace ?? null, e), await n();
|
|
98
|
-
}), a.on("tabs:close:other-tabs", (e) => S(o.value?.workspace ?? null, e)), a.on("tabs:focus:tab", async (e) => {
|
|
99
|
-
B(o.value?.workspace ?? null, e), await n();
|
|
100
|
-
}), a.on("tabs:focus:tab-last", async (e) => {
|
|
101
|
-
ee(o.value?.workspace ?? null, e), await n();
|
|
102
|
-
}), a.on("tabs:navigate:previous", async (e) => {
|
|
103
|
-
ae(o.value?.workspace ?? null, e), await n();
|
|
104
|
-
}), a.on("tabs:navigate:next", async (e) => {
|
|
105
|
-
te(o.value?.workspace ?? null, e), await n();
|
|
106
|
-
}), a.on("tabs:update:tabs", async (e) => {
|
|
107
|
-
oe(o.value?.workspace ?? null, e), await n();
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
export {
|
|
111
|
-
ue as useWorkspaceClientEvents
|
|
112
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-workspace-selector.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-workspace-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAK1F,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,KAAK,CAAA;AAOnC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAG/B,CAAA;AA0BD,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,eAAe,EAAE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,CAAA;IACtC,UAAU,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7C,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAA;IAC5E,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,cAAc,CAAA;KAAE,GAAG;QAAE,OAAO,EAAE,KAAK,CAAA;KAAE,CAAC,CAAA;CAC1G,CAAA;AAED,eAAO,MAAM,oBAAoB,QAAO,0BAiJvC,CAAA"}
|
package/dist/v2/plugins.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
|
|
2
|
-
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
|
|
3
|
-
import type { Component } from 'vue';
|
|
4
|
-
/**
|
|
5
|
-
* ClientPlugin is used to extend the API Client with custom hooks and UI components.
|
|
6
|
-
*
|
|
7
|
-
* Example usage:
|
|
8
|
-
*
|
|
9
|
-
* const myPlugin: ClientPlugin = {
|
|
10
|
-
* hooks: {
|
|
11
|
-
* beforeRequest: (request) => {
|
|
12
|
-
* // Modify the request before it is sent
|
|
13
|
-
* request.headers.set('X-Custom-Header', 'foo');
|
|
14
|
-
* return request;
|
|
15
|
-
* },
|
|
16
|
-
* responseReceived: async (response, operation) => {
|
|
17
|
-
* // Handle post-response logic
|
|
18
|
-
* const data = await response.json();
|
|
19
|
-
* console.log('Received:', data, 'for operation:', operation.operationId);
|
|
20
|
-
* }
|
|
21
|
-
* },
|
|
22
|
-
* components: {
|
|
23
|
-
* request: MyRequestComponent, // Custom Vue component for rendering the request section
|
|
24
|
-
* response: MyResponseComponent // Custom Vue component for rendering the response section
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
27
|
-
*/
|
|
28
|
-
export type ClientPlugin = {
|
|
29
|
-
hooks?: Partial<{
|
|
30
|
-
beforeRequest: (request: Request) => Request | Promise<Request>;
|
|
31
|
-
responseReceived: (response: Response, operation: Record<string, any>) => void | Promise<void>;
|
|
32
|
-
}>;
|
|
33
|
-
components?: Partial<{
|
|
34
|
-
request: Component<{
|
|
35
|
-
operation: OperationObject;
|
|
36
|
-
selectedExample?: string;
|
|
37
|
-
}>;
|
|
38
|
-
response: Component<{
|
|
39
|
-
request?: Request;
|
|
40
|
-
response?: ResponseInstance;
|
|
41
|
-
}>;
|
|
42
|
-
}>;
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=plugins.d.ts.map
|
package/dist/v2/plugins.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/v2/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACpC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;QACd,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAC/D,gBAAgB,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;KAC/F,CAAC,CAAA;IACF,UAAU,CAAC,EAAE,OAAO,CAAC;QACnB,OAAO,EAAE,SAAS,CAAC;YAAE,SAAS,EAAE,eAAe,CAAC;YAAC,eAAe,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;QAC5E,QAAQ,EAAE,SAAS,CAAC;YAAE,OAAO,CAAC,EAAE,OAAO,CAAC;YAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAA;SAAE,CAAC,CAAA;KACxE,CAAC,CAAA;CACH,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|