@scalar/api-client 2.23.4 → 2.25.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 +57 -0
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +8 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +33 -29
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +6 -0
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +46 -29
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts +15 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +125 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue2.js +4 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -2
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -2
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.d.ts +8 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +95 -108
- package/dist/v2/features/app/app-state.d.ts +46 -16
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +174 -161
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -2
- 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/WebTopNav.vue.d.ts +3 -3
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts +49 -0
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/filter-workspaces.js +5 -0
- package/dist/v2/features/app/helpers/group-workspaces.d.ts +24 -0
- package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/group-workspaces.js +23 -0
- package/dist/v2/features/app/hooks/use-document-watcher.js +8 -8
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +12 -11
- package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Settings.vue.js +17 -25
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +115 -118
- package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +14 -4
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +5 -6
- package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +16 -0
- package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -0
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js +34 -0
- package/dist/v2/features/command-palette/index.d.ts +4 -0
- package/dist/v2/features/command-palette/index.d.ts.map +1 -0
- package/dist/v2/features/command-palette/index.js +8 -0
- package/dist/v2/features/environments/EnvironmentsList.vue.d.ts +4 -0
- package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/EnvironmentsList.vue.js +29 -27
- package/dist/v2/features/environments/components/Environment.vue.d.ts +1 -0
- package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/Environment.vue.js +37 -24
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +2 -2
- package/dist/v2/features/modal/Modal.vue2.js +39 -38
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +35 -26
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +7 -0
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +15 -15
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts +0 -52
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +0 -1
- package/dist/v2/features/import-listener/ImportListener.vue.js +0 -91
- package/dist/v2/features/import-listener/ImportListener.vue2.js +0 -4
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +0 -7
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +0 -1
- package/dist/v2/features/import-listener/components/DropEventListener.vue.js +0 -81
- package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +0 -4
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +0 -40
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +0 -1
- package/dist/v2/features/import-listener/components/ImportModal.vue.js +0 -170
- package/dist/v2/features/import-listener/components/ImportModal.vue3.js +0 -5
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +0 -29
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +0 -1
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +0 -83
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +0 -4
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +0 -8
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +0 -1
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +0 -4
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +0 -15
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +0 -1
- package/dist/v2/features/import-listener/helpers/load-document-from-source.js +0 -28
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +0 -15
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +0 -1
- package/dist/v2/features/import-listener/helpers/wait-for-condition.js +0 -16
- package/dist/v2/features/import-listener/index.d.ts +0 -2
- package/dist/v2/features/import-listener/index.d.ts.map +0 -1
- package/dist/v2/features/import-listener/index.js +0 -4
- /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts +0 -0
- /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.js +0 -0
- /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts +0 -0
- /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.js +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as g, ScalarTeleportRoot as
|
|
3
|
-
import { getThemeStyles as
|
|
4
|
-
import { ScalarToasts as
|
|
1
|
+
import { defineComponent as h, computed as c, createBlock as u, openBlock as l, unref as t, withCtx as v, createElementVNode as p, createVNode as n, createElementBlock as k, renderSlot as w, normalizeProps as y, guardReactiveProps as T } from "vue";
|
|
2
|
+
import { useModal as g, ScalarTeleportRoot as B } from "@scalar/components";
|
|
3
|
+
import { getThemeStyles as C } from "@scalar/themes";
|
|
4
|
+
import { ScalarToasts as x } from "@scalar/use-toasts";
|
|
5
5
|
import { extensions as E } from "@scalar/workspace-store/schemas/extensions";
|
|
6
|
-
import { RouterView as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
6
|
+
import { RouterView as O } from "vue-router";
|
|
7
|
+
import _ from "./components/CreateWorkspaceModal.vue.js";
|
|
8
|
+
import A from "./components/SplashScreen.vue.js";
|
|
9
|
+
import { groupWorkspacesByTeam as U } from "./helpers/group-workspaces.js";
|
|
10
|
+
import { useDocumentWatcher as M } from "./hooks/use-document-watcher.js";
|
|
11
|
+
import I from "../command-palette/TheCommandPalette.vue.js";
|
|
11
12
|
import { useColorMode as D } from "../../hooks/use-color-mode.js";
|
|
12
|
-
import { useGlobalHotKeys as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { mergeSecurity as
|
|
17
|
-
import H from "../import-listener/ImportListener.vue.js";
|
|
13
|
+
import { useGlobalHotKeys as $ } from "../../hooks/use-global-hot-keys.js";
|
|
14
|
+
import N from "./components/AppSidebar.vue.js";
|
|
15
|
+
import L from "./components/DesktopTabs.vue.js";
|
|
16
|
+
import P from "./components/WebTopNav.vue.js";
|
|
17
|
+
import { mergeSecurity as H } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
|
|
18
18
|
const F = ["innerHTML"], V = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "flex flex-1 flex-col"
|
|
21
|
-
}, R = { class: "flex min-h-0 flex-1" }, z = { class: "bg-b-1 flex-1" }, G = { key: 1 }, K = {},
|
|
21
|
+
}, R = { class: "flex min-h-0 flex-1" }, z = { class: "bg-b-1 flex-1" }, G = { key: 1 }, K = {}, pe = /* @__PURE__ */ h({
|
|
22
22
|
...K,
|
|
23
23
|
__name: "App",
|
|
24
24
|
props: {
|
|
@@ -27,32 +27,30 @@ const F = ["innerHTML"], V = {
|
|
|
27
27
|
getAppState: { type: Function },
|
|
28
28
|
getCommandPaletteState: { type: Function }
|
|
29
29
|
},
|
|
30
|
-
setup(
|
|
31
|
-
|
|
32
|
-
openCreateWorkspace: () =>
|
|
30
|
+
setup(s, { expose: f }) {
|
|
31
|
+
f({
|
|
32
|
+
openCreateWorkspace: () => i.show()
|
|
33
33
|
});
|
|
34
|
-
const e =
|
|
35
|
-
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e)
|
|
36
|
-
const { isDarkMode: f } = D({ workspaceStore: e.store });
|
|
37
|
-
I(e.eventBus, r.layout), A({
|
|
34
|
+
const e = s.getAppState(), S = s.getCommandPaletteState();
|
|
35
|
+
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), D({ workspaceStore: e.store }), $(e.eventBus, s.layout), M({
|
|
38
36
|
documentName: () => e.store.value?.workspace[E.workspace.activeDocument],
|
|
39
37
|
store: e.store,
|
|
40
38
|
initialTimeout: 5e3
|
|
41
39
|
});
|
|
42
|
-
const
|
|
40
|
+
const b = c(() => {
|
|
43
41
|
if (e.store.value === null)
|
|
44
42
|
return "";
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
}),
|
|
48
|
-
if (!
|
|
43
|
+
const o = e.store.value.workspace["x-scalar-theme"];
|
|
44
|
+
return o ? `<style>${C(o)}</style>` : "";
|
|
45
|
+
}), m = (o) => {
|
|
46
|
+
if (!o)
|
|
49
47
|
return;
|
|
50
48
|
const a = e.workspace.workspaceList.value?.find(
|
|
51
|
-
(
|
|
49
|
+
(r) => r.id === o
|
|
52
50
|
);
|
|
53
51
|
a && e.workspace.navigateToWorkspace(a.namespace, a.slug);
|
|
54
|
-
},
|
|
55
|
-
const
|
|
52
|
+
}, i = g(), W = c(() => {
|
|
53
|
+
const o = e.store.value?.auth ? H(
|
|
56
54
|
e.document.value?.components?.securitySchemes ?? {},
|
|
57
55
|
{},
|
|
58
56
|
e.store.value.auth,
|
|
@@ -64,94 +62,83 @@ const F = ["innerHTML"], V = {
|
|
|
64
62
|
environment: e.environment.value,
|
|
65
63
|
eventBus: e.eventBus,
|
|
66
64
|
exampleName: e.activeEntities.exampleName.value,
|
|
67
|
-
layout:
|
|
65
|
+
layout: s.layout,
|
|
68
66
|
method: e.activeEntities.method.value,
|
|
69
67
|
path: e.activeEntities.path.value,
|
|
70
68
|
workspaceStore: e.store.value,
|
|
71
69
|
activeWorkspace: e.workspace.activeWorkspace.value,
|
|
72
|
-
plugins:
|
|
73
|
-
securitySchemes:
|
|
70
|
+
plugins: s.plugins,
|
|
71
|
+
securitySchemes: o
|
|
74
72
|
};
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
store: t(e).store.value,
|
|
119
|
-
workspaces: t(e).workspace.workspaceList.value,
|
|
120
|
-
"onClick:workspace": t(e).workspace.navigateToWorkspace,
|
|
121
|
-
"onCreate:workspace": a[2] || (a[2] = (o) => t(c).show()),
|
|
122
|
-
"onSelect:workspace": l,
|
|
123
|
-
onSelectItem: t(e).sidebar.handleSelectItem,
|
|
124
|
-
"onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
|
|
125
|
-
}, {
|
|
126
|
-
sidebarMenuActions: u(() => [
|
|
127
|
-
T(s.$slots, "sidebar-menu-actions")
|
|
128
|
-
]),
|
|
129
|
-
_: 3
|
|
130
|
-
}, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
|
|
131
|
-
m("div", z, [
|
|
132
|
-
n(t(M), h(y(b.value)), null, 16)
|
|
133
|
-
])
|
|
73
|
+
}), d = c(
|
|
74
|
+
() => U(
|
|
75
|
+
e.workspace.filteredWorkspaceList.value,
|
|
76
|
+
e.activeEntities.teamUid.value
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
return (o, a) => (l(), u(t(B), null, {
|
|
80
|
+
default: v(() => [
|
|
81
|
+
p("div", { innerHTML: b.value }, null, 8, F),
|
|
82
|
+
n(t(x)),
|
|
83
|
+
t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (l(), k("main", V, [
|
|
84
|
+
s.layout === "desktop" ? (l(), u(L, {
|
|
85
|
+
key: 0,
|
|
86
|
+
activeTabIndex: t(e).tabs.activeTabIndex.value,
|
|
87
|
+
eventBus: t(e).eventBus,
|
|
88
|
+
tabs: t(e).tabs.state.value
|
|
89
|
+
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (l(), u(P, {
|
|
90
|
+
key: 1,
|
|
91
|
+
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
92
|
+
workspaces: d.value,
|
|
93
|
+
"onCreate:workspace": a[0] || (a[0] = (r) => t(i).show()),
|
|
94
|
+
"onSelect:workspace": m
|
|
95
|
+
}, null, 8, ["activeWorkspace", "workspaces"])),
|
|
96
|
+
p("div", R, [
|
|
97
|
+
n(N, {
|
|
98
|
+
isSidebarOpen: t(e).sidebar.isOpen.value,
|
|
99
|
+
"onUpdate:isSidebarOpen": a[1] || (a[1] = (r) => t(e).sidebar.isOpen.value = r),
|
|
100
|
+
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
101
|
+
eventBus: t(e).eventBus,
|
|
102
|
+
isWorkspaceOpen: t(e).workspace.isOpen.value,
|
|
103
|
+
layout: s.layout,
|
|
104
|
+
sidebarState: t(e).sidebar.state,
|
|
105
|
+
sidebarWidth: t(e).sidebar.width.value,
|
|
106
|
+
store: t(e).store.value,
|
|
107
|
+
workspaces: d.value,
|
|
108
|
+
"onClick:workspace": t(e).workspace.navigateToWorkspace,
|
|
109
|
+
"onCreate:workspace": a[2] || (a[2] = (r) => t(i).show()),
|
|
110
|
+
"onSelect:workspace": m,
|
|
111
|
+
onSelectItem: t(e).sidebar.handleSelectItem,
|
|
112
|
+
"onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
|
|
113
|
+
}, {
|
|
114
|
+
sidebarMenuActions: v(() => [
|
|
115
|
+
w(o.$slots, "sidebar-menu-actions")
|
|
134
116
|
]),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
]))
|
|
117
|
+
_: 3
|
|
118
|
+
}, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
|
|
119
|
+
p("div", z, [
|
|
120
|
+
n(t(O), y(T(W.value)), null, 16)
|
|
121
|
+
])
|
|
122
|
+
]),
|
|
123
|
+
w(o.$slots, "create-workspace", { state: t(i) }, () => [
|
|
124
|
+
n(_, {
|
|
125
|
+
state: t(i),
|
|
126
|
+
"onCreate:workspace": a[3] || (a[3] = (r) => t(e).workspace.create(r))
|
|
127
|
+
}, null, 8, ["state"])
|
|
147
128
|
]),
|
|
148
|
-
|
|
149
|
-
|
|
129
|
+
n(I, {
|
|
130
|
+
eventBus: t(e).eventBus,
|
|
131
|
+
paletteState: t(S),
|
|
132
|
+
workspaceStore: t(e).store.value
|
|
133
|
+
}, null, 8, ["eventBus", "paletteState", "workspaceStore"])
|
|
134
|
+
])) : (l(), k("main", G, [
|
|
135
|
+
n(A)
|
|
136
|
+
]))
|
|
150
137
|
]),
|
|
151
138
|
_: 3
|
|
152
139
|
}));
|
|
153
140
|
}
|
|
154
141
|
});
|
|
155
142
|
export {
|
|
156
|
-
|
|
143
|
+
pe as default
|
|
157
144
|
};
|
|
@@ -23,7 +23,7 @@ type WorkspaceOption = ScalarListboxOption & {
|
|
|
23
23
|
declare const navigateToWorkspace: (namespace?: string, slug?: string) => Promise<void>;
|
|
24
24
|
/**
|
|
25
25
|
* Creates a new workspace with the provided name.
|
|
26
|
-
* - Generates a unique slug for the workspace (
|
|
26
|
+
* - Generates a unique slug for the workspace (uses the provided slug if it is unique, otherwise generates a unique slug).
|
|
27
27
|
* - Adds a default blank document ("drafts") to the workspace.
|
|
28
28
|
* - Persists the workspace and navigates to it.
|
|
29
29
|
*
|
|
@@ -31,12 +31,10 @@ declare const navigateToWorkspace: (namespace?: string, slug?: string) => Promis
|
|
|
31
31
|
* await createWorkspace({ name: 'My Awesome API' })
|
|
32
32
|
* // -> Navigates to /workspace/my-awesome-api (if available)
|
|
33
33
|
*/
|
|
34
|
-
declare const createWorkspace: ({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
slug: string;
|
|
39
|
-
};
|
|
34
|
+
declare const createWorkspace: ({ teamUid, namespace, slug, name, }: {
|
|
35
|
+
teamUid?: string;
|
|
36
|
+
namespace?: string;
|
|
37
|
+
slug?: string;
|
|
40
38
|
name: string;
|
|
41
39
|
}) => Promise<{
|
|
42
40
|
name: string;
|
|
@@ -96,48 +94,80 @@ export type GetEntryByLocation = (location: {
|
|
|
96
94
|
declare const handleSelectItem: (id: string) => Promise<void | import("vue-router").NavigationFailure | undefined> | undefined;
|
|
97
95
|
/** Handler for sidebar width changes. */
|
|
98
96
|
declare const handleSidebarWidthUpdate: (width: number) => void | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* Copies the URL of the tab at the given index to the clipboard.
|
|
101
|
-
* Constructs the full URL using the current origin and the tab path.
|
|
102
|
-
*
|
|
103
|
-
* @throws Will silently fail if clipboard API is unavailable or the tab does not exist.
|
|
104
|
-
*/
|
|
105
|
-
declare const copyTabUrl: (index: number) => Promise<void>;
|
|
97
|
+
/** Defines the overall application state structure and its main feature modules */
|
|
106
98
|
export type AppState = {
|
|
99
|
+
/** The workspace store */
|
|
107
100
|
store: ShallowRef<WorkspaceStore | null>;
|
|
101
|
+
/** The sidebar management */
|
|
108
102
|
sidebar: {
|
|
103
|
+
/** The sidebar state */
|
|
109
104
|
state: typeof sidebarState;
|
|
105
|
+
/** The width of the sidebar */
|
|
110
106
|
width: ComputedRef<number>;
|
|
107
|
+
/** Whether the sidebar is open */
|
|
111
108
|
isOpen: Ref<boolean>;
|
|
109
|
+
/** Handles the selection of an item in the sidebar */
|
|
112
110
|
handleSelectItem: typeof handleSelectItem;
|
|
111
|
+
/** Handles the width update of the sidebar */
|
|
113
112
|
handleSidebarWidthUpdate: typeof handleSidebarWidthUpdate;
|
|
113
|
+
/** Gets the entry by location */
|
|
114
114
|
getEntryByLocation: typeof getEntryByLocation;
|
|
115
115
|
};
|
|
116
|
+
/** The tabs management */
|
|
116
117
|
tabs: {
|
|
118
|
+
/** The tabs state */
|
|
117
119
|
state: Ref<Tab[]>;
|
|
120
|
+
/** The active tab index */
|
|
118
121
|
activeTabIndex: Ref<number>;
|
|
119
|
-
|
|
122
|
+
/** Copies the URL of the tab at the given index to the clipboard */
|
|
123
|
+
copyTabUrl: (index: number) => Promise<void>;
|
|
120
124
|
};
|
|
125
|
+
/** The workspace management */
|
|
121
126
|
workspace: {
|
|
127
|
+
/** Creates a new workspace and navigates to it */
|
|
122
128
|
create: typeof createWorkspace;
|
|
129
|
+
/** All workspace list */
|
|
123
130
|
workspaceList: Ref<WorkspaceOption[]>;
|
|
124
|
-
|
|
131
|
+
/** Filtered workspace list, based on the current teamUid */
|
|
132
|
+
filteredWorkspaceList: ComputedRef<WorkspaceOption[]>;
|
|
133
|
+
/** The currently active workspace */
|
|
134
|
+
activeWorkspace: ShallowRef<{
|
|
135
|
+
id: string;
|
|
136
|
+
label: string;
|
|
137
|
+
} | null>;
|
|
138
|
+
/** Navigates to the specified workspace */
|
|
125
139
|
navigateToWorkspace: typeof navigateToWorkspace;
|
|
140
|
+
/** Whether the workspace page is open */
|
|
126
141
|
isOpen: ComputedRef<boolean>;
|
|
127
142
|
};
|
|
143
|
+
/** The workspace event bus for handling workspace-level events */
|
|
128
144
|
eventBus: WorkspaceEventBus;
|
|
145
|
+
/** The router instance */
|
|
129
146
|
router: ShallowRef<Router | null>;
|
|
147
|
+
/** The current route derived from the router */
|
|
130
148
|
currentRoute: Ref<RouteLocationNormalizedGeneric | null>;
|
|
149
|
+
/** Whether the workspace is currently syncing */
|
|
131
150
|
loading: Ref<boolean>;
|
|
151
|
+
/** The currently active entities */
|
|
132
152
|
activeEntities: {
|
|
153
|
+
/** The namespace of the current entity, e.g. "default" or a custom namespace */
|
|
133
154
|
namespace: Ref<string | undefined>;
|
|
155
|
+
/** The slug identifying the current workspace */
|
|
134
156
|
workspaceSlug: Ref<string | undefined>;
|
|
157
|
+
/** The slug of the currently selected document in the workspace */
|
|
135
158
|
documentSlug: Ref<string | undefined>;
|
|
159
|
+
/** The API path currently selected (e.g. "/users/{id}") */
|
|
136
160
|
path: Ref<string | undefined>;
|
|
161
|
+
/** The HTTP method for the currently selected API path (e.g. GET, POST) */
|
|
137
162
|
method: Ref<HttpMethod | undefined>;
|
|
163
|
+
/** The name of the currently selected example (for examples within an endpoint) */
|
|
138
164
|
exampleName: Ref<string | undefined>;
|
|
165
|
+
/** The unique identifier for the selected team context */
|
|
166
|
+
teamUid: Ref<string>;
|
|
139
167
|
};
|
|
168
|
+
/** The currently active environment */
|
|
140
169
|
environment: ComputedRef<XScalarEnvironment>;
|
|
170
|
+
/** The currently active document */
|
|
141
171
|
document: ComputedRef<WorkspaceDocument | null>;
|
|
142
172
|
};
|
|
143
173
|
export declare function useAppState(_router: Router): AppState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAGnE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oEAAoE,CAAA;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,KAAK,UAAU,EAAoC,MAAM,KAAK,CAAA;AACnG,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAGnE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,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