@scalar/api-client 2.5.16 → 2.5.18
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 +35 -0
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +9 -8
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +15 -13
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +10 -9
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +28 -26
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +9 -8
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +9 -7
- package/dist/components/ImportCollection/ImportNowButton.vue.js +6 -4
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +4 -2
- package/dist/components/Server/ServerSelector.vue.js +2 -1
- package/dist/components/SideNav/SideHelp.vue.js +16 -10
- package/dist/components/SideNav/SideNav.vue.js +2 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +2 -1
- package/dist/components/TopNav/TopNav.vue.js +9 -7
- package/dist/components/TopNav/TopNavItem.vue2.js +8 -4
- package/dist/layouts/App/create-api-client-app.d.ts +42 -2
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +84 -4
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +42 -2
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +42 -2
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +42 -2
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/store.d.ts +42 -2
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue2.js +8 -7
- package/dist/views/Collection/CollectionServers.vue2.js +2 -1
- package/dist/views/Collection/CollectionSettings.vue2.js +2 -1
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +4 -2
- package/dist/views/Collection/components/MarkdownInput.vue2.js +4 -2
- package/dist/views/Environment/Environment.vue2.js +2 -1
- package/dist/views/Environment/EnvironmentModal.vue.js +10 -9
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +2 -1
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +5 -4
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +22 -11
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +9 -8
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +34 -29
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +4 -2
- package/dist/views/Request/RequestSection/RequestParams.vue.js +2 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +12 -10
- package/dist/views/Request/RequestSidebar.vue2.js +2 -1
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +2 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +6 -3
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +4 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +2 -1
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +2 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +4 -2
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +5 -4
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +13 -10
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +46 -44
- package/dist/views/Settings/SettingsGeneral.vue.js +19 -17
- package/dist/views/Settings/components/SettingsAppearance.vue.js +8 -5
- package/package.json +16 -16
|
@@ -13,7 +13,7 @@ import { useWorkspace as re } from "../../store/store.js";
|
|
|
13
13
|
const ie = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, ce = { class: "flex flex-col gap-4" }, de = { class: "rounded-lg border" }, ue = { class: "bg-b-2 flex cursor-grab items-center justify-between rounded-t-lg px-1 py-1 text-sm" }, ve = { class: "flex items-center" }, me = ["onClick"], fe = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, Me = /* @__PURE__ */ J({
|
|
14
14
|
__name: "CollectionEnvironment",
|
|
15
15
|
setup(pe) {
|
|
16
|
-
const { activeCollection: l, activeWorkspace: $, activeEnvVariables: D } = ae(), { collectionMutators: m } = re(), b = k(), h = k(), g = k(),
|
|
16
|
+
const { activeCollection: l, activeWorkspace: $, activeEnvVariables: D } = ae(), { collectionMutators: m } = re(), b = k(), h = k(), g = k(), _ = k(), M = F(""), s = F(null), E = F(void 0), V = L(() => {
|
|
17
17
|
var n;
|
|
18
18
|
return (n = l.value) != null && n["x-scalar-environments"] ? Object.entries(l.value["x-scalar-environments"]).map(
|
|
19
19
|
([e, i]) => ({
|
|
@@ -60,9 +60,9 @@ const ie = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, ce = { c
|
|
|
60
60
|
e
|
|
61
61
|
), b.hide();
|
|
62
62
|
}, B = (n) => {
|
|
63
|
-
s.value = n,
|
|
63
|
+
s.value = n, E.value = n, _.show();
|
|
64
64
|
}, W = () => {
|
|
65
|
-
s.value = null,
|
|
65
|
+
s.value = null, E.value = void 0, _.hide();
|
|
66
66
|
}, R = (n) => {
|
|
67
67
|
var p;
|
|
68
68
|
if (!((p = l.value) != null && p.uid) || !s.value)
|
|
@@ -79,7 +79,7 @@ const ie = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, ce = { c
|
|
|
79
79
|
l.value.uid,
|
|
80
80
|
"x-scalar-environments",
|
|
81
81
|
o
|
|
82
|
-
), s.value = null,
|
|
82
|
+
), s.value = null, E.value = void 0, _.hide();
|
|
83
83
|
}, T = (n, e) => {
|
|
84
84
|
var x;
|
|
85
85
|
if (!((x = l.value) != null && x.uid))
|
|
@@ -182,7 +182,8 @@ const ie = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, ce = { c
|
|
|
182
182
|
}),
|
|
183
183
|
e[4] || (e[4] = r("span", null, "Add Environment", -1))
|
|
184
184
|
]),
|
|
185
|
-
_: 1
|
|
185
|
+
_: 1,
|
|
186
|
+
__: [4]
|
|
186
187
|
})
|
|
187
188
|
])
|
|
188
189
|
]),
|
|
@@ -216,12 +217,12 @@ const ie = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, ce = { c
|
|
|
216
217
|
}, null, 8, ["selectedColor", "state"]),
|
|
217
218
|
c(t(S), {
|
|
218
219
|
size: "xxs",
|
|
219
|
-
state: t(
|
|
220
|
+
state: t(_),
|
|
220
221
|
title: `Edit ${s.value}`
|
|
221
222
|
}, {
|
|
222
223
|
default: u(() => [
|
|
223
224
|
c(te, {
|
|
224
|
-
name:
|
|
225
|
+
name: E.value ?? "",
|
|
225
226
|
onClose: W,
|
|
226
227
|
onEdit: R
|
|
227
228
|
}, null, 8, ["name"])
|
|
@@ -184,13 +184,15 @@ const re = /* @__PURE__ */ $({
|
|
|
184
184
|
default: u(() => n[0] || (n[0] = [
|
|
185
185
|
K("Key")
|
|
186
186
|
])),
|
|
187
|
-
_: 1
|
|
187
|
+
_: 1,
|
|
188
|
+
__: [0]
|
|
188
189
|
}),
|
|
189
190
|
v(z, null, {
|
|
190
191
|
default: u(() => n[1] || (n[1] = [
|
|
191
192
|
K("Value")
|
|
192
193
|
])),
|
|
193
|
-
_: 1
|
|
194
|
+
_: 1,
|
|
195
|
+
__: [1]
|
|
194
196
|
})
|
|
195
197
|
]),
|
|
196
198
|
_: 1
|
|
@@ -45,7 +45,8 @@ const B = { class: "flex h-full w-full flex-col gap-2 pt-8" }, C = { class: "fle
|
|
|
45
45
|
}),
|
|
46
46
|
e[4] || (e[4] = n("span", null, "Edit", -1))
|
|
47
47
|
]),
|
|
48
|
-
_: 1
|
|
48
|
+
_: 1,
|
|
49
|
+
__: [4]
|
|
49
50
|
})) : a("", !0)
|
|
50
51
|
]),
|
|
51
52
|
n("div", I, [
|
|
@@ -75,7 +76,8 @@ const B = { class: "flex h-full w-full flex-col gap-2 pt-8" }, C = { class: "fle
|
|
|
75
76
|
}),
|
|
76
77
|
e[7] || (e[7] = n("span", null, "Write a description", -1))
|
|
77
78
|
]),
|
|
78
|
-
_: 1
|
|
79
|
+
_: 1,
|
|
80
|
+
__: [7]
|
|
79
81
|
})
|
|
80
82
|
]))
|
|
81
83
|
], 64)) : a("", !0),
|
|
@@ -338,7 +338,8 @@ const Be = { class: "flex-1" }, Le = ["onClick"], Ke = { class: "flex h-5 max-w-
|
|
|
338
338
|
}),
|
|
339
339
|
o[2] || (o[2] = b("span", null, "Add Environment", -1))
|
|
340
340
|
]),
|
|
341
|
-
_: 2
|
|
341
|
+
_: 2,
|
|
342
|
+
__: [2]
|
|
342
343
|
}, 1032, ["onClick"])) : H("", !0)
|
|
343
344
|
], 2), [
|
|
344
345
|
[Ee, se(n.uid)]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, ref as m, computed as h, watch as w, createBlock as u, openBlock as v, unref as s, withCtx as a, createVNode as r, createElementVNode as p, createTextVNode as I, normalizeClass as E, toDisplayString as N } from "vue";
|
|
2
2
|
import { ScalarModal as T, ScalarListbox as $, ScalarButton as x, ScalarIcon as z } from "@scalar/components";
|
|
3
3
|
import { useToasts as B } from "@scalar/use-toasts";
|
|
4
4
|
import D from "../../components/CommandPalette/CommandActionForm.vue.js";
|
|
5
5
|
import P from "../../components/CommandPalette/CommandActionInput.vue.js";
|
|
6
6
|
import U from "./EnvironmentColors.vue.js";
|
|
7
7
|
import { useWorkspace as W } from "../../store/store.js";
|
|
8
|
-
const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */
|
|
8
|
+
const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ y({
|
|
9
9
|
__name: "EnvironmentModal",
|
|
10
10
|
props: {
|
|
11
11
|
state: {},
|
|
@@ -27,7 +27,7 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
27
27
|
})
|
|
28
28
|
]), l = m(
|
|
29
29
|
d.value.find((t) => t.id === n.collectionId)
|
|
30
|
-
), { toast: b } = B(),
|
|
30
|
+
), { toast: b } = B(), _ = (t) => {
|
|
31
31
|
c.value = t;
|
|
32
32
|
};
|
|
33
33
|
w(
|
|
@@ -38,7 +38,7 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
38
38
|
) : l.value = void 0);
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
|
-
const
|
|
41
|
+
const V = () => {
|
|
42
42
|
var t, e, o, C;
|
|
43
43
|
if (!i.value.trim()) {
|
|
44
44
|
b("Please enter a name before adding an environment.", "error");
|
|
@@ -54,7 +54,7 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
54
54
|
type: ((e = l.value) == null ? void 0 : e.id) === "global" ? "global" : "collection",
|
|
55
55
|
collectionId: ((o = l.value) == null ? void 0 : o.id) !== "global" ? (C = l.value) == null ? void 0 : C.id : void 0
|
|
56
56
|
});
|
|
57
|
-
},
|
|
57
|
+
}, k = () => {
|
|
58
58
|
n.state.hide(), S.commandPalette.emit({ commandName: "Create Collection" });
|
|
59
59
|
};
|
|
60
60
|
return (t, e) => (v(), u(s(T), {
|
|
@@ -66,7 +66,7 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
66
66
|
r(D, {
|
|
67
67
|
disabled: !l.value || !i.value.trim(),
|
|
68
68
|
onCancel: e[2] || (e[2] = (o) => f("cancel")),
|
|
69
|
-
onSubmit:
|
|
69
|
+
onSubmit: V
|
|
70
70
|
}, {
|
|
71
71
|
options: a(() => [
|
|
72
72
|
r(s($), {
|
|
@@ -96,12 +96,13 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
96
96
|
key: 1,
|
|
97
97
|
class: "hover:bg-b-2 max-h-8 justify-between gap-1 p-2 text-xs",
|
|
98
98
|
variant: "outlined",
|
|
99
|
-
onClick:
|
|
99
|
+
onClick: k
|
|
100
100
|
}, {
|
|
101
101
|
default: a(() => e[3] || (e[3] = [
|
|
102
102
|
p("span", { class: "text-c-1" }, "Create Collection", -1)
|
|
103
103
|
])),
|
|
104
|
-
_: 1
|
|
104
|
+
_: 1,
|
|
105
|
+
__: [3]
|
|
105
106
|
}))
|
|
106
107
|
]),
|
|
107
108
|
_: 1
|
|
@@ -116,7 +117,7 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ _({
|
|
|
116
117
|
activeColor: c.value,
|
|
117
118
|
class: "peer",
|
|
118
119
|
selector: "",
|
|
119
|
-
onSelect:
|
|
120
|
+
onSelect: _
|
|
120
121
|
}, null, 8, ["activeColor"]),
|
|
121
122
|
r(P, {
|
|
122
123
|
modelValue: i.value,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as b, createBlock as
|
|
2
|
-
import { ScalarModal as
|
|
1
|
+
import { defineComponent as b, createBlock as _, openBlock as y, unref as s, withCtx as n, createElementVNode as r, toDisplayString as i, createVNode as m, createTextVNode as u } from "vue";
|
|
2
|
+
import { ScalarModal as S, ScalarButton as d } from "@scalar/components";
|
|
3
3
|
import { useWorkspace as g } from "../../../../store/store.js";
|
|
4
4
|
const k = { class: "text-c-2 mb-4 text-sm leading-normal" }, C = { class: "flex justify-between gap-2" }, B = /* @__PURE__ */ b({
|
|
5
5
|
__name: "DeleteRequestAuthModal",
|
|
@@ -13,7 +13,7 @@ const k = { class: "text-c-2 mb-4 text-sm leading-normal" }, C = { class: "flex
|
|
|
13
13
|
var e;
|
|
14
14
|
(e = l.scheme) != null && e.id && h.delete(l.scheme.id), c("delete");
|
|
15
15
|
};
|
|
16
|
-
return (e, t) => (
|
|
16
|
+
return (e, t) => (y(), _(s(S), {
|
|
17
17
|
size: "xxs",
|
|
18
18
|
state: e.state,
|
|
19
19
|
title: "Delete Security Scheme"
|
|
@@ -32,7 +32,8 @@ const k = { class: "text-c-2 mb-4 text-sm leading-normal" }, C = { class: "flex
|
|
|
32
32
|
default: n(() => t[1] || (t[1] = [
|
|
33
33
|
u(" Cancel ")
|
|
34
34
|
])),
|
|
35
|
-
_: 1
|
|
35
|
+
_: 1,
|
|
36
|
+
__: [1]
|
|
36
37
|
}),
|
|
37
38
|
m(s(d), {
|
|
38
39
|
class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
|
|
@@ -55,7 +55,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
55
55
|
default: o(() => e[10] || (e[10] = [
|
|
56
56
|
u(" Access Token ")
|
|
57
57
|
])),
|
|
58
|
-
_: 1
|
|
58
|
+
_: 1,
|
|
59
|
+
__: [10]
|
|
59
60
|
}, 16, ["modelValue"])
|
|
60
61
|
]),
|
|
61
62
|
_: 1
|
|
@@ -73,7 +74,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
73
74
|
default: o(() => e[11] || (e[11] = [
|
|
74
75
|
u(" Clear ")
|
|
75
76
|
])),
|
|
76
|
-
_: 1
|
|
77
|
+
_: 1,
|
|
78
|
+
__: [11]
|
|
77
79
|
}, 8, ["loading"])
|
|
78
80
|
])
|
|
79
81
|
]),
|
|
@@ -91,7 +93,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
91
93
|
default: o(() => e[12] || (e[12] = [
|
|
92
94
|
u(" Auth URL ")
|
|
93
95
|
])),
|
|
94
|
-
_: 1
|
|
96
|
+
_: 1,
|
|
97
|
+
__: [12]
|
|
95
98
|
}, 16, ["modelValue"])) : w("", !0),
|
|
96
99
|
"tokenUrl" in l.flow ? (d(), k(p, m({ key: 1 }, i, {
|
|
97
100
|
modelValue: l.flow.tokenUrl,
|
|
@@ -101,7 +104,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
101
104
|
default: o(() => e[13] || (e[13] = [
|
|
102
105
|
u(" Token URL ")
|
|
103
106
|
])),
|
|
104
|
-
_: 1
|
|
107
|
+
_: 1,
|
|
108
|
+
__: [13]
|
|
105
109
|
}, 16, ["modelValue"])) : w("", !0)
|
|
106
110
|
]),
|
|
107
111
|
_: 1
|
|
@@ -116,7 +120,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
116
120
|
default: o(() => e[14] || (e[14] = [
|
|
117
121
|
u(" Redirect URL ")
|
|
118
122
|
])),
|
|
119
|
-
_: 1
|
|
123
|
+
_: 1,
|
|
124
|
+
__: [14]
|
|
120
125
|
}, 16, ["modelValue"])
|
|
121
126
|
]),
|
|
122
127
|
_: 1
|
|
@@ -133,7 +138,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
133
138
|
default: o(() => e[15] || (e[15] = [
|
|
134
139
|
u(" Username ")
|
|
135
140
|
])),
|
|
136
|
-
_: 1
|
|
141
|
+
_: 1,
|
|
142
|
+
__: [15]
|
|
137
143
|
}, 16, ["modelValue"])
|
|
138
144
|
]),
|
|
139
145
|
_: 1
|
|
@@ -149,7 +155,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
149
155
|
default: o(() => e[16] || (e[16] = [
|
|
150
156
|
u(" Password ")
|
|
151
157
|
])),
|
|
152
|
-
_: 1
|
|
158
|
+
_: 1,
|
|
159
|
+
__: [16]
|
|
153
160
|
}, 16, ["modelValue"])
|
|
154
161
|
]),
|
|
155
162
|
_: 1
|
|
@@ -165,7 +172,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
165
172
|
default: o(() => e[17] || (e[17] = [
|
|
166
173
|
u(" Client ID ")
|
|
167
174
|
])),
|
|
168
|
-
_: 1
|
|
175
|
+
_: 1,
|
|
176
|
+
__: [17]
|
|
169
177
|
}, 16, ["modelValue"])
|
|
170
178
|
]),
|
|
171
179
|
_: 1
|
|
@@ -181,7 +189,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
181
189
|
default: o(() => e[18] || (e[18] = [
|
|
182
190
|
u(" Client Secret ")
|
|
183
191
|
])),
|
|
184
|
-
_: 1
|
|
192
|
+
_: 1,
|
|
193
|
+
__: [18]
|
|
185
194
|
}, 16, ["modelValue"])
|
|
186
195
|
]),
|
|
187
196
|
_: 1
|
|
@@ -200,7 +209,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
200
209
|
default: o(() => e[19] || (e[19] = [
|
|
201
210
|
u(" Use PKCE ")
|
|
202
211
|
])),
|
|
203
|
-
_: 1
|
|
212
|
+
_: 1,
|
|
213
|
+
__: [19]
|
|
204
214
|
}, 16, ["enum", "modelValue"])
|
|
205
215
|
]),
|
|
206
216
|
_: 1
|
|
@@ -231,7 +241,8 @@ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { c
|
|
|
231
241
|
default: o(() => e[20] || (e[20] = [
|
|
232
242
|
u(" Authorize ")
|
|
233
243
|
])),
|
|
234
|
-
_: 1
|
|
244
|
+
_: 1,
|
|
245
|
+
__: [20]
|
|
235
246
|
}, 8, ["loading"])
|
|
236
247
|
])
|
|
237
248
|
]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Disclosure as
|
|
1
|
+
import { defineComponent as _, computed as y, createBlock as h, openBlock as u, unref as o, withCtx as c, createElementVNode as a, createVNode as i, normalizeClass as j, toDisplayString as m, createCommentVNode as k, withModifiers as N, createTextVNode as C, createElementBlock as V, Fragment as z, renderList as A } from "vue";
|
|
2
|
+
import { Disclosure as T, DisclosureButton as E, DisclosurePanel as F } from "@headlessui/vue";
|
|
3
3
|
import { ScalarButton as I, ScalarIcon as R } from "@scalar/components";
|
|
4
4
|
import D from "../../../../components/DataTable/DataTableCell.vue.js";
|
|
5
5
|
import L from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
@@ -7,7 +7,7 @@ import M from "../../../../components/DataTable/DataTableCheckbox.vue.js";
|
|
|
7
7
|
const P = { class: "flex h-fit w-full" }, U = { class: "flex-1" }, q = { class: "flex items-center gap-1.75" }, G = {
|
|
8
8
|
class: "grid auto-rows-auto",
|
|
9
9
|
style: { gridTemplateColumns: "1fr auto" }
|
|
10
|
-
}, H = { key: 0 }, J = { class: "font-code text-xs" }, ee = /* @__PURE__ */
|
|
10
|
+
}, H = { key: 0 }, J = { class: "font-code text-xs" }, ee = /* @__PURE__ */ _({
|
|
11
11
|
__name: "OAuthScopesInput",
|
|
12
12
|
props: {
|
|
13
13
|
flow: {},
|
|
@@ -47,7 +47,7 @@ const P = { class: "flex h-fit w-full" }, U = { class: "flex-1" }, q = { class:
|
|
|
47
47
|
default: c(() => [
|
|
48
48
|
a("div", P, [
|
|
49
49
|
l[1] || (l[1] = a("div", { class: "text-c-1 h-full items-center" }, null, -1)),
|
|
50
|
-
i(o(
|
|
50
|
+
i(o(T), {
|
|
51
51
|
as: "div",
|
|
52
52
|
class: "bl flex w-full flex-col"
|
|
53
53
|
}, {
|
|
@@ -55,7 +55,7 @@ const P = { class: "flex h-fit w-full" }, U = { class: "flex-1" }, q = { class:
|
|
|
55
55
|
var n, w;
|
|
56
56
|
return [
|
|
57
57
|
i(o(E), {
|
|
58
|
-
class:
|
|
58
|
+
class: j([
|
|
59
59
|
"group/scopes-accordion hover:text-c-1 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pr-2.25 pl-3 text-left",
|
|
60
60
|
(((w = (n = e.flow) == null ? void 0 : n.selectedScopes) == null ? void 0 : w.length) || 0) > 0 ? "text-c-1" : "text-c-3"
|
|
61
61
|
])
|
|
@@ -69,12 +69,13 @@ const P = { class: "flex h-fit w-full" }, U = { class: "flex-1" }, q = { class:
|
|
|
69
69
|
key: 0,
|
|
70
70
|
class: "text-c-3 hover:bg-b-2 hover:text-c-1 rounded px-1.5",
|
|
71
71
|
size: "sm",
|
|
72
|
-
onClick:
|
|
72
|
+
onClick: N(O, ["stop"])
|
|
73
73
|
}, {
|
|
74
74
|
default: c(() => l[0] || (l[0] = [
|
|
75
75
|
C(" Select All ")
|
|
76
76
|
])),
|
|
77
|
-
_: 1
|
|
77
|
+
_: 1,
|
|
78
|
+
__: [0]
|
|
78
79
|
})) : k("", !0),
|
|
79
80
|
i(o(R), {
|
|
80
81
|
class: "text-c-3 group-hover/scopes-accordion:text-c-2",
|
|
@@ -89,7 +90,7 @@ const P = { class: "flex h-fit w-full" }, U = { class: "flex-1" }, q = { class:
|
|
|
89
90
|
i(o(F), { as: "template" }, {
|
|
90
91
|
default: c(() => [
|
|
91
92
|
a("table", G, [
|
|
92
|
-
(u(!0), V(
|
|
93
|
+
(u(!0), V(z, null, A($.value, ({ id: s, label: f, description: r }) => (u(), h(o(L), {
|
|
93
94
|
key: s,
|
|
94
95
|
class: "text-c-2",
|
|
95
96
|
onClick: (p) => B(s, !d.value.includes(s))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, computed as P, ref as R, onMounted as q, createElementBlock as i, openBlock as l, Fragment as p, renderList as
|
|
1
|
+
import { defineComponent as F, computed as P, ref as R, onMounted as q, createElementBlock as i, openBlock as l, Fragment as p, renderList as $, createBlock as S, createCommentVNode as v, unref as d, normalizeClass as _, withCtx as n, createVNode as u, createTextVNode as V, toDisplayString as E, mergeProps as k, createElementVNode as A, capitalize as g } from "vue";
|
|
2
2
|
import { ScalarMarkdown as z } from "@scalar/components";
|
|
3
3
|
import { safeLocalStorage as I, CLIENT_LS_KEYS as N } from "@scalar/helpers/object/local-storage";
|
|
4
4
|
import { isDefined as j } from "@scalar/oas-utils/helpers";
|
|
@@ -24,38 +24,38 @@ const J = {
|
|
|
24
24
|
workspace: {}
|
|
25
25
|
},
|
|
26
26
|
setup(c) {
|
|
27
|
-
const
|
|
27
|
+
const C = D(), { collectionMutators: L, securitySchemes: U, securitySchemeMutators: M } = C, x = P(
|
|
28
28
|
() => c.securitySchemeUids.map((t) => ({
|
|
29
|
-
scheme:
|
|
29
|
+
scheme: U[t]
|
|
30
30
|
}))
|
|
31
31
|
), s = R(""), O = (t) => {
|
|
32
|
-
const r = t.description ? `: ${t.description}` : "", e = `${
|
|
32
|
+
const r = t.description ? `: ${t.description}` : "", e = `${g(t.nameKey)}${r || `: ${t.type}`}`;
|
|
33
33
|
if (t.type === "apiKey")
|
|
34
|
-
return `${
|
|
34
|
+
return `${g(t.nameKey)}${r || `: ${t.in}`}`;
|
|
35
35
|
if (t.type === "oauth2") {
|
|
36
36
|
const o = Object.values(t.flows ?? {})[0];
|
|
37
|
-
return `${
|
|
37
|
+
return `${g(t.nameKey)}: ${s.value ? s.value : (o == null ? void 0 : o.type) ?? ""}${r}`;
|
|
38
38
|
}
|
|
39
|
-
return t.type === "http" ? `${
|
|
39
|
+
return t.type === "http" ? `${g(t.nameKey)}: ${t.scheme}${r}` : `${e}${r}`;
|
|
40
40
|
}, m = (t, r, e) => {
|
|
41
|
-
H(t, r, e,
|
|
41
|
+
H(t, r, e, C, c.persistAuth);
|
|
42
42
|
};
|
|
43
43
|
q(() => {
|
|
44
44
|
if (!c.persistAuth)
|
|
45
45
|
return;
|
|
46
46
|
const t = JSON.parse(
|
|
47
47
|
I().getItem(N.AUTH) ?? "{}"
|
|
48
|
-
), r = Object.keys(
|
|
48
|
+
), r = Object.keys(U).reduce(
|
|
49
49
|
(e, o) => {
|
|
50
|
-
const a =
|
|
50
|
+
const a = U[o];
|
|
51
51
|
return a && (e[a.nameKey] = a.uid), e;
|
|
52
52
|
},
|
|
53
53
|
{}
|
|
54
54
|
);
|
|
55
55
|
Object.entries(t).forEach(([e, o]) => {
|
|
56
56
|
const a = r[e];
|
|
57
|
-
a && Object.entries(o).forEach(([
|
|
58
|
-
M.edit(a,
|
|
57
|
+
a && Object.entries(o).forEach(([T, K]) => {
|
|
58
|
+
M.edit(a, T, K);
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
try {
|
|
@@ -71,28 +71,28 @@ const J = {
|
|
|
71
71
|
envVariables: c.envVariables,
|
|
72
72
|
workspace: c.workspace
|
|
73
73
|
};
|
|
74
|
-
return (t, r) => (l(!0), i(p, null,
|
|
74
|
+
return (t, r) => (l(!0), i(p, null, $(x.value, ({ scheme: e }) => (l(), i(p, {
|
|
75
75
|
key: e == null ? void 0 : e.uid
|
|
76
76
|
}, [
|
|
77
|
-
|
|
77
|
+
x.value.length > 1 ? (l(), S(d(f), {
|
|
78
78
|
key: 0,
|
|
79
|
-
class:
|
|
79
|
+
class: _({
|
|
80
80
|
"request-example-references-header": t.layout === "reference"
|
|
81
81
|
})
|
|
82
82
|
}, {
|
|
83
83
|
default: n(() => [
|
|
84
84
|
u(d(B), {
|
|
85
|
-
class:
|
|
85
|
+
class: _(["text-c-2 flex items-center pl-3", t.layout === "reference" && "border-b"])
|
|
86
86
|
}, {
|
|
87
87
|
default: n(() => [
|
|
88
|
-
V(
|
|
88
|
+
V(E(O(e)), 1)
|
|
89
89
|
]),
|
|
90
90
|
_: 2
|
|
91
91
|
}, 1032, ["class"])
|
|
92
92
|
]),
|
|
93
93
|
_: 2
|
|
94
94
|
}, 1032, ["class"])) : v("", !0),
|
|
95
|
-
e != null && e.description &&
|
|
95
|
+
e != null && e.description && x.value.length <= 1 ? (l(), S(d(f), { key: 1 }, {
|
|
96
96
|
default: n(() => [
|
|
97
97
|
u(d(B), {
|
|
98
98
|
"aria-label": e.description,
|
|
@@ -122,7 +122,8 @@ const J = {
|
|
|
122
122
|
default: n(() => r[0] || (r[0] = [
|
|
123
123
|
V(" Bearer Token ")
|
|
124
124
|
])),
|
|
125
|
-
_: 2
|
|
125
|
+
_: 2,
|
|
126
|
+
__: [0]
|
|
126
127
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
127
128
|
]),
|
|
128
129
|
_: 2
|
|
@@ -140,7 +141,8 @@ const J = {
|
|
|
140
141
|
default: n(() => r[1] || (r[1] = [
|
|
141
142
|
V(" Username ")
|
|
142
143
|
])),
|
|
143
|
-
_: 2
|
|
144
|
+
_: 2,
|
|
145
|
+
__: [1]
|
|
144
146
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
145
147
|
]),
|
|
146
148
|
_: 2
|
|
@@ -156,7 +158,8 @@ const J = {
|
|
|
156
158
|
default: n(() => r[2] || (r[2] = [
|
|
157
159
|
V(" Password ")
|
|
158
160
|
])),
|
|
159
|
-
_: 2
|
|
161
|
+
_: 2,
|
|
162
|
+
__: [2]
|
|
160
163
|
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
161
164
|
]),
|
|
162
165
|
_: 2
|
|
@@ -174,7 +177,8 @@ const J = {
|
|
|
174
177
|
default: n(() => r[3] || (r[3] = [
|
|
175
178
|
V(" Name ")
|
|
176
179
|
])),
|
|
177
|
-
_: 2
|
|
180
|
+
_: 2,
|
|
181
|
+
__: [3]
|
|
178
182
|
}, 1040, ["containerClass", "modelValue", "onUpdate:modelValue"])
|
|
179
183
|
]),
|
|
180
184
|
_: 2
|
|
@@ -190,7 +194,8 @@ const J = {
|
|
|
190
194
|
default: n(() => r[4] || (r[4] = [
|
|
191
195
|
V(" Value ")
|
|
192
196
|
])),
|
|
193
|
-
_: 2
|
|
197
|
+
_: 2,
|
|
198
|
+
__: [4]
|
|
194
199
|
}, 1040, ["modelValue", "onUpdate:modelValue"])
|
|
195
200
|
]),
|
|
196
201
|
_: 2
|
|
@@ -200,23 +205,23 @@ const J = {
|
|
|
200
205
|
default: n(() => [
|
|
201
206
|
Object.keys(e.flows).length > 1 ? (l(), i("div", J, [
|
|
202
207
|
A("div", Y, [
|
|
203
|
-
(l(!0), i(p, null,
|
|
208
|
+
(l(!0), i(p, null, $(e == null ? void 0 : e.flows, (o, a, y) => (l(), i("button", {
|
|
204
209
|
key: a,
|
|
205
|
-
class:
|
|
210
|
+
class: _(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-base font-medium", {
|
|
206
211
|
"!text-c-1 !rounded-none border-b-[1px] !border-current": t.layout !== "reference" && (s.value === a || y === 0 && !s.value),
|
|
207
212
|
"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": t.layout === "reference" && (s.value === a || y === 0 && !s.value)
|
|
208
213
|
}]),
|
|
209
214
|
type: "button",
|
|
210
|
-
onClick: (
|
|
215
|
+
onClick: (T) => s.value = a
|
|
211
216
|
}, [
|
|
212
|
-
A("span", G,
|
|
217
|
+
A("span", G, E(a), 1)
|
|
213
218
|
], 10, W))), 128))
|
|
214
219
|
])
|
|
215
220
|
])) : v("", !0)
|
|
216
221
|
]),
|
|
217
222
|
_: 2
|
|
218
223
|
}, 1024),
|
|
219
|
-
(l(!0), i(p, null,
|
|
224
|
+
(l(!0), i(p, null, $(e == null ? void 0 : e.flows, (o, a, y) => (l(), i(p, { key: a }, [
|
|
220
225
|
s.value === a || y === 0 && !s.value ? (l(), S(Q, k({
|
|
221
226
|
key: 0,
|
|
222
227
|
ref_for: !0
|
|
@@ -231,7 +236,7 @@ const J = {
|
|
|
231
236
|
], 64))), 128))
|
|
232
237
|
], 64)) : (e == null ? void 0 : e.type) === "openIdConnect" ? (l(), i("div", {
|
|
233
238
|
key: 5,
|
|
234
|
-
class:
|
|
239
|
+
class: _(["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
240
|
}, " Coming soon ", 2)) : v("", !0)
|
|
236
241
|
], 64))), 128));
|
|
237
242
|
}
|
|
@@ -367,7 +367,8 @@ const me = {
|
|
|
367
367
|
default: m(() => n[3] || (n[3] = [
|
|
368
368
|
H(" Delete ")
|
|
369
369
|
])),
|
|
370
|
-
_: 1
|
|
370
|
+
_: 1,
|
|
371
|
+
__: [3]
|
|
371
372
|
})
|
|
372
373
|
], 64)) : (b(), g(y(F), {
|
|
373
374
|
key: 1,
|
|
@@ -385,7 +386,8 @@ const me = {
|
|
|
385
386
|
thickness: "2.5"
|
|
386
387
|
})
|
|
387
388
|
]),
|
|
388
|
-
_: 1
|
|
389
|
+
_: 1,
|
|
390
|
+
__: [4]
|
|
389
391
|
}))
|
|
390
392
|
])) : ((o = p.value) == null ? void 0 : o.id) == "multipartForm" ? (b(), g(G, {
|
|
391
393
|
key: 2,
|