@scalar/api-client 2.2.10 → 2.2.12
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/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +19 -18
- package/dist/layouts/App/create-api-client-app.d.ts +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +2 -2
- package/dist/layouts/Web/create-api-client-web.d.ts +1 -1
- package/dist/libs/create-client.d.ts +1 -1
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +64 -51
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +50 -48
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +12 -12
- 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 +40 -36
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +53 -51
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +15 -15
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +44 -44
- 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 +103 -111
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +11 -11
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue"],"names":[],"mappings":"AA8GA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAKjE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAC;;
|
|
1
|
+
{"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue"],"names":[],"mappings":"AA8GA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAKjE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAC;;AA+PF,wBAOG"}
|
|
@@ -24,20 +24,20 @@ const z = { class: "flex h-fit w-full" }, E = { class: "flex-1" }, F = {
|
|
|
24
24
|
description: c
|
|
25
25
|
}));
|
|
26
26
|
}
|
|
27
|
-
),
|
|
27
|
+
), u = x(() => {
|
|
28
28
|
var e;
|
|
29
29
|
return ((e = s.flow) == null ? void 0 : e.selectedScopes) || [];
|
|
30
30
|
});
|
|
31
31
|
function _(e, l) {
|
|
32
32
|
l ? s.updateScheme(`flows.${s.flow.type}.selectedScopes`, [
|
|
33
|
-
...
|
|
33
|
+
...u.value,
|
|
34
34
|
e
|
|
35
35
|
]) : s.updateScheme(
|
|
36
36
|
`flows.${s.flow.type}.selectedScopes`,
|
|
37
|
-
|
|
37
|
+
u.value.filter((c) => c !== e)
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
return (e, l) => (p(), w(t(S), { class: "items-center min-h-8 h-auto" }, {
|
|
40
|
+
return (e, l) => (p(), w(t(S), { class: "items-center min-h-8 h-auto !max-h-[initial]" }, {
|
|
41
41
|
default: n(() => [
|
|
42
42
|
o("div", z, [
|
|
43
43
|
l[0] || (l[0] = o("div", { class: "text-c-1 min-w-[94px] items-center pl-2 h-full" }, [
|
|
@@ -57,9 +57,9 @@ const z = { class: "flex h-fit w-full" }, E = { class: "flex-1" }, F = {
|
|
|
57
57
|
])
|
|
58
58
|
}, {
|
|
59
59
|
default: n(({ open: a }) => {
|
|
60
|
-
var f,
|
|
60
|
+
var f, i, m;
|
|
61
61
|
return [
|
|
62
|
-
o("div", E, " Selected " + d(((
|
|
62
|
+
o("div", E, " Selected " + d(((i = (f = e.flow) == null ? void 0 : f.selectedScopes) == null ? void 0 : i.length) || 0) + " / " + d(Object.keys(((m = e.flow) == null ? void 0 : m.scopes) ?? {}).length || 0), 1),
|
|
63
63
|
r(t(O), {
|
|
64
64
|
class: "text-c-3 group-hover/scopes-accordion:text-c-2",
|
|
65
65
|
icon: a ? "ChevronDown" : "ChevronRight",
|
|
@@ -72,25 +72,25 @@ const z = { class: "flex h-fit w-full" }, E = { class: "flex-1" }, F = {
|
|
|
72
72
|
r(t(N), { as: "template" }, {
|
|
73
73
|
default: n(() => [
|
|
74
74
|
o("table", F, [
|
|
75
|
-
(p(!0), v(b, null, k(g.value, ({ id: a, label: f, description:
|
|
75
|
+
(p(!0), v(b, null, k(g.value, ({ id: a, label: f, description: i }) => (p(), w(t(T), {
|
|
76
76
|
key: a,
|
|
77
77
|
class: "text-c-2",
|
|
78
|
-
onClick: (m) => _(a, !
|
|
78
|
+
onClick: (m) => _(a, !u.value.includes(a))
|
|
79
79
|
}, {
|
|
80
80
|
default: n(() => [
|
|
81
|
-
r(t(S), { class: "w-full px-2 py-1.5 hover:text-c-1 cursor-pointer" }, {
|
|
81
|
+
r(t(S), { class: "w-full px-2 py-1.5 hover:text-c-1 cursor-pointer !max-h-[initial]" }, {
|
|
82
82
|
default: n(() => [
|
|
83
83
|
o("span", null, [
|
|
84
|
-
|
|
84
|
+
i ? (p(), v("span", I, [
|
|
85
85
|
o("span", R, d(f), 1),
|
|
86
|
-
V(" – " + d(
|
|
86
|
+
V(" – " + d(i), 1)
|
|
87
87
|
])) : D("", !0)
|
|
88
88
|
])
|
|
89
89
|
]),
|
|
90
90
|
_: 2
|
|
91
91
|
}, 1024),
|
|
92
92
|
r(t(j), {
|
|
93
|
-
modelValue:
|
|
93
|
+
modelValue: u.value.includes(a),
|
|
94
94
|
"onUpdate:modelValue": () => {
|
|
95
95
|
}
|
|
96
96
|
}, null, 8, ["modelValue"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":"AAolBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AAs4BF,wBAOG"}
|
|
@@ -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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7d610d02"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -2,11 +2,11 @@ import { defineComponent as Z, computed as b, ref as I, watch as W, openBlock as
|
|
|
2
2
|
import oe from "../../../components/CodeInput/CodeInput.vue.js";
|
|
3
3
|
import ne from "../../../components/DataTable/DataTable.vue.js";
|
|
4
4
|
import le from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import E from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
6
|
import re from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
7
|
import { useActiveEntities as ie } from "../../../store/active-entities.js";
|
|
8
|
-
import { ScalarListbox as
|
|
9
|
-
import { requestExampleParametersSchema as
|
|
8
|
+
import { ScalarListbox as J, ScalarButton as R, ScalarIcon as T } from "@scalar/components";
|
|
9
|
+
import { requestExampleParametersSchema as A } from "@scalar/oas-utils/entities/spec";
|
|
10
10
|
import { canMethodHaveBody as ue } from "@scalar/oas-utils/helpers";
|
|
11
11
|
import $ from "./RequestTable.vue.js";
|
|
12
12
|
import { useWorkspace as de } from "../../../store/store.js";
|
|
@@ -42,12 +42,12 @@ const se = {
|
|
|
42
42
|
}).map(([e, a]) => ({
|
|
43
43
|
id: e,
|
|
44
44
|
label: a
|
|
45
|
-
})),
|
|
45
|
+
})), k = b(() => {
|
|
46
46
|
var e, a;
|
|
47
47
|
return o.value ? o.value.body.activeBody === "formData" ? ((e = o.value.body.formData) == null ? void 0 : e.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : o.value.body.activeBody === "binary" ? "binaryFile" : o.value.body.activeBody === "raw" && ((a = o.value.body.raw) != null && a.encoding) ? o.value.body.raw.encoding === "html" ? "other" : o.value.body.raw.encoding : "none" : "none";
|
|
48
48
|
}), v = b({
|
|
49
49
|
get: () => x.find(
|
|
50
|
-
(e) => e.id ===
|
|
50
|
+
(e) => e.id === k.value
|
|
51
51
|
) ?? x[x.length - 1],
|
|
52
52
|
set: (e) => {
|
|
53
53
|
e != null && e.id && q(e.id);
|
|
@@ -70,7 +70,7 @@ const se = {
|
|
|
70
70
|
n
|
|
71
71
|
);
|
|
72
72
|
} else {
|
|
73
|
-
const n = [
|
|
73
|
+
const n = [A.parse({ [a]: t })];
|
|
74
74
|
i.edit(
|
|
75
75
|
o.value.uid,
|
|
76
76
|
"body.formData.value",
|
|
@@ -81,7 +81,7 @@ const se = {
|
|
|
81
81
|
(y = B.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || y.focus();
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
e === l.length - 1 &&
|
|
84
|
+
e === l.length - 1 && N();
|
|
85
85
|
}, f = b(
|
|
86
86
|
() => {
|
|
87
87
|
var e, a, t;
|
|
@@ -89,10 +89,10 @@ const se = {
|
|
|
89
89
|
}
|
|
90
90
|
), C = () => {
|
|
91
91
|
const e = f.value[f.value.length - 1];
|
|
92
|
-
(!e || e.key !== "" || e.value !== "") &&
|
|
93
|
-
},
|
|
92
|
+
(!e || e.key !== "" || e.value !== "") && N();
|
|
93
|
+
}, N = () => {
|
|
94
94
|
if (!c.value || !o.value) return;
|
|
95
|
-
const e =
|
|
95
|
+
const e = A.parse({
|
|
96
96
|
enabled: !1
|
|
97
97
|
}), a = [...f.value, e];
|
|
98
98
|
o.value.body.formData ? i.edit(
|
|
@@ -103,7 +103,7 @@ const se = {
|
|
|
103
103
|
value: a,
|
|
104
104
|
encoding: "form-data"
|
|
105
105
|
});
|
|
106
|
-
},
|
|
106
|
+
}, S = (e, a) => {
|
|
107
107
|
if (!c.value || !o.value) return;
|
|
108
108
|
const t = f.value;
|
|
109
109
|
if (t.length > e) {
|
|
@@ -114,9 +114,9 @@ const se = {
|
|
|
114
114
|
l
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
},
|
|
117
|
+
}, j = (e) => {
|
|
118
118
|
!c.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
|
|
119
|
-
},
|
|
119
|
+
}, O = (e) => e === "multipartForm" ? {
|
|
120
120
|
activeBody: "formData",
|
|
121
121
|
encoding: "form-data",
|
|
122
122
|
header: "multipart/form-data"
|
|
@@ -151,7 +151,7 @@ const se = {
|
|
|
151
151
|
} : { activeBody: "raw", encoding: void 0, header: void 0 }, q = (e) => {
|
|
152
152
|
var m, y;
|
|
153
153
|
if (!o.value) return;
|
|
154
|
-
const { activeBody: a, encoding: t, header: l } =
|
|
154
|
+
const { activeBody: a, encoding: t, header: l } = O(e);
|
|
155
155
|
if (i.edit(
|
|
156
156
|
o.value.uid,
|
|
157
157
|
"body.activeBody",
|
|
@@ -246,15 +246,15 @@ const se = {
|
|
|
246
246
|
},
|
|
247
247
|
() => {
|
|
248
248
|
var e;
|
|
249
|
-
(e = c.value) != null && e.method && ue(c.value.method) && q(
|
|
250
|
-
|
|
249
|
+
(e = c.value) != null && e.method && ue(c.value.method) && q(k.value), ["multipartForm", "formUrlEncoded"].includes(
|
|
250
|
+
k.value
|
|
251
251
|
) && C();
|
|
252
252
|
},
|
|
253
253
|
{ immediate: !0 }
|
|
254
254
|
);
|
|
255
255
|
const g = b(() => {
|
|
256
256
|
var n, r, m;
|
|
257
|
-
const e = v.value.id, { header: a } =
|
|
257
|
+
const e = v.value.id, { header: a } = O(e), t = ((r = (n = c.value) == null ? void 0 : n.requestBody) == null ? void 0 : r.content) || {}, l = a ? ((m = t[a]) == null ? void 0 : m.examples) || {} : {};
|
|
258
258
|
return Object.entries(l).map(([y, D]) => ({
|
|
259
259
|
id: y,
|
|
260
260
|
label: y,
|
|
@@ -262,9 +262,12 @@ const se = {
|
|
|
262
262
|
}));
|
|
263
263
|
}), _ = b({
|
|
264
264
|
get: () => {
|
|
265
|
-
var
|
|
266
|
-
const e = ((
|
|
267
|
-
return g.value.find((
|
|
265
|
+
var l, n;
|
|
266
|
+
const e = ((n = (l = o.value) == null ? void 0 : l.body.raw) == null ? void 0 : n.value) ?? "{}", a = JSON.parse(e);
|
|
267
|
+
return g.value.find((r) => {
|
|
268
|
+
const m = r.value;
|
|
269
|
+
return JSON.stringify(m.value) === JSON.stringify(a);
|
|
270
|
+
}) ?? g.value[0];
|
|
268
271
|
},
|
|
269
272
|
set: (e) => {
|
|
270
273
|
if (e != null && e.id) {
|
|
@@ -273,7 +276,7 @@ const se = {
|
|
|
273
276
|
);
|
|
274
277
|
if (a) {
|
|
275
278
|
const t = a.value;
|
|
276
|
-
|
|
279
|
+
j(JSON.stringify(t.value, null, 2));
|
|
277
280
|
}
|
|
278
281
|
}
|
|
279
282
|
}
|
|
@@ -285,18 +288,18 @@ const se = {
|
|
|
285
288
|
default: d(() => [
|
|
286
289
|
s(ne, { columns: [""] }, {
|
|
287
290
|
default: d(() => [
|
|
288
|
-
s(
|
|
291
|
+
s(E, null, {
|
|
289
292
|
default: d(() => [
|
|
290
293
|
s(le, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
|
|
291
294
|
default: d(() => [
|
|
292
|
-
s(u(
|
|
295
|
+
s(u(J), {
|
|
293
296
|
modelValue: v.value,
|
|
294
297
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
|
|
295
298
|
options: u(x),
|
|
296
299
|
teleport: ""
|
|
297
300
|
}, {
|
|
298
301
|
default: d(() => [
|
|
299
|
-
s(u(
|
|
302
|
+
s(u(R), {
|
|
300
303
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
301
304
|
fullWidth: "",
|
|
302
305
|
variant: "ghost"
|
|
@@ -305,7 +308,7 @@ const se = {
|
|
|
305
308
|
var t;
|
|
306
309
|
return [
|
|
307
310
|
w("span", null, F((t = v.value) == null ? void 0 : t.label), 1),
|
|
308
|
-
s(u(
|
|
311
|
+
s(u(T), {
|
|
309
312
|
icon: "ChevronDown",
|
|
310
313
|
size: "md"
|
|
311
314
|
})
|
|
@@ -316,7 +319,7 @@ const se = {
|
|
|
316
319
|
]),
|
|
317
320
|
_: 1
|
|
318
321
|
}, 8, ["modelValue", "options"]),
|
|
319
|
-
g.value.length > 0 ? (p(), h(u(
|
|
322
|
+
g.value.length > 0 ? (p(), h(u(J), {
|
|
320
323
|
key: 0,
|
|
321
324
|
modelValue: _.value,
|
|
322
325
|
"onUpdate:modelValue": a[1] || (a[1] = (t) => _.value = t),
|
|
@@ -325,7 +328,7 @@ const se = {
|
|
|
325
328
|
teleport: ""
|
|
326
329
|
}, {
|
|
327
330
|
default: d(() => [
|
|
328
|
-
s(u(
|
|
331
|
+
s(u(R), {
|
|
329
332
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
330
333
|
fullWidth: "",
|
|
331
334
|
variant: "ghost"
|
|
@@ -334,7 +337,7 @@ const se = {
|
|
|
334
337
|
var t;
|
|
335
338
|
return [
|
|
336
339
|
w("span", null, F((t = _.value) == null ? void 0 : t.label), 1),
|
|
337
|
-
s(u(
|
|
340
|
+
s(u(T), {
|
|
338
341
|
icon: "ChevronDown",
|
|
339
342
|
size: "md"
|
|
340
343
|
})
|
|
@@ -351,7 +354,7 @@ const se = {
|
|
|
351
354
|
]),
|
|
352
355
|
_: 1
|
|
353
356
|
}),
|
|
354
|
-
s(
|
|
357
|
+
s(E, null, {
|
|
355
358
|
default: d(() => {
|
|
356
359
|
var t, l, n, r, m;
|
|
357
360
|
return [
|
|
@@ -360,7 +363,7 @@ const se = {
|
|
|
360
363
|
]))) : v.value.id === "binaryFile" ? (p(), U("div", ce, [
|
|
361
364
|
(t = u(o)) != null && t.body.binary ? (p(), U(ae, { key: 0 }, [
|
|
362
365
|
w("span", me, F(((l = u(o)) == null ? void 0 : l.body.binary).name), 1),
|
|
363
|
-
s(u(
|
|
366
|
+
s(u(R), {
|
|
364
367
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
|
|
365
368
|
size: "sm",
|
|
366
369
|
variant: "outlined",
|
|
@@ -371,7 +374,7 @@ const se = {
|
|
|
371
374
|
])),
|
|
372
375
|
_: 1
|
|
373
376
|
})
|
|
374
|
-
], 64)) : (p(), h(u(
|
|
377
|
+
], 64)) : (p(), h(u(R), {
|
|
375
378
|
key: 1,
|
|
376
379
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
|
|
377
380
|
size: "sm",
|
|
@@ -380,7 +383,7 @@ const se = {
|
|
|
380
383
|
}, {
|
|
381
384
|
default: d(() => [
|
|
382
385
|
a[4] || (a[4] = w("span", null, "Upload File", -1)),
|
|
383
|
-
s(u(
|
|
386
|
+
s(u(T), {
|
|
384
387
|
class: "ml-1",
|
|
385
388
|
icon: "UploadSimple",
|
|
386
389
|
size: "xs",
|
|
@@ -399,7 +402,7 @@ const se = {
|
|
|
399
402
|
showUploadButton: "",
|
|
400
403
|
onDeleteRow: V,
|
|
401
404
|
onRemoveFile: M,
|
|
402
|
-
onToggleRow:
|
|
405
|
+
onToggleRow: S,
|
|
403
406
|
onUpdateRow: P,
|
|
404
407
|
onUploadFile: L
|
|
405
408
|
}, null, 8, ["items"])) : v.value.id == "formUrlEncoded" ? (p(), h($, {
|
|
@@ -412,23 +415,24 @@ const se = {
|
|
|
412
415
|
showUploadButton: "",
|
|
413
416
|
onDeleteRow: V,
|
|
414
417
|
onRemoveFile: M,
|
|
415
|
-
onToggleRow:
|
|
418
|
+
onToggleRow: S,
|
|
416
419
|
onUpdateRow: P,
|
|
417
420
|
onUploadFile: L
|
|
418
421
|
}, null, 8, ["items"])) : (p(), h(oe, {
|
|
419
422
|
key: 4,
|
|
423
|
+
class: "border-t-1/2",
|
|
420
424
|
content: "",
|
|
421
425
|
language: Y.value,
|
|
422
426
|
lineNumbers: "",
|
|
423
427
|
lint: "",
|
|
424
428
|
modelValue: ((m = (r = (n = u(o)) == null ? void 0 : n.body) == null ? void 0 : r.raw) == null ? void 0 : m.value) ?? "",
|
|
425
|
-
"onUpdate:modelValue":
|
|
429
|
+
"onUpdate:modelValue": j
|
|
426
430
|
}, null, 8, ["language", "modelValue"]))
|
|
427
431
|
];
|
|
428
432
|
}),
|
|
429
433
|
_: 1
|
|
430
434
|
}),
|
|
431
|
-
s(
|
|
435
|
+
s(E)
|
|
432
436
|
]),
|
|
433
437
|
_: 1
|
|
434
438
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AA8IA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AAyMF,wBAOG"}
|
|
@@ -1,96 +1,98 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import
|
|
5
|
-
import { REGEX as
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
const
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "text-c-3 px-4 text-sm border rounded min-h-12 justify-center flex items-center bg-b-1 mx-1"
|
|
10
|
-
}, O = /* @__PURE__ */ _({
|
|
1
|
+
import { defineComponent as P, computed as _, watch as y, openBlock as g, createBlock as R, withCtx as $, createTextVNode as b, toDisplayString as q, createCommentVNode as w } from "vue";
|
|
2
|
+
import V from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useActiveEntities as M } from "../../../store/active-entities.js";
|
|
4
|
+
import U from "./RequestTable.vue.js";
|
|
5
|
+
import { REGEX as N } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import { useWorkspace as T } from "../../../store/store.js";
|
|
7
|
+
const S = /* @__PURE__ */ P({
|
|
11
8
|
__name: "RequestPathParams",
|
|
12
9
|
props: {
|
|
13
10
|
title: {},
|
|
14
11
|
paramKey: {}
|
|
15
12
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const o =
|
|
13
|
+
setup(E) {
|
|
14
|
+
const o = E, { activeRequest: s, activeExample: n, activeServer: d } = M(), { requestMutators: f, requestExampleMutators: v } = T(), p = _(() => {
|
|
18
15
|
const e = n.value;
|
|
19
|
-
return e ? e.parameters[o.paramKey].map((
|
|
16
|
+
return e ? e.parameters[o.paramKey].map((t) => {
|
|
20
17
|
var r;
|
|
21
18
|
return {
|
|
22
|
-
...
|
|
23
|
-
enum:
|
|
19
|
+
...t,
|
|
20
|
+
enum: t.enum || ((r = e.serverVariables) == null ? void 0 : r[t.key])
|
|
24
21
|
};
|
|
25
22
|
}) : [];
|
|
26
|
-
}),
|
|
27
|
-
var
|
|
23
|
+
}), K = (e, t, r) => {
|
|
24
|
+
var l, a;
|
|
28
25
|
if (!s.value || !n.value) return;
|
|
29
|
-
const i = n.value.parameters[o.paramKey],
|
|
30
|
-
if (
|
|
31
|
-
if ((
|
|
26
|
+
const i = n.value.parameters[o.paramKey], u = (l = i[e]) == null ? void 0 : l.key;
|
|
27
|
+
if (t === "key") {
|
|
28
|
+
if ((a = i[e]) != null && a.required)
|
|
32
29
|
return;
|
|
33
30
|
if (r) {
|
|
34
|
-
const c = encodeURIComponent(
|
|
35
|
-
|
|
31
|
+
const c = encodeURIComponent(u), m = encodeURIComponent(r), x = new RegExp(`(?<=/):${c}(?=[/?#]|$)`, "g"), C = s.value.path.replace(
|
|
32
|
+
x,
|
|
36
33
|
`:${m}`
|
|
37
34
|
);
|
|
38
|
-
|
|
35
|
+
f.edit(s.value.uid, "path", C);
|
|
39
36
|
} else {
|
|
40
37
|
i.splice(e, 1);
|
|
41
|
-
const c = new RegExp(`/:${encodeURIComponent(
|
|
42
|
-
|
|
38
|
+
const c = new RegExp(`/:${encodeURIComponent(u)}(?=[/?#]|$)`, "g"), m = s.value.path.replace(c, "");
|
|
39
|
+
f.edit(s.value.uid, "path", m);
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
|
-
|
|
42
|
+
v.edit(
|
|
46
43
|
n.value.uid,
|
|
47
|
-
`parameters.${o.paramKey}.${e}.${
|
|
44
|
+
`parameters.${o.paramKey}.${e}.${t}`,
|
|
48
45
|
r
|
|
49
46
|
);
|
|
50
|
-
},
|
|
51
|
-
var
|
|
47
|
+
}, k = (e) => {
|
|
48
|
+
var l;
|
|
52
49
|
if (!n.value) return;
|
|
53
|
-
const
|
|
54
|
-
(
|
|
50
|
+
const t = ((l = e.match(N.PATH)) == null ? void 0 : l.map((a) => a.slice(1, -1))) || [], r = n.value.parameters[o.paramKey], i = new Map(r.map((a) => [a.key, a])), u = t.map(
|
|
51
|
+
(a) => i.get(a) || { key: a, value: "", enabled: !0 }
|
|
55
52
|
);
|
|
56
|
-
r.forEach((
|
|
57
|
-
!
|
|
58
|
-
}), r.splice(0, r.length, ...
|
|
53
|
+
r.forEach((a) => {
|
|
54
|
+
!t.includes(a.key) && (a.value || a.required) && u.push(a);
|
|
55
|
+
}), r.splice(0, r.length, ...u), t.length === 0 && r.splice(0, r.length), v.edit(
|
|
59
56
|
n.value.uid,
|
|
60
57
|
`parameters.${o.paramKey}`,
|
|
61
58
|
r
|
|
62
59
|
);
|
|
60
|
+
}, h = (e) => {
|
|
61
|
+
e && k(e);
|
|
63
62
|
};
|
|
64
|
-
return
|
|
63
|
+
return y(
|
|
64
|
+
() => s.value,
|
|
65
|
+
(e) => {
|
|
66
|
+
var t;
|
|
67
|
+
e && h((t = d.value) == null ? void 0 : t.url);
|
|
68
|
+
}
|
|
69
|
+
), y(
|
|
65
70
|
() => {
|
|
66
71
|
var e;
|
|
67
|
-
return (e =
|
|
72
|
+
return (e = d.value) == null ? void 0 : e.url;
|
|
68
73
|
},
|
|
69
|
-
(e) => {
|
|
70
|
-
e &&
|
|
74
|
+
(e, t) => {
|
|
75
|
+
e !== t && h(e);
|
|
71
76
|
}
|
|
72
|
-
), (e,
|
|
73
|
-
itemCount:
|
|
77
|
+
), (e, t) => (g(), R(V, {
|
|
78
|
+
itemCount: p.value.length
|
|
74
79
|
}, {
|
|
75
|
-
title:
|
|
76
|
-
|
|
80
|
+
title: $(() => [
|
|
81
|
+
b(q(e.title), 1)
|
|
77
82
|
]),
|
|
78
|
-
default:
|
|
79
|
-
|
|
83
|
+
default: $(() => [
|
|
84
|
+
p.value.length ? (g(), R(U, {
|
|
80
85
|
key: 0,
|
|
81
86
|
class: "flex-1",
|
|
82
87
|
isEnabledHidden: "",
|
|
83
|
-
items:
|
|
84
|
-
onUpdateRow:
|
|
85
|
-
}, null, 8, ["items"])) : (
|
|
86
|
-
x(" You can use variables in your path: "),
|
|
87
|
-
P("code", { class: "bg-b-2 ml-1 px-1 rounded" }, "/endpoint/{my_path_variable}", -1)
|
|
88
|
-
])))
|
|
88
|
+
items: p.value,
|
|
89
|
+
onUpdateRow: K
|
|
90
|
+
}, null, 8, ["items"])) : w("", !0)
|
|
89
91
|
]),
|
|
90
92
|
_: 1
|
|
91
93
|
}, 8, ["itemCount"]));
|
|
92
94
|
}
|
|
93
95
|
});
|
|
94
96
|
export {
|
|
95
|
-
|
|
97
|
+
S as default
|
|
96
98
|
};
|
|
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-317bb675"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -3,24 +3,24 @@ import H from "../../../components/ContextBar.vue.js";
|
|
|
3
3
|
import N from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
4
4
|
import { useActiveEntities as E } from "../../../store/active-entities.js";
|
|
5
5
|
import K from "./RequestBody.vue.js";
|
|
6
|
-
import
|
|
6
|
+
import f from "./RequestParams.vue.js";
|
|
7
7
|
import U from "./RequestPathParams.vue.js";
|
|
8
|
-
import { canMethodHaveBody as
|
|
8
|
+
import { canMethodHaveBody as h } from "@scalar/oas-utils/helpers";
|
|
9
9
|
import Q from "./RequestAuth/RequestAuth.vue.js";
|
|
10
10
|
import { useWorkspace as $ } from "../../../store/store.js";
|
|
11
11
|
const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none group" }, M = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
|
|
14
14
|
for: "requestname"
|
|
15
|
-
},
|
|
15
|
+
}, z = ["value"], I = {
|
|
16
16
|
key: 2,
|
|
17
17
|
class: "flex items-center text-c-1 h-8"
|
|
18
|
-
},
|
|
18
|
+
}, L = { class: "request-section-content custom-scroll flex flex-1 flex-col px-3 xl:px-4 py-2.5" }, ee = /* @__PURE__ */ B({
|
|
19
19
|
__name: "RequestSection",
|
|
20
20
|
props: {
|
|
21
21
|
selectedSecuritySchemeUids: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
23
|
+
setup(O) {
|
|
24
24
|
const { activeRequest: l, activeExample: y } = E(), { isReadOnly: p, requestMutators: g } = $(), k = S(() => {
|
|
25
25
|
var a, u;
|
|
26
26
|
const t = /* @__PURE__ */ new Set([
|
|
@@ -32,7 +32,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
32
32
|
"Headers",
|
|
33
33
|
"Body"
|
|
34
34
|
]);
|
|
35
|
-
return (a = y.value) != null && a.parameters.path.length || t.delete("Variables"),
|
|
35
|
+
return (a = y.value) != null && a.parameters.path.length || t.delete("Variables"), h(((u = l.value) == null ? void 0 : u.method) ?? "get") || t.delete("Body"), _.value && t.delete("Auth"), [...t];
|
|
36
36
|
}), _ = S(
|
|
37
37
|
() => {
|
|
38
38
|
var t, a;
|
|
@@ -40,7 +40,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
40
40
|
}
|
|
41
41
|
), e = b("All");
|
|
42
42
|
V(l, (t) => {
|
|
43
|
-
e.value === "Body" && t && !
|
|
43
|
+
e.value === "Body" && t && !h(t.method) && (e.value = "All");
|
|
44
44
|
});
|
|
45
45
|
const q = (t) => {
|
|
46
46
|
if (!l.value) return;
|
|
@@ -57,14 +57,14 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
57
57
|
return [
|
|
58
58
|
A("div", D, [
|
|
59
59
|
o(p) ? C("", !0) : (d(), v("label", M)),
|
|
60
|
-
o(p) ? (d(), v("span",
|
|
60
|
+
o(p) ? (d(), v("span", I, R((c = o(l)) == null ? void 0 : c.summary), 1)) : (d(), v("input", {
|
|
61
61
|
key: 1,
|
|
62
62
|
id: "requestname",
|
|
63
63
|
class: "text-c-1 rounded pointer-events-auto relative w-full pl-2 -ml-0.5 md:-ml-1 xl:-ml-2 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: q
|
|
67
|
-
}, null, 40,
|
|
67
|
+
}, null, 40, z))
|
|
68
68
|
]),
|
|
69
69
|
s(H, {
|
|
70
70
|
activeSection: e.value,
|
|
@@ -76,7 +76,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
76
76
|
default: x(() => {
|
|
77
77
|
var n, c, m;
|
|
78
78
|
return [
|
|
79
|
-
A("div",
|
|
79
|
+
A("div", L, [
|
|
80
80
|
i(s(Q, {
|
|
81
81
|
selectedSecuritySchemeUids: t.selectedSecuritySchemeUids,
|
|
82
82
|
title: "Authentication"
|
|
@@ -88,26 +88,26 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
88
88
|
]),
|
|
89
89
|
i(s(U, {
|
|
90
90
|
paramKey: "path",
|
|
91
|
-
title: "
|
|
91
|
+
title: "Variables"
|
|
92
92
|
}, null, 512), [
|
|
93
93
|
[
|
|
94
94
|
r,
|
|
95
95
|
(e.value === "All" || e.value === "Variables") && ((m = (c = (n = o(y)) == null ? void 0 : n.parameters) == null ? void 0 : c.path) == null ? void 0 : m.length)
|
|
96
96
|
]
|
|
97
97
|
]),
|
|
98
|
-
i(s(
|
|
98
|
+
i(s(f, {
|
|
99
99
|
paramKey: "cookies",
|
|
100
100
|
title: "Cookies"
|
|
101
101
|
}, null, 512), [
|
|
102
102
|
[r, e.value === "All" || e.value === "Cookies"]
|
|
103
103
|
]),
|
|
104
|
-
i(s(
|
|
104
|
+
i(s(f, {
|
|
105
105
|
paramKey: "headers",
|
|
106
106
|
title: "Headers"
|
|
107
107
|
}, null, 512), [
|
|
108
108
|
[r, e.value === "All" || e.value === "Headers"]
|
|
109
109
|
]),
|
|
110
|
-
i(s(
|
|
110
|
+
i(s(f, {
|
|
111
111
|
paramKey: "query",
|
|
112
112
|
title: "Query Parameters"
|
|
113
113
|
}, null, 512), [
|
|
@@ -116,7 +116,7 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
116
116
|
i(s(K, { title: "Body" }, null, 512), [
|
|
117
117
|
[
|
|
118
118
|
r,
|
|
119
|
-
o(l) && (e.value === "All" || e.value === "Body") && o(
|
|
119
|
+
o(l) && (e.value === "All" || e.value === "Body") && o(h)(o(l).method)
|
|
120
120
|
]
|
|
121
121
|
])
|
|
122
122
|
])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSidebar.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-2eb44014"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|