@scalar/api-client 2.1.33 → 2.1.35
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 +36 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.js +1 -1
- package/dist/components/ContextBar.vue2.js +6 -6
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +53 -40
- package/dist/components/ScalarHotkey.vue.d.ts +5 -6
- package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey.vue.js +9 -18
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +2 -2
- package/dist/components/SideNav/SideNav.vue2.js +8 -8
- package/dist/components/Sidebar/SidebarButton.vue.d.ts +4 -0
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +19 -17
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +14 -14
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +35 -29
- package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -1
- package/dist/layouts/App/MainLayout.vue.js +4 -4
- package/dist/layouts/App/create-api-client-app.d.ts +257 -45
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.js +10 -10
- package/dist/layouts/App/hotkeys.js +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +514 -90
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +24 -22
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +33 -27
- package/dist/layouts/Web/create-api-client-web.d.ts +258 -46
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.js +9 -9
- package/dist/libs/create-client.d.ts +280 -50
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +25 -24
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/local-storage.d.ts +2 -2
- package/dist/libs/local-storage.d.ts.map +1 -1
- package/dist/libs/send-request.d.ts +2 -1
- package/dist/libs/send-request.d.ts.map +1 -1
- package/dist/libs/send-request.js +98 -97
- package/dist/router.d.ts +5 -5
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +32 -32
- package/dist/store/collections.d.ts +14 -4
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/events.d.ts +1 -1
- package/dist/store/import-spec.d.ts +16 -31
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +43 -56
- package/dist/store/requests.d.ts +14 -14
- package/dist/store/store.d.ts +514 -90
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +43 -43
- package/dist/store/workspace.d.ts +10 -10
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts +5 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +64 -55
- package/dist/views/Environment/Environment.vue.d.ts +5 -1
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +75 -66
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +96 -90
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +21 -21
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +79 -71
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +2 -0
- 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 +105 -112
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +5 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +38 -35
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +5 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -118
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +126 -0
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +4 -4
- package/dist/views/Request/RequestSidebar.vue2.js +43 -42
- 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 +27 -26
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +5 -99
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +104 -2
- package/dist/views/Settings/SettingsGeneral.vue.js +3 -3
- package/dist/views/Settings/SettingsGeneralMode.vue.js +3 -3
- package/package.json +8 -8
- package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -5
|
@@ -1,157 +1,150 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useModal as
|
|
4
|
-
import { nanoid as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { displaySchemeFormatter as $, createSchemeValueSet as
|
|
8
|
-
import { ADD_AUTH_OPTIONS as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useWorkspace as
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as I, ref as w, computed as v, openBlock as u, createBlock as O, withCtx as c, createElementVNode as r, toDisplayString as A, createVNode as i, unref as o, createElementBlock as m, Fragment as W, renderList as z, createTextVNode as E, withModifiers as j } from "vue";
|
|
2
|
+
import H from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useModal as L, ScalarComboboxMultiselect as P, ScalarButton as G, ScalarIcon as D } from "@scalar/components";
|
|
4
|
+
import { nanoid as J } from "nanoid";
|
|
5
|
+
import K from "./DeleteRequestAuthModal.vue.js";
|
|
6
|
+
import Q from "./RequestExampleAuth.vue.js";
|
|
7
|
+
import { displaySchemeFormatter as $, createSchemeValueSet as X } from "../../libs/auth.js";
|
|
8
|
+
import { ADD_AUTH_OPTIONS as Y } from "../../consts/new-auth-options.js";
|
|
9
|
+
import Z from "../../../../components/DataTable/DataTable.vue.js";
|
|
10
|
+
import ee from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
11
|
+
import te from "../../../../components/DataTable/DataTableHeader.vue.js";
|
|
12
|
+
import { useWorkspace as le } from "../../../../store/store.js";
|
|
13
|
+
const se = { class: "flex gap-1" }, oe = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "flex relative scroll-timeline-x w-full"
|
|
16
|
-
},
|
|
16
|
+
}, ie = { class: "flex flex-1 gap-0.25 mr-1.5 items-center" }, ae = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "pl-2"
|
|
19
|
-
},
|
|
19
|
+
}, ye = /* @__PURE__ */ I({
|
|
20
20
|
__name: "RequestAuth",
|
|
21
21
|
props: {
|
|
22
|
+
selectedSecuritySchemeUids: {},
|
|
22
23
|
title: {}
|
|
23
24
|
},
|
|
24
|
-
setup(
|
|
25
|
+
setup(S) {
|
|
25
26
|
const {
|
|
26
|
-
activeCollection:
|
|
27
|
-
activeRequest:
|
|
28
|
-
collectionMutators:
|
|
29
|
-
isReadOnly:
|
|
30
|
-
requestMutators:
|
|
31
|
-
securitySchemes:
|
|
32
|
-
securitySchemeMutators:
|
|
33
|
-
} =
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
);
|
|
38
|
-
return ((S.value && (t != null && t.length) ? t.map((s) => {
|
|
39
|
-
var f;
|
|
40
|
-
const l = Object.keys(s)[0];
|
|
41
|
-
return ((f = Object.values(v).find((B) => B.nameKey === l)) == null ? void 0 : f.uid) ?? "";
|
|
42
|
-
}) : (d = u.value) == null ? void 0 : d.securitySchemes) ?? []).map((s) => v[s]).filter((s) => s);
|
|
43
|
-
}), R = _(
|
|
27
|
+
activeCollection: a,
|
|
28
|
+
activeRequest: d,
|
|
29
|
+
collectionMutators: x,
|
|
30
|
+
isReadOnly: f,
|
|
31
|
+
requestMutators: M,
|
|
32
|
+
securitySchemes: p,
|
|
33
|
+
securitySchemeMutators: V
|
|
34
|
+
} = le(), R = w(null), h = L(), y = w(void 0), _ = `combobox-${J()}`, T = v(() => {
|
|
35
|
+
var e;
|
|
36
|
+
return (((e = a.value) == null ? void 0 : e.securitySchemes) ?? []).map((l) => p[l]).filter((l) => l);
|
|
37
|
+
}), B = v(
|
|
44
38
|
() => {
|
|
45
|
-
const t =
|
|
39
|
+
const t = T.value.map(
|
|
46
40
|
(e) => $(e)
|
|
47
41
|
);
|
|
48
|
-
return
|
|
42
|
+
return f.value ? t : [
|
|
49
43
|
{ label: "Select auth", options: t },
|
|
50
44
|
{
|
|
51
45
|
label: "Add new auth",
|
|
52
|
-
options:
|
|
46
|
+
options: Y
|
|
53
47
|
}
|
|
54
48
|
];
|
|
55
49
|
}
|
|
56
|
-
),
|
|
57
|
-
(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
), b = (t) => {
|
|
51
|
+
!a.value || !d.value || (f.value ? x.edit(
|
|
52
|
+
a.value.uid,
|
|
53
|
+
"selectedSecuritySchemeUids",
|
|
54
|
+
t
|
|
55
|
+
) : M.edit(
|
|
56
|
+
d.value.uid,
|
|
57
|
+
"selectedSecuritySchemeUids",
|
|
58
|
+
t
|
|
59
|
+
));
|
|
60
|
+
}, n = v(
|
|
61
|
+
() => S.selectedSecuritySchemeUids.map(
|
|
62
|
+
(t) => $(p[t])
|
|
63
|
+
)
|
|
63
64
|
);
|
|
64
|
-
function
|
|
65
|
-
var
|
|
66
|
-
if (!((
|
|
67
|
-
const e = t.find((
|
|
65
|
+
function N(t) {
|
|
66
|
+
var C, U;
|
|
67
|
+
if (!((C = a.value) != null && C.uid) || !((U = d.value) != null && U.uid)) return;
|
|
68
|
+
const e = t.find((s) => s.payload), l = t.filter((s) => !s.payload).map(({ id: s }) => s);
|
|
68
69
|
if (e != null && e.payload) {
|
|
69
|
-
const
|
|
70
|
+
const s = V.add(
|
|
70
71
|
e.payload,
|
|
71
|
-
|
|
72
|
+
a.value.uid
|
|
72
73
|
);
|
|
73
|
-
|
|
74
|
+
l.push(s.uid);
|
|
74
75
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
const g = l.filter((s) => !a.value.auth[s]);
|
|
77
|
+
x.edit(
|
|
78
|
+
a.value.uid,
|
|
78
79
|
"auth",
|
|
79
|
-
|
|
80
|
-
), b
|
|
81
|
-
r.value.uid,
|
|
82
|
-
"selectedSecuritySchemeUids",
|
|
83
|
-
o
|
|
84
|
-
);
|
|
80
|
+
g.reduce((s, k) => (s[k] = X(p[k]), s), a.value.auth)
|
|
81
|
+
), b(l);
|
|
85
82
|
}
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
"selectedSecuritySchemeUids",
|
|
89
|
-
r.value.selectedSecuritySchemeUids.filter(
|
|
90
|
-
(e) => e !== t
|
|
91
|
-
)
|
|
83
|
+
const q = (t) => b(
|
|
84
|
+
S.selectedSecuritySchemeUids.filter((e) => e !== t)
|
|
92
85
|
);
|
|
93
|
-
function
|
|
94
|
-
|
|
86
|
+
function F(t) {
|
|
87
|
+
y.value = t, h.show();
|
|
95
88
|
}
|
|
96
|
-
return (t, e) => (
|
|
89
|
+
return (t, e) => (u(), O(H, {
|
|
97
90
|
class: "group/params",
|
|
98
|
-
itemCount:
|
|
91
|
+
itemCount: n.value.length
|
|
99
92
|
}, {
|
|
100
|
-
title:
|
|
101
|
-
|
|
93
|
+
title: c(() => [
|
|
94
|
+
r("div", se, A(t.title), 1)
|
|
102
95
|
]),
|
|
103
|
-
default:
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
default: c(() => [
|
|
97
|
+
r("form", null, [
|
|
98
|
+
i(o(Z), {
|
|
106
99
|
class: "flex-1",
|
|
107
100
|
columns: [""]
|
|
108
101
|
}, {
|
|
109
|
-
default:
|
|
110
|
-
|
|
111
|
-
default:
|
|
112
|
-
|
|
113
|
-
default:
|
|
114
|
-
|
|
102
|
+
default: c(() => [
|
|
103
|
+
i(o(ee), null, {
|
|
104
|
+
default: c(() => [
|
|
105
|
+
i(o(te), { class: "relative col-span-full cursor-pointer py-[0px] px-[0px] flex items-center" }, {
|
|
106
|
+
default: c(() => [
|
|
107
|
+
i(o(P), {
|
|
115
108
|
ref_key: "comboboxRef",
|
|
116
|
-
ref:
|
|
109
|
+
ref: R,
|
|
117
110
|
class: "text-xs w-full",
|
|
118
111
|
fullWidth: "",
|
|
119
|
-
isDeletable:
|
|
120
|
-
modelValue:
|
|
112
|
+
isDeletable: !o(f),
|
|
113
|
+
modelValue: n.value,
|
|
121
114
|
multiple: "",
|
|
122
|
-
options:
|
|
115
|
+
options: B.value,
|
|
123
116
|
style: { "margin-left": "120px" },
|
|
124
|
-
teleport: `#${
|
|
125
|
-
onDelete:
|
|
126
|
-
"onUpdate:modelValue":
|
|
117
|
+
teleport: `#${_}`,
|
|
118
|
+
onDelete: F,
|
|
119
|
+
"onUpdate:modelValue": N
|
|
127
120
|
}, {
|
|
128
|
-
default:
|
|
129
|
-
|
|
121
|
+
default: c(() => [
|
|
122
|
+
i(o(G), {
|
|
130
123
|
class: "h-auto py-0 px-0 text-c-2 hover:text-c-1 font-normal justify-start",
|
|
131
124
|
fullWidth: "",
|
|
132
125
|
variant: "ghost"
|
|
133
126
|
}, {
|
|
134
|
-
default:
|
|
135
|
-
e[3] || (e[3] =
|
|
136
|
-
|
|
137
|
-
e[1] || (e[1] =
|
|
138
|
-
|
|
139
|
-
(
|
|
140
|
-
key:
|
|
141
|
-
class: "cm-pill flex items-center mx-0 h-fit pr-1"
|
|
127
|
+
default: c(() => [
|
|
128
|
+
e[3] || (e[3] = r("div", { class: "text-c-1 h-8 flex min-w-[94px] items-center pr-0 pl-2" }, " Auth Type ", -1)),
|
|
129
|
+
n.value.length ? (u(), m("div", oe, [
|
|
130
|
+
e[1] || (e[1] = r("div", { class: "fade-left" }, null, -1)),
|
|
131
|
+
r("div", ie, [
|
|
132
|
+
(u(!0), m(W, null, z(n.value, (l) => (u(), m("span", {
|
|
133
|
+
key: l.id,
|
|
134
|
+
class: "cm-pill flex items-center mx-0 h-fit pr-1 !bg-b-2 text-c-1"
|
|
142
135
|
}, [
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
E(A(l.label) + " ", 1),
|
|
137
|
+
i(o(D), {
|
|
145
138
|
class: "ml-1 cursor-pointer text-c-3 hover:text-c-1",
|
|
146
139
|
icon: "Close",
|
|
147
140
|
size: "xs",
|
|
148
|
-
onClick:
|
|
141
|
+
onClick: j((g) => q(l.id), ["stop"])
|
|
149
142
|
}, null, 8, ["onClick"])
|
|
150
143
|
]))), 128))
|
|
151
144
|
]),
|
|
152
|
-
e[2] || (e[2] =
|
|
153
|
-
])) : (
|
|
154
|
-
|
|
145
|
+
e[2] || (e[2] = r("div", { class: "fade-right" }, null, -1))
|
|
146
|
+
])) : (u(), m("div", ae, " None ")),
|
|
147
|
+
i(o(D), {
|
|
155
148
|
class: "min-w-3 ml-auto mr-2.5",
|
|
156
149
|
icon: "ChevronDown",
|
|
157
150
|
size: "xs"
|
|
@@ -161,23 +154,23 @@ const le = { class: "flex gap-1" }, oe = {
|
|
|
161
154
|
})
|
|
162
155
|
]),
|
|
163
156
|
_: 1
|
|
164
|
-
}, 8, ["modelValue", "options", "teleport"])
|
|
157
|
+
}, 8, ["isDeletable", "modelValue", "options", "teleport"])
|
|
165
158
|
]),
|
|
166
159
|
_: 1
|
|
167
160
|
})
|
|
168
161
|
]),
|
|
169
162
|
_: 1
|
|
170
163
|
}),
|
|
171
|
-
|
|
164
|
+
i(Q, { selectedSecuritySchemeUids: t.selectedSecuritySchemeUids }, null, 8, ["selectedSecuritySchemeUids"])
|
|
172
165
|
]),
|
|
173
166
|
_: 1
|
|
174
167
|
}),
|
|
175
|
-
|
|
176
|
-
scheme:
|
|
177
|
-
state:
|
|
178
|
-
onClose: e[0] || (e[0] = (
|
|
168
|
+
i(K, {
|
|
169
|
+
scheme: y.value,
|
|
170
|
+
state: o(h),
|
|
171
|
+
onClose: e[0] || (e[0] = (l) => o(h).hide())
|
|
179
172
|
}, null, 8, ["scheme", "state"]),
|
|
180
|
-
|
|
173
|
+
r("div", { id: _ })
|
|
181
174
|
])
|
|
182
175
|
]),
|
|
183
176
|
_: 1
|
|
@@ -185,5 +178,5 @@ const le = { class: "flex gap-1" }, oe = {
|
|
|
185
178
|
}
|
|
186
179
|
});
|
|
187
180
|
export {
|
|
188
|
-
|
|
181
|
+
ye as default
|
|
189
182
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
selectedSecuritySchemeUids: string[];
|
|
3
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
4
|
+
selectedSecuritySchemeUids: string[];
|
|
5
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
6
|
export default _default;
|
|
3
7
|
//# sourceMappingURL=RequestExampleAuth.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestExampleAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RequestExampleAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue"],"names":[],"mappings":";gCA+J8B,MAAM,EAAE;;gCAAR,MAAM,EAAE;;AAmVtC,wBAMG"}
|
|
@@ -1,49 +1,52 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as b, computed as g, openBlock as r, createElementBlock as s, Fragment as f, renderList as x, createVNode as o, unref as i, withCtx as l, createBlock as k, createTextVNode as n, toDisplayString as T, createCommentVNode as c, capitalize as B } from "vue";
|
|
2
|
+
import y from "../RequestAuthDataTableInput.vue.js";
|
|
3
|
+
import E from "./OAuth2.vue.js";
|
|
4
4
|
import p from "../../../../components/DataTable/DataTableRow.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import { isOauth2Example as
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
const A = /* @__PURE__ */
|
|
5
|
+
import F from "../../../../components/DataTable/DataTableCell.vue.js";
|
|
6
|
+
import { isOauth2Example as R } from "../../libs/oauth2.js";
|
|
7
|
+
import { useWorkspace as C } from "../../../../store/store.js";
|
|
8
|
+
const A = /* @__PURE__ */ b({
|
|
9
9
|
__name: "RequestExampleAuth",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
props: {
|
|
11
|
+
selectedSecuritySchemeUids: {}
|
|
12
|
+
},
|
|
13
|
+
setup(_) {
|
|
14
|
+
const { activeCollection: V, activeRequest: $, collectionMutators: v, securitySchemes: w } = C(), U = g(() => !V.value || !$.value ? [] : _.selectedSecuritySchemeUids.map((d) => ({
|
|
15
|
+
example: V.value.auth[d],
|
|
16
|
+
scheme: w[d]
|
|
14
17
|
})));
|
|
15
|
-
function
|
|
16
|
-
return `${B(
|
|
18
|
+
function S(d) {
|
|
19
|
+
return `${B(d.nameKey)}: ${d.type} ${d.type === "oauth2" ? d.flow.type : ""}`;
|
|
17
20
|
}
|
|
18
|
-
function m(
|
|
21
|
+
function m(d, u, e, t) {
|
|
19
22
|
var a;
|
|
20
|
-
(a =
|
|
21
|
-
|
|
22
|
-
`auth.${
|
|
23
|
+
(a = V.value) != null && a.uid && v.edit(
|
|
24
|
+
V.value.uid,
|
|
25
|
+
`auth.${d}.${e}`,
|
|
23
26
|
t
|
|
24
27
|
);
|
|
25
28
|
}
|
|
26
|
-
return (
|
|
29
|
+
return (d, u) => (r(!0), s(f, null, x(U.value, ({ scheme: e, example: t }) => (r(), s(f, {
|
|
27
30
|
key: e.uid
|
|
28
31
|
}, [
|
|
29
|
-
|
|
32
|
+
o(i(p), { class: "group/delete" }, {
|
|
30
33
|
default: l(() => [
|
|
31
|
-
|
|
34
|
+
U.value.length > 1 ? (r(), k(i(F), {
|
|
32
35
|
key: 0,
|
|
33
|
-
class: "text-c-
|
|
36
|
+
class: "text-c-3 pl-2 font-medium flex items-center"
|
|
34
37
|
}, {
|
|
35
38
|
default: l(() => [
|
|
36
|
-
n(T(
|
|
39
|
+
n(T(S(e)), 1)
|
|
37
40
|
]),
|
|
38
41
|
_: 2
|
|
39
|
-
}, 1024)) :
|
|
42
|
+
}, 1024)) : c("", !0)
|
|
40
43
|
]),
|
|
41
44
|
_: 2
|
|
42
45
|
}, 1024),
|
|
43
46
|
e.type === "http" && t.type === "http" ? (r(), s(f, { key: 0 }, [
|
|
44
47
|
e.scheme === "bearer" ? (r(), k(i(p), { key: 0 }, {
|
|
45
48
|
default: l(() => [
|
|
46
|
-
|
|
49
|
+
o(y, {
|
|
47
50
|
id: `http-bearer-token-${e.uid}`,
|
|
48
51
|
modelValue: t.token,
|
|
49
52
|
placeholder: "Token",
|
|
@@ -58,9 +61,9 @@ const A = /* @__PURE__ */ w({
|
|
|
58
61
|
]),
|
|
59
62
|
_: 2
|
|
60
63
|
}, 1024)) : e.scheme === "basic" ? (r(), s(f, { key: 1 }, [
|
|
61
|
-
|
|
64
|
+
o(i(p), null, {
|
|
62
65
|
default: l(() => [
|
|
63
|
-
|
|
66
|
+
o(y, {
|
|
64
67
|
id: `http-basic-username-${e.uid}`,
|
|
65
68
|
class: "text-c-2",
|
|
66
69
|
modelValue: t.username,
|
|
@@ -76,9 +79,9 @@ const A = /* @__PURE__ */ w({
|
|
|
76
79
|
]),
|
|
77
80
|
_: 2
|
|
78
81
|
}, 1024),
|
|
79
|
-
|
|
82
|
+
o(i(p), null, {
|
|
80
83
|
default: l(() => [
|
|
81
|
-
|
|
84
|
+
o(y, {
|
|
82
85
|
id: `http-basic-password-${e.uid}`,
|
|
83
86
|
modelValue: t.password,
|
|
84
87
|
placeholder: "xxxxxx",
|
|
@@ -93,11 +96,11 @@ const A = /* @__PURE__ */ w({
|
|
|
93
96
|
]),
|
|
94
97
|
_: 2
|
|
95
98
|
}, 1024)
|
|
96
|
-
], 64)) :
|
|
99
|
+
], 64)) : c("", !0)
|
|
97
100
|
], 64)) : e.type === "apiKey" && t.type === "apiKey" ? (r(), s(f, { key: 1 }, [
|
|
98
|
-
|
|
101
|
+
o(i(p), null, {
|
|
99
102
|
default: l(() => [
|
|
100
|
-
|
|
103
|
+
o(y, {
|
|
101
104
|
id: `api-key-name-${e.uid}`,
|
|
102
105
|
modelValue: t.name,
|
|
103
106
|
placeholder: "api-key",
|
|
@@ -111,9 +114,9 @@ const A = /* @__PURE__ */ w({
|
|
|
111
114
|
]),
|
|
112
115
|
_: 2
|
|
113
116
|
}, 1024),
|
|
114
|
-
|
|
117
|
+
o(i(p), null, {
|
|
115
118
|
default: l(() => [
|
|
116
|
-
|
|
119
|
+
o(y, {
|
|
117
120
|
id: `api-key-value-add-${e.uid}`,
|
|
118
121
|
modelValue: t.value,
|
|
119
122
|
placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
|
|
@@ -127,11 +130,11 @@ const A = /* @__PURE__ */ w({
|
|
|
127
130
|
]),
|
|
128
131
|
_: 2
|
|
129
132
|
}, 1024)
|
|
130
|
-
], 64)) : e.type === "oauth2" && i(
|
|
133
|
+
], 64)) : e.type === "oauth2" && i(R)(t) ? (r(), k(E, {
|
|
131
134
|
key: 2,
|
|
132
135
|
example: t,
|
|
133
136
|
scheme: e
|
|
134
|
-
}, null, 8, ["example", "scheme"])) :
|
|
137
|
+
}, null, 8, ["example", "scheme"])) : c("", !0)
|
|
135
138
|
], 64))), 128));
|
|
136
139
|
}
|
|
137
140
|
});
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
selectedSecuritySchemeUids: string[];
|
|
3
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
4
|
+
selectedSecuritySchemeUids: string[];
|
|
5
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
6
|
export default _default;
|
|
3
7
|
//# sourceMappingURL=RequestSection.vue.d.ts.map
|
|
@@ -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":";gCA4K8B,MAAM,EAAE;;gCAAR,MAAM,EAAE;;AA4QtC,wBAMG"}
|
|
@@ -1,120 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import v from "./RequestParams.vue.js";
|
|
6
|
-
import K from "./RequestPathParams.vue.js";
|
|
7
|
-
import { canMethodHaveBody as f } from "@scalar/oas-utils/helpers";
|
|
8
|
-
import E from "./RequestAuth/RequestAuth.vue.js";
|
|
9
|
-
import { useWorkspace as Q } from "../../../store/store.js";
|
|
10
|
-
const $ = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none" }, D = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
|
|
13
|
-
for: "requestname"
|
|
14
|
-
}, M = ["value"], P = {
|
|
15
|
-
key: 2,
|
|
16
|
-
class: "text-c-1"
|
|
17
|
-
}, I = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-4 py-2.5" }, X = /* @__PURE__ */ S({
|
|
18
|
-
__name: "RequestSection",
|
|
19
|
-
setup(O) {
|
|
20
|
-
const { activeRequest: a, activeExample: h, isReadOnly: d, requestMutators: k } = Q(), B = _(() => {
|
|
21
|
-
var l, o;
|
|
22
|
-
const t = /* @__PURE__ */ new Set([
|
|
23
|
-
"All",
|
|
24
|
-
"Query",
|
|
25
|
-
"Auth",
|
|
26
|
-
"Variables",
|
|
27
|
-
"Cookies",
|
|
28
|
-
"Headers",
|
|
29
|
-
"Body"
|
|
30
|
-
]);
|
|
31
|
-
return (l = h.value) != null && l.parameters.path.length || t.delete("Variables"), f(((o = a.value) == null ? void 0 : o.method) ?? "get") || t.delete("Body"), y.value && t.delete("Auth"), [...t];
|
|
32
|
-
}), y = _(
|
|
33
|
-
() => {
|
|
34
|
-
var t, l;
|
|
35
|
-
return d.value && ((l = (t = a.value) == null ? void 0 : t.security) == null ? void 0 : l.length) === 0;
|
|
36
|
-
}
|
|
37
|
-
), e = g("All");
|
|
38
|
-
b(a, (t) => {
|
|
39
|
-
e.value === "Body" && t && !f(t.method) && (e.value = "All");
|
|
40
|
-
});
|
|
41
|
-
const q = (t) => {
|
|
42
|
-
if (!a.value) return;
|
|
43
|
-
const l = t.target;
|
|
44
|
-
k.edit(a.value.uid, "summary", l.value);
|
|
45
|
-
};
|
|
46
|
-
return (t, l) => (m(), C(R, null, {
|
|
47
|
-
title: x(() => {
|
|
48
|
-
var o, i;
|
|
49
|
-
return [
|
|
50
|
-
A("div", $, [
|
|
51
|
-
r(d) ? V("", !0) : (m(), p("label", D)),
|
|
52
|
-
r(d) ? (m(), p("span", P, w((i = r(a)) == null ? void 0 : i.summary), 1)) : (m(), p("input", {
|
|
53
|
-
key: 1,
|
|
54
|
-
id: "requestname",
|
|
55
|
-
class: "outline-none border-0 text-c-1 rounded pointer-events-auto relative w-full",
|
|
56
|
-
placeholder: "Request Name",
|
|
57
|
-
value: (o = r(a)) == null ? void 0 : o.summary,
|
|
58
|
-
onInput: q
|
|
59
|
-
}, null, 40, M))
|
|
60
|
-
]),
|
|
61
|
-
s(H, {
|
|
62
|
-
activeSection: e.value,
|
|
63
|
-
sections: B.value,
|
|
64
|
-
onSetActiveSection: l[0] || (l[0] = (c) => e.value = c)
|
|
65
|
-
}, null, 8, ["activeSection", "sections"])
|
|
66
|
-
];
|
|
67
|
-
}),
|
|
68
|
-
default: x(() => {
|
|
69
|
-
var o, i, c;
|
|
70
|
-
return [
|
|
71
|
-
A("div", I, [
|
|
72
|
-
u(s(E, { title: "Authentication" }, null, 512), [
|
|
73
|
-
[
|
|
74
|
-
n,
|
|
75
|
-
!y.value && (e.value === "All" || e.value === "Auth")
|
|
76
|
-
]
|
|
77
|
-
]),
|
|
78
|
-
u(s(K, {
|
|
79
|
-
paramKey: "path",
|
|
80
|
-
title: "Path Variables"
|
|
81
|
-
}, null, 512), [
|
|
82
|
-
[
|
|
83
|
-
n,
|
|
84
|
-
(e.value === "All" || e.value === "Variables") && ((c = (i = (o = r(h)) == null ? void 0 : o.parameters) == null ? void 0 : i.path) == null ? void 0 : c.length)
|
|
85
|
-
]
|
|
86
|
-
]),
|
|
87
|
-
u(s(v, {
|
|
88
|
-
paramKey: "cookies",
|
|
89
|
-
title: "Cookies"
|
|
90
|
-
}, null, 512), [
|
|
91
|
-
[n, e.value === "All" || e.value === "Cookies"]
|
|
92
|
-
]),
|
|
93
|
-
u(s(v, {
|
|
94
|
-
paramKey: "headers",
|
|
95
|
-
title: "Headers"
|
|
96
|
-
}, null, 512), [
|
|
97
|
-
[n, e.value === "All" || e.value === "Headers"]
|
|
98
|
-
]),
|
|
99
|
-
u(s(v, {
|
|
100
|
-
paramKey: "query",
|
|
101
|
-
title: "Query Parameters"
|
|
102
|
-
}, null, 512), [
|
|
103
|
-
[n, e.value === "All" || e.value === "Query"]
|
|
104
|
-
]),
|
|
105
|
-
u(s(N, { title: "Body" }, null, 512), [
|
|
106
|
-
[
|
|
107
|
-
n,
|
|
108
|
-
r(a) && (e.value === "All" || e.value === "Body") && r(f)(r(a).method)
|
|
109
|
-
]
|
|
110
|
-
])
|
|
111
|
-
])
|
|
112
|
-
];
|
|
113
|
-
}),
|
|
114
|
-
_: 1
|
|
115
|
-
}));
|
|
116
|
-
}
|
|
117
|
-
});
|
|
1
|
+
import o from "./RequestSection.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1039132b"]]);
|
|
118
5
|
export {
|
|
119
|
-
|
|
6
|
+
p as default
|
|
120
7
|
};
|