@scalar/api-client 2.38.3 → 2.38.4
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 +6 -0
- package/dist/{AddressBar-CX8xiYoe.js → AddressBar-BOZGKSoz.js} +4 -4
- package/dist/{AddressBar-CX8xiYoe.js.map → AddressBar-BOZGKSoz.js.map} +1 -1
- package/dist/{App-BpNPKHmM.js → App-DHBmpWJI.js} +4 -4
- package/dist/{App-BpNPKHmM.js.map → App-DHBmpWJI.js.map} +1 -1
- package/dist/{CodeInput-BN7uw3Bh.js → CodeInput-BTN8cC5h.js} +2 -2
- package/dist/{CodeInput-BN7uw3Bh.js.map → CodeInput-BTN8cC5h.js.map} +1 -1
- package/dist/{Collection-ChAxs3rz.js → Collection-BsAG7ms5.js} +2 -2
- package/dist/{Collection-ChAxs3rz.js.map → Collection-BsAG7ms5.js.map} +1 -1
- package/dist/{CollectionAuthentication-BDpvv8cA.js → CollectionAuthentication-BMGhRnpo.js} +5 -5
- package/dist/{CollectionAuthentication-BDpvv8cA.js.map → CollectionAuthentication-BMGhRnpo.js.map} +1 -1
- package/dist/{CollectionEnvironment-dwisJ-h5.js → CollectionEnvironment-BY9Gcnln.js} +4 -4
- package/dist/{CollectionEnvironment-dwisJ-h5.js.map → CollectionEnvironment-BY9Gcnln.js.map} +1 -1
- package/dist/{CollectionOverview-CJ9-Vmei.js → CollectionOverview-C3GvN8GY.js} +3 -3
- package/dist/{CollectionOverview-CJ9-Vmei.js.map → CollectionOverview-C3GvN8GY.js.map} +1 -1
- package/dist/{CollectionServers-BWkIGwz4.js → CollectionServers-DuOLysNB.js} +5 -5
- package/dist/{CollectionServers-BWkIGwz4.js.map → CollectionServers-DuOLysNB.js.map} +1 -1
- package/dist/{CollectionSettings-CqUUYOym.js → CollectionSettings-FtXNetOh.js} +2 -2
- package/dist/{CollectionSettings-CqUUYOym.js.map → CollectionSettings-FtXNetOh.js.map} +1 -1
- package/dist/{CommandPalette-BiA0IgO8.js → CommandPalette-BxoEK8TY.js} +2 -2
- package/dist/{CommandPalette-BiA0IgO8.js.map → CommandPalette-BxoEK8TY.js.map} +1 -1
- package/dist/{Cookies-CNRSxP8J.js → Cookies-BYTv1YIA.js} +8 -8
- package/dist/{Cookies-CNRSxP8J.js.map → Cookies-BYTv1YIA.js.map} +1 -1
- package/dist/{DataTableInput-SkIUPlrB.js → DataTableInput-RydMDjn2.js} +2 -2
- package/dist/{DataTableInput-SkIUPlrB.js.map → DataTableInput-RydMDjn2.js.map} +1 -1
- package/dist/{Environment-D_CbZk0A.js → Environment-BIxG7DaO.js} +5 -5
- package/dist/{Environment-D_CbZk0A.js.map → Environment-BIxG7DaO.js.map} +1 -1
- package/dist/{EnvironmentModal-CcyqnPc2.js → EnvironmentModal-C0lYytkh.js} +2 -2
- package/dist/{EnvironmentModal-CcyqnPc2.js.map → EnvironmentModal-C0lYytkh.js.map} +1 -1
- package/dist/{Form-bA4bV_oA.js → Form-KFcdRQp1.js} +3 -3
- package/dist/{Form-bA4bV_oA.js.map → Form-KFcdRQp1.js.map} +1 -1
- package/dist/{ImportCollection-BIYMxB9Q.js → ImportCollection-CGjySEzP.js} +2 -2
- package/dist/{ImportCollection-BIYMxB9Q.js.map → ImportCollection-CGjySEzP.js.map} +1 -1
- package/dist/{MainLayout-oMIJ5QXF.js → MainLayout-BnLwst16.js} +3 -3
- package/dist/{MainLayout-oMIJ5QXF.js.map → MainLayout-BnLwst16.js.map} +1 -1
- package/dist/{Modal-DkOa_KK0.js → Modal-CTZ8UNds.js} +2 -2
- package/dist/{Modal-DkOa_KK0.js.map → Modal-CTZ8UNds.js.map} +1 -1
- package/dist/{Request-BWfYWyBa.js → Request-d0RY0ZhC.js} +10 -10
- package/dist/{Request-BWfYWyBa.js.map → Request-d0RY0ZhC.js.map} +1 -1
- package/dist/{RequestAuth-BU6ubH-c.js → RequestAuth-1cRH3DDn.js} +3 -3
- package/dist/{RequestAuth-BU6ubH-c.js.map → RequestAuth-1cRH3DDn.js.map} +1 -1
- package/dist/{RequestRoot-7xhK5_qr.js → RequestRoot-pW0yXesG.js} +7 -7
- package/dist/{RequestRoot-7xhK5_qr.js.map → RequestRoot-pW0yXesG.js.map} +1 -1
- package/dist/{RequestSection-Bx8UHW-k.js → RequestSection-D2BLvDTr.js} +4 -4
- package/dist/{RequestSection-Bx8UHW-k.js.map → RequestSection-D2BLvDTr.js.map} +1 -1
- package/dist/{ResponseSection-CLrgLMN_.js → ResponseSection-B_YF7l_E.js} +3 -3
- package/dist/{ResponseSection-CLrgLMN_.js.map → ResponseSection-B_YF7l_E.js.map} +1 -1
- package/dist/{Server-BS4zjUdO.js → Server-CEKGIEfE.js} +2 -2
- package/dist/{Server-BS4zjUdO.js.map → Server-CEKGIEfE.js.map} +1 -1
- package/dist/{Settings-BuLKHzRY.js → Settings-BaPvhJ8Y.js} +2 -2
- package/dist/{Settings-BuLKHzRY.js.map → Settings-BaPvhJ8Y.js.map} +1 -1
- package/dist/{Sidebar-Xl9_nFXX.js → Sidebar-CRxdl38Y.js} +2 -2
- package/dist/{Sidebar-Xl9_nFXX.js.map → Sidebar-CRxdl38Y.js.map} +1 -1
- package/dist/components/AddressBar/AddressBar.vue.d.ts +1 -1
- package/dist/components/AddressBar/index.js +3 -3
- package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
- package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -1
- package/dist/components/CodeInput/index.js +1 -1
- package/dist/components/CommandPalette/index.js +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -2
- package/dist/components/DataTable/index.js +2 -2
- package/dist/components/Form/LabelInput.vue.d.ts +1 -1
- package/dist/components/ImportCollection/index.js +1 -1
- package/dist/components/ImportCollection/utils/import-collection.d.ts +1 -1
- package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts +1 -1
- package/dist/components/Server/ServerVariablesForm.vue.d.ts +1 -1
- package/dist/components/Server/index.js +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +4 -4
- package/dist/{components-DfJHvSLM.js → components-B0BwUDFw.js} +2 -2
- package/dist/{components-DfJHvSLM.js.map → components-B0BwUDFw.js.map} +1 -1
- package/dist/hooks/useSidebar.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/layouts/App/create-api-client-app.d.ts +9 -9
- package/dist/layouts/App/index.js +3 -3
- package/dist/layouts/Modal/create-api-client-modal.d.ts +1 -1
- package/dist/layouts/Modal/index.d.ts +1 -1
- package/dist/layouts/Modal/index.js +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +9 -9
- package/dist/layouts/Web/index.js +4 -4
- package/dist/libs/create-client.d.ts +3 -3
- package/dist/libs/environment-parser.d.ts +1 -1
- package/dist/libs/get-request-uid-by-path-method.d.ts +1 -1
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/index.d.ts +1 -1
- package/dist/libs/index.js +1 -1
- package/dist/libs/local-storage.d.ts +1 -1
- package/dist/libs/send-request/create-request-operation.d.ts +3 -3
- package/dist/{operation-block-DE-hoO03.js → operation-block-B1B3lJPx.js} +3 -3
- package/dist/{operation-block-DE-hoO03.js.map → operation-block-B1B3lJPx.js.map} +1 -1
- package/dist/{operation-code-sample-xgx4qi2H.js → operation-code-sample-DOzAPxLQ.js} +2 -2
- package/dist/{operation-code-sample-xgx4qi2H.js.map → operation-code-sample-DOzAPxLQ.js.map} +1 -1
- package/dist/plugins/hooks/usePluginManager.d.ts +1 -1
- package/dist/{request-block-N7dPFyrG.js → request-block-C1kLLMEd.js} +2 -2
- package/dist/{request-block-N7dPFyrG.js.map → request-block-C1kLLMEd.js.map} +1 -1
- package/dist/store/collections.d.ts +1 -1
- package/dist/store/environment.d.ts +1 -1
- package/dist/store/events.d.ts +8 -8
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/index.js +1 -1
- package/dist/store/request-example.d.ts +1 -1
- package/dist/store/requests.d.ts +1 -1
- package/dist/store/security-schemes.d.ts +1 -1
- package/dist/store/servers.d.ts +1 -1
- package/dist/store/store.d.ts +7 -7
- package/dist/store/tags.d.ts +1 -1
- package/dist/store/workspace.d.ts +1 -1
- package/dist/{store-DaPoVtIS.js → store-DnlAQK5d.js} +15 -15
- package/dist/{store-DaPoVtIS.js.map → store-DnlAQK5d.js.map} +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +3 -3
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
- package/dist/v2/blocks/operation-block/index.js +8 -8
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/index.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +4 -4
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +1 -1
- package/dist/v2/blocks/request-block/index.js +4 -4
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/index.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -3
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +2 -2
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +1 -1
- package/dist/v2/features/app/App.vue.d.ts +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +1 -1
- package/dist/v2/features/app/components/index.js +2 -2
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +3 -3
- package/dist/v2/features/app/helpers/get-route-param.d.ts +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts +3 -3
- package/dist/v2/features/app/index.d.ts +5 -5
- package/dist/v2/features/app/index.js +8 -8
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/OperationCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Cookies.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Editor/Editor.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Environment.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Overview.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Servers.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Settings.vue.d.ts +4 -4
- package/dist/v2/features/collection/components/Tabs.vue.d.ts +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +45 -10
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/editor/helpers/json/create-json-model.d.ts +1 -1
- package/dist/v2/features/editor/helpers/yaml/create-yaml-model.d.ts +1 -1
- package/dist/v2/features/editor/helpers/yaml/get-yaml-node-range-from-path.d.ts +1 -1
- package/dist/v2/features/editor/hooks/use-editor.d.ts +1 -1
- package/dist/v2/features/editor/hooks/use-json-pointer-link-support.d.ts +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +2 -2
- package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +1 -1
- package/dist/v2/features/modal/index.js +8 -8
- package/dist/v2/features/modal/modal-events.d.ts +1 -1
- package/dist/v2/features/operation/Operation.vue.d.ts +2 -2
- package/dist/v2/features/operation/index.js +8 -8
- package/dist/v2/features/search/helpers/create-fuse-instance.d.ts +1 -1
- package/dist/v2/features/search/helpers/create-search-index.d.ts +1 -1
- package/dist/v2/helpers/get-active-proxy-url.d.ts +1 -1
- package/dist/v2/helpers/get-tab-details.d.ts +1 -1
- package/dist/v2/helpers/handle-hotkeys.d.ts +1 -1
- package/dist/v2/hooks/use-global-hot-keys.d.ts +1 -1
- package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +1 -1
- package/dist/views/Environment/handle-drag.d.ts +1 -1
- package/dist/views/Request/Request.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.js +3 -3
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +1 -1
- package/dist/views/Request/RequestSection/index.js +4 -4
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +3 -3
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -1
- package/dist/views/Request/ResponseSection/index.js +3 -3
- package/dist/views/Request/components/index.js +1 -1
- package/dist/views/Request/handle-drag.d.ts +2 -2
- package/dist/views/Request/libs/auth.d.ts +1 -1
- package/dist/views/Request/libs/oauth2.d.ts +1 -1
- package/dist/views/Request/libs/watch-mode.d.ts +2 -2
- package/package.json +12 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AddressBar } from './AddressBar';
|
|
1
|
+
export { AddressBar } from './AddressBar/index.js';
|
|
2
2
|
export { default as OpenApiClientButton } from './OpenApiClientButton.vue';
|
|
3
|
-
export { Sidebar } from './Sidebar';
|
|
3
|
+
export { Sidebar } from './Sidebar/index.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../HttpMethod-rnWEgC3T.js";
|
|
2
|
-
import "../CodeInput-
|
|
3
|
-
import "../Server-
|
|
4
|
-
import { t as AddressBar_default } from "../AddressBar-
|
|
2
|
+
import "../CodeInput-BTN8cC5h.js";
|
|
3
|
+
import "../Server-CEKGIEfE.js";
|
|
4
|
+
import { t as AddressBar_default } from "../AddressBar-BOZGKSoz.js";
|
|
5
5
|
import { t as OpenApiClientButton_default } from "../components-ChixwQhN.js";
|
|
6
|
-
import { t as Sidebar_default } from "../Sidebar-
|
|
6
|
+
import { t as Sidebar_default } from "../Sidebar-CRxdl38Y.js";
|
|
7
7
|
export { AddressBar_default as AddressBar, OpenApiClientButton_default as OpenApiClientButton, Sidebar_default as Sidebar };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as useWorkspace, w as useActiveEntities } from "./store-
|
|
1
|
+
import { r as useWorkspace, w as useActiveEntities } from "./store-DnlAQK5d.js";
|
|
2
2
|
import { t as DeleteSidebarListElement_default } from "./DeleteSidebarListElement-C-p87d03.js";
|
|
3
3
|
import { t as EditSidebarListElement_default } from "./EditSidebarListElement-CodWPnM6.js";
|
|
4
4
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, withCtx, withModifiers } from "vue";
|
|
@@ -180,4 +180,4 @@ var WorkspaceDropdown_default = /* @__PURE__ */ defineComponent({
|
|
|
180
180
|
//#endregion
|
|
181
181
|
export { WorkspaceDropdown_default as t };
|
|
182
182
|
|
|
183
|
-
//# sourceMappingURL=components-
|
|
183
|
+
//# sourceMappingURL=components-B0BwUDFw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-DfJHvSLM.js","names":[],"sources":["../src/views/Request/components/WorkspaceDropdown.vue","../src/views/Request/components/WorkspaceDropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n ScalarIcon,\n ScalarListboxCheckbox,\n ScalarModal,\n useModal,\n} from '@scalar/components'\nimport type { Workspace } from '@scalar/oas-utils/entities/workspace'\nimport { computed, ref } from 'vue'\nimport { useRouter } from 'vue-router'\n\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport EditSidebarListElement from '@/components/Sidebar/Actions/EditSidebarListElement.vue'\nimport { useWorkspace } from '@/store'\nimport { useActiveEntities } from '@/store/active-entities'\n\nconst { activeWorkspace } = useActiveEntities()\nconst { workspaces, workspaceMutators, events } = useWorkspace()\nconst { push } = useRouter()\n\nconst updateSelected = (uid: Workspace['uid']) => {\n if (uid === activeWorkspace.value?.uid) {\n return\n }\n\n push({\n name: 'workspace',\n params: {\n workspace: uid,\n },\n })\n}\n\nconst isLastWorkspace = computed(() => Object.keys(workspaces).length === 1)\n\nconst createNewWorkspace = () =>\n events.commandPalette.emit({ commandName: 'Create Workspace' })\n\nconst tempName = ref('')\nconst tempUid = ref('' as Workspace['uid'])\nconst editModal = useModal()\nconst deleteModal = useModal()\n\nconst openRenameModal = (uid: Workspace['uid']) => {\n const workspace = workspaces[uid]\n if (!workspace) {\n return\n }\n\n tempName.value = workspace.name\n tempUid.value = uid\n editModal.show()\n}\n\nconst handleWorkspaceEdit = (name: string) => {\n if (!name.trim()) {\n return\n }\n\n workspaceMutators.edit(tempUid.value, 'name', name.trim())\n editModal.hide()\n}\n\nconst openDeleteModal = (uid: Workspace['uid']) => {\n const workspace = workspaces[uid]\n if (!workspace) {\n return\n }\n\n tempName.value = workspace.name\n tempUid.value = uid\n deleteModal.show()\n}\n\nconst deleteWorkspace = async () => {\n if (!isLastWorkspace.value) {\n const deletedActiveWorkspace = activeWorkspace.value?.uid === tempUid.value\n const currentWorkspaces = { ...workspaces }\n delete currentWorkspaces[tempUid.value]\n\n workspaceMutators.delete(tempUid.value)\n\n // Switch to another workspace if the active one is deleted\n if (deletedActiveWorkspace) {\n const newWorkspaceUid = Object.keys(currentWorkspaces)[0]\n\n await push({\n name: 'workspace',\n params: {\n workspace: newWorkspaceUid,\n },\n })\n }\n }\n\n deleteModal.hide()\n}\n</script>\n\n<template>\n <div>\n <div class=\"flex w-[inherit] items-center text-base\">\n <ScalarDropdown>\n <ScalarButton\n class=\"text-c-1 hover:bg-b-2 line-clamp-1 h-full w-fit justify-start px-1.5 py-1.5 font-normal\"\n variant=\"ghost\">\n <div class=\"m-0 flex items-center gap-1.5 font-bold\">\n <h2 class=\"line-clamp-1 text-left\">\n {{ activeWorkspace?.name }}\n </h2>\n </div>\n </ScalarButton>\n\n <!-- Workspace list -->\n <template #items>\n <ScalarDropdownItem\n v-for=\"(workspace, uid) in workspaces\"\n :key=\"uid\"\n class=\"group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n @click.stop=\"updateSelected(workspace.uid)\">\n <ScalarListboxCheckbox :selected=\"activeWorkspace?.uid === uid\" />\n <span class=\"overflow-hidden text-ellipsis\">{{\n workspace.name\n }}</span>\n <ScalarDropdown\n placement=\"right-start\"\n teleport>\n <ScalarButton\n class=\"hover:bg-b-3 -mr-1 ml-auto aspect-square h-fit px-0.5 py-0 group-hover/item:flex\"\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\">\n <ScalarIcon\n icon=\"Ellipses\"\n size=\"sm\" />\n </ScalarButton>\n <template #items>\n <ScalarDropdownItem\n class=\"flex gap-2\"\n @mousedown=\"openRenameModal(workspace.uid)\"\n @touchend.prevent=\"openRenameModal(workspace.uid)\">\n <ScalarIcon\n class=\"inline-flex\"\n icon=\"Edit\"\n size=\"md\"\n thickness=\"1.5\" />\n <span>Rename</span>\n </ScalarDropdownItem>\n <ScalarDropdownItem\n v-if=\"!isLastWorkspace\"\n class=\"flex gap-2\"\n @mousedown.prevent=\"openDeleteModal(workspace.uid)\"\n @touchend.prevent=\"openDeleteModal(workspace.uid)\">\n <ScalarIcon\n class=\"inline-flex\"\n icon=\"Delete\"\n size=\"md\"\n thickness=\"1.5\" />\n <span>Delete</span>\n </ScalarDropdownItem>\n </template>\n </ScalarDropdown>\n </ScalarDropdownItem>\n <ScalarDropdownDivider />\n\n <!-- Add new workspace -->\n <ScalarDropdownItem\n class=\"flex items-center gap-1.5\"\n @click=\"createNewWorkspace\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>Create Workspace</span>\n </ScalarDropdownItem>\n </template>\n </ScalarDropdown>\n </div>\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"deleteModal\"\n title=\"Delete workspace\">\n <DeleteSidebarListElement\n :variableName=\"tempName\"\n warningMessage=\"This cannot be undone. You're about to delete the workspace and everything inside it.\"\n @close=\"deleteModal.hide()\"\n @delete=\"deleteWorkspace\" />\n </ScalarModal>\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"editModal\"\n title=\"Rename Workspace\">\n <EditSidebarListElement\n :name=\"tempName\"\n @close=\"editModal.hide()\"\n @edit=\"handleWorkspaceEdit\" />\n </ScalarModal>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n ScalarIcon,\n ScalarListboxCheckbox,\n ScalarModal,\n useModal,\n} from '@scalar/components'\nimport type { Workspace } from '@scalar/oas-utils/entities/workspace'\nimport { computed, ref } from 'vue'\nimport { useRouter } from 'vue-router'\n\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport EditSidebarListElement from '@/components/Sidebar/Actions/EditSidebarListElement.vue'\nimport { useWorkspace } from '@/store'\nimport { useActiveEntities } from '@/store/active-entities'\n\nconst { activeWorkspace } = useActiveEntities()\nconst { workspaces, workspaceMutators, events } = useWorkspace()\nconst { push } = useRouter()\n\nconst updateSelected = (uid: Workspace['uid']) => {\n if (uid === activeWorkspace.value?.uid) {\n return\n }\n\n push({\n name: 'workspace',\n params: {\n workspace: uid,\n },\n })\n}\n\nconst isLastWorkspace = computed(() => Object.keys(workspaces).length === 1)\n\nconst createNewWorkspace = () =>\n events.commandPalette.emit({ commandName: 'Create Workspace' })\n\nconst tempName = ref('')\nconst tempUid = ref('' as Workspace['uid'])\nconst editModal = useModal()\nconst deleteModal = useModal()\n\nconst openRenameModal = (uid: Workspace['uid']) => {\n const workspace = workspaces[uid]\n if (!workspace) {\n return\n }\n\n tempName.value = workspace.name\n tempUid.value = uid\n editModal.show()\n}\n\nconst handleWorkspaceEdit = (name: string) => {\n if (!name.trim()) {\n return\n }\n\n workspaceMutators.edit(tempUid.value, 'name', name.trim())\n editModal.hide()\n}\n\nconst openDeleteModal = (uid: Workspace['uid']) => {\n const workspace = workspaces[uid]\n if (!workspace) {\n return\n }\n\n tempName.value = workspace.name\n tempUid.value = uid\n deleteModal.show()\n}\n\nconst deleteWorkspace = async () => {\n if (!isLastWorkspace.value) {\n const deletedActiveWorkspace = activeWorkspace.value?.uid === tempUid.value\n const currentWorkspaces = { ...workspaces }\n delete currentWorkspaces[tempUid.value]\n\n workspaceMutators.delete(tempUid.value)\n\n // Switch to another workspace if the active one is deleted\n if (deletedActiveWorkspace) {\n const newWorkspaceUid = Object.keys(currentWorkspaces)[0]\n\n await push({\n name: 'workspace',\n params: {\n workspace: newWorkspaceUid,\n },\n })\n }\n }\n\n deleteModal.hide()\n}\n</script>\n\n<template>\n <div>\n <div class=\"flex w-[inherit] items-center text-base\">\n <ScalarDropdown>\n <ScalarButton\n class=\"text-c-1 hover:bg-b-2 line-clamp-1 h-full w-fit justify-start px-1.5 py-1.5 font-normal\"\n variant=\"ghost\">\n <div class=\"m-0 flex items-center gap-1.5 font-bold\">\n <h2 class=\"line-clamp-1 text-left\">\n {{ activeWorkspace?.name }}\n </h2>\n </div>\n </ScalarButton>\n\n <!-- Workspace list -->\n <template #items>\n <ScalarDropdownItem\n v-for=\"(workspace, uid) in workspaces\"\n :key=\"uid\"\n class=\"group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n @click.stop=\"updateSelected(workspace.uid)\">\n <ScalarListboxCheckbox :selected=\"activeWorkspace?.uid === uid\" />\n <span class=\"overflow-hidden text-ellipsis\">{{\n workspace.name\n }}</span>\n <ScalarDropdown\n placement=\"right-start\"\n teleport>\n <ScalarButton\n class=\"hover:bg-b-3 -mr-1 ml-auto aspect-square h-fit px-0.5 py-0 group-hover/item:flex\"\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\">\n <ScalarIcon\n icon=\"Ellipses\"\n size=\"sm\" />\n </ScalarButton>\n <template #items>\n <ScalarDropdownItem\n class=\"flex gap-2\"\n @mousedown=\"openRenameModal(workspace.uid)\"\n @touchend.prevent=\"openRenameModal(workspace.uid)\">\n <ScalarIcon\n class=\"inline-flex\"\n icon=\"Edit\"\n size=\"md\"\n thickness=\"1.5\" />\n <span>Rename</span>\n </ScalarDropdownItem>\n <ScalarDropdownItem\n v-if=\"!isLastWorkspace\"\n class=\"flex gap-2\"\n @mousedown.prevent=\"openDeleteModal(workspace.uid)\"\n @touchend.prevent=\"openDeleteModal(workspace.uid)\">\n <ScalarIcon\n class=\"inline-flex\"\n icon=\"Delete\"\n size=\"md\"\n thickness=\"1.5\" />\n <span>Delete</span>\n </ScalarDropdownItem>\n </template>\n </ScalarDropdown>\n </ScalarDropdownItem>\n <ScalarDropdownDivider />\n\n <!-- Add new workspace -->\n <ScalarDropdownItem\n class=\"flex items-center gap-1.5\"\n @click=\"createNewWorkspace\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>Create Workspace</span>\n </ScalarDropdownItem>\n </template>\n </ScalarDropdown>\n </div>\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"deleteModal\"\n title=\"Delete workspace\">\n <DeleteSidebarListElement\n :variableName=\"tempName\"\n warningMessage=\"This cannot be undone. You're about to delete the workspace and everything inside it.\"\n @close=\"deleteModal.hide()\"\n @delete=\"deleteWorkspace\" />\n </ScalarModal>\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"editModal\"\n title=\"Rename Workspace\">\n <EditSidebarListElement\n :name=\"tempName\"\n @close=\"editModal.hide()\"\n @edit=\"handleWorkspaceEdit\" />\n </ScalarModal>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;ECoBA,MAAM,EAAE,oBAAoB,mBAAkB;EAC9C,MAAM,EAAE,YAAY,mBAAmB,WAAW,cAAa;EAC/D,MAAM,EAAE,SAAS,WAAU;EAE3B,MAAM,kBAAkB,QAA0B;AAChD,OAAI,QAAQ,gBAAgB,OAAO,IACjC;AAGF,QAAK;IACH,MAAM;IACN,QAAQ,EACN,WAAW,KACZ;IACF,CAAA;;EAGH,MAAM,kBAAkB,eAAe,OAAO,KAAK,WAAW,CAAC,WAAW,EAAC;EAE3E,MAAM,2BACJ,OAAO,eAAe,KAAK,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EAAA;QADZ,MAAK;QACL,MAAK;uCAET,mBAA6B,QAAA,MAAvB,oBAAgB,GAAA,EAAA,CAAA;;;;4BA/DX,CARf,YAQe,MAAA,aAAA,EAAA;MAPb,OAAM;MACN,SAAQ;;6BAKF,CAJN,mBAIM,OAJN,YAIM,CAHJ,mBAEK,MAFL,YAEK,gBADA,MAAA,gBAAe,EAAE,KAAI,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;;;IAuElC,YASc,MAAA,YAAA,EAAA;KARX,MAAM;KACN,OAAO,MAAA,YAAW;KACnB,OAAM;;4BAKwB,CAJ9B,YAI8B,kCAAA;MAH3B,cAAc,SAAA;MACf,gBAAe;MACd,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,YAAW,CAAC,MAAI;MACvB,UAAQ;;;;IAEb,YAQc,MAAA,YAAA,EAAA;KAPX,MAAM;KACN,OAAO,MAAA,UAAS;KACjB,OAAM;;4BAI0B,CAHhC,YAGgC,gCAAA;MAF7B,MAAM,SAAA;MACN,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,UAAS,CAAC,MAAI;MACrB,QAAM"}
|
|
1
|
+
{"version":3,"file":"components-B0BwUDFw.js","names":[],"sources":["../src/views/Request/components/WorkspaceDropdown.vue","../src/views/Request/components/WorkspaceDropdown.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n ScalarIcon,\n ScalarListboxCheckbox,\n ScalarModal,\n useModal,\n} from '@scalar/components'\nimport type { Workspace } from '@scalar/oas-utils/entities/workspace'\nimport { computed, ref } from 'vue'\nimport { useRouter } from 'vue-router'\n\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport EditSidebarListElement from '@/components/Sidebar/Actions/EditSidebarListElement.vue'\nimport { useWorkspace } from '@/store'\nimport { useActiveEntities } from '@/store/active-entities'\n\nconst { activeWorkspace } = useActiveEntities()\nconst { workspaces, workspaceMutators, events } = useWorkspace()\nconst { push } = useRouter()\n\nconst updateSelected = (uid: Workspace['uid']) => {\n if (uid === activeWorkspace.value?.uid) {\n return\n }\n\n push({\n name: 'workspace',\n params: {\n workspace: uid,\n },\n })\n}\n\nconst isLastWorkspace = computed(() => Object.keys(workspaces).length === 1)\n\nconst createNewWorkspace = () =>\n events.commandPalette.emit({ commandName: 'Create Workspace' })\n\nconst tempName = ref('')\nconst tempUid = ref('' as Workspace['uid'])\nconst editModal = useModal()\nconst deleteModal = useModal()\n\nconst openRenameModal = (uid: Workspace['uid']) => {\n const workspace = workspaces[uid]\n if (!workspace) {\n return\n }\n\n tempName.value = workspace.name\n tempUid.value = uid\n editModal.show()\n}\n\nconst handleWorkspaceEdit = (name: string) => {\n if (!name.trim()) {\n return\n }\n\n workspaceMutators.edit(tempUid.value, 'name', name.trim())\n editModal.hide()\n}\n\nconst openDeleteModal = (uid: Workspace['uid']) => {\n const workspace = workspaces[uid]\n if (!workspace) {\n return\n }\n\n tempName.value = workspace.name\n tempUid.value = uid\n deleteModal.show()\n}\n\nconst deleteWorkspace = async () => {\n if (!isLastWorkspace.value) {\n const deletedActiveWorkspace = activeWorkspace.value?.uid === tempUid.value\n const currentWorkspaces = { ...workspaces }\n delete currentWorkspaces[tempUid.value]\n\n workspaceMutators.delete(tempUid.value)\n\n // Switch to another workspace if the active one is deleted\n if (deletedActiveWorkspace) {\n const newWorkspaceUid = Object.keys(currentWorkspaces)[0]\n\n await push({\n name: 'workspace',\n params: {\n workspace: newWorkspaceUid,\n },\n })\n }\n }\n\n deleteModal.hide()\n}\n</script>\n\n<template>\n <div>\n <div class=\"flex w-[inherit] items-center text-base\">\n <ScalarDropdown>\n <ScalarButton\n class=\"text-c-1 hover:bg-b-2 line-clamp-1 h-full w-fit justify-start px-1.5 py-1.5 font-normal\"\n variant=\"ghost\">\n <div class=\"m-0 flex items-center gap-1.5 font-bold\">\n <h2 class=\"line-clamp-1 text-left\">\n {{ activeWorkspace?.name }}\n </h2>\n </div>\n </ScalarButton>\n\n <!-- Workspace list -->\n <template #items>\n <ScalarDropdownItem\n v-for=\"(workspace, uid) in workspaces\"\n :key=\"uid\"\n class=\"group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n @click.stop=\"updateSelected(workspace.uid)\">\n <ScalarListboxCheckbox :selected=\"activeWorkspace?.uid === uid\" />\n <span class=\"overflow-hidden text-ellipsis\">{{\n workspace.name\n }}</span>\n <ScalarDropdown\n placement=\"right-start\"\n teleport>\n <ScalarButton\n class=\"hover:bg-b-3 -mr-1 ml-auto aspect-square h-fit px-0.5 py-0 group-hover/item:flex\"\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\">\n <ScalarIcon\n icon=\"Ellipses\"\n size=\"sm\" />\n </ScalarButton>\n <template #items>\n <ScalarDropdownItem\n class=\"flex gap-2\"\n @mousedown=\"openRenameModal(workspace.uid)\"\n @touchend.prevent=\"openRenameModal(workspace.uid)\">\n <ScalarIcon\n class=\"inline-flex\"\n icon=\"Edit\"\n size=\"md\"\n thickness=\"1.5\" />\n <span>Rename</span>\n </ScalarDropdownItem>\n <ScalarDropdownItem\n v-if=\"!isLastWorkspace\"\n class=\"flex gap-2\"\n @mousedown.prevent=\"openDeleteModal(workspace.uid)\"\n @touchend.prevent=\"openDeleteModal(workspace.uid)\">\n <ScalarIcon\n class=\"inline-flex\"\n icon=\"Delete\"\n size=\"md\"\n thickness=\"1.5\" />\n <span>Delete</span>\n </ScalarDropdownItem>\n </template>\n </ScalarDropdown>\n </ScalarDropdownItem>\n <ScalarDropdownDivider />\n\n <!-- Add new workspace -->\n <ScalarDropdownItem\n class=\"flex items-center gap-1.5\"\n @click=\"createNewWorkspace\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>Create Workspace</span>\n </ScalarDropdownItem>\n </template>\n </ScalarDropdown>\n </div>\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"deleteModal\"\n title=\"Delete workspace\">\n <DeleteSidebarListElement\n :variableName=\"tempName\"\n warningMessage=\"This cannot be undone. You're about to delete the workspace and everything inside it.\"\n @close=\"deleteModal.hide()\"\n @delete=\"deleteWorkspace\" />\n </ScalarModal>\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"editModal\"\n title=\"Rename Workspace\">\n <EditSidebarListElement\n :name=\"tempName\"\n @close=\"editModal.hide()\"\n @edit=\"handleWorkspaceEdit\" />\n </ScalarModal>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport {\n ScalarButton,\n ScalarDropdown,\n ScalarDropdownDivider,\n ScalarDropdownItem,\n ScalarIcon,\n ScalarListboxCheckbox,\n ScalarModal,\n useModal,\n} from '@scalar/components'\nimport type { Workspace } from '@scalar/oas-utils/entities/workspace'\nimport { computed, ref } from 'vue'\nimport { useRouter } from 'vue-router'\n\nimport DeleteSidebarListElement from '@/components/Sidebar/Actions/DeleteSidebarListElement.vue'\nimport EditSidebarListElement from '@/components/Sidebar/Actions/EditSidebarListElement.vue'\nimport { useWorkspace } from '@/store'\nimport { useActiveEntities } from '@/store/active-entities'\n\nconst { activeWorkspace } = useActiveEntities()\nconst { workspaces, workspaceMutators, events } = useWorkspace()\nconst { push } = useRouter()\n\nconst updateSelected = (uid: Workspace['uid']) => {\n if (uid === activeWorkspace.value?.uid) {\n return\n }\n\n push({\n name: 'workspace',\n params: {\n workspace: uid,\n },\n })\n}\n\nconst isLastWorkspace = computed(() => Object.keys(workspaces).length === 1)\n\nconst createNewWorkspace = () =>\n events.commandPalette.emit({ commandName: 'Create Workspace' })\n\nconst tempName = ref('')\nconst tempUid = ref('' as Workspace['uid'])\nconst editModal = useModal()\nconst deleteModal = useModal()\n\nconst openRenameModal = (uid: Workspace['uid']) => {\n const workspace = workspaces[uid]\n if (!workspace) {\n return\n }\n\n tempName.value = workspace.name\n tempUid.value = uid\n editModal.show()\n}\n\nconst handleWorkspaceEdit = (name: string) => {\n if (!name.trim()) {\n return\n }\n\n workspaceMutators.edit(tempUid.value, 'name', name.trim())\n editModal.hide()\n}\n\nconst openDeleteModal = (uid: Workspace['uid']) => {\n const workspace = workspaces[uid]\n if (!workspace) {\n return\n }\n\n tempName.value = workspace.name\n tempUid.value = uid\n deleteModal.show()\n}\n\nconst deleteWorkspace = async () => {\n if (!isLastWorkspace.value) {\n const deletedActiveWorkspace = activeWorkspace.value?.uid === tempUid.value\n const currentWorkspaces = { ...workspaces }\n delete currentWorkspaces[tempUid.value]\n\n workspaceMutators.delete(tempUid.value)\n\n // Switch to another workspace if the active one is deleted\n if (deletedActiveWorkspace) {\n const newWorkspaceUid = Object.keys(currentWorkspaces)[0]\n\n await push({\n name: 'workspace',\n params: {\n workspace: newWorkspaceUid,\n },\n })\n }\n }\n\n deleteModal.hide()\n}\n</script>\n\n<template>\n <div>\n <div class=\"flex w-[inherit] items-center text-base\">\n <ScalarDropdown>\n <ScalarButton\n class=\"text-c-1 hover:bg-b-2 line-clamp-1 h-full w-fit justify-start px-1.5 py-1.5 font-normal\"\n variant=\"ghost\">\n <div class=\"m-0 flex items-center gap-1.5 font-bold\">\n <h2 class=\"line-clamp-1 text-left\">\n {{ activeWorkspace?.name }}\n </h2>\n </div>\n </ScalarButton>\n\n <!-- Workspace list -->\n <template #items>\n <ScalarDropdownItem\n v-for=\"(workspace, uid) in workspaces\"\n :key=\"uid\"\n class=\"group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap\"\n @click.stop=\"updateSelected(workspace.uid)\">\n <ScalarListboxCheckbox :selected=\"activeWorkspace?.uid === uid\" />\n <span class=\"overflow-hidden text-ellipsis\">{{\n workspace.name\n }}</span>\n <ScalarDropdown\n placement=\"right-start\"\n teleport>\n <ScalarButton\n class=\"hover:bg-b-3 -mr-1 ml-auto aspect-square h-fit px-0.5 py-0 group-hover/item:flex\"\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\">\n <ScalarIcon\n icon=\"Ellipses\"\n size=\"sm\" />\n </ScalarButton>\n <template #items>\n <ScalarDropdownItem\n class=\"flex gap-2\"\n @mousedown=\"openRenameModal(workspace.uid)\"\n @touchend.prevent=\"openRenameModal(workspace.uid)\">\n <ScalarIcon\n class=\"inline-flex\"\n icon=\"Edit\"\n size=\"md\"\n thickness=\"1.5\" />\n <span>Rename</span>\n </ScalarDropdownItem>\n <ScalarDropdownItem\n v-if=\"!isLastWorkspace\"\n class=\"flex gap-2\"\n @mousedown.prevent=\"openDeleteModal(workspace.uid)\"\n @touchend.prevent=\"openDeleteModal(workspace.uid)\">\n <ScalarIcon\n class=\"inline-flex\"\n icon=\"Delete\"\n size=\"md\"\n thickness=\"1.5\" />\n <span>Delete</span>\n </ScalarDropdownItem>\n </template>\n </ScalarDropdown>\n </ScalarDropdownItem>\n <ScalarDropdownDivider />\n\n <!-- Add new workspace -->\n <ScalarDropdownItem\n class=\"flex items-center gap-1.5\"\n @click=\"createNewWorkspace\">\n <div class=\"flex h-4 w-4 items-center justify-center\">\n <ScalarIcon\n icon=\"Add\"\n size=\"sm\" />\n </div>\n <span>Create Workspace</span>\n </ScalarDropdownItem>\n </template>\n </ScalarDropdown>\n </div>\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"deleteModal\"\n title=\"Delete workspace\">\n <DeleteSidebarListElement\n :variableName=\"tempName\"\n warningMessage=\"This cannot be undone. You're about to delete the workspace and everything inside it.\"\n @close=\"deleteModal.hide()\"\n @delete=\"deleteWorkspace\" />\n </ScalarModal>\n <ScalarModal\n :size=\"'xxs'\"\n :state=\"editModal\"\n title=\"Rename Workspace\">\n <EditSidebarListElement\n :name=\"tempName\"\n @close=\"editModal.hide()\"\n @edit=\"handleWorkspaceEdit\" />\n </ScalarModal>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;ECoBA,MAAM,EAAE,oBAAoB,mBAAkB;EAC9C,MAAM,EAAE,YAAY,mBAAmB,WAAW,cAAa;EAC/D,MAAM,EAAE,SAAS,WAA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K;WACL,SAAQ;;kCAGM,CAFd,YAEc,MAAA,WAAA,EAAA;YADZ,MAAK;YACL,MAAK;;;;;;;;;;MA6Bb,YAAyB,MAAA,sBAAA,CAAA;MAGzB,YASqB,MAAA,mBAAA,EAAA;OARnB,OAAM;OACL,SAAO;;8BAKF,CAJN,mBAIM,OAJN,YAIM,CAHJ,YAEc,MAAA,WAAA,EAAA;QADZ,MAAK;QACL,MAAK;uCAET,mBAA6B,QAAA,MAAvB,oBAAgB,GAAA,EAAA,CAAA;;;;4BA/DX,CARf,YAQe,MAAA,aAAA,EAAA;MAPb,OAAM;MACN,SAAQ;;6BAKF,CAJN,mBAIM,OAJN,YAIM,CAHJ,mBAEK,MAFL,YAEK,gBADA,MAAA,gBAAe,EAAE,KAAI,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;;;IAuElC,YASc,MAAA,YAAA,EAAA;KARX,MAAM;KACN,OAAO,MAAA,YAAW;KACnB,OAAM;;4BAKwB,CAJ9B,YAI8B,kCAAA;MAH3B,cAAc,SAAA;MACf,gBAAe;MACd,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,YAAW,CAAC,MAAI;MACvB,UAAQ;;;;IAEb,YAQc,MAAA,YAAA,EAAA;KAPX,MAAM;KACN,OAAO,MAAA,UAAS;KACjB,OAAM;;4BAI0B,CAHhC,YAGgC,gCAAA;MAF7B,MAAM,SAAA;MACN,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,UAAS,CAAC,MAAI;MACrB,QAAM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InjectionKey } from 'vue';
|
|
2
|
-
import type { ClientLayout } from '
|
|
2
|
+
import type { ClientLayout } from '../hooks/useLayout';
|
|
3
3
|
type CollapsedSidebarFolders = Record<string, boolean>;
|
|
4
4
|
/** Creates the sidebar state so that it can be unique across instances of the client */
|
|
5
5
|
export declare const createSidebarState: ({ layout }: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
-
export { ApiClientApp, createApiClientApp } from './layouts/App';
|
|
3
|
-
export { type ApiClient, createApiClientModal } from './layouts/Modal';
|
|
2
|
+
export { ApiClientApp, createApiClientApp } from './layouts/App/index.js';
|
|
3
|
+
export { type ApiClient, createApiClientModal } from './layouts/Modal/index.js';
|
|
4
4
|
export { useWorkspace } from './store/store';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./CommandPalette-
|
|
2
|
-
import { r as useWorkspace } from "./store-
|
|
3
|
-
import { n as ApiClientApp_default, t as createApiClientApp } from "./App-
|
|
1
|
+
import "./CommandPalette-BxoEK8TY.js";
|
|
2
|
+
import { r as useWorkspace } from "./store-DnlAQK5d.js";
|
|
3
|
+
import { n as ApiClientApp_default, t as createApiClientApp } from "./App-DHBmpWJI.js";
|
|
4
4
|
import "./HttpMethod-rnWEgC3T.js";
|
|
5
|
-
import "./MainLayout-
|
|
5
|
+
import "./MainLayout-BnLwst16.js";
|
|
6
6
|
import "./ModalClientContainer-qHsZi4wQ.js";
|
|
7
|
-
import { t as createApiClientModal } from "./Modal-
|
|
7
|
+
import { t as createApiClientModal } from "./Modal-CTZ8UNds.js";
|
|
8
8
|
export { ApiClientApp_default as ApiClientApp, createApiClientApp, createApiClientModal, useWorkspace };
|
|
@@ -23,8 +23,8 @@ mountOnInitialize?: boolean) => Promise<{
|
|
|
23
23
|
propertyKey: P;
|
|
24
24
|
value: NonNullable<import("@scalar/object-utils/nested").PathValue<import("@scalar/types/entities").SecurityScheme, P>>;
|
|
25
25
|
}) => void;
|
|
26
|
-
route: (payload?: import("
|
|
27
|
-
open: (payload?: import("
|
|
26
|
+
route: (payload?: import("../../libs/index.js").OpenClientPayload) => void;
|
|
27
|
+
open: (payload?: import("../../libs/index.js").OpenClientPayload) => void;
|
|
28
28
|
mount: (mountingEl?: HTMLElement | null) => void;
|
|
29
29
|
modalState: {
|
|
30
30
|
open: boolean;
|
|
@@ -415,14 +415,14 @@ mountOnInitialize?: boolean) => Promise<{
|
|
|
415
415
|
hide: () => void;
|
|
416
416
|
};
|
|
417
417
|
events: {
|
|
418
|
-
executeRequest: import("
|
|
418
|
+
executeRequest: import("../../libs/index.js").EventBus<{
|
|
419
419
|
requestUid?: string;
|
|
420
420
|
}>;
|
|
421
|
-
focusAddressBar: import("
|
|
422
|
-
cancelRequest: import("
|
|
423
|
-
requestStatus: import("
|
|
424
|
-
commandPalette: import("
|
|
425
|
-
hotKeys: import("
|
|
421
|
+
focusAddressBar: import("../../libs/index.js").EventBus<any>;
|
|
422
|
+
cancelRequest: import("../../libs/index.js").EventBus<any>;
|
|
423
|
+
requestStatus: import("../../libs/index.js").EventBus<import("../../libs/index.js").RequestStatus>;
|
|
424
|
+
commandPalette: import("../../libs/index.js").EventBus<import("../../components/CommandPalette/TheCommandPalette.vue").CommandPaletteEvent>;
|
|
425
|
+
hotKeys: import("../../libs/index.js").EventBus<Partial<Record<"addTopNav" | "closeModal" | "closeTopNav" | "createNew" | "executeRequest" | "focusAddressBar" | "focusRequestSearch" | "jumpToLastTab" | "jumpToTab" | "navigateSearchResultsDown" | "navigateSearchResultsUp" | "navigateTopNavLeft" | "navigateTopNavRight" | "openCommandPalette" | "selectSearchResult" | "toggleSidebar", KeyboardEvent>>>;
|
|
426
426
|
};
|
|
427
427
|
sidebarWidth: import("vue").Ref<string, string>;
|
|
428
428
|
setSidebarWidth: (width: string) => void;
|
|
@@ -572,7 +572,7 @@ mountOnInitialize?: boolean) => Promise<{
|
|
|
572
572
|
shouldLoad?: boolean;
|
|
573
573
|
} & Pick<import("@scalar/types/api-reference").ApiReferenceConfiguration, "servers"> & {
|
|
574
574
|
dereferencedDocument?: import("@scalar/openapi-types").OpenAPIV3_1.Document;
|
|
575
|
-
}, "documentUrl"> & Pick<import("@scalar/types/api-reference").ApiReferenceConfiguration, "proxyUrl">) => Promise<import("
|
|
575
|
+
}, "documentUrl"> & Pick<import("@scalar/types/api-reference").ApiReferenceConfiguration, "proxyUrl">) => Promise<import("../../libs/index.js").ErrorResponse<Awaited<ReturnType<(_spec: string | Record<string, any> | undefined, workspaceUid: string, options?: Pick<{
|
|
576
576
|
info: {
|
|
577
577
|
title: string;
|
|
578
578
|
version: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../CommandPalette-
|
|
2
|
-
import { n as ApiClientApp_default, t as createApiClientApp } from "../../App-
|
|
1
|
+
import "../../CommandPalette-BxoEK8TY.js";
|
|
2
|
+
import { n as ApiClientApp_default, t as createApiClientApp } from "../../App-DHBmpWJI.js";
|
|
3
3
|
import "../../HttpMethod-rnWEgC3T.js";
|
|
4
|
-
import "../../MainLayout-
|
|
4
|
+
import "../../MainLayout-BnLwst16.js";
|
|
5
5
|
export { ApiClientApp_default as ApiClientApp, createApiClientApp };
|
|
@@ -22,8 +22,8 @@ mountOnInitialize?: boolean) => Promise<{
|
|
|
22
22
|
propertyKey: P;
|
|
23
23
|
value: NonNullable<import("@scalar/object-utils/nested").PathValue<import("@scalar/types/entities").SecurityScheme, P>>;
|
|
24
24
|
}) => void;
|
|
25
|
-
route: (payload?: import("
|
|
26
|
-
open: (payload?: import("
|
|
25
|
+
route: (payload?: import("../../libs/index.js").OpenClientPayload) => void;
|
|
26
|
+
open: (payload?: import("../../libs/index.js").OpenClientPayload) => void;
|
|
27
27
|
mount: (mountingEl?: HTMLElement | null) => void;
|
|
28
28
|
modalState: {
|
|
29
29
|
open: boolean;
|
|
@@ -414,14 +414,14 @@ mountOnInitialize?: boolean) => Promise<{
|
|
|
414
414
|
hide: () => void;
|
|
415
415
|
};
|
|
416
416
|
events: {
|
|
417
|
-
executeRequest: import("
|
|
417
|
+
executeRequest: import("../../libs/index.js").EventBus<{
|
|
418
418
|
requestUid?: string;
|
|
419
419
|
}>;
|
|
420
|
-
focusAddressBar: import("
|
|
421
|
-
cancelRequest: import("
|
|
422
|
-
requestStatus: import("
|
|
423
|
-
commandPalette: import("
|
|
424
|
-
hotKeys: import("
|
|
420
|
+
focusAddressBar: import("../../libs/index.js").EventBus<any>;
|
|
421
|
+
cancelRequest: import("../../libs/index.js").EventBus<any>;
|
|
422
|
+
requestStatus: import("../../libs/index.js").EventBus<import("../../libs/index.js").RequestStatus>;
|
|
423
|
+
commandPalette: import("../../libs/index.js").EventBus<import("../../components/CommandPalette/TheCommandPalette.vue").CommandPaletteEvent>;
|
|
424
|
+
hotKeys: import("../../libs/index.js").EventBus<Partial<Record<"addTopNav" | "closeModal" | "closeTopNav" | "createNew" | "executeRequest" | "focusAddressBar" | "focusRequestSearch" | "jumpToLastTab" | "jumpToTab" | "navigateSearchResultsDown" | "navigateSearchResultsUp" | "navigateTopNavLeft" | "navigateTopNavRight" | "openCommandPalette" | "selectSearchResult" | "toggleSidebar", KeyboardEvent>>>;
|
|
425
425
|
};
|
|
426
426
|
sidebarWidth: import("vue").Ref<string, string>;
|
|
427
427
|
setSidebarWidth: (width: string) => void;
|
|
@@ -571,7 +571,7 @@ mountOnInitialize?: boolean) => Promise<{
|
|
|
571
571
|
shouldLoad?: boolean;
|
|
572
572
|
} & Pick<import("@scalar/types/api-reference").ApiReferenceConfiguration, "servers"> & {
|
|
573
573
|
dereferencedDocument?: import("@scalar/openapi-types").OpenAPIV3_1.Document;
|
|
574
|
-
}, "documentUrl"> & Pick<import("@scalar/types/api-reference").ApiReferenceConfiguration, "proxyUrl">) => Promise<import("
|
|
574
|
+
}, "documentUrl"> & Pick<import("@scalar/types/api-reference").ApiReferenceConfiguration, "proxyUrl">) => Promise<import("../../libs/index.js").ErrorResponse<Awaited<ReturnType<(_spec: string | Record<string, any> | undefined, workspaceUid: string, options?: Pick<{
|
|
575
575
|
info: {
|
|
576
576
|
title: string;
|
|
577
577
|
version: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../../CommandPalette-
|
|
2
|
-
import { D as routes, O as saveActiveWorkspace, _ as createApiClient, d as handleHotKeyDown, r as useWorkspace, w as useActiveEntities } from "../../store-
|
|
1
|
+
import "../../CommandPalette-BxoEK8TY.js";
|
|
2
|
+
import { D as routes, O as saveActiveWorkspace, _ as createApiClient, d as handleHotKeyDown, r as useWorkspace, w as useActiveEntities } from "../../store-DnlAQK5d.js";
|
|
3
3
|
import { r as useSidebar } from "../../useSidebar-DLTwHDI-.js";
|
|
4
4
|
import "../../HttpMethod-rnWEgC3T.js";
|
|
5
|
-
import { t as MainLayout_default } from "../../MainLayout-
|
|
5
|
+
import { t as MainLayout_default } from "../../MainLayout-BnLwst16.js";
|
|
6
6
|
import { t as analytics } from "../../analytics-BZimCWcw.js";
|
|
7
|
-
import { t as ImportCollectionListener_default } from "../../ImportCollection-
|
|
7
|
+
import { t as ImportCollectionListener_default } from "../../ImportCollection-CGjySEzP.js";
|
|
8
8
|
import { KeepAlive, computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, onBeforeMount, onBeforeUnmount, onMounted, openBlock, resolveDynamicComponent, unref, watch, withCtx } from "vue";
|
|
9
9
|
import { ScalarTeleportRoot, addScalarClassesToHeadless } from "@scalar/components";
|
|
10
10
|
import { getThemeStyles } from "@scalar/themes";
|
|
@@ -5,8 +5,8 @@ import type { OpenAPI } from '@scalar/openapi-types';
|
|
|
5
5
|
import { type ApiClientConfiguration } from '@scalar/types/api-reference';
|
|
6
6
|
import { type Component } from 'vue';
|
|
7
7
|
import type { Router } from 'vue-router';
|
|
8
|
-
import { type ClientLayout } from '
|
|
9
|
-
import { type WorkspaceStore } from '
|
|
8
|
+
import { type ClientLayout } from '../hooks/useLayout';
|
|
9
|
+
import { type WorkspaceStore } from '../store/store';
|
|
10
10
|
export type OpenClientPayload = ({
|
|
11
11
|
path: string;
|
|
12
12
|
method: OpenAPI.HttpMethod | Uppercase<OpenAPI.HttpMethod>;
|
|
@@ -489,7 +489,7 @@ export declare const createApiClient: ({ el, appComponent, configuration: _confi
|
|
|
489
489
|
}>;
|
|
490
490
|
focusAddressBar: import("./event-bus").EventBus<any>;
|
|
491
491
|
cancelRequest: import("./event-bus").EventBus<any>;
|
|
492
|
-
requestStatus: import("./event-bus").EventBus<import("./send-request").RequestStatus>;
|
|
492
|
+
requestStatus: import("./event-bus").EventBus<import("./send-request/index.js").RequestStatus>;
|
|
493
493
|
commandPalette: import("./event-bus").EventBus<import("../components/CommandPalette/TheCommandPalette.vue").CommandPaletteEvent>;
|
|
494
494
|
hotKeys: import("./event-bus").EventBus<Partial<Record<"addTopNav" | "closeModal" | "closeTopNav" | "createNew" | "executeRequest" | "focusAddressBar" | "focusRequestSearch" | "jumpToLastTab" | "jumpToTab" | "navigateSearchResultsDown" | "navigateSearchResultsUp" | "navigateTopNavLeft" | "navigateTopNavRight" | "openCommandPalette" | "selectSearchResult" | "toggleSidebar", KeyboardEvent>>>;
|
|
495
495
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EnvVariables } from '
|
|
1
|
+
import type { EnvVariables } from '../libs/env-helpers';
|
|
2
2
|
/** Parses the active environment variables and extracts key-value pairs. */
|
|
3
3
|
export declare function parseEnvVariables(activeEnvVariables: EnvVariables): {
|
|
4
4
|
key: string;
|
package/dist/libs/hot-keys.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HotkeyEventName } from '@scalar/oas-utils/entities/hotkeys';
|
|
2
2
|
import type { HotKeyConfig, HotKeyModifiers } from '@scalar/oas-utils/entities/workspace';
|
|
3
|
-
import type { EventBus } from '
|
|
3
|
+
import type { EventBus } from '../libs/index.js';
|
|
4
4
|
export type HotKeyEvent = Partial<Record<HotkeyEventName, KeyboardEvent>>;
|
|
5
5
|
/**
|
|
6
6
|
* Default set of keybindings
|
package/dist/libs/index.d.ts
CHANGED
|
@@ -12,5 +12,5 @@ export { loadAllResources } from './local-storage';
|
|
|
12
12
|
export { formatHeaderKey, normalizeHeaders } from './normalize-headers';
|
|
13
13
|
export { parseCurlCommand } from './parse-curl';
|
|
14
14
|
export { convertPostmanToOpenApi, getPostmanDocumentDetails, isPostmanCollection } from './postman';
|
|
15
|
-
export { type RequestStatus, buildRequestSecurity, createRequestOperation, decodeBuffer } from './send-request';
|
|
15
|
+
export { type RequestStatus, buildRequestSecurity, createRequestOperation, decodeBuffer } from './send-request/index.js';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/libs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as createApiClient, c as isPostmanCollection, d as handleHotKeyDown, f as isInput, g as getEnvColor, h as parseEnvVariables, l as DEFAULT_HOTKEYS, m as isUrl, o as convertPostmanToOpenApi, p as getOpenApiDocumentDetails, s as getPostmanDocumentDetails, u as getModifiers, v as loadAllResources, x as createEventBus, y as findRequestByPathMethod } from "../store-
|
|
1
|
+
import { _ as createApiClient, c as isPostmanCollection, d as handleHotKeyDown, f as isInput, g as getEnvColor, h as parseEnvVariables, l as DEFAULT_HOTKEYS, m as isUrl, o as convertPostmanToOpenApi, p as getOpenApiDocumentDetails, s as getPostmanDocumentDetails, u as getModifiers, v as loadAllResources, x as createEventBus, y as findRequestByPathMethod } from "../store-DnlAQK5d.js";
|
|
2
2
|
import { a as ERRORS, i as normalizeHeaders, n as decodeBuffer, o as normalizeError, r as formatHeaderKey, s as prettyErrorMessage, t as createRequestOperation } from "../send-request-BsTfRiBC.js";
|
|
3
3
|
import { n as formatMs, t as formatBytes } from "../formatters-DOGXZq9R.js";
|
|
4
4
|
import { t as parseCurlCommand } from "../parse-curl-BtypQT3D.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WorkspaceStore } from '
|
|
1
|
+
import type { WorkspaceStore } from '../store/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Loads all resources from localStorage and applies any migrations, then loads into mutators
|
|
4
4
|
* We use the raw mutator.add here instead of the custom ones because we do NOT want any side effects
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Cookie } from '@scalar/oas-utils/entities/cookie';
|
|
2
2
|
import type { Operation, RequestExample, ResponseInstance, SecurityScheme, Server } from '@scalar/oas-utils/entities/spec';
|
|
3
|
-
import { type ErrorResponse } from '
|
|
4
|
-
import type { EventBus } from '
|
|
5
|
-
import type { PluginManager } from '
|
|
3
|
+
import { type ErrorResponse } from '../../libs/errors';
|
|
4
|
+
import type { EventBus } from '../../libs/event-bus';
|
|
5
|
+
import type { PluginManager } from '../../plugins/index.js';
|
|
6
6
|
export type RequestStatus = 'start' | 'stop' | 'abort';
|
|
7
7
|
/** Response from sendRequest hoisted so we can use it as the return type for createRequestOperation */
|
|
8
8
|
type SendRequestResponse = ErrorResponse<{
|
|
@@ -3,12 +3,12 @@ import { i as isElectron } from "./set-request-cookies-BJJhsU4A.js";
|
|
|
3
3
|
import { i as isTextMediaType } from "./consts-CyGRb9dl.js";
|
|
4
4
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BmmBcIzD.js";
|
|
5
5
|
import { t as OpenApiClientButton_default } from "./components-ChixwQhN.js";
|
|
6
|
-
import { C as getDefaultHeaders, T as getExample, _ as serializeSimpleStyle, b as deSerializeParameter, f as serializeContentValue, g as serializePipeDelimitedStyle, h as serializeFormStyleForCookies, m as serializeFormStyle, o as generateClientOptions, p as serializeDeepObjectStyle, v as serializeSpaceDelimitedStyle, w as APP_VERSION, x as filterGlobalCookie, y as isParamDisabled } from "./operation-code-sample-
|
|
6
|
+
import { C as getDefaultHeaders, T as getExample, _ as serializeSimpleStyle, b as deSerializeParameter, f as serializeContentValue, g as serializePipeDelimitedStyle, h as serializeFormStyleForCookies, m as serializeFormStyle, o as generateClientOptions, p as serializeDeepObjectStyle, v as serializeSpaceDelimitedStyle, w as APP_VERSION, x as filterGlobalCookie, y as isParamDisabled } from "./operation-code-sample-DOzAPxLQ.js";
|
|
7
7
|
import { t as getResolvedUrl } from "./get-resolved-url-SybDPV0U.js";
|
|
8
8
|
import { n as getEnvironmentVariables } from "./get-server-url-UVN-dx79.js";
|
|
9
9
|
import { t as ViewLayout_default } from "./ViewLayout-BOXN0IYo.js";
|
|
10
10
|
import { t as ViewLayoutContent_default } from "./ViewLayoutContent-CvMoJYPF.js";
|
|
11
|
-
import { n as getExampleFromBody, r as getSelectedBodyContentType, t as RequestBlock_default } from "./request-block-
|
|
11
|
+
import { n as getExampleFromBody, r as getSelectedBodyContentType, t as RequestBlock_default } from "./request-block-C1kLLMEd.js";
|
|
12
12
|
import { r as isAuthOptional } from "./scalar-auth-selector-block-Bs79QOMA.js";
|
|
13
13
|
import { t as ResponseBlock_default } from "./response-block-DmkaDZYs.js";
|
|
14
14
|
import { t as AddressBar_default } from "./scalar-address-bar-block-BbysOhkE.js";
|
|
@@ -1671,4 +1671,4 @@ var OperationBlock_default = /* @__PURE__ */ defineComponent({
|
|
|
1671
1671
|
//#endregion
|
|
1672
1672
|
export { getSelectedServer as a, combineParams as c, mapHiddenClientsConfig as i, buildRequestSecurity as l, Operation_default as n, getSelectedSecurity as o, getActiveProxyUrl as r, getSecurityRequirements as s, OperationBlock_default as t, getSecuritySchemes as u };
|
|
1673
1673
|
|
|
1674
|
-
//# sourceMappingURL=operation-block-
|
|
1674
|
+
//# sourceMappingURL=operation-block-B1B3lJPx.js.map
|