@scalar/api-client 2.0.25 → 2.0.27
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/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +38 -38
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +11 -11
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +48 -46
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +23 -30
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts +20 -0
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarToggle.vue.js +48 -0
- package/dist/components/Sidebar/SidebarToggle.vue2.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -10
- package/dist/layouts/Modal/api-client-modal.d.ts +1 -1
- package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/api-client-modal.js +41 -41
- package/dist/store/workspace.d.ts +36 -12
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +163 -149
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +22 -22
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -30
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +97 -98
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +155 -125
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +44 -46
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +0 -5
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +24 -113
- package/package.json +4 -4
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
import { ScalarListbox as
|
|
1
|
+
import { defineComponent as Q, ref as L, computed as _, watch as N, openBlock as i, createBlock as v, withCtx as d, createTextVNode as V, toDisplayString as k, createElementBlock as y, Fragment as j, createVNode as m, unref as c, createElementVNode as b, nextTick as Z } from "vue";
|
|
2
|
+
import I from "../../../components/CodeInput/CodeInput.vue.js";
|
|
3
|
+
import ee from "../../../components/DataTable/DataTable.vue.js";
|
|
4
|
+
import te from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
|
+
import F from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
|
+
import ae from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
|
+
import { useWorkspace as oe } from "../../../store/workspace.js";
|
|
8
|
+
import { ScalarListbox as ne, ScalarButton as D, ScalarIcon as q } from "@scalar/components";
|
|
9
9
|
import { createRequestExampleParameter as S } from "@scalar/oas-utils/entities/workspace/spec";
|
|
10
|
-
import
|
|
11
|
-
import { useFileDialog as
|
|
12
|
-
const
|
|
10
|
+
import W from "./RequestTable.vue.js";
|
|
11
|
+
import { useFileDialog as A } from "../../../hooks/useFileDialog.js";
|
|
12
|
+
const le = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "text-c-3 flex min-h-14 w-full items-center justify-center rounded border border-dashed text-center text-base"
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
],
|
|
15
|
+
}, re = /* @__PURE__ */ b("span", null, "No Body", -1), ue = [
|
|
16
|
+
re
|
|
17
|
+
], se = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
],
|
|
20
|
+
}, ie = /* @__PURE__ */ b("span", null, "No Body", -1), de = [
|
|
21
|
+
ie
|
|
22
|
+
], ce = {
|
|
23
23
|
key: 1,
|
|
24
24
|
class: "flex items-center justify-center p-1.5 overflow-hidden"
|
|
25
|
-
},
|
|
25
|
+
}, me = { class: "text-c-2 text-xs w-full border rounded p-1 max-w-full overflow-hidden whitespace-nowrap" }, pe = /* @__PURE__ */ b("span", null, "Upload File", -1), Re = /* @__PURE__ */ Q({
|
|
26
26
|
__name: "RequestBody",
|
|
27
27
|
props: {
|
|
28
28
|
title: {},
|
|
29
29
|
body: {},
|
|
30
30
|
formData: {}
|
|
31
31
|
},
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
32
|
+
setup(fe) {
|
|
33
|
+
const M = {
|
|
34
34
|
multipartForm: "Multipart Form",
|
|
35
35
|
formUrlEncoded: "Form URL Encoded",
|
|
36
36
|
binaryFile: "Binary File",
|
|
@@ -40,86 +40,116 @@ const ae = {
|
|
|
40
40
|
edn: "EDN",
|
|
41
41
|
other: "Other",
|
|
42
42
|
none: "None"
|
|
43
|
-
}, { activeRequest:
|
|
43
|
+
}, { activeRequest: p, activeExample: t, requestExampleMutators: r } = oe(), u = L("none"), h = L(null), O = {
|
|
44
44
|
json: "json",
|
|
45
45
|
xml: "xml",
|
|
46
46
|
yaml: "yaml",
|
|
47
47
|
edn: "edn",
|
|
48
48
|
other: "html"
|
|
49
|
-
},
|
|
50
|
-
const e =
|
|
51
|
-
return
|
|
49
|
+
}, z = _(() => {
|
|
50
|
+
const e = u.value;
|
|
51
|
+
return O[e] ?? "plaintext";
|
|
52
52
|
});
|
|
53
53
|
function R() {
|
|
54
54
|
console.log("deleteRow");
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
|
|
56
|
+
const C = (e, a, o) => {
|
|
57
|
+
if (!p.value || !t.value) return;
|
|
58
|
+
const s = f.value;
|
|
59
|
+
if (s.length > e) {
|
|
60
|
+
const n = [...s];
|
|
61
|
+
n[e] = { ...n[e], [a]: o }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1), r.edit(
|
|
62
62
|
t.value.uid,
|
|
63
63
|
"body.formData.value",
|
|
64
|
-
|
|
64
|
+
n
|
|
65
65
|
);
|
|
66
66
|
} else {
|
|
67
|
-
const
|
|
68
|
-
|
|
67
|
+
const n = [S({ [a]: o })];
|
|
68
|
+
r.edit(
|
|
69
69
|
t.value.uid,
|
|
70
70
|
"body.formData.value",
|
|
71
|
-
|
|
72
|
-
),
|
|
73
|
-
var
|
|
74
|
-
if (!
|
|
75
|
-
(
|
|
71
|
+
n
|
|
72
|
+
), Z(() => {
|
|
73
|
+
var P;
|
|
74
|
+
if (!h.value) return;
|
|
75
|
+
(P = h.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || P.focus();
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, f = _(
|
|
79
79
|
() => {
|
|
80
80
|
var e;
|
|
81
81
|
return ((e = t.value) == null ? void 0 : e.body.formData.value) ?? [];
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
function
|
|
85
|
-
|
|
84
|
+
function $() {
|
|
85
|
+
f.value.length === 0 && x();
|
|
86
86
|
}
|
|
87
87
|
const x = () => {
|
|
88
|
-
if (!
|
|
88
|
+
if (!p.value || !t.value) return;
|
|
89
89
|
const e = S({
|
|
90
90
|
enabled: !1
|
|
91
|
-
}), a = [...
|
|
92
|
-
|
|
91
|
+
}), a = [...f.value, e];
|
|
92
|
+
r.edit(
|
|
93
93
|
t.value.uid,
|
|
94
94
|
"body.formData.value",
|
|
95
95
|
a
|
|
96
96
|
);
|
|
97
|
-
},
|
|
98
|
-
!
|
|
97
|
+
}, H = (e) => {
|
|
98
|
+
!p.value || !t.value || r.edit(
|
|
99
99
|
t.value.uid,
|
|
100
100
|
"body.raw.value",
|
|
101
101
|
e
|
|
102
102
|
);
|
|
103
|
-
}, J = (e) => {
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
}, J = (e) => e === "multipartForm" ? "multipart/form-data" : e === "formUrlEncoded" ? "application/x-www-form-urlencoded" : e === "binaryFile" ? "application/octet-stream" : e !== "none" ? `application/${e}` : "", X = (e) => e === "multipartForm" || e === "formUrlEncoded" ? "formData" : e === "binaryFile" ? "binary" : "raw", Y = (e) => {
|
|
104
|
+
const a = J(e), o = X(e);
|
|
105
|
+
r.edit(
|
|
106
106
|
t.value.uid,
|
|
107
107
|
"body.activeBody",
|
|
108
|
-
|
|
108
|
+
o
|
|
109
109
|
);
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
const s = [
|
|
111
|
+
...t.value.parameters.headers
|
|
112
|
+
].findIndex(
|
|
113
|
+
(l) => l.key.toLowerCase() === "Content-Type".toLowerCase()
|
|
114
|
+
), n = [...t.value.parameters.headers][s];
|
|
115
|
+
if ((n == null ? void 0 : n.value) !== a) {
|
|
116
|
+
if (n && a) {
|
|
117
|
+
const l = [...t.value.parameters.headers];
|
|
118
|
+
l[s].value = a, r.edit(
|
|
119
|
+
t.value.uid,
|
|
120
|
+
"parameters.headers",
|
|
121
|
+
l
|
|
122
|
+
);
|
|
123
|
+
} else if (a) {
|
|
124
|
+
const l = [
|
|
125
|
+
...t.value.parameters.headers.filter(
|
|
126
|
+
(E) => E.key.toLowerCase() !== "Content-Type".toLowerCase()
|
|
127
|
+
)
|
|
128
|
+
];
|
|
129
|
+
l.push({
|
|
130
|
+
key: "Content-Type",
|
|
131
|
+
value: a,
|
|
132
|
+
enabled: !0
|
|
133
|
+
}), r.edit(
|
|
134
|
+
t.value.uid,
|
|
135
|
+
"parameters.headers",
|
|
136
|
+
l
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}, T = async (e) => {
|
|
141
|
+
const { open: a } = A({
|
|
112
142
|
onChange: async (o) => {
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
...
|
|
118
|
-
file:
|
|
119
|
-
},
|
|
143
|
+
const s = o == null ? void 0 : o[0];
|
|
144
|
+
if (s && p.value && t.value) {
|
|
145
|
+
const l = [...f.value];
|
|
146
|
+
l[e] = {
|
|
147
|
+
...l[e],
|
|
148
|
+
file: s
|
|
149
|
+
}, r.edit(
|
|
120
150
|
t.value.uid,
|
|
121
151
|
"body.formData.value",
|
|
122
|
-
|
|
152
|
+
l
|
|
123
153
|
);
|
|
124
154
|
}
|
|
125
155
|
},
|
|
@@ -128,26 +158,26 @@ const ae = {
|
|
|
128
158
|
});
|
|
129
159
|
a();
|
|
130
160
|
};
|
|
131
|
-
function
|
|
132
|
-
!
|
|
161
|
+
function G() {
|
|
162
|
+
!p.value || !t.value || r.edit(t.value.uid, "body.binary", void 0);
|
|
133
163
|
}
|
|
134
|
-
function
|
|
135
|
-
if (!
|
|
136
|
-
const o = [...
|
|
164
|
+
function U(e) {
|
|
165
|
+
if (!p.value || !t.value) return;
|
|
166
|
+
const o = [...f.value];
|
|
137
167
|
o[e] = {
|
|
138
168
|
...o[e],
|
|
139
169
|
file: void 0
|
|
140
|
-
},
|
|
170
|
+
}, r.edit(
|
|
141
171
|
t.value.uid,
|
|
142
172
|
"body.formData.value",
|
|
143
173
|
o
|
|
144
174
|
);
|
|
145
175
|
}
|
|
146
|
-
function
|
|
147
|
-
const { open: e } =
|
|
176
|
+
function K() {
|
|
177
|
+
const { open: e } = A({
|
|
148
178
|
onChange: async (a) => {
|
|
149
179
|
const o = a == null ? void 0 : a[0];
|
|
150
|
-
o &&
|
|
180
|
+
o && p.value && t.value && r.edit(
|
|
151
181
|
t.value.uid,
|
|
152
182
|
"body.binary",
|
|
153
183
|
o
|
|
@@ -158,63 +188,63 @@ const ae = {
|
|
|
158
188
|
});
|
|
159
189
|
e();
|
|
160
190
|
}
|
|
161
|
-
const
|
|
191
|
+
const B = Object.entries(M).map(
|
|
162
192
|
([e, a]) => ({
|
|
163
193
|
id: e,
|
|
164
194
|
label: a,
|
|
165
195
|
value: e
|
|
166
196
|
})
|
|
167
197
|
), g = _({
|
|
168
|
-
get: () =>
|
|
198
|
+
get: () => B.find((e) => e.id === u.value),
|
|
169
199
|
set: (e) => {
|
|
170
|
-
e != null && e.id && (
|
|
200
|
+
e != null && e.id && (u.value = e.id);
|
|
171
201
|
}
|
|
172
|
-
}), w = _(() => t.value ? t.value.body.formData && t.value.body.formData.value.length > 0 ? "multipartForm" : t.value.body.
|
|
173
|
-
return w.value !== "none" && (
|
|
202
|
+
}), w = _(() => t.value ? t.value.body.activeBody === "formData" && t.value.body.formData && t.value.body.formData.value.length > 0 ? "multipartForm" : t.value.body.activeBody === "raw" ? t.value.body.raw.encoding : u.value : "none");
|
|
203
|
+
return w.value !== "none" && (u.value = w.value), N(
|
|
174
204
|
w,
|
|
175
205
|
(e) => {
|
|
176
|
-
e && (
|
|
206
|
+
e && (u.value = e);
|
|
177
207
|
},
|
|
178
208
|
{ immediate: !0 }
|
|
179
209
|
), N(
|
|
180
|
-
|
|
210
|
+
u,
|
|
181
211
|
(e) => {
|
|
182
|
-
(e === "multipartForm" || e === "formUrlEncoded") &&
|
|
212
|
+
(e === "multipartForm" || e === "formUrlEncoded") && $(), Y(e);
|
|
183
213
|
},
|
|
184
214
|
{ immediate: !0 }
|
|
185
|
-
), (e, a) => (
|
|
186
|
-
title:
|
|
215
|
+
), (e, a) => (i(), v(ae, null, {
|
|
216
|
+
title: d(() => [
|
|
187
217
|
V(k(e.title), 1)
|
|
188
218
|
]),
|
|
189
|
-
default:
|
|
190
|
-
e.body && e.body.length === 0 && e.formData && e.formData.length === 0 ? (
|
|
219
|
+
default: d(() => [
|
|
220
|
+
e.body && e.body.length === 0 && e.formData && e.formData.length === 0 ? (i(), y("div", le, ue)) : e.formData && e.formData.length > 0 ? (i(), y(j, { key: 1 }, [], 64)) : (i(), v(ee, {
|
|
191
221
|
key: 2,
|
|
192
222
|
columns: [""]
|
|
193
223
|
}, {
|
|
194
|
-
default:
|
|
195
|
-
|
|
196
|
-
default:
|
|
197
|
-
|
|
198
|
-
default:
|
|
199
|
-
|
|
224
|
+
default: d(() => [
|
|
225
|
+
m(F, null, {
|
|
226
|
+
default: d(() => [
|
|
227
|
+
m(te, { class: "relative col-span-full flex h-8 cursor-pointer items-center px-[2.25px] py-[2.25px]" }, {
|
|
228
|
+
default: d(() => [
|
|
229
|
+
m(c(ne), {
|
|
200
230
|
modelValue: g.value,
|
|
201
231
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => g.value = o),
|
|
202
232
|
class: "text-xxs w-full",
|
|
203
233
|
fullWidth: "",
|
|
204
|
-
options:
|
|
234
|
+
options: c(B),
|
|
205
235
|
teleport: ""
|
|
206
236
|
}, {
|
|
207
|
-
default:
|
|
208
|
-
|
|
237
|
+
default: d(() => [
|
|
238
|
+
m(c(D), {
|
|
209
239
|
class: "flex gap-1.5 h-auto px-1.5 text-c-2 font-normal hover:text-c-1",
|
|
210
240
|
fullWidth: "",
|
|
211
241
|
variant: "ghost"
|
|
212
242
|
}, {
|
|
213
|
-
default:
|
|
243
|
+
default: d(() => {
|
|
214
244
|
var o;
|
|
215
245
|
return [
|
|
216
|
-
|
|
217
|
-
|
|
246
|
+
b("span", null, k((o = g.value) == null ? void 0 : o.label), 1),
|
|
247
|
+
m(c(q), {
|
|
218
248
|
icon: "ChevronDown",
|
|
219
249
|
size: "xs",
|
|
220
250
|
thickness: "2.5"
|
|
@@ -232,34 +262,34 @@ const ae = {
|
|
|
232
262
|
]),
|
|
233
263
|
_: 1
|
|
234
264
|
}),
|
|
235
|
-
|
|
236
|
-
default:
|
|
237
|
-
var o,
|
|
265
|
+
m(F, null, {
|
|
266
|
+
default: d(() => {
|
|
267
|
+
var o, s, n;
|
|
238
268
|
return [
|
|
239
|
-
|
|
240
|
-
(o =
|
|
241
|
-
|
|
242
|
-
|
|
269
|
+
u.value === "none" ? (i(), y("div", se, de)) : u.value === "binaryFile" ? (i(), y("div", ce, [
|
|
270
|
+
(o = c(t)) != null && o.body.binary ? (i(), y(j, { key: 0 }, [
|
|
271
|
+
b("span", me, k((s = c(t)) == null ? void 0 : s.body.binary.name), 1),
|
|
272
|
+
m(c(D), {
|
|
243
273
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1",
|
|
244
274
|
size: "sm",
|
|
245
275
|
variant: "outlined",
|
|
246
|
-
onClick:
|
|
276
|
+
onClick: G
|
|
247
277
|
}, {
|
|
248
|
-
default:
|
|
278
|
+
default: d(() => [
|
|
249
279
|
V(" Delete ")
|
|
250
280
|
]),
|
|
251
281
|
_: 1
|
|
252
282
|
})
|
|
253
|
-
], 64)) : (
|
|
283
|
+
], 64)) : (i(), v(c(D), {
|
|
254
284
|
key: 1,
|
|
255
285
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2",
|
|
256
286
|
size: "sm",
|
|
257
287
|
variant: "outlined",
|
|
258
|
-
onClick:
|
|
288
|
+
onClick: K
|
|
259
289
|
}, {
|
|
260
|
-
default:
|
|
261
|
-
|
|
262
|
-
|
|
290
|
+
default: d(() => [
|
|
291
|
+
pe,
|
|
292
|
+
m(c(q), {
|
|
263
293
|
class: "ml-1",
|
|
264
294
|
icon: "UploadSimple",
|
|
265
295
|
size: "xs",
|
|
@@ -268,46 +298,46 @@ const ae = {
|
|
|
268
298
|
]),
|
|
269
299
|
_: 1
|
|
270
300
|
}))
|
|
271
|
-
])) :
|
|
301
|
+
])) : u.value == "multipartForm" ? (i(), v(W, {
|
|
272
302
|
key: 2,
|
|
273
303
|
ref_key: "tableWrapperRef",
|
|
274
|
-
ref:
|
|
304
|
+
ref: h,
|
|
275
305
|
class: "!m-0 rounded-t-none shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
|
|
276
306
|
columns: ["32px", "", "", "61px"],
|
|
277
|
-
items:
|
|
307
|
+
items: f.value,
|
|
278
308
|
showUploadButton: "",
|
|
279
309
|
onAddRow: x,
|
|
280
310
|
onDeleteRow: R,
|
|
281
|
-
onRemoveFile:
|
|
282
|
-
onUpdateRow:
|
|
283
|
-
onUploadFile:
|
|
284
|
-
}, null, 8, ["items"])) :
|
|
311
|
+
onRemoveFile: U,
|
|
312
|
+
onUpdateRow: C,
|
|
313
|
+
onUploadFile: T
|
|
314
|
+
}, null, 8, ["items"])) : u.value == "formUrlEncoded" ? (i(), v(W, {
|
|
285
315
|
key: 3,
|
|
286
316
|
ref_key: "tableWrapperRef",
|
|
287
|
-
ref:
|
|
317
|
+
ref: h,
|
|
288
318
|
class: "!m-0 rounded-t-none border-t-0 shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
|
|
289
319
|
columns: ["32px", "", "", "61px"],
|
|
290
|
-
items:
|
|
320
|
+
items: f.value,
|
|
291
321
|
showUploadButton: "",
|
|
292
322
|
onAddRow: x,
|
|
293
323
|
onDeleteRow: R,
|
|
294
|
-
onRemoveFile:
|
|
295
|
-
onUpdateRow:
|
|
296
|
-
onUploadFile:
|
|
297
|
-
}, null, 8, ["items"])) : (
|
|
324
|
+
onRemoveFile: U,
|
|
325
|
+
onUpdateRow: C,
|
|
326
|
+
onUploadFile: T
|
|
327
|
+
}, null, 8, ["items"])) : (i(), v(I, {
|
|
298
328
|
key: 4,
|
|
299
329
|
content: "",
|
|
300
|
-
language:
|
|
330
|
+
language: z.value,
|
|
301
331
|
lineNumbers: "",
|
|
302
332
|
lint: "",
|
|
303
|
-
modelValue: ((
|
|
304
|
-
"onUpdate:modelValue":
|
|
333
|
+
modelValue: ((n = c(t)) == null ? void 0 : n.body.raw.value) ?? "",
|
|
334
|
+
"onUpdate:modelValue": H
|
|
305
335
|
}, null, 8, ["language", "modelValue"]))
|
|
306
336
|
];
|
|
307
337
|
}),
|
|
308
338
|
_: 1
|
|
309
339
|
}),
|
|
310
|
-
|
|
340
|
+
m(F)
|
|
311
341
|
]),
|
|
312
342
|
_: 1
|
|
313
343
|
}))
|
|
@@ -317,5 +347,5 @@ const ae = {
|
|
|
317
347
|
}
|
|
318
348
|
});
|
|
319
349
|
export {
|
|
320
|
-
|
|
350
|
+
Re as default
|
|
321
351
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AAyIA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;UAO1C,OAAO,GAAG,cAAc;;UAAxB,OAAO,GAAG,cAAc;;AAiVhC,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,102 +1,100 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as q, computed as E, openBlock as m, createBlock as u, unref as e, withCtx as l, createVNode as t, createCommentVNode as R, createElementVNode as n } from "vue";
|
|
2
2
|
import { commandPaletteBus as z } from "../../libs/eventBusses/command-palette.js";
|
|
3
|
-
import { activeRouterParams as
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import { ScalarDropdown as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
const
|
|
3
|
+
import { activeRouterParams as d, PathId as p } from "../../router.js";
|
|
4
|
+
import { useWorkspace as C, findRequestFolders as I } from "../../store/workspace.js";
|
|
5
|
+
import { ScalarDropdown as w, ScalarDropdownItem as o, ScalarIcon as s, ScalarDropdownDivider as S, ScalarButton as b } from "@scalar/components";
|
|
6
|
+
import { useRouter as A } from "vue-router";
|
|
7
|
+
const B = /* @__PURE__ */ n("span", null, "Add Example", -1), N = /* @__PURE__ */ n("span", null, "Rename", -1), M = /* @__PURE__ */ n("span", null, "Duplicate", -1), P = /* @__PURE__ */ n("span", null, "Delete", -1), j = /* @__PURE__ */ q({
|
|
8
8
|
__name: "RequestSidebarItemMenu",
|
|
9
9
|
props: {
|
|
10
10
|
item: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
12
|
+
setup(f) {
|
|
13
|
+
const a = f, { activeWorkspace: c, requestMutators: _, requestExampleMutators: x } = C(), { replace: r } = A(), h = () => z.emit({
|
|
14
14
|
commandName: "Add Example",
|
|
15
|
-
metaData:
|
|
16
|
-
}),
|
|
15
|
+
metaData: a.item.uid
|
|
16
|
+
}), k = () => {
|
|
17
17
|
console.log("rename");
|
|
18
|
-
},
|
|
18
|
+
}, v = () => {
|
|
19
19
|
console.log("duplicate");
|
|
20
|
-
},
|
|
21
|
-
if ("requestUid" in
|
|
22
|
-
|
|
20
|
+
}, g = () => {
|
|
21
|
+
if ("requestUid" in a.item)
|
|
22
|
+
x.delete(a.item), d.value[p.Examples] === a.item.uid && r(`/workspace/${c.value}/request/default`);
|
|
23
23
|
else {
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
_.delete(
|
|
24
|
+
const i = I(a.item.uid);
|
|
25
|
+
if (!i.length) return;
|
|
26
|
+
_.delete(a.item, i[0]), d.value[p.Request] === a.item.uid && r(`/workspace/${c.value.uid}/request/default`);
|
|
27
27
|
}
|
|
28
|
-
},
|
|
29
|
-
return (
|
|
30
|
-
items:
|
|
31
|
-
|
|
28
|
+
}, D = E(() => "summary" in a.item);
|
|
29
|
+
return (i, V) => (m(), u(e(w), { teleport: "#scalar-client" }, {
|
|
30
|
+
items: l(() => [
|
|
31
|
+
D.value ? (m(), u(e(o), {
|
|
32
32
|
key: 0,
|
|
33
33
|
class: "flex !gap-2",
|
|
34
|
-
onClick:
|
|
34
|
+
onClick: h
|
|
35
35
|
}, {
|
|
36
|
-
default:
|
|
37
|
-
t(e(
|
|
36
|
+
default: l(() => [
|
|
37
|
+
t(e(s), {
|
|
38
38
|
class: "inline-flex",
|
|
39
39
|
icon: "Add",
|
|
40
40
|
size: "sm"
|
|
41
41
|
}),
|
|
42
|
-
|
|
42
|
+
B
|
|
43
43
|
]),
|
|
44
44
|
_: 1
|
|
45
45
|
})) : R("", !0),
|
|
46
46
|
t(e(o), {
|
|
47
47
|
class: "flex !gap-2",
|
|
48
|
-
onClick:
|
|
48
|
+
onClick: k
|
|
49
49
|
}, {
|
|
50
|
-
default:
|
|
51
|
-
t(e(
|
|
50
|
+
default: l(() => [
|
|
51
|
+
t(e(s), {
|
|
52
52
|
class: "inline-flex",
|
|
53
53
|
icon: "Edit",
|
|
54
54
|
size: "sm"
|
|
55
55
|
}),
|
|
56
|
-
|
|
56
|
+
N
|
|
57
57
|
]),
|
|
58
58
|
_: 1
|
|
59
59
|
}),
|
|
60
60
|
t(e(o), {
|
|
61
61
|
class: "flex !gap-2",
|
|
62
|
-
onClick:
|
|
62
|
+
onClick: v
|
|
63
63
|
}, {
|
|
64
|
-
default:
|
|
65
|
-
t(e(
|
|
64
|
+
default: l(() => [
|
|
65
|
+
t(e(s), {
|
|
66
66
|
class: "inline-flex",
|
|
67
67
|
icon: "Duplicate",
|
|
68
68
|
size: "sm"
|
|
69
69
|
}),
|
|
70
|
-
|
|
70
|
+
M
|
|
71
71
|
]),
|
|
72
72
|
_: 1
|
|
73
73
|
}),
|
|
74
|
-
t(e(
|
|
74
|
+
t(e(S)),
|
|
75
75
|
t(e(o), {
|
|
76
76
|
class: "flex !gap-2",
|
|
77
|
-
onClick:
|
|
77
|
+
onClick: g
|
|
78
78
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
t(e(
|
|
79
|
+
default: l(() => [
|
|
80
|
+
t(e(s), {
|
|
81
81
|
class: "inline-flex",
|
|
82
82
|
icon: "Trash",
|
|
83
83
|
size: "sm"
|
|
84
84
|
}),
|
|
85
|
-
|
|
85
|
+
P
|
|
86
86
|
]),
|
|
87
87
|
_: 1
|
|
88
88
|
})
|
|
89
89
|
]),
|
|
90
|
-
default:
|
|
91
|
-
t(e(
|
|
90
|
+
default: l(() => [
|
|
91
|
+
t(e(b), {
|
|
92
92
|
class: "z-10 hover:bg-b-3 transition-none p-1 group-hover:flex ui-open:flex absolute left-0 hidden -translate-x-full -ml-1",
|
|
93
93
|
size: "sm",
|
|
94
|
-
variant: "ghost"
|
|
95
|
-
onClick: m[0] || (m[0] = w(() => {
|
|
96
|
-
}, ["stop"]))
|
|
94
|
+
variant: "ghost"
|
|
97
95
|
}, {
|
|
98
|
-
default:
|
|
99
|
-
t(e(
|
|
96
|
+
default: l(() => [
|
|
97
|
+
t(e(s), {
|
|
100
98
|
icon: "Ellipses",
|
|
101
99
|
size: "sm"
|
|
102
100
|
})
|
|
@@ -109,5 +107,5 @@ const N = /* @__PURE__ */ i("span", null, "Add Example", -1), P = /* @__PURE__ *
|
|
|
109
107
|
}
|
|
110
108
|
});
|
|
111
109
|
export {
|
|
112
|
-
|
|
110
|
+
j as default
|
|
113
111
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
2
2
|
title: string;
|
|
3
|
-
active: boolean;
|
|
4
3
|
data: any;
|
|
5
4
|
headers: {
|
|
6
5
|
name: string;
|
|
@@ -8,11 +7,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
8
7
|
required: boolean;
|
|
9
8
|
}[];
|
|
10
9
|
}>, {
|
|
11
|
-
active: boolean;
|
|
12
10
|
data: null;
|
|
13
11
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
14
12
|
title: string;
|
|
15
|
-
active: boolean;
|
|
16
13
|
data: any;
|
|
17
14
|
headers: {
|
|
18
15
|
name: string;
|
|
@@ -20,11 +17,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
20
17
|
required: boolean;
|
|
21
18
|
}[];
|
|
22
19
|
}>, {
|
|
23
|
-
active: boolean;
|
|
24
20
|
data: null;
|
|
25
21
|
}>>>, {
|
|
26
22
|
data: any;
|
|
27
|
-
active: boolean;
|
|
28
23
|
}, {}>;
|
|
29
24
|
export default _default;
|
|
30
25
|
type __VLS_WithDefaults<P, D> = {
|