@scalar/api-client 2.2.29 → 2.2.31
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 +33 -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 +81 -87
- package/dist/components/ContextBar.vue.js +2 -2
- package/dist/components/ContextBar.vue2.js +3 -3
- package/dist/components/DataTable/index.js +16 -16
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +5 -5
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -2
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/hooks/useLayout.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +11 -11
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +22 -22
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +11 -11
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +21 -21
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/find-request.d.ts +53 -0
- package/dist/libs/find-request.d.ts.map +1 -0
- package/dist/libs/find-request.js +22 -0
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/libs/hot-keys.d.ts.map +1 -1
- package/dist/libs/hot-keys.js +3 -2
- package/dist/libs/importers/index.d.ts +1 -1
- package/dist/libs/importers/index.d.ts.map +1 -1
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +31 -29
- package/dist/libs/parse-curl.d.ts +4 -1
- package/dist/libs/parse-curl.d.ts.map +1 -1
- package/dist/libs/parse-curl.js +55 -69
- package/dist/libs/send-request/send-request.js +1 -1
- package/dist/store/active-entities.d.ts +19 -15
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +30 -27
- package/dist/store/events.d.ts +1 -1
- package/dist/store/store.d.ts +11 -11
- package/dist/store/store.d.ts.map +1 -1
- 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/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +67 -66
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +100 -60
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +1 -1
- package/dist/views/Request/RequestSection/index.d.ts +2 -0
- package/dist/views/Request/RequestSection/index.d.ts.map +1 -0
- package/dist/views/Request/RequestSection/index.js +4 -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 +123 -121
- package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
- package/dist/views/Request/RequestSubpageHeader.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +9 -9
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +1 -1
- package/dist/views/Request/ResponseSection/index.d.ts +2 -0
- package/dist/views/Request/ResponseSection/index.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/index.js +4 -0
- package/package.json +19 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d84d8b55"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
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 m, createTextVNode as H, toDisplayString as _, createVNode as v, unref as c, 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
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import ue from "../../../components/DataTable/DataTable.vue.js";
|
|
4
|
+
import ie from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
5
|
import P 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";
|
|
@@ -23,7 +23,7 @@ const ve = {
|
|
|
23
23
|
title: {}
|
|
24
24
|
},
|
|
25
25
|
setup(ye) {
|
|
26
|
-
const { activeRequest:
|
|
26
|
+
const { activeRequest: f, activeExample: o } = se(), { requestExampleMutators: i } = me(), Q = {
|
|
27
27
|
json: "json",
|
|
28
28
|
xml: "xml",
|
|
29
29
|
yaml: "yaml",
|
|
@@ -61,28 +61,28 @@ const ve = {
|
|
|
61
61
|
console.log("deleteRow");
|
|
62
62
|
}
|
|
63
63
|
const S = (e, a, t) => {
|
|
64
|
-
var l, r, d,
|
|
65
|
-
if (!
|
|
64
|
+
var l, r, d, u, p, h, k;
|
|
65
|
+
if (!f.value || !o.value) return;
|
|
66
66
|
const n = b.value;
|
|
67
67
|
if (n.length > e) {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
...
|
|
71
|
-
value: ((l =
|
|
72
|
-
key: ((r =
|
|
73
|
-
enabled: ((d =
|
|
68
|
+
const s = [...n];
|
|
69
|
+
s[e] = {
|
|
70
|
+
...s[e],
|
|
71
|
+
value: ((l = s[e]) == null ? void 0 : l.value) || "",
|
|
72
|
+
key: ((r = s[e]) == null ? void 0 : r.key) || "",
|
|
73
|
+
enabled: ((d = s[e]) == null ? void 0 : d.enabled) ?? !1,
|
|
74
74
|
[a]: t || ""
|
|
75
|
-
}, (((
|
|
75
|
+
}, (((u = s[e]) == null ? void 0 : u.key) !== "" || ((p = s[e]) == null ? void 0 : p.value) !== "") && (s[e].enabled = !0), ((h = s[e]) == null ? void 0 : h.key) === "" && ((k = s[e]) == null ? void 0 : k.value) === "" && s.splice(e, 1), i.edit(
|
|
76
76
|
o.value.uid,
|
|
77
77
|
"body.formData.value",
|
|
78
|
-
|
|
78
|
+
s
|
|
79
79
|
);
|
|
80
80
|
} else {
|
|
81
|
-
const
|
|
81
|
+
const s = [Y.parse({ [a]: t })];
|
|
82
82
|
i.edit(
|
|
83
83
|
o.value.uid,
|
|
84
84
|
"body.formData.value",
|
|
85
|
-
|
|
85
|
+
s
|
|
86
86
|
), le(() => {
|
|
87
87
|
var A;
|
|
88
88
|
if (!R.value) return;
|
|
@@ -99,7 +99,7 @@ const ve = {
|
|
|
99
99
|
const e = b.value[b.value.length - 1];
|
|
100
100
|
(!e || e.key !== "" || e.value !== "") && O();
|
|
101
101
|
}, O = () => {
|
|
102
|
-
if (!
|
|
102
|
+
if (!f.value || !o.value) return;
|
|
103
103
|
const e = Y.parse({
|
|
104
104
|
enabled: !1
|
|
105
105
|
}), a = [...b.value, e];
|
|
@@ -112,7 +112,7 @@ const ve = {
|
|
|
112
112
|
encoding: "form-data"
|
|
113
113
|
});
|
|
114
114
|
}, q = (e, a) => {
|
|
115
|
-
if (!
|
|
115
|
+
if (!f.value || !o.value) return;
|
|
116
116
|
const t = b.value;
|
|
117
117
|
if (t.length > e) {
|
|
118
118
|
const n = [...t];
|
|
@@ -123,7 +123,7 @@ const ve = {
|
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
}, L = (e) => {
|
|
126
|
-
!
|
|
126
|
+
!f.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
|
|
127
127
|
}, M = (e) => e === "multipartForm" ? {
|
|
128
128
|
activeBody: "formData",
|
|
129
129
|
encoding: "form-data",
|
|
@@ -157,7 +157,7 @@ const ve = {
|
|
|
157
157
|
encoding: "html",
|
|
158
158
|
header: "application/html"
|
|
159
159
|
} : { activeBody: "raw", encoding: void 0, header: void 0 }, W = (e) => {
|
|
160
|
-
var d,
|
|
160
|
+
var d, u;
|
|
161
161
|
if (!o.value) return;
|
|
162
162
|
const { activeBody: a, encoding: t, header: n } = M(e);
|
|
163
163
|
if (i.edit(
|
|
@@ -172,7 +172,7 @@ const ve = {
|
|
|
172
172
|
else if (t && a === "formData")
|
|
173
173
|
i.edit(o.value.uid, "body.formData", {
|
|
174
174
|
encoding: t,
|
|
175
|
-
value: ((
|
|
175
|
+
value: ((u = o.value.body.formData) == null ? void 0 : u.value) ?? []
|
|
176
176
|
});
|
|
177
177
|
else if (!t) {
|
|
178
178
|
const { raw: p, ...h } = o.value.body;
|
|
@@ -193,19 +193,20 @@ const ve = {
|
|
|
193
193
|
}, z = async (e) => {
|
|
194
194
|
const { open: a } = K({
|
|
195
195
|
onChange: async (t) => {
|
|
196
|
+
var l, r;
|
|
196
197
|
const n = t == null ? void 0 : t[0];
|
|
197
|
-
if (n &&
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
...
|
|
198
|
+
if (n && f.value && o.value) {
|
|
199
|
+
const u = [...b.value];
|
|
200
|
+
u[e] = {
|
|
201
|
+
...u[e],
|
|
201
202
|
file: n,
|
|
202
|
-
value: n.name,
|
|
203
|
-
key: n.name,
|
|
203
|
+
value: ((l = u[e]) == null ? void 0 : l.value) || n.name,
|
|
204
|
+
key: ((r = u[e]) == null ? void 0 : r.key) || n.name,
|
|
204
205
|
enabled: !0
|
|
205
206
|
}, i.edit(
|
|
206
207
|
o.value.uid,
|
|
207
208
|
"body.formData.value",
|
|
208
|
-
|
|
209
|
+
u
|
|
209
210
|
);
|
|
210
211
|
}
|
|
211
212
|
},
|
|
@@ -215,10 +216,10 @@ const ve = {
|
|
|
215
216
|
a();
|
|
216
217
|
};
|
|
217
218
|
function I() {
|
|
218
|
-
!
|
|
219
|
+
!f.value || !o.value || i.edit(o.value.uid, "body.binary", void 0);
|
|
219
220
|
}
|
|
220
221
|
function J(e) {
|
|
221
|
-
if (!
|
|
222
|
+
if (!f.value || !o.value) return;
|
|
222
223
|
const t = [...b.value];
|
|
223
224
|
t[e] = {
|
|
224
225
|
...t[e],
|
|
@@ -236,7 +237,7 @@ const ve = {
|
|
|
236
237
|
const { open: e } = K({
|
|
237
238
|
onChange: async (a) => {
|
|
238
239
|
const t = a == null ? void 0 : a[0];
|
|
239
|
-
t &&
|
|
240
|
+
t && f.value && o.value && i.edit(
|
|
240
241
|
o.value.uid,
|
|
241
242
|
"body.binary",
|
|
242
243
|
t
|
|
@@ -260,15 +261,15 @@ const ve = {
|
|
|
260
261
|
},
|
|
261
262
|
() => {
|
|
262
263
|
var e;
|
|
263
|
-
(e =
|
|
264
|
+
(e = f.value) != null && e.method && ce(f.value.method) && W(E.value), ["multipartForm", "formUrlEncoded"].includes(
|
|
264
265
|
E.value
|
|
265
266
|
) && j();
|
|
266
267
|
},
|
|
267
268
|
{ immediate: !0 }
|
|
268
269
|
);
|
|
269
270
|
const B = w(() => {
|
|
270
|
-
var l, r, d,
|
|
271
|
-
const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((d = (r =
|
|
271
|
+
var l, r, d, u;
|
|
272
|
+
const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((d = (r = f.value) == null ? void 0 : r.requestBody) == null ? void 0 : d.content) || {}, n = a ? ((u = t[a]) == null ? void 0 : u.examples) || {} : {};
|
|
272
273
|
return Object.entries(n).map(([p, h]) => ({
|
|
273
274
|
id: p,
|
|
274
275
|
label: p,
|
|
@@ -296,33 +297,33 @@ const ve = {
|
|
|
296
297
|
}
|
|
297
298
|
});
|
|
298
299
|
return (e, a) => (g(), x(de, null, {
|
|
299
|
-
title:
|
|
300
|
+
title: m(() => [
|
|
300
301
|
H(_(e.title), 1)
|
|
301
302
|
]),
|
|
302
|
-
default:
|
|
303
|
-
|
|
304
|
-
default:
|
|
305
|
-
|
|
306
|
-
default:
|
|
307
|
-
|
|
308
|
-
default:
|
|
309
|
-
|
|
303
|
+
default: m(() => [
|
|
304
|
+
v(ue, { columns: [""] }, {
|
|
305
|
+
default: m(() => [
|
|
306
|
+
v(P, null, {
|
|
307
|
+
default: m(() => [
|
|
308
|
+
v(ie, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
|
|
309
|
+
default: m(() => [
|
|
310
|
+
v(c(X), {
|
|
310
311
|
modelValue: y.value,
|
|
311
312
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => y.value = t),
|
|
312
|
-
options:
|
|
313
|
+
options: c(F),
|
|
313
314
|
teleport: ""
|
|
314
315
|
}, {
|
|
315
|
-
default:
|
|
316
|
-
|
|
316
|
+
default: m(() => [
|
|
317
|
+
v(c(U), {
|
|
317
318
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
318
319
|
fullWidth: "",
|
|
319
320
|
variant: "ghost"
|
|
320
321
|
}, {
|
|
321
|
-
default:
|
|
322
|
+
default: m(() => {
|
|
322
323
|
var t;
|
|
323
324
|
return [
|
|
324
325
|
D("span", null, _((t = y.value) == null ? void 0 : t.label), 1),
|
|
325
|
-
|
|
326
|
+
v(c(C), {
|
|
326
327
|
icon: "ChevronDown",
|
|
327
328
|
size: "md"
|
|
328
329
|
})
|
|
@@ -333,7 +334,7 @@ const ve = {
|
|
|
333
334
|
]),
|
|
334
335
|
_: 1
|
|
335
336
|
}, 8, ["modelValue", "options"]),
|
|
336
|
-
B.value.length > 0 ? (g(), x(
|
|
337
|
+
B.value.length > 0 ? (g(), x(c(X), {
|
|
337
338
|
key: 0,
|
|
338
339
|
modelValue: T.value,
|
|
339
340
|
"onUpdate:modelValue": a[1] || (a[1] = (t) => T.value = t),
|
|
@@ -341,17 +342,17 @@ const ve = {
|
|
|
341
342
|
side: "left",
|
|
342
343
|
teleport: ""
|
|
343
344
|
}, {
|
|
344
|
-
default:
|
|
345
|
-
|
|
345
|
+
default: m(() => [
|
|
346
|
+
v(c(U), {
|
|
346
347
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
347
348
|
fullWidth: "",
|
|
348
349
|
variant: "ghost"
|
|
349
350
|
}, {
|
|
350
|
-
default:
|
|
351
|
+
default: m(() => {
|
|
351
352
|
var t;
|
|
352
353
|
return [
|
|
353
354
|
D("span", null, _((t = T.value) == null ? void 0 : t.label), 1),
|
|
354
|
-
|
|
355
|
+
v(c(C), {
|
|
355
356
|
icon: "ChevronDown",
|
|
356
357
|
size: "md"
|
|
357
358
|
})
|
|
@@ -368,36 +369,36 @@ const ve = {
|
|
|
368
369
|
]),
|
|
369
370
|
_: 1
|
|
370
371
|
}),
|
|
371
|
-
|
|
372
|
-
default:
|
|
373
|
-
var t, n, l, r, d,
|
|
372
|
+
v(P, null, {
|
|
373
|
+
default: m(() => {
|
|
374
|
+
var t, n, l, r, d, u, p, h, k;
|
|
374
375
|
return [
|
|
375
376
|
((t = y.value) == null ? void 0 : t.id) === "none" ? (g(), V("div", ve, a[2] || (a[2] = [
|
|
376
377
|
D("span", null, "No Body", -1)
|
|
377
378
|
]))) : ((n = y.value) == null ? void 0 : n.id) === "binaryFile" ? (g(), V("div", fe, [
|
|
378
|
-
(l =
|
|
379
|
-
D("span", pe, _(((r =
|
|
380
|
-
|
|
379
|
+
(l = c(o)) != null && l.body.binary ? (g(), V(ne, { key: 0 }, [
|
|
380
|
+
D("span", pe, _(((r = c(o)) == null ? void 0 : r.body.binary).name), 1),
|
|
381
|
+
v(c(U), {
|
|
381
382
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
|
|
382
383
|
size: "sm",
|
|
383
384
|
variant: "outlined",
|
|
384
385
|
onClick: I
|
|
385
386
|
}, {
|
|
386
|
-
default:
|
|
387
|
+
default: m(() => a[3] || (a[3] = [
|
|
387
388
|
H(" Delete ")
|
|
388
389
|
])),
|
|
389
390
|
_: 1
|
|
390
391
|
})
|
|
391
|
-
], 64)) : (g(), x(
|
|
392
|
+
], 64)) : (g(), x(c(U), {
|
|
392
393
|
key: 1,
|
|
393
394
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
|
|
394
395
|
size: "sm",
|
|
395
396
|
variant: "outlined",
|
|
396
397
|
onClick: ee
|
|
397
398
|
}, {
|
|
398
|
-
default:
|
|
399
|
+
default: m(() => [
|
|
399
400
|
a[4] || (a[4] = D("span", null, "Upload File", -1)),
|
|
400
|
-
|
|
401
|
+
v(c(C), {
|
|
401
402
|
class: "ml-1",
|
|
402
403
|
icon: "UploadSimple",
|
|
403
404
|
size: "xs",
|
|
@@ -419,7 +420,7 @@ const ve = {
|
|
|
419
420
|
onToggleRow: q,
|
|
420
421
|
onUpdateRow: S,
|
|
421
422
|
onUploadFile: z
|
|
422
|
-
}, null, 8, ["items"])) : ((
|
|
423
|
+
}, null, 8, ["items"])) : ((u = y.value) == null ? void 0 : u.id) == "formUrlEncoded" ? (g(), x(G, {
|
|
423
424
|
key: 3,
|
|
424
425
|
ref_key: "tableWrapperRef",
|
|
425
426
|
ref: R,
|
|
@@ -439,14 +440,14 @@ const ve = {
|
|
|
439
440
|
language: Z.value,
|
|
440
441
|
lineNumbers: "",
|
|
441
442
|
lint: "",
|
|
442
|
-
modelValue: ((k = (h = (p =
|
|
443
|
+
modelValue: ((k = (h = (p = c(o)) == null ? void 0 : p.body) == null ? void 0 : h.raw) == null ? void 0 : k.value) ?? "",
|
|
443
444
|
"onUpdate:modelValue": L
|
|
444
445
|
}, null, 8, ["language", "modelValue"]))
|
|
445
446
|
];
|
|
446
447
|
}),
|
|
447
448
|
_: 1
|
|
448
449
|
}),
|
|
449
|
-
|
|
450
|
+
v(P)
|
|
450
451
|
]),
|
|
451
452
|
_: 1
|
|
452
453
|
})
|
|
@@ -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":"AAiNA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAKxC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AA4UF,wBAOG"}
|
|
@@ -1,100 +1,140 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
1
|
+
import { defineComponent as E, computed as f, onMounted as S, ref as A, watch as N, openBlock as y, createBlock as h, withCtx as n, createTextVNode as k, toDisplayString as R, createElementVNode as o, unref as x, createVNode as b, withModifiers as V, createCommentVNode as z, nextTick as _ } from "vue";
|
|
2
|
+
import B from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useActiveEntities as M } from "../../../store/active-entities.js";
|
|
4
4
|
import W from "./RequestTable.vue.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { ScalarTooltip as D, ScalarButton as O } from "@scalar/components";
|
|
6
|
+
import { requestExampleParametersSchema as C } from "@scalar/oas-utils/entities/spec";
|
|
7
|
+
import { useWorkspace as U } from "../../../store/store.js";
|
|
8
|
+
const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, F = { class: "sr-only" }, ee = /* @__PURE__ */ E({
|
|
8
9
|
__name: "RequestParams",
|
|
9
10
|
props: {
|
|
10
11
|
title: {},
|
|
11
12
|
paramKey: {}
|
|
12
13
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
14
|
+
setup(q) {
|
|
15
|
+
const r = q, { activeRequest: u, activeExample: s } = M(), { requestExampleMutators: i } = U(), l = f(
|
|
15
16
|
() => {
|
|
16
17
|
var e;
|
|
17
|
-
return ((e = s.value) == null ? void 0 : e.parameters[
|
|
18
|
+
return ((e = s.value) == null ? void 0 : e.parameters[r.paramKey]) ?? [];
|
|
18
19
|
}
|
|
19
20
|
);
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
S(() => {
|
|
22
|
+
v();
|
|
22
23
|
});
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
const e =
|
|
26
|
-
|
|
24
|
+
const p = () => {
|
|
25
|
+
if (!u.value || !s.value) return;
|
|
26
|
+
const e = C.parse({ enabled: !1 }), t = [...l.value, e];
|
|
27
|
+
i.edit(
|
|
27
28
|
s.value.uid,
|
|
28
|
-
`parameters.${
|
|
29
|
+
`parameters.${r.paramKey}`,
|
|
29
30
|
t
|
|
30
31
|
);
|
|
31
|
-
},
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
const a = [...
|
|
32
|
+
}, m = A(null), w = (e, t, d) => {
|
|
33
|
+
if (!u.value || !s.value) return;
|
|
34
|
+
const c = l.value;
|
|
35
|
+
if (c.length > e) {
|
|
36
|
+
const a = [...c];
|
|
36
37
|
if (!a[e]) return;
|
|
37
|
-
a[e] = { ...a[e], [t]:
|
|
38
|
+
a[e] = { ...a[e], [t]: d }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), i.edit(
|
|
38
39
|
s.value.uid,
|
|
39
|
-
`parameters.${
|
|
40
|
+
`parameters.${r.paramKey}`,
|
|
40
41
|
a
|
|
41
42
|
);
|
|
42
43
|
} else {
|
|
43
|
-
const a = [
|
|
44
|
-
|
|
44
|
+
const a = [C.parse({ [t]: d })];
|
|
45
|
+
i.edit(
|
|
45
46
|
s.value.uid,
|
|
46
|
-
`parameters.${
|
|
47
|
+
`parameters.${r.paramKey}`,
|
|
47
48
|
a
|
|
48
|
-
),
|
|
49
|
-
var
|
|
50
|
-
if (!
|
|
51
|
-
(
|
|
49
|
+
), _(() => {
|
|
50
|
+
var g;
|
|
51
|
+
if (!m.value) return;
|
|
52
|
+
(g = m.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || g.focus();
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
|
-
e ===
|
|
55
|
-
},
|
|
55
|
+
e === c.length - 1 && p();
|
|
56
|
+
}, P = (e, t) => u.value && s.value && i.edit(
|
|
56
57
|
s.value.uid,
|
|
57
|
-
`parameters.${
|
|
58
|
+
`parameters.${r.paramKey}.${e}.enabled`,
|
|
58
59
|
t
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
e
|
|
60
|
+
), K = () => {
|
|
61
|
+
if (!u.value || !s.value) return;
|
|
62
|
+
const e = l.value.filter((t) => t.required);
|
|
63
|
+
i.edit(
|
|
64
|
+
s.value.uid,
|
|
65
|
+
`parameters.${r.paramKey}`,
|
|
66
|
+
e
|
|
67
|
+
), _(() => {
|
|
68
|
+
p();
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
function v() {
|
|
72
|
+
if (l.value.length === 0)
|
|
73
|
+
p();
|
|
74
|
+
else if (l.value.length >= 1) {
|
|
75
|
+
const e = l.value[l.value.length - 1];
|
|
76
|
+
e && e.key !== "" && e.value !== "" && p();
|
|
66
77
|
}
|
|
67
78
|
}
|
|
68
|
-
const
|
|
69
|
-
() =>
|
|
70
|
-
);
|
|
71
|
-
return
|
|
79
|
+
const $ = f(
|
|
80
|
+
() => l.value.filter((e) => e.key || e.value).length
|
|
81
|
+
), T = f(() => l.value.length > 1);
|
|
82
|
+
return N(
|
|
72
83
|
() => s.value,
|
|
73
84
|
(e, t) => {
|
|
74
|
-
e !== t &&
|
|
85
|
+
e !== t && v();
|
|
75
86
|
},
|
|
76
87
|
{ immediate: !0 }
|
|
77
|
-
), (e, t) => (
|
|
88
|
+
), (e, t) => (y(), h(B, {
|
|
78
89
|
class: "group/params",
|
|
79
|
-
itemCount:
|
|
90
|
+
itemCount: $.value
|
|
80
91
|
}, {
|
|
81
|
-
title:
|
|
82
|
-
|
|
92
|
+
title: n(() => [
|
|
93
|
+
k(R(e.title), 1)
|
|
94
|
+
]),
|
|
95
|
+
actions: n(() => [
|
|
96
|
+
o("div", j, [
|
|
97
|
+
T.value ? (y(), h(x(D), {
|
|
98
|
+
key: 0,
|
|
99
|
+
side: "right",
|
|
100
|
+
sideOffset: 12
|
|
101
|
+
}, {
|
|
102
|
+
trigger: n(() => [
|
|
103
|
+
b(x(O), {
|
|
104
|
+
class: "px-1 transition-none",
|
|
105
|
+
size: "sm",
|
|
106
|
+
variant: "ghost",
|
|
107
|
+
onClick: V(K, ["stop"])
|
|
108
|
+
}, {
|
|
109
|
+
default: n(() => [
|
|
110
|
+
t[0] || (t[0] = k(" Clear ")),
|
|
111
|
+
o("span", F, "All " + R(e.title), 1)
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
})
|
|
115
|
+
]),
|
|
116
|
+
content: n(() => t[1] || (t[1] = [
|
|
117
|
+
o("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 z-context p-2 text-xxs leading-5 z-10 text-c-1" }, [
|
|
118
|
+
o("div", { class: "flex items-center text-c-2" }, [
|
|
119
|
+
o("span", null, "Clear optional parameters")
|
|
120
|
+
])
|
|
121
|
+
], -1)
|
|
122
|
+
])),
|
|
123
|
+
_: 1
|
|
124
|
+
})) : z("", !0)
|
|
125
|
+
])
|
|
83
126
|
]),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
])),
|
|
87
|
-
default: m(() => [
|
|
88
|
-
y("div", {
|
|
127
|
+
default: n(() => [
|
|
128
|
+
o("div", {
|
|
89
129
|
ref_key: "tableWrapperRef",
|
|
90
|
-
ref:
|
|
130
|
+
ref: m
|
|
91
131
|
}, [
|
|
92
|
-
|
|
132
|
+
b(W, {
|
|
93
133
|
class: "flex-1",
|
|
94
134
|
columns: ["32px", "", ""],
|
|
95
|
-
items:
|
|
96
|
-
onToggleRow:
|
|
97
|
-
onUpdateRow:
|
|
135
|
+
items: l.value,
|
|
136
|
+
onToggleRow: P,
|
|
137
|
+
onUpdateRow: w
|
|
98
138
|
}, null, 8, ["items"])
|
|
99
139
|
], 512)
|
|
100
140
|
]),
|
|
@@ -103,5 +143,5 @@ const G = /* @__PURE__ */ q({
|
|
|
103
143
|
}
|
|
104
144
|
});
|
|
105
145
|
export {
|
|
106
|
-
|
|
146
|
+
ee as default
|
|
107
147
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4KA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC,CAAC;;
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA4KA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC,CAAC;;AAkQF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4daacc06"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -60,7 +60,7 @@ const M = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
60
60
|
o(p) ? (d(), v("span", L, H((c = o(l)) == null ? void 0 : c.summary), 1)) : (d(), v("input", {
|
|
61
61
|
key: 1,
|
|
62
62
|
id: "requestname",
|
|
63
|
-
class: "text-c-1 rounded pointer-events-auto relative w-full pl-
|
|
63
|
+
class: "text-c-1 rounded pointer-events-auto relative w-full pl-1.25 -ml-0.5 md:-ml-1.25 has-[:focus-visible]:outline h-8 group-hover-input has-[:focus-visible]:outline z-10",
|
|
64
64
|
placeholder: "Request Name",
|
|
65
65
|
value: (n = o(l)) == null ? void 0 : n.summary,
|
|
66
66
|
onInput: B
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":"AAyfA,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC;;;;;cAMqC,MAAM;aAAO,MAAM;;;;;;;cAAnB,MAAM;aAAO,MAAM;;;;AAiwB1D,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./RequestSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const f = /* @__PURE__ */ o(e, [["__scopeId", "data-v-7ea0ef65"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|