@scalar/api-client 2.2.0 → 2.2.2
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 +35 -0
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
- package/dist/components/SideNav/SideNav.vue.js +4 -4
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +165 -5
- package/dist/components/TopNav/TopNav.vue2.js +2 -165
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +2 -2
- package/dist/components/TopNav/TopNavItem.vue2.js +5 -5
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +2 -2
- package/dist/layouts/App/ApiClientApp.vue.d.ts +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +39 -36
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/style.css +1 -1
- package/dist/tailwind/desktop-variants.d.ts +18 -0
- package/dist/tailwind/desktop-variants.d.ts.map +1 -0
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +8 -8
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +33 -34
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +30 -30
- 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 +6 -6
- 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 +42 -44
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +25 -21
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +7 -7
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +7 -7
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +23 -23
- package/package.json +9 -9
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Variants
|
|
3
|
+
*/
|
|
4
|
+
export declare const platformVariants: readonly ["mac", "windows", "linux"];
|
|
5
|
+
/**
|
|
6
|
+
* Add support for `desktop` and platform modifiers
|
|
7
|
+
*
|
|
8
|
+
* @example <div class="desktop:rounded-lg">...</div>
|
|
9
|
+
* @example <div class="mac:hidden">...</div>
|
|
10
|
+
*
|
|
11
|
+
* Modified from `@todesktop/tailwind-variants`
|
|
12
|
+
* @see https://github.com/todesktop/tailwind-variants
|
|
13
|
+
*/
|
|
14
|
+
export declare const desktopVariants: {
|
|
15
|
+
handler: import("tailwindcss/types/config").PluginCreator;
|
|
16
|
+
config?: Partial<import("tailwindcss/types/config").Config>;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=desktop-variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"desktop-variants.d.ts","sourceRoot":"","sources":["../../src/tailwind/desktop-variants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,gBAAgB,sCAAuC,CAAA;AAEpE;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;;CAU1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAmQ8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;
|
|
1
|
+
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAmQ8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA0XjD,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Request.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-76d1e7a7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -37,13 +37,13 @@ const He = /* @__PURE__ */ K({
|
|
|
37
37
|
serverMutators: W,
|
|
38
38
|
servers: j,
|
|
39
39
|
events: p
|
|
40
|
-
} = T, u = R(!l), E = R(), e = R(), h = R(""),
|
|
40
|
+
} = T, u = R(!l), E = R(), e = R(), h = R(""), z = pe(), D = B(
|
|
41
41
|
() => k.findLast((o) => {
|
|
42
42
|
var t;
|
|
43
43
|
return o.request.uid === ((t = v.value) == null ? void 0 : t.uid);
|
|
44
44
|
})
|
|
45
|
-
), { mediaQueries:
|
|
46
|
-
P(
|
|
45
|
+
), { mediaQueries: F } = de();
|
|
46
|
+
P(F.md, (o) => u.value = o);
|
|
47
47
|
const U = B(
|
|
48
48
|
() => {
|
|
49
49
|
var o, t;
|
|
@@ -73,12 +73,12 @@ const He = /* @__PURE__ */ K({
|
|
|
73
73
|
E.value = m.controller;
|
|
74
74
|
const [c, f] = await m.sendRequest();
|
|
75
75
|
c ? w(c.message, "error") : k.push(f);
|
|
76
|
-
},
|
|
76
|
+
}, Q = async () => {
|
|
77
77
|
var o;
|
|
78
78
|
return (o = E.value) == null ? void 0 : o.abort(Se.REQUEST_ABORTED);
|
|
79
79
|
};
|
|
80
80
|
X(() => {
|
|
81
|
-
p.executeRequest.on(C), p.cancelRequest.on(
|
|
81
|
+
p.executeRequest.on(C), p.cancelRequest.on(Q);
|
|
82
82
|
}), me(), Y(() => p.executeRequest.off(C));
|
|
83
83
|
function J({ requestName: o }) {
|
|
84
84
|
var r, i, m, c;
|
|
@@ -106,7 +106,7 @@ const He = /* @__PURE__ */ K({
|
|
|
106
106
|
},
|
|
107
107
|
a.value.collections[0]
|
|
108
108
|
);
|
|
109
|
-
t &&
|
|
109
|
+
t && z.push(
|
|
110
110
|
`/workspace/${a.value.uid}/request/${t.uid}`
|
|
111
111
|
), n.hide();
|
|
112
112
|
}
|
|
@@ -115,7 +115,7 @@ const He = /* @__PURE__ */ K({
|
|
|
115
115
|
}
|
|
116
116
|
return (o, t) => (b(), Z(_, null, [
|
|
117
117
|
ee("div", {
|
|
118
|
-
class: N(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative overflow-hidden", {
|
|
118
|
+
class: N(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative z-0 overflow-hidden", {
|
|
119
119
|
"!mr-0 !mb-0 !border-0": s(l)
|
|
120
120
|
}])
|
|
121
121
|
}, [
|
|
@@ -143,7 +143,7 @@ const He = /* @__PURE__ */ K({
|
|
|
143
143
|
return [
|
|
144
144
|
d(le, { selectedSecuritySchemeUids: U.value }, null, 8, ["selectedSecuritySchemeUids"]),
|
|
145
145
|
d(ie, {
|
|
146
|
-
response: (r =
|
|
146
|
+
response: (r = D.value) == null ? void 0 : r.response
|
|
147
147
|
}, null, 8, ["response"])
|
|
148
148
|
];
|
|
149
149
|
}),
|
|
@@ -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":"AAyhBA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AAuzBF,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
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-68fbfb14"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as G, computed as w, ref as K, watch as S, openBlock as f, createBlock as b, withCtx as u, createTextVNode as q, toDisplayString as
|
|
1
|
+
import { defineComponent as G, computed as w, ref as K, watch as S, openBlock as f, createBlock as b, withCtx as u, createTextVNode as q, toDisplayString as D, createVNode as s, unref as c, createElementVNode as x, createElementBlock as F, Fragment as Q, nextTick as Z } from "vue";
|
|
2
2
|
import I from "../../../components/CodeInput/CodeInput.vue.js";
|
|
3
3
|
import ee from "../../../components/DataTable/DataTable.vue.js";
|
|
4
4
|
import ae from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import R from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
6
|
import te from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
7
|
import { useActiveEntities as oe } from "../../../store/active-entities.js";
|
|
8
|
-
import { ScalarListbox as ne, ScalarButton as
|
|
8
|
+
import { ScalarListbox as ne, ScalarButton as k, ScalarIcon as L } from "@scalar/components";
|
|
9
9
|
import { requestExampleParametersSchema as M } from "@scalar/oas-utils/entities/spec";
|
|
10
10
|
import { canMethodHaveBody as le } from "@scalar/oas-utils/helpers";
|
|
11
|
-
import
|
|
11
|
+
import W from "./RequestTable.vue.js";
|
|
12
12
|
import { useWorkspace as re } from "../../../store/store.js";
|
|
13
|
-
import { useFileDialog as
|
|
13
|
+
import { useFileDialog as z } from "../../../hooks/useFileDialog.js";
|
|
14
14
|
const ie = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
|
|
@@ -23,7 +23,7 @@ const ie = {
|
|
|
23
23
|
title: {}
|
|
24
24
|
},
|
|
25
25
|
setup(se) {
|
|
26
|
-
const { activeRequest: d, activeExample: a } = oe(), { requestExampleMutators: r } = re(),
|
|
26
|
+
const { activeRequest: d, activeExample: a } = oe(), { requestExampleMutators: r } = re(), A = {
|
|
27
27
|
json: "json",
|
|
28
28
|
xml: "xml",
|
|
29
29
|
yaml: "yaml",
|
|
@@ -54,12 +54,12 @@ const ie = {
|
|
|
54
54
|
}
|
|
55
55
|
}), g = K(null), O = w(() => {
|
|
56
56
|
const e = m.value.id;
|
|
57
|
-
return
|
|
57
|
+
return A[e] ?? "plaintext";
|
|
58
58
|
});
|
|
59
|
-
function
|
|
59
|
+
function _() {
|
|
60
60
|
console.log("deleteRow");
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const U = (e, t, o) => {
|
|
63
63
|
if (!d.value || !a.value) return;
|
|
64
64
|
const l = v.value;
|
|
65
65
|
if (l.length > e) {
|
|
@@ -81,12 +81,13 @@ const ie = {
|
|
|
81
81
|
(y = g.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || y.focus();
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
+
e === l.length - 1 && E();
|
|
84
85
|
}, v = w(
|
|
85
86
|
() => {
|
|
86
87
|
var e, t, o;
|
|
87
88
|
return ((o = (t = (e = a.value) == null ? void 0 : e.body) == null ? void 0 : t.formData) == null ? void 0 : o.value) ?? [];
|
|
88
89
|
}
|
|
89
|
-
),
|
|
90
|
+
), T = () => v.value.length === 0 && E(), E = () => {
|
|
90
91
|
if (!d.value || !a.value) return;
|
|
91
92
|
const e = M.parse({
|
|
92
93
|
enabled: !1
|
|
@@ -179,7 +180,7 @@ const ie = {
|
|
|
179
180
|
n
|
|
180
181
|
);
|
|
181
182
|
}, j = async (e) => {
|
|
182
|
-
const { open: t } =
|
|
183
|
+
const { open: t } = z({
|
|
183
184
|
onChange: async (o) => {
|
|
184
185
|
const l = o == null ? void 0 : o[0];
|
|
185
186
|
if (l && d.value && a.value) {
|
|
@@ -215,7 +216,7 @@ const ie = {
|
|
|
215
216
|
);
|
|
216
217
|
}
|
|
217
218
|
function X() {
|
|
218
|
-
const { open: e } =
|
|
219
|
+
const { open: e } = z({
|
|
219
220
|
onChange: async (t) => {
|
|
220
221
|
const o = t == null ? void 0 : t[0];
|
|
221
222
|
o && d.value && a.value && r.edit(
|
|
@@ -232,7 +233,7 @@ const ie = {
|
|
|
232
233
|
return S(
|
|
233
234
|
m,
|
|
234
235
|
(e) => {
|
|
235
|
-
["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) &&
|
|
236
|
+
["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) && T();
|
|
236
237
|
},
|
|
237
238
|
{ immediate: !0 }
|
|
238
239
|
), S(
|
|
@@ -244,17 +245,17 @@ const ie = {
|
|
|
244
245
|
var e;
|
|
245
246
|
(e = d.value) != null && e.method && le(d.value.method) && C(B.value), ["multipartForm", "formUrlEncoded"].includes(
|
|
246
247
|
B.value
|
|
247
|
-
) &&
|
|
248
|
+
) && T();
|
|
248
249
|
},
|
|
249
250
|
{ immediate: !0 }
|
|
250
251
|
), (e, t) => (f(), b(te, null, {
|
|
251
252
|
title: u(() => [
|
|
252
|
-
q(
|
|
253
|
+
q(D(e.title), 1)
|
|
253
254
|
]),
|
|
254
255
|
default: u(() => [
|
|
255
256
|
s(ee, { columns: [""] }, {
|
|
256
257
|
default: u(() => [
|
|
257
|
-
s(
|
|
258
|
+
s(R, null, {
|
|
258
259
|
default: u(() => [
|
|
259
260
|
s(ae, { class: "relative col-span-full flex h-8 cursor-pointer items-center !p-0" }, {
|
|
260
261
|
default: u(() => [
|
|
@@ -266,7 +267,7 @@ const ie = {
|
|
|
266
267
|
teleport: ""
|
|
267
268
|
}, {
|
|
268
269
|
default: u(() => [
|
|
269
|
-
s(c(
|
|
270
|
+
s(c(k), {
|
|
270
271
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1",
|
|
271
272
|
fullWidth: "",
|
|
272
273
|
variant: "ghost"
|
|
@@ -274,7 +275,7 @@ const ie = {
|
|
|
274
275
|
default: u(() => {
|
|
275
276
|
var o;
|
|
276
277
|
return [
|
|
277
|
-
x("span", null,
|
|
278
|
+
x("span", null, D((o = m.value) == null ? void 0 : o.label), 1),
|
|
278
279
|
s(c(L), {
|
|
279
280
|
icon: "ChevronDown",
|
|
280
281
|
size: "xs",
|
|
@@ -293,16 +294,16 @@ const ie = {
|
|
|
293
294
|
]),
|
|
294
295
|
_: 1
|
|
295
296
|
}),
|
|
296
|
-
s(
|
|
297
|
+
s(R, null, {
|
|
297
298
|
default: u(() => {
|
|
298
299
|
var o, l, n, i, p;
|
|
299
300
|
return [
|
|
300
|
-
m.value.id === "none" ? (f(),
|
|
301
|
+
m.value.id === "none" ? (f(), F("div", ie, t[1] || (t[1] = [
|
|
301
302
|
x("span", null, "No Body", -1)
|
|
302
|
-
]))) : m.value.id === "binaryFile" ? (f(),
|
|
303
|
-
(o = c(a)) != null && o.body.binary ? (f(),
|
|
304
|
-
x("span", ue,
|
|
305
|
-
s(c(
|
|
303
|
+
]))) : m.value.id === "binaryFile" ? (f(), F("div", de, [
|
|
304
|
+
(o = c(a)) != null && o.body.binary ? (f(), F(Q, { key: 0 }, [
|
|
305
|
+
x("span", ue, D(((l = c(a)) == null ? void 0 : l.body.binary).name), 1),
|
|
306
|
+
s(c(k), {
|
|
306
307
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
|
|
307
308
|
size: "sm",
|
|
308
309
|
variant: "outlined",
|
|
@@ -313,7 +314,7 @@ const ie = {
|
|
|
313
314
|
])),
|
|
314
315
|
_: 1
|
|
315
316
|
})
|
|
316
|
-
], 64)) : (f(), b(c(
|
|
317
|
+
], 64)) : (f(), b(c(k), {
|
|
317
318
|
key: 1,
|
|
318
319
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
|
|
319
320
|
size: "sm",
|
|
@@ -331,7 +332,7 @@ const ie = {
|
|
|
331
332
|
]),
|
|
332
333
|
_: 1
|
|
333
334
|
}))
|
|
334
|
-
])) : m.value.id == "multipartForm" ? (f(), b(
|
|
335
|
+
])) : m.value.id == "multipartForm" ? (f(), b(W, {
|
|
335
336
|
key: 2,
|
|
336
337
|
ref_key: "tableWrapperRef",
|
|
337
338
|
ref: g,
|
|
@@ -339,13 +340,12 @@ const ie = {
|
|
|
339
340
|
columns: ["32px", "", "", "61px"],
|
|
340
341
|
items: v.value,
|
|
341
342
|
showUploadButton: "",
|
|
342
|
-
|
|
343
|
-
onDeleteRow: U,
|
|
343
|
+
onDeleteRow: _,
|
|
344
344
|
onRemoveFile: V,
|
|
345
345
|
onToggleRow: P,
|
|
346
|
-
onUpdateRow:
|
|
346
|
+
onUpdateRow: U,
|
|
347
347
|
onUploadFile: j
|
|
348
|
-
}, null, 8, ["items"])) : m.value.id == "formUrlEncoded" ? (f(), b(
|
|
348
|
+
}, null, 8, ["items"])) : m.value.id == "formUrlEncoded" ? (f(), b(W, {
|
|
349
349
|
key: 3,
|
|
350
350
|
ref_key: "tableWrapperRef",
|
|
351
351
|
ref: g,
|
|
@@ -353,11 +353,10 @@ const ie = {
|
|
|
353
353
|
columns: ["32px", "", "", "61px"],
|
|
354
354
|
items: v.value,
|
|
355
355
|
showUploadButton: "",
|
|
356
|
-
|
|
357
|
-
onDeleteRow: U,
|
|
356
|
+
onDeleteRow: _,
|
|
358
357
|
onRemoveFile: V,
|
|
359
358
|
onToggleRow: P,
|
|
360
|
-
onUpdateRow:
|
|
359
|
+
onUpdateRow: U,
|
|
361
360
|
onUploadFile: j
|
|
362
361
|
}, null, 8, ["items"])) : (f(), b(I, {
|
|
363
362
|
key: 4,
|
|
@@ -372,7 +371,7 @@ const ie = {
|
|
|
372
371
|
}),
|
|
373
372
|
_: 1
|
|
374
373
|
}),
|
|
375
|
-
s(
|
|
374
|
+
s(R)
|
|
376
375
|
]),
|
|
377
376
|
_: 1
|
|
378
377
|
})
|
|
@@ -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":"AA+LA,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;;AAmSF,wBAOG"}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as $, computed as y, onMounted as w, ref as x, watch as E, openBlock as A, createBlock as S, withCtx as i, createTextVNode as h, toDisplayString as g, createElementVNode as c, createVNode as R, unref as T, withModifiers as B, nextTick as k } from "vue";
|
|
2
2
|
import M from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
3
|
import { useActiveEntities as N } from "../../../store/active-entities.js";
|
|
4
4
|
import V from "./RequestTable.vue.js";
|
|
5
5
|
import { ScalarButton as W } from "@scalar/components";
|
|
6
6
|
import { requestExampleParametersSchema as _ } from "@scalar/oas-utils/entities/spec";
|
|
7
7
|
import { useWorkspace as z } from "../../../store/store.js";
|
|
8
|
-
const D = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, U = { class: "sr-only" }, Y = /* @__PURE__ */
|
|
8
|
+
const D = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, U = { class: "sr-only" }, Y = /* @__PURE__ */ $({
|
|
9
9
|
__name: "RequestParams",
|
|
10
10
|
props: {
|
|
11
11
|
title: {},
|
|
12
12
|
paramKey: {}
|
|
13
13
|
},
|
|
14
14
|
setup(b) {
|
|
15
|
-
const r = b, { activeRequest:
|
|
15
|
+
const r = b, { activeRequest: o, activeExample: a } = N(), { requestExampleMutators: n } = z(), l = y(
|
|
16
16
|
() => {
|
|
17
17
|
var e;
|
|
18
18
|
return ((e = a.value) == null ? void 0 : e.parameters[r.paramKey]) ?? [];
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
w(() => {
|
|
22
|
+
f();
|
|
23
23
|
});
|
|
24
24
|
const u = () => {
|
|
25
|
-
if (!
|
|
25
|
+
if (!o.value || !a.value) return;
|
|
26
26
|
const e = _.parse({ enabled: !1 }), t = [...l.value, e];
|
|
27
|
-
|
|
27
|
+
n.edit(
|
|
28
28
|
a.value.uid,
|
|
29
29
|
`parameters.${r.paramKey}`,
|
|
30
30
|
t
|
|
31
31
|
);
|
|
32
|
-
}, p = x(null), q = (e, t,
|
|
33
|
-
if (!
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const s = [...
|
|
37
|
-
s[e] = { ...s[e], [t]:
|
|
32
|
+
}, p = x(null), q = (e, t, v) => {
|
|
33
|
+
if (!o.value || !a.value) return;
|
|
34
|
+
const m = l.value;
|
|
35
|
+
if (m.length > e) {
|
|
36
|
+
const s = [...m];
|
|
37
|
+
s[e] = { ...s[e], [t]: v }, (s[e].key !== "" || s[e].value !== "") && (s[e].enabled = !0), s[e].key === "" && s[e].value === "" && s.splice(e, 1), n.edit(
|
|
38
38
|
a.value.uid,
|
|
39
39
|
`parameters.${r.paramKey}`,
|
|
40
40
|
s
|
|
41
41
|
);
|
|
42
42
|
} else {
|
|
43
|
-
const s = [_.parse({ [t]:
|
|
44
|
-
|
|
43
|
+
const s = [_.parse({ [t]: v })];
|
|
44
|
+
n.edit(
|
|
45
45
|
a.value.uid,
|
|
46
46
|
`parameters.${r.paramKey}`,
|
|
47
47
|
s
|
|
@@ -51,16 +51,17 @@ const D = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
51
51
|
(d = p.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || d.focus();
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
e === m.length - 1 && u();
|
|
55
|
+
}, P = (e, t) => o.value && a.value && n.edit(
|
|
55
56
|
a.value.uid,
|
|
56
57
|
`parameters.${r.paramKey}.${e}.enabled`,
|
|
57
58
|
t
|
|
58
|
-
),
|
|
59
|
-
if (!
|
|
59
|
+
), C = () => {
|
|
60
|
+
if (!o.value || !a.value) return;
|
|
60
61
|
const e = l.value.filter(
|
|
61
62
|
(t) => t.enabled || t.required
|
|
62
63
|
);
|
|
63
|
-
|
|
64
|
+
n.edit(
|
|
64
65
|
a.value.uid,
|
|
65
66
|
`parameters.${r.paramKey}`,
|
|
66
67
|
e
|
|
@@ -68,7 +69,7 @@ const D = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
68
69
|
u();
|
|
69
70
|
});
|
|
70
71
|
};
|
|
71
|
-
function
|
|
72
|
+
function f() {
|
|
72
73
|
if (l.value.length === 0)
|
|
73
74
|
u();
|
|
74
75
|
else if (l.value.length >= 1) {
|
|
@@ -76,40 +77,40 @@ const D = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
76
77
|
e.key !== "" && e.value !== "" && u();
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
const
|
|
80
|
+
const K = y(
|
|
80
81
|
() => l.value.filter((e) => e.key || e.value).length
|
|
81
82
|
);
|
|
82
|
-
return
|
|
83
|
+
return E(
|
|
83
84
|
() => a.value,
|
|
84
85
|
(e, t) => {
|
|
85
|
-
e !== t &&
|
|
86
|
+
e !== t && f();
|
|
86
87
|
},
|
|
87
88
|
{ immediate: !0 }
|
|
88
|
-
), (e, t) => (
|
|
89
|
+
), (e, t) => (A(), S(M, {
|
|
89
90
|
class: "group/params",
|
|
90
|
-
itemCount:
|
|
91
|
+
itemCount: K.value
|
|
91
92
|
}, {
|
|
92
93
|
title: i(() => [
|
|
93
94
|
h(g(e.title), 1)
|
|
94
95
|
]),
|
|
95
96
|
actions: i(() => [
|
|
96
|
-
|
|
97
|
+
c("div", D, [
|
|
97
98
|
R(T(W), {
|
|
98
99
|
class: "px-1 transition-none",
|
|
99
100
|
size: "sm",
|
|
100
101
|
variant: "ghost",
|
|
101
|
-
onClick: B(
|
|
102
|
+
onClick: B(C, ["stop"])
|
|
102
103
|
}, {
|
|
103
104
|
default: i(() => [
|
|
104
105
|
t[0] || (t[0] = h(" Clear")),
|
|
105
|
-
|
|
106
|
+
c("span", U, "All " + g(e.title), 1)
|
|
106
107
|
]),
|
|
107
108
|
_: 1
|
|
108
109
|
})
|
|
109
110
|
])
|
|
110
111
|
]),
|
|
111
112
|
default: i(() => [
|
|
112
|
-
|
|
113
|
+
c("div", {
|
|
113
114
|
ref_key: "tableWrapperRef",
|
|
114
115
|
ref: p
|
|
115
116
|
}, [
|
|
@@ -117,7 +118,6 @@ const D = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
117
118
|
class: "flex-1",
|
|
118
119
|
columns: ["32px", "", ""],
|
|
119
120
|
items: l.value,
|
|
120
|
-
onAddRow: u,
|
|
121
121
|
onToggleRow: P,
|
|
122
122
|
onUpdateRow: q
|
|
123
123
|
}, null, 8, ["items"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AA6KA,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":"AA6KA,KAAK,WAAW,GAAG;IACjB,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC,CAAC;;AAsQF,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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ade1db3e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, computed as S, ref as b, watch as V, openBlock as d, createBlock as w, unref as o, withCtx as
|
|
1
|
+
import { defineComponent as B, computed as S, ref as b, watch as V, openBlock as d, createBlock as w, unref as o, withCtx as x, createElementVNode as A, createElementBlock as v, createCommentVNode as C, toDisplayString as R, createVNode as s, withDirectives as i, vShow as r } from "vue";
|
|
2
2
|
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";
|
|
@@ -52,15 +52,15 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
52
52
|
return d(), w(N, {
|
|
53
53
|
"aria-label": `Request: ${(u = o(l)) == null ? void 0 : u.summary}`
|
|
54
54
|
}, {
|
|
55
|
-
title:
|
|
55
|
+
title: x(() => {
|
|
56
56
|
var n, c;
|
|
57
57
|
return [
|
|
58
|
-
|
|
58
|
+
A("div", D, [
|
|
59
59
|
o(p) ? C("", !0) : (d(), v("label", M)),
|
|
60
60
|
o(p) ? (d(), v("span", z, R((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-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
|
|
@@ -73,10 +73,10 @@ const D = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
73
73
|
}, null, 8, ["activeSection", "sections"])
|
|
74
74
|
];
|
|
75
75
|
}),
|
|
76
|
-
default:
|
|
76
|
+
default: x(() => {
|
|
77
77
|
var n, c, m;
|
|
78
78
|
return [
|
|
79
|
-
|
|
79
|
+
A("div", I, [
|
|
80
80
|
i(s(Q, {
|
|
81
81
|
selectedSecuritySchemeUids: t.selectedSecuritySchemeUids,
|
|
82
82
|
title: "Authentication"
|
|
@@ -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":"AAiNA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAO9E,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,uBAAuB,EAAE,CAAA;IACjC,8BAA8B;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;;;;;;;;;;;;;;;;;;;qBAFkB,OAAO;sBACN,OAAO;;AA8a9B,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-79278ac7"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|