@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
1
|
import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods';
|
|
2
|
-
import type
|
|
2
|
+
import { type AvailableClients } from '@scalar/types/snippetz';
|
|
3
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
4
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
5
|
import type { AuthMeta } from '@scalar/workspace-store/mutators';
|
|
5
6
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
7
|
+
import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
6
8
|
import type { OpenApiDocument, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
7
9
|
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
|
|
8
10
|
import type { ClientLayout } from '../../../hooks/index.js';
|
|
9
11
|
import { type History } from '../../../v2/blocks/scalar-address-bar-block/index.js';
|
|
10
|
-
import type
|
|
12
|
+
import { type ClientPlugin } from '../../../v2/helpers/plugins.js';
|
|
11
13
|
/**
|
|
12
14
|
* OperationBlock
|
|
13
15
|
*
|
|
@@ -22,38 +24,30 @@ import type { ClientPlugin } from '../../../v2/plugins';
|
|
|
22
24
|
* draft overrides for the UI when present.
|
|
23
25
|
*/
|
|
24
26
|
declare const _default: import("vue").DefineComponent<{
|
|
27
|
+
/** Event bus */
|
|
25
28
|
eventBus: WorkspaceEventBus;
|
|
26
29
|
/** Application version */
|
|
27
30
|
appVersion: string;
|
|
31
|
+
/** Workspace/document cookies */
|
|
32
|
+
globalCookies: XScalarCookie[];
|
|
28
33
|
/** Current request path */
|
|
29
34
|
path: string;
|
|
30
35
|
/** Current request method */
|
|
31
36
|
method: HttpMethodType;
|
|
37
|
+
/** HTTP clients */
|
|
38
|
+
httpClients: AvailableClients;
|
|
32
39
|
/** Client layout */
|
|
33
40
|
layout: ClientLayout;
|
|
34
41
|
/** Currently selected server */
|
|
35
42
|
server: ServerObject | null;
|
|
43
|
+
/** Currently selected client */
|
|
44
|
+
selectedClient: WorkspaceStore["workspace"]["x-scalar-default-client"];
|
|
36
45
|
/** Server list available for operation/document */
|
|
37
46
|
servers: ServerObject[];
|
|
38
47
|
/** List of request history */
|
|
39
48
|
history: History[];
|
|
40
|
-
/**
|
|
41
|
-
* When the request is sent from the modal, this indicates the progress percentage
|
|
42
|
-
* of the request being sent.
|
|
43
|
-
*
|
|
44
|
-
* The amount remaining to load from 100 -> 0
|
|
45
|
-
*/
|
|
46
|
-
requestLoadingPercentage?: number;
|
|
47
|
-
/** Preprocessed response */
|
|
48
|
-
response?: ResponseInstance;
|
|
49
|
-
/** Original request instance */
|
|
50
|
-
request?: Request;
|
|
51
49
|
/** Total number of performed requests */
|
|
52
50
|
totalPerformedRequests: number;
|
|
53
|
-
/** Sidebar open state */
|
|
54
|
-
isSidebarOpen?: boolean;
|
|
55
|
-
/** Controls sidebar visibility */
|
|
56
|
-
showSidebar?: boolean;
|
|
57
51
|
/** Hides the client button on the header */
|
|
58
52
|
hideClientButton?: boolean;
|
|
59
53
|
/** Client integration */
|
|
@@ -67,52 +61,46 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
67
61
|
/** Currently selected example key for the current operation */
|
|
68
62
|
exampleKey: string;
|
|
69
63
|
/** Meta information for the auth update */
|
|
70
|
-
authMeta
|
|
64
|
+
authMeta: AuthMeta;
|
|
71
65
|
/** Document defined security schemes */
|
|
72
66
|
securitySchemes: NonNullable<OpenApiDocument["components"]>["securitySchemes"];
|
|
73
67
|
/** Currently selected security for the current operation */
|
|
74
68
|
selectedSecurity: OpenApiDocument["x-scalar-selected-security"];
|
|
75
69
|
/** Required security for the operation/document */
|
|
76
|
-
|
|
70
|
+
securityRequirements: OpenApiDocument["security"];
|
|
77
71
|
/** Client plugins */
|
|
78
|
-
plugins
|
|
72
|
+
plugins: ClientPlugin[];
|
|
79
73
|
/** For environment variables in the inputs */
|
|
80
74
|
environment: XScalarEnvironment;
|
|
75
|
+
/** The proxy URL for sending requests */
|
|
76
|
+
proxyUrl: string;
|
|
81
77
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
82
78
|
"update:servers": () => any;
|
|
83
79
|
}, string, import("vue").PublicProps, Readonly<{
|
|
80
|
+
/** Event bus */
|
|
84
81
|
eventBus: WorkspaceEventBus;
|
|
85
82
|
/** Application version */
|
|
86
83
|
appVersion: string;
|
|
84
|
+
/** Workspace/document cookies */
|
|
85
|
+
globalCookies: XScalarCookie[];
|
|
87
86
|
/** Current request path */
|
|
88
87
|
path: string;
|
|
89
88
|
/** Current request method */
|
|
90
89
|
method: HttpMethodType;
|
|
90
|
+
/** HTTP clients */
|
|
91
|
+
httpClients: AvailableClients;
|
|
91
92
|
/** Client layout */
|
|
92
93
|
layout: ClientLayout;
|
|
93
94
|
/** Currently selected server */
|
|
94
95
|
server: ServerObject | null;
|
|
96
|
+
/** Currently selected client */
|
|
97
|
+
selectedClient: WorkspaceStore["workspace"]["x-scalar-default-client"];
|
|
95
98
|
/** Server list available for operation/document */
|
|
96
99
|
servers: ServerObject[];
|
|
97
100
|
/** List of request history */
|
|
98
101
|
history: History[];
|
|
99
|
-
/**
|
|
100
|
-
* When the request is sent from the modal, this indicates the progress percentage
|
|
101
|
-
* of the request being sent.
|
|
102
|
-
*
|
|
103
|
-
* The amount remaining to load from 100 -> 0
|
|
104
|
-
*/
|
|
105
|
-
requestLoadingPercentage?: number;
|
|
106
|
-
/** Preprocessed response */
|
|
107
|
-
response?: ResponseInstance;
|
|
108
|
-
/** Original request instance */
|
|
109
|
-
request?: Request;
|
|
110
102
|
/** Total number of performed requests */
|
|
111
103
|
totalPerformedRequests: number;
|
|
112
|
-
/** Sidebar open state */
|
|
113
|
-
isSidebarOpen?: boolean;
|
|
114
|
-
/** Controls sidebar visibility */
|
|
115
|
-
showSidebar?: boolean;
|
|
116
104
|
/** Hides the client button on the header */
|
|
117
105
|
hideClientButton?: boolean;
|
|
118
106
|
/** Client integration */
|
|
@@ -126,17 +114,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
126
114
|
/** Currently selected example key for the current operation */
|
|
127
115
|
exampleKey: string;
|
|
128
116
|
/** Meta information for the auth update */
|
|
129
|
-
authMeta
|
|
117
|
+
authMeta: AuthMeta;
|
|
130
118
|
/** Document defined security schemes */
|
|
131
119
|
securitySchemes: NonNullable<OpenApiDocument["components"]>["securitySchemes"];
|
|
132
120
|
/** Currently selected security for the current operation */
|
|
133
121
|
selectedSecurity: OpenApiDocument["x-scalar-selected-security"];
|
|
134
122
|
/** Required security for the operation/document */
|
|
135
|
-
|
|
123
|
+
securityRequirements: OpenApiDocument["security"];
|
|
136
124
|
/** Client plugins */
|
|
137
|
-
plugins
|
|
125
|
+
plugins: ClientPlugin[];
|
|
138
126
|
/** For environment variables in the inputs */
|
|
139
127
|
environment: XScalarEnvironment;
|
|
128
|
+
/** The proxy URL for sending requests */
|
|
129
|
+
proxyUrl: string;
|
|
140
130
|
}> & Readonly<{
|
|
141
131
|
"onUpdate:servers"?: (() => any) | undefined;
|
|
142
132
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"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"}
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
1
|
+
import { defineComponent as B, computed as q, ref as i, onMounted as g, onBeforeUnmount as R, watch as C, createElementBlock as S, openBlock as U, createElementVNode as k, createVNode as o, withCtx as h, unref as a } from "vue";
|
|
2
|
+
import { AVAILABLE_CLIENTS as E } from "@scalar/types/snippetz";
|
|
3
|
+
import { useToasts as b } from "@scalar/use-toasts";
|
|
4
|
+
import V from "../../../components/ViewLayout/ViewLayout.vue.js";
|
|
5
|
+
import K from "../../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
6
|
+
import { ERRORS as O } from "../../../libs/errors.js";
|
|
7
|
+
import { createStoreEvents as w } from "../../../store/events.js";
|
|
8
|
+
import { buildRequest as P } from "./helpers/build-request.js";
|
|
9
|
+
import { sendRequest as M } from "./helpers/send-request.js";
|
|
10
|
+
import A from "./components/Header.vue.js";
|
|
11
|
+
import { generateClientOptions as L } from "../operation-code-sample/helpers/generate-client-options.js";
|
|
12
|
+
import T from "../request-block/RequestBlock.vue.js";
|
|
13
|
+
import N from "../response-block/ResponseBlock.vue.js";
|
|
14
|
+
const I = { class: "bg-b-1 flex h-full flex-col" }, $ = { class: "lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0" }, j = {
|
|
9
15
|
name: "OperationBlock"
|
|
10
|
-
},
|
|
11
|
-
...
|
|
16
|
+
}, ee = /* @__PURE__ */ B({
|
|
17
|
+
...j,
|
|
12
18
|
props: {
|
|
13
19
|
eventBus: {},
|
|
14
20
|
appVersion: {},
|
|
21
|
+
globalCookies: { default: () => [] },
|
|
15
22
|
path: {},
|
|
16
23
|
method: {},
|
|
24
|
+
httpClients: { default: () => E },
|
|
17
25
|
layout: {},
|
|
18
26
|
server: {},
|
|
27
|
+
selectedClient: {},
|
|
19
28
|
servers: {},
|
|
20
29
|
history: {},
|
|
21
|
-
requestLoadingPercentage: {},
|
|
22
|
-
response: {},
|
|
23
|
-
request: {},
|
|
24
30
|
totalPerformedRequests: {},
|
|
25
|
-
isSidebarOpen: { type: Boolean },
|
|
26
|
-
showSidebar: { type: Boolean },
|
|
27
31
|
hideClientButton: { type: Boolean },
|
|
28
32
|
integration: {},
|
|
29
33
|
documentUrl: {},
|
|
@@ -33,66 +37,75 @@ const q = { class: "bg-b-1 flex h-full flex-col" }, b = { class: "lg:min-h-heade
|
|
|
33
37
|
authMeta: {},
|
|
34
38
|
securitySchemes: {},
|
|
35
39
|
selectedSecurity: {},
|
|
36
|
-
|
|
37
|
-
plugins: {},
|
|
38
|
-
environment: {}
|
|
40
|
+
securityRequirements: {},
|
|
41
|
+
plugins: { default: () => [] },
|
|
42
|
+
environment: {},
|
|
43
|
+
proxyUrl: {}
|
|
39
44
|
},
|
|
40
45
|
emits: ["update:servers"],
|
|
41
|
-
setup(t, { emit:
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
setup(t, { emit: y }) {
|
|
47
|
+
const p = y, f = q(() => L(t.httpClients)), { toast: m } = b(), d = i(null), s = i(null), l = i(null), c = () => d.value?.abort(O.REQUEST_ABORTED), r = async () => {
|
|
48
|
+
const [e, n] = P({
|
|
49
|
+
environment: t.environment,
|
|
50
|
+
exampleKey: t.exampleKey,
|
|
51
|
+
globalCookies: t.globalCookies,
|
|
46
52
|
method: t.method,
|
|
53
|
+
operation: t.operation,
|
|
47
54
|
path: t.path,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
securitySchemes: t.securitySchemes,
|
|
56
|
+
selectedSecurity: t.selectedSecurity?.selectedSchemes ?? [],
|
|
57
|
+
server: t.server,
|
|
58
|
+
proxyUrl: t.proxyUrl
|
|
59
|
+
});
|
|
60
|
+
if (e) {
|
|
61
|
+
m(e.message, "error");
|
|
62
|
+
return;
|
|
52
63
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
d.value = n.controller, t.eventBus.emit("hooks:on:request:sent");
|
|
65
|
+
const [u, v] = await M({
|
|
66
|
+
isUsingProxy: n.isUsingProxy,
|
|
67
|
+
operation: t.operation,
|
|
68
|
+
plugins: t.plugins,
|
|
69
|
+
request: n.request
|
|
70
|
+
});
|
|
71
|
+
if (t.eventBus.emit("hooks:on:request:complete"), u) {
|
|
72
|
+
m(u.message, "error");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
s.value = v.response, l.value = v.request;
|
|
76
|
+
};
|
|
77
|
+
return g(() => {
|
|
78
|
+
t.eventBus.on("operation:send:request:hotkey", r), t.eventBus.on("operation:cancel:request", c);
|
|
79
|
+
}), R(() => {
|
|
80
|
+
t.eventBus.off("operation:send:request:hotkey", r), t.eventBus.off("operation:cancel:request", c);
|
|
81
|
+
}), C([() => t.path, () => t.method, () => t.exampleKey], () => {
|
|
82
|
+
s.value = null, l.value = null;
|
|
83
|
+
}), (e, n) => (U(), S("div", I, [
|
|
84
|
+
k("div", $, [
|
|
85
|
+
o(A, {
|
|
69
86
|
documentUrl: e.documentUrl,
|
|
70
87
|
environment: e.environment,
|
|
71
88
|
eventBus: e.eventBus,
|
|
72
89
|
hideClientButton: e.hideClientButton,
|
|
73
90
|
history: e.history,
|
|
74
91
|
integration: e.integration,
|
|
75
|
-
isSidebarOpen: e.isSidebarOpen,
|
|
76
92
|
layout: e.layout,
|
|
77
93
|
method: e.method,
|
|
78
94
|
path: e.path,
|
|
79
|
-
percentage: e.requestLoadingPercentage,
|
|
80
95
|
server: e.server,
|
|
81
96
|
servers: e.servers,
|
|
82
|
-
showSidebar: e.showSidebar,
|
|
83
97
|
source: e.source,
|
|
84
|
-
onExecute:
|
|
85
|
-
"onUpdate:
|
|
86
|
-
|
|
87
|
-
"onUpdate:servers": r[0] || (r[0] = (U) => u("update:servers"))
|
|
88
|
-
}, null, 8, ["documentUrl", "environment", "eventBus", "hideClientButton", "history", "integration", "isSidebarOpen", "layout", "method", "path", "percentage", "server", "servers", "showSidebar", "source"])
|
|
98
|
+
onExecute: r,
|
|
99
|
+
"onUpdate:servers": n[0] || (n[0] = (u) => p("update:servers"))
|
|
100
|
+
}, null, 8, ["documentUrl", "environment", "eventBus", "hideClientButton", "history", "integration", "layout", "method", "path", "server", "servers", "source"])
|
|
89
101
|
]),
|
|
90
|
-
o(
|
|
91
|
-
default:
|
|
92
|
-
o(
|
|
93
|
-
default:
|
|
94
|
-
o(
|
|
102
|
+
o(V, { class: "border-t" }, {
|
|
103
|
+
default: h(() => [
|
|
104
|
+
o(K, { class: "flex-1" }, {
|
|
105
|
+
default: h(() => [
|
|
106
|
+
o(a(T), {
|
|
95
107
|
authMeta: e.authMeta,
|
|
108
|
+
clientOptions: f.value,
|
|
96
109
|
environment: e.environment,
|
|
97
110
|
eventBus: e.eventBus,
|
|
98
111
|
exampleKey: e.exampleKey,
|
|
@@ -101,20 +114,23 @@ const q = { class: "bg-b-1 flex h-full flex-col" }, b = { class: "lg:min-h-heade
|
|
|
101
114
|
operation: e.operation,
|
|
102
115
|
path: e.path,
|
|
103
116
|
plugins: e.plugins,
|
|
104
|
-
|
|
117
|
+
proxyUrl: e.proxyUrl,
|
|
118
|
+
securityRequirements: e.securityRequirements,
|
|
105
119
|
securitySchemes: e.securitySchemes,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
120
|
+
selectedClient: e.selectedClient,
|
|
121
|
+
selectedSecurity: e.selectedSecurity,
|
|
122
|
+
server: e.server
|
|
123
|
+
}, null, 8, ["authMeta", "clientOptions", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "server"]),
|
|
124
|
+
o(a(N), {
|
|
109
125
|
appVersion: e.appVersion,
|
|
110
126
|
eventBus: e.eventBus,
|
|
111
|
-
events:
|
|
127
|
+
events: a(w)(),
|
|
112
128
|
layout: e.layout,
|
|
113
129
|
plugins: e.plugins,
|
|
114
|
-
request:
|
|
115
|
-
response:
|
|
130
|
+
request: l.value,
|
|
131
|
+
response: s.value,
|
|
116
132
|
totalPerformedRequests: e.totalPerformedRequests,
|
|
117
|
-
onSendRequest:
|
|
133
|
+
onSendRequest: r
|
|
118
134
|
}, null, 8, ["appVersion", "eventBus", "events", "layout", "plugins", "request", "response", "totalPerformedRequests"])
|
|
119
135
|
]),
|
|
120
136
|
_: 1
|
|
@@ -126,5 +142,5 @@ const q = { class: "bg-b-1 flex h-full flex-col" }, b = { class: "lg:min-h-heade
|
|
|
126
142
|
}
|
|
127
143
|
});
|
|
128
144
|
export {
|
|
129
|
-
|
|
145
|
+
ee as default
|
|
130
146
|
};
|
|
@@ -11,10 +11,6 @@ type __VLS_Props = {
|
|
|
11
11
|
method: HttpMethod;
|
|
12
12
|
/** Client layout */
|
|
13
13
|
layout: ClientLayout;
|
|
14
|
-
/** Sidebar open state */
|
|
15
|
-
isSidebarOpen?: boolean;
|
|
16
|
-
/** Controls sidebar visibility */
|
|
17
|
-
showSidebar?: boolean;
|
|
18
14
|
/** Hides the client button on the header */
|
|
19
15
|
hideClientButton?: boolean;
|
|
20
16
|
/** Client integration */
|
|
@@ -29,35 +25,17 @@ type __VLS_Props = {
|
|
|
29
25
|
servers: ServerObject[];
|
|
30
26
|
/** List of request history */
|
|
31
27
|
history: History[];
|
|
32
|
-
/**
|
|
33
|
-
* When the request is sent from the modal, this indicates the progress percentage
|
|
34
|
-
* of the request being sent.
|
|
35
|
-
*
|
|
36
|
-
* The amount remaining to load from 100 -> 0
|
|
37
|
-
*/
|
|
38
|
-
requestLoadingPercentage?: number;
|
|
39
28
|
/** Event bus */
|
|
40
29
|
eventBus: WorkspaceEventBus;
|
|
30
|
+
/** Environment variables */
|
|
41
31
|
environment: XScalarEnvironment;
|
|
42
32
|
};
|
|
43
33
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
44
34
|
execute: () => any;
|
|
45
35
|
"update:servers": () => any;
|
|
46
|
-
"update:path": (payload: {
|
|
47
|
-
value: string;
|
|
48
|
-
}) => any;
|
|
49
|
-
"update:method": (payload: {
|
|
50
|
-
value: HttpMethod;
|
|
51
|
-
}) => any;
|
|
52
36
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
53
37
|
onExecute?: (() => any) | undefined;
|
|
54
38
|
"onUpdate:servers"?: (() => any) | undefined;
|
|
55
|
-
"onUpdate:path"?: ((payload: {
|
|
56
|
-
value: string;
|
|
57
|
-
}) => any) | undefined;
|
|
58
|
-
"onUpdate:method"?: ((payload: {
|
|
59
|
-
value: HttpMethod;
|
|
60
|
-
}) => any) | undefined;
|
|
61
39
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
62
40
|
export default _default;
|
|
63
41
|
//# sourceMappingURL=Header.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"names":[],"mappings":"AAmIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAE/E,KAAK,WAAW,GAAG;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,CAAA;IACpC,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,4BAA4B;IAC5B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;AAyNF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Header.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d73c7e3d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
d as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
1
|
+
import { defineComponent as d, createElementBlock as l, openBlock as n, createElementVNode as o, createVNode as i, unref as r, createBlock as v, createCommentVNode as u } from "vue";
|
|
2
|
+
import { ScalarIcon as a } from "@scalar/components";
|
|
3
3
|
import f from "../../scalar-address-bar-block/components/AddressBar.vue.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import g from "../../../../components/OpenApiClientButton.vue.js";
|
|
5
|
+
const y = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" }, b = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-1 lg:mb-0 lg:flex-1 lg:px-2.5" }, w = /* @__PURE__ */ d({
|
|
6
6
|
__name: "Header",
|
|
7
7
|
props: {
|
|
8
8
|
path: {},
|
|
9
9
|
method: {},
|
|
10
10
|
layout: {},
|
|
11
|
-
isSidebarOpen: { type: Boolean },
|
|
12
|
-
showSidebar: { type: Boolean, default: !0 },
|
|
13
11
|
hideClientButton: { type: Boolean, default: !1 },
|
|
14
12
|
integration: {},
|
|
15
13
|
documentUrl: {},
|
|
@@ -17,74 +15,67 @@ const b = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
|
|
|
17
15
|
server: {},
|
|
18
16
|
servers: {},
|
|
19
17
|
history: {},
|
|
20
|
-
requestLoadingPercentage: {},
|
|
21
18
|
eventBus: {},
|
|
22
19
|
environment: {}
|
|
23
20
|
},
|
|
24
|
-
emits: ["execute", "update:
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
return (e, t) => (n(),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, null, 2)) : i("", !0)
|
|
33
|
-
]),
|
|
34
|
-
u(a(f), {
|
|
21
|
+
emits: ["execute", "update:servers"],
|
|
22
|
+
setup(B, { emit: p }) {
|
|
23
|
+
const m = p;
|
|
24
|
+
return (e, t) => (n(), l("div", y, [
|
|
25
|
+
t[6] || (t[6] = o("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [
|
|
26
|
+
o("div", { class: "size-8" })
|
|
27
|
+
], -1)),
|
|
28
|
+
i(r(f), {
|
|
35
29
|
environment: e.environment,
|
|
36
30
|
eventBus: e.eventBus,
|
|
37
31
|
history: e.history,
|
|
38
32
|
layout: e.layout,
|
|
39
33
|
method: e.method,
|
|
40
34
|
path: e.path,
|
|
41
|
-
percentage: e.requestLoadingPercentage,
|
|
42
35
|
server: e.server,
|
|
43
36
|
servers: e.servers,
|
|
44
|
-
onExecute: t[0] || (t[0] = (
|
|
45
|
-
"onUpdate:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
l("div", B, [
|
|
50
|
-
e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (n(), g(a(y), {
|
|
37
|
+
onExecute: t[0] || (t[0] = (s) => m("execute")),
|
|
38
|
+
"onUpdate:servers": t[1] || (t[1] = (s) => m("update:servers"))
|
|
39
|
+
}, null, 8, ["environment", "eventBus", "history", "layout", "method", "path", "server", "servers"]),
|
|
40
|
+
o("div", b, [
|
|
41
|
+
e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (n(), v(r(g), {
|
|
51
42
|
key: 0,
|
|
52
43
|
buttonSource: "modal",
|
|
53
44
|
class: "!w-fit lg:-mr-1",
|
|
54
45
|
integration: e.integration ?? null,
|
|
55
46
|
source: e.source ?? "api-reference",
|
|
56
47
|
url: e.documentUrl
|
|
57
|
-
}, null, 8, ["integration", "source", "url"])) :
|
|
58
|
-
e.layout === "modal" && e.source !== "gitbook" ? (n(),
|
|
48
|
+
}, null, 8, ["integration", "source", "url"])) : u("", !0),
|
|
49
|
+
e.layout === "modal" && e.source !== "gitbook" ? (n(), l("button", {
|
|
59
50
|
key: 1,
|
|
60
51
|
class: "app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2",
|
|
61
52
|
type: "button",
|
|
62
|
-
onClick: t[
|
|
53
|
+
onClick: t[2] || (t[2] = (s) => e.eventBus.emit("ui:close:client-modal"))
|
|
63
54
|
}, [
|
|
64
|
-
|
|
55
|
+
i(r(a), {
|
|
65
56
|
icon: "Close",
|
|
66
57
|
size: "lg",
|
|
67
58
|
thickness: "2"
|
|
68
59
|
}),
|
|
69
|
-
t[
|
|
70
|
-
])) :
|
|
71
|
-
e.layout === "modal" && e.source === "gitbook" ? (n(),
|
|
60
|
+
t[4] || (t[4] = o("span", { class: "sr-only" }, "Close Client", -1))
|
|
61
|
+
])) : u("", !0),
|
|
62
|
+
e.layout === "modal" && e.source === "gitbook" ? (n(), l("button", {
|
|
72
63
|
key: 2,
|
|
73
64
|
class: "text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2",
|
|
74
65
|
type: "button",
|
|
75
|
-
onClick: t[
|
|
66
|
+
onClick: t[3] || (t[3] = (s) => e.eventBus.emit("ui:close:client-modal"))
|
|
76
67
|
}, [
|
|
77
|
-
|
|
68
|
+
i(r(a), {
|
|
78
69
|
icon: "Close",
|
|
79
70
|
size: "md",
|
|
80
71
|
thickness: "1.75"
|
|
81
72
|
}),
|
|
82
|
-
t[
|
|
83
|
-
])) :
|
|
73
|
+
t[5] || (t[5] = o("span", { class: "sr-only" }, "Close Client", -1))
|
|
74
|
+
])) : u("", !0)
|
|
84
75
|
])
|
|
85
76
|
]));
|
|
86
77
|
}
|
|
87
78
|
});
|
|
88
79
|
export {
|
|
89
|
-
|
|
80
|
+
w as default
|
|
90
81
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/request-body';
|
|
2
|
+
/**
|
|
3
|
+
* Create the fetch request body
|
|
4
|
+
*/
|
|
5
|
+
export declare const buildRequestBody: (requestBody: RequestBodyObject | undefined,
|
|
6
|
+
/** Environment variables flattened into a key-value object */
|
|
7
|
+
env?: Record<string, string>,
|
|
8
|
+
/** The key of the current example */
|
|
9
|
+
exampleKey?: string) => BodyInit | null;
|
|
10
|
+
//# sourceMappingURL=build-request-body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-request-body.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-body.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAIjG;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,iBAAiB,GAAG,SAAS;AAC1C,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qCAAqC;AACrC,mBAAsB,KACrB,QAAQ,GAAG,IAmDb,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { replaceEnvVariables as i } from "@scalar/helpers/regex/replace-variables";
|
|
2
|
+
import { getExampleFromBody as c } from "../../request-block/helpers/get-request-body-example.js";
|
|
3
|
+
const u = (r, e = {}, l = "default") => {
|
|
4
|
+
if (!r)
|
|
5
|
+
return null;
|
|
6
|
+
const a = r?.["x-scalar-selected-content-type"]?.[l] ?? Object.keys(r?.content ?? {})[0] ?? "application/json", t = c(r, a, l);
|
|
7
|
+
if (!t)
|
|
8
|
+
return null;
|
|
9
|
+
if ((a === "multipart/form-data" || a === "application/x-www-form-urlencoded") && Array.isArray(t.value)) {
|
|
10
|
+
const n = a === "multipart/form-data" ? new FormData() : new URLSearchParams();
|
|
11
|
+
return t.value.forEach(({ name: f, value: o }) => {
|
|
12
|
+
if (!f)
|
|
13
|
+
return;
|
|
14
|
+
const p = i(f, e);
|
|
15
|
+
o instanceof File && n instanceof FormData ? n.append(p, o) : typeof o == "string" && n.append(p, i(o, e));
|
|
16
|
+
}), n;
|
|
17
|
+
}
|
|
18
|
+
return typeof t.value == "object" ? i(JSON.stringify(t.value), e) : typeof t.value == "string" ? i(t.value, e) : t.value;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
u as buildRequestBody
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
2
|
+
/**
|
|
3
|
+
* Generate a cookie header from the cookie params
|
|
4
|
+
*/
|
|
5
|
+
export declare const getCookieHeader: (cookieParams: XScalarCookie[], originalCookieHeader: string | undefined) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Build out the cookies header taking in global, param and security scheme cookies
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildRequestCookieHeader: ({ paramCookies, globalCookies, env, path, originalCookieHeader, url, useCustomCookieHeader, }: {
|
|
10
|
+
/** Parsed/replaced cookies from the parameters and security schemes */
|
|
11
|
+
paramCookies: XScalarCookie[];
|
|
12
|
+
/** Raw global cookies from the workspace/document */
|
|
13
|
+
globalCookies: XScalarCookie[];
|
|
14
|
+
/** Environment variables flattened into a key-value object */
|
|
15
|
+
env: Record<string, string>;
|
|
16
|
+
/** The path of the request used to filter global cookies by path */
|
|
17
|
+
path: string;
|
|
18
|
+
/** Cookie header that previously exists from the spec OR from the user */
|
|
19
|
+
originalCookieHeader: string | undefined;
|
|
20
|
+
/** The url of the request used to filter global cookies by domain */
|
|
21
|
+
url: string;
|
|
22
|
+
/**
|
|
23
|
+
* If we are running in Electron or using the proxy, we need to add a custom header
|
|
24
|
+
* that's then forwarded as a `Cookie` header.
|
|
25
|
+
*/
|
|
26
|
+
useCustomCookieHeader: boolean;
|
|
27
|
+
}) => null | {
|
|
28
|
+
name: string;
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=build-request-cookie-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-request-cookie-header.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-cookie-header.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,qEAAqE,CAAA;AAa5E;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,aAAa,EAAE,EAAE,sBAAsB,MAAM,GAAG,SAAS,KAAG,MAWzG,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,+FAQtC;IACD,uEAAuE;IACvE,YAAY,EAAE,aAAa,EAAE,CAAA;IAC7B,qDAAqD;IACrD,aAAa,EAAE,aAAa,EAAE,CAAA;IAC9B,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAA;CAC/B,KAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAoCvC,CAAA"}
|