@scalar/api-client 2.26.1 → 2.27.1
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 +102 -0
- package/dist/components/Server/ServerSelector.vue.js +6 -6
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +6 -6
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +48 -43
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -10
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +29 -25
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +15 -15
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +10 -0
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +4 -0
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +1 -1
- 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 +101 -100
- 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 +62 -69
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +6 -6
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +36 -2
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +38 -3
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +68 -69
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -40
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +35 -41
- 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 +37 -41
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +3 -2
- 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/OAuth2.vue.js +107 -87
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +21 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +91 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +4 -0
- 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 +107 -93
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +87 -65
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +36 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +35 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +18 -10
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +5 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +27 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +3 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +29 -37
- package/dist/v2/components/layout/CollapsibleSection.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.d.ts +2 -2
- package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue2.js +45 -42
- 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 +25 -24
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +30 -30
- package/dist/v2/features/app/App.vue.d.ts +6 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +48 -46
- package/dist/v2/features/app/app-events.d.ts +1 -1
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +95 -56
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue2.js +111 -105
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +12 -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 +12 -10
- package/dist/v2/features/app/helpers/routes.d.ts +3 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-theme.d.ts +42 -0
- package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-theme.js +34 -0
- package/dist/v2/features/app/index.d.ts +0 -1
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +27 -26
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +13 -12
- 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 +49 -40
- package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.js +26 -13
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +27 -15
- package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.js +2 -2
- package/dist/v2/features/collection/components/Overview.vue2.js +68 -61
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js +93 -88
- package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Settings.vue.js +19 -17
- package/dist/v2/features/environments/EnvironmentsList.vue.js +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +2 -2
- package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +8 -8
- package/dist/v2/features/modal/Modal.vue.d.ts +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +15 -15
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +31 -34
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts +10 -7
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/CollectionSettings.vue.js +183 -149
- package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/DocumentSettings.vue.js +88 -79
- package/dist/v2/features/settings/components/Section.vue.d.ts +2 -1
- package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/components/Section.vue.js +26 -15
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +4 -3
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +1 -1
- package/dist/v2/features/settings/helpers/get-theme-colors.js +6 -7
- package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +2 -2
- package/dist/v2/helpers/index.d.ts +0 -1
- package/dist/v2/helpers/index.d.ts.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.d.ts +3 -1
- package/dist/v2/hooks/use-global-hot-keys.d.ts.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.js +8 -6
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +10 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +139 -155
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +104 -101
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +20 -18
- package/dist/v2/helpers/plugins.d.ts +0 -65
- package/dist/v2/helpers/plugins.d.ts.map +0 -1
- package/dist/v2/helpers/plugins.js +0 -11
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { extensions as _ } from "@scalar/workspace-store/schemas/extensions";
|
|
1
|
+
import { defineComponent as b, computed as T, createBlock as m, openBlock as i, unref as t, withCtx as p, createElementVNode as l, createVNode as r, createElementBlock as u, renderSlot as d, createCommentVNode as v, normalizeProps as y, guardReactiveProps as W } from "vue";
|
|
2
|
+
import { useModal as g, ScalarTeleportRoot as x } from "@scalar/components";
|
|
3
|
+
import { ScalarToasts as B } from "@scalar/use-toasts";
|
|
4
|
+
import { extensions as C } from "@scalar/workspace-store/schemas/extensions";
|
|
6
5
|
import { RouterView as E } from "vue-router";
|
|
7
6
|
import A from "./components/CreateWorkspaceModal.vue.js";
|
|
8
7
|
import O from "./components/SplashScreen.vue.js";
|
|
9
8
|
import { useDocumentWatcher as M } from "./hooks/use-document-watcher.js";
|
|
10
|
-
import U from "
|
|
9
|
+
import { useTheme as U } from "./hooks/use-theme.js";
|
|
10
|
+
import _ from "../command-palette/TheCommandPalette.vue.js";
|
|
11
11
|
import { useColorMode as D } from "../../hooks/use-color-mode.js";
|
|
12
12
|
import { useGlobalHotKeys as I } from "../../hooks/use-global-hot-keys.js";
|
|
13
13
|
import N from "./components/AppSidebar.vue.js";
|
|
14
14
|
import P from "./components/DesktopTabs.vue.js";
|
|
15
|
-
import
|
|
16
|
-
import { mergeSecurity as
|
|
17
|
-
const
|
|
15
|
+
import H from "./components/DownloadAppButton.vue.js";
|
|
16
|
+
import { mergeSecurity as L } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
|
|
17
|
+
const V = ["innerHTML"], $ = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 flex-col" }, R = { class: "flex min-h-0 flex-1 flex-row" }, G = { class: "flex flex-1 flex-col" }, j = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "flex h-12 items-center justify-end border-b p-2"
|
|
20
|
-
}, z = { class: "bg-b-1 min-h-0 flex-1" }, K = { key: 1 }, q = {},
|
|
20
|
+
}, z = { class: "bg-b-1 min-h-0 flex-1" }, K = { key: 1 }, q = {}, pe = /* @__PURE__ */ b({
|
|
21
21
|
...q,
|
|
22
22
|
__name: "App",
|
|
23
23
|
props: {
|
|
24
24
|
layout: {},
|
|
25
25
|
plugins: { default: () => [] },
|
|
26
|
+
customThemes: { default: () => [] },
|
|
27
|
+
fallbackThemeSlug: { default: "default" },
|
|
26
28
|
getAppState: { type: Function },
|
|
27
29
|
getCommandPaletteState: { type: Function }
|
|
28
30
|
},
|
|
29
|
-
setup(
|
|
30
|
-
|
|
31
|
+
setup(a, { expose: k }) {
|
|
32
|
+
k({
|
|
31
33
|
openCreateWorkspace: () => c.show()
|
|
32
34
|
});
|
|
33
|
-
const e =
|
|
34
|
-
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), I(e.eventBus,
|
|
35
|
-
documentName: () => e.store.value?.workspace[
|
|
35
|
+
const e = a.getAppState(), f = a.getCommandPaletteState();
|
|
36
|
+
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), I(e.eventBus, a.layout), M({
|
|
37
|
+
documentName: () => e.store.value?.workspace[C.workspace.activeDocument],
|
|
36
38
|
store: e.store,
|
|
37
39
|
initialTimeout: 5e3
|
|
38
40
|
}), D({ workspaceStore: e.store });
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (!a)
|
|
41
|
+
const { themeStyleTag: w } = U({
|
|
42
|
+
fallbackThemeSlug: () => a.fallbackThemeSlug,
|
|
43
|
+
customThemes: () => a.customThemes,
|
|
44
|
+
store: e.store
|
|
45
|
+
}), h = (s) => {
|
|
46
|
+
if (!s)
|
|
46
47
|
return;
|
|
47
48
|
const o = e.workspace.workspaceList.value?.find(
|
|
48
|
-
(n) => n.id ===
|
|
49
|
+
(n) => n.id === s
|
|
49
50
|
);
|
|
50
51
|
o && e.workspace.navigateToWorkspace(o.namespace, o.slug);
|
|
51
|
-
}, c =
|
|
52
|
-
const
|
|
52
|
+
}, c = g(), S = T(() => {
|
|
53
|
+
const s = e.store.value?.auth ? L(
|
|
53
54
|
e.document.value?.components?.securitySchemes ?? {},
|
|
54
55
|
{},
|
|
55
56
|
e.store.value.auth,
|
|
@@ -61,27 +62,28 @@ const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
|
|
|
61
62
|
environment: e.environment.value,
|
|
62
63
|
eventBus: e.eventBus,
|
|
63
64
|
exampleName: e.activeEntities.exampleName.value,
|
|
64
|
-
layout:
|
|
65
|
+
layout: a.layout,
|
|
65
66
|
method: e.activeEntities.method.value,
|
|
66
67
|
path: e.activeEntities.path.value,
|
|
67
68
|
workspaceStore: e.store.value,
|
|
68
69
|
activeWorkspace: e.workspace.activeWorkspace.value,
|
|
69
|
-
plugins:
|
|
70
|
-
securitySchemes:
|
|
70
|
+
plugins: a.plugins,
|
|
71
|
+
securitySchemes: s,
|
|
72
|
+
customThemes: a.customThemes
|
|
71
73
|
};
|
|
72
74
|
});
|
|
73
|
-
return (
|
|
74
|
-
default:
|
|
75
|
-
l("div", { innerHTML:
|
|
76
|
-
r(t(
|
|
77
|
-
t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), u("main",
|
|
75
|
+
return (s, o) => (i(), m(t(x), null, {
|
|
76
|
+
default: p(() => [
|
|
77
|
+
l("div", { innerHTML: t(w) }, null, 8, V),
|
|
78
|
+
r(t(B)),
|
|
79
|
+
t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), u("main", $, [
|
|
78
80
|
l("div", F, [
|
|
79
|
-
|
|
81
|
+
a.layout === "desktop" ? (i(), m(P, {
|
|
80
82
|
key: 0,
|
|
81
83
|
activeTabIndex: t(e).tabs.activeTabIndex.value,
|
|
82
84
|
eventBus: t(e).eventBus,
|
|
83
85
|
tabs: t(e).tabs.state.value
|
|
84
|
-
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) :
|
|
86
|
+
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : v("", !0),
|
|
85
87
|
l("div", R, [
|
|
86
88
|
r(N, {
|
|
87
89
|
isSidebarOpen: t(e).sidebar.isOpen.value,
|
|
@@ -89,7 +91,7 @@ const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
|
|
|
89
91
|
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
90
92
|
eventBus: t(e).eventBus,
|
|
91
93
|
isWorkspaceOpen: t(e).workspace.isOpen.value,
|
|
92
|
-
layout:
|
|
94
|
+
layout: a.layout,
|
|
93
95
|
sidebarState: t(e).sidebar.state,
|
|
94
96
|
sidebarWidth: t(e).sidebar.width.value,
|
|
95
97
|
store: t(e).store.value,
|
|
@@ -100,30 +102,30 @@ const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
|
|
|
100
102
|
onSelectItem: t(e).sidebar.handleSelectItem,
|
|
101
103
|
"onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
|
|
102
104
|
}, {
|
|
103
|
-
sidebarMenuActions:
|
|
104
|
-
|
|
105
|
+
sidebarMenuActions: p(() => [
|
|
106
|
+
d(s.$slots, "sidebar-menu-actions")
|
|
105
107
|
]),
|
|
106
108
|
_: 3
|
|
107
109
|
}, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
|
|
108
110
|
l("div", G, [
|
|
109
|
-
|
|
110
|
-
r(
|
|
111
|
-
])) :
|
|
111
|
+
a.layout === "web" ? (i(), u("nav", j, [
|
|
112
|
+
r(H)
|
|
113
|
+
])) : v("", !0),
|
|
112
114
|
l("div", z, [
|
|
113
|
-
r(t(E),
|
|
115
|
+
r(t(E), y(W(S.value)), null, 16)
|
|
114
116
|
])
|
|
115
117
|
])
|
|
116
118
|
])
|
|
117
119
|
]),
|
|
118
|
-
|
|
120
|
+
d(s.$slots, "create-workspace", { state: t(c) }, () => [
|
|
119
121
|
r(A, {
|
|
120
122
|
state: t(c),
|
|
121
123
|
"onCreate:workspace": o[2] || (o[2] = (n) => t(e).workspace.create(n))
|
|
122
124
|
}, null, 8, ["state"])
|
|
123
125
|
]),
|
|
124
|
-
r(
|
|
126
|
+
r(_, {
|
|
125
127
|
eventBus: t(e).eventBus,
|
|
126
|
-
paletteState: t(
|
|
128
|
+
paletteState: t(f),
|
|
127
129
|
workspaceStore: t(e).store.value
|
|
128
130
|
}, null, 8, ["eventBus", "paletteState", "workspaceStore"])
|
|
129
131
|
])) : (i(), u("main", K, [
|
|
@@ -135,5 +137,5 @@ const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 f
|
|
|
135
137
|
}
|
|
136
138
|
});
|
|
137
139
|
export {
|
|
138
|
-
|
|
140
|
+
pe as default
|
|
139
141
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
2
|
import type { OperationExampleMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
3
|
import { type ShallowRef } from 'vue';
|
|
4
|
-
import type
|
|
4
|
+
import { type Router } from 'vue-router';
|
|
5
5
|
export declare function initializeAppEventHandlers({ eventBus, store, router, rebuildSidebar, navigateToCurrentTab, onSelectSidebarItem, onAfterExampleCreation, onCopyTabUrl, onToggleSidebar, }: {
|
|
6
6
|
eventBus: WorkspaceEventBus;
|
|
7
7
|
store: ShallowRef<WorkspaceStore | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAC7F,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,KAAK,CAAA;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"app-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAC7F,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAiD,KAAK,MAAM,EAAE,MAAM,YAAY,CAAA;AAKvF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,UAAU,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,sBAAsB,EAAE,CAAC,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B,QAkRA"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { computed as x } from "vue";
|
|
2
|
+
import { NavigationFailureType as w } from "vue-router";
|
|
3
|
+
import { initializeWorkspaceEventHandlers as g } from "../../workspace-events.js";
|
|
4
|
+
function A({
|
|
5
|
+
eventBus: s,
|
|
5
6
|
store: r,
|
|
6
|
-
router:
|
|
7
|
-
rebuildSidebar:
|
|
8
|
-
navigateToCurrentTab:
|
|
9
|
-
onSelectSidebarItem:
|
|
10
|
-
onAfterExampleCreation:
|
|
11
|
-
onCopyTabUrl:
|
|
12
|
-
onToggleSidebar:
|
|
7
|
+
router: n,
|
|
8
|
+
rebuildSidebar: u,
|
|
9
|
+
navigateToCurrentTab: m,
|
|
10
|
+
onSelectSidebarItem: f,
|
|
11
|
+
onAfterExampleCreation: i,
|
|
12
|
+
onCopyTabUrl: h,
|
|
13
|
+
onToggleSidebar: l
|
|
13
14
|
}) {
|
|
14
|
-
const
|
|
15
|
+
const o = x(() => n.currentRoute?.value), p = ({
|
|
15
16
|
documentName: e,
|
|
16
17
|
path: a,
|
|
17
18
|
method: t,
|
|
18
|
-
exampleName:
|
|
19
|
-
}) => !(e !== void 0 && e !==
|
|
20
|
-
|
|
21
|
-
eventBus:
|
|
19
|
+
exampleName: c
|
|
20
|
+
}) => !(e !== void 0 && e !== o.value?.params.documentSlug || a !== void 0 && encodeURIComponent(a) !== o.value?.params.pathEncoded || t !== void 0 && t !== o.value?.params.method || c !== void 0 && c !== o.value?.params.exampleName);
|
|
21
|
+
g({
|
|
22
|
+
eventBus: s,
|
|
22
23
|
store: r,
|
|
23
24
|
hooks: {
|
|
24
25
|
//------------------------------------------------------------------------------------
|
|
@@ -26,7 +27,7 @@ function N({
|
|
|
26
27
|
//------------------------------------------------------------------------------------
|
|
27
28
|
"document:delete:document": {
|
|
28
29
|
onAfterExecute: async (e) => {
|
|
29
|
-
|
|
30
|
+
o?.value?.params.documentSlug === e.name && await n.push({
|
|
30
31
|
name: "workspace.environment"
|
|
31
32
|
});
|
|
32
33
|
}
|
|
@@ -38,38 +39,38 @@ function N({
|
|
|
38
39
|
onBeforeExecute: (e) => ({
|
|
39
40
|
...e,
|
|
40
41
|
callback: async (a) => {
|
|
41
|
-
a === "success" && (await
|
|
42
|
+
a === "success" && (await n.replace({
|
|
42
43
|
name: "example",
|
|
43
44
|
params: {
|
|
44
45
|
method: e.payload.method,
|
|
45
46
|
pathEncoded: encodeURIComponent(e.payload.path),
|
|
46
|
-
exampleName:
|
|
47
|
+
exampleName: o.value?.params.exampleName
|
|
47
48
|
}
|
|
48
|
-
}),
|
|
49
|
+
}), u(r.value?.workspace.activeDocument?.["x-scalar-navigation"]?.name)), e.callback(a);
|
|
49
50
|
}
|
|
50
51
|
})
|
|
51
52
|
},
|
|
52
53
|
"operation:upsert:parameter": {
|
|
53
|
-
onAfterExecute: (e) =>
|
|
54
|
+
onAfterExecute: (e) => i(e.meta)
|
|
54
55
|
},
|
|
55
56
|
"operation:update:extra-parameters": {
|
|
56
|
-
onAfterExecute: (e) =>
|
|
57
|
+
onAfterExecute: (e) => i(e.meta)
|
|
57
58
|
},
|
|
58
59
|
"operation:reload:history": {
|
|
59
|
-
onAfterExecute: (e) =>
|
|
60
|
+
onAfterExecute: (e) => i({ ...e.meta, exampleKey: "draft" })
|
|
60
61
|
},
|
|
61
62
|
"operation:delete:operation": {
|
|
62
63
|
onAfterExecute: async (e) => {
|
|
63
|
-
|
|
64
|
+
u(e.documentName);
|
|
64
65
|
const {
|
|
65
66
|
documentName: a,
|
|
66
|
-
meta: { path: t, method:
|
|
67
|
+
meta: { path: t, method: c }
|
|
67
68
|
} = e;
|
|
68
|
-
|
|
69
|
+
p({
|
|
69
70
|
documentName: a,
|
|
70
71
|
path: t,
|
|
71
|
-
method:
|
|
72
|
-
}) && await
|
|
72
|
+
method: c
|
|
73
|
+
}) && await n.replace({
|
|
73
74
|
name: "document.overview",
|
|
74
75
|
params: {
|
|
75
76
|
documentSlug: a
|
|
@@ -79,21 +80,21 @@ function N({
|
|
|
79
80
|
},
|
|
80
81
|
"operation:delete:example": {
|
|
81
82
|
onAfterExecute: async (e) => {
|
|
82
|
-
|
|
83
|
+
u(e.documentName);
|
|
83
84
|
const {
|
|
84
85
|
documentName: a,
|
|
85
|
-
meta: { path: t, method:
|
|
86
|
+
meta: { path: t, method: c, exampleKey: d }
|
|
86
87
|
} = e;
|
|
87
|
-
|
|
88
|
+
p({
|
|
88
89
|
documentName: a,
|
|
89
90
|
path: t,
|
|
90
|
-
method:
|
|
91
|
-
exampleName:
|
|
92
|
-
}) && await
|
|
91
|
+
method: c,
|
|
92
|
+
exampleName: d
|
|
93
|
+
}) && await n.replace({
|
|
93
94
|
name: "example",
|
|
94
95
|
params: {
|
|
95
96
|
pathEncoded: encodeURIComponent(t),
|
|
96
|
-
method:
|
|
97
|
+
method: c,
|
|
97
98
|
documentSlug: a,
|
|
98
99
|
exampleName: "default"
|
|
99
100
|
}
|
|
@@ -104,55 +105,93 @@ function N({
|
|
|
104
105
|
// Operation Request Body Related Hooks
|
|
105
106
|
//------------------------------------------------------------------------------------
|
|
106
107
|
"operation:update:requestBody:value": {
|
|
107
|
-
onAfterExecute: (e) =>
|
|
108
|
+
onAfterExecute: (e) => i(e.meta)
|
|
108
109
|
},
|
|
109
110
|
"operation:update:requestBody:formValue": {
|
|
110
|
-
onAfterExecute: (e) =>
|
|
111
|
+
onAfterExecute: (e) => i(e.meta)
|
|
111
112
|
},
|
|
112
113
|
//------------------------------------------------------------------------------------
|
|
113
114
|
// Tag Related Event Hooks
|
|
114
115
|
//------------------------------------------------------------------------------------
|
|
115
116
|
"tag:create:tag": {
|
|
116
|
-
onAfterExecute: (e) =>
|
|
117
|
+
onAfterExecute: (e) => u(e.documentName)
|
|
117
118
|
},
|
|
118
119
|
"tag:delete:tag": {
|
|
119
|
-
onAfterExecute: (e) =>
|
|
120
|
+
onAfterExecute: (e) => u(e.documentName)
|
|
120
121
|
},
|
|
121
122
|
//------------------------------------------------------------------------------------
|
|
122
123
|
// Tabs Related Event Hooks
|
|
123
124
|
//------------------------------------------------------------------------------------
|
|
124
125
|
"tabs:add:tab": {
|
|
125
|
-
onAfterExecute:
|
|
126
|
+
onAfterExecute: m
|
|
126
127
|
},
|
|
127
128
|
"tabs:close:tab": {
|
|
128
|
-
onAfterExecute:
|
|
129
|
+
onAfterExecute: m
|
|
129
130
|
},
|
|
130
131
|
"tabs:focus:tab": {
|
|
131
|
-
onAfterExecute:
|
|
132
|
+
onAfterExecute: m
|
|
132
133
|
},
|
|
133
134
|
"tabs:focus:tab-last": {
|
|
134
|
-
onAfterExecute:
|
|
135
|
+
onAfterExecute: m
|
|
135
136
|
},
|
|
136
137
|
"tabs:navigate:previous": {
|
|
137
|
-
onAfterExecute:
|
|
138
|
+
onAfterExecute: m
|
|
138
139
|
},
|
|
139
140
|
"tabs:navigate:next": {
|
|
140
|
-
onAfterExecute:
|
|
141
|
+
onAfterExecute: m
|
|
141
142
|
},
|
|
142
143
|
"tabs:update:tabs": {
|
|
143
|
-
onAfterExecute:
|
|
144
|
+
onAfterExecute: m
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
|
-
}),
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
147
|
+
}), s.on("scroll-to:nav-item", ({ id: e }) => f(e)), s.on("ui:toggle:sidebar", l), s.on("ui:navigate", async (e) => {
|
|
148
|
+
const a = (t) => {
|
|
149
|
+
if (!t)
|
|
150
|
+
return e.callback?.("success");
|
|
151
|
+
const c = w.duplicated;
|
|
152
|
+
return t.type !== c ? e.callback?.("error") : e.callback?.("success");
|
|
153
|
+
};
|
|
154
|
+
if (e.page === "document") {
|
|
155
|
+
const t = {
|
|
156
|
+
documentSlug: e.documentSlug,
|
|
157
|
+
workspaceSlug: e.workspaceSlug,
|
|
158
|
+
namespace: e.namespace
|
|
159
|
+
};
|
|
160
|
+
if (e.path === "overview")
|
|
161
|
+
return a(await n.push({ name: "document.overview", params: t }));
|
|
162
|
+
if (e.path === "servers")
|
|
163
|
+
return a(await n.push({ name: "document.servers", params: t }));
|
|
164
|
+
if (e.path === "environment")
|
|
165
|
+
return a(await n.push({ name: "document.environment", params: t }));
|
|
166
|
+
if (e.path === "authentication")
|
|
167
|
+
return a(await n.push({ name: "document.authentication", params: t }));
|
|
168
|
+
if (e.path === "cookies")
|
|
169
|
+
return a(await n.push({ name: "document.cookies", params: t }));
|
|
170
|
+
if (e.path === "settings")
|
|
171
|
+
return a(await n.push({ name: "document.settings", params: t }));
|
|
172
|
+
}
|
|
173
|
+
if (e.page === "workspace") {
|
|
174
|
+
const t = { workspaceSlug: e.workspaceSlug, namespace: e.namespace };
|
|
175
|
+
if (e.path === "environment")
|
|
176
|
+
return a(await n.push({ name: "workspace.environment", params: t }));
|
|
177
|
+
if (e.path === "cookies")
|
|
178
|
+
return a(await n.push({ name: "workspace.cookies", params: t }));
|
|
179
|
+
if (e.path === "settings")
|
|
180
|
+
return a(await n.push({ name: "workspace.settings", params: t }));
|
|
181
|
+
}
|
|
182
|
+
if (e.page === "example") {
|
|
183
|
+
const t = {
|
|
184
|
+
namespace: e.namespace,
|
|
185
|
+
workspaceSlug: e.workspaceSlug,
|
|
186
|
+
documentSlug: e.documentSlug,
|
|
187
|
+
pathEncoded: encodeURIComponent(e.path),
|
|
188
|
+
method: e.method,
|
|
189
|
+
exampleName: e.exampleName
|
|
190
|
+
};
|
|
191
|
+
return a(await n.push({ name: "example", params: t }));
|
|
192
|
+
}
|
|
193
|
+
}), s.on("tabs:copy:url", (e) => h(e.index));
|
|
155
194
|
}
|
|
156
195
|
export {
|
|
157
|
-
|
|
196
|
+
A as initializeAppEventHandlers
|
|
158
197
|
};
|
|
@@ -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":"AA+eA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAQ3B,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,cAAc,EAAE,CAAA;IAC5B;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAiBJ,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAkLF,KAAK,gBAAgB,GAAG;IACxB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAMF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA2kBxD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import p from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-658f060e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|