@scalar/api-client 2.2.22 → 2.2.24
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 +22 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +69 -70
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +69 -61
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
- package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +42 -38
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
- package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +22 -19
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +57 -49
- package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
- 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 +38 -36
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +71 -64
- package/dist/layouts/App/ApiClientApp.vue.js +4 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
- package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
- package/dist/libs/create-client.d.ts +10 -10
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +42 -36
- package/dist/libs/extractAttachmentFilename.d.ts +3 -0
- package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
- package/dist/libs/extractAttachmentFilename.js +7 -7
- package/dist/libs/importers/curl.d.ts.map +1 -1
- package/dist/libs/importers/curl.js +18 -18
- package/dist/libs/normalize-headers.d.ts.map +1 -1
- package/dist/libs/normalize-headers.js +2 -2
- package/dist/libs/parse-curl.js +39 -36
- package/dist/store/active-entities.d.ts +4 -4
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +88 -86
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +29 -29
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +27 -23
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +94 -77
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +27 -27
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +18 -18
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +35 -33
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +14 -9
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +39 -37
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +94 -89
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +118 -116
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +149 -144
- 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 +168 -150
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.js +37 -31
- package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +147 -130
- package/dist/views/Request/types/sidebar-item.d.ts +4 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.js +38 -35
- package/dist/views/Servers/Servers.vue2.js +38 -35
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/dist/views/Settings/Settings.vue2.js +15 -15
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
- package/package.json +8 -8
|
@@ -1,109 +1,112 @@
|
|
|
1
|
-
import { defineComponent as N, computed as f, watch as B, onMounted as D, openBlock as
|
|
1
|
+
import { defineComponent as N, computed as f, watch as B, onMounted as D, openBlock as c, createElementBlock as x, createVNode as s, unref as n, withCtx as l, Fragment as j, renderList as M, createBlock as w, withModifiers as h, createTextVNode as E, toDisplayString as k, createElementVNode as u, normalizeClass as V, createCommentVNode as z } from "vue";
|
|
2
2
|
import { useActiveEntities as W } from "../../store/active-entities.js";
|
|
3
|
-
import { ScalarDropdown as L, ScalarDropdownItem as
|
|
3
|
+
import { ScalarDropdown as L, ScalarDropdownItem as m, ScalarListboxCheckbox as O, ScalarIcon as g, ScalarDropdownDivider as R, ScalarButton as $ } from "@scalar/components";
|
|
4
4
|
import { useRouter as A } from "vue-router";
|
|
5
5
|
import { useWorkspace as F } from "../../store/store.js";
|
|
6
6
|
const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap" }, q = { class: "flex items-center justify-center h-4 w-4" }, U = /* @__PURE__ */ N({
|
|
7
7
|
__name: "EnvironmentSelector",
|
|
8
8
|
setup(G) {
|
|
9
|
-
const { activeCollection: o, activeWorkspace:
|
|
10
|
-
o.value && (_.edit(
|
|
9
|
+
const { activeCollection: o, activeWorkspace: i, activeEnvironment: v } = W(), { isReadOnly: C, collectionMutators: _ } = F(), b = A(), d = (e) => {
|
|
10
|
+
o.value && i.value && (_.edit(
|
|
11
11
|
o.value.uid,
|
|
12
12
|
"x-scalar-active-environment",
|
|
13
|
-
|
|
14
|
-
),
|
|
15
|
-
}, S = () =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
e
|
|
14
|
+
), i.value.activeEnvironmentId = e);
|
|
15
|
+
}, S = () => {
|
|
16
|
+
var e;
|
|
17
|
+
return b.push({
|
|
18
|
+
name: "environment",
|
|
19
|
+
params: {
|
|
20
|
+
environment: (e = i.value) == null ? void 0 : e.uid
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}, y = f(() => {
|
|
24
|
+
const { value: e } = v, { value: t } = o;
|
|
25
|
+
return (e == null ? void 0 : e.uid) || (t == null ? void 0 : t["x-scalar-active-environment"]) || "Environment";
|
|
23
26
|
}), I = f(() => {
|
|
24
|
-
const { value:
|
|
25
|
-
return
|
|
26
|
-
...
|
|
27
|
+
const { value: e } = o, t = e == null ? void 0 : e["x-scalar-environments"];
|
|
28
|
+
return t ? Object.entries(t).map(([a, r]) => ({
|
|
29
|
+
...r,
|
|
27
30
|
uid: a,
|
|
28
31
|
name: a
|
|
29
32
|
})) : [];
|
|
30
|
-
}), p = (
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
+
}), p = (e) => {
|
|
34
|
+
const t = e["x-scalar-active-environment"];
|
|
35
|
+
t && o.value && i.value ? (o.value["x-scalar-active-environment"] = t, i.value.activeEnvironmentId = t) : i.value && (i.value.activeEnvironmentId = "");
|
|
33
36
|
};
|
|
34
|
-
return B(o, (
|
|
35
|
-
p(
|
|
37
|
+
return B(o, (e) => {
|
|
38
|
+
p(e);
|
|
36
39
|
}), D(() => {
|
|
37
40
|
p(o.value);
|
|
38
|
-
}), (
|
|
39
|
-
|
|
40
|
-
items:
|
|
41
|
-
(
|
|
41
|
+
}), (e, t) => (c(), x("div", null, [
|
|
42
|
+
s(n(L), { placement: "bottom-end" }, {
|
|
43
|
+
items: l(() => [
|
|
44
|
+
(c(!0), x(j, null, M(I.value, (a) => (c(), w(n(m), {
|
|
42
45
|
key: a.uid,
|
|
43
46
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
|
|
44
|
-
onClick: h((
|
|
47
|
+
onClick: h((r) => d(a.uid), ["stop"])
|
|
45
48
|
}, {
|
|
46
|
-
default:
|
|
47
|
-
var
|
|
49
|
+
default: l(() => {
|
|
50
|
+
var r;
|
|
48
51
|
return [
|
|
49
|
-
|
|
50
|
-
selected: ((
|
|
52
|
+
s(n(O), {
|
|
53
|
+
selected: ((r = n(o)) == null ? void 0 : r["x-scalar-active-environment"]) === a.uid
|
|
51
54
|
}, null, 8, ["selected"]),
|
|
52
55
|
E(" " + k(a.name), 1)
|
|
53
56
|
];
|
|
54
57
|
}),
|
|
55
58
|
_: 2
|
|
56
59
|
}, 1032, ["onClick"]))), 128)),
|
|
57
|
-
|
|
60
|
+
s(n(m), {
|
|
58
61
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
|
|
59
|
-
onClick:
|
|
62
|
+
onClick: t[0] || (t[0] = h((a) => d(""), ["stop"]))
|
|
60
63
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
var a;
|
|
64
|
+
default: l(() => {
|
|
65
|
+
var a, r;
|
|
63
66
|
return [
|
|
64
|
-
|
|
67
|
+
u("div", {
|
|
65
68
|
class: V([
|
|
66
69
|
"flex items-center justify-center rounded-full p-[3px] w-4 h-4",
|
|
67
|
-
n(v).uid === "" && ((
|
|
70
|
+
((a = n(v)) == null ? void 0 : a.uid) === "" && ((r = n(o)) == null ? void 0 : r["x-scalar-active-environment"]) === "" ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
|
|
68
71
|
])
|
|
69
72
|
}, [
|
|
70
|
-
|
|
73
|
+
s(n(g), {
|
|
71
74
|
class: "size-2.5",
|
|
72
75
|
icon: "Checkmark",
|
|
73
76
|
thickness: "3.5"
|
|
74
77
|
})
|
|
75
78
|
], 2),
|
|
76
|
-
|
|
79
|
+
t[1] || (t[1] = E(" No Environment "))
|
|
77
80
|
];
|
|
78
81
|
}),
|
|
79
82
|
_: 1
|
|
80
83
|
}),
|
|
81
|
-
|
|
82
|
-
n(C) ? z("", !0) : (
|
|
84
|
+
s(n(R)),
|
|
85
|
+
n(C) ? z("", !0) : (c(), w(n(m), {
|
|
83
86
|
key: 0,
|
|
84
87
|
class: "flex items-center gap-1.5",
|
|
85
88
|
onClick: S
|
|
86
89
|
}, {
|
|
87
|
-
default:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
default: l(() => [
|
|
91
|
+
u("div", q, [
|
|
92
|
+
s(n(g), {
|
|
90
93
|
icon: "Brackets",
|
|
91
94
|
size: "sm"
|
|
92
95
|
})
|
|
93
96
|
]),
|
|
94
|
-
|
|
97
|
+
t[2] || (t[2] = u("span", { class: "leading-none" }, "Manage Environments", -1))
|
|
95
98
|
]),
|
|
96
99
|
_: 1
|
|
97
100
|
}))
|
|
98
101
|
]),
|
|
99
|
-
default:
|
|
100
|
-
|
|
102
|
+
default: l(() => [
|
|
103
|
+
s(n($), {
|
|
101
104
|
class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 w-fit",
|
|
102
105
|
fullWidth: "",
|
|
103
106
|
variant: "ghost"
|
|
104
107
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
|
|
108
|
+
default: l(() => [
|
|
109
|
+
u("h2", T, k(y.value), 1)
|
|
107
110
|
]),
|
|
108
111
|
_: 1
|
|
109
112
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;AAwVA,wBAOG"}
|
|
@@ -1,81 +1,84 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as x, ref as h, onMounted as D, onBeforeUnmount as E, openBlock as g, createBlock as T, Transition as _, withCtx as L, createElementBlock as C, createElementVNode as d, createVNode as b, unref as k, createCommentVNode as A } from "vue";
|
|
2
|
+
import { ScalarIcon as w } from "@scalar/components";
|
|
3
|
+
const B = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "fixed translate-x-1/2 translate-y-1/2 md:translate-x-0 md:translate-y-0 right-1/2 bottom-1/2 md:bottom-10 md:right-10 w-64 h-64 bg-b-2 z-50 rounded-xl border transition-opacity duration-200"
|
|
6
|
-
},
|
|
6
|
+
}, F = { class: "flex flex-col items-center justify-center h-full" }, z = /* @__PURE__ */ x({
|
|
7
7
|
__name: "DropEventListener",
|
|
8
8
|
emits: ["input"],
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
document.addEventListener("dragenter",
|
|
14
|
-
}),
|
|
15
|
-
document.removeEventListener("dragenter",
|
|
9
|
+
setup(N, { emit: y }) {
|
|
10
|
+
const c = y, a = h(!1);
|
|
11
|
+
let i = 0;
|
|
12
|
+
D(() => {
|
|
13
|
+
document.addEventListener("dragenter", v), document.addEventListener("dragleave", m), document.addEventListener("dragover", p), document.addEventListener("drop", f);
|
|
14
|
+
}), E(() => {
|
|
15
|
+
document.removeEventListener("dragenter", v), document.removeEventListener("dragover", p), document.removeEventListener("dragleave", m), document.removeEventListener("drop", f);
|
|
16
16
|
});
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
return ((
|
|
17
|
+
function u(e) {
|
|
18
|
+
var n;
|
|
19
|
+
return ((n = e.dataTransfer) == null ? void 0 : n.types.includes("text/html")) ?? !1;
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
22
|
-
if (e.preventDefault(),
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
|
|
21
|
+
async function f(e) {
|
|
22
|
+
if (e.preventDefault(), a.value = !1, i = 0, !u(e) && e.dataTransfer) {
|
|
23
|
+
const n = e.dataTransfer.getData("text").replace(/^blob:/, "");
|
|
24
|
+
if (n)
|
|
25
|
+
c("input", n, null, "drop");
|
|
26
26
|
else if (e.dataTransfer.files.length > 0) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const o = e.dataTransfer.files[0];
|
|
28
|
+
if (!o) return;
|
|
29
|
+
const s = new FileReader();
|
|
30
|
+
s.onload = async (r) => {
|
|
31
|
+
r.target && typeof r.target.result == "string" && c("input", r.target.result, null, "drop");
|
|
32
|
+
}, s.readAsText(o);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
|
-
function
|
|
36
|
+
function p(e) {
|
|
35
37
|
e.preventDefault();
|
|
36
38
|
}
|
|
37
|
-
function f(e) {
|
|
38
|
-
e.preventDefault(), o--, o === 0 && (r.value = !1);
|
|
39
|
-
}
|
|
40
39
|
function m(e) {
|
|
41
|
-
|
|
40
|
+
e.preventDefault(), i--, i === 0 && (a.value = !1);
|
|
41
|
+
}
|
|
42
|
+
function v(e) {
|
|
43
|
+
var n, o, s;
|
|
44
|
+
if (e.preventDefault(), i++, !u(e)) {
|
|
42
45
|
if (e.dataTransfer) {
|
|
43
|
-
const
|
|
44
|
-
for (let
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
46
|
+
const r = e.dataTransfer.items;
|
|
47
|
+
for (let l = 0; l < r.length; l++) {
|
|
48
|
+
const t = r[l];
|
|
49
|
+
if ((t == null ? void 0 : t.kind) === "string" || (n = t == null ? void 0 : t.type) != null && n.includes("json") || (o = t == null ? void 0 : t.type) != null && o.includes("yml") || (s = t == null ? void 0 : t.type) != null && s.includes("yaml")) {
|
|
50
|
+
a.value = !0;
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
|
-
|
|
55
|
+
a.value = !1;
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
return (e,
|
|
58
|
+
return (e, n) => (g(), T(_, {
|
|
56
59
|
enterActiveClass: "transition-opacity duration-200",
|
|
57
60
|
enterFromClass: "opacity-0",
|
|
58
61
|
leaveActiveClass: "transition-opacity duration-200",
|
|
59
62
|
leaveToClass: "opacity-0"
|
|
60
63
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
default: L(() => [
|
|
65
|
+
a.value ? (g(), C("div", B, [
|
|
66
|
+
d("div", F, [
|
|
67
|
+
d("div", null, [
|
|
68
|
+
b(k(w), {
|
|
66
69
|
icon: "Download",
|
|
67
70
|
size: "xl",
|
|
68
71
|
thickness: "2"
|
|
69
72
|
})
|
|
70
73
|
]),
|
|
71
|
-
|
|
74
|
+
n[0] || (n[0] = d("div", { class: "text-center text-c-1 m-4" }, " Drop your OpenAPI document here ", -1))
|
|
72
75
|
])
|
|
73
|
-
])) :
|
|
76
|
+
])) : A("", !0)
|
|
74
77
|
]),
|
|
75
78
|
_: 1
|
|
76
79
|
}));
|
|
77
80
|
}
|
|
78
81
|
});
|
|
79
82
|
export {
|
|
80
|
-
|
|
83
|
+
z as default
|
|
81
84
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, ref as W, computed as c, watch as
|
|
1
|
+
import { defineComponent as H, ref as W, computed as c, watch as g, onMounted as K, onUnmounted as G, openBlock as l, createBlock as J, unref as i, withCtx as Q, createElementBlock as a, createCommentVNode as u, createElementVNode as e, normalizeClass as X, Fragment as b, createVNode as d, 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";
|
|
@@ -37,7 +37,7 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
37
37
|
},
|
|
38
38
|
emits: ["importFinished"],
|
|
39
39
|
setup(T, { emit: P }) {
|
|
40
|
-
const s = T, D = P, { activeWorkspace:
|
|
40
|
+
const s = T, D = P, { activeWorkspace: p } = re(), { workspaceMutators: V, events: j } = fe(), { prefetchResult: n, prefetchUrl: w, resetPrefetchResult: S } = ne(), r = ie(), v = W(!0);
|
|
41
41
|
j.hotKeys.on(() => r.hide());
|
|
42
42
|
const z = c(() => {
|
|
43
43
|
try {
|
|
@@ -50,9 +50,9 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
50
50
|
}), N = c(() => {
|
|
51
51
|
var o, t;
|
|
52
52
|
return (t = (o = z.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
|
|
53
|
-
}),
|
|
53
|
+
}), k = c(
|
|
54
54
|
() => U(n.content || s.source || "")
|
|
55
|
-
), { darkLightMode: O } = ue(), { currentRoute: $ } = pe(),
|
|
55
|
+
), { darkLightMode: O } = ue(), { currentRoute: $ } = pe(), h = c(() => {
|
|
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,51 +60,52 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
60
60
|
}
|
|
61
61
|
return null;
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
g(
|
|
64
64
|
() => s.source,
|
|
65
65
|
async (o) => {
|
|
66
|
-
var t;
|
|
66
|
+
var t, m;
|
|
67
67
|
if (S(), C(o)) {
|
|
68
68
|
if (s.eventType && ["paste", "drop"].includes(s.eventType)) {
|
|
69
|
-
const { error:
|
|
69
|
+
const { error: f } = await w(
|
|
70
70
|
o,
|
|
71
|
-
(t =
|
|
71
|
+
(t = p.value) == null ? void 0 : t.proxyUrl
|
|
72
72
|
);
|
|
73
|
-
|
|
73
|
+
f ? r.hide() : r.show();
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
w(o, (m = p.value) == null ? void 0 : m.proxyUrl), r.show();
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
o && A(o) && U(o) ? r.show() : r.hide();
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
const E = c(() => !!s.source && C(s.source)), F = c(() => !!s.source && A(s.source)),
|
|
82
|
+
const E = c(() => !!s.source && C(s.source)), F = c(() => !!s.source && A(s.source)), x = c(() => n.url && ae(n.url)), y = (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
|
+
g(
|
|
88
88
|
() => r.open,
|
|
89
89
|
(o) => {
|
|
90
|
-
o ?
|
|
90
|
+
o ? y() : R();
|
|
91
91
|
}
|
|
92
|
-
),
|
|
92
|
+
), g(
|
|
93
93
|
() => s.source,
|
|
94
94
|
() => {
|
|
95
|
-
|
|
95
|
+
y();
|
|
96
96
|
}
|
|
97
97
|
), K(() => {
|
|
98
|
-
|
|
98
|
+
y();
|
|
99
99
|
}), G(() => {
|
|
100
100
|
document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
|
|
101
101
|
});
|
|
102
|
-
const
|
|
103
|
-
() =>
|
|
102
|
+
const I = c(
|
|
103
|
+
() => p.value && x.value && s.integration && `<style>${me(s.integration)}</style>`
|
|
104
104
|
);
|
|
105
105
|
function q() {
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
var o;
|
|
107
|
+
x.value && s.integration && V.edit(
|
|
108
|
+
((o = p.value) == null ? void 0 : o.uid) ?? "",
|
|
108
109
|
"themeId",
|
|
109
110
|
s.integration
|
|
110
111
|
), D("importFinished");
|
|
@@ -114,12 +115,12 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
114
115
|
state: i(r)
|
|
115
116
|
}, {
|
|
116
117
|
default: Q(() => {
|
|
117
|
-
var
|
|
118
|
+
var m, _, f, L;
|
|
118
119
|
return [
|
|
119
|
-
|
|
120
|
+
I.value ? (l(), a("div", {
|
|
120
121
|
key: 0,
|
|
121
|
-
innerHTML:
|
|
122
|
-
}, null, 8, ve)) :
|
|
122
|
+
innerHTML: I.value
|
|
123
|
+
}, null, 8, ve)) : u("", !0),
|
|
123
124
|
e("div", he, [
|
|
124
125
|
t[6] || (t[6] = e("div", { class: "section-flare" }, [
|
|
125
126
|
e("div", { class: "section-flare-item" }),
|
|
@@ -134,30 +135,30 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
134
135
|
e("div", {
|
|
135
136
|
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" }])
|
|
136
137
|
}, [
|
|
137
|
-
i(n).error && i(n).state === "idle" && !
|
|
138
|
+
i(n).error && i(n).state === "idle" && !k.value ? (l(), a(b, { key: 0 }, [
|
|
138
139
|
t[1] || (t[1] = e("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
|
|
139
140
|
d(oe, {
|
|
140
|
-
url: ((
|
|
141
|
+
url: ((m = i(n)) == null ? void 0 : m.input) || s.source
|
|
141
142
|
}, null, 8, ["url"])
|
|
142
|
-
], 64)) : (l(), a(
|
|
143
|
-
|
|
143
|
+
], 64)) : (l(), a(b, { key: 1 }, [
|
|
144
|
+
x.value ? (l(), a("div", xe, [
|
|
144
145
|
e("div", ye, [
|
|
145
146
|
d(te, { integration: o.integration }, null, 8, ["integration"])
|
|
146
147
|
])
|
|
147
|
-
])) :
|
|
148
|
+
])) : h.value ? (l(), a("img", {
|
|
148
149
|
key: 1,
|
|
149
150
|
alt: "Logo",
|
|
150
151
|
class: "w-full object-contain mb-2",
|
|
151
|
-
src:
|
|
152
|
-
}, null, 8, _e)) :
|
|
153
|
-
|
|
152
|
+
src: h.value
|
|
153
|
+
}, null, 8, _e)) : u("", !0),
|
|
154
|
+
h.value ? u("", !0) : (l(), a("div", ge, Y(N.value || "Untitled Collection"), 1)),
|
|
154
155
|
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)),
|
|
155
|
-
|
|
156
|
+
k.value ? (l(), a(b, { key: 3 }, [
|
|
156
157
|
e("div", be, [
|
|
157
158
|
d(ee, {
|
|
158
|
-
source: ((
|
|
159
|
+
source: ((_ = i(n)) == null ? void 0 : _.url) ?? ((f = i(n)) == null ? void 0 : f.content) ?? o.source,
|
|
159
160
|
variant: "button",
|
|
160
|
-
watchMode:
|
|
161
|
+
watchMode: v.value,
|
|
161
162
|
onImportFinished: q
|
|
162
163
|
}, null, 8, ["source", "watchMode"])
|
|
163
164
|
]),
|
|
@@ -170,14 +171,14 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
|
|
|
170
171
|
(L = i(n)) != null && L.url ? (l(), a("div", Ie, [
|
|
171
172
|
e("div", Le, [
|
|
172
173
|
d(Z, {
|
|
173
|
-
modelValue:
|
|
174
|
-
"onUpdate:modelValue": t[0] || (t[0] = (B) =>
|
|
174
|
+
modelValue: v.value,
|
|
175
|
+
"onUpdate:modelValue": t[0] || (t[0] = (B) => v.value = B),
|
|
175
176
|
disableToolTip: !0
|
|
176
177
|
}, null, 8, ["modelValue"])
|
|
177
178
|
]),
|
|
178
179
|
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))
|
|
179
|
-
])) :
|
|
180
|
-
], 64)) :
|
|
180
|
+
])) : u("", !0)
|
|
181
|
+
], 64)) : u("", !0)
|
|
181
182
|
], 64))
|
|
182
183
|
], 2),
|
|
183
184
|
e("div", Me, [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isUrl as
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import { ScalarButton as
|
|
5
|
-
import { useToasts as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as b, openBlock as n, createElementBlock as g, Fragment as B, createBlock as c, unref as l, withCtx as f, createTextVNode as d, createCommentVNode as F } from "vue";
|
|
2
|
+
import { isUrl as I } from "./utils/isUrl.js";
|
|
3
|
+
import { useActiveEntities as U } from "../../store/active-entities.js";
|
|
4
|
+
import { ScalarButton as y } from "@scalar/components";
|
|
5
|
+
import { useToasts as q } from "@scalar/use-toasts";
|
|
6
|
+
import { useRouter as M } from "vue-router";
|
|
7
|
+
import { useWorkspace as T } from "../../store/store.js";
|
|
8
|
+
const _ = /* @__PURE__ */ b({
|
|
9
9
|
__name: "ImportNowButton",
|
|
10
10
|
props: {
|
|
11
11
|
source: {},
|
|
@@ -13,73 +13,75 @@ const R = /* @__PURE__ */ v({
|
|
|
13
13
|
watchMode: { type: Boolean }
|
|
14
14
|
},
|
|
15
15
|
emits: ["importFinished"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
async function
|
|
16
|
+
setup(k, { emit: w }) {
|
|
17
|
+
const r = k, h = w, v = M(), { activeWorkspace: s } = U(), { importSpecFromUrl: C, importSpecFile: x } = T(), { toast: u } = q();
|
|
18
|
+
async function a() {
|
|
19
|
+
var t, e, m;
|
|
19
20
|
try {
|
|
20
|
-
if (
|
|
21
|
-
if (
|
|
22
|
-
const [
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
if (r.source) {
|
|
22
|
+
if (I(r.source)) {
|
|
23
|
+
const [o, i] = await C(
|
|
24
|
+
r.source,
|
|
25
|
+
((t = s.value) == null ? void 0 : t.uid) ?? "",
|
|
25
26
|
{
|
|
26
|
-
proxyUrl:
|
|
27
|
-
watchMode:
|
|
27
|
+
proxyUrl: (e = s.value) == null ? void 0 : e.proxyUrl,
|
|
28
|
+
watchMode: r.watchMode
|
|
28
29
|
}
|
|
29
30
|
);
|
|
30
|
-
|
|
31
|
+
o || p(i);
|
|
31
32
|
} else {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const o = await x(
|
|
34
|
+
r.source,
|
|
35
|
+
((m = s.value) == null ? void 0 : m.uid) ?? ""
|
|
35
36
|
);
|
|
36
|
-
|
|
37
|
+
p(o);
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
u("Import successful", "info"), h("importFinished");
|
|
39
40
|
}
|
|
40
|
-
} catch (
|
|
41
|
-
console.error("[importCollection]",
|
|
42
|
-
const
|
|
43
|
-
|
|
41
|
+
} catch (o) {
|
|
42
|
+
console.error("[importCollection]", o);
|
|
43
|
+
const i = (o == null ? void 0 : o.message) || "Unknown error";
|
|
44
|
+
u(`Import failed: ${i}`, "error");
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
47
|
+
function p(t) {
|
|
48
|
+
var e;
|
|
49
|
+
t && v.push({
|
|
48
50
|
name: "request",
|
|
49
51
|
params: {
|
|
50
|
-
workspace:
|
|
52
|
+
workspace: (e = s.value) == null ? void 0 : e.uid,
|
|
51
53
|
request: t == null ? void 0 : t.requests[0]
|
|
52
54
|
}
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
|
-
return (t, e) => t.source ? (
|
|
56
|
-
t.variant === "button" ? (
|
|
57
|
+
return (t, e) => t.source ? (n(), g(B, { key: 0 }, [
|
|
58
|
+
t.variant === "button" ? (n(), c(l(y), {
|
|
57
59
|
key: 0,
|
|
58
60
|
class: "py-2.5 px-6 rounded-lg font-bold h-fit mt-3 w-full",
|
|
59
61
|
size: "md",
|
|
60
62
|
type: "button",
|
|
61
|
-
onClick:
|
|
63
|
+
onClick: a
|
|
62
64
|
}, {
|
|
63
|
-
default:
|
|
64
|
-
|
|
65
|
+
default: f(() => e[0] || (e[0] = [
|
|
66
|
+
d(" Import Collection ")
|
|
65
67
|
])),
|
|
66
68
|
_: 1
|
|
67
|
-
})) : (
|
|
69
|
+
})) : (n(), c(l(y), {
|
|
68
70
|
key: 1,
|
|
69
71
|
class: "text-[21px] py-2.5 px-6 rounded-lg font-bold h-fit",
|
|
70
72
|
size: "md",
|
|
71
73
|
type: "button",
|
|
72
74
|
variant: "ghost",
|
|
73
|
-
onClick:
|
|
75
|
+
onClick: a
|
|
74
76
|
}, {
|
|
75
|
-
default:
|
|
76
|
-
|
|
77
|
+
default: f(() => e[1] || (e[1] = [
|
|
78
|
+
d(" Try it in the browser ")
|
|
77
79
|
])),
|
|
78
80
|
_: 1
|
|
79
81
|
}))
|
|
80
|
-
], 64)) :
|
|
82
|
+
], 64)) : F("", !0);
|
|
81
83
|
}
|
|
82
84
|
});
|
|
83
85
|
export {
|
|
84
|
-
|
|
86
|
+
_ as default
|
|
85
87
|
};
|