@scalar/api-client 2.1.52 → 2.2.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 +22 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +35 -42
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +25 -24
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +32 -39
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +10 -15
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +48 -47
- package/dist/components/CodeInput/codeVariableWidget.d.ts +3 -2
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +15 -14
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +18 -23
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +27 -26
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +19 -20
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +19 -24
- package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +23 -22
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +47 -46
- package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +23 -28
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +127 -96
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +28 -27
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts +1 -1
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +14 -18
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +15 -14
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +20 -19
- package/dist/components/SideNav/SideNavRouterLink.vue.js +9 -9
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +1 -1
- package/dist/components/TopNav/TopNav.vue2.js +20 -19
- package/dist/components/TopNav/TopNavItem.vue.d.ts +2 -2
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/useLayout.d.ts +2 -0
- package/dist/hooks/useLayout.d.ts.map +1 -1
- package/dist/hooks/useLayout.js +4 -3
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +38 -37
- package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -1
- package/dist/layouts/App/MainLayout.vue.js +3 -3
- package/dist/layouts/App/create-api-client-app.d.ts +669 -1232
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +24 -23
- package/dist/layouts/Modal/create-api-client-modal.d.ts +1382 -2508
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +34 -33
- package/dist/layouts/Web/create-api-client-web.d.ts +669 -1232
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +673 -1236
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +91 -102
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/send-request.d.ts +2 -3
- package/dist/libs/send-request.d.ts.map +1 -1
- package/dist/libs/send-request.js +127 -123
- package/dist/store/active-entities.d.ts +333 -0
- package/dist/store/active-entities.d.ts.map +1 -0
- package/dist/store/active-entities.js +97 -0
- package/dist/store/collections.d.ts +4 -274
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/cookies.d.ts +4 -4
- package/dist/store/environment.d.ts +4 -4
- package/dist/store/import-spec.d.ts +0 -54
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/index.js +4 -3
- package/dist/store/request-example.d.ts +4 -4
- package/dist/store/requests.d.ts +15 -15
- package/dist/store/security-schemes.d.ts +527 -317
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +33 -41
- package/dist/store/servers.d.ts +4 -4
- package/dist/store/store-context.d.ts +0 -3
- package/dist/store/store-context.d.ts.map +1 -1
- package/dist/store/store.d.ts +640 -5297
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +111 -189
- package/dist/store/tags.d.ts +4 -4
- package/dist/store/workspace.d.ts +14 -24
- package/dist/store/workspace.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 +14 -13
- package/dist/views/Cookies/CookieRaw.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieRaw.vue.js +14 -13
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +3 -3
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +92 -92
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +96 -99
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +49 -46
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +94 -100
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +60 -67
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +29 -28
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +11 -10
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +24 -28
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +19 -18
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
- 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 +72 -73
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +111 -109
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +15 -16
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +14 -14
- 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 +23 -22
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +32 -31
- package/dist/views/Request/consts/new-auth-options.d.ts +16 -8
- package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
- package/dist/views/Request/consts/new-auth-options.js +16 -8
- package/dist/views/Request/handle-drag.d.ts +2 -1
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.js +23 -25
- package/dist/views/Request/hooks/useOpenApiWatcher.d.ts.map +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.js +40 -39
- package/dist/views/Request/libs/auth.d.ts +1 -29
- package/dist/views/Request/libs/auth.d.ts.map +1 -1
- package/dist/views/Request/libs/auth.js +2 -9
- package/dist/views/Request/libs/index.js +6 -8
- package/dist/views/Request/libs/live-sync.d.ts +6 -5
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +164 -185
- package/dist/views/Request/libs/oauth2.d.ts +6 -10
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +54 -69
- package/dist/views/Servers/ServerForm.vue.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.js +14 -13
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +18 -17
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +218 -126
- package/dist/views/Settings/{SettingsGeneralMode.vue.d.ts → components/SettingsAppearance.vue.d.ts} +2 -2
- package/dist/views/Settings/components/SettingsAppearance.vue.d.ts.map +1 -0
- package/dist/views/Settings/components/SettingsAppearance.vue.js +74 -0
- package/dist/views/Settings/components/SettingsAppearance.vue2.js +4 -0
- package/dist/views/Settings/components/SettingsSection.vue.d.ts +24 -0
- package/dist/views/Settings/components/SettingsSection.vue.d.ts.map +1 -0
- package/dist/views/Settings/components/SettingsSection.vue.js +24 -0
- package/dist/views/Settings/components/SettingsSection.vue2.js +4 -0
- package/package.json +8 -8
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthModal.vue.d.ts +0 -16
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthModal.vue.d.ts.map +0 -1
- package/dist/views/Settings/SettingsGeneralMode.vue.d.ts.map +0 -1
- package/dist/views/Settings/SettingsGeneralMode.vue.js +0 -78
- package/dist/views/Settings/SettingsGeneralMode.vue2.js +0 -4
|
@@ -1,77 +1,70 @@
|
|
|
1
|
-
const
|
|
1
|
+
const w = () => {
|
|
2
2
|
const e = new Uint8Array(32);
|
|
3
3
|
return crypto.getRandomValues(e), btoa(String.fromCharCode(...e)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
4
|
-
}, _ = async (e,
|
|
5
|
-
if (
|
|
6
|
-
const
|
|
7
|
-
return btoa(String.fromCharCode(...new Uint8Array(
|
|
8
|
-
},
|
|
4
|
+
}, _ = async (e, i) => {
|
|
5
|
+
if (i === "plain") return e;
|
|
6
|
+
const s = new TextEncoder().encode(e), t = await crypto.subtle.digest("SHA-256", s);
|
|
7
|
+
return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
8
|
+
}, y = async (e, i) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
r,
|
|
15
|
-
a
|
|
16
|
-
);
|
|
10
|
+
if (!e) return [new Error("Flow not found"), null];
|
|
11
|
+
const a = e.selectedScopes.join(" ");
|
|
12
|
+
if (e.type === "clientCredentials" || e.type === "password")
|
|
13
|
+
return m(e, a);
|
|
17
14
|
{
|
|
18
|
-
const s = (Math.random() + 1).toString(36).substring(7), t = new URL(e.
|
|
19
|
-
let
|
|
20
|
-
if (e.
|
|
15
|
+
const s = (Math.random() + 1).toString(36).substring(7), t = new URL(e.authorizationUrl);
|
|
16
|
+
let o = null;
|
|
17
|
+
if (e.type === "implicit")
|
|
21
18
|
t.searchParams.set("response_type", "token");
|
|
22
|
-
else if (e.
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
e
|
|
19
|
+
else if (e.type === "authorizationCode" && (t.searchParams.set("response_type", "code"), e["x-usePkce"] !== "no")) {
|
|
20
|
+
const r = w(), c = await _(
|
|
21
|
+
r,
|
|
22
|
+
e["x-usePkce"]
|
|
26
23
|
);
|
|
27
|
-
|
|
28
|
-
codeVerifier:
|
|
29
|
-
codeChallenge:
|
|
30
|
-
codeChallengeMethod: e
|
|
31
|
-
}, t.searchParams.set("code_challenge",
|
|
24
|
+
o = {
|
|
25
|
+
codeVerifier: r,
|
|
26
|
+
codeChallenge: c,
|
|
27
|
+
codeChallengeMethod: e["x-usePkce"] === "SHA-256" ? "S256" : "plain"
|
|
28
|
+
}, t.searchParams.set("code_challenge", c), t.searchParams.set(
|
|
32
29
|
"code_challenge_method",
|
|
33
|
-
|
|
30
|
+
o.codeChallengeMethod
|
|
34
31
|
);
|
|
35
32
|
}
|
|
36
|
-
if (e
|
|
37
|
-
const
|
|
38
|
-
e
|
|
39
|
-
|
|
33
|
+
if (e["x-scalar-redirect-uri"].startsWith("/")) {
|
|
34
|
+
const r = i.url || window.location.origin + window.location.pathname, c = new URL(
|
|
35
|
+
e["x-scalar-redirect-uri"],
|
|
36
|
+
r
|
|
40
37
|
).toString();
|
|
41
|
-
t.searchParams.set("redirect_uri",
|
|
38
|
+
t.searchParams.set("redirect_uri", c);
|
|
42
39
|
} else
|
|
43
|
-
t.searchParams.set(
|
|
44
|
-
"redirect_uri",
|
|
45
|
-
e.flow["x-scalar-redirect-uri"]
|
|
46
|
-
);
|
|
40
|
+
t.searchParams.set("redirect_uri", e["x-scalar-redirect-uri"]);
|
|
47
41
|
t.searchParams.set("client_id", e["x-scalar-client-id"]), t.searchParams.set("state", s), a && t.searchParams.set("scope", a);
|
|
48
42
|
const n = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
|
|
49
|
-
return n ? new Promise((
|
|
50
|
-
const
|
|
51
|
-
var
|
|
52
|
-
let
|
|
43
|
+
return n ? new Promise((r) => {
|
|
44
|
+
const c = setInterval(() => {
|
|
45
|
+
var p;
|
|
46
|
+
let d = null, u = null;
|
|
53
47
|
try {
|
|
54
48
|
const l = new URL(n.location.href).searchParams;
|
|
55
|
-
|
|
56
|
-
const
|
|
49
|
+
d = l.get("access_token"), u = l.get("code");
|
|
50
|
+
const g = new URLSearchParams(
|
|
57
51
|
n.location.href.split("#")[1]
|
|
58
52
|
);
|
|
59
|
-
|
|
53
|
+
d || (d = g.get("access_token")), u || (u = g.get("code"));
|
|
60
54
|
} catch {
|
|
61
55
|
}
|
|
62
|
-
if (n.closed ||
|
|
63
|
-
if (clearInterval(
|
|
64
|
-
const l = (
|
|
65
|
-
|
|
56
|
+
if (n.closed || d || u)
|
|
57
|
+
if (clearInterval(c), n.close(), d) {
|
|
58
|
+
const l = (p = n.location.href.match(/state=([^&]*)/)) == null ? void 0 : p[1];
|
|
59
|
+
r(l === s ? [null, d] : [new Error("State mismatch"), null]);
|
|
66
60
|
} else u ? new URL(
|
|
67
61
|
n.location.href
|
|
68
|
-
).searchParams.get("state") === s ?
|
|
62
|
+
).searchParams.get("state") === s ? m(
|
|
69
63
|
e,
|
|
70
|
-
r,
|
|
71
64
|
a,
|
|
72
65
|
u,
|
|
73
|
-
|
|
74
|
-
).then(
|
|
66
|
+
o
|
|
67
|
+
).then(r) : r([new Error("State mismatch"), null]) : (clearInterval(c), r([
|
|
75
68
|
new Error("Window was closed without granting authorization"),
|
|
76
69
|
null
|
|
77
70
|
]));
|
|
@@ -81,27 +74,20 @@ const P = (e) => e.type.startsWith("oauth"), y = () => {
|
|
|
81
74
|
} catch {
|
|
82
75
|
return [new Error("Failed to authorize oauth2 flow"), null];
|
|
83
76
|
}
|
|
84
|
-
},
|
|
85
|
-
if (!("
|
|
86
|
-
return [
|
|
87
|
-
new Error(
|
|
88
|
-
"Authorize Servers only works for Password, Client Credentials or Authorization Code flow"
|
|
89
|
-
),
|
|
90
|
-
null
|
|
91
|
-
];
|
|
92
|
-
if (!e.flow) return [new Error("OAuth2 flow was not defined"), null];
|
|
77
|
+
}, m = async (e, i, a, s) => {
|
|
78
|
+
if (!e) return [new Error("OAuth2 flow was not defined"), null];
|
|
93
79
|
const t = new URLSearchParams();
|
|
94
|
-
t.set("client_id", e["x-scalar-client-id"]),
|
|
80
|
+
t.set("client_id", e["x-scalar-client-id"]), i && t.set("scope", i), e.clientSecret && t.set("client_secret", e.clientSecret), "x-scalar-redirect-uri" in e && e["x-scalar-redirect-uri"] && t.set("redirect_uri", e["x-scalar-redirect-uri"]), a ? (t.set("code", a), t.set("grant_type", "authorization_code"), s && t.set("code_verifier", s.codeVerifier)) : e.type === "password" ? (t.set("grant_type", "password"), t.set("username", e.username), t.set("password", e.password)) : t.set("grant_type", "client_credentials");
|
|
95
81
|
try {
|
|
96
|
-
const
|
|
82
|
+
const o = {
|
|
97
83
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
98
84
|
};
|
|
99
|
-
|
|
100
|
-
const
|
|
85
|
+
o.Authorization = `Basic ${btoa(`${e["x-scalar-client-id"]}:${e.clientSecret}`)}`;
|
|
86
|
+
const h = await fetch(e.tokenUrl, {
|
|
101
87
|
method: "POST",
|
|
102
|
-
headers:
|
|
88
|
+
headers: o,
|
|
103
89
|
body: t
|
|
104
|
-
}), { access_token: n } = await
|
|
90
|
+
}), { access_token: n } = await h.json();
|
|
105
91
|
return [null, n];
|
|
106
92
|
} catch {
|
|
107
93
|
return [
|
|
@@ -113,8 +99,7 @@ const P = (e) => e.type.startsWith("oauth"), y = () => {
|
|
|
113
99
|
}
|
|
114
100
|
};
|
|
115
101
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
_ as generateCodeChallenge
|
|
119
|
-
P as isOauth2Example
|
|
102
|
+
y as authorizeOauth2,
|
|
103
|
+
m as authorizeServers,
|
|
104
|
+
_ as generateCodeChallenge
|
|
120
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerForm.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Servers/ServerForm.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ServerForm.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Servers/ServerForm.vue"],"names":[],"mappings":";AA6NA,wBAMG"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as S, computed as l, openBlock as
|
|
1
|
+
import { defineComponent as S, computed as l, openBlock as n, createElementBlock as d, Fragment as b, createVNode as g, createBlock as y, createCommentVNode as p } from "vue";
|
|
2
2
|
import m from "../../components/Form/Form.vue.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { useActiveEntities as O } from "../../store/active-entities.js";
|
|
4
|
+
import { useRoute as V } from "vue-router";
|
|
5
|
+
import { useWorkspace as j } from "../../store/store.js";
|
|
6
|
+
const B = { class: "w-full" }, N = /* @__PURE__ */ S({
|
|
6
7
|
__name: "ServerForm",
|
|
7
|
-
setup(
|
|
8
|
-
const { activeCollection: a, servers: v, serverMutators:
|
|
8
|
+
setup(C) {
|
|
9
|
+
const { activeCollection: a } = O(), { servers: v, serverMutators: u } = j(), f = [
|
|
9
10
|
{ label: "URL", key: "url", placeholder: "https://void.scalar.com/api" },
|
|
10
11
|
{
|
|
11
12
|
label: "Label",
|
|
12
13
|
key: "description",
|
|
13
14
|
placeholder: "Production"
|
|
14
15
|
}
|
|
15
|
-
], c =
|
|
16
|
+
], c = V(), o = l(
|
|
16
17
|
() => {
|
|
17
18
|
var e, t;
|
|
18
19
|
return v[a.value && c.params.server === "default" ? (e = a.value) == null ? void 0 : e.servers[0] : ((t = a.value) == null ? void 0 : t.servers.find(
|
|
@@ -20,9 +21,9 @@ const j = { class: "w-full" }, L = /* @__PURE__ */ S({
|
|
|
20
21
|
)) ?? ""];
|
|
21
22
|
}
|
|
22
23
|
), _ = (e, t) => {
|
|
23
|
-
a.value &&
|
|
24
|
+
a.value && u.edit(o.value.uid, e, t);
|
|
24
25
|
}, k = (e, t) => {
|
|
25
|
-
a.value &&
|
|
26
|
+
a.value && u.edit(o.value.uid, `variables.${e}.value`, t);
|
|
26
27
|
}, h = l(
|
|
27
28
|
() => {
|
|
28
29
|
var e;
|
|
@@ -43,15 +44,15 @@ const j = { class: "w-full" }, L = /* @__PURE__ */ S({
|
|
|
43
44
|
return e[t] = (r.default ?? ((s = r == null ? void 0 : r.enum) == null ? void 0 : s[0]) ?? "").toString(), e;
|
|
44
45
|
}, {})
|
|
45
46
|
);
|
|
46
|
-
return (e, t) => (
|
|
47
|
-
o.value ? (
|
|
47
|
+
return (e, t) => (n(), d("div", B, [
|
|
48
|
+
o.value ? (n(), d(b, { key: 0 }, [
|
|
48
49
|
g(m, {
|
|
49
50
|
data: o.value,
|
|
50
51
|
onUpdate: _,
|
|
51
52
|
options: f,
|
|
52
53
|
title: "Server"
|
|
53
54
|
}, null, 8, ["data"]),
|
|
54
|
-
Object.keys(i.value).length ? (
|
|
55
|
+
Object.keys(i.value).length ? (n(), y(m, {
|
|
55
56
|
key: 0,
|
|
56
57
|
data: i.value,
|
|
57
58
|
onUpdate: k,
|
|
@@ -63,5 +64,5 @@ const j = { class: "w-full" }, L = /* @__PURE__ */ S({
|
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
+
N as default
|
|
67
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Servers.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Servers/Servers.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Servers.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Servers/Servers.vue"],"names":[],"mappings":";AAoOA,wBAMG"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as d, openBlock as a, createBlock as m, withCtx as e, createVNode as r, unref as n, createElementVNode as _, createElementBlock as v, Fragment as S, renderList as x, createTextVNode as b } from "vue";
|
|
2
2
|
import k from "../../components/Sidebar/SidebarButton.vue.js";
|
|
3
3
|
import h from "../../components/Sidebar/SidebarList.vue.js";
|
|
4
4
|
import L from "../../components/Sidebar/SidebarListElement.vue.js";
|
|
5
5
|
import V from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
6
6
|
import w from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useActiveEntities as C } from "../../store/active-entities.js";
|
|
8
|
+
import { serverSchema as E } from "@scalar/oas-utils/entities/spec";
|
|
8
9
|
import { useRouter as y } from "vue-router";
|
|
9
10
|
import B from "./ServerForm.vue.js";
|
|
10
|
-
import { useWorkspace as
|
|
11
|
-
import
|
|
12
|
-
const $ = { class: "flex-1" },
|
|
11
|
+
import { useWorkspace as N } from "../../store/store.js";
|
|
12
|
+
import A from "../../components/Sidebar/Sidebar.vue.js";
|
|
13
|
+
const $ = { class: "flex-1" }, J = /* @__PURE__ */ d({
|
|
13
14
|
__name: "Servers",
|
|
14
15
|
setup(g) {
|
|
15
|
-
const { activeCollection: t, servers: u, serverMutators: c } =
|
|
16
|
+
const { activeCollection: t } = C(), { servers: u, serverMutators: c } = N(), { push: f } = y(), p = () => {
|
|
16
17
|
if (!t.value) return;
|
|
17
|
-
const o =
|
|
18
|
+
const o = E.parse({ url: "http://localhost" });
|
|
18
19
|
c.add(o, t.value.uid), f({
|
|
19
20
|
name: "servers",
|
|
20
21
|
params: {
|
|
@@ -22,21 +23,21 @@ const $ = { class: "flex-1" }, G = /* @__PURE__ */ p({
|
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
|
-
return (o,
|
|
26
|
+
return (o, i) => (a(), m(V, null, {
|
|
26
27
|
default: e(() => [
|
|
27
|
-
r(n(
|
|
28
|
+
r(n(A), { title: "Servers" }, {
|
|
28
29
|
content: e(() => [
|
|
29
30
|
_("div", $, [
|
|
30
31
|
r(h, null, {
|
|
31
32
|
default: e(() => {
|
|
32
|
-
var
|
|
33
|
+
var l;
|
|
33
34
|
return [
|
|
34
|
-
(
|
|
35
|
-
key:
|
|
35
|
+
(a(!0), v(S, null, x((l = n(t)) == null ? void 0 : l.servers, (s) => (a(), m(L, {
|
|
36
|
+
key: s,
|
|
36
37
|
class: "text-xs",
|
|
37
38
|
variable: {
|
|
38
|
-
name: n(u)[
|
|
39
|
-
uid:
|
|
39
|
+
name: n(u)[s].url ?? "",
|
|
40
|
+
uid: s
|
|
40
41
|
}
|
|
41
42
|
}, null, 8, ["variable"]))), 128))
|
|
42
43
|
];
|
|
@@ -46,8 +47,8 @@ const $ = { class: "flex-1" }, G = /* @__PURE__ */ p({
|
|
|
46
47
|
])
|
|
47
48
|
]),
|
|
48
49
|
button: e(() => [
|
|
49
|
-
r(k, { click:
|
|
50
|
-
title: e(() =>
|
|
50
|
+
r(k, { click: p }, {
|
|
51
|
+
title: e(() => i[0] || (i[0] = [
|
|
51
52
|
b("Add Server")
|
|
52
53
|
])),
|
|
53
54
|
_: 1
|
|
@@ -67,5 +68,5 @@ const $ = { class: "flex-1" }, G = /* @__PURE__ */ p({
|
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
70
|
export {
|
|
70
|
-
|
|
71
|
+
J as default
|
|
71
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsGeneral.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/SettingsGeneral.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SettingsGeneral.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/SettingsGeneral.vue"],"names":[],"mappings":";AA+2BA,wBAMG"}
|