@scalar/api-client 2.2.31 → 2.2.33
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 +36 -0
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts +9 -3
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -54
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +13 -3
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.vue.js +7 -7
- package/dist/components/DataTable/DataTableCell.vue.js +6 -6
- package/dist/components/Form/Form.vue.d.ts.map +1 -1
- package/dist/components/Form/Form.vue.js +5 -5
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +72 -71
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +23 -22
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +61 -48
- package/dist/components/SideNav/SideNavLink.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +5 -5
- package/dist/components/Sidebar/SidebarList.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +12 -12
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -2
- package/dist/layouts/App/create-api-client-app.d.ts +168 -127
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +336 -254
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +168 -127
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +169 -128
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +8 -7
- package/dist/libs/find-request.d.ts +2 -0
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +114 -116
- package/dist/routes.d.ts +1 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +12 -7
- package/dist/store/active-entities.d.ts +29 -27
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/request-example.d.ts +134 -134
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/requests.d.ts +26 -4
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/store.d.ts +171 -128
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +48 -46
- package/dist/store/tags.d.ts +24 -4
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +12 -12
- package/dist/views/Cookies/Cookies.vue2.js +12 -12
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +98 -97
- package/dist/views/Environment/EnvironmentModal.vue.js +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +6 -6
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +14 -14
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -2
- 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 +132 -125
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +21 -21
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +12 -12
- package/dist/views/Servers/ServerForm.vue.d.ts +8 -1
- package/dist/views/Servers/ServerForm.vue.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.js +28 -59
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +141 -53
- package/package.json +12 -12
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { defineComponent as H, ref as W, computed as
|
|
1
|
+
import { defineComponent as H, ref as W, computed as a, watch as _, onMounted as K, onUnmounted as G, openBlock as l, createBlock as J, unref as i, withCtx as Q, createElementBlock as d, createCommentVNode as f, createElementVNode as e, normalizeClass as X, Fragment as b, createVNode as m, toDisplayString as Y, createTextVNode as M } from "vue";
|
|
2
2
|
import Z from "../CommandPalette/WatchModeToggle.vue.js";
|
|
3
3
|
import ee from "./ImportNowButton.vue.js";
|
|
4
4
|
import te from "./IntegrationLogo.vue.js";
|
|
5
5
|
import oe from "./PrefetchError.vue.js";
|
|
6
6
|
import se from "./WorkspaceSelector.vue.js";
|
|
7
7
|
import { useUrlPrefetcher as ne } from "./hooks/useUrlPrefetcher.js";
|
|
8
|
-
import { getOpenApiDocumentVersion as
|
|
9
|
-
import { isDocument as
|
|
10
|
-
import { isUrl as
|
|
8
|
+
import { getOpenApiDocumentVersion as T } from "./utils/getOpenApiDocumentVersion.js";
|
|
9
|
+
import { isDocument as U } from "./utils/isDocument.js";
|
|
10
|
+
import { isUrl as A } from "./utils/isUrl.js";
|
|
11
11
|
import { useActiveEntities as re } from "../../store/active-entities.js";
|
|
12
12
|
import { useModal as ie, ScalarModal as le, ScalarIcon as ce } from "@scalar/components";
|
|
13
13
|
import { isLocalUrl as ae } from "@scalar/oas-utils/helpers";
|
|
14
14
|
import { normalize as de } from "@scalar/openapi-parser";
|
|
15
|
-
import { getThemeStyles as me } from "@scalar/themes";
|
|
16
|
-
import { useColorMode as
|
|
15
|
+
import { getThemeStyles as me, themeIds as ue } from "@scalar/themes";
|
|
16
|
+
import { useColorMode as fe } from "@scalar/use-hooks/useColorMode";
|
|
17
17
|
import { useRouter as pe } from "vue-router";
|
|
18
|
-
import { useWorkspace as
|
|
19
|
-
const
|
|
18
|
+
import { useWorkspace as ve } from "../../store/store.js";
|
|
19
|
+
const he = ["innerHTML"], xe = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, ye = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "flex justify-center items-center mb-2 p-1"
|
|
22
|
-
},
|
|
22
|
+
}, ge = { class: "rounded-xl size-10" }, _e = ["src"], be = {
|
|
23
23
|
key: 2,
|
|
24
24
|
class: "text-center text-md font-bold mb-2 line-clamp-1"
|
|
25
|
-
},
|
|
25
|
+
}, we = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, ke = { class: "flex justify-center" }, Ie = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, Le = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
|
|
28
|
-
},
|
|
28
|
+
}, Me = { class: "flex items-center justify-center" }, Te = { class: "flex flex-col justify-center items-center pb-8" }, Ue = { class: "text-center flex items-center flex-col" }, Ae = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, Ce = {
|
|
29
29
|
href: "https://scalar.com/download",
|
|
30
30
|
target: "_blank"
|
|
31
|
-
},
|
|
31
|
+
}, Je = /* @__PURE__ */ H({
|
|
32
32
|
__name: "ImportCollectionModal",
|
|
33
33
|
props: {
|
|
34
34
|
source: {},
|
|
@@ -36,10 +36,10 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
36
36
|
eventType: {}
|
|
37
37
|
},
|
|
38
38
|
emits: ["importFinished"],
|
|
39
|
-
setup(
|
|
40
|
-
const s =
|
|
39
|
+
setup(C, { emit: P }) {
|
|
40
|
+
const s = C, D = P, { activeWorkspace: p } = re(), { workspaceMutators: V, events: j } = ve(), { prefetchResult: n, prefetchUrl: w, resetPrefetchResult: S } = ne(), r = ie(), h = W(!0);
|
|
41
41
|
j.hotKeys.on(() => r.hide());
|
|
42
|
-
const z =
|
|
42
|
+
const z = a(() => {
|
|
43
43
|
try {
|
|
44
44
|
return de(
|
|
45
45
|
n.content || s.source || ""
|
|
@@ -47,12 +47,12 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
47
47
|
} catch {
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
}), N =
|
|
50
|
+
}), N = a(() => {
|
|
51
51
|
var o, t;
|
|
52
52
|
return (t = (o = z.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
|
|
53
|
-
}), k =
|
|
54
|
-
() =>
|
|
55
|
-
), { darkLightMode: O } =
|
|
53
|
+
}), k = a(
|
|
54
|
+
() => T(n.content || s.source || "")
|
|
55
|
+
), { darkLightMode: O } = fe(), { currentRoute: $ } = pe(), x = a(() => {
|
|
56
56
|
try {
|
|
57
57
|
const o = $.value.query, t = O.value === "dark" ? o.dark_logo : o.light_logo;
|
|
58
58
|
if (t) return decodeURIComponent(t);
|
|
@@ -60,54 +60,55 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
60
60
|
}
|
|
61
61
|
return null;
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
_(
|
|
64
64
|
() => s.source,
|
|
65
65
|
async (o) => {
|
|
66
|
-
var t,
|
|
67
|
-
if (S(),
|
|
66
|
+
var t, c;
|
|
67
|
+
if (S(), A(o)) {
|
|
68
68
|
if (s.eventType && ["paste", "drop"].includes(s.eventType)) {
|
|
69
|
-
const { error:
|
|
69
|
+
const { error: v } = await w(
|
|
70
70
|
o,
|
|
71
71
|
(t = p.value) == null ? void 0 : t.proxyUrl
|
|
72
72
|
);
|
|
73
|
-
|
|
73
|
+
v ? r.hide() : r.show();
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
w(o, (
|
|
76
|
+
w(o, (c = p.value) == null ? void 0 : c.proxyUrl), r.show();
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
o &&
|
|
79
|
+
o && U(o) && T(o) ? r.show() : r.hide();
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
const E =
|
|
82
|
+
const E = a(() => !!s.source && A(s.source)), F = a(() => !!s.source && U(s.source)), y = a(() => n.url && ae(n.url)), g = (o) => {
|
|
83
83
|
document.body.classList.remove("has-no-import-url"), (E.value || F.value) && r.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
|
|
84
84
|
}, R = () => {
|
|
85
85
|
document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
_(
|
|
88
88
|
() => r.open,
|
|
89
89
|
(o) => {
|
|
90
|
-
o ?
|
|
90
|
+
o ? g() : R();
|
|
91
91
|
}
|
|
92
|
-
),
|
|
92
|
+
), _(
|
|
93
93
|
() => s.source,
|
|
94
94
|
() => {
|
|
95
|
-
|
|
95
|
+
g();
|
|
96
96
|
}
|
|
97
97
|
), K(() => {
|
|
98
|
-
|
|
98
|
+
g();
|
|
99
99
|
}), G(() => {
|
|
100
100
|
document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
|
|
101
101
|
});
|
|
102
|
-
const I =
|
|
103
|
-
() => p.value &&
|
|
102
|
+
const I = a(
|
|
103
|
+
() => p.value && y.value && s.integration && `<style>${me(s.integration)}</style>`
|
|
104
104
|
);
|
|
105
105
|
function q() {
|
|
106
|
-
var
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
var c;
|
|
107
|
+
const o = (u) => ue.includes(u), t = s.integration && o(s.integration) ? s.integration : "default";
|
|
108
|
+
y.value && V.edit(
|
|
109
|
+
((c = p.value) == null ? void 0 : c.uid) ?? "",
|
|
109
110
|
"themeId",
|
|
110
|
-
|
|
111
|
+
t
|
|
111
112
|
), D("importFinished");
|
|
112
113
|
}
|
|
113
114
|
return (o, t) => (l(), J(i(le), {
|
|
@@ -115,13 +116,13 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
115
116
|
state: i(r)
|
|
116
117
|
}, {
|
|
117
118
|
default: Q(() => {
|
|
118
|
-
var
|
|
119
|
+
var c, u, v, L;
|
|
119
120
|
return [
|
|
120
|
-
I.value ? (l(),
|
|
121
|
+
I.value ? (l(), d("div", {
|
|
121
122
|
key: 0,
|
|
122
123
|
innerHTML: I.value
|
|
123
|
-
}, null, 8,
|
|
124
|
-
e("div",
|
|
124
|
+
}, null, 8, he)) : f("", !0),
|
|
125
|
+
e("div", xe, [
|
|
125
126
|
t[6] || (t[6] = e("div", { class: "section-flare" }, [
|
|
126
127
|
e("div", { class: "section-flare-item" }),
|
|
127
128
|
e("div", { class: "section-flare-item" }),
|
|
@@ -135,57 +136,57 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
135
136
|
e("div", {
|
|
136
137
|
class: X(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": i(n).state === "loading" }])
|
|
137
138
|
}, [
|
|
138
|
-
i(n).error && i(n).state === "idle" && !k.value ? (l(),
|
|
139
|
+
i(n).error && i(n).state === "idle" && !k.value ? (l(), d(b, { key: 0 }, [
|
|
139
140
|
t[1] || (t[1] = e("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
|
|
140
|
-
|
|
141
|
-
url: ((
|
|
141
|
+
m(oe, {
|
|
142
|
+
url: ((c = i(n)) == null ? void 0 : c.input) || s.source
|
|
142
143
|
}, null, 8, ["url"])
|
|
143
|
-
], 64)) : (l(),
|
|
144
|
-
|
|
145
|
-
e("div",
|
|
146
|
-
|
|
144
|
+
], 64)) : (l(), d(b, { key: 1 }, [
|
|
145
|
+
y.value ? (l(), d("div", ye, [
|
|
146
|
+
e("div", ge, [
|
|
147
|
+
m(te, { integration: o.integration }, null, 8, ["integration"])
|
|
147
148
|
])
|
|
148
|
-
])) :
|
|
149
|
+
])) : x.value ? (l(), d("img", {
|
|
149
150
|
key: 1,
|
|
150
151
|
alt: "Logo",
|
|
151
152
|
class: "w-full object-contain mb-2",
|
|
152
|
-
src:
|
|
153
|
-
}, null, 8, _e)) :
|
|
154
|
-
|
|
153
|
+
src: x.value
|
|
154
|
+
}, null, 8, _e)) : f("", !0),
|
|
155
|
+
x.value ? f("", !0) : (l(), d("div", be, Y(N.value || "Untitled Collection"), 1)),
|
|
155
156
|
t[4] || (t[4] = e("div", { class: "text-c-1 text-sm font-medium text-center text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
|
|
156
|
-
k.value ? (l(),
|
|
157
|
-
e("div",
|
|
158
|
-
|
|
159
|
-
source: ((
|
|
157
|
+
k.value ? (l(), d(b, { key: 3 }, [
|
|
158
|
+
e("div", we, [
|
|
159
|
+
m(ee, {
|
|
160
|
+
source: ((u = i(n)) == null ? void 0 : u.url) ?? ((v = i(n)) == null ? void 0 : v.content) ?? o.source,
|
|
160
161
|
variant: "button",
|
|
161
|
-
watchMode:
|
|
162
|
+
watchMode: h.value,
|
|
162
163
|
onImportFinished: q
|
|
163
164
|
}, null, 8, ["source", "watchMode"])
|
|
164
165
|
]),
|
|
165
|
-
e("div",
|
|
166
|
-
e("div",
|
|
166
|
+
e("div", ke, [
|
|
167
|
+
e("div", Ie, [
|
|
167
168
|
t[2] || (t[2] = M(" Import to: ")),
|
|
168
|
-
|
|
169
|
+
m(se)
|
|
169
170
|
])
|
|
170
171
|
]),
|
|
171
|
-
(L = i(n)) != null && L.url ? (l(),
|
|
172
|
-
e("div",
|
|
173
|
-
|
|
174
|
-
modelValue:
|
|
175
|
-
"onUpdate:modelValue": t[0] || (t[0] = (B) =>
|
|
172
|
+
(L = i(n)) != null && L.url ? (l(), d("div", Le, [
|
|
173
|
+
e("div", Me, [
|
|
174
|
+
m(Z, {
|
|
175
|
+
modelValue: h.value,
|
|
176
|
+
"onUpdate:modelValue": t[0] || (t[0] = (B) => h.value = B),
|
|
176
177
|
disableToolTip: !0
|
|
177
178
|
}, null, 8, ["modelValue"])
|
|
178
179
|
]),
|
|
179
180
|
t[3] || (t[3] = e("div", { class: "pt-0 text-center text-balance font-medium text-xs text-c-3" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
|
|
180
|
-
])) :
|
|
181
|
-
], 64)) :
|
|
181
|
+
])) : f("", !0)
|
|
182
|
+
], 64)) : f("", !0)
|
|
182
183
|
], 64))
|
|
183
184
|
], 2),
|
|
184
|
-
e("div",
|
|
185
|
+
e("div", Te, [
|
|
185
186
|
e("div", Ue, [
|
|
186
187
|
e("div", Ae, [
|
|
187
188
|
e("a", Ce, [
|
|
188
|
-
|
|
189
|
+
m(i(ce), {
|
|
189
190
|
icon: "Logo",
|
|
190
191
|
size: "xl"
|
|
191
192
|
})
|
|
@@ -210,5 +211,5 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
210
211
|
}
|
|
211
212
|
});
|
|
212
213
|
export {
|
|
213
|
-
|
|
214
|
+
Je as default
|
|
214
215
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AA6bA,wBAKG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as W, ref as D, openBlock as
|
|
1
|
+
import { defineComponent as W, ref as D, openBlock as m, createElementBlock as w, Fragment as v, createElementVNode as s, createVNode as o, unref as e, withCtx as r, renderList as z, createBlock as N, withModifiers as k, normalizeClass as M, toDisplayString as h, withDirectives as B, vModelText as V, createTextVNode as j } from "vue";
|
|
2
2
|
import { useActiveEntities as E } from "../../store/active-entities.js";
|
|
3
3
|
import { useModal as T, ScalarDropdown as $, ScalarDropdownItem as _, ScalarIcon as u, ScalarDropdownDivider as A, ScalarButton as b, ScalarModal as I } from "@scalar/components";
|
|
4
4
|
import { useToasts as F } from "@scalar/use-toasts";
|
|
@@ -7,45 +7,45 @@ import { useWorkspace as P } from "../../store/store.js";
|
|
|
7
7
|
const R = { class: "flex items-center text-sm w-[inherit]" }, U = { class: "font-medium m-0 text-sm flex gap-1 items-center" }, q = { class: "line-clamp-1 text-left w-[calc(100%-10px)] text-xs" }, G = { class: "text-ellipsis overflow-hidden" }, H = { class: "flex items-center justify-center h-4 w-4" }, ee = /* @__PURE__ */ W({
|
|
8
8
|
__name: "WorkspaceSelector",
|
|
9
9
|
setup(J) {
|
|
10
|
-
const { activeWorkspace: i } = E(), { workspaces: g, workspaceMutators: C } = P(), { push: f } = L(), c = T(), { toast: x } = F(),
|
|
10
|
+
const { activeWorkspace: i } = E(), { workspaces: g, workspaceMutators: C } = P(), { push: f } = L(), c = T(), { toast: x } = F(), l = D(""), y = (n) => {
|
|
11
11
|
var t;
|
|
12
|
-
|
|
12
|
+
n !== ((t = i.value) == null ? void 0 : t.uid) && f({
|
|
13
13
|
name: "workspace",
|
|
14
14
|
params: {
|
|
15
|
-
workspace:
|
|
15
|
+
workspace: n
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
},
|
|
19
|
-
if (!
|
|
18
|
+
}, S = () => {
|
|
19
|
+
if (!l.value.trim()) {
|
|
20
20
|
x("Please enter a name before creating a workspace.", "error");
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
name:
|
|
23
|
+
const n = C.add({
|
|
24
|
+
name: l.value
|
|
25
25
|
});
|
|
26
|
-
x(`Created new workspace '${
|
|
26
|
+
x(`Created new workspace '${n.name}'`), f({
|
|
27
27
|
name: "workspace",
|
|
28
28
|
params: {
|
|
29
|
-
workspace:
|
|
29
|
+
workspace: n.uid
|
|
30
30
|
}
|
|
31
|
-
}),
|
|
31
|
+
}), l.value = "", c.hide();
|
|
32
32
|
};
|
|
33
|
-
return (
|
|
33
|
+
return (n, t) => (m(), w(v, null, [
|
|
34
34
|
s("div", R, [
|
|
35
35
|
o(e($), null, {
|
|
36
36
|
items: r(() => [
|
|
37
|
-
(
|
|
37
|
+
(m(!0), w(v, null, z(e(g), (a, p) => (m(), N(e(_), {
|
|
38
38
|
key: p,
|
|
39
39
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: k((d) => y(p), ["stop"])
|
|
41
41
|
}, {
|
|
42
42
|
default: r(() => {
|
|
43
|
-
var
|
|
43
|
+
var d;
|
|
44
44
|
return [
|
|
45
45
|
s("div", {
|
|
46
46
|
class: M([
|
|
47
47
|
"flex items-center justify-center rounded-full p-[3px] w-4 h-4",
|
|
48
|
-
((
|
|
48
|
+
((d = e(i)) == null ? void 0 : d.uid) === p ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
|
|
49
49
|
])
|
|
50
50
|
}, [
|
|
51
51
|
o(e(u), {
|
|
@@ -101,27 +101,28 @@ const R = { class: "flex items-center text-sm w-[inherit]" }, U = { class: "font
|
|
|
101
101
|
})
|
|
102
102
|
]),
|
|
103
103
|
o(e(I), {
|
|
104
|
-
bodyClass: "
|
|
104
|
+
bodyClass: "m-0 p-1 rounded-lg border-t-0",
|
|
105
|
+
class: "absolute z-overlay",
|
|
105
106
|
size: "xxs",
|
|
106
107
|
state: e(c),
|
|
107
108
|
variant: "form"
|
|
108
109
|
}, {
|
|
109
110
|
default: r(() => [
|
|
110
111
|
s("form", {
|
|
111
|
-
class: "flex gap-1
|
|
112
|
-
onSubmit:
|
|
112
|
+
class: "flex gap-1",
|
|
113
|
+
onSubmit: k(S, ["prevent"])
|
|
113
114
|
}, [
|
|
114
115
|
B(s("input", {
|
|
115
|
-
"onUpdate:modelValue": t[1] || (t[1] = (a) =>
|
|
116
|
+
"onUpdate:modelValue": t[1] || (t[1] = (a) => l.value = a),
|
|
116
117
|
class: "border-none outline-none flex-1 w-full text-sm min-h-8 p-1.5",
|
|
117
118
|
placeholder: "New Workspace",
|
|
118
119
|
type: "text"
|
|
119
120
|
}, null, 512), [
|
|
120
|
-
[V,
|
|
121
|
+
[V, l.value]
|
|
121
122
|
]),
|
|
122
123
|
o(e(b), {
|
|
123
124
|
class: "max-h-8 text-xs p-0 px-3",
|
|
124
|
-
disabled: !
|
|
125
|
+
disabled: !l.value.trim(),
|
|
125
126
|
type: "submit"
|
|
126
127
|
}, {
|
|
127
128
|
default: r(() => t[3] || (t[3] = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/components/Search/useSearch.ts"],"names":[],"mappings":"AAIA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAI/C;;;GAGG;AACH,wBAAgB,SAAS;;;
|
|
1
|
+
{"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/components/Search/useSearch.ts"],"names":[],"mappings":"AAIA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAI/C;;;GAGG;AACH,wBAAgB,SAAS;;;eAUd,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;;;iCAkHsB,UAAU;eAvHrC,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;MAkH0C;sBAxDjC,IAAI;;;uCAae,IAAI,GAAG,MAAM;;EAyExD"}
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import { useActiveEntities as
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import
|
|
4
|
-
import { ref as
|
|
5
|
-
import { useRouter as
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
1
|
+
import { useActiveEntities as H } from "../../store/active-entities.js";
|
|
2
|
+
import { isDefined as k, shouldIgnoreEntity as S } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import L from "fuse.js";
|
|
4
|
+
import { ref as o, watch as y, computed as I, nextTick as M } from "vue";
|
|
5
|
+
import { useRouter as V } from "vue-router";
|
|
6
|
+
import { useWorkspace as $ } from "../../store/store.js";
|
|
7
|
+
function K() {
|
|
8
|
+
const T = V(), {
|
|
9
|
+
activeWorkspace: b,
|
|
10
|
+
activeWorkspaceRequests: h,
|
|
11
|
+
activeWorkspaceCollections: W
|
|
12
|
+
} = H(), { requests: w, tags: E } = $(), u = o([]), r = o([]), a = o(0), n = o(""), c = o(null), f = o([]), m = new L(u.value, {
|
|
9
13
|
keys: ["title", "description", "body"]
|
|
10
|
-
}),
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
u.value = e.
|
|
14
|
-
var
|
|
14
|
+
}), x = () => {
|
|
15
|
+
n.value = "", a.value = 0, r.value = [], c.value instanceof HTMLInputElement && c.value.blur();
|
|
16
|
+
}, A = (e) => {
|
|
17
|
+
u.value = e.filter((t) => S(t)).filter((t) => {
|
|
18
|
+
var g;
|
|
19
|
+
const s = (g = W.value) == null ? void 0 : g.find(
|
|
20
|
+
(l) => l.requests.includes(t.uid)
|
|
21
|
+
);
|
|
22
|
+
return !!!(s != null && s.tags.map((l) => E[l]).filter(k).filter((l) => {
|
|
23
|
+
var R;
|
|
24
|
+
return (R = t.tags) == null ? void 0 : R.includes(l.name);
|
|
25
|
+
}).filter((l) => S(l)).length);
|
|
26
|
+
}).map((t) => {
|
|
27
|
+
var s;
|
|
15
28
|
return {
|
|
16
29
|
id: t.uid,
|
|
17
30
|
title: t.summary ?? t.method,
|
|
@@ -19,58 +32,58 @@ function P() {
|
|
|
19
32
|
httpVerb: t.method,
|
|
20
33
|
path: t.path,
|
|
21
34
|
// TODO: Use router instead
|
|
22
|
-
link: `/workspace/${(
|
|
35
|
+
link: `/workspace/${(s = b.value) == null ? void 0 : s.uid}/request/${t.uid}`
|
|
23
36
|
};
|
|
24
|
-
}),
|
|
25
|
-
},
|
|
26
|
-
|
|
37
|
+
}), m.setCollection(u.value);
|
|
38
|
+
}, p = () => {
|
|
39
|
+
a.value = 0, r.value = m.search(n.value);
|
|
27
40
|
};
|
|
28
|
-
|
|
29
|
-
e.length ?
|
|
41
|
+
y(n, (e) => {
|
|
42
|
+
e.length ? p() : r.value = [];
|
|
30
43
|
});
|
|
31
|
-
const
|
|
32
|
-
const t = e === "up" ? -1 : 1,
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
44
|
+
const C = (e) => {
|
|
45
|
+
const t = e === "up" ? -1 : 1, s = i.value.length;
|
|
46
|
+
a.value = (a.value + t + s) % s, M(() => {
|
|
47
|
+
const v = f.value[a.value];
|
|
48
|
+
v instanceof HTMLElement && v.scrollIntoView({
|
|
36
49
|
behavior: "smooth",
|
|
37
50
|
block: "center"
|
|
38
51
|
});
|
|
39
52
|
});
|
|
40
|
-
},
|
|
41
|
-
if (
|
|
42
|
-
const e =
|
|
43
|
-
e &&
|
|
53
|
+
}, D = () => {
|
|
54
|
+
if (a.value >= 0) {
|
|
55
|
+
const e = i.value[a.value];
|
|
56
|
+
e && d(e);
|
|
44
57
|
}
|
|
45
|
-
},
|
|
46
|
-
() =>
|
|
58
|
+
}, F = I(
|
|
59
|
+
() => h.value.map((e) => w[e]).filter(k)
|
|
47
60
|
);
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
y(
|
|
62
|
+
h,
|
|
50
63
|
() => {
|
|
51
|
-
|
|
64
|
+
A(F.value);
|
|
52
65
|
},
|
|
53
66
|
{ immediate: !0 }
|
|
54
67
|
);
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
() =>
|
|
68
|
+
const d = (e) => {
|
|
69
|
+
T.push(e.item.id), x();
|
|
70
|
+
}, i = I(
|
|
71
|
+
() => n.value.length === 0 ? u.value.map((e) => ({
|
|
59
72
|
item: e
|
|
60
|
-
})) :
|
|
73
|
+
})) : r.value
|
|
61
74
|
);
|
|
62
75
|
return {
|
|
63
|
-
searchText:
|
|
64
|
-
searchResultsWithPlaceholderResults:
|
|
65
|
-
selectedSearchResult:
|
|
66
|
-
onSearchResultClick:
|
|
67
|
-
fuseSearch:
|
|
68
|
-
searchInputRef:
|
|
69
|
-
searchResultRefs:
|
|
70
|
-
navigateSearchResults:
|
|
71
|
-
selectSearchResult:
|
|
76
|
+
searchText: n,
|
|
77
|
+
searchResultsWithPlaceholderResults: i,
|
|
78
|
+
selectedSearchResult: a,
|
|
79
|
+
onSearchResultClick: d,
|
|
80
|
+
fuseSearch: p,
|
|
81
|
+
searchInputRef: c,
|
|
82
|
+
searchResultRefs: f,
|
|
83
|
+
navigateSearchResults: C,
|
|
84
|
+
selectSearchResult: D
|
|
72
85
|
};
|
|
73
86
|
}
|
|
74
87
|
export {
|
|
75
|
-
|
|
88
|
+
K as useSearch
|
|
76
89
|
};
|
|
@@ -11,8 +11,8 @@ const h = /* @__PURE__ */ a({
|
|
|
11
11
|
setup(f) {
|
|
12
12
|
const { layout: n } = d();
|
|
13
13
|
return (e, w) => (r(), i(m(e.is ?? "a"), {
|
|
14
|
-
class: s(["hover:bg-b-
|
|
15
|
-
"bg-b-
|
|
14
|
+
class: s(["hover:bg-b-2 no-underline min-w-[37px] max-w-[37px] flex items-center justify-center rounded-lg p-2", {
|
|
15
|
+
"bg-b-2 transition-none hover:cursor-auto text-c-1": e.active,
|
|
16
16
|
"sm:min-w-max sm:max-w-max sm:rounded sm:py-1.5": o(n) === "web"
|
|
17
17
|
}])
|
|
18
18
|
}, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Sidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9571ad76"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -3,7 +3,7 @@ import { useBreakpoints as z } from "@scalar/use-hooks/useBreakpoints";
|
|
|
3
3
|
import { useWorkspace as B } from "../../store/store.js";
|
|
4
4
|
const C = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "min-h-12 xl:min-h-client-header flex items-center justify-between px-3 py-1.5 md:px-
|
|
6
|
+
class: "min-h-12 xl:min-h-client-header flex items-center justify-between px-3 py-1.5 md:px-[18px] md:py-2.5 text-sm"
|
|
7
7
|
}, I = { class: "font-medium m-0 text-sm whitespace-nowrap" }, O = { class: "relative z-10 pt-0 md:px-2.5 md:pb-2.5 sticky bottom-0 w-[inherit] has-[.empty-sidebar-item]:border-t-1/2" }, V = /* @__PURE__ */ S({
|
|
8
8
|
__name: "Sidebar",
|
|
9
9
|
props: {
|
|
@@ -11,14 +11,14 @@ const C = {
|
|
|
11
11
|
isSidebarOpen: { type: Boolean, default: !0 }
|
|
12
12
|
},
|
|
13
13
|
setup(y) {
|
|
14
|
-
const w = y, { isReadOnly: c, sidebarWidth: o, setSidebarWidth: i } = B(), a = g(!1), p = g(null), { breakpoints: d } = z(),
|
|
14
|
+
const w = y, { isReadOnly: c, sidebarWidth: o, setSidebarWidth: i } = B(), a = g(!1), p = g(null), { breakpoints: d } = z(), x = (e) => {
|
|
15
15
|
e.preventDefault();
|
|
16
|
-
const f = e.clientX,
|
|
16
|
+
const f = e.clientX, k = parseInt(
|
|
17
17
|
getComputedStyle(p.value).width || o.value,
|
|
18
18
|
10
|
|
19
19
|
), v = (E) => {
|
|
20
20
|
a.value = !0, document.body.classList.add("dragging");
|
|
21
|
-
let t =
|
|
21
|
+
let t = k + E.clientX - f;
|
|
22
22
|
t > 420 && (t = 420 + (t - 420) * 0.2), t < 240 && (t = 240), i(`${t}px`);
|
|
23
23
|
}, b = () => {
|
|
24
24
|
a.value = !1, document.body.classList.remove("dragging"), document.documentElement.removeEventListener("mousemove", v, !1), document.documentElement.removeEventListener("mouseup", b, !1), parseInt(o.value, 10) > 420 ? i("360px") : parseInt(o.value, 10) < 240 && i("240px");
|
|
@@ -49,7 +49,7 @@ const C = {
|
|
|
49
49
|
]),
|
|
50
50
|
r("div", {
|
|
51
51
|
class: "resizer",
|
|
52
|
-
onMousedown:
|
|
52
|
+
onMousedown: x
|
|
53
53
|
}, null, 32)
|
|
54
54
|
], 64)) : u("", !0)
|
|
55
55
|
], 6)), [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { openBlock as o, createElementBlock as t, renderSlot as r } from "vue";
|
|
2
2
|
import c from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
const s = {}, l = { class: "flex flex-col
|
|
3
|
+
const s = {}, l = { class: "gap-1/2 flex flex-col px-3 pb-[75px]" };
|
|
4
4
|
function n(e, f) {
|
|
5
5
|
return o(), t("ul", l, [
|
|
6
6
|
r(e.$slots, "default")
|
|
@@ -12,7 +12,7 @@ type __VLS_Props = {
|
|
|
12
12
|
isDeletable?: boolean;
|
|
13
13
|
isCopyable?: boolean;
|
|
14
14
|
isRenameable?: boolean;
|
|
15
|
-
type: 'environment' | 'cookies' | '
|
|
15
|
+
type: 'environment' | 'cookies' | 'servers';
|
|
16
16
|
};
|
|
17
17
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
18
18
|
delete: (id: string) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarListElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarListElement.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarListElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarListElement.vue"],"names":[],"mappings":"AAwHA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,oBAAoB,CAAA;AAK1D,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE,IAAI,CAAA;QACX,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB,CAAA;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,CAAA;CAC5C,CAAC;;;;;;;;;;AA0NF,wBAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./SidebarListElement.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-b9e543a3"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|