@scalar/api-client 2.2.55 → 2.2.57
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 +39 -0
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +53 -54
- package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +3 -19
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +154 -129
- package/dist/components/DataTable/DataTableInput.vue.d.ts +4 -4
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.js +17 -16
- package/dist/layouts/App/create-api-client-app.d.ts +62 -52
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +120 -100
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +1 -2
- package/dist/layouts/Web/create-api-client-web.d.ts +62 -52
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +64 -58
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +82 -80
- package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
- package/dist/libs/extractAttachmentFilename.js +8 -7
- package/dist/libs/find-request.d.ts +1 -1
- package/dist/libs/find-request.d.ts.map +1 -1
- 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 +9 -8
- package/dist/libs/send-request/create-request-operation.test.d.ts +3 -2
- package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
- package/dist/store/active-entities.d.ts +4 -3
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/import-spec.d.ts +3 -3
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +4 -1
- package/dist/store/request-example.d.ts +22 -12
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/requests.d.ts +13 -13
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/security-schemes.d.ts +6 -6
- package/dist/store/store.d.ts +92 -67
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +12 -12
- package/dist/store/workspace.d.ts +12 -12
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/RequestRoot.test.d.ts +2 -0
- package/dist/views/Request/RequestRoot.test.d.ts.map +1 -0
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +2 -2
- package/dist/views/Request/RequestRoot.vue2.js +72 -60
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +113 -107
- 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 +37 -37
- 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 +55 -51
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +171 -166
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +187 -180
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
- package/dist/views/Request/RequestSubpageHeader.vue2.js +41 -49
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +62 -45
- package/package.json +13 -13
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +0 -15
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +0 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +0 -176
- package/dist/components/CommandPalette/CommandPaletteRequest.vue2.js +0 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as ee, computed as h, ref as ae, watch as
|
|
2
|
-
import { ScalarListbox as X, ScalarButton as
|
|
1
|
+
import { defineComponent as ee, computed as h, ref as ae, watch as A, openBlock as b, createBlock as g, withCtx as m, createTextVNode as H, toDisplayString as F, createVNode as c, unref as v, createElementVNode as k, createCommentVNode as ne, createElementBlock as E, Fragment as te, nextTick as oe } from "vue";
|
|
2
|
+
import { ScalarListbox as X, ScalarButton as D, ScalarIcon as C } from "@scalar/components";
|
|
3
3
|
import { requestExampleParametersSchema as Y } from "@scalar/oas-utils/entities/spec";
|
|
4
4
|
import { canMethodHaveBody as le } from "@scalar/oas-utils/helpers";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import ie from "../../../components/CodeInput/CodeInput.vue.js";
|
|
6
|
+
import re from "../../../components/DataTable/DataTable.vue.js";
|
|
7
7
|
import de from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
8
|
-
import
|
|
8
|
+
import j from "../../../components/DataTable/DataTableRow.vue.js";
|
|
9
9
|
import ue from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
10
10
|
import G from "./RequestTable.vue.js";
|
|
11
11
|
import { useWorkspace as se } from "../../../store/store.js";
|
|
@@ -26,7 +26,7 @@ const me = {
|
|
|
26
26
|
workspace: {},
|
|
27
27
|
title: {}
|
|
28
28
|
},
|
|
29
|
-
setup(
|
|
29
|
+
setup(l) {
|
|
30
30
|
const { requestExampleMutators: d } = se(), Q = {
|
|
31
31
|
json: "json",
|
|
32
32
|
xml: "xml",
|
|
@@ -46,75 +46,75 @@ const me = {
|
|
|
46
46
|
}).map(([e, a]) => ({
|
|
47
47
|
id: e,
|
|
48
48
|
label: a
|
|
49
|
-
})),
|
|
49
|
+
})), R = h(() => {
|
|
50
50
|
var o;
|
|
51
|
-
const { activeBody: e, formData: a, raw: n } =
|
|
52
|
-
return e === "formData" ? (a == null ? void 0 : a.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : e === "binary" ? "binaryFile" : e === "raw" && (n != null && n.encoding) ? n.encoding === "html" ? "other" : n.encoding : Object.keys(((o =
|
|
51
|
+
const { activeBody: e, formData: a, raw: n } = l.example.body;
|
|
52
|
+
return n != null && n.mimeType ? n.mimeType : e === "formData" ? (a == null ? void 0 : a.encoding) === "urlencoded" ? "formUrlEncoded" : "multipartForm" : e === "binary" ? "binaryFile" : e === "raw" && (n != null && n.encoding) ? n.encoding === "html" ? "other" : n.encoding : Object.keys(((o = l.operation.requestBody) == null ? void 0 : o.content) || {})[0] || "none";
|
|
53
53
|
}), p = h({
|
|
54
54
|
get: () => x.find(
|
|
55
|
-
(e) => e.id ===
|
|
55
|
+
(e) => e.id === R.value
|
|
56
56
|
) ?? x[x.length - 1] ?? x[0],
|
|
57
57
|
set: (e) => {
|
|
58
|
-
e != null && e.id &&
|
|
58
|
+
e != null && e.id && L(e.id);
|
|
59
59
|
}
|
|
60
60
|
}), B = ae(null), Z = h(() => {
|
|
61
61
|
var a;
|
|
62
62
|
const e = (a = p.value) == null ? void 0 : a.id;
|
|
63
63
|
return Q[e] ?? "plaintext";
|
|
64
64
|
});
|
|
65
|
-
function
|
|
65
|
+
function P() {
|
|
66
66
|
console.log("deleteRow");
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
var o,
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
const u = [...
|
|
68
|
+
const N = (e, a, n) => {
|
|
69
|
+
var o, i, s, r, f, V, J;
|
|
70
|
+
const t = y.value;
|
|
71
|
+
if (t.length > e) {
|
|
72
|
+
const u = [...t];
|
|
73
73
|
u[e] = {
|
|
74
74
|
...u[e],
|
|
75
75
|
value: ((o = u[e]) == null ? void 0 : o.value) || "",
|
|
76
|
-
key: ((
|
|
76
|
+
key: ((i = u[e]) == null ? void 0 : i.key) || "",
|
|
77
77
|
enabled: ((s = u[e]) == null ? void 0 : s.enabled) ?? !1,
|
|
78
78
|
[a]: n || ""
|
|
79
|
-
}, (((
|
|
80
|
-
|
|
79
|
+
}, (((r = u[e]) == null ? void 0 : r.key) !== "" || ((f = u[e]) == null ? void 0 : f.value) !== "") && (u[e].enabled = !0), ((V = u[e]) == null ? void 0 : V.key) === "" && ((J = u[e]) == null ? void 0 : J.value) === "" && u.splice(e, 1), d.edit(
|
|
80
|
+
l.example.uid,
|
|
81
81
|
"body.formData.value",
|
|
82
82
|
u
|
|
83
83
|
);
|
|
84
84
|
} else {
|
|
85
85
|
const u = [Y.parse({ [a]: n })];
|
|
86
|
-
d.edit(
|
|
87
|
-
var
|
|
86
|
+
d.edit(l.example.uid, "body.formData.value", u), oe(() => {
|
|
87
|
+
var $;
|
|
88
88
|
if (!B.value) return;
|
|
89
|
-
(
|
|
89
|
+
($ = B.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || $.focus();
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
e ===
|
|
92
|
+
e === t.length - 1 && O();
|
|
93
93
|
}, y = h(() => {
|
|
94
94
|
var e;
|
|
95
|
-
return ((e =
|
|
96
|
-
}),
|
|
95
|
+
return ((e = l.example.body.formData) == null ? void 0 : e.value) ?? [];
|
|
96
|
+
}), T = () => {
|
|
97
97
|
const e = y.value[y.value.length - 1];
|
|
98
98
|
(!e || e.key !== "" || e.value !== "") && O();
|
|
99
99
|
}, O = () => {
|
|
100
100
|
const e = Y.parse({
|
|
101
101
|
enabled: !1
|
|
102
102
|
}), a = [...y.value, e];
|
|
103
|
-
|
|
103
|
+
l.example.body.formData ? d.edit(l.example.uid, "body.formData.value", a) : d.edit(l.example.uid, "body.formData", {
|
|
104
104
|
value: a,
|
|
105
105
|
encoding: "form-data"
|
|
106
106
|
});
|
|
107
107
|
}, S = (e, a) => {
|
|
108
108
|
const n = y.value;
|
|
109
109
|
if (n.length > e) {
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
const t = [...n];
|
|
111
|
+
t[e] && (t[e].enabled = a), d.edit(
|
|
112
|
+
l.example.uid,
|
|
113
113
|
"body.formData.value",
|
|
114
|
-
|
|
114
|
+
t
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
}, q = (e) => d.edit(
|
|
117
|
+
}, q = (e) => d.edit(l.example.uid, "body.raw.value", e), W = (e) => e === "multipartForm" ? {
|
|
118
118
|
activeBody: "formData",
|
|
119
119
|
encoding: "form-data",
|
|
120
120
|
header: "multipart/form-data"
|
|
@@ -126,10 +126,10 @@ const me = {
|
|
|
126
126
|
activeBody: "binary",
|
|
127
127
|
encoding: void 0,
|
|
128
128
|
header: "application/octet-stream"
|
|
129
|
-
} : e === "json" ? {
|
|
129
|
+
} : e === "json" || e.endsWith("+json") ? {
|
|
130
130
|
activeBody: "raw",
|
|
131
131
|
encoding: "json",
|
|
132
|
-
header: "application/json"
|
|
132
|
+
header: e.endsWith("+json") ? `application/${e}` : "application/json"
|
|
133
133
|
} : e === "xml" ? {
|
|
134
134
|
activeBody: "raw",
|
|
135
135
|
encoding: "xml",
|
|
@@ -146,111 +146,117 @@ const me = {
|
|
|
146
146
|
activeBody: "raw",
|
|
147
147
|
encoding: "html",
|
|
148
148
|
header: "application/html"
|
|
149
|
-
} : { activeBody: "raw", encoding: void 0, header: void 0 },
|
|
150
|
-
var s,
|
|
151
|
-
const { activeBody: a, encoding: n, header:
|
|
152
|
-
if (d.edit(
|
|
153
|
-
d.edit(
|
|
149
|
+
} : { activeBody: "raw", encoding: void 0, header: void 0 }, L = (e) => {
|
|
150
|
+
var s, r;
|
|
151
|
+
const { activeBody: a, encoding: n, header: t } = W(e);
|
|
152
|
+
if (d.edit(l.example.uid, "body.activeBody", a), n && a === "raw")
|
|
153
|
+
d.edit(l.example.uid, "body.raw", {
|
|
154
154
|
encoding: n,
|
|
155
|
-
value: ((s =
|
|
155
|
+
value: ((s = l.example.body.raw) == null ? void 0 : s.value) ?? ""
|
|
156
156
|
});
|
|
157
157
|
else if (n && a === "formData")
|
|
158
|
-
d.edit(
|
|
158
|
+
d.edit(l.example.uid, "body.formData", {
|
|
159
159
|
encoding: n,
|
|
160
|
-
value: ((
|
|
160
|
+
value: ((r = l.example.body.formData) == null ? void 0 : r.value) ?? []
|
|
161
161
|
});
|
|
162
162
|
else if (!n && a !== "binary") {
|
|
163
|
-
const { raw: f, ...
|
|
164
|
-
d.edit(
|
|
163
|
+
const { raw: f, ...V } = l.example.body;
|
|
164
|
+
d.edit(l.example.uid, "body", V);
|
|
165
165
|
}
|
|
166
|
-
const o = [...
|
|
166
|
+
const o = [...l.example.parameters.headers], i = o.findIndex(
|
|
167
167
|
(f) => f.key.toLowerCase() === "content-type"
|
|
168
168
|
);
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
else if (
|
|
169
|
+
if (i >= 0)
|
|
170
|
+
t && o[i] ? o[i].value = t : o[i] && (a !== "raw" || e === "none") && o.splice(i, 1);
|
|
171
|
+
else if (t) {
|
|
172
172
|
const f = o[o.length - 1];
|
|
173
173
|
f && f.key === "" && f.value === "" ? o.splice(o.length - 1, 0, {
|
|
174
174
|
key: "Content-Type",
|
|
175
|
-
value:
|
|
175
|
+
value: t,
|
|
176
176
|
enabled: !0
|
|
177
177
|
}) : o.push({
|
|
178
178
|
key: "Content-Type",
|
|
179
|
-
value:
|
|
179
|
+
value: t,
|
|
180
180
|
enabled: !0
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
d.edit(
|
|
184
|
-
},
|
|
183
|
+
d.edit(l.example.uid, "parameters.headers", o);
|
|
184
|
+
}, M = async (e) => {
|
|
185
185
|
const { open: a } = K({
|
|
186
186
|
onChange: async (n) => {
|
|
187
|
-
var o,
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
...
|
|
193
|
-
file:
|
|
194
|
-
value: ((o =
|
|
195
|
-
key: ((
|
|
187
|
+
var o, i;
|
|
188
|
+
const t = n == null ? void 0 : n[0];
|
|
189
|
+
if (t) {
|
|
190
|
+
const r = [...y.value];
|
|
191
|
+
r[e] = {
|
|
192
|
+
...r[e],
|
|
193
|
+
file: t,
|
|
194
|
+
value: ((o = r[e]) == null ? void 0 : o.value) || t.name,
|
|
195
|
+
key: ((i = r[e]) == null ? void 0 : i.key) || t.name,
|
|
196
196
|
enabled: !0
|
|
197
197
|
}, d.edit(
|
|
198
|
-
|
|
198
|
+
l.example.uid,
|
|
199
199
|
"body.formData.value",
|
|
200
|
-
|
|
201
|
-
),
|
|
200
|
+
r
|
|
201
|
+
), T();
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
204
|
multiple: !1,
|
|
205
205
|
accept: "*/*"
|
|
206
206
|
});
|
|
207
207
|
a();
|
|
208
|
-
}, I = () => d.edit(
|
|
208
|
+
}, I = () => d.edit(l.example.uid, "body.binary", void 0);
|
|
209
209
|
function z(e) {
|
|
210
|
-
const a = y.value, n = [...a];
|
|
211
|
-
a.length > 1
|
|
210
|
+
const a = y.value, n = [...a], t = a[e], o = t == null ? void 0 : t.file;
|
|
211
|
+
if (a.length > 1 && (!(t != null && t.key) && !(t != null && t.value) || o && (t == null ? void 0 : t.key) === o.name && (t == null ? void 0 : t.value) === o.name))
|
|
212
|
+
n.splice(e, 1);
|
|
213
|
+
else {
|
|
214
|
+
const i = n[e];
|
|
215
|
+
i && (i.file = void 0);
|
|
216
|
+
}
|
|
217
|
+
d.edit(l.example.uid, "body.formData.value", n);
|
|
212
218
|
}
|
|
213
219
|
function _() {
|
|
214
220
|
const { open: e } = K({
|
|
215
221
|
onChange: async (a) => {
|
|
216
222
|
const n = a == null ? void 0 : a[0];
|
|
217
|
-
n && d.edit(
|
|
223
|
+
n && d.edit(l.example.uid, "body.binary", n);
|
|
218
224
|
},
|
|
219
225
|
multiple: !1,
|
|
220
226
|
accept: "*/*"
|
|
221
227
|
});
|
|
222
228
|
e();
|
|
223
229
|
}
|
|
224
|
-
|
|
230
|
+
A(
|
|
225
231
|
p,
|
|
226
232
|
(e) => {
|
|
227
|
-
["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") &&
|
|
233
|
+
["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") && T();
|
|
228
234
|
},
|
|
229
235
|
{ immediate: !0 }
|
|
230
|
-
),
|
|
231
|
-
() =>
|
|
236
|
+
), A(
|
|
237
|
+
() => l.example.uid,
|
|
232
238
|
() => {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
) &&
|
|
239
|
+
l.operation.method && le(l.operation.method) && L(R.value), ["multipartForm", "formUrlEncoded"].includes(
|
|
240
|
+
R.value
|
|
241
|
+
) && T();
|
|
236
242
|
},
|
|
237
243
|
{ immediate: !0 }
|
|
238
244
|
);
|
|
239
245
|
const w = h(() => {
|
|
240
|
-
var o,
|
|
241
|
-
const e = (o = p.value) == null ? void 0 : o.id, { header: a } =
|
|
242
|
-
return Object.entries(
|
|
243
|
-
id:
|
|
244
|
-
label:
|
|
246
|
+
var o, i, s;
|
|
247
|
+
const e = (o = p.value) == null ? void 0 : o.id, { header: a } = W(e), n = ((i = l.operation.requestBody) == null ? void 0 : i.content) || {}, t = a ? ((s = n[a]) == null ? void 0 : s.examples) || {} : {};
|
|
248
|
+
return Object.entries(t).map(([r, f]) => ({
|
|
249
|
+
id: r,
|
|
250
|
+
label: r,
|
|
245
251
|
value: f
|
|
246
252
|
}));
|
|
247
253
|
}), U = h({
|
|
248
254
|
get: () => {
|
|
249
|
-
var
|
|
250
|
-
const e = ((
|
|
255
|
+
var t;
|
|
256
|
+
const e = ((t = l.example.body.raw) == null ? void 0 : t.value) ?? "{}", a = JSON.parse(e);
|
|
251
257
|
return w.value.find((o) => {
|
|
252
|
-
const
|
|
253
|
-
return JSON.stringify(
|
|
258
|
+
const i = o.value;
|
|
259
|
+
return JSON.stringify(i.value) === JSON.stringify(a);
|
|
254
260
|
}) ?? w.value[0];
|
|
255
261
|
},
|
|
256
262
|
set: (e) => {
|
|
@@ -265,12 +271,12 @@ const me = {
|
|
|
265
271
|
});
|
|
266
272
|
return (e, a) => (b(), g(ue, null, {
|
|
267
273
|
title: m(() => [
|
|
268
|
-
H(
|
|
274
|
+
H(F(e.title), 1)
|
|
269
275
|
]),
|
|
270
276
|
default: m(() => [
|
|
271
|
-
c(
|
|
277
|
+
c(re, { columns: [""] }, {
|
|
272
278
|
default: m(() => [
|
|
273
|
-
c(
|
|
279
|
+
c(j, null, {
|
|
274
280
|
default: m(() => [
|
|
275
281
|
c(de, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
|
|
276
282
|
default: m(() => [
|
|
@@ -281,7 +287,7 @@ const me = {
|
|
|
281
287
|
teleport: ""
|
|
282
288
|
}, {
|
|
283
289
|
default: m(() => [
|
|
284
|
-
c(v(
|
|
290
|
+
c(v(D), {
|
|
285
291
|
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-3 font-normal",
|
|
286
292
|
fullWidth: "",
|
|
287
293
|
variant: "ghost"
|
|
@@ -289,7 +295,7 @@ const me = {
|
|
|
289
295
|
default: m(() => {
|
|
290
296
|
var n;
|
|
291
297
|
return [
|
|
292
|
-
k("span", null,
|
|
298
|
+
k("span", null, F((n = p.value) == null ? void 0 : n.label), 1),
|
|
293
299
|
c(v(C), {
|
|
294
300
|
icon: "ChevronDown",
|
|
295
301
|
size: "md"
|
|
@@ -310,7 +316,7 @@ const me = {
|
|
|
310
316
|
teleport: ""
|
|
311
317
|
}, {
|
|
312
318
|
default: m(() => [
|
|
313
|
-
c(v(
|
|
319
|
+
c(v(D), {
|
|
314
320
|
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-2 font-normal",
|
|
315
321
|
fullWidth: "",
|
|
316
322
|
variant: "ghost"
|
|
@@ -318,7 +324,7 @@ const me = {
|
|
|
318
324
|
default: m(() => {
|
|
319
325
|
var n;
|
|
320
326
|
return [
|
|
321
|
-
k("span", null,
|
|
327
|
+
k("span", null, F((n = U.value) == null ? void 0 : n.label), 1),
|
|
322
328
|
c(v(C), {
|
|
323
329
|
icon: "ChevronDown",
|
|
324
330
|
size: "md"
|
|
@@ -336,16 +342,16 @@ const me = {
|
|
|
336
342
|
]),
|
|
337
343
|
_: 1
|
|
338
344
|
}),
|
|
339
|
-
c(
|
|
345
|
+
c(j, null, {
|
|
340
346
|
default: m(() => {
|
|
341
|
-
var n,
|
|
347
|
+
var n, t, o, i, s, r;
|
|
342
348
|
return [
|
|
343
349
|
((n = p.value) == null ? void 0 : n.id) === "none" ? (b(), E("div", me, a[2] || (a[2] = [
|
|
344
350
|
k("span", null, "No Body", -1)
|
|
345
|
-
]))) : ((
|
|
351
|
+
]))) : ((t = p.value) == null ? void 0 : t.id) === "binaryFile" ? (b(), E("div", ce, [
|
|
346
352
|
e.example.body.binary ? (b(), E(te, { key: 0 }, [
|
|
347
|
-
k("span", fe,
|
|
348
|
-
c(v(
|
|
353
|
+
k("span", fe, F(e.example.body.binary.name), 1),
|
|
354
|
+
c(v(D), {
|
|
349
355
|
class: "bg-b-2 hover:bg-b-3 text-c-2 ml-1 border-0 shadow-none",
|
|
350
356
|
size: "sm",
|
|
351
357
|
variant: "outlined",
|
|
@@ -356,7 +362,7 @@ const me = {
|
|
|
356
362
|
])),
|
|
357
363
|
_: 1
|
|
358
364
|
})
|
|
359
|
-
], 64)) : (b(), g(v(
|
|
365
|
+
], 64)) : (b(), g(v(D), {
|
|
360
366
|
key: 1,
|
|
361
367
|
class: "bg-b-2 hover:bg-b-3 text-c-2 border-0 shadow-none",
|
|
362
368
|
size: "sm",
|
|
@@ -385,12 +391,12 @@ const me = {
|
|
|
385
391
|
items: y.value,
|
|
386
392
|
showUploadButton: "",
|
|
387
393
|
workspace: e.workspace,
|
|
388
|
-
onDeleteRow:
|
|
394
|
+
onDeleteRow: P,
|
|
389
395
|
onRemoveFile: z,
|
|
390
396
|
onToggleRow: S,
|
|
391
|
-
onUpdateRow:
|
|
392
|
-
onUploadFile:
|
|
393
|
-
}, null, 8, ["envVariables", "environment", "items", "workspace"])) : ((
|
|
397
|
+
onUpdateRow: N,
|
|
398
|
+
onUploadFile: M
|
|
399
|
+
}, null, 8, ["envVariables", "environment", "items", "workspace"])) : ((i = p.value) == null ? void 0 : i.id) == "formUrlEncoded" ? (b(), g(G, {
|
|
394
400
|
key: 3,
|
|
395
401
|
ref_key: "tableWrapperRef",
|
|
396
402
|
ref: B,
|
|
@@ -401,12 +407,12 @@ const me = {
|
|
|
401
407
|
items: y.value,
|
|
402
408
|
showUploadButton: "",
|
|
403
409
|
workspace: e.workspace,
|
|
404
|
-
onDeleteRow:
|
|
410
|
+
onDeleteRow: P,
|
|
405
411
|
onRemoveFile: z,
|
|
406
412
|
onToggleRow: S,
|
|
407
|
-
onUpdateRow:
|
|
408
|
-
onUploadFile:
|
|
409
|
-
}, null, 8, ["envVariables", "environment", "items", "workspace"])) : (b(), g(
|
|
413
|
+
onUpdateRow: N,
|
|
414
|
+
onUploadFile: M
|
|
415
|
+
}, null, 8, ["envVariables", "environment", "items", "workspace"])) : (b(), g(ie, {
|
|
410
416
|
key: 4,
|
|
411
417
|
class: "border-t-1/2 px-1",
|
|
412
418
|
content: "",
|
|
@@ -415,7 +421,7 @@ const me = {
|
|
|
415
421
|
language: Z.value,
|
|
416
422
|
lineNumbers: "",
|
|
417
423
|
lint: "",
|
|
418
|
-
modelValue: ((
|
|
424
|
+
modelValue: ((r = (s = e.example.body) == null ? void 0 : s.raw) == null ? void 0 : r.value) ?? "",
|
|
419
425
|
workspace: e.workspace,
|
|
420
426
|
"onUpdate:modelValue": q
|
|
421
427
|
}, null, 8, ["envVariables", "environment", "language", "modelValue", "workspace"]))
|
|
@@ -423,7 +429,7 @@ const me = {
|
|
|
423
429
|
}),
|
|
424
430
|
_: 1
|
|
425
431
|
}),
|
|
426
|
-
c(
|
|
432
|
+
c(j)
|
|
427
433
|
]),
|
|
428
434
|
_: 1
|
|
429
435
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAuRA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AASxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAwUF,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-c67b3580"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarErrorBoundary as
|
|
3
|
-
import { canMethodHaveBody as c, isDefined as
|
|
1
|
+
import { defineComponent as C, computed as p, ref as R, watch as E, openBlock as s, createBlock as y, withCtx as u, createElementVNode as v, unref as l, createElementBlock as d, createCommentVNode as h, toDisplayString as O, createVNode as n, withDirectives as i, vShow as t } from "vue";
|
|
2
|
+
import { ScalarErrorBoundary as H } from "@scalar/components";
|
|
3
|
+
import { canMethodHaveBody as c, isDefined as N, REGEX as w } from "@scalar/oas-utils/helpers";
|
|
4
4
|
import K from "../../../components/ContextBar.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import { matchesDomain as
|
|
7
|
-
import
|
|
5
|
+
import D from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
6
|
+
import { matchesDomain as U } from "../../../libs/send-request/set-request-cookies.js";
|
|
7
|
+
import $ from "./RequestBody.vue.js";
|
|
8
8
|
import f from "./RequestParams.vue.js";
|
|
9
|
-
import
|
|
9
|
+
import L from "./RequestPathParams.vue.js";
|
|
10
10
|
import Q from "./RequestAuth/RequestAuth.vue.js";
|
|
11
11
|
import M from "./RequestCodeExample.vue.js";
|
|
12
|
-
import { useWorkspace as
|
|
12
|
+
import { useWorkspace as T } from "../../../store/store.js";
|
|
13
13
|
import { useLayout as W } from "../../../hooks/useLayout.js";
|
|
14
14
|
const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, z = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
|
|
17
17
|
for: "requestname"
|
|
18
|
-
},
|
|
18
|
+
}, G = ["placeholder", "value"], I = {
|
|
19
19
|
key: 2,
|
|
20
20
|
class: "text-c-1 flex h-8 items-center"
|
|
21
|
-
},
|
|
21
|
+
}, X = { class: "request-section-content custom-scroll relative flex flex-1 flex-col divide-y" }, te = /* @__PURE__ */ C({
|
|
22
22
|
__name: "RequestSection",
|
|
23
23
|
props: {
|
|
24
24
|
collection: {},
|
|
@@ -31,8 +31,8 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
31
31
|
server: {},
|
|
32
32
|
workspace: {}
|
|
33
33
|
},
|
|
34
|
-
setup(
|
|
35
|
-
const { requestMutators:
|
|
34
|
+
setup(o) {
|
|
35
|
+
const { requestMutators: b, cookies: V, securitySchemes: S } = T(), { layout: m } = W(), P = p(() => {
|
|
36
36
|
const e = /* @__PURE__ */ new Set([
|
|
37
37
|
"All",
|
|
38
38
|
"Query",
|
|
@@ -42,27 +42,27 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
42
42
|
"Headers",
|
|
43
43
|
"Body"
|
|
44
44
|
]);
|
|
45
|
-
return
|
|
45
|
+
return o.example.parameters.path.length || e.delete("Variables"), c(o.operation.method ?? "get") || e.delete("Body"), k.value && e.delete("Auth"), [...e];
|
|
46
46
|
}), k = p(
|
|
47
47
|
() => {
|
|
48
48
|
var e;
|
|
49
|
-
return m === "modal" && ((e =
|
|
49
|
+
return m === "modal" && ((e = o.operation.security) == null ? void 0 : e.length) === 0;
|
|
50
50
|
}
|
|
51
|
-
), a =
|
|
52
|
-
|
|
53
|
-
() =>
|
|
51
|
+
), a = R("All");
|
|
52
|
+
E(
|
|
53
|
+
() => o.operation,
|
|
54
54
|
(e) => {
|
|
55
55
|
a.value === "Body" && e && !c(e.method) && (a.value = "All");
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
const A = (e) => {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
() => (
|
|
59
|
+
const r = e.target;
|
|
60
|
+
b.edit(o.operation.uid, "summary", r.value);
|
|
61
|
+
}, g = p(
|
|
62
|
+
() => (o.workspace.cookies ?? []).map((e) => V[e]).filter(N).filter((e) => e.name).filter(
|
|
63
63
|
(e) => {
|
|
64
|
-
var
|
|
65
|
-
return
|
|
64
|
+
var r;
|
|
65
|
+
return U(((r = o.server) == null ? void 0 : r.url) || o.operation.path, e.domain);
|
|
66
66
|
}
|
|
67
67
|
).map((e) => ({
|
|
68
68
|
key: e.name,
|
|
@@ -75,8 +75,8 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
75
75
|
},
|
|
76
76
|
enabled: !0
|
|
77
77
|
}))
|
|
78
|
-
);
|
|
79
|
-
return (e,
|
|
78
|
+
), q = () => o.operation.summary ? o.operation.summary : o.operation.path.replace(w.PROTOCOL, "") ? o.operation.path.replace(w.PROTOCOL, "") : "Request Name";
|
|
79
|
+
return (e, r) => (s(), y(D, {
|
|
80
80
|
"aria-label": `Request: ${e.operation.summary}`
|
|
81
81
|
}, {
|
|
82
82
|
title: u(() => [
|
|
@@ -86,20 +86,20 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
86
86
|
key: 1,
|
|
87
87
|
id: "requestname",
|
|
88
88
|
class: "text-c-1 group-hover-input pl-1.25 md:-ml-1.25 pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded has-[:focus-visible]:outline",
|
|
89
|
-
placeholder:
|
|
89
|
+
placeholder: q(),
|
|
90
90
|
value: e.operation.summary,
|
|
91
91
|
onInput: A
|
|
92
|
-
}, null, 40,
|
|
92
|
+
}, null, 40, G)) : (s(), d("span", I, O(e.operation.summary), 1))
|
|
93
93
|
]),
|
|
94
94
|
n(K, {
|
|
95
95
|
activeSection: a.value,
|
|
96
|
-
sections:
|
|
97
|
-
onSetActiveSection:
|
|
96
|
+
sections: P.value,
|
|
97
|
+
onSetActiveSection: r[0] || (r[0] = (B) => a.value = B)
|
|
98
98
|
}, null, 8, ["activeSection", "sections"])
|
|
99
99
|
]),
|
|
100
100
|
default: u(() => [
|
|
101
|
-
v("div",
|
|
102
|
-
e.collection && e.workspace && (l(m) !== "modal" || Object.keys(l(
|
|
101
|
+
v("div", X, [
|
|
102
|
+
e.collection && e.workspace && (l(m) !== "modal" || Object.keys(l(S) ?? {}).length) ? i((s(), y(Q, {
|
|
103
103
|
key: 0,
|
|
104
104
|
collection: e.collection,
|
|
105
105
|
envVariables: e.envVariables,
|
|
@@ -116,7 +116,7 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
116
116
|
!k.value && (a.value === "All" || a.value === "Auth")
|
|
117
117
|
]
|
|
118
118
|
]) : h("", !0),
|
|
119
|
-
i(n(
|
|
119
|
+
i(n(L, {
|
|
120
120
|
envVariables: e.envVariables,
|
|
121
121
|
environment: e.environment,
|
|
122
122
|
example: e.example,
|
|
@@ -138,7 +138,7 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
138
138
|
invalidParams: e.invalidParams,
|
|
139
139
|
operation: e.operation,
|
|
140
140
|
paramKey: "cookies",
|
|
141
|
-
readOnlyEntries:
|
|
141
|
+
readOnlyEntries: g.value,
|
|
142
142
|
title: "Cookies",
|
|
143
143
|
workspace: e.workspace,
|
|
144
144
|
workspaceParamKey: "cookies"
|
|
@@ -169,7 +169,7 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
169
169
|
}, null, 8, ["envVariables", "environment", "example", "invalidParams", "operation", "workspace"]), [
|
|
170
170
|
[t, a.value === "All" || a.value === "Query"]
|
|
171
171
|
]),
|
|
172
|
-
i(n(
|
|
172
|
+
i(n($, {
|
|
173
173
|
envVariables: e.envVariables,
|
|
174
174
|
environment: e.environment,
|
|
175
175
|
example: e.example,
|
|
@@ -182,8 +182,8 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
182
182
|
e.operation.method && (a.value === "All" || a.value === "Body") && l(c)(e.operation.method)
|
|
183
183
|
]
|
|
184
184
|
]),
|
|
185
|
-
|
|
186
|
-
n(l(
|
|
185
|
+
r[1] || (r[1] = v("div", { class: "-my-0.25 flex flex-grow" }, null, -1)),
|
|
186
|
+
n(l(H), null, {
|
|
187
187
|
default: u(() => [
|
|
188
188
|
n(M, {
|
|
189
189
|
collection: e.collection,
|
|
@@ -202,5 +202,5 @@ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
|
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
204
|
export {
|
|
205
|
-
|
|
205
|
+
te as default
|
|
206
206
|
};
|
|
@@ -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":"AAmPA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAOlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,CAAC,uBAAuB,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,EAAE,CAAA;IAClE,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;IACpB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC5B,CAAC;;;;;;;;;;;;;;;;;;;;yBARsB,OAAO;sBACV,OAAO;cACf,OAAO;gBACL,OAAO;;AA6exB,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-cabdb6a1"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|