@scalar/api-client 2.5.29 → 2.5.30
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 +18 -0
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +14 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +49 -47
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +202 -1
- 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 +100 -91
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +200 -1
- 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 +64 -44
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +14 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +104 -121
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.d.ts +9 -0
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.js +28 -0
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.test.d.ts +2 -0
- package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.test.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +3 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/index.js +6 -4
- 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 +25 -24
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +13 -13
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as A, ref as h, computed as p, watch as v, createElementBlock as s, openBlock as o, withModifiers as z, createCommentVNode as f, createBlock as C, createVNode as b, normalizeClass as a, Fragment as V, renderList as $, createElementVNode as y, toDisplayString as O, unref as u, withCtx as S, renderSlot as B } from "vue";
|
|
2
|
+
import { useModal as M } from "@scalar/components";
|
|
3
|
+
import { isDefined as N } from "@scalar/helpers/array/is-defined";
|
|
4
|
+
import D from "./DeleteRequestAuthModal.vue.js";
|
|
5
|
+
import E from "./RequestAuthTab.vue.js";
|
|
6
|
+
import U from "../../../../components/DataTable/DataTable.vue.js";
|
|
7
|
+
import { useWorkspace as j } from "../../../../store/store.js";
|
|
8
|
+
const q = ["onClick"], F = { class: "relative z-10 font-medium whitespace-nowrap" }, I = {
|
|
7
9
|
key: 0,
|
|
8
10
|
class: "absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"
|
|
9
|
-
},
|
|
11
|
+
}, P = /* @__PURE__ */ A({
|
|
10
12
|
__name: "RequestAuthDataTable",
|
|
11
13
|
props: {
|
|
12
14
|
collection: {},
|
|
@@ -18,79 +20,97 @@ const M = ["onClick"], N = { class: "relative z-10 font-medium whitespace-nowrap
|
|
|
18
20
|
server: {},
|
|
19
21
|
workspace: {}
|
|
20
22
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
emits: ["authorized", "activeSchemes"],
|
|
24
|
+
setup(n, { emit: k }) {
|
|
25
|
+
const m = k, { securitySchemes: g } = j(), d = M(), w = h(
|
|
23
26
|
null
|
|
24
|
-
),
|
|
27
|
+
), r = h(0), i = p(() => {
|
|
25
28
|
if (!n.selectedSchemeOptions || n.selectedSchemeOptions.length === 0)
|
|
26
29
|
return [];
|
|
27
|
-
const e = n.selectedSchemeOptions[
|
|
30
|
+
const e = n.selectedSchemeOptions[r.value];
|
|
28
31
|
if (!e)
|
|
29
32
|
return [];
|
|
30
|
-
const
|
|
31
|
-
return
|
|
32
|
-
})
|
|
33
|
-
|
|
33
|
+
const t = e.id.split(",").filter(Boolean);
|
|
34
|
+
return t.length > 1 ? t : [e.id];
|
|
35
|
+
});
|
|
36
|
+
v(
|
|
37
|
+
i,
|
|
38
|
+
(e) => {
|
|
39
|
+
m(
|
|
40
|
+
"activeSchemes",
|
|
41
|
+
e.map((t) => g[t]).filter(N)
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
{ immediate: !0 }
|
|
45
|
+
);
|
|
46
|
+
const x = p(() => i.value.length > 0);
|
|
47
|
+
return v(
|
|
34
48
|
() => n.selectedSchemeOptions,
|
|
35
49
|
(e) => {
|
|
36
|
-
(!e || !e[
|
|
50
|
+
(!e || !e[r.value]) && (r.value = Math.max(0, r.value - 1));
|
|
37
51
|
}
|
|
38
|
-
), (e,
|
|
39
|
-
onSubmit:
|
|
52
|
+
), (e, t) => (o(), s("form", {
|
|
53
|
+
onSubmit: t[2] || (t[2] = z(() => {
|
|
40
54
|
}, ["prevent"]))
|
|
41
55
|
}, [
|
|
42
|
-
e.selectedSchemeOptions.length > 1 ? (o(),
|
|
56
|
+
e.selectedSchemeOptions.length > 1 ? (o(), s("div", {
|
|
43
57
|
key: 0,
|
|
44
|
-
class:
|
|
58
|
+
class: a(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", e.layout === "client" && "border-x-0"])
|
|
45
59
|
}, [
|
|
46
|
-
(o(!0),
|
|
47
|
-
key:
|
|
48
|
-
class:
|
|
60
|
+
(o(!0), s(V, null, $(e.selectedSchemeOptions, (l, c) => (o(), s("div", {
|
|
61
|
+
key: l.id,
|
|
62
|
+
class: a(["relative z-1 -mb-[var(--scalar-border-width)] flex h-8 cursor-pointer", [r.value === c ? "text-c-1" : "text-c-3"]])
|
|
49
63
|
}, [
|
|
50
|
-
|
|
64
|
+
y("button", {
|
|
51
65
|
class: "floating-bg relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium",
|
|
52
66
|
type: "button",
|
|
53
|
-
onClick: (
|
|
67
|
+
onClick: (L) => r.value = c
|
|
54
68
|
}, [
|
|
55
|
-
|
|
56
|
-
], 8,
|
|
57
|
-
|
|
69
|
+
y("span", F, O(l.label), 1)
|
|
70
|
+
], 8, q),
|
|
71
|
+
r.value === c ? (o(), s("div", I)) : f("", !0)
|
|
58
72
|
], 2))), 128))
|
|
59
|
-
], 2)) :
|
|
60
|
-
|
|
73
|
+
], 2)) : f("", !0),
|
|
74
|
+
x.value ? (o(), C(u(U), {
|
|
61
75
|
key: 1,
|
|
62
|
-
class:
|
|
76
|
+
class: a(["flex-1", e.layout === "reference" && "bg-b-1 rounded-b-lg border border-t-0"]),
|
|
63
77
|
columns: [""],
|
|
64
78
|
presentational: ""
|
|
65
79
|
}, {
|
|
66
|
-
default:
|
|
67
|
-
|
|
80
|
+
default: S(() => [
|
|
81
|
+
b(E, {
|
|
68
82
|
collection: e.collection,
|
|
69
83
|
envVariables: e.envVariables,
|
|
70
84
|
environment: e.environment,
|
|
71
85
|
layout: e.layout,
|
|
72
86
|
persistAuth: e.persistAuth,
|
|
73
|
-
securitySchemeUids:
|
|
87
|
+
securitySchemeUids: i.value,
|
|
74
88
|
server: e.server,
|
|
75
|
-
workspace: e.workspace
|
|
76
|
-
|
|
89
|
+
workspace: e.workspace,
|
|
90
|
+
onAuthorized: t[0] || (t[0] = (l) => m("authorized"))
|
|
91
|
+
}, {
|
|
92
|
+
"oauth-actions": S(() => [
|
|
93
|
+
B(e.$slots, "oauth-actions", {}, void 0, !0)
|
|
94
|
+
]),
|
|
95
|
+
_: 3
|
|
96
|
+
}, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "securitySchemeUids", "server", "workspace"])
|
|
77
97
|
]),
|
|
78
|
-
_:
|
|
79
|
-
}, 8, ["class"])) : (o(),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 8, ["class"])) : (o(), s("div", {
|
|
80
100
|
key: 2,
|
|
81
|
-
class:
|
|
101
|
+
class: a([
|
|
82
102
|
"text-c-3 bg-b-1 flex min-h-16 items-center justify-center border-t px-4 text-sm",
|
|
83
103
|
e.layout === "reference" && "min-h-[calc(4rem+0.5px)] rounded-b-lg border"
|
|
84
104
|
])
|
|
85
105
|
}, " No authentication selected ", 2)),
|
|
86
|
-
|
|
87
|
-
scheme:
|
|
88
|
-
state:
|
|
89
|
-
onClose:
|
|
106
|
+
b(D, {
|
|
107
|
+
scheme: w.value,
|
|
108
|
+
state: u(d),
|
|
109
|
+
onClose: t[1] || (t[1] = (l) => u(d).hide())
|
|
90
110
|
}, null, 8, ["scheme", "state"])
|
|
91
111
|
], 32));
|
|
92
112
|
}
|
|
93
113
|
});
|
|
94
114
|
export {
|
|
95
|
-
|
|
115
|
+
P as default
|
|
96
116
|
};
|
|
@@ -12,6 +12,19 @@ type __VLS_Props = {
|
|
|
12
12
|
server: Server | undefined;
|
|
13
13
|
workspace: Workspace;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
type __VLS_Slots = {
|
|
16
|
+
'oauth-actions'?: () => unknown;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
authorized: () => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onAuthorized?: (() => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
24
|
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
17
30
|
//# sourceMappingURL=RequestAuthTab.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue"],"names":[],"mappings":"AA0QA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAKrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAQ1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;AAiBF,KAAK,WAAW,GAAG;IACjB,eAAe,CAAC,EAAE,MAAM,OAAO,CAAA;CAChC,CAAC;AAkgBF,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,17 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarMarkdownSummary as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import w from "./RequestAuthDataTableInput.vue.js";
|
|
1
|
+
import { defineComponent as N, computed as P, ref as j, onMounted as L, createElementBlock as u, openBlock as a, Fragment as p, renderList as U, createBlock as m, createCommentVNode as v, unref as i, withCtx as l, createVNode as n, createElementVNode as C, toDisplayString as A, mergeProps as V, createTextVNode as w, normalizeClass as T, renderSlot as M, capitalize as $ } from "vue";
|
|
2
|
+
import { ScalarMarkdownSummary as R } from "@scalar/components";
|
|
3
|
+
import { useWorkspace as Q } from "../../../../store/store.js";
|
|
4
|
+
import { updateScheme as q } from "../helpers/update-scheme.js";
|
|
5
|
+
import { restoreAuthFromLocalStorage as D } from "./helpers/restore-auth-from-local-storage.js";
|
|
6
|
+
import E from "./OAuth2.vue.js";
|
|
7
|
+
import x from "./RequestAuthDataTableInput.vue.js";
|
|
9
8
|
import f from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
9
|
+
import z from "../../../../components/DataTable/DataTableCell.vue.js";
|
|
10
|
+
const O = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow-hidden px-3 py-1.25 text-ellipsis group-hover/auth:absolute group-hover/auth:h-auto group-hover/auth:border-b *:first:line-clamp-1 *:first:text-ellipsis group-hover/auth:*:first:line-clamp-none" }, H = {
|
|
12
11
|
key: 0,
|
|
13
12
|
class: "flex min-h-8 border-t text-base"
|
|
14
|
-
}, W = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" }, G = ["onClick"],
|
|
13
|
+
}, W = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" }, G = ["onClick"], J = { class: "relative z-10" }, le = /* @__PURE__ */ N({
|
|
15
14
|
__name: "RequestAuthTab",
|
|
16
15
|
props: {
|
|
17
16
|
collection: {},
|
|
@@ -23,79 +22,57 @@ const J = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow
|
|
|
23
22
|
server: {},
|
|
24
23
|
workspace: {}
|
|
25
24
|
},
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
emits: ["authorized"],
|
|
26
|
+
setup(b, { emit: B }) {
|
|
27
|
+
const F = B, c = Q(), { securitySchemes: I } = c, _ = P(
|
|
28
28
|
() => b.securitySchemeUids.map((t) => ({
|
|
29
|
-
scheme:
|
|
29
|
+
scheme: I[t]
|
|
30
30
|
}))
|
|
31
|
-
),
|
|
32
|
-
const
|
|
31
|
+
), d = j(""), S = (t) => {
|
|
32
|
+
const o = t.description ? `: ${t.description}` : "", e = `${$(t.nameKey)}${o || `: ${t.type}`}`;
|
|
33
33
|
if (t.type === "apiKey")
|
|
34
|
-
return `${
|
|
34
|
+
return `${$(t.nameKey)}${o || `: ${t.in}`}`;
|
|
35
35
|
if (t.type === "oauth2") {
|
|
36
|
-
const
|
|
37
|
-
return `${
|
|
36
|
+
const r = Object.values(t.flows ?? {})[0];
|
|
37
|
+
return `${$(t.nameKey)}: ${d.value ? d.value : (r == null ? void 0 : r.type) ?? ""}${o}`;
|
|
38
38
|
}
|
|
39
|
-
return t.type === "http" ? `${
|
|
40
|
-
}, k = (t,
|
|
41
|
-
|
|
39
|
+
return t.type === "http" ? `${$(t.nameKey)}: ${t.scheme}${o}` : `${e}${o}`;
|
|
40
|
+
}, k = (t, o, e) => {
|
|
41
|
+
q(t, o, e, c, b.persistAuth);
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return;
|
|
46
|
-
const t = JSON.parse(
|
|
47
|
-
N().getItem(j.AUTH) ?? "{}"
|
|
48
|
-
), r = Object.keys(g).reduce(
|
|
49
|
-
(e, o) => {
|
|
50
|
-
const a = g[o];
|
|
51
|
-
return a && (e[a.nameKey] = a.uid), e;
|
|
52
|
-
},
|
|
53
|
-
{}
|
|
54
|
-
);
|
|
55
|
-
Object.entries(t).forEach(([e, o]) => {
|
|
56
|
-
const a = r[e];
|
|
57
|
-
a && Object.entries(o).forEach(([E, K]) => {
|
|
58
|
-
O.edit(a, E, K);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
try {
|
|
62
|
-
const o = JSON.parse(
|
|
63
|
-
N().getItem(j.SELECTED_SECURITY_SCHEMES) ?? ""
|
|
64
|
-
).map((a) => Array.isArray(a) ? a.map((y) => r[y]).filter(B) : r[a]).filter(B);
|
|
65
|
-
M.edit(b.collection.uid, "selectedSecuritySchemeUids", o);
|
|
66
|
-
} catch {
|
|
67
|
-
}
|
|
43
|
+
L(() => {
|
|
44
|
+
b.persistAuth && D(c, b.collection.uid);
|
|
68
45
|
});
|
|
69
|
-
const
|
|
46
|
+
const y = {
|
|
70
47
|
environment: b.environment,
|
|
71
48
|
envVariables: b.envVariables,
|
|
72
49
|
workspace: b.workspace
|
|
73
50
|
};
|
|
74
|
-
return (t,
|
|
51
|
+
return (t, o) => (a(!0), u(p, null, U(_.value, ({ scheme: e }) => (a(), u(p, {
|
|
75
52
|
key: e == null ? void 0 : e.uid
|
|
76
53
|
}, [
|
|
77
|
-
|
|
78
|
-
default:
|
|
79
|
-
|
|
80
|
-
"aria-label":
|
|
54
|
+
_.value.length > 1 && e ? (a(), m(i(f), { key: 0 }, {
|
|
55
|
+
default: l(() => [
|
|
56
|
+
n(i(z), {
|
|
57
|
+
"aria-label": S(e),
|
|
81
58
|
class: "text-c-2 group/auth flex items-center leading-[22px] whitespace-nowrap outline-none hover:whitespace-normal"
|
|
82
59
|
}, {
|
|
83
|
-
default:
|
|
84
|
-
|
|
60
|
+
default: l(() => [
|
|
61
|
+
C("p", O, A(S(e)), 1)
|
|
85
62
|
]),
|
|
86
63
|
_: 2
|
|
87
64
|
}, 1032, ["aria-label"])
|
|
88
65
|
]),
|
|
89
66
|
_: 2
|
|
90
67
|
}, 1024)) : v("", !0),
|
|
91
|
-
e != null && e.description &&
|
|
92
|
-
default:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
68
|
+
e != null && e.description && _.value.length <= 1 ? (a(), m(i(f), { key: 1 }, {
|
|
69
|
+
default: l(() => [
|
|
70
|
+
n(i(z), {
|
|
71
|
+
"aria-label": e.description,
|
|
72
|
+
class: "max-h-[auto]"
|
|
96
73
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
74
|
+
default: l(() => [
|
|
75
|
+
n(i(R), {
|
|
99
76
|
class: "auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25",
|
|
100
77
|
value: e.description
|
|
101
78
|
}, null, 8, ["value"])
|
|
@@ -105,137 +82,143 @@ const J = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow
|
|
|
105
82
|
]),
|
|
106
83
|
_: 2
|
|
107
84
|
}, 1024)) : v("", !0),
|
|
108
|
-
(e == null ? void 0 : e.type) === "http" ? (
|
|
109
|
-
e.scheme === "bearer" ? (
|
|
110
|
-
default:
|
|
111
|
-
|
|
85
|
+
(e == null ? void 0 : e.type) === "http" ? (a(), u(p, { key: 2 }, [
|
|
86
|
+
e.scheme === "bearer" ? (a(), m(i(f), { key: 0 }, {
|
|
87
|
+
default: l(() => [
|
|
88
|
+
n(x, V({ ref_for: !0 }, y, {
|
|
112
89
|
containerClass: t.layout === "reference" && "border-t",
|
|
113
90
|
modelValue: e.token,
|
|
114
91
|
placeholder: "Token",
|
|
115
92
|
type: "password",
|
|
116
|
-
"onUpdate:modelValue": (
|
|
93
|
+
"onUpdate:modelValue": (r) => k(e.uid, "token", r)
|
|
117
94
|
}), {
|
|
118
|
-
default:
|
|
119
|
-
|
|
95
|
+
default: l(() => o[1] || (o[1] = [
|
|
96
|
+
w(" Bearer Token ")
|
|
120
97
|
])),
|
|
121
98
|
_: 2,
|
|
122
|
-
__: [
|
|
99
|
+
__: [1]
|
|
123
100
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
124
101
|
]),
|
|
125
102
|
_: 2
|
|
126
|
-
}, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (
|
|
127
|
-
|
|
128
|
-
default:
|
|
129
|
-
|
|
103
|
+
}, 1024)) : (e == null ? void 0 : e.scheme) === "basic" ? (a(), u(p, { key: 1 }, [
|
|
104
|
+
n(i(f), null, {
|
|
105
|
+
default: l(() => [
|
|
106
|
+
n(x, V({ ref_for: !0 }, y, {
|
|
130
107
|
class: "text-c-2",
|
|
131
108
|
modelValue: e.username,
|
|
132
109
|
placeholder: "janedoe",
|
|
133
110
|
required: "",
|
|
134
|
-
"onUpdate:modelValue": (
|
|
111
|
+
"onUpdate:modelValue": (r) => k(e.uid, "username", r)
|
|
135
112
|
}), {
|
|
136
|
-
default:
|
|
137
|
-
|
|
113
|
+
default: l(() => o[2] || (o[2] = [
|
|
114
|
+
w(" Username ")
|
|
138
115
|
])),
|
|
139
116
|
_: 2,
|
|
140
|
-
__: [
|
|
117
|
+
__: [2]
|
|
141
118
|
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
142
119
|
]),
|
|
143
120
|
_: 2
|
|
144
121
|
}, 1024),
|
|
145
|
-
|
|
146
|
-
default:
|
|
147
|
-
|
|
122
|
+
n(i(f), null, {
|
|
123
|
+
default: l(() => [
|
|
124
|
+
n(x, V({ ref_for: !0 }, y, {
|
|
148
125
|
modelValue: e.password,
|
|
149
126
|
placeholder: "********",
|
|
150
127
|
type: "password",
|
|
151
|
-
"onUpdate:modelValue": (
|
|
128
|
+
"onUpdate:modelValue": (r) => k(e.uid, "password", r)
|
|
152
129
|
}), {
|
|
153
|
-
default:
|
|
154
|
-
|
|
130
|
+
default: l(() => o[3] || (o[3] = [
|
|
131
|
+
w(" Password ")
|
|
155
132
|
])),
|
|
156
133
|
_: 2,
|
|
157
|
-
__: [
|
|
134
|
+
__: [3]
|
|
158
135
|
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
159
136
|
]),
|
|
160
137
|
_: 2
|
|
161
138
|
}, 1024)
|
|
162
139
|
], 64)) : v("", !0)
|
|
163
|
-
], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (
|
|
164
|
-
|
|
165
|
-
default:
|
|
166
|
-
|
|
140
|
+
], 64)) : (e == null ? void 0 : e.type) === "apiKey" ? (a(), u(p, { key: 3 }, [
|
|
141
|
+
n(i(f), null, {
|
|
142
|
+
default: l(() => [
|
|
143
|
+
n(x, V({ ref_for: !0 }, y, {
|
|
167
144
|
containerClass: t.layout === "reference" && "border-t",
|
|
168
145
|
modelValue: e.name,
|
|
169
146
|
placeholder: "api-key",
|
|
170
|
-
"onUpdate:modelValue": (
|
|
147
|
+
"onUpdate:modelValue": (r) => k(e.uid, "name", r)
|
|
171
148
|
}), {
|
|
172
|
-
default:
|
|
173
|
-
|
|
149
|
+
default: l(() => o[4] || (o[4] = [
|
|
150
|
+
w(" Name ")
|
|
174
151
|
])),
|
|
175
152
|
_: 2,
|
|
176
|
-
__: [
|
|
153
|
+
__: [4]
|
|
177
154
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
178
155
|
]),
|
|
179
156
|
_: 2
|
|
180
157
|
}, 1024),
|
|
181
|
-
|
|
182
|
-
default:
|
|
183
|
-
|
|
158
|
+
n(i(f), null, {
|
|
159
|
+
default: l(() => [
|
|
160
|
+
n(x, V({ ref_for: !0 }, y, {
|
|
184
161
|
modelValue: e.value,
|
|
185
162
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
186
163
|
type: "password",
|
|
187
|
-
"onUpdate:modelValue": (
|
|
164
|
+
"onUpdate:modelValue": (r) => k(e.uid, "value", r)
|
|
188
165
|
}), {
|
|
189
|
-
default:
|
|
190
|
-
|
|
166
|
+
default: l(() => o[5] || (o[5] = [
|
|
167
|
+
w(" Value ")
|
|
191
168
|
])),
|
|
192
169
|
_: 2,
|
|
193
|
-
__: [
|
|
170
|
+
__: [5]
|
|
194
171
|
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
195
172
|
]),
|
|
196
173
|
_: 2
|
|
197
174
|
}, 1024)
|
|
198
|
-
], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (
|
|
199
|
-
|
|
200
|
-
default:
|
|
201
|
-
Object.keys(e.flows).length > 1 ? (
|
|
202
|
-
|
|
203
|
-
(
|
|
204
|
-
key:
|
|
205
|
-
class:
|
|
206
|
-
"!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (
|
|
207
|
-
"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (
|
|
175
|
+
], 64)) : (e == null ? void 0 : e.type) === "oauth2" ? (a(), u(p, { key: 4 }, [
|
|
176
|
+
n(i(f), null, {
|
|
177
|
+
default: l(() => [
|
|
178
|
+
Object.keys(e.flows).length > 1 ? (a(), u("div", H, [
|
|
179
|
+
C("div", W, [
|
|
180
|
+
(a(!0), u(p, null, U(e == null ? void 0 : e.flows, (r, s, g) => (a(), u("button", {
|
|
181
|
+
key: s,
|
|
182
|
+
class: T(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-base font-medium", {
|
|
183
|
+
"!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (d.value === s || g === 0 && !d.value),
|
|
184
|
+
"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (d.value === s || g === 0 && !d.value)
|
|
208
185
|
}]),
|
|
209
186
|
type: "button",
|
|
210
|
-
onClick: (
|
|
187
|
+
onClick: (K) => d.value = s
|
|
211
188
|
}, [
|
|
212
|
-
|
|
189
|
+
C("span", J, A(s), 1)
|
|
213
190
|
], 10, G))), 128))
|
|
214
191
|
])
|
|
215
192
|
])) : v("", !0)
|
|
216
193
|
]),
|
|
217
194
|
_: 2
|
|
218
195
|
}, 1024),
|
|
219
|
-
(
|
|
220
|
-
|
|
196
|
+
(a(!0), u(p, null, U(e == null ? void 0 : e.flows, (r, s, g) => (a(), u(p, { key: s }, [
|
|
197
|
+
d.value === s || g === 0 && !d.value ? (a(), m(E, V({
|
|
221
198
|
key: 0,
|
|
222
199
|
ref_for: !0
|
|
223
|
-
},
|
|
200
|
+
}, y, {
|
|
224
201
|
collection: t.collection,
|
|
225
|
-
flow:
|
|
202
|
+
flow: r,
|
|
226
203
|
persistAuth: t.persistAuth,
|
|
227
204
|
scheme: e,
|
|
228
205
|
server: t.server,
|
|
229
|
-
workspace: t.workspace
|
|
230
|
-
|
|
206
|
+
workspace: t.workspace,
|
|
207
|
+
onAuthorized: o[0] || (o[0] = (K) => F("authorized"))
|
|
208
|
+
}), {
|
|
209
|
+
"oauth-actions": l(() => [
|
|
210
|
+
M(t.$slots, "oauth-actions")
|
|
211
|
+
]),
|
|
212
|
+
_: 2
|
|
213
|
+
}, 1040, ["collection", "flow", "persistAuth", "scheme", "server", "workspace"])) : v("", !0)
|
|
231
214
|
], 64))), 128))
|
|
232
|
-
], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (
|
|
215
|
+
], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (a(), u("div", {
|
|
233
216
|
key: 5,
|
|
234
|
-
class:
|
|
217
|
+
class: T(["text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-t border-b-0 px-4 text-base", { "rounded-b-lg": t.layout === "reference" }])
|
|
235
218
|
}, " Coming soon ", 2)) : v("", !0)
|
|
236
219
|
], 64))), 128));
|
|
237
220
|
}
|
|
238
221
|
});
|
|
239
222
|
export {
|
|
240
|
-
|
|
223
|
+
le as default
|
|
241
224
|
};
|
package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkspaceStore } from '../../../../../store/store.js';
|
|
2
|
+
/**
|
|
3
|
+
* Manually restore the auth from local storage
|
|
4
|
+
*
|
|
5
|
+
* Only use this if you need to restore auth manually, in the client web + app we load the whole store from
|
|
6
|
+
* local storage so it isn't needed there.
|
|
7
|
+
*/
|
|
8
|
+
export declare const restoreAuthFromLocalStorage: (store: WorkspaceStore, collectionUid: string) => void;
|
|
9
|
+
//# sourceMappingURL=restore-auth-from-local-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-auth-from-local-storage.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GAAI,OAAO,cAAc,EAAE,eAAe,MAAM,SAgDvF,CAAA"}
|
package/dist/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isDefined as i } from "@scalar/helpers/array/is-defined";
|
|
2
|
+
import { safeLocalStorage as n, CLIENT_LS_KEYS as S } from "@scalar/helpers/object/local-storage";
|
|
3
|
+
const O = (a, d) => {
|
|
4
|
+
try {
|
|
5
|
+
const { collectionMutators: c, securitySchemes: o, securitySchemeMutators: m } = a, u = JSON.parse(n().getItem(S.AUTH) ?? "{}"), s = Object.keys(o).reduce(
|
|
6
|
+
(e, r) => {
|
|
7
|
+
const t = o[r];
|
|
8
|
+
return t && (e[t.nameKey] = t.uid), e;
|
|
9
|
+
},
|
|
10
|
+
{}
|
|
11
|
+
);
|
|
12
|
+
Object.entries(u).forEach(([e, r]) => {
|
|
13
|
+
const t = s[e];
|
|
14
|
+
t && Object.entries(r).forEach(([h, l]) => {
|
|
15
|
+
m.edit(t, h, l);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
const f = JSON.parse(
|
|
19
|
+
n().getItem(S.SELECTED_SECURITY_SCHEMES) ?? "[]"
|
|
20
|
+
).map((e) => Array.isArray(e) ? e.map((r) => s[r]).filter(i) : s[e]).filter(i);
|
|
21
|
+
c.edit(d, "selectedSecuritySchemeUids", f);
|
|
22
|
+
} catch (c) {
|
|
23
|
+
console.error(c);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
O as restoreAuthFromLocalStorage
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-auth-from-local-storage.test.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** biome-ignore-all lint/performance/noBarrelFile: these are exported publicly */
|
|
2
|
+
export { restoreAuthFromLocalStorage } from './helpers/restore-auth-from-local-storage.js';
|
|
2
3
|
export { default as RequestAuth } from './RequestAuth.vue.js';
|
|
4
|
+
export { default as RequestAuthDataTable } from './RequestAuthDataTable.vue.js';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAA;AACvF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { default as
|
|
1
|
+
import { restoreAuthFromLocalStorage as o } from "./helpers/restore-auth-from-local-storage.js";
|
|
2
|
+
import { default as a } from "./RequestAuth.vue.js";
|
|
3
|
+
import { default as f } from "./RequestAuthDataTable.vue.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
a as RequestAuth,
|
|
6
|
+
f as RequestAuthDataTable,
|
|
7
|
+
o as restoreAuthFromLocalStorage
|
|
6
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAqWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAUrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAQ1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAyiBF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSection.vue2.js";
|
|
2
2
|
import "./RequestSection.vue3.js";
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fbbc9b8b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|