@scalar/api-reference 1.25.48 → 1.25.49
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/browser/standalone.js +13698 -13755
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +136 -137
- package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
- package/dist/components/Content/Operation/TestRequestButton.vue2.js +18 -17
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts.map +1 -1
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.js +1 -1
- package/dist/components/DarkModeToggle/DarkModeToggle.vue2.js +12 -11
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +146 -142
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +37 -35
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
- package/dist/{components → features/ApiClientModal}/ApiClientModal.vue.d.ts +3 -3
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -0
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -0
- package/dist/features/ApiClientModal/index.d.ts +3 -0
- package/dist/features/ApiClientModal/index.d.ts.map +1 -0
- package/dist/features/ApiClientModal/useApiClient.d.ts +7734 -0
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -0
- package/dist/features/ApiClientModal/useApiClient.js +23 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +2 -2
- package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +10 -7
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +16 -20
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +148 -155
- package/dist/index.js +43 -45
- package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -1
- package/dist/legacy/components/SecurityScheme.vue.js +2 -2
- package/dist/legacy/components/SecurityScheme.vue2.js +111 -115
- package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -1
- package/dist/legacy/components/SecuritySchemeSelector.vue.js +1 -1
- package/dist/legacy/components/SecuritySchemeSelector.vue2.js +46 -36
- package/dist/legacy/helpers/index.d.ts +1 -1
- package/dist/legacy/stores/index.d.ts +1 -2
- package/dist/legacy/stores/index.d.ts.map +1 -1
- package/dist/legacy/stores/useOpenApiStore.js +4 -18
- package/dist/style.css +1 -1
- package/package.json +11 -11
- package/dist/components/ApiClientModal.vue.d.ts.map +0 -1
- package/dist/components/ApiClientModal.vue.js +0 -64
- package/dist/components/api-client-bus.d.ts +0 -22
- package/dist/components/api-client-bus.d.ts.map +0 -1
- package/dist/components/api-client-bus.js +0 -6
- package/dist/helpers/openClientFor.d.ts +0 -7
- package/dist/helpers/openClientFor.d.ts.map +0 -1
- package/dist/helpers/openClientFor.js +0 -19
- package/dist/legacy/helpers/createPlaceholderRequest.js +0 -14
- package/dist/legacy/stores/useApiClientStore.d.ts +0 -18
- package/dist/legacy/stores/useApiClientStore.d.ts.map +0 -1
- package/dist/legacy/stores/useApiClientStore.js +0 -32
- package/dist/legacy/stores/useRequestStore.js +0 -33
- /package/dist/{components → features/ApiClientModal}/ApiClientModal.vue2.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityScheme.vue.d.ts","sourceRoot":"","sources":["../../../src/legacy/components/SecurityScheme.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SecurityScheme.vue.d.ts","sourceRoot":"","sources":["../../../src/legacy/components/SecurityScheme.vue"],"names":[],"mappings":"AA8gBA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;YAkBxE,SAAS,CAAC,oBAAoB,GAC9B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB;YAC5B,MAAM;;YAHV,SAAS,CAAC,oBAAoB,GAC9B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,oBAAoB;YAC5B,MAAM;;AA4wBhB,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SecurityScheme.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b6e18839"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineComponent as Q, computed as X, openBlock as
|
|
1
|
+
import { defineComponent as Q, computed as X, openBlock as n, createBlock as m, withModifiers as Y, withCtx as s, unref as l, createElementBlock as K, Fragment as F, createTextVNode as i, toDisplayString as Z, createCommentVNode as v, createVNode as d, createElementVNode as W } from "vue";
|
|
2
2
|
import { concatenateUrlAndPath as x, redirectToProxy as _ } from "@scalar/oas-utils/helpers";
|
|
3
3
|
import { useToasts as ee } from "@scalar/use-toasts";
|
|
4
|
-
import { apiClientBus as F } from "../../components/api-client-bus.js";
|
|
5
4
|
import te from "./CardForm.vue.js";
|
|
6
5
|
import re from "./CardFormButton.vue.js";
|
|
7
6
|
import P from "./CardFormGroup.vue.js";
|
|
@@ -11,28 +10,29 @@ import R from "./SecuritySchemeScopes.vue.js";
|
|
|
11
10
|
import { useServerStore as oe } from "../stores/useServerStore.js";
|
|
12
11
|
import { getUrlFromServerState as ae } from "../helpers/getUrlFromServerState.js";
|
|
13
12
|
import { useAuthenticationStore as se } from "../stores/useAuthenticationStore.js";
|
|
14
|
-
|
|
13
|
+
import { useApiClient as ue } from "../../features/ApiClientModal/useApiClient.js";
|
|
14
|
+
const Se = /* @__PURE__ */ Q({
|
|
15
15
|
__name: "SecurityScheme",
|
|
16
16
|
props: {
|
|
17
17
|
value: {},
|
|
18
18
|
proxy: {}
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const { toast: L } = ee(), { server: N } = oe(), { authentication: r, setAuthentication: p } = se(), V = (t) => {
|
|
20
|
+
setup(le) {
|
|
21
|
+
const { toast: L } = ee(), { client: C } = ue(), { server: N } = oe(), { authentication: r, setAuthentication: p } = se(), V = (t) => {
|
|
22
|
+
var o;
|
|
22
23
|
const e = t.target.value;
|
|
23
24
|
p({
|
|
24
25
|
apiKey: {
|
|
25
26
|
...r.apiKey,
|
|
26
27
|
token: e
|
|
27
28
|
}
|
|
28
|
-
}), r.preferredSecurityScheme &&
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
});
|
|
29
|
+
}), r.preferredSecurityScheme && ((o = C.value) == null || o.updateAuth({
|
|
30
|
+
nameKey: r.preferredSecurityScheme,
|
|
31
|
+
propertyKey: "value",
|
|
32
|
+
value: e
|
|
33
|
+
}));
|
|
35
34
|
}, D = (t) => {
|
|
35
|
+
var o;
|
|
36
36
|
const e = t.target.value;
|
|
37
37
|
p({
|
|
38
38
|
http: {
|
|
@@ -42,14 +42,13 @@ const ke = /* @__PURE__ */ Q({
|
|
|
42
42
|
username: e
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
}), r.preferredSecurityScheme &&
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
});
|
|
45
|
+
}), r.preferredSecurityScheme && ((o = C.value) == null || o.updateAuth({
|
|
46
|
+
nameKey: r.preferredSecurityScheme,
|
|
47
|
+
propertyKey: "username",
|
|
48
|
+
value: e
|
|
49
|
+
}));
|
|
52
50
|
}, E = (t) => {
|
|
51
|
+
var o;
|
|
53
52
|
const e = t.target.value;
|
|
54
53
|
p({
|
|
55
54
|
http: {
|
|
@@ -59,14 +58,13 @@ const ke = /* @__PURE__ */ Q({
|
|
|
59
58
|
password: e
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
|
-
}), r.preferredSecurityScheme &&
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
});
|
|
61
|
+
}), r.preferredSecurityScheme && ((o = C.value) == null || o.updateAuth({
|
|
62
|
+
nameKey: r.preferredSecurityScheme,
|
|
63
|
+
propertyKey: "password",
|
|
64
|
+
value: e
|
|
65
|
+
}));
|
|
69
66
|
}, H = (t) => {
|
|
67
|
+
var o;
|
|
70
68
|
const e = t.target.value;
|
|
71
69
|
p({
|
|
72
70
|
http: {
|
|
@@ -76,14 +74,12 @@ const ke = /* @__PURE__ */ Q({
|
|
|
76
74
|
token: e
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
|
-
}), r.preferredSecurityScheme &&
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
}, B = (t) => {
|
|
77
|
+
}), r.preferredSecurityScheme && ((o = C.value) == null || o.updateAuth({
|
|
78
|
+
nameKey: r.preferredSecurityScheme,
|
|
79
|
+
propertyKey: "token",
|
|
80
|
+
value: e
|
|
81
|
+
}));
|
|
82
|
+
}, z = (t) => {
|
|
87
83
|
p({
|
|
88
84
|
oAuth2: {
|
|
89
85
|
...r.oAuth2,
|
|
@@ -106,57 +102,57 @@ const ke = /* @__PURE__ */ Q({
|
|
|
106
102
|
});
|
|
107
103
|
};
|
|
108
104
|
function $(t) {
|
|
109
|
-
const e = r.oAuth2.scopes.join(" "),
|
|
105
|
+
const e = r.oAuth2.scopes.join(" "), o = (Math.random() + 1).toString(36).substring(7), a = new URL(t.authorizationUrl);
|
|
110
106
|
return p({
|
|
111
|
-
oAuth2: { ...r.oAuth2, state:
|
|
112
|
-
}),
|
|
107
|
+
oAuth2: { ...r.oAuth2, state: o }
|
|
108
|
+
}), a.searchParams.set("response_type", "token"), a.searchParams.set("client_id", r.oAuth2.clientId), a.searchParams.set("redirect_uri", window.location.href), a.searchParams.set("scope", e), a.searchParams.set("state", o), a.toString();
|
|
113
109
|
}
|
|
114
110
|
function q(t, e) {
|
|
115
111
|
if (typeof t != "string") {
|
|
116
112
|
console.log("tokenUrl is not a string");
|
|
117
113
|
return;
|
|
118
114
|
}
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
e != null && e.proxy ? _(e == null ? void 0 : e.proxy,
|
|
115
|
+
const o = e != null && e.baseUrl && !t.startsWith("http") ? x(e == null ? void 0 : e.baseUrl, t) : t, a = new URL(o);
|
|
116
|
+
a.searchParams.set("grant_type", "password"), a.searchParams.set("username", r.oAuth2.username), a.searchParams.set("password", r.oAuth2.password), a.searchParams.set("client_id", r.oAuth2.clientId), a.searchParams.set("scope", r.oAuth2.scopes.join(" ")), fetch(
|
|
117
|
+
e != null && e.proxy ? _(e == null ? void 0 : e.proxy, a.toString()) : a.toString(),
|
|
122
118
|
{
|
|
123
119
|
method: "POST",
|
|
124
120
|
headers: {
|
|
125
121
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
126
122
|
}
|
|
127
123
|
}
|
|
128
|
-
).then((
|
|
129
|
-
if (!
|
|
124
|
+
).then((u) => {
|
|
125
|
+
if (!u.ok)
|
|
130
126
|
throw new Error(
|
|
131
127
|
"Failed to get an access token. Please check your credentials."
|
|
132
128
|
);
|
|
133
|
-
return
|
|
134
|
-
}).then((
|
|
129
|
+
return u.json();
|
|
130
|
+
}).then((u) => {
|
|
135
131
|
p({
|
|
136
|
-
oAuth2: { ...r.oAuth2, accessToken:
|
|
132
|
+
oAuth2: { ...r.oAuth2, accessToken: u.access_token }
|
|
137
133
|
});
|
|
138
|
-
}).catch((
|
|
134
|
+
}).catch((u) => {
|
|
139
135
|
L("Couldn’t retrieve the password grant token", "warn", {
|
|
140
136
|
description: "Open your browser console to get more information."
|
|
141
|
-
}), console.error("[authorizeWithPassword]",
|
|
137
|
+
}), console.error("[authorizeWithPassword]", u);
|
|
142
138
|
});
|
|
143
139
|
}
|
|
144
|
-
const
|
|
140
|
+
const T = X({
|
|
145
141
|
get: () => r.oAuth2.scopes,
|
|
146
142
|
set: (t) => p({ oAuth2: { ...r.oAuth2, scopes: t } })
|
|
147
143
|
}), J = (t) => {
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
var
|
|
144
|
+
const o = window.open(t, "openAuth2Window", "left=100,top=100,width=800,height=600");
|
|
145
|
+
if (o) {
|
|
146
|
+
const a = setInterval(function() {
|
|
147
|
+
var u;
|
|
152
148
|
try {
|
|
153
|
-
const c = new URLSearchParams(
|
|
154
|
-
if (
|
|
155
|
-
clearInterval(
|
|
156
|
-
const w = (
|
|
149
|
+
const c = new URLSearchParams(o.location.href).get("access_token");
|
|
150
|
+
if (o.closed || c) {
|
|
151
|
+
clearInterval(a);
|
|
152
|
+
const w = (u = o.location.href.match(/state=([^&]*)/)) == null ? void 0 : u[1];
|
|
157
153
|
c && r.oAuth2.state === w && p({
|
|
158
154
|
oAuth2: { ...r.oAuth2, accessToken: c }
|
|
159
|
-
}),
|
|
155
|
+
}), o.close();
|
|
160
156
|
}
|
|
161
157
|
} catch {
|
|
162
158
|
}
|
|
@@ -164,41 +160,41 @@ const ke = /* @__PURE__ */ Q({
|
|
|
164
160
|
}
|
|
165
161
|
};
|
|
166
162
|
return (t, e) => {
|
|
167
|
-
var
|
|
168
|
-
return t.value && ((
|
|
163
|
+
var o;
|
|
164
|
+
return t.value && ((o = t.value) != null && o.type) ? (n(), m(te, {
|
|
169
165
|
key: 0,
|
|
170
166
|
onSubmit: e[5] || (e[5] = Y(() => {
|
|
171
167
|
}, ["prevent"]))
|
|
172
168
|
}, {
|
|
173
|
-
default:
|
|
174
|
-
t.value.type === "apiKey" ? (
|
|
169
|
+
default: s(() => [
|
|
170
|
+
t.value.type === "apiKey" ? (n(), m(f, {
|
|
175
171
|
key: 0,
|
|
176
172
|
id: `security-scheme-${t.value.name}`,
|
|
177
173
|
placeholder: "Token",
|
|
178
174
|
type: "password",
|
|
179
|
-
value:
|
|
175
|
+
value: l(r).apiKey.token,
|
|
180
176
|
onInput: V
|
|
181
177
|
}, {
|
|
182
|
-
default:
|
|
183
|
-
var
|
|
178
|
+
default: s(() => {
|
|
179
|
+
var a, u, h;
|
|
184
180
|
return [
|
|
185
|
-
t.value.in ? (
|
|
186
|
-
i(Z(((
|
|
181
|
+
t.value.in ? (n(), K(F, { key: 0 }, [
|
|
182
|
+
i(Z(((u = (a = t.value.in) == null ? void 0 : a.charAt(0)) == null ? void 0 : u.toUpperCase()) + ((h = t.value.in) == null ? void 0 : h.slice(1))), 1)
|
|
187
183
|
], 64)) : v("", !0),
|
|
188
184
|
e[6] || (e[6] = i(" API "))
|
|
189
185
|
];
|
|
190
186
|
}),
|
|
191
187
|
_: 1
|
|
192
|
-
}, 8, ["id", "value"])) : t.value.type === "http" || t.value.type === "basic" ? (
|
|
193
|
-
t.value.type === "basic" || t.value.scheme === "basic" ? (
|
|
194
|
-
default:
|
|
188
|
+
}, 8, ["id", "value"])) : t.value.type === "http" || t.value.type === "basic" ? (n(), K(F, { key: 1 }, [
|
|
189
|
+
t.value.type === "basic" || t.value.scheme === "basic" ? (n(), m(P, { key: 0 }, {
|
|
190
|
+
default: s(() => [
|
|
195
191
|
d(f, {
|
|
196
192
|
id: "http.basic.username",
|
|
197
193
|
placeholder: "Username",
|
|
198
|
-
value:
|
|
194
|
+
value: l(r).http.basic.username,
|
|
199
195
|
onInput: D
|
|
200
196
|
}, {
|
|
201
|
-
default:
|
|
197
|
+
default: s(() => e[7] || (e[7] = [
|
|
202
198
|
i(" Username ")
|
|
203
199
|
])),
|
|
204
200
|
_: 1
|
|
@@ -207,73 +203,73 @@ const ke = /* @__PURE__ */ Q({
|
|
|
207
203
|
id: "http.basic.password",
|
|
208
204
|
placeholder: "Password",
|
|
209
205
|
type: "password",
|
|
210
|
-
value:
|
|
206
|
+
value: l(r).http.basic.password,
|
|
211
207
|
onInput: E
|
|
212
208
|
}, {
|
|
213
|
-
default:
|
|
209
|
+
default: s(() => e[8] || (e[8] = [
|
|
214
210
|
i(" Password ")
|
|
215
211
|
])),
|
|
216
212
|
_: 1
|
|
217
213
|
}, 8, ["value"])
|
|
218
214
|
]),
|
|
219
215
|
_: 1
|
|
220
|
-
})) : t.value.type === "http" && t.value.scheme === "bearer" ? (
|
|
216
|
+
})) : t.value.type === "http" && t.value.scheme === "bearer" ? (n(), m(f, {
|
|
221
217
|
key: 1,
|
|
222
218
|
id: "http.bearer.token",
|
|
223
219
|
placeholder: "Token",
|
|
224
220
|
type: "password",
|
|
225
|
-
value:
|
|
221
|
+
value: l(r).http.bearer.token,
|
|
226
222
|
onInput: H
|
|
227
223
|
}, {
|
|
228
|
-
default:
|
|
224
|
+
default: s(() => e[9] || (e[9] = [
|
|
229
225
|
i(" Bearer Token ")
|
|
230
226
|
])),
|
|
231
227
|
_: 1
|
|
232
228
|
}, 8, ["value"])) : v("", !0)
|
|
233
|
-
], 64)) : t.value.type.toLowerCase() === "oauth2" && t.value.flows ? (
|
|
234
|
-
default:
|
|
235
|
-
var
|
|
229
|
+
], 64)) : t.value.type.toLowerCase() === "oauth2" && t.value.flows ? (n(), m(P, { key: 2 }, {
|
|
230
|
+
default: s(() => {
|
|
231
|
+
var a, u;
|
|
236
232
|
return [
|
|
237
|
-
t.value.flows.implicit ? (
|
|
238
|
-
|
|
233
|
+
t.value.flows.implicit ? (n(), K(F, { key: 0 }, [
|
|
234
|
+
l(r).oAuth2.accessToken ? (n(), K(F, { key: 0 }, [
|
|
239
235
|
d(f, {
|
|
240
236
|
id: "oAuth2.accessToken",
|
|
241
237
|
placeholder: "xxxxx",
|
|
242
238
|
type: "password",
|
|
243
|
-
value:
|
|
239
|
+
value: l(r).oAuth2.accessToken
|
|
244
240
|
}, {
|
|
245
|
-
default:
|
|
241
|
+
default: s(() => e[10] || (e[10] = [
|
|
246
242
|
i(" Access Token ")
|
|
247
243
|
])),
|
|
248
244
|
_: 1
|
|
249
245
|
}, 8, ["value"]),
|
|
250
246
|
d(re, {
|
|
251
|
-
onClick: e[0] || (e[0] = () =>
|
|
247
|
+
onClick: e[0] || (e[0] = () => l(p)({
|
|
252
248
|
oAuth2: {
|
|
253
|
-
...
|
|
249
|
+
...l(r).oAuth2,
|
|
254
250
|
accessToken: "",
|
|
255
251
|
state: ""
|
|
256
252
|
}
|
|
257
253
|
}))
|
|
258
254
|
}, {
|
|
259
|
-
default:
|
|
255
|
+
default: s(() => e[11] || (e[11] = [
|
|
260
256
|
i(" Reset ")
|
|
261
257
|
])),
|
|
262
258
|
_: 1
|
|
263
259
|
})
|
|
264
260
|
], 64)) : v("", !0)
|
|
265
261
|
], 64)) : v("", !0),
|
|
266
|
-
(
|
|
267
|
-
default:
|
|
262
|
+
(u = (a = t.value) == null ? void 0 : a.flows) != null && u.password ? (n(), m(j, { key: 1 }, {
|
|
263
|
+
default: s(() => [
|
|
268
264
|
d(P, null, {
|
|
269
|
-
default:
|
|
265
|
+
default: s(() => [
|
|
270
266
|
d(f, {
|
|
271
267
|
id: "oAuth2.username",
|
|
272
268
|
placeholder: "Username",
|
|
273
|
-
value:
|
|
269
|
+
value: l(r).oAuth2.username,
|
|
274
270
|
onInput: M
|
|
275
271
|
}, {
|
|
276
|
-
default:
|
|
272
|
+
default: s(() => e[12] || (e[12] = [
|
|
277
273
|
i(" Username ")
|
|
278
274
|
])),
|
|
279
275
|
_: 1
|
|
@@ -282,10 +278,10 @@ const ke = /* @__PURE__ */ Q({
|
|
|
282
278
|
id: "oAuth2.password",
|
|
283
279
|
placeholder: "Password",
|
|
284
280
|
type: "password",
|
|
285
|
-
value:
|
|
281
|
+
value: l(r).oAuth2.password,
|
|
286
282
|
onInput: G
|
|
287
283
|
}, {
|
|
288
|
-
default:
|
|
284
|
+
default: s(() => e[13] || (e[13] = [
|
|
289
285
|
i(" Password ")
|
|
290
286
|
])),
|
|
291
287
|
_: 1
|
|
@@ -294,38 +290,38 @@ const ke = /* @__PURE__ */ Q({
|
|
|
294
290
|
_: 1
|
|
295
291
|
}),
|
|
296
292
|
d(P, null, {
|
|
297
|
-
default:
|
|
298
|
-
var h, c, w, A, k, S, y, b, I, g,
|
|
293
|
+
default: s(() => {
|
|
294
|
+
var h, c, w, A, k, S, y, b, I, g, B;
|
|
299
295
|
return [
|
|
300
296
|
d(f, {
|
|
301
297
|
id: "oAuth2.clientId",
|
|
302
298
|
placeholder: "12345",
|
|
303
299
|
type: "text",
|
|
304
|
-
value:
|
|
305
|
-
onInput:
|
|
300
|
+
value: l(r).oAuth2.clientId,
|
|
301
|
+
onInput: z
|
|
306
302
|
}, {
|
|
307
|
-
default:
|
|
303
|
+
default: s(() => e[14] || (e[14] = [
|
|
308
304
|
i(" Client ID ")
|
|
309
305
|
])),
|
|
310
306
|
_: 1
|
|
311
307
|
}, 8, ["value"]),
|
|
312
308
|
t.value !== void 0 && Object.entries(
|
|
313
309
|
((w = (c = (h = t.value) == null ? void 0 : h.flows) == null ? void 0 : c.implicit) == null ? void 0 : w.scopes) ?? ((S = (k = (A = t.value) == null ? void 0 : A.flows) == null ? void 0 : k.password) == null ? void 0 : S.scopes) ?? {}
|
|
314
|
-
).length > 0 ? (
|
|
310
|
+
).length > 0 ? (n(), m(R, {
|
|
315
311
|
key: 0,
|
|
316
|
-
selected:
|
|
317
|
-
"onUpdate:selected": e[1] || (e[1] = (
|
|
318
|
-
scopes: ((I = (b = (y = t.value) == null ? void 0 : y.flows) == null ? void 0 : b.implicit) == null ? void 0 : I.scopes) ?? ((
|
|
312
|
+
selected: T.value,
|
|
313
|
+
"onUpdate:selected": e[1] || (e[1] = (U) => T.value = U),
|
|
314
|
+
scopes: ((I = (b = (y = t.value) == null ? void 0 : y.flows) == null ? void 0 : b.implicit) == null ? void 0 : I.scopes) ?? ((B = (g = t.value) == null ? void 0 : g.flows) == null ? void 0 : B.password.scopes)
|
|
319
315
|
}, null, 8, ["selected", "scopes"])) : v("", !0),
|
|
320
316
|
W("button", {
|
|
321
317
|
class: "cardform-auth-button",
|
|
322
318
|
type: "button",
|
|
323
319
|
onClick: e[2] || (e[2] = () => {
|
|
324
|
-
var
|
|
320
|
+
var U, O;
|
|
325
321
|
return q(
|
|
326
|
-
(O = (
|
|
322
|
+
(O = (U = t.value.flows) == null ? void 0 : U.password) == null ? void 0 : O.tokenUrl,
|
|
327
323
|
{
|
|
328
|
-
baseUrl:
|
|
324
|
+
baseUrl: l(ae)(l(N)),
|
|
329
325
|
proxy: t.proxy
|
|
330
326
|
}
|
|
331
327
|
);
|
|
@@ -337,30 +333,30 @@ const ke = /* @__PURE__ */ Q({
|
|
|
337
333
|
})
|
|
338
334
|
]),
|
|
339
335
|
_: 1
|
|
340
|
-
})) : (
|
|
341
|
-
default:
|
|
336
|
+
})) : (n(), m(j, { key: 2 }, {
|
|
337
|
+
default: s(() => [
|
|
342
338
|
d(P, null, {
|
|
343
|
-
default:
|
|
339
|
+
default: s(() => {
|
|
344
340
|
var h, c, w, A, k, S;
|
|
345
341
|
return [
|
|
346
342
|
d(f, {
|
|
347
343
|
id: "oAuth2.clientId",
|
|
348
344
|
placeholder: "12345",
|
|
349
345
|
type: "text",
|
|
350
|
-
value:
|
|
351
|
-
onInput:
|
|
346
|
+
value: l(r).oAuth2.clientId,
|
|
347
|
+
onInput: z
|
|
352
348
|
}, {
|
|
353
|
-
default:
|
|
349
|
+
default: s(() => e[15] || (e[15] = [
|
|
354
350
|
i(" Client ID ")
|
|
355
351
|
])),
|
|
356
352
|
_: 1
|
|
357
353
|
}, 8, ["value"]),
|
|
358
354
|
t.value !== void 0 && Object.entries(
|
|
359
355
|
((h = t.value.flows.implicit) == null ? void 0 : h.scopes) ?? ((c = t.value.flows.password) == null ? void 0 : c.scopes) ?? ((w = t.value.flows.authorizationCode) == null ? void 0 : w.scopes)
|
|
360
|
-
).length > 0 ? (
|
|
356
|
+
).length > 0 ? (n(), m(R, {
|
|
361
357
|
key: 0,
|
|
362
|
-
selected:
|
|
363
|
-
"onUpdate:selected": e[3] || (e[3] = (y) =>
|
|
358
|
+
selected: T.value,
|
|
359
|
+
"onUpdate:selected": e[3] || (e[3] = (y) => T.value = y),
|
|
364
360
|
scopes: ((A = t.value.flows.implicit) == null ? void 0 : A.scopes) ?? ((k = t.value.flows.password) == null ? void 0 : k.scopes) ?? ((S = t.value.flows.authorizationCode) == null ? void 0 : S.scopes)
|
|
365
361
|
}, null, 8, ["selected", "scopes"])) : v("", !0),
|
|
366
362
|
W("button", {
|
|
@@ -393,5 +389,5 @@ const ke = /* @__PURE__ */ Q({
|
|
|
393
389
|
}
|
|
394
390
|
});
|
|
395
391
|
export {
|
|
396
|
-
|
|
392
|
+
Se as default
|
|
397
393
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecuritySchemeSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/legacy/components/SecuritySchemeSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SecuritySchemeSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/legacy/components/SecuritySchemeSelector.vue"],"names":[],"mappings":"AAiMA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;;YAUxE,SAAS,CAAC,yBAAyB,GACnC,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAC7C,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;;;;YAF/C,SAAS,CAAC,yBAAyB,GACnC,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAC7C,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;;;;AA0OrD,wBASG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./SecuritySchemeSelector.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const f = /* @__PURE__ */ o(e, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ o(e, [["__scopeId", "data-v-14fe4cfc"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,73 +1,83 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as _, onMounted as z, onServerPrefetch as I, computed as l, openBlock as S, createElementBlock as K, toDisplayString as m, createBlock as P, unref as s, withCtx as v, createVNode as b, createElementVNode as U, createTextVNode as $, createCommentVNode as D } from "vue";
|
|
2
|
+
import { ScalarListbox as E, ScalarButton as H, ScalarIcon as M } from "@scalar/components";
|
|
3
|
+
import { useApiClient as T } from "../../features/ApiClientModal/useApiClient.js";
|
|
4
|
+
import { useAuthenticationStore as F } from "../stores/useAuthenticationStore.js";
|
|
5
|
+
const W = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "security-scheme-label"
|
|
7
|
-
},
|
|
8
|
+
}, R = /* @__PURE__ */ _({
|
|
8
9
|
__name: "SecuritySchemeSelector",
|
|
9
10
|
props: {
|
|
10
11
|
value: {}
|
|
11
12
|
},
|
|
12
13
|
emits: ["input"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
setup(A, { emit: w }) {
|
|
15
|
+
const i = A, C = w, { authentication: c, setAuthentication: O } = F(), { client: p } = T();
|
|
16
|
+
z(() => {
|
|
17
|
+
c.preferredSecurityScheme || u(Object.keys(i.value ?? {})[0] ?? null);
|
|
17
18
|
});
|
|
18
19
|
const u = (e) => {
|
|
19
|
-
|
|
20
|
+
var t;
|
|
21
|
+
if (O({
|
|
20
22
|
preferredSecurityScheme: e
|
|
21
|
-
}),
|
|
23
|
+
}), (t = p.value) != null && t.store) {
|
|
24
|
+
const { collections: r, collectionMutators: o, securitySchemes: j } = p.value.store, f = Object.keys(r)[0], y = Object.values(j).find(
|
|
25
|
+
({ nameKey: x }) => x === e
|
|
26
|
+
);
|
|
27
|
+
y && f && o.edit(f, "selectedSecuritySchemeUids", [
|
|
28
|
+
y.uid
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
C("input", e);
|
|
22
32
|
};
|
|
23
|
-
|
|
24
|
-
() => u(Object.keys(
|
|
33
|
+
I(
|
|
34
|
+
() => u(Object.keys(i.value ?? {})[0] ?? null)
|
|
25
35
|
);
|
|
26
|
-
const
|
|
27
|
-
var t,
|
|
28
|
-
return
|
|
29
|
-
},
|
|
30
|
-
() =>
|
|
36
|
+
const B = (e) => !(e != null && e.type), L = (e) => e.type.toLowerCase() === "apikey", g = (e) => e.type === "http" && e.scheme.toLowerCase() === "basic" || e.type.toLowerCase() === "basic", k = (e) => e.type === "http" && e.scheme.toLowerCase() === "bearer", N = (e) => e.type.toLowerCase() === "oauth2", a = (e, t) => `${V(e)} (${t})`, V = (e) => {
|
|
37
|
+
var t, r;
|
|
38
|
+
return B(e) ? "No Authentication" : L(e) ? "API Key" : g(e) ? "Basic Authentication" : k(e) ? "Bearer Authentication" : N(e) ? (t = e.flows) != null && t.implicit ? "OAuth 2.0 Implicit" : (r = e.flows) != null && r.password ? "OAuth 2.0 Password" : "OAuth 2.0" : `${e.type} (not yet supported)`;
|
|
39
|
+
}, n = l(() => Object.keys(i.value ?? {})), d = l(
|
|
40
|
+
() => n.value.map((e) => {
|
|
31
41
|
var t;
|
|
32
42
|
return {
|
|
33
43
|
id: e,
|
|
34
|
-
label:
|
|
44
|
+
label: a((t = i.value) == null ? void 0 : t[e], e)
|
|
35
45
|
};
|
|
36
46
|
})
|
|
37
47
|
), h = l({
|
|
38
48
|
get: () => {
|
|
39
49
|
var e;
|
|
40
|
-
return (e =
|
|
41
|
-
(t) => t.id ===
|
|
50
|
+
return (e = d.value) == null ? void 0 : e.find(
|
|
51
|
+
(t) => t.id === c.preferredSecurityScheme
|
|
42
52
|
);
|
|
43
53
|
},
|
|
44
54
|
set: (e) => u((e == null ? void 0 : e.id) ?? "")
|
|
45
55
|
});
|
|
46
56
|
return (e, t) => {
|
|
47
|
-
var
|
|
48
|
-
return
|
|
57
|
+
var r;
|
|
58
|
+
return n.value.length === 1 ? (S(), K("div", W, m(a((r = e.value) == null ? void 0 : r[n.value[0]], n.value[0])), 1)) : n.value.length > 1 ? (S(), P(s(E), {
|
|
49
59
|
key: 1,
|
|
50
60
|
modelValue: h.value,
|
|
51
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
61
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => h.value = o),
|
|
52
62
|
label: "Security Scheme",
|
|
53
|
-
options:
|
|
63
|
+
options: d.value,
|
|
54
64
|
resize: ""
|
|
55
65
|
}, {
|
|
56
|
-
default:
|
|
57
|
-
|
|
66
|
+
default: v(() => [
|
|
67
|
+
b(s(H), {
|
|
58
68
|
class: "security-scheme-button",
|
|
59
69
|
fullWidth: "",
|
|
60
70
|
variant: "ghost"
|
|
61
71
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
var
|
|
72
|
+
default: v(() => {
|
|
73
|
+
var o;
|
|
64
74
|
return [
|
|
65
|
-
t[1] || (t[1] =
|
|
66
|
-
|
|
67
|
-
(
|
|
68
|
-
|
|
75
|
+
t[1] || (t[1] = U("span", { class: "sr-only" }, "Selected:", -1)),
|
|
76
|
+
$(" " + m(s(c).preferredSecurityScheme ? a(
|
|
77
|
+
(o = e.value) == null ? void 0 : o[s(c).preferredSecurityScheme],
|
|
78
|
+
s(c).preferredSecurityScheme
|
|
69
79
|
) : "No Authentication") + " ", 1),
|
|
70
|
-
|
|
80
|
+
b(s(M), {
|
|
71
81
|
icon: "ChevronDown",
|
|
72
82
|
size: "xs"
|
|
73
83
|
})
|
|
@@ -77,10 +87,10 @@ const E = {
|
|
|
77
87
|
})
|
|
78
88
|
]),
|
|
79
89
|
_: 1
|
|
80
|
-
}, 8, ["modelValue", "options"])) :
|
|
90
|
+
}, 8, ["modelValue", "options"])) : D("", !0);
|
|
81
91
|
};
|
|
82
92
|
}
|
|
83
93
|
});
|
|
84
94
|
export {
|
|
85
|
-
|
|
95
|
+
R as default
|
|
86
96
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export * from './useApiClientStore.js';
|
|
2
1
|
export * from './useAuthenticationStore.js';
|
|
3
2
|
export * from './useOpenApiStore.js';
|
|
4
|
-
export * from './useRequestStore
|
|
3
|
+
export * from './useRequestStore';
|
|
5
4
|
export * from './useServerStore.js';
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA"}
|