@scalar/api-client 2.15.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +150 -0
- package/dist/hooks/useResponseBody.js +6 -6
- package/dist/libs/errors.d.ts +1 -0
- package/dist/libs/errors.d.ts.map +1 -1
- package/dist/libs/errors.js +1 -0
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
- package/dist/libs/send-request/create-request-operation.js +41 -35
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +28 -38
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +84 -45
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -11
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +28 -35
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +10 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +22 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +31 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +31 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +3 -9
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +56 -0
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +10 -3
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-security.js +46 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +45 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/build-request.js +66 -0
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +9 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts +16 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +4 -0
- package/dist/v2/blocks/operation-block/helpers/get-delimiter.js +17 -0
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +9 -3
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +21 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +53 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.js +120 -0
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +89 -110
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +8 -13
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +22 -28
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +19 -8
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +30 -24
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +12 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +20 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts +10 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts.map +1 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +4 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +14 -12
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +191 -169
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +10 -10
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +2 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +15 -19
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +2 -2
- package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/types.d.ts +16 -0
- package/dist/v2/blocks/operation-code-sample/types.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +15 -10
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +158 -125
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +59 -50
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +148 -149
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +13 -3
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
- package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
- package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +0 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +97 -87
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +59 -56
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +26 -24
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +44 -43
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +7 -6
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/code-input/CodeInput.vue2.js +61 -59
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
- package/dist/v2/components/resize/index.d.ts +0 -1
- package/dist/v2/components/resize/index.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -5
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +49 -47
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.d.ts +3 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +128 -139
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue2.js +103 -80
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
- package/dist/v2/features/app/helpers/routes.d.ts +32 -6
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +25 -16
- package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
- package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
- package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
- package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
- package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
- package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
- package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
- package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
- package/dist/v2/{hooks/use-workspace-client-events.js → features/app/hooks/use-workspace-client-app-events.js} +48 -45
- package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
- package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
- package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
- package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
- package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
- package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
- package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
- package/dist/v2/features/collection/components/Environment.vue.js +32 -1
- package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
- package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
- package/dist/v2/features/collection/components/Servers.vue.js +142 -2
- package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
- package/dist/v2/features/collection/components/Settings.vue.js +58 -2
- package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
- package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +1 -1
- package/dist/v2/features/modal/Modal.vue2.js +118 -31
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
- package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
- package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
- package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +59 -28
- package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
- package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
- package/dist/v2/features/operation/index.d.ts +0 -1
- package/dist/v2/features/operation/index.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
- package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
- package/dist/v2/helpers/generate-location-id.d.ts +19 -0
- package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
- package/dist/v2/helpers/generate-location-id.js +10 -0
- package/dist/v2/helpers/get-active-environment.d.ts +5 -0
- package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
- package/dist/v2/helpers/get-active-environment.js +22 -0
- package/dist/v2/helpers/get-tab-details.d.ts +2 -2
- package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/v2/helpers/plugins.d.ts +59 -0
- package/dist/v2/helpers/plugins.d.ts.map +1 -0
- package/dist/v2/helpers/plugins.js +11 -0
- package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
- package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
- package/dist/v2/hooks/use-scroll-lock.js +21 -0
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +18 -18
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
- package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
- package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
- package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
- package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
- package/dist/v2/hooks/use-sync-path.js +0 -51
- package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
- package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
- package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
- package/dist/v2/plugins.d.ts +0 -44
- package/dist/v2/plugins.d.ts.map +0 -1
- /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
- /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
- /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { xScalarEnvironmentSchema as r } from "@scalar/workspace-store/schemas/extensions/document/x-scalar-environments";
|
|
2
|
+
import { coerceValue as a } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
3
|
+
const s = (e, o) => {
|
|
4
|
+
if (e === null)
|
|
5
|
+
return a(r, {});
|
|
6
|
+
const n = e.workspace["x-scalar-active-environment"];
|
|
7
|
+
if (!n)
|
|
8
|
+
return a(r, {});
|
|
9
|
+
const t = e.workspace["x-scalar-environments"]?.[n] ?? {
|
|
10
|
+
variables: []
|
|
11
|
+
}, i = o?.["x-scalar-environments"]?.[n] ?? {
|
|
12
|
+
variables: []
|
|
13
|
+
};
|
|
14
|
+
return a(r, {
|
|
15
|
+
...t,
|
|
16
|
+
...i,
|
|
17
|
+
variables: [...t.variables, ...i.variables]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
s as getActiveEnvironment
|
|
22
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace';
|
|
3
|
-
import type {
|
|
3
|
+
import type { UseAppSidebarReturn } from '../../v2/features/app/hooks/use-app-sidebar.js';
|
|
4
4
|
/**
|
|
5
5
|
* Returns display details for a tab in the API client UI.
|
|
6
6
|
* Determines the title and icon to use based on workspace, document, path, and method.
|
|
@@ -35,7 +35,7 @@ export declare const getTabDetails: ({ workspace, document, path, method, getEnt
|
|
|
35
35
|
document?: string;
|
|
36
36
|
path?: string;
|
|
37
37
|
method?: HttpMethod;
|
|
38
|
-
getEntryByLocation:
|
|
38
|
+
getEntryByLocation: UseAppSidebarReturn["getEntryByLocation"];
|
|
39
39
|
}) => {
|
|
40
40
|
title: string;
|
|
41
41
|
icon?: Tab["icon"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-tab-details.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-tab-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAE/E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"get-tab-details.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-tab-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,GAAI,4DAM3B;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,kBAAkB,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAA;CAC9D,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAoCtC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
|
|
2
2
|
const r = {
|
|
3
|
-
Enter: { event: "operation:send:request", modifiers: ["default"] },
|
|
3
|
+
Enter: { event: "operation:send:request:hotkey", modifiers: ["default"] },
|
|
4
4
|
b: { event: "ui:toggle:sidebar", modifiers: ["default"] },
|
|
5
5
|
p: { event: "ui:open:command-palette", modifiers: ["shiftKey"] },
|
|
6
6
|
l: { event: "ui:focus:address-bar", modifiers: ["default"] }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
/** A type representing the hooks that a client plugin can define */
|
|
4
|
+
export type ClientPluginHooks = {
|
|
5
|
+
beforeRequest: (payload: Request) => Request | Promise<Request>;
|
|
6
|
+
responseReceived: (payload: {
|
|
7
|
+
response: Response;
|
|
8
|
+
request: Request;
|
|
9
|
+
operation: OperationObject;
|
|
10
|
+
}) => void | Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
/** A type representing the components that a client plugin can define */
|
|
13
|
+
export type ClientPluginComponents = {
|
|
14
|
+
request: Component;
|
|
15
|
+
response: Component;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* ClientPlugin is used to extend the API Client with custom hooks and UI components.
|
|
19
|
+
*
|
|
20
|
+
* Example usage:
|
|
21
|
+
*
|
|
22
|
+
* const myPlugin: ClientPlugin = {
|
|
23
|
+
* hooks: {
|
|
24
|
+
* beforeRequest: (request) => {
|
|
25
|
+
* // Modify the request before it is sent
|
|
26
|
+
* request.headers.set('X-Custom-Header', 'foo');
|
|
27
|
+
* return request;
|
|
28
|
+
* },
|
|
29
|
+
* responseReceived: async (response, operation) => {
|
|
30
|
+
* // Handle post-response logic
|
|
31
|
+
* const data = await response.json();
|
|
32
|
+
* console.log('Received:', data, 'for operation:', operation.operationId);
|
|
33
|
+
* }
|
|
34
|
+
* },
|
|
35
|
+
* components: {
|
|
36
|
+
* request: MyRequestComponent, // Custom Vue component for rendering the request section
|
|
37
|
+
* response: MyResponseComponent // Custom Vue component for rendering the response section
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
*/
|
|
41
|
+
export type ClientPlugin = {
|
|
42
|
+
hooks?: Partial<ClientPluginHooks>;
|
|
43
|
+
components?: Partial<ClientPluginComponents>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Maps hook names to their expected payload types.
|
|
47
|
+
* This ensures type safety when executing hooks with their corresponding payloads.
|
|
48
|
+
* Derived from the ClientPlugin hooks definition.
|
|
49
|
+
*/
|
|
50
|
+
type HookPayloadMap = {
|
|
51
|
+
[K in keyof ClientPluginHooks]: Parameters<ClientPluginHooks[K]>[0];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Execute any hook with type-safe payload handling.
|
|
55
|
+
* The payload type is inferred from the hook name to ensure correct usage.
|
|
56
|
+
*/
|
|
57
|
+
export declare const executeHook: <K extends keyof HookPayloadMap>(payload: HookPayloadMap[K], hookName: K, plugins: ClientPlugin[]) => Promise<HookPayloadMap[K]>;
|
|
58
|
+
export {};
|
|
59
|
+
//# sour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CAAC,CAY3B,CAAA"}
|
|
@@ -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/
|
|
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/object-utils": "1.2.16",
|
|
332
|
-
"@scalar/oas-utils": "0.6.8",
|
|
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/
|
|
335
|
-
"@scalar/
|
|
336
|
-
"@scalar/sidebar": "0.
|
|
337
|
-
"@scalar/snippetz": "0.5.5",
|
|
338
|
-
"@scalar/types": "0.5.2",
|
|
339
|
-
"@scalar/use-codemirror": "0.13.2",
|
|
340
|
-
"@scalar/use-hooks": "0.3.3",
|
|
333
|
+
"@scalar/openapi-parser": "0.23.9",
|
|
334
|
+
"@scalar/object-utils": "1.2.18",
|
|
335
|
+
"@scalar/sidebar": "0.7.1",
|
|
341
336
|
"@scalar/themes": "0.13.26",
|
|
342
|
-
"@scalar/
|
|
343
|
-
"@scalar/use-
|
|
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
|
+
"@scalar/use-toasts": "0.9.1",
|
|
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",
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
"vite-svg-loader": "5.1.0",
|
|
357
357
|
"vitest": "3.2.4",
|
|
358
358
|
"@scalar/galaxy": "0.5.12",
|
|
359
|
-
"@scalar/build-tooling": "0.
|
|
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,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a,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":["../../../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"}
|
|
@@ -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":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAwC,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAmD7G,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,SAqWA,CAAA"}
|
|
@@ -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
|