@scalar/api-client 2.1.31 → 2.1.32
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 +13 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +3 -3
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +104 -92
- package/dist/components/CodeInput/codeVariableWidget.js +3 -3
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +110 -95
- package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCell.vue.js +5 -5
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue2.js +22 -22
- package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.js +4 -4
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +37 -42
- package/dist/layouts/App/MainLayout.vue.d.ts +12 -0
- package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -0
- package/dist/layouts/App/MainLayout.vue.js +18 -0
- package/dist/layouts/App/MainLayout.vue2.js +4 -0
- package/dist/layouts/App/create-api-client-app.d.ts +6 -5
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +12 -10
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +26 -31
- package/dist/layouts/Web/create-api-client-web.d.ts +6 -5
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +6 -5
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +21 -18
- package/dist/store/store.d.ts +28 -13
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +112 -108
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +4 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +61 -48
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +5 -384
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +384 -2
- package/dist/views/Request/RequestSection/RequestSection.vue.js +15 -15
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +90 -65
- package/package.json +7 -7
|
@@ -1,4 +1,386 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as G, computed as w, ref as K, watch as S, openBlock as p, createBlock as b, withCtx as u, createTextVNode as q, toDisplayString as F, createVNode as s, unref as c, createElementVNode as x, createElementBlock as R, Fragment as Q, nextTick as Z } from "vue";
|
|
2
|
+
import I from "../../../components/CodeInput/CodeInput.vue.js";
|
|
3
|
+
import ee from "../../../components/DataTable/DataTable.vue.js";
|
|
4
|
+
import ae from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
|
+
import k from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
|
+
import te from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
|
+
import { ScalarListbox as oe, ScalarButton as _, ScalarIcon as L } from "@scalar/components";
|
|
8
|
+
import { requestExampleParametersSchema as M } from "@scalar/oas-utils/entities/spec";
|
|
9
|
+
import { canMethodHaveBody as ne } from "@scalar/oas-utils/helpers";
|
|
10
|
+
import W from "./RequestTable.vue.js";
|
|
11
|
+
import { useWorkspace as le } from "../../../store/store.js";
|
|
12
|
+
import { useFileDialog as A } from "../../../hooks/useFileDialog.js";
|
|
13
|
+
const re = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
|
|
16
|
+
}, de = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "flex items-center justify-center p-1.5 overflow-hidden"
|
|
19
|
+
}, ie = { class: "text-c-2 text-xs w-full border rounded p-1 max-w-full overflow-hidden whitespace-nowrap" }, De = /* @__PURE__ */ G({
|
|
20
|
+
__name: "RequestBody",
|
|
21
|
+
props: {
|
|
22
|
+
title: {}
|
|
23
|
+
},
|
|
24
|
+
setup(ue) {
|
|
25
|
+
const { activeRequest: i, activeExample: a, requestExampleMutators: r } = le(), z = {
|
|
26
|
+
json: "json",
|
|
27
|
+
xml: "xml",
|
|
28
|
+
yaml: "yaml",
|
|
29
|
+
edn: "edn",
|
|
30
|
+
other: "html"
|
|
31
|
+
}, h = Object.entries({
|
|
32
|
+
multipartForm: "Multipart Form",
|
|
33
|
+
formUrlEncoded: "Form URL Encoded",
|
|
34
|
+
binaryFile: "Binary File",
|
|
35
|
+
json: "JSON",
|
|
36
|
+
xml: "XML",
|
|
37
|
+
yaml: "YAML",
|
|
38
|
+
edn: "EDN",
|
|
39
|
+
other: "Other",
|
|
40
|
+
none: "None"
|
|
41
|
+
}).map(([e, t]) => ({
|
|
42
|
+
id: e,
|
|
43
|
+
label: t
|
|
44
|
+
})), B = w(() => {
|
|
45
|
+
var e, t;
|
|
46
|
+
return a.value ? a.value.body.activeBody === "formData" ? ((e = a.value.body.formData) == null ? void 0 : e.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : a.value.body.activeBody === "binary" ? "binaryFile" : a.value.body.activeBody === "raw" && ((t = a.value.body.raw) != null && t.encoding) ? a.value.body.raw.encoding === "html" ? "other" : a.value.body.raw.encoding : "none" : "none";
|
|
47
|
+
}), m = w({
|
|
48
|
+
get: () => h.find(
|
|
49
|
+
(e) => e.id === B.value
|
|
50
|
+
) ?? h[h.length - 1],
|
|
51
|
+
set: (e) => {
|
|
52
|
+
e != null && e.id && C(e.id);
|
|
53
|
+
}
|
|
54
|
+
}), g = K(null), O = w(() => {
|
|
55
|
+
const e = m.value.id;
|
|
56
|
+
return z[e] ?? "plaintext";
|
|
57
|
+
});
|
|
58
|
+
function U() {
|
|
59
|
+
console.log("deleteRow");
|
|
60
|
+
}
|
|
61
|
+
const T = (e, t, o) => {
|
|
62
|
+
if (!i.value || !a.value) return;
|
|
63
|
+
const l = v.value;
|
|
64
|
+
if (l.length > e) {
|
|
65
|
+
const n = [...l];
|
|
66
|
+
n[e] = { ...n[e], [t]: o }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1), r.edit(
|
|
67
|
+
a.value.uid,
|
|
68
|
+
"body.formData.value",
|
|
69
|
+
n
|
|
70
|
+
);
|
|
71
|
+
} else {
|
|
72
|
+
const n = [M.parse({ [t]: o })];
|
|
73
|
+
r.edit(
|
|
74
|
+
a.value.uid,
|
|
75
|
+
"body.formData.value",
|
|
76
|
+
n
|
|
77
|
+
), Z(() => {
|
|
78
|
+
var y;
|
|
79
|
+
if (!g.value) return;
|
|
80
|
+
(y = g.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || y.focus();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}, v = w(
|
|
84
|
+
() => {
|
|
85
|
+
var e, t, o;
|
|
86
|
+
return ((o = (t = (e = a.value) == null ? void 0 : e.body) == null ? void 0 : t.formData) == null ? void 0 : o.value) ?? [];
|
|
87
|
+
}
|
|
88
|
+
), E = () => v.value.length === 0 && D(), D = () => {
|
|
89
|
+
if (!i.value || !a.value) return;
|
|
90
|
+
const e = M.parse({
|
|
91
|
+
enabled: !1
|
|
92
|
+
}), t = [...v.value, e];
|
|
93
|
+
a.value.body.formData ? r.edit(
|
|
94
|
+
a.value.uid,
|
|
95
|
+
"body.formData.value",
|
|
96
|
+
t
|
|
97
|
+
) : r.edit(a.value.uid, "body.formData", {
|
|
98
|
+
value: t,
|
|
99
|
+
encoding: "form-data"
|
|
100
|
+
});
|
|
101
|
+
}, P = (e, t) => {
|
|
102
|
+
if (!i.value || !a.value) return;
|
|
103
|
+
const o = v.value;
|
|
104
|
+
if (o.length > e) {
|
|
105
|
+
const l = [...o];
|
|
106
|
+
l[e].enabled = t, r.edit(
|
|
107
|
+
a.value.uid,
|
|
108
|
+
"body.formData.value",
|
|
109
|
+
l
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
}, $ = (e) => {
|
|
113
|
+
!i.value || !a.value || r.edit(a.value.uid, "body.raw.value", e);
|
|
114
|
+
}, H = (e) => e === "multipartForm" ? {
|
|
115
|
+
activeBody: "formData",
|
|
116
|
+
encoding: "form-data",
|
|
117
|
+
header: "multipart/form-data"
|
|
118
|
+
} : e === "formUrlEncoded" ? {
|
|
119
|
+
activeBody: "formData",
|
|
120
|
+
encoding: "urlencoded",
|
|
121
|
+
header: "application/x-www-form-urlencoded"
|
|
122
|
+
} : e === "binaryFile" ? {
|
|
123
|
+
activeBody: "binary",
|
|
124
|
+
encoding: void 0,
|
|
125
|
+
header: "application/octet-stream"
|
|
126
|
+
} : e === "json" ? {
|
|
127
|
+
activeBody: "raw",
|
|
128
|
+
encoding: "json",
|
|
129
|
+
header: "application/json"
|
|
130
|
+
} : e === "xml" ? {
|
|
131
|
+
activeBody: "raw",
|
|
132
|
+
encoding: "xml",
|
|
133
|
+
header: "application/xml"
|
|
134
|
+
} : e === "yaml" ? {
|
|
135
|
+
activeBody: "raw",
|
|
136
|
+
encoding: "yaml",
|
|
137
|
+
header: "application/yaml"
|
|
138
|
+
} : e === "edn" ? {
|
|
139
|
+
activeBody: "raw",
|
|
140
|
+
encoding: "edn",
|
|
141
|
+
header: "application/edn"
|
|
142
|
+
} : e === "other" ? {
|
|
143
|
+
activeBody: "raw",
|
|
144
|
+
encoding: "html",
|
|
145
|
+
header: "application/html"
|
|
146
|
+
} : { activeBody: "raw", encoding: void 0, header: void 0 }, C = (e) => {
|
|
147
|
+
var f, y;
|
|
148
|
+
if (!a.value) return;
|
|
149
|
+
const { activeBody: t, encoding: o, header: l } = H(e);
|
|
150
|
+
if (r.edit(
|
|
151
|
+
a.value.uid,
|
|
152
|
+
"body.activeBody",
|
|
153
|
+
t
|
|
154
|
+
), o && t === "raw")
|
|
155
|
+
r.edit(a.value.uid, "body.raw", {
|
|
156
|
+
encoding: o,
|
|
157
|
+
value: ((f = a.value.body.raw) == null ? void 0 : f.value) ?? ""
|
|
158
|
+
});
|
|
159
|
+
else if (o && t === "formData")
|
|
160
|
+
r.edit(a.value.uid, "body.formData", {
|
|
161
|
+
encoding: o,
|
|
162
|
+
value: ((y = a.value.body.formData) == null ? void 0 : y.value) ?? []
|
|
163
|
+
});
|
|
164
|
+
else if (!o) {
|
|
165
|
+
const { raw: N, ...Y } = a.value.body;
|
|
166
|
+
r.edit(a.value.uid, "body", Y);
|
|
167
|
+
}
|
|
168
|
+
const n = [...a.value.parameters.headers], d = n.findIndex(
|
|
169
|
+
(N) => N.key.toLowerCase() === "content-type"
|
|
170
|
+
);
|
|
171
|
+
d >= 0 ? l ? n[d].value = l : n.splice(d, 1) : l && n.unshift({
|
|
172
|
+
key: "Content-Type",
|
|
173
|
+
value: l,
|
|
174
|
+
enabled: !0
|
|
175
|
+
}), r.edit(
|
|
176
|
+
a.value.uid,
|
|
177
|
+
"parameters.headers",
|
|
178
|
+
n
|
|
179
|
+
);
|
|
180
|
+
}, j = async (e) => {
|
|
181
|
+
const { open: t } = A({
|
|
182
|
+
onChange: async (o) => {
|
|
183
|
+
const l = o == null ? void 0 : o[0];
|
|
184
|
+
if (l && i.value && a.value) {
|
|
185
|
+
const d = [...v.value];
|
|
186
|
+
d[e] = {
|
|
187
|
+
...d[e],
|
|
188
|
+
file: l
|
|
189
|
+
}, r.edit(
|
|
190
|
+
a.value.uid,
|
|
191
|
+
"body.formData.value",
|
|
192
|
+
d
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
multiple: !1,
|
|
197
|
+
accept: "*/*"
|
|
198
|
+
});
|
|
199
|
+
t();
|
|
200
|
+
};
|
|
201
|
+
function J() {
|
|
202
|
+
!i.value || !a.value || r.edit(a.value.uid, "body.binary", void 0);
|
|
203
|
+
}
|
|
204
|
+
function V(e) {
|
|
205
|
+
if (!i.value || !a.value) return;
|
|
206
|
+
const o = [...v.value];
|
|
207
|
+
o[e] = {
|
|
208
|
+
...o[e],
|
|
209
|
+
file: void 0
|
|
210
|
+
}, r.edit(
|
|
211
|
+
a.value.uid,
|
|
212
|
+
"body.formData.value",
|
|
213
|
+
o
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
function X() {
|
|
217
|
+
const { open: e } = A({
|
|
218
|
+
onChange: async (t) => {
|
|
219
|
+
const o = t == null ? void 0 : t[0];
|
|
220
|
+
o && i.value && a.value && r.edit(
|
|
221
|
+
a.value.uid,
|
|
222
|
+
"body.binary",
|
|
223
|
+
o
|
|
224
|
+
);
|
|
225
|
+
},
|
|
226
|
+
multiple: !1,
|
|
227
|
+
accept: "*/*"
|
|
228
|
+
});
|
|
229
|
+
e();
|
|
230
|
+
}
|
|
231
|
+
return S(
|
|
232
|
+
m,
|
|
233
|
+
(e) => {
|
|
234
|
+
["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) && E();
|
|
235
|
+
},
|
|
236
|
+
{ immediate: !0 }
|
|
237
|
+
), S(
|
|
238
|
+
() => {
|
|
239
|
+
var e;
|
|
240
|
+
return (e = a.value) == null ? void 0 : e.uid;
|
|
241
|
+
},
|
|
242
|
+
() => {
|
|
243
|
+
var e;
|
|
244
|
+
(e = i.value) != null && e.method && ne(i.value.method) && C(B.value), ["multipartForm", "formUrlEncoded"].includes(
|
|
245
|
+
B.value
|
|
246
|
+
) && E();
|
|
247
|
+
},
|
|
248
|
+
{ immediate: !0 }
|
|
249
|
+
), (e, t) => (p(), b(te, null, {
|
|
250
|
+
title: u(() => [
|
|
251
|
+
q(F(e.title), 1)
|
|
252
|
+
]),
|
|
253
|
+
default: u(() => [
|
|
254
|
+
s(ee, { columns: [""] }, {
|
|
255
|
+
default: u(() => [
|
|
256
|
+
s(k, null, {
|
|
257
|
+
default: u(() => [
|
|
258
|
+
s(ae, { class: "relative col-span-full flex h-8 cursor-pointer items-center px-[2.25px] py-[2.25px]" }, {
|
|
259
|
+
default: u(() => [
|
|
260
|
+
s(c(oe), {
|
|
261
|
+
modelValue: m.value,
|
|
262
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => m.value = o),
|
|
263
|
+
class: "text-xxs w-full",
|
|
264
|
+
fullWidth: "",
|
|
265
|
+
options: c(h),
|
|
266
|
+
teleport: ""
|
|
267
|
+
}, {
|
|
268
|
+
default: u(() => [
|
|
269
|
+
s(c(_), {
|
|
270
|
+
class: "flex gap-1.5 h-auto px-1.5 text-c-2 font-normal hover:text-c-1",
|
|
271
|
+
fullWidth: "",
|
|
272
|
+
variant: "ghost"
|
|
273
|
+
}, {
|
|
274
|
+
default: u(() => {
|
|
275
|
+
var o;
|
|
276
|
+
return [
|
|
277
|
+
x("span", null, F((o = m.value) == null ? void 0 : o.label), 1),
|
|
278
|
+
s(c(L), {
|
|
279
|
+
icon: "ChevronDown",
|
|
280
|
+
size: "xs",
|
|
281
|
+
thickness: "2.5"
|
|
282
|
+
})
|
|
283
|
+
];
|
|
284
|
+
}),
|
|
285
|
+
_: 1
|
|
286
|
+
})
|
|
287
|
+
]),
|
|
288
|
+
_: 1
|
|
289
|
+
}, 8, ["modelValue", "options"])
|
|
290
|
+
]),
|
|
291
|
+
_: 1
|
|
292
|
+
})
|
|
293
|
+
]),
|
|
294
|
+
_: 1
|
|
295
|
+
}),
|
|
296
|
+
s(k, null, {
|
|
297
|
+
default: u(() => {
|
|
298
|
+
var o, l, n, d, f;
|
|
299
|
+
return [
|
|
300
|
+
m.value.id === "none" ? (p(), R("div", re, t[1] || (t[1] = [
|
|
301
|
+
x("span", null, "No Body", -1)
|
|
302
|
+
]))) : m.value.id === "binaryFile" ? (p(), R("div", de, [
|
|
303
|
+
(o = c(a)) != null && o.body.binary ? (p(), R(Q, { key: 0 }, [
|
|
304
|
+
x("span", ie, F(((l = c(a)) == null ? void 0 : l.body.binary).name), 1),
|
|
305
|
+
s(c(_), {
|
|
306
|
+
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
|
|
307
|
+
size: "sm",
|
|
308
|
+
variant: "outlined",
|
|
309
|
+
onClick: J
|
|
310
|
+
}, {
|
|
311
|
+
default: u(() => t[2] || (t[2] = [
|
|
312
|
+
q(" Delete ")
|
|
313
|
+
])),
|
|
314
|
+
_: 1
|
|
315
|
+
})
|
|
316
|
+
], 64)) : (p(), b(c(_), {
|
|
317
|
+
key: 1,
|
|
318
|
+
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
|
|
319
|
+
size: "sm",
|
|
320
|
+
variant: "outlined",
|
|
321
|
+
onClick: X
|
|
322
|
+
}, {
|
|
323
|
+
default: u(() => [
|
|
324
|
+
t[3] || (t[3] = x("span", null, "Upload File", -1)),
|
|
325
|
+
s(c(L), {
|
|
326
|
+
class: "ml-1",
|
|
327
|
+
icon: "UploadSimple",
|
|
328
|
+
size: "xs",
|
|
329
|
+
thickness: "2.5"
|
|
330
|
+
})
|
|
331
|
+
]),
|
|
332
|
+
_: 1
|
|
333
|
+
}))
|
|
334
|
+
])) : m.value.id == "multipartForm" ? (p(), b(W, {
|
|
335
|
+
key: 2,
|
|
336
|
+
ref_key: "tableWrapperRef",
|
|
337
|
+
ref: g,
|
|
338
|
+
class: "!m-0 rounded-t-none shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
|
|
339
|
+
columns: ["32px", "", "", "61px"],
|
|
340
|
+
items: v.value,
|
|
341
|
+
showUploadButton: "",
|
|
342
|
+
onAddRow: D,
|
|
343
|
+
onDeleteRow: U,
|
|
344
|
+
onRemoveFile: V,
|
|
345
|
+
onToggleRow: P,
|
|
346
|
+
onUpdateRow: T,
|
|
347
|
+
onUploadFile: j
|
|
348
|
+
}, null, 8, ["items"])) : m.value.id == "formUrlEncoded" ? (p(), b(W, {
|
|
349
|
+
key: 3,
|
|
350
|
+
ref_key: "tableWrapperRef",
|
|
351
|
+
ref: g,
|
|
352
|
+
class: "!m-0 rounded-t-none border-t-0 shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
|
|
353
|
+
columns: ["32px", "", "", "61px"],
|
|
354
|
+
items: v.value,
|
|
355
|
+
showUploadButton: "",
|
|
356
|
+
onAddRow: D,
|
|
357
|
+
onDeleteRow: U,
|
|
358
|
+
onRemoveFile: V,
|
|
359
|
+
onToggleRow: P,
|
|
360
|
+
onUpdateRow: T,
|
|
361
|
+
onUploadFile: j
|
|
362
|
+
}, null, 8, ["items"])) : (p(), b(I, {
|
|
363
|
+
key: 4,
|
|
364
|
+
content: "",
|
|
365
|
+
language: O.value,
|
|
366
|
+
lineNumbers: "",
|
|
367
|
+
lint: "",
|
|
368
|
+
modelValue: ((f = (d = (n = c(a)) == null ? void 0 : n.body) == null ? void 0 : d.raw) == null ? void 0 : f.value) ?? "",
|
|
369
|
+
"onUpdate:modelValue": $
|
|
370
|
+
}, null, 8, ["language", "modelValue"]))
|
|
371
|
+
];
|
|
372
|
+
}),
|
|
373
|
+
_: 1
|
|
374
|
+
}),
|
|
375
|
+
s(k)
|
|
376
|
+
]),
|
|
377
|
+
_: 1
|
|
378
|
+
})
|
|
379
|
+
]),
|
|
380
|
+
_: 1
|
|
381
|
+
}));
|
|
382
|
+
}
|
|
383
|
+
});
|
|
2
384
|
export {
|
|
3
|
-
|
|
385
|
+
De as default
|
|
4
386
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as S, computed as _, ref as g, watch as b, openBlock as m, createBlock as C, withCtx as x, createElementVNode as A, unref as r, createElementBlock as p, createCommentVNode as V, toDisplayString as w, createVNode as s, withDirectives as u, vShow as n } from "vue";
|
|
2
2
|
import H from "../../../components/ContextBar.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import R from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
4
|
+
import N from "./RequestBody.vue.js";
|
|
5
5
|
import v from "./RequestParams.vue.js";
|
|
6
6
|
import K from "./RequestPathParams.vue.js";
|
|
7
7
|
import { canMethodHaveBody as f } from "@scalar/oas-utils/helpers";
|
|
8
|
-
import
|
|
9
|
-
import { useWorkspace as
|
|
10
|
-
const
|
|
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
11
|
key: 0,
|
|
12
12
|
class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
|
|
13
13
|
for: "requestname"
|
|
14
14
|
}, M = ["value"], P = {
|
|
15
15
|
key: 2,
|
|
16
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__ */
|
|
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
18
|
__name: "RequestSection",
|
|
19
19
|
setup(O) {
|
|
20
|
-
const { activeRequest: a, activeExample: h, isReadOnly: d, requestMutators: k } =
|
|
20
|
+
const { activeRequest: a, activeExample: h, isReadOnly: d, requestMutators: k } = Q(), B = _(() => {
|
|
21
21
|
var l, o;
|
|
22
22
|
const t = /* @__PURE__ */ new Set([
|
|
23
23
|
"All",
|
|
@@ -34,20 +34,20 @@ const Q = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none"
|
|
|
34
34
|
var t, l;
|
|
35
35
|
return d.value && ((l = (t = a.value) == null ? void 0 : t.security) == null ? void 0 : l.length) === 0;
|
|
36
36
|
}
|
|
37
|
-
), e =
|
|
37
|
+
), e = g("All");
|
|
38
38
|
b(a, (t) => {
|
|
39
39
|
e.value === "Body" && t && !f(t.method) && (e.value = "All");
|
|
40
40
|
});
|
|
41
|
-
const
|
|
41
|
+
const q = (t) => {
|
|
42
42
|
if (!a.value) return;
|
|
43
43
|
const l = t.target;
|
|
44
44
|
k.edit(a.value.uid, "summary", l.value);
|
|
45
45
|
};
|
|
46
|
-
return (t, l) => (m(), C(
|
|
46
|
+
return (t, l) => (m(), C(R, null, {
|
|
47
47
|
title: x(() => {
|
|
48
48
|
var o, i;
|
|
49
49
|
return [
|
|
50
|
-
A("div",
|
|
50
|
+
A("div", $, [
|
|
51
51
|
r(d) ? V("", !0) : (m(), p("label", D)),
|
|
52
52
|
r(d) ? (m(), p("span", P, w((i = r(a)) == null ? void 0 : i.summary), 1)) : (m(), p("input", {
|
|
53
53
|
key: 1,
|
|
@@ -55,7 +55,7 @@ const Q = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none"
|
|
|
55
55
|
class: "outline-none border-0 text-c-1 rounded pointer-events-auto relative w-full",
|
|
56
56
|
placeholder: "Request Name",
|
|
57
57
|
value: (o = r(a)) == null ? void 0 : o.summary,
|
|
58
|
-
onInput:
|
|
58
|
+
onInput: q
|
|
59
59
|
}, null, 40, M))
|
|
60
60
|
]),
|
|
61
61
|
s(H, {
|
|
@@ -69,7 +69,7 @@ const Q = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none"
|
|
|
69
69
|
var o, i, c;
|
|
70
70
|
return [
|
|
71
71
|
A("div", I, [
|
|
72
|
-
u(s(
|
|
72
|
+
u(s(E, { title: "Authentication" }, null, 512), [
|
|
73
73
|
[
|
|
74
74
|
n,
|
|
75
75
|
!y.value && (e.value === "All" || e.value === "Auth")
|
|
@@ -102,7 +102,7 @@ const Q = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none"
|
|
|
102
102
|
}, null, 512), [
|
|
103
103
|
[n, e.value === "All" || e.value === "Query"]
|
|
104
104
|
]),
|
|
105
|
-
u(s(
|
|
105
|
+
u(s(N, { title: "Body" }, null, 512), [
|
|
106
106
|
[
|
|
107
107
|
n,
|
|
108
108
|
r(a) && (e.value === "All" || e.value === "Body") && r(f)(r(a).method)
|
|
@@ -33,7 +33,7 @@ const x = { class: "pl-1 pr-1.5 py-[9px]" }, h = { class: "grid gap-1.5 pointer-
|
|
|
33
33
|
class: "w-full",
|
|
34
34
|
delay: 0,
|
|
35
35
|
side: "left",
|
|
36
|
-
triggerClass: "before:absolute before:content-[''] before:bg-gradient-to-r before:from-transparent before:to-b-1 before:min-h-full before:right-[23px] before:w-3 absolute h-
|
|
36
|
+
triggerClass: "before:absolute before:content-[''] before:bg-gradient-to-r before:from-transparent before:to-b-1 before:min-h-full before:right-[23px] before:w-3 absolute h-full right-0"
|
|
37
37
|
}, {
|
|
38
38
|
trigger: n(() => [
|
|
39
39
|
m("div", x, [
|
|
@@ -13,7 +13,7 @@ const N = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, q = { cl
|
|
|
13
13
|
s.commandPalette.emit({ commandName: "Create Request" });
|
|
14
14
|
}, c = (n) => {
|
|
15
15
|
n != null && n.openCommandPaletteRequest && m();
|
|
16
|
-
}, x = "2.1.
|
|
16
|
+
}, x = "2.1.32";
|
|
17
17
|
return k(() => s.hotKeys.on(c)), R(() => s.hotKeys.off(c)), (n, e) => (r(), l("div", N, [
|
|
18
18
|
t("div", q, [
|
|
19
19
|
o(f).isReadOnly ? p("", !0) : (r(), l("div", v, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsGeneral.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/SettingsGeneral.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SettingsGeneral.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/SettingsGeneral.vue"],"names":[],"mappings":";AAusBA,wBAKG"}
|