@scalar/api-client 2.18.3 → 2.19.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 +56 -0
- package/dist/components/AddressBar/AddressBar.vue2.js +5 -5
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +6 -6
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +26 -28
- package/dist/components/ImportCollection/utils/get-openapi-version.d.ts.map +1 -1
- package/dist/components/ImportCollection/utils/import-collection.d.ts +1 -1
- package/dist/components/ImportCollection/utils/import-collection.d.ts.map +1 -1
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +16 -16
- package/dist/components/Server/index.d.ts +1 -1
- package/dist/components/Server/index.d.ts.map +1 -1
- package/dist/components/Server/index.js +6 -6
- package/dist/components/SideNav/SideNav.vue.js +3 -3
- package/dist/components/Sidebar/index.d.ts +1 -2
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useResponseBody.d.ts +1 -1
- package/dist/hooks/useResponseBody.d.ts.map +1 -1
- package/dist/hooks/useResponseBody.js +4 -4
- package/dist/hooks/useSidebar.d.ts +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +5 -5
- package/dist/layouts/App/MainLayout.vue.js +4 -4
- package/dist/layouts/App/create-api-client-app.d.ts +12 -12
- package/dist/layouts/App/index.d.ts +1 -1
- package/dist/layouts/App/index.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +6 -6
- package/dist/layouts/Web/create-api-client-web.d.ts +12 -12
- package/dist/layouts/Web/index.d.ts +1 -1
- package/dist/layouts/Web/index.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +12 -12
- package/dist/libs/get-request-uid-by-path-method.d.ts +1 -1
- package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -1
- package/dist/libs/hot-keys.d.ts +2 -2
- package/dist/libs/hot-keys.d.ts.map +1 -1
- package/dist/libs/importers/curl.d.ts.map +1 -1
- package/dist/libs/index.d.ts +14 -15
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +33 -33
- package/dist/libs/parse-curl.js +4 -4
- package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
- package/dist/libs/send-request/create-fetch-body.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-body.js +1 -1
- package/dist/libs/send-request/create-fetch-headers.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-query-params.js +2 -1
- package/dist/libs/send-request/index.d.ts +1 -1
- package/dist/libs/send-request/index.d.ts.map +1 -1
- package/dist/libs/send-request/index.js +4 -4
- package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.js +4 -4
- package/dist/store/active-entities.d.ts +1 -1
- package/dist/store/collections.d.ts +1 -1
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +4 -4
- package/dist/store/environment.d.ts +1 -1
- package/dist/store/environment.d.ts.map +1 -1
- package/dist/store/environment.js +4 -4
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/request-example.d.ts +1 -1
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +6 -6
- package/dist/store/requests.d.ts +1 -1
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +8 -8
- package/dist/store/security-schemes.d.ts +1 -1
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +4 -4
- package/dist/store/servers.d.ts +1 -1
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +4 -4
- package/dist/store/store.d.ts +12 -12
- package/dist/store/tags.d.ts +1 -1
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +5 -5
- package/dist/store/workspace.d.ts +13 -13
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +7 -7
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +4 -5
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +17 -16
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +3 -3
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +22 -22
- 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 +14 -13
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.js +43 -41
- package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +14 -0
- package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +14 -0
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +25 -0
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +17 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +10 -0
- 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 +29 -25
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +6 -1
- 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 +27 -23
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +10 -1
- 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 +48 -39
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +49 -46
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +6 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +200 -115
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +4 -4
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +21 -17
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +16 -10
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +32 -45
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +16 -13
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +4 -4
- package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +32 -33
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +33 -18
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +106 -106
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +10 -5
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +60 -31
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +41 -0
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +25 -0
- package/dist/v2/blocks/request-block/helpers/group-by.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/group-by.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-by.js +6 -3
- package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts +13 -0
- package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +7 -0
- 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 +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +61 -63
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -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/OAuth2.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -2
- 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/RequestAuthTab.vue.d.ts +2 -2
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +2 -0
- 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 +57 -51
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +31 -26
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +11 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +31 -32
- package/dist/v2/features/app/App.vue.d.ts +16 -2
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +53 -48
- package/dist/v2/features/app/app-events.d.ts +5 -9
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +146 -120
- package/dist/v2/features/app/app-state.d.ts +2 -1
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +77 -79
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +11 -1
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -75
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +5 -59
- 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 +9 -8
- package/dist/v2/features/app/index.d.ts +5 -1
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/app/index.js +8 -2
- 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 +21 -22
- package/dist/v2/features/modal/index.d.ts +1 -1
- package/dist/v2/features/modal/index.d.ts.map +1 -1
- package/dist/v2/features/modal/index.js +4 -4
- package/dist/v2/features/modal/modal-events.d.ts +13 -0
- package/dist/v2/features/modal/modal-events.d.ts.map +1 -0
- package/dist/v2/features/modal/modal-events.js +31 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +30 -43
- package/dist/v2/workspace-events.d.ts +25 -0
- package/dist/v2/workspace-events.d.ts.map +1 -0
- package/dist/v2/workspace-events.js +202 -0
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +3 -3
- package/dist/views/Environment/handle-drag.d.ts +1 -1
- package/dist/views/Environment/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +9 -9
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +4 -4
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +4 -4
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +5 -5
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +6 -6
- package/dist/views/Request/RequestSidebarItem.vue2.js +6 -6
- package/dist/views/Request/RequestSubpageHeader.vue2.js +4 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/index.d.ts +1 -1
- package/dist/views/Request/ResponseSection/index.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/index.js +4 -4
- package/dist/views/Request/consts/index.d.ts +2 -3
- package/dist/views/Request/consts/index.d.ts.map +1 -1
- package/dist/views/Request/consts/new-auth-options.d.ts +1 -1
- package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.d.ts +1 -1
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.d.ts.map +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.js +14 -14
- package/dist/views/Request/libs/auth.d.ts +1 -1
- package/dist/views/Request/libs/auth.d.ts.map +1 -1
- package/dist/views/Request/libs/index.d.ts +3 -3
- package/dist/views/Request/libs/index.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +1 -1
- package/dist/views/Request/libs/watch-mode.js +6 -6
- package/dist/views/Request/types/index.d.ts +1 -1
- package/dist/views/Request/types/index.d.ts.map +1 -1
- package/package.json +14 -14
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +0 -18
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +0 -1
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +0 -39
- package/dist/v2/features/operation/helpers/get-operation-header.js +0 -12
|
@@ -2,14 +2,14 @@ import { isDefined as C } from "@scalar/helpers/array/is-defined";
|
|
|
2
2
|
import { sortByOrder as $ } from "@scalar/helpers/array/sort-by-order";
|
|
3
3
|
import { isHttpMethod as H } from "@scalar/helpers/http/is-http-method";
|
|
4
4
|
import { createSidebarState as V, generateReverseIndex as Y } from "@scalar/sidebar";
|
|
5
|
-
import { createWorkspaceStore as
|
|
5
|
+
import { createWorkspaceStore as D } from "@scalar/workspace-store/client";
|
|
6
6
|
import { createWorkspaceEventBus as j } from "@scalar/workspace-store/events";
|
|
7
7
|
import { generateUniqueValue as q } from "@scalar/workspace-store/helpers/generate-unique-value";
|
|
8
8
|
import { getParentEntry as p } from "@scalar/workspace-store/navigation";
|
|
9
9
|
import { createWorkspaceStorePersistence as z } from "@scalar/workspace-store/persistence";
|
|
10
10
|
import { persistencePlugin as J } from "@scalar/workspace-store/plugins/client";
|
|
11
11
|
import { extensions as M } from "@scalar/workspace-store/schemas/extensions";
|
|
12
|
-
import {
|
|
12
|
+
import { shallowRef as g, computed as i, ref as u, watch as G } from "vue";
|
|
13
13
|
import { getActiveEnvironment as Q } from "../../helpers/get-active-environment.js";
|
|
14
14
|
import { getTabDetails as X } from "../../helpers/get-tab-details.js";
|
|
15
15
|
import { slugify as Z } from "../../helpers/slugify.js";
|
|
@@ -18,33 +18,33 @@ import { useCommandPaletteState as te } from "../command-palette/hooks/use-comma
|
|
|
18
18
|
import { initializeAppEventHandlers as ae } from "./app-events.js";
|
|
19
19
|
const ne = 1e3, m = j({
|
|
20
20
|
debug: !1
|
|
21
|
-
}),
|
|
21
|
+
}), x = u(void 0), v = u(void 0), R = u(void 0), A = u(void 0), U = u(void 0), d = u(!1), c = g(null);
|
|
22
22
|
G(c, (e) => {
|
|
23
23
|
e && e.afterEach((t) => we(t));
|
|
24
24
|
});
|
|
25
|
-
const f =
|
|
25
|
+
const f = i(() => c.value?.currentRoute.value ?? null);
|
|
26
26
|
function s(e, t) {
|
|
27
27
|
const a = t?.params[e];
|
|
28
28
|
if (typeof a == "string")
|
|
29
29
|
return e === "method" ? a && H(a) ? a : void 0 : decodeURIComponent(a);
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
31
|
+
const S = g(null), y = u([]), n = g(null), E = i(() => n.value?.workspace.documents[v.value ?? ""] || null), re = i(() => Q(n.value, E.value)), { workspace: h } = await z();
|
|
32
|
+
y.value = await h.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
|
|
33
|
+
const oe = async ({ workspaceId: e }) => D({
|
|
34
34
|
plugins: [await J({ workspaceId: e, debounceDelay: ne })]
|
|
35
35
|
}), se = async (e) => {
|
|
36
|
-
const t = await
|
|
36
|
+
const t = await h.getItem(e);
|
|
37
37
|
if (!t)
|
|
38
38
|
return {
|
|
39
39
|
success: !1
|
|
40
40
|
};
|
|
41
|
-
const a = await
|
|
42
|
-
return a.loadWorkspace(t.workspace),
|
|
41
|
+
const a = await oe({ workspaceId: e });
|
|
42
|
+
return a.loadWorkspace(t.workspace), S.value = { id: e, label: t.name }, n.value = a, {
|
|
43
43
|
success: !0,
|
|
44
44
|
workspace: a.workspace
|
|
45
45
|
};
|
|
46
46
|
}, ce = async ({ id: e, name: t }) => {
|
|
47
|
-
const a =
|
|
47
|
+
const a = D();
|
|
48
48
|
await a.addDocument({
|
|
49
49
|
name: "drafts",
|
|
50
50
|
document: {
|
|
@@ -61,10 +61,10 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
61
61
|
"x-scalar-original-document-hash": "drafts",
|
|
62
62
|
"x-scalar-icon": "interface-edit-tool-pencil"
|
|
63
63
|
}
|
|
64
|
-
}), await
|
|
64
|
+
}), await h.setItem(e, {
|
|
65
65
|
name: t,
|
|
66
66
|
workspace: a.exportWorkspace()
|
|
67
|
-
}),
|
|
67
|
+
}), y.value.push({ id: e, label: t });
|
|
68
68
|
}, B = async (e) => {
|
|
69
69
|
e && await c.value?.push({
|
|
70
70
|
name: "workspace.environment",
|
|
@@ -78,22 +78,22 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
78
78
|
const a = await q({
|
|
79
79
|
defaultValue: e ?? t,
|
|
80
80
|
// Use the provided id if it exists, otherwise use the name
|
|
81
|
-
validation: async (
|
|
81
|
+
validation: async (l) => !await h.has(l),
|
|
82
82
|
maxRetries: 100,
|
|
83
83
|
transformation: Z
|
|
84
84
|
});
|
|
85
85
|
if (!a)
|
|
86
86
|
return;
|
|
87
|
-
const
|
|
88
|
-
return await ce(
|
|
89
|
-
},
|
|
87
|
+
const o = { id: a, name: t };
|
|
88
|
+
return await ce(o), await B(a), o;
|
|
89
|
+
}, ie = async (e) => {
|
|
90
90
|
n.value = null, d.value = !0;
|
|
91
91
|
const t = await se(e);
|
|
92
92
|
if (t.success) {
|
|
93
|
-
const
|
|
94
|
-
W && await c.value?.replace(W.path),
|
|
93
|
+
const o = t.workspace["x-scalar-active-tab"] ?? 0, l = t.workspace["x-scalar-tabs"], W = l?.[o];
|
|
94
|
+
W && await c.value?.replace(W.path), l && o >= l.length && m.emit("tabs:update:tabs", {
|
|
95
95
|
"x-scalar-active-tab": 0
|
|
96
|
-
}),
|
|
96
|
+
}), l || m.emit("tabs:update:tabs", {
|
|
97
97
|
"x-scalar-tabs": [I(f.value)],
|
|
98
98
|
"x-scalar-active-tab": 0
|
|
99
99
|
}), d.value = !1;
|
|
@@ -105,26 +105,26 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
105
105
|
});
|
|
106
106
|
if (d.value = !1, !a)
|
|
107
107
|
return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
|
|
108
|
-
|
|
109
|
-
}, O =
|
|
108
|
+
r.reset();
|
|
109
|
+
}, O = i(() => {
|
|
110
110
|
const e = n.value;
|
|
111
111
|
if (!e)
|
|
112
112
|
return [];
|
|
113
113
|
const t = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
|
|
114
114
|
return $(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(C);
|
|
115
|
-
}),
|
|
115
|
+
}), r = V(O), b = ({
|
|
116
116
|
document: e,
|
|
117
117
|
path: t,
|
|
118
118
|
method: a,
|
|
119
|
-
example:
|
|
120
|
-
}) => JSON.stringify([e, t, a,
|
|
119
|
+
example: o
|
|
120
|
+
}) => JSON.stringify([e, t, a, o].filter(C)), T = i(
|
|
121
121
|
() => Y({
|
|
122
122
|
items: O.value,
|
|
123
123
|
nestedKey: "children",
|
|
124
124
|
filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
|
|
125
125
|
getId: (e) => {
|
|
126
126
|
const t = p("document", e), a = p("operation", e);
|
|
127
|
-
return
|
|
127
|
+
return b({
|
|
128
128
|
document: t?.name ?? "",
|
|
129
129
|
path: a?.path,
|
|
130
130
|
method: a?.method,
|
|
@@ -132,33 +132,33 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
})
|
|
135
|
-
),
|
|
136
|
-
const t = T.value.get(
|
|
135
|
+
), w = (e) => {
|
|
136
|
+
const t = T.value.get(b(e));
|
|
137
137
|
return t || T.value.get(
|
|
138
|
-
|
|
138
|
+
b({
|
|
139
139
|
document: e.document,
|
|
140
140
|
path: e.path,
|
|
141
141
|
method: e.method
|
|
142
142
|
})
|
|
143
143
|
);
|
|
144
144
|
}, L = (e) => {
|
|
145
|
-
const t =
|
|
145
|
+
const t = r.getEntryById(e);
|
|
146
146
|
if (!t) {
|
|
147
147
|
console.warn(`Could not find sidebar entry with id ${e} to select`);
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
if (t.type === "document")
|
|
151
|
-
return
|
|
151
|
+
return r.setSelected(e), r.setExpanded(e, !r.isExpanded(e)), c.value?.push({
|
|
152
152
|
name: "document.overview",
|
|
153
153
|
params: { documentSlug: t.name }
|
|
154
154
|
});
|
|
155
155
|
if (t.type === "operation") {
|
|
156
|
-
if (
|
|
157
|
-
|
|
156
|
+
if (r.isSelected(e)) {
|
|
157
|
+
r.setExpanded(e, !r.isExpanded(e));
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
const a = t.children?.find((
|
|
161
|
-
return a ? (
|
|
160
|
+
const a = t.children?.find((o) => o.type === "example");
|
|
161
|
+
return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e), c.value?.push({
|
|
162
162
|
name: "example",
|
|
163
163
|
params: {
|
|
164
164
|
documentSlug: p("document", t)?.name,
|
|
@@ -169,7 +169,7 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
if (t.type === "example") {
|
|
172
|
-
|
|
172
|
+
r.setSelected(e), r.setExpanded(e, !0);
|
|
173
173
|
const a = p("operation", t);
|
|
174
174
|
return c.value?.push({
|
|
175
175
|
name: "example",
|
|
@@ -188,39 +188,39 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
188
188
|
documentSlug: p("document", t)?.name
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
|
-
|
|
192
|
-
},
|
|
191
|
+
r.setExpanded(e, !r.isExpanded(e));
|
|
192
|
+
}, le = async () => {
|
|
193
193
|
if (!n.value)
|
|
194
194
|
return;
|
|
195
195
|
const e = n.value.workspace["x-scalar-active-tab"] ?? 0, t = n.value.workspace["x-scalar-tabs"]?.[e];
|
|
196
196
|
t && await c.value?.replace(t.path);
|
|
197
|
-
},
|
|
197
|
+
}, N = (e) => {
|
|
198
198
|
e && n.value?.buildSidebar(e);
|
|
199
|
-
},
|
|
200
|
-
const t =
|
|
199
|
+
}, ue = (e) => {
|
|
200
|
+
const t = E.value?.["x-scalar-navigation"]?.name;
|
|
201
201
|
if (!t)
|
|
202
202
|
return;
|
|
203
|
-
const a =
|
|
203
|
+
const a = w({
|
|
204
204
|
document: t,
|
|
205
205
|
path: e.path,
|
|
206
206
|
method: e.method,
|
|
207
207
|
example: e.exampleKey
|
|
208
208
|
});
|
|
209
|
-
(!a || a.type !== "example") &&
|
|
210
|
-
}, pe = 288, de =
|
|
211
|
-
const t = s("method", e), a = s("pathEncoded", e),
|
|
209
|
+
(!a || a.type !== "example") && N(t);
|
|
210
|
+
}, pe = 288, de = i(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? pe), me = (e) => n.value?.update("x-scalar-sidebar-width", e), k = u(!0), ve = "x-scalar-tabs", fe = "x-scalar-active-tab", I = (e) => {
|
|
211
|
+
const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), l = s("workspaceSlug", e);
|
|
212
212
|
return {
|
|
213
213
|
...X({
|
|
214
|
-
workspace:
|
|
215
|
-
document:
|
|
214
|
+
workspace: l,
|
|
215
|
+
document: o,
|
|
216
216
|
path: a,
|
|
217
217
|
method: t,
|
|
218
|
-
getEntryByLocation:
|
|
218
|
+
getEntryByLocation: w
|
|
219
219
|
}),
|
|
220
220
|
path: f.value?.path ?? ""
|
|
221
221
|
};
|
|
222
|
-
},
|
|
223
|
-
const t =
|
|
222
|
+
}, _ = i(() => n.value?.workspace[ve] ?? [I(f.value)]), he = i(() => n.value?.workspace[fe] ?? 0), F = async (e) => {
|
|
223
|
+
const t = _.value[e];
|
|
224
224
|
if (!t) {
|
|
225
225
|
console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
|
|
226
226
|
return;
|
|
@@ -228,72 +228,70 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
228
228
|
const a = `${window.location.origin}${t.path}`;
|
|
229
229
|
try {
|
|
230
230
|
await navigator.clipboard.writeText(a);
|
|
231
|
-
} catch (
|
|
232
|
-
console.error("Failed to copy URL to clipboard:",
|
|
231
|
+
} catch (o) {
|
|
232
|
+
console.error("Failed to copy URL to clipboard:", o);
|
|
233
233
|
}
|
|
234
234
|
}, we = (e) => {
|
|
235
|
-
console.log({ message: "handleRouteChange", to: e });
|
|
236
235
|
const t = s("workspaceSlug", e), a = s("documentSlug", e);
|
|
237
|
-
if (
|
|
238
|
-
if (e.path !== "" && ee.setCurrentPath(e.path), t !==
|
|
239
|
-
return
|
|
236
|
+
if (x.value = t, v.value = a, R.value = s("method", e), A.value = s("pathEncoded", e), U.value = s("exampleName", e), !!t) {
|
|
237
|
+
if (e.path !== "" && ee.setCurrentPath(e.path), t !== S.value?.id)
|
|
238
|
+
return ie(t);
|
|
240
239
|
if (a && a !== n.value?.workspace[M.workspace.activeDocument])
|
|
241
240
|
return n?.value?.update("x-scalar-active-document", a);
|
|
242
241
|
xe(e), be(e);
|
|
243
242
|
}
|
|
244
243
|
}, xe = (e) => {
|
|
245
|
-
const t = n.value?.workspace["x-scalar-tabs"] ?? [], a = n.value?.workspace["x-scalar-active-tab"] ?? 0,
|
|
246
|
-
!
|
|
244
|
+
const t = n.value?.workspace["x-scalar-tabs"] ?? [], a = n.value?.workspace["x-scalar-active-tab"] ?? 0, o = t[a];
|
|
245
|
+
!o || o.path === e.path || (t[a] = I(e));
|
|
247
246
|
}, be = (e) => {
|
|
248
247
|
const t = s("documentSlug", e);
|
|
249
248
|
if (!t) {
|
|
250
|
-
|
|
249
|
+
r.setSelected(null);
|
|
251
250
|
return;
|
|
252
251
|
}
|
|
253
|
-
const a =
|
|
252
|
+
const a = w({
|
|
254
253
|
document: t,
|
|
255
254
|
path: s("pathEncoded", e),
|
|
256
255
|
method: s("method", e),
|
|
257
256
|
example: s("exampleName", e)
|
|
258
257
|
});
|
|
259
|
-
a && (
|
|
258
|
+
a && (r.setSelected(a.id), r.setExpanded(a.id, !0));
|
|
260
259
|
}, K = te();
|
|
261
260
|
ae({
|
|
262
261
|
eventBus: m,
|
|
263
262
|
router: c,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
onAfterExampleCreation: ie,
|
|
263
|
+
store: n,
|
|
264
|
+
navigateToCurrentTab: le,
|
|
265
|
+
rebuildSidebar: N,
|
|
266
|
+
onAfterExampleCreation: ue,
|
|
269
267
|
onOpenCommandPalette: K.open,
|
|
270
268
|
onSelectSidebarItem: L,
|
|
271
269
|
onCopyTabUrl: (e) => F(e),
|
|
272
270
|
onToggleSidebar: () => k.value = !k.value
|
|
273
271
|
});
|
|
274
|
-
function
|
|
275
|
-
return {
|
|
272
|
+
function _e(e) {
|
|
273
|
+
return e && (c.value = e), {
|
|
276
274
|
/** Active workspace store */
|
|
277
275
|
store: n,
|
|
278
276
|
sidebar: {
|
|
279
|
-
state:
|
|
277
|
+
state: r,
|
|
280
278
|
width: de,
|
|
281
279
|
isOpen: k,
|
|
282
280
|
handleSelectItem: L,
|
|
283
281
|
handleSidebarWidthUpdate: me,
|
|
284
|
-
getEntryByLocation:
|
|
282
|
+
getEntryByLocation: w
|
|
285
283
|
},
|
|
286
284
|
tabs: {
|
|
287
|
-
state:
|
|
285
|
+
state: _,
|
|
288
286
|
activeTabIndex: he,
|
|
289
287
|
copyTabUrl: F
|
|
290
288
|
},
|
|
291
289
|
workspace: {
|
|
292
290
|
create: P,
|
|
293
|
-
workspaceList:
|
|
294
|
-
activeWorkspace:
|
|
291
|
+
workspaceList: y,
|
|
292
|
+
activeWorkspace: S,
|
|
295
293
|
setId: B,
|
|
296
|
-
isOpen:
|
|
294
|
+
isOpen: i(() => !!(x.value && !v.value))
|
|
297
295
|
},
|
|
298
296
|
commandPalette: K,
|
|
299
297
|
eventBus: m,
|
|
@@ -301,16 +299,16 @@ function Ne() {
|
|
|
301
299
|
currentRoute: f,
|
|
302
300
|
loading: d,
|
|
303
301
|
activeEntities: {
|
|
304
|
-
workspaceSlug:
|
|
302
|
+
workspaceSlug: x,
|
|
305
303
|
documentSlug: v,
|
|
306
304
|
path: A,
|
|
307
|
-
method:
|
|
305
|
+
method: R,
|
|
308
306
|
exampleName: U
|
|
309
307
|
},
|
|
310
|
-
environment:
|
|
311
|
-
document:
|
|
308
|
+
environment: re,
|
|
309
|
+
document: E
|
|
312
310
|
};
|
|
313
311
|
}
|
|
314
312
|
export {
|
|
315
|
-
|
|
313
|
+
_e as useAppState
|
|
316
314
|
};
|
|
@@ -41,13 +41,17 @@ type __VLS_Props = {
|
|
|
41
41
|
*/
|
|
42
42
|
store: WorkspaceStore;
|
|
43
43
|
};
|
|
44
|
+
type __VLS_Slots = {
|
|
45
|
+
/** Slot for customizing the actions section of the sidebar menu. */
|
|
46
|
+
sidebarMenuActions?(): unknown;
|
|
47
|
+
};
|
|
44
48
|
type __VLS_PublicProps = __VLS_Props & {
|
|
45
49
|
/** Controls the visibility of the sidebar */
|
|
46
50
|
'isSidebarOpen': boolean;
|
|
47
51
|
/** Controls the width of the sidebar */
|
|
48
52
|
'sidebarWidth': number;
|
|
49
53
|
};
|
|
50
|
-
declare const
|
|
54
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
51
55
|
"update:sidebarWidth": (value: number) => any;
|
|
52
56
|
"update:isSidebarOpen": (value: boolean) => any;
|
|
53
57
|
} & {
|
|
@@ -63,5 +67,11 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
63
67
|
"onClick:workspace"?: (() => any) | undefined;
|
|
64
68
|
"onUpdate:isSidebarOpen"?: ((value: boolean) => any) | undefined;
|
|
65
69
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
70
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
66
71
|
export default _default;
|
|
72
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
73
|
+
new (): {
|
|
74
|
+
$slots: S;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
67
77
|
//# sourceMappingURL=AppSidebar.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAwcA,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAA;AAM3B,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACf;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C;;;OAGG;IACH,UAAU,EAAE,mBAAmB,EAAE,CAAA;IACjC;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAgBJ,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAmLF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAqcF,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-59eb2624"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|