@scalar/api-client 2.2.44 → 2.2.45
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 +26 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +37 -37
- package/dist/components/EmptyState.vue.d.ts +3 -0
- package/dist/components/EmptyState.vue.d.ts.map +1 -0
- package/dist/components/EmptyState.vue.js +7 -0
- package/dist/components/EmptyState.vue2.js +31 -0
- package/dist/components/Form/Form.vue.js +1 -1
- package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey.vue.js +12 -7
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/layouts/App/create-api-client-app.d.ts +2 -2
- package/dist/layouts/Modal/create-api-client-modal.d.ts +4 -4
- package/dist/layouts/Web/create-api-client-web.d.ts +2 -2
- package/dist/libs/create-client.d.ts +2 -2
- package/dist/libs/index.js +31 -33
- package/dist/libs/send-request/build-request-security.d.ts +17 -0
- package/dist/libs/send-request/build-request-security.d.ts.map +1 -0
- package/dist/libs/send-request/build-request-security.js +31 -0
- package/dist/libs/send-request/create-fetch-body.d.ts +18 -0
- package/dist/libs/send-request/create-fetch-body.d.ts.map +1 -0
- package/dist/libs/send-request/create-fetch-body.js +26 -0
- package/dist/libs/send-request/create-fetch-headers.d.ts +4 -0
- package/dist/libs/send-request/create-fetch-headers.d.ts.map +1 -0
- package/dist/libs/send-request/create-fetch-headers.js +11 -0
- package/dist/libs/send-request/create-fetch-query-params.d.ts +4 -0
- package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -0
- package/dist/libs/send-request/create-fetch-query-params.js +10 -0
- package/dist/libs/send-request/create-request-operation.d.ts +29 -0
- package/dist/libs/send-request/create-request-operation.d.ts.map +1 -0
- package/dist/libs/send-request/create-request-operation.js +107 -0
- package/dist/libs/send-request/decode-buffer.d.ts +3 -0
- package/dist/libs/send-request/decode-buffer.d.ts.map +1 -0
- package/dist/libs/send-request/decode-buffer.js +9 -0
- package/dist/libs/send-request/index.d.ts +2 -1
- package/dist/libs/send-request/index.d.ts.map +1 -1
- package/dist/libs/send-request/index.js +4 -6
- package/dist/store/request-example.d.ts +2 -2
- package/dist/store/store.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieModal.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieModal.vue.js +2 -2
- package/dist/views/Cookies/CookieModal.vue2.js +11 -11
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +37 -36
- package/dist/views/Request/Request.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +89 -87
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +47 -45
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +8 -7
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +97 -104
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +39 -57
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +74 -71
- package/package.json +10 -10
- package/dist/libs/send-request/send-request.d.ts +0 -51
- package/dist/libs/send-request/send-request.d.ts.map +0 -1
- package/dist/libs/send-request/send-request.js +0 -177
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as ae, computed as w, ref as te, watch as $, openBlock as g, createBlock as x, withCtx as
|
|
1
|
+
import { defineComponent as ae, computed as w, ref as te, watch as $, openBlock as g, createBlock as x, withCtx as f, createTextVNode as H, toDisplayString as _, createVNode as p, unref as m, createElementVNode as D, createCommentVNode as oe, createElementBlock as V, Fragment as ne, nextTick as le } from "vue";
|
|
2
2
|
import re from "../../../components/CodeInput/CodeInput.vue.js";
|
|
3
3
|
import ue from "../../../components/DataTable/DataTable.vue.js";
|
|
4
4
|
import ie from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
5
|
import C from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
6
|
import de from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
7
|
import { useActiveEntities as se } from "../../../store/active-entities.js";
|
|
8
|
-
import { ScalarListbox as X, ScalarButton as
|
|
8
|
+
import { ScalarListbox as X, ScalarButton as T, ScalarIcon as P } from "@scalar/components";
|
|
9
9
|
import { requestExampleParametersSchema as Y } from "@scalar/oas-utils/entities/spec";
|
|
10
10
|
import { canMethodHaveBody as ce } from "@scalar/oas-utils/helpers";
|
|
11
11
|
import G from "./RequestTable.vue.js";
|
|
@@ -23,7 +23,7 @@ const ve = {
|
|
|
23
23
|
title: {}
|
|
24
24
|
},
|
|
25
25
|
setup(ye) {
|
|
26
|
-
const { activeRequest:
|
|
26
|
+
const { activeRequest: v, activeExample: o } = se(), { requestExampleMutators: i } = me(), Q = {
|
|
27
27
|
json: "json",
|
|
28
28
|
xml: "xml",
|
|
29
29
|
yaml: "yaml",
|
|
@@ -42,12 +42,14 @@ const ve = {
|
|
|
42
42
|
}).map(([e, a]) => ({
|
|
43
43
|
id: e,
|
|
44
44
|
label: a
|
|
45
|
-
})),
|
|
46
|
-
var
|
|
47
|
-
return o.value ? o.value.body.activeBody === "formData" ? ((
|
|
45
|
+
})), U = w(() => {
|
|
46
|
+
var a, t, n, l;
|
|
47
|
+
return o.value ? o.value.body.activeBody === "formData" ? ((a = o.value.body.formData) == null ? void 0 : a.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : o.value.body.activeBody === "binary" ? "binaryFile" : o.value.body.activeBody === "raw" && ((t = o.value.body.raw) != null && t.encoding) ? o.value.body.raw.encoding === "html" ? "other" : o.value.body.raw.encoding : Object.keys(
|
|
48
|
+
((l = (n = v.value) == null ? void 0 : n.requestBody) == null ? void 0 : l.content) || {}
|
|
49
|
+
)[0] || "none" : "none";
|
|
48
50
|
}), y = w({
|
|
49
51
|
get: () => F.find(
|
|
50
|
-
(e) => e.id ===
|
|
52
|
+
(e) => e.id === U.value
|
|
51
53
|
) ?? F[F.length - 1],
|
|
52
54
|
set: (e) => {
|
|
53
55
|
e != null && e.id && W(e.id);
|
|
@@ -60,15 +62,15 @@ const ve = {
|
|
|
60
62
|
function N() {
|
|
61
63
|
console.log("deleteRow");
|
|
62
64
|
}
|
|
63
|
-
const
|
|
64
|
-
var
|
|
65
|
-
if (!
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
const c = [...
|
|
65
|
+
const j = (e, a, t) => {
|
|
66
|
+
var l, r, s, u, d, h, B;
|
|
67
|
+
if (!v.value || !o.value) return;
|
|
68
|
+
const n = b.value;
|
|
69
|
+
if (n.length > e) {
|
|
70
|
+
const c = [...n];
|
|
69
71
|
c[e] = {
|
|
70
72
|
...c[e],
|
|
71
|
-
value: ((
|
|
73
|
+
value: ((l = c[e]) == null ? void 0 : l.value) || "",
|
|
72
74
|
key: ((r = c[e]) == null ? void 0 : r.key) || "",
|
|
73
75
|
enabled: ((s = c[e]) == null ? void 0 : s.enabled) ?? !1,
|
|
74
76
|
[a]: t || ""
|
|
@@ -83,23 +85,23 @@ const ve = {
|
|
|
83
85
|
o.value.uid,
|
|
84
86
|
"body.formData.value",
|
|
85
87
|
c
|
|
86
|
-
),
|
|
88
|
+
), le(() => {
|
|
87
89
|
var A;
|
|
88
90
|
if (!R.value) return;
|
|
89
91
|
(A = R.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || A.focus();
|
|
90
92
|
});
|
|
91
93
|
}
|
|
92
|
-
e ===
|
|
94
|
+
e === n.length - 1 && S();
|
|
93
95
|
}, b = w(
|
|
94
96
|
() => {
|
|
95
97
|
var e, a, t;
|
|
96
98
|
return ((t = (a = (e = o.value) == null ? void 0 : e.body) == null ? void 0 : a.formData) == null ? void 0 : t.value) ?? [];
|
|
97
99
|
}
|
|
98
|
-
),
|
|
100
|
+
), O = () => {
|
|
99
101
|
const e = b.value[b.value.length - 1];
|
|
100
|
-
(!e || e.key !== "" || e.value !== "") &&
|
|
101
|
-
},
|
|
102
|
-
if (!
|
|
102
|
+
(!e || e.key !== "" || e.value !== "") && S();
|
|
103
|
+
}, S = () => {
|
|
104
|
+
if (!v.value || !o.value) return;
|
|
103
105
|
const e = Y.parse({
|
|
104
106
|
enabled: !1
|
|
105
107
|
}), a = [...b.value, e];
|
|
@@ -112,18 +114,18 @@ const ve = {
|
|
|
112
114
|
encoding: "form-data"
|
|
113
115
|
});
|
|
114
116
|
}, q = (e, a) => {
|
|
115
|
-
if (!
|
|
117
|
+
if (!v.value || !o.value) return;
|
|
116
118
|
const t = b.value;
|
|
117
119
|
if (t.length > e) {
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
+
const n = [...t];
|
|
121
|
+
n[e] && (n[e].enabled = a), i.edit(
|
|
120
122
|
o.value.uid,
|
|
121
123
|
"body.formData.value",
|
|
122
|
-
|
|
124
|
+
n
|
|
123
125
|
);
|
|
124
126
|
}
|
|
125
127
|
}, L = (e) => {
|
|
126
|
-
!
|
|
128
|
+
!v.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
|
|
127
129
|
}, M = (e) => e === "multipartForm" ? {
|
|
128
130
|
activeBody: "formData",
|
|
129
131
|
encoding: "form-data",
|
|
@@ -159,7 +161,7 @@ const ve = {
|
|
|
159
161
|
} : { activeBody: "raw", encoding: void 0, header: void 0 }, W = (e) => {
|
|
160
162
|
var s, u;
|
|
161
163
|
if (!o.value) return;
|
|
162
|
-
const { activeBody: a, encoding: t, header:
|
|
164
|
+
const { activeBody: a, encoding: t, header: n } = M(e);
|
|
163
165
|
if (i.edit(
|
|
164
166
|
o.value.uid,
|
|
165
167
|
"body.activeBody",
|
|
@@ -178,40 +180,40 @@ const ve = {
|
|
|
178
180
|
const { raw: d, ...h } = o.value.body;
|
|
179
181
|
i.edit(o.value.uid, "body", h);
|
|
180
182
|
}
|
|
181
|
-
const
|
|
183
|
+
const l = [...o.value.parameters.headers], r = l.findIndex(
|
|
182
184
|
(d) => d.key.toLowerCase() === "content-type"
|
|
183
185
|
);
|
|
184
186
|
if (r >= 0)
|
|
185
|
-
|
|
186
|
-
else if (
|
|
187
|
-
const d =
|
|
188
|
-
d && d.key === "" && d.value === "" ?
|
|
187
|
+
n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1);
|
|
188
|
+
else if (n) {
|
|
189
|
+
const d = l[l.length - 1];
|
|
190
|
+
d && d.key === "" && d.value === "" ? l.splice(l.length - 1, 0, {
|
|
189
191
|
key: "Content-Type",
|
|
190
|
-
value:
|
|
192
|
+
value: n,
|
|
191
193
|
enabled: !0
|
|
192
|
-
}) :
|
|
194
|
+
}) : l.push({
|
|
193
195
|
key: "Content-Type",
|
|
194
|
-
value:
|
|
196
|
+
value: n,
|
|
195
197
|
enabled: !0
|
|
196
198
|
});
|
|
197
199
|
}
|
|
198
200
|
i.edit(
|
|
199
201
|
o.value.uid,
|
|
200
202
|
"parameters.headers",
|
|
201
|
-
|
|
203
|
+
l
|
|
202
204
|
);
|
|
203
205
|
}, z = async (e) => {
|
|
204
206
|
const { open: a } = K({
|
|
205
207
|
onChange: async (t) => {
|
|
206
|
-
var
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
208
|
+
var l, r;
|
|
209
|
+
const n = t == null ? void 0 : t[0];
|
|
210
|
+
if (n && v.value && o.value) {
|
|
209
211
|
const u = [...b.value];
|
|
210
212
|
u[e] = {
|
|
211
213
|
...u[e],
|
|
212
|
-
file:
|
|
213
|
-
value: ((
|
|
214
|
-
key: ((r = u[e]) == null ? void 0 : r.key) ||
|
|
214
|
+
file: n,
|
|
215
|
+
value: ((l = u[e]) == null ? void 0 : l.value) || n.name,
|
|
216
|
+
key: ((r = u[e]) == null ? void 0 : r.key) || n.name,
|
|
215
217
|
enabled: !0
|
|
216
218
|
}, i.edit(
|
|
217
219
|
o.value.uid,
|
|
@@ -226,10 +228,10 @@ const ve = {
|
|
|
226
228
|
a();
|
|
227
229
|
};
|
|
228
230
|
function I() {
|
|
229
|
-
!
|
|
231
|
+
!v.value || !o.value || i.edit(o.value.uid, "body.binary", void 0);
|
|
230
232
|
}
|
|
231
233
|
function J(e) {
|
|
232
|
-
if (!
|
|
234
|
+
if (!v.value || !o.value) return;
|
|
233
235
|
const t = [...b.value];
|
|
234
236
|
t[e] = {
|
|
235
237
|
...t[e],
|
|
@@ -247,7 +249,7 @@ const ve = {
|
|
|
247
249
|
const { open: e } = K({
|
|
248
250
|
onChange: async (a) => {
|
|
249
251
|
const t = a == null ? void 0 : a[0];
|
|
250
|
-
t &&
|
|
252
|
+
t && v.value && o.value && i.edit(
|
|
251
253
|
o.value.uid,
|
|
252
254
|
"body.binary",
|
|
253
255
|
t
|
|
@@ -261,7 +263,7 @@ const ve = {
|
|
|
261
263
|
$(
|
|
262
264
|
y,
|
|
263
265
|
(e) => {
|
|
264
|
-
["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") &&
|
|
266
|
+
["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") && O();
|
|
265
267
|
},
|
|
266
268
|
{ immediate: !0 }
|
|
267
269
|
), $(
|
|
@@ -271,24 +273,24 @@ const ve = {
|
|
|
271
273
|
},
|
|
272
274
|
() => {
|
|
273
275
|
var e;
|
|
274
|
-
(e =
|
|
275
|
-
|
|
276
|
-
) &&
|
|
276
|
+
(e = v.value) != null && e.method && ce(v.value.method) && W(U.value), ["multipartForm", "formUrlEncoded"].includes(
|
|
277
|
+
U.value
|
|
278
|
+
) && O();
|
|
277
279
|
},
|
|
278
280
|
{ immediate: !0 }
|
|
279
281
|
);
|
|
280
282
|
const k = w(() => {
|
|
281
|
-
var
|
|
282
|
-
const e = (
|
|
283
|
-
return Object.entries(
|
|
283
|
+
var l, r, s, u;
|
|
284
|
+
const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((s = (r = v.value) == null ? void 0 : r.requestBody) == null ? void 0 : s.content) || {}, n = a ? ((u = t[a]) == null ? void 0 : u.examples) || {} : {};
|
|
285
|
+
return Object.entries(n).map(([d, h]) => ({
|
|
284
286
|
id: d,
|
|
285
287
|
label: d,
|
|
286
288
|
value: h
|
|
287
289
|
}));
|
|
288
|
-
}),
|
|
290
|
+
}), E = w({
|
|
289
291
|
get: () => {
|
|
290
|
-
var
|
|
291
|
-
const e = ((
|
|
292
|
+
var n, l;
|
|
293
|
+
const e = ((l = (n = o.value) == null ? void 0 : n.body.raw) == null ? void 0 : l.value) ?? "{}", a = JSON.parse(e);
|
|
292
294
|
return k.value.find((r) => {
|
|
293
295
|
const s = r.value;
|
|
294
296
|
return JSON.stringify(s.value) === JSON.stringify(a);
|
|
@@ -307,33 +309,33 @@ const ve = {
|
|
|
307
309
|
}
|
|
308
310
|
});
|
|
309
311
|
return (e, a) => (g(), x(de, null, {
|
|
310
|
-
title:
|
|
312
|
+
title: f(() => [
|
|
311
313
|
H(_(e.title), 1)
|
|
312
314
|
]),
|
|
313
|
-
default:
|
|
314
|
-
|
|
315
|
-
default:
|
|
316
|
-
|
|
317
|
-
default:
|
|
318
|
-
|
|
319
|
-
default:
|
|
320
|
-
|
|
315
|
+
default: f(() => [
|
|
316
|
+
p(ue, { columns: [""] }, {
|
|
317
|
+
default: f(() => [
|
|
318
|
+
p(C, null, {
|
|
319
|
+
default: f(() => [
|
|
320
|
+
p(ie, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
|
|
321
|
+
default: f(() => [
|
|
322
|
+
p(m(X), {
|
|
321
323
|
modelValue: y.value,
|
|
322
324
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => y.value = t),
|
|
323
325
|
options: m(F),
|
|
324
326
|
teleport: ""
|
|
325
327
|
}, {
|
|
326
|
-
default:
|
|
327
|
-
|
|
328
|
+
default: f(() => [
|
|
329
|
+
p(m(T), {
|
|
328
330
|
class: "flex gap-1.5 h-full px-3 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
329
331
|
fullWidth: "",
|
|
330
332
|
variant: "ghost"
|
|
331
333
|
}, {
|
|
332
|
-
default:
|
|
334
|
+
default: f(() => {
|
|
333
335
|
var t;
|
|
334
336
|
return [
|
|
335
337
|
D("span", null, _((t = y.value) == null ? void 0 : t.label), 1),
|
|
336
|
-
|
|
338
|
+
p(m(P), {
|
|
337
339
|
icon: "ChevronDown",
|
|
338
340
|
size: "md"
|
|
339
341
|
})
|
|
@@ -346,23 +348,23 @@ const ve = {
|
|
|
346
348
|
}, 8, ["modelValue", "options"]),
|
|
347
349
|
k.value.length > 0 ? (g(), x(m(X), {
|
|
348
350
|
key: 0,
|
|
349
|
-
modelValue:
|
|
350
|
-
"onUpdate:modelValue": a[1] || (a[1] = (t) =>
|
|
351
|
+
modelValue: E.value,
|
|
352
|
+
"onUpdate:modelValue": a[1] || (a[1] = (t) => E.value = t),
|
|
351
353
|
options: k.value,
|
|
352
354
|
side: "left",
|
|
353
355
|
teleport: ""
|
|
354
356
|
}, {
|
|
355
|
-
default:
|
|
356
|
-
|
|
357
|
+
default: f(() => [
|
|
358
|
+
p(m(T), {
|
|
357
359
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
358
360
|
fullWidth: "",
|
|
359
361
|
variant: "ghost"
|
|
360
362
|
}, {
|
|
361
|
-
default:
|
|
363
|
+
default: f(() => {
|
|
362
364
|
var t;
|
|
363
365
|
return [
|
|
364
|
-
D("span", null, _((t =
|
|
365
|
-
|
|
366
|
+
D("span", null, _((t = E.value) == null ? void 0 : t.label), 1),
|
|
367
|
+
p(m(P), {
|
|
366
368
|
icon: "ChevronDown",
|
|
367
369
|
size: "md"
|
|
368
370
|
})
|
|
@@ -379,36 +381,36 @@ const ve = {
|
|
|
379
381
|
]),
|
|
380
382
|
_: 1
|
|
381
383
|
}),
|
|
382
|
-
|
|
383
|
-
default:
|
|
384
|
-
var t,
|
|
384
|
+
p(C, null, {
|
|
385
|
+
default: f(() => {
|
|
386
|
+
var t, n, l, r, s, u, d, h, B;
|
|
385
387
|
return [
|
|
386
388
|
((t = y.value) == null ? void 0 : t.id) === "none" ? (g(), V("div", ve, a[2] || (a[2] = [
|
|
387
389
|
D("span", null, "No Body", -1)
|
|
388
|
-
]))) : ((
|
|
389
|
-
(
|
|
390
|
+
]))) : ((n = y.value) == null ? void 0 : n.id) === "binaryFile" ? (g(), V("div", fe, [
|
|
391
|
+
(l = m(o)) != null && l.body.binary ? (g(), V(ne, { key: 0 }, [
|
|
390
392
|
D("span", pe, _(((r = m(o)) == null ? void 0 : r.body.binary).name), 1),
|
|
391
|
-
|
|
393
|
+
p(m(T), {
|
|
392
394
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
|
|
393
395
|
size: "sm",
|
|
394
396
|
variant: "outlined",
|
|
395
397
|
onClick: I
|
|
396
398
|
}, {
|
|
397
|
-
default:
|
|
399
|
+
default: f(() => a[3] || (a[3] = [
|
|
398
400
|
H(" Delete ")
|
|
399
401
|
])),
|
|
400
402
|
_: 1
|
|
401
403
|
})
|
|
402
|
-
], 64)) : (g(), x(m(
|
|
404
|
+
], 64)) : (g(), x(m(T), {
|
|
403
405
|
key: 1,
|
|
404
406
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
|
|
405
407
|
size: "sm",
|
|
406
408
|
variant: "outlined",
|
|
407
409
|
onClick: ee
|
|
408
410
|
}, {
|
|
409
|
-
default:
|
|
411
|
+
default: f(() => [
|
|
410
412
|
a[4] || (a[4] = D("span", null, "Upload File", -1)),
|
|
411
|
-
|
|
413
|
+
p(m(P), {
|
|
412
414
|
class: "ml-1",
|
|
413
415
|
icon: "UploadSimple",
|
|
414
416
|
size: "xs",
|
|
@@ -428,7 +430,7 @@ const ve = {
|
|
|
428
430
|
onDeleteRow: N,
|
|
429
431
|
onRemoveFile: J,
|
|
430
432
|
onToggleRow: q,
|
|
431
|
-
onUpdateRow:
|
|
433
|
+
onUpdateRow: j,
|
|
432
434
|
onUploadFile: z
|
|
433
435
|
}, null, 8, ["items"])) : ((u = y.value) == null ? void 0 : u.id) == "formUrlEncoded" ? (g(), x(G, {
|
|
434
436
|
key: 3,
|
|
@@ -441,7 +443,7 @@ const ve = {
|
|
|
441
443
|
onDeleteRow: N,
|
|
442
444
|
onRemoveFile: J,
|
|
443
445
|
onToggleRow: q,
|
|
444
|
-
onUpdateRow:
|
|
446
|
+
onUpdateRow: j,
|
|
445
447
|
onUploadFile: z
|
|
446
448
|
}, null, 8, ["items"])) : (g(), x(re, {
|
|
447
449
|
key: 4,
|
|
@@ -457,7 +459,7 @@ const ve = {
|
|
|
457
459
|
}),
|
|
458
460
|
_: 1
|
|
459
461
|
}),
|
|
460
|
-
|
|
462
|
+
p(C)
|
|
461
463
|
]),
|
|
462
464
|
_: 1
|
|
463
465
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestParams.vue"],"names":[],"mappings":"AAwOA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;KACxB,EAAE,CAAA;CACJ,CAAC;;AA+VF,wBAOG"}
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { defineComponent as A, computed as m, onMounted as N, ref as V, watch as
|
|
1
|
+
import { defineComponent as A, computed as m, onMounted as N, ref as V, watch as z, openBlock as f, createBlock as d, withCtx as r, createTextVNode as R, toDisplayString as k, createElementVNode as i, unref as x, createVNode as C, withModifiers as B, createCommentVNode as E, normalizeClass as M, nextTick as _ } from "vue";
|
|
2
2
|
import W from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import
|
|
5
|
-
import { ScalarTooltip as
|
|
6
|
-
import { requestExampleParametersSchema as
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
const
|
|
3
|
+
import { useActiveEntities as D } from "../../../store/active-entities.js";
|
|
4
|
+
import q from "./RequestTable.vue.js";
|
|
5
|
+
import { ScalarTooltip as G, ScalarButton as U } from "@scalar/components";
|
|
6
|
+
import { requestExampleParametersSchema as w } from "@scalar/oas-utils/entities/spec";
|
|
7
|
+
import { useWorkspace as j } from "../../../store/store.js";
|
|
8
|
+
const F = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, H = { class: "sr-only" }, ae = /* @__PURE__ */ A({
|
|
9
9
|
__name: "RequestParams",
|
|
10
10
|
props: {
|
|
11
11
|
title: {},
|
|
12
12
|
paramKey: {},
|
|
13
13
|
readOnlyEntries: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const n =
|
|
15
|
+
setup(P) {
|
|
16
|
+
const n = P, { activeRequest: u, activeExample: s } = D(), { requestExampleMutators: o } = j(), l = m(
|
|
17
17
|
() => {
|
|
18
18
|
var e;
|
|
19
19
|
return ((e = s.value) == null ? void 0 : e.parameters[n.paramKey]) ?? [];
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
N(() => {
|
|
23
|
-
|
|
23
|
+
g();
|
|
24
24
|
});
|
|
25
25
|
const p = () => {
|
|
26
26
|
if (!u.value || !s.value) return;
|
|
27
|
-
const e =
|
|
27
|
+
const e = w.parse({ enabled: !1 }), t = [...l.value, e];
|
|
28
28
|
o.edit(
|
|
29
29
|
s.value.uid,
|
|
30
30
|
`parameters.${n.paramKey}`,
|
|
31
31
|
t
|
|
32
32
|
);
|
|
33
|
-
}, c = V(null),
|
|
33
|
+
}, c = V(null), K = (e, t, h) => {
|
|
34
34
|
if (!u.value || !s.value) return;
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
const a = [...
|
|
35
|
+
const v = l.value;
|
|
36
|
+
if (v.length > e) {
|
|
37
|
+
const a = [...v];
|
|
38
38
|
if (!a[e]) return;
|
|
39
|
-
a[e] = { ...a[e], [t]:
|
|
39
|
+
a[e] = { ...a[e], [t]: h }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), o.edit(
|
|
40
40
|
s.value.uid,
|
|
41
41
|
`parameters.${n.paramKey}`,
|
|
42
42
|
a
|
|
43
43
|
);
|
|
44
44
|
} else {
|
|
45
|
-
const a = [
|
|
45
|
+
const a = [w.parse({ [t]: h })];
|
|
46
46
|
o.edit(
|
|
47
47
|
s.value.uid,
|
|
48
48
|
`parameters.${n.paramKey}`,
|
|
49
49
|
a
|
|
50
|
-
),
|
|
51
|
-
var
|
|
50
|
+
), _(() => {
|
|
51
|
+
var b;
|
|
52
52
|
if (!c.value) return;
|
|
53
|
-
(
|
|
53
|
+
(b = c.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || b.focus();
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
e ===
|
|
57
|
-
},
|
|
56
|
+
e === v.length - 1 && p();
|
|
57
|
+
}, $ = (e, t) => u.value && s.value && o.edit(
|
|
58
58
|
s.value.uid,
|
|
59
59
|
`parameters.${n.paramKey}.${e}.enabled`,
|
|
60
60
|
t
|
|
61
|
-
),
|
|
61
|
+
), O = () => {
|
|
62
62
|
if (!u.value || !s.value) return;
|
|
63
63
|
const e = l.value.filter((t) => t.required);
|
|
64
64
|
o.edit(
|
|
65
65
|
s.value.uid,
|
|
66
66
|
`parameters.${n.paramKey}`,
|
|
67
67
|
e
|
|
68
|
-
),
|
|
68
|
+
), _(() => {
|
|
69
69
|
p();
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
function
|
|
72
|
+
function g() {
|
|
73
73
|
if (l.value.length === 0)
|
|
74
74
|
p();
|
|
75
75
|
else if (l.value.length >= 1) {
|
|
@@ -77,43 +77,43 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
77
77
|
e && e.key !== "" && e.value !== "" && p();
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const T = m(
|
|
81
81
|
() => l.value.filter((e) => e.key || e.value).length
|
|
82
|
-
),
|
|
83
|
-
|
|
82
|
+
), S = m(() => l.value.length > 1);
|
|
83
|
+
z(
|
|
84
84
|
() => s.value,
|
|
85
85
|
(e, t) => {
|
|
86
|
-
e !== t &&
|
|
86
|
+
e !== t && g();
|
|
87
87
|
},
|
|
88
88
|
{ immediate: !0 }
|
|
89
89
|
);
|
|
90
|
-
const
|
|
90
|
+
const y = m(
|
|
91
91
|
() => (n.readOnlyEntries ?? []).length > 0
|
|
92
92
|
);
|
|
93
|
-
return (e, t) => (
|
|
93
|
+
return (e, t) => (f(), d(W, {
|
|
94
94
|
class: "group/params",
|
|
95
|
-
itemCount:
|
|
95
|
+
itemCount: T.value
|
|
96
96
|
}, {
|
|
97
97
|
title: r(() => [
|
|
98
98
|
R(k(e.title), 1)
|
|
99
99
|
]),
|
|
100
100
|
actions: r(() => [
|
|
101
|
-
i("div",
|
|
102
|
-
|
|
101
|
+
i("div", F, [
|
|
102
|
+
S.value ? (f(), d(x(G), {
|
|
103
103
|
key: 0,
|
|
104
104
|
side: "right",
|
|
105
105
|
sideOffset: 12
|
|
106
106
|
}, {
|
|
107
107
|
trigger: r(() => [
|
|
108
|
-
x(
|
|
108
|
+
C(x(U), {
|
|
109
109
|
class: "px-1 transition-none",
|
|
110
110
|
size: "sm",
|
|
111
111
|
variant: "ghost",
|
|
112
|
-
onClick:
|
|
112
|
+
onClick: B(O, ["stop"])
|
|
113
113
|
}, {
|
|
114
114
|
default: r(() => [
|
|
115
115
|
t[0] || (t[0] = R(" Clear ")),
|
|
116
|
-
i("span",
|
|
116
|
+
i("span", H, "All " + k(e.title), 1)
|
|
117
117
|
]),
|
|
118
118
|
_: 1
|
|
119
119
|
})
|
|
@@ -126,7 +126,7 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
126
126
|
], -1)
|
|
127
127
|
])),
|
|
128
128
|
_: 1
|
|
129
|
-
})) :
|
|
129
|
+
})) : E("", !0)
|
|
130
130
|
])
|
|
131
131
|
]),
|
|
132
132
|
default: r(() => [
|
|
@@ -134,20 +134,22 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
134
134
|
ref_key: "tableWrapperRef",
|
|
135
135
|
ref: c
|
|
136
136
|
}, [
|
|
137
|
-
|
|
137
|
+
y.value ? (f(), d(q, {
|
|
138
138
|
key: 0,
|
|
139
|
-
class: "flex-1",
|
|
139
|
+
class: M(["flex-1", {
|
|
140
|
+
"bg-mix-transparent bg-mix-amount-95 bg-c-3": y.value
|
|
141
|
+
}]),
|
|
140
142
|
columns: ["32px", "", ""],
|
|
141
143
|
isGlobal: "",
|
|
142
144
|
isReadOnly: "",
|
|
143
145
|
items: e.readOnlyEntries
|
|
144
|
-
}, null, 8, ["items"])) :
|
|
145
|
-
|
|
146
|
+
}, null, 8, ["class", "items"])) : E("", !0),
|
|
147
|
+
C(q, {
|
|
146
148
|
class: "flex-1",
|
|
147
149
|
columns: ["32px", "", ""],
|
|
148
150
|
items: l.value,
|
|
149
|
-
onToggleRow:
|
|
150
|
-
onUpdateRow:
|
|
151
|
+
onToggleRow: $,
|
|
152
|
+
onUpdateRow: K
|
|
151
153
|
}, null, 8, ["items"])
|
|
152
154
|
], 512)
|
|
153
155
|
]),
|
|
@@ -156,5 +158,5 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
156
158
|
}
|
|
157
159
|
});
|
|
158
160
|
export {
|
|
159
|
-
|
|
161
|
+
ae as default
|
|
160
162
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestTable.vue"],"names":[],"mappings":"AAwPA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;;;;;;;;;;;;;;;;;;;yBAJsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AAkfxB,wBASG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestTable.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-68853319"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|