@scalar/api-client 2.17.6 → 2.17.8
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 +40 -0
- package/dist/components/CommandPalette/CommandActionInput.vue.js +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +5 -5
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.js +18 -18
- package/dist/components/Sidebar/Actions/EditSidebarListElement.vue.js +7 -7
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +44 -5
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +2 -44
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.js +22 -17
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -10
- 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 +149 -126
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts +20 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +7 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue2.js +76 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +22 -5
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +79 -64
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +16 -8
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +84 -82
- package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.js +43 -5
- package/dist/v2/components/forms/ConfirmationForm.vue2.js +2 -43
- package/dist/v2/components/modals/DeleteModal.vue.js +11 -11
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/DocumentSettings.vue.js +104 -5
- package/dist/v2/features/settings/DocumentSettings.vue2.js +2 -104
- package/dist/views/Collection/CollectionSettings.vue.d.ts.map +1 -1
- package/dist/views/Collection/CollectionSettings.vue.js +1 -4
- package/dist/views/Collection/CollectionSettings.vue2.js +5 -5
- package/dist/views/Environment/EnvironmentColorModal.vue.js +6 -6
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +12 -12
|
@@ -1,128 +1,130 @@
|
|
|
1
|
-
import { makeUrlAbsolute as
|
|
2
|
-
import { shouldUseProxy as
|
|
3
|
-
import { encode as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return crypto.getRandomValues(
|
|
7
|
-
}, z = async (
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
1
|
+
import { makeUrlAbsolute as b } from "@scalar/helpers/url/make-url-absolute";
|
|
2
|
+
import { shouldUseProxy as E } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { encode as A, fromUint8Array as C } from "js-base64";
|
|
4
|
+
const S = () => {
|
|
5
|
+
const s = new Uint8Array(32);
|
|
6
|
+
return crypto.getRandomValues(s), C(s, !0);
|
|
7
|
+
}, z = async (s, e) => {
|
|
8
|
+
if (e === "plain")
|
|
9
|
+
return s;
|
|
10
10
|
if (typeof crypto?.subtle?.digest != "function")
|
|
11
|
-
return console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead."),
|
|
12
|
-
const l = new TextEncoder().encode(
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
-
const d =
|
|
11
|
+
return console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead."), s;
|
|
12
|
+
const l = new TextEncoder().encode(s), f = await crypto.subtle.digest("SHA-256", l);
|
|
13
|
+
return C(new Uint8Array(f), !0);
|
|
14
|
+
}, L = async (s, e, g, l, f) => {
|
|
15
|
+
const d = s[e];
|
|
16
16
|
try {
|
|
17
17
|
if (!d)
|
|
18
18
|
return [new Error("Flow not found"), null];
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
19
|
+
const m = g.join(" ");
|
|
20
|
+
if (e === "clientCredentials" || e === "password")
|
|
21
21
|
return U(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
s,
|
|
23
|
+
e,
|
|
24
|
+
m,
|
|
25
25
|
{
|
|
26
|
-
proxyUrl:
|
|
26
|
+
proxyUrl: f
|
|
27
27
|
},
|
|
28
28
|
l
|
|
29
29
|
);
|
|
30
|
-
const
|
|
30
|
+
const t = (Math.random() + 1).toString(36).substring(2, 10), a = b(s[e].authorizationUrl, {
|
|
31
31
|
baseUrl: l?.url
|
|
32
32
|
}), n = new URL(a);
|
|
33
|
-
let
|
|
34
|
-
if (
|
|
33
|
+
let c = null;
|
|
34
|
+
if (e === "implicit")
|
|
35
35
|
n.searchParams.set("response_type", "token");
|
|
36
|
-
else if (
|
|
37
|
-
const
|
|
38
|
-
if (n.searchParams.set("response_type", "code"),
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
codeVerifier:
|
|
42
|
-
codeChallenge:
|
|
43
|
-
codeChallengeMethod:
|
|
44
|
-
}, n.searchParams.set("code_challenge",
|
|
36
|
+
else if (e === "authorizationCode") {
|
|
37
|
+
const r = s[e];
|
|
38
|
+
if (n.searchParams.set("response_type", "code"), r["x-usePkce"] !== "no") {
|
|
39
|
+
const o = S(), u = await z(o, r["x-usePkce"]);
|
|
40
|
+
c = {
|
|
41
|
+
codeVerifier: o,
|
|
42
|
+
codeChallenge: u,
|
|
43
|
+
codeChallengeMethod: r["x-usePkce"] === "SHA-256" ? "S256" : "plain"
|
|
44
|
+
}, n.searchParams.set("code_challenge", u), n.searchParams.set("code_challenge_method", c.codeChallengeMethod);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
const
|
|
50
|
-
n.searchParams.set("redirect_uri",
|
|
47
|
+
const i = s[e];
|
|
48
|
+
if (i["x-scalar-secret-redirect-uri"].startsWith("/")) {
|
|
49
|
+
const r = l?.url || window.location.origin + window.location.pathname, o = new URL(i["x-scalar-secret-redirect-uri"], r).toString();
|
|
50
|
+
n.searchParams.set("redirect_uri", o);
|
|
51
51
|
} else
|
|
52
|
-
n.searchParams.set("redirect_uri",
|
|
53
|
-
d["x-scalar-security-query"] && Object.keys(d["x-scalar-security-query"]).forEach((
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
}), n.searchParams.set("client_id", d["x-scalar-secret-client-id"]), n.searchParams.set("state",
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
const
|
|
60
|
-
let
|
|
52
|
+
n.searchParams.set("redirect_uri", i["x-scalar-secret-redirect-uri"]);
|
|
53
|
+
d["x-scalar-security-query"] && Object.keys(d["x-scalar-security-query"]).forEach((r) => {
|
|
54
|
+
const o = d["x-scalar-security-query"]?.[r];
|
|
55
|
+
o && n.searchParams.set(r, o);
|
|
56
|
+
}), n.searchParams.set("client_id", d["x-scalar-secret-client-id"]), n.searchParams.set("state", t), m && n.searchParams.set("scope", m);
|
|
57
|
+
const h = window.open(n, "openAuth2Window", "left=100,top=100,width=800,height=600");
|
|
58
|
+
return h ? new Promise((r) => {
|
|
59
|
+
const o = setInterval(() => {
|
|
60
|
+
let u = null, p = null, x = null, _ = null;
|
|
61
61
|
try {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
62
|
+
const w = new URL(h.location.href).searchParams, k = d["x-tokenName"] || "access_token";
|
|
63
|
+
u = w.get(k), p = w.get("code"), x = w.get("error"), _ = w.get("error_description");
|
|
64
|
+
const P = new URLSearchParams(h.location.href.split("#")[1]);
|
|
65
|
+
u ||= P.get(k), p ||= P.get("code"), x ||= P.get("error"), _ ||= P.get("error_description");
|
|
66
66
|
} catch {
|
|
67
67
|
}
|
|
68
|
-
if (
|
|
69
|
-
if (clearInterval(
|
|
70
|
-
|
|
71
|
-
else if (
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
} else
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
if (h.closed || u || p || x)
|
|
69
|
+
if (clearInterval(o), h.close(), x)
|
|
70
|
+
r([new Error(`OAuth error: ${x}${_ ? ` (${_})` : ""}`), null]);
|
|
71
|
+
else if (u) {
|
|
72
|
+
const w = h.location.href.match(/state=([^&]*)/)?.[1];
|
|
73
|
+
r(w === t ? [null, u] : [new Error("State mismatch"), null]);
|
|
74
|
+
} else p && e === "authorizationCode" ? new URL(h.location.href).searchParams.get("state") === t ? U(
|
|
75
|
+
s,
|
|
76
|
+
e,
|
|
77
|
+
m,
|
|
78
78
|
{
|
|
79
|
-
code:
|
|
80
|
-
pkce:
|
|
81
|
-
proxyUrl:
|
|
79
|
+
code: p,
|
|
80
|
+
pkce: c,
|
|
81
|
+
proxyUrl: f
|
|
82
82
|
},
|
|
83
83
|
l
|
|
84
|
-
).then(
|
|
84
|
+
).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(o), r([new Error("Window was closed without granting authorization"), null]));
|
|
85
85
|
}, 200);
|
|
86
86
|
}) : [new Error("Failed to open auth window"), null];
|
|
87
87
|
} catch {
|
|
88
88
|
return [new Error("Failed to authorize oauth2 flow"), null];
|
|
89
89
|
}
|
|
90
|
-
}, U = async (
|
|
90
|
+
}, U = async (s, e, g, {
|
|
91
91
|
code: l,
|
|
92
|
-
pkce:
|
|
92
|
+
pkce: f,
|
|
93
93
|
proxyUrl: d
|
|
94
|
-
} = {},
|
|
95
|
-
const
|
|
96
|
-
if (!
|
|
94
|
+
} = {}, m) => {
|
|
95
|
+
const t = s[e];
|
|
96
|
+
if (!t)
|
|
97
97
|
return [new Error("OAuth2 flow was not defined"), null];
|
|
98
98
|
const a = new URLSearchParams();
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
g && (e === "clientCredentials" || e === "password") && a.set("scope", g);
|
|
100
|
+
const n = t["x-scalar-credentials-location"] === "body";
|
|
101
|
+
if (n && (a.set("client_id", t["x-scalar-secret-client-id"]), a.set("client_secret", t["x-scalar-secret-client-secret"])), "x-scalar-secret-redirect-uri" in t && t["x-scalar-secret-redirect-uri"] && a.set("redirect_uri", t["x-scalar-secret-redirect-uri"]), l)
|
|
102
|
+
a.set("code", l), a.set("grant_type", "authorization_code"), f && a.set("code_verifier", f.codeVerifier);
|
|
103
|
+
else if (e === "password") {
|
|
104
|
+
const c = s[e];
|
|
105
|
+
a.set("grant_type", "password"), a.set("username", c["x-scalar-secret-username"]), a.set("password", c["x-scalar-secret-password"]);
|
|
104
106
|
} else
|
|
105
107
|
a.set("grant_type", "client_credentials");
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
t["x-scalar-security-body"] && Object.entries(t["x-scalar-security-body"]).forEach(([c, i]) => {
|
|
109
|
+
i && a.set(c, i);
|
|
108
110
|
});
|
|
109
111
|
try {
|
|
110
|
-
const
|
|
112
|
+
const c = {
|
|
111
113
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
112
114
|
};
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
+
n || (c.Authorization = `Basic ${A(`${t["x-scalar-secret-client-id"]}:${t["x-scalar-secret-client-secret"]}`)}`);
|
|
116
|
+
const i = b(t.tokenUrl, { baseUrl: m?.url }), y = E(d, i) ? `${d}?${new URLSearchParams([["scalar_url", i]]).toString()}` : i, r = await (await fetch(y, {
|
|
115
117
|
method: "POST",
|
|
116
|
-
headers:
|
|
118
|
+
headers: c,
|
|
117
119
|
body: a
|
|
118
|
-
})).json(),
|
|
119
|
-
return [null,
|
|
120
|
+
})).json(), o = t["x-tokenName"] || "access_token";
|
|
121
|
+
return [null, r[o]];
|
|
120
122
|
} catch {
|
|
121
123
|
return [new Error("Failed to get an access token. Please check your credentials."), null];
|
|
122
124
|
}
|
|
123
125
|
};
|
|
124
126
|
export {
|
|
125
|
-
|
|
127
|
+
L as authorizeOauth2,
|
|
126
128
|
U as authorizeServers,
|
|
127
129
|
z as generateCodeChallenge
|
|
128
130
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfirmationForm.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/forms/ConfirmationForm.vue"],"names":[],"mappings":"AA6CA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0CAA0C;IAC1C,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAC7B,CAAC;AA4EF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAsB/C,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,45 @@
|
|
|
1
|
-
import o from "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { defineComponent as f, createElementBlock as u, openBlock as d, withModifiers as p, renderSlot as v, createElementVNode as b, createVNode as o, unref as a, withCtx as i, createTextVNode as l, toDisplayString as c } from "vue";
|
|
2
|
+
import { ScalarButton as r } from "@scalar/components";
|
|
3
|
+
const x = { class: "flex justify-between gap-10" }, g = /* @__PURE__ */ f({
|
|
4
|
+
__name: "ConfirmationForm",
|
|
5
|
+
props: {
|
|
6
|
+
label: { default: "Save" },
|
|
7
|
+
variant: { default: "solid" }
|
|
8
|
+
},
|
|
9
|
+
emits: ["cancel", "submit"],
|
|
10
|
+
setup(C, { emit: s }) {
|
|
11
|
+
const n = s;
|
|
12
|
+
return (t, e) => (d(), u("form", {
|
|
13
|
+
class: "flex flex-col gap-4 text-base",
|
|
14
|
+
onSubmit: e[1] || (e[1] = p((m) => n("submit"), ["prevent"]))
|
|
15
|
+
}, [
|
|
16
|
+
v(t.$slots, "default"),
|
|
17
|
+
b("div", x, [
|
|
18
|
+
o(a(r), {
|
|
19
|
+
size: "sm",
|
|
20
|
+
type: "button",
|
|
21
|
+
variant: "outlined",
|
|
22
|
+
onClick: e[0] || (e[0] = (m) => n("cancel"))
|
|
23
|
+
}, {
|
|
24
|
+
default: i(() => [...e[2] || (e[2] = [
|
|
25
|
+
l(" Cancel ", -1)
|
|
26
|
+
])]),
|
|
27
|
+
_: 1
|
|
28
|
+
}),
|
|
29
|
+
o(a(r), {
|
|
30
|
+
size: "sm",
|
|
31
|
+
type: "submit",
|
|
32
|
+
variant: t.variant
|
|
33
|
+
}, {
|
|
34
|
+
default: i(() => [
|
|
35
|
+
l(c(t.label), 1)
|
|
36
|
+
]),
|
|
37
|
+
_: 1
|
|
38
|
+
}, 8, ["variant"])
|
|
39
|
+
])
|
|
40
|
+
], 32));
|
|
41
|
+
}
|
|
42
|
+
});
|
|
5
43
|
export {
|
|
6
|
-
|
|
44
|
+
g as default
|
|
7
45
|
};
|
|
@@ -1,45 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ScalarButton as r } from "@scalar/components";
|
|
3
|
-
const x = { class: "flex justify-between gap-10" }, S = /* @__PURE__ */ m({
|
|
4
|
-
__name: "ConfirmationForm",
|
|
5
|
-
props: {
|
|
6
|
-
label: { default: "Save" },
|
|
7
|
-
variant: { default: "solid" }
|
|
8
|
-
},
|
|
9
|
-
emits: ["cancel", "submit"],
|
|
10
|
-
setup(w, { emit: s }) {
|
|
11
|
-
const o = s;
|
|
12
|
-
return (t, e) => (f(), p("form", {
|
|
13
|
-
class: "flex flex-col gap-4 text-base",
|
|
14
|
-
onSubmit: e[1] || (e[1] = d((u) => o("submit"), ["prevent"]))
|
|
15
|
-
}, [
|
|
16
|
-
c(t.$slots, "default", {}, void 0, !0),
|
|
17
|
-
v("div", x, [
|
|
18
|
-
n(a(r), {
|
|
19
|
-
class: "flex h-8 cursor-pointer items-center gap-1.5 px-2.5 shadow-none focus:outline-none",
|
|
20
|
-
type: "button",
|
|
21
|
-
variant: "outlined",
|
|
22
|
-
onClick: e[0] || (e[0] = (u) => o("cancel"))
|
|
23
|
-
}, {
|
|
24
|
-
default: i(() => [...e[2] || (e[2] = [
|
|
25
|
-
l(" Cancel ", -1)
|
|
26
|
-
])]),
|
|
27
|
-
_: 1
|
|
28
|
-
}),
|
|
29
|
-
n(a(r), {
|
|
30
|
-
class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
|
|
31
|
-
type: "submit",
|
|
32
|
-
variant: t.variant
|
|
33
|
-
}, {
|
|
34
|
-
default: i(() => [
|
|
35
|
-
l(b(t.label), 1)
|
|
36
|
-
]),
|
|
37
|
-
_: 1
|
|
38
|
-
}, 8, ["variant"])
|
|
39
|
-
])
|
|
40
|
-
], 32));
|
|
41
|
-
}
|
|
42
|
-
});
|
|
1
|
+
import f from "./ConfirmationForm.vue.js";
|
|
43
2
|
export {
|
|
44
|
-
|
|
3
|
+
f as default
|
|
45
4
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as s, computed as i, createBlock as
|
|
2
|
-
import { truncate as
|
|
1
|
+
import { defineComponent as s, computed as i, createBlock as c, openBlock as a, unref as p, withCtx as d, createElementBlock as u, createCommentVNode as f, toDisplayString as g } from "vue";
|
|
2
|
+
import { truncate as _ } from "@scalar/helpers/string/truncate";
|
|
3
3
|
import k from "../forms/ConfirmationForm.vue.js";
|
|
4
4
|
const v = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "text-c-2 text-sm leading-normal text-pretty"
|
|
7
|
-
},
|
|
7
|
+
}, M = /* @__PURE__ */ s({
|
|
8
8
|
__name: "DeleteModal",
|
|
9
9
|
props: {
|
|
10
10
|
name: {},
|
|
11
11
|
warningMessage: {}
|
|
12
12
|
},
|
|
13
13
|
emits: ["close", "delete"],
|
|
14
|
-
setup(
|
|
15
|
-
const t = r,
|
|
16
|
-
return (n, e) => (
|
|
17
|
-
label: `Delete ${
|
|
14
|
+
setup(o, { emit: r }) {
|
|
15
|
+
const t = r, l = i(() => _(o.name));
|
|
16
|
+
return (n, e) => (a(), c(p(k), {
|
|
17
|
+
label: `Delete ${l.value}`,
|
|
18
18
|
variant: "danger",
|
|
19
|
-
onCancel: e[0] || (e[0] = (
|
|
20
|
-
onSubmit: e[1] || (e[1] = (
|
|
19
|
+
onCancel: e[0] || (e[0] = (m) => t("close")),
|
|
20
|
+
onSubmit: e[1] || (e[1] = (m) => t("delete"))
|
|
21
21
|
}, {
|
|
22
22
|
default: d(() => [
|
|
23
|
-
n.warningMessage ? (
|
|
23
|
+
n.warningMessage ? (a(), u("p", v, g(n.warningMessage), 1)) : f("", !0)
|
|
24
24
|
]),
|
|
25
25
|
_: 1
|
|
26
26
|
}, 8, ["label"]));
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
M as default
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/settings/DocumentSettings.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/settings/DocumentSettings.vue"],"names":[],"mappings":"AAyJA,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;;;;;;;AAkTF,wBAOG"}
|
|
@@ -1,7 +1,106 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as v, createElementBlock as d, openBlock as a, Fragment as i, createElementVNode as e, createVNode as n, unref as o, createTextVNode as u, toDisplayString as w, withCtx as m } from "vue";
|
|
2
|
+
import { useModal as x, ScalarToggle as D, ScalarIcon as f, ScalarButton as y, ScalarModal as k } from "@scalar/components";
|
|
3
|
+
import M from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
4
|
+
const U = { class: "flex flex-col gap-12" }, C = { class: "flex flex-col gap-2" }, N = { class: "bg-b-2 rounded-lg border text-sm" }, S = { class: "bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3" }, B = { class: "text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap" }, V = { class: "flex items-center" }, T = ["href"], z = { class: "flex flex-col gap-4" }, A = { class: "flex items-center justify-between rounded-lg border p-3 text-sm" }, O = /* @__PURE__ */ v({
|
|
5
|
+
__name: "DocumentSettings",
|
|
6
|
+
props: {
|
|
7
|
+
documentUrl: {},
|
|
8
|
+
watchMode: { type: Boolean },
|
|
9
|
+
title: {},
|
|
10
|
+
isDraftDocument: { type: Boolean, default: !1 }
|
|
11
|
+
},
|
|
12
|
+
emits: ["delete:document", "update:watchMode"],
|
|
13
|
+
setup(p, { emit: g }) {
|
|
14
|
+
const r = g, s = x(), b = () => {
|
|
15
|
+
p.isDraftDocument || s.show();
|
|
16
|
+
}, h = () => {
|
|
17
|
+
r("delete:document"), s.hide();
|
|
18
|
+
};
|
|
19
|
+
return (l, t) => (a(), d(i, null, [
|
|
20
|
+
e("div", U, [
|
|
21
|
+
e("div", C, [
|
|
22
|
+
t[5] || (t[5] = e("div", { class: "flex h-8 items-center" }, [
|
|
23
|
+
e("h3", { class: "font-bold" }, "Features")
|
|
24
|
+
], -1)),
|
|
25
|
+
e("div", N, [
|
|
26
|
+
e("div", S, [
|
|
27
|
+
t[2] || (t[2] = e("div", null, [
|
|
28
|
+
e("h4", null, "Watch Mode"),
|
|
29
|
+
e("p", { class: "text-c-2 mt-1" }, " When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")
|
|
30
|
+
], -1)),
|
|
31
|
+
n(o(D), {
|
|
32
|
+
class: "w-4",
|
|
33
|
+
disabled: !l.documentUrl,
|
|
34
|
+
modelValue: l.watchMode ?? !1,
|
|
35
|
+
"onUpdate:modelValue": t[0] || (t[0] = (c) => r("update:watchMode", c))
|
|
36
|
+
}, null, 8, ["disabled", "modelValue"])
|
|
37
|
+
]),
|
|
38
|
+
e("div", B, [
|
|
39
|
+
e("div", V, [
|
|
40
|
+
l.documentUrl ? (a(), d(i, { key: 0 }, [
|
|
41
|
+
t[3] || (t[3] = e("span", { class: "bg-b-2 sticky left-0 pr-2 pl-3" }, "Source", -1)),
|
|
42
|
+
e("a", {
|
|
43
|
+
class: "text-c-2 group rounded pr-3 no-underline hover:underline",
|
|
44
|
+
href: l.documentUrl,
|
|
45
|
+
target: "_blank"
|
|
46
|
+
}, [
|
|
47
|
+
u(w(l.documentUrl) + " ", 1),
|
|
48
|
+
n(o(f), {
|
|
49
|
+
class: "ml-1 hidden w-2.5 group-hover:inline",
|
|
50
|
+
icon: "ExternalLink"
|
|
51
|
+
})
|
|
52
|
+
], 8, T)
|
|
53
|
+
], 64)) : (a(), d(i, { key: 1 }, [
|
|
54
|
+
n(o(f), {
|
|
55
|
+
class: "text-c-2 mr-2 ml-3 w-4",
|
|
56
|
+
icon: "NotAllowed",
|
|
57
|
+
size: "sm"
|
|
58
|
+
}),
|
|
59
|
+
t[4] || (t[4] = e("span", { class: "text-c-2 pr-3" }, " No URL configured. Try importing an OpenAPI document from an URL. ", -1))
|
|
60
|
+
], 64))
|
|
61
|
+
])
|
|
62
|
+
])
|
|
63
|
+
])
|
|
64
|
+
]),
|
|
65
|
+
e("div", z, [
|
|
66
|
+
t[8] || (t[8] = e("h3", { class: "font-bold" }, "Danger Zone", -1)),
|
|
67
|
+
e("div", A, [
|
|
68
|
+
t[7] || (t[7] = e("div", null, [
|
|
69
|
+
e("h4", null, "Delete Collection"),
|
|
70
|
+
e("p", { class: "text-c-2 mt-1" }, " Be careful, my friend. Once deleted, there is no way to recover the collection. ")
|
|
71
|
+
], -1)),
|
|
72
|
+
n(o(y), {
|
|
73
|
+
disabled: l.isDraftDocument,
|
|
74
|
+
size: "sm",
|
|
75
|
+
variant: "danger",
|
|
76
|
+
onClick: b
|
|
77
|
+
}, {
|
|
78
|
+
default: m(() => [...t[6] || (t[6] = [
|
|
79
|
+
u(" Delete Collection ", -1)
|
|
80
|
+
])]),
|
|
81
|
+
_: 1
|
|
82
|
+
}, 8, ["disabled"])
|
|
83
|
+
])
|
|
84
|
+
])
|
|
85
|
+
]),
|
|
86
|
+
n(o(k), {
|
|
87
|
+
size: "xxs",
|
|
88
|
+
state: o(s),
|
|
89
|
+
title: `Delete ${l.title}`
|
|
90
|
+
}, {
|
|
91
|
+
default: m(() => [
|
|
92
|
+
n(M, {
|
|
93
|
+
variableName: l.title ?? "",
|
|
94
|
+
warningMessage: "This action cannot be undone.",
|
|
95
|
+
onClose: t[1] || (t[1] = (c) => o(s).hide()),
|
|
96
|
+
onDelete: h
|
|
97
|
+
}, null, 8, ["variableName"])
|
|
98
|
+
]),
|
|
99
|
+
_: 1
|
|
100
|
+
}, 8, ["state", "title"])
|
|
101
|
+
], 64));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
5
104
|
export {
|
|
6
|
-
|
|
105
|
+
O as default
|
|
7
106
|
};
|
|
@@ -1,106 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useModal as v, ScalarToggle as D, ScalarIcon as f, ScalarButton as y, ScalarModal as k } from "@scalar/components";
|
|
3
|
-
import M from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
4
|
-
const U = { class: "flex flex-col gap-12" }, C = { class: "flex flex-col gap-2" }, N = { class: "bg-b-2 rounded-lg border text-sm" }, S = { class: "bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3" }, B = { class: "text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap" }, V = { class: "flex items-center" }, T = ["href"], A = { class: "flex flex-col gap-4" }, E = { class: "flex items-center justify-between rounded-lg border p-3 text-sm" }, _ = /* @__PURE__ */ w({
|
|
5
|
-
__name: "DocumentSettings",
|
|
6
|
-
props: {
|
|
7
|
-
documentUrl: {},
|
|
8
|
-
watchMode: { type: Boolean },
|
|
9
|
-
title: {},
|
|
10
|
-
isDraftDocument: { type: Boolean, default: !1 }
|
|
11
|
-
},
|
|
12
|
-
emits: ["delete:document", "update:watchMode"],
|
|
13
|
-
setup(p, { emit: g }) {
|
|
14
|
-
const r = g, s = v(), b = () => {
|
|
15
|
-
p.isDraftDocument || s.show();
|
|
16
|
-
}, h = () => {
|
|
17
|
-
r("delete:document"), s.hide();
|
|
18
|
-
};
|
|
19
|
-
return (l, t) => (d(), a(i, null, [
|
|
20
|
-
e("div", U, [
|
|
21
|
-
e("div", C, [
|
|
22
|
-
t[5] || (t[5] = e("div", { class: "flex h-8 items-center" }, [
|
|
23
|
-
e("h3", { class: "font-bold" }, "Features")
|
|
24
|
-
], -1)),
|
|
25
|
-
e("div", N, [
|
|
26
|
-
e("div", S, [
|
|
27
|
-
t[2] || (t[2] = e("div", null, [
|
|
28
|
-
e("h4", null, "Watch Mode"),
|
|
29
|
-
e("p", { class: "text-c-2 mt-1" }, " When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")
|
|
30
|
-
], -1)),
|
|
31
|
-
n(o(D), {
|
|
32
|
-
class: "w-4",
|
|
33
|
-
disabled: !l.documentUrl,
|
|
34
|
-
modelValue: l.watchMode ?? !1,
|
|
35
|
-
"onUpdate:modelValue": t[0] || (t[0] = (c) => r("update:watchMode", c))
|
|
36
|
-
}, null, 8, ["disabled", "modelValue"])
|
|
37
|
-
]),
|
|
38
|
-
e("div", B, [
|
|
39
|
-
e("div", V, [
|
|
40
|
-
l.documentUrl ? (d(), a(i, { key: 0 }, [
|
|
41
|
-
t[3] || (t[3] = e("span", { class: "bg-b-2 sticky left-0 pr-2 pl-3" }, "Source", -1)),
|
|
42
|
-
e("a", {
|
|
43
|
-
class: "text-c-2 group rounded pr-3 no-underline hover:underline",
|
|
44
|
-
href: l.documentUrl,
|
|
45
|
-
target: "_blank"
|
|
46
|
-
}, [
|
|
47
|
-
u(x(l.documentUrl) + " ", 1),
|
|
48
|
-
n(o(f), {
|
|
49
|
-
class: "ml-1 hidden w-2.5 group-hover:inline",
|
|
50
|
-
icon: "ExternalLink"
|
|
51
|
-
})
|
|
52
|
-
], 8, T)
|
|
53
|
-
], 64)) : (d(), a(i, { key: 1 }, [
|
|
54
|
-
n(o(f), {
|
|
55
|
-
class: "text-c-2 mr-2 ml-3 w-4",
|
|
56
|
-
icon: "NotAllowed",
|
|
57
|
-
size: "sm"
|
|
58
|
-
}),
|
|
59
|
-
t[4] || (t[4] = e("span", { class: "text-c-2 pr-3" }, " No URL configured. Try importing an OpenAPI document from an URL. ", -1))
|
|
60
|
-
], 64))
|
|
61
|
-
])
|
|
62
|
-
])
|
|
63
|
-
])
|
|
64
|
-
]),
|
|
65
|
-
e("div", A, [
|
|
66
|
-
t[8] || (t[8] = e("h3", { class: "font-bold" }, "Danger Zone", -1)),
|
|
67
|
-
e("div", E, [
|
|
68
|
-
t[7] || (t[7] = e("div", null, [
|
|
69
|
-
e("h4", null, "Delete Collection"),
|
|
70
|
-
e("p", { class: "text-c-2 mt-1" }, " Be careful, my friend. Once deleted, there is no way to recover the collection. ")
|
|
71
|
-
], -1)),
|
|
72
|
-
n(o(y), {
|
|
73
|
-
class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
|
|
74
|
-
disabled: l.isDraftDocument,
|
|
75
|
-
variant: "danger",
|
|
76
|
-
onClick: b
|
|
77
|
-
}, {
|
|
78
|
-
default: m(() => [...t[6] || (t[6] = [
|
|
79
|
-
u(" Delete Collection ", -1)
|
|
80
|
-
])]),
|
|
81
|
-
_: 1
|
|
82
|
-
}, 8, ["disabled"])
|
|
83
|
-
])
|
|
84
|
-
])
|
|
85
|
-
]),
|
|
86
|
-
n(o(k), {
|
|
87
|
-
size: "xxs",
|
|
88
|
-
state: o(s),
|
|
89
|
-
title: `Delete ${l.title}`
|
|
90
|
-
}, {
|
|
91
|
-
default: m(() => [
|
|
92
|
-
n(M, {
|
|
93
|
-
variableName: l.title ?? "",
|
|
94
|
-
warningMessage: "This action cannot be undone.",
|
|
95
|
-
onClose: t[1] || (t[1] = (c) => o(s).hide()),
|
|
96
|
-
onDelete: h
|
|
97
|
-
}, null, 8, ["variableName"])
|
|
98
|
-
]),
|
|
99
|
-
_: 1
|
|
100
|
-
}, 8, ["state", "title"])
|
|
101
|
-
], 64));
|
|
102
|
-
}
|
|
103
|
-
});
|
|
1
|
+
import f from "./DocumentSettings.vue.js";
|
|
104
2
|
export {
|
|
105
|
-
|
|
3
|
+
f as default
|
|
106
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionSettings.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CollectionSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Collection/CollectionSettings.vue"],"names":[],"mappings":";AAseA,wBAKG"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
/* empty css */
|
|
3
|
-
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f353959a"]]);
|
|
1
|
+
import f from "./CollectionSettings.vue2.js";
|
|
5
2
|
export {
|
|
6
3
|
f as default
|
|
7
4
|
};
|