@scalar/api-client 2.2.21 → 2.2.23
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 +16 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +70 -71
- package/dist/components/AddressBar/AddressBarServer.vue.js +26 -26
- 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 +46 -46
- package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +42 -38
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
- package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +22 -19
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +57 -49
- package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
- package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +16 -16
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarToggle.vue.js +3 -3
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +71 -64
- package/dist/layouts/App/ApiClientApp.vue.js +4 -1
- package/dist/layouts/App/create-api-client-app.d.ts +2 -1
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
- package/dist/layouts/Modal/create-api-client-modal.d.ts +4 -2
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +2 -1
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +12 -11
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +54 -47
- package/dist/libs/extractAttachmentFilename.d.ts +3 -0
- package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
- package/dist/libs/extractAttachmentFilename.js +7 -7
- package/dist/libs/importers/curl.d.ts.map +1 -1
- package/dist/libs/importers/curl.js +18 -18
- package/dist/libs/normalize-headers.d.ts.map +1 -1
- package/dist/libs/normalize-headers.js +2 -2
- package/dist/libs/parse-curl.js +39 -36
- package/dist/store/active-entities.d.ts +4 -4
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +88 -86
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +29 -29
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +27 -23
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +94 -77
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +27 -27
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +18 -18
- package/dist/store/store.d.ts +5 -5
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +53 -48
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +35 -33
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +14 -9
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +39 -37
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +94 -89
- 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 +118 -119
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
- 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 +192 -178
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
- package/dist/views/Request/RequestSidebar.vue.d.ts +3 -4
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +166 -164
- 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 +168 -150
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts +0 -1
- 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 +44 -49
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.js +37 -31
- package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +147 -130
- package/dist/views/Request/types/sidebar-item.d.ts +4 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.js +38 -35
- package/dist/views/Servers/Servers.vue2.js +38 -35
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/dist/views/Settings/Settings.vue2.js +15 -15
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
- package/package.json +6 -6
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useActiveEntities as
|
|
8
|
-
import { ScalarListbox as
|
|
9
|
-
import { requestExampleParametersSchema as
|
|
10
|
-
import { canMethodHaveBody as
|
|
11
|
-
import
|
|
12
|
-
import { useWorkspace as
|
|
13
|
-
import { useFileDialog as
|
|
14
|
-
const
|
|
1
|
+
import { defineComponent as ae, computed as w, ref as te, watch as $, openBlock as g, createBlock as x, withCtx as c, createTextVNode as H, toDisplayString as _, createVNode as m, unref as s, createElementVNode as D, createCommentVNode as oe, createElementBlock as V, Fragment as ne, nextTick as le } from "vue";
|
|
2
|
+
import re from "../../../components/CodeInput/CodeInput.vue.js";
|
|
3
|
+
import ie from "../../../components/DataTable/DataTable.vue.js";
|
|
4
|
+
import ue from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
|
+
import P from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
|
+
import de from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
|
+
import { useActiveEntities as se } from "../../../store/active-entities.js";
|
|
8
|
+
import { ScalarListbox as X, ScalarButton as U, ScalarIcon as C } from "@scalar/components";
|
|
9
|
+
import { requestExampleParametersSchema as Y } from "@scalar/oas-utils/entities/spec";
|
|
10
|
+
import { canMethodHaveBody as ce } from "@scalar/oas-utils/helpers";
|
|
11
|
+
import G from "./RequestTable.vue.js";
|
|
12
|
+
import { useWorkspace as me } from "../../../store/store.js";
|
|
13
|
+
import { useFileDialog as K } from "../../../hooks/useFileDialog.js";
|
|
14
|
+
const ve = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "border-t-1/2 text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
|
|
17
|
-
},
|
|
17
|
+
}, fe = {
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "flex items-center justify-center p-1.5 overflow-hidden"
|
|
20
|
-
},
|
|
20
|
+
}, pe = { class: "text-c-2 text-xs w-full border rounded p-1 max-w-full overflow-hidden whitespace-nowrap" }, Ce = /* @__PURE__ */ ae({
|
|
21
21
|
__name: "RequestBody",
|
|
22
22
|
props: {
|
|
23
23
|
title: {}
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const { activeRequest:
|
|
25
|
+
setup(ye) {
|
|
26
|
+
const { activeRequest: v, activeExample: o } = se(), { requestExampleMutators: i } = me(), Q = {
|
|
27
27
|
json: "json",
|
|
28
28
|
xml: "xml",
|
|
29
29
|
yaml: "yaml",
|
|
30
30
|
edn: "edn",
|
|
31
31
|
other: "html"
|
|
32
|
-
},
|
|
32
|
+
}, F = Object.entries({
|
|
33
33
|
multipartForm: "Multipart Form",
|
|
34
34
|
formUrlEncoded: "Form URL Encoded",
|
|
35
35
|
binaryFile: "Binary File",
|
|
@@ -42,59 +42,67 @@ const se = {
|
|
|
42
42
|
}).map(([e, a]) => ({
|
|
43
43
|
id: e,
|
|
44
44
|
label: a
|
|
45
|
-
})),
|
|
45
|
+
})), E = w(() => {
|
|
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
|
-
}),
|
|
49
|
-
get: () =>
|
|
50
|
-
(e) => e.id ===
|
|
51
|
-
) ??
|
|
48
|
+
}), y = w({
|
|
49
|
+
get: () => F.find(
|
|
50
|
+
(e) => e.id === E.value
|
|
51
|
+
) ?? F[F.length - 1],
|
|
52
52
|
set: (e) => {
|
|
53
|
-
e != null && e.id &&
|
|
53
|
+
e != null && e.id && W(e.id);
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
}), R = te(null), Z = w(() => {
|
|
56
|
+
var a;
|
|
57
|
+
const e = (a = y.value) == null ? void 0 : a.id;
|
|
58
|
+
return Q[e] ?? "plaintext";
|
|
58
59
|
});
|
|
59
|
-
function
|
|
60
|
+
function N() {
|
|
60
61
|
console.log("deleteRow");
|
|
61
62
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
const S = (e, a, t) => {
|
|
64
|
+
var l, r, d, f, p, h, k;
|
|
65
|
+
if (!v.value || !o.value) return;
|
|
66
|
+
const n = b.value;
|
|
67
|
+
if (n.length > e) {
|
|
68
|
+
const u = [...n];
|
|
69
|
+
u[e] = {
|
|
70
|
+
...u[e],
|
|
71
|
+
[a]: t || "",
|
|
72
|
+
value: ((l = u[e]) == null ? void 0 : l.value) || "",
|
|
73
|
+
key: ((r = u[e]) == null ? void 0 : r.key) || "",
|
|
74
|
+
enabled: ((d = u[e]) == null ? void 0 : d.enabled) ?? !1
|
|
75
|
+
}, (((f = u[e]) == null ? void 0 : f.key) !== "" || ((p = u[e]) == null ? void 0 : p.value) !== "") && (u[e].enabled = !0), ((h = u[e]) == null ? void 0 : h.key) === "" && ((k = u[e]) == null ? void 0 : k.value) === "" && u.splice(e, 1), i.edit(
|
|
68
76
|
o.value.uid,
|
|
69
77
|
"body.formData.value",
|
|
70
|
-
|
|
78
|
+
u
|
|
71
79
|
);
|
|
72
80
|
} else {
|
|
73
|
-
const
|
|
81
|
+
const u = [Y.parse({ [a]: t })];
|
|
74
82
|
i.edit(
|
|
75
83
|
o.value.uid,
|
|
76
84
|
"body.formData.value",
|
|
77
|
-
|
|
78
|
-
),
|
|
79
|
-
var
|
|
80
|
-
if (!
|
|
81
|
-
(
|
|
85
|
+
u
|
|
86
|
+
), le(() => {
|
|
87
|
+
var A;
|
|
88
|
+
if (!R.value) return;
|
|
89
|
+
(A = R.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || A.focus();
|
|
82
90
|
});
|
|
83
91
|
}
|
|
84
|
-
e ===
|
|
85
|
-
},
|
|
92
|
+
e === n.length - 1 && O();
|
|
93
|
+
}, b = w(
|
|
86
94
|
() => {
|
|
87
95
|
var e, a, t;
|
|
88
96
|
return ((t = (a = (e = o.value) == null ? void 0 : e.body) == null ? void 0 : a.formData) == null ? void 0 : t.value) ?? [];
|
|
89
97
|
}
|
|
90
|
-
),
|
|
91
|
-
const e =
|
|
92
|
-
(!e || e.key !== "" || e.value !== "") &&
|
|
93
|
-
},
|
|
94
|
-
if (!
|
|
95
|
-
const e =
|
|
98
|
+
), j = () => {
|
|
99
|
+
const e = b.value[b.value.length - 1];
|
|
100
|
+
(!e || e.key !== "" || e.value !== "") && O();
|
|
101
|
+
}, O = () => {
|
|
102
|
+
if (!v.value || !o.value) return;
|
|
103
|
+
const e = Y.parse({
|
|
96
104
|
enabled: !1
|
|
97
|
-
}), a = [...
|
|
105
|
+
}), a = [...b.value, e];
|
|
98
106
|
o.value.body.formData ? i.edit(
|
|
99
107
|
o.value.uid,
|
|
100
108
|
"body.formData.value",
|
|
@@ -103,20 +111,20 @@ const se = {
|
|
|
103
111
|
value: a,
|
|
104
112
|
encoding: "form-data"
|
|
105
113
|
});
|
|
106
|
-
},
|
|
107
|
-
if (!
|
|
108
|
-
const t =
|
|
114
|
+
}, q = (e, a) => {
|
|
115
|
+
if (!v.value || !o.value) return;
|
|
116
|
+
const t = b.value;
|
|
109
117
|
if (t.length > e) {
|
|
110
|
-
const
|
|
111
|
-
|
|
118
|
+
const n = [...t];
|
|
119
|
+
n[e] && (n[e].enabled = a), i.edit(
|
|
112
120
|
o.value.uid,
|
|
113
121
|
"body.formData.value",
|
|
114
|
-
|
|
122
|
+
n
|
|
115
123
|
);
|
|
116
124
|
}
|
|
117
|
-
},
|
|
118
|
-
!
|
|
119
|
-
},
|
|
125
|
+
}, L = (e) => {
|
|
126
|
+
!v.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
|
|
127
|
+
}, M = (e) => e === "multipartForm" ? {
|
|
120
128
|
activeBody: "formData",
|
|
121
129
|
encoding: "form-data",
|
|
122
130
|
header: "multipart/form-data"
|
|
@@ -148,10 +156,10 @@ const se = {
|
|
|
148
156
|
activeBody: "raw",
|
|
149
157
|
encoding: "html",
|
|
150
158
|
header: "application/html"
|
|
151
|
-
} : { activeBody: "raw", encoding: void 0, header: void 0 },
|
|
152
|
-
var
|
|
159
|
+
} : { activeBody: "raw", encoding: void 0, header: void 0 }, W = (e) => {
|
|
160
|
+
var d, f;
|
|
153
161
|
if (!o.value) return;
|
|
154
|
-
const { activeBody: a, encoding: t, header:
|
|
162
|
+
const { activeBody: a, encoding: t, header: n } = M(e);
|
|
155
163
|
if (i.edit(
|
|
156
164
|
o.value.uid,
|
|
157
165
|
"body.activeBody",
|
|
@@ -159,38 +167,41 @@ const se = {
|
|
|
159
167
|
), t && a === "raw")
|
|
160
168
|
i.edit(o.value.uid, "body.raw", {
|
|
161
169
|
encoding: t,
|
|
162
|
-
value: ((
|
|
170
|
+
value: ((d = o.value.body.raw) == null ? void 0 : d.value) ?? ""
|
|
163
171
|
});
|
|
164
172
|
else if (t && a === "formData")
|
|
165
173
|
i.edit(o.value.uid, "body.formData", {
|
|
166
174
|
encoding: t,
|
|
167
|
-
value: ((
|
|
175
|
+
value: ((f = o.value.body.formData) == null ? void 0 : f.value) ?? []
|
|
168
176
|
});
|
|
169
177
|
else if (!t) {
|
|
170
|
-
const { raw:
|
|
171
|
-
i.edit(o.value.uid, "body",
|
|
178
|
+
const { raw: p, ...h } = o.value.body;
|
|
179
|
+
i.edit(o.value.uid, "body", h);
|
|
172
180
|
}
|
|
173
|
-
const
|
|
174
|
-
(
|
|
181
|
+
const l = [...o.value.parameters.headers], r = l.findIndex(
|
|
182
|
+
(p) => p.key.toLowerCase() === "content-type"
|
|
175
183
|
);
|
|
176
|
-
r >= 0 ? l ?
|
|
184
|
+
r >= 0 ? n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1) : n && l.unshift({
|
|
177
185
|
key: "Content-Type",
|
|
178
|
-
value:
|
|
186
|
+
value: n,
|
|
179
187
|
enabled: !0
|
|
180
188
|
}), i.edit(
|
|
181
189
|
o.value.uid,
|
|
182
190
|
"parameters.headers",
|
|
183
|
-
|
|
191
|
+
l
|
|
184
192
|
);
|
|
185
|
-
},
|
|
186
|
-
const { open: a } =
|
|
193
|
+
}, z = async (e) => {
|
|
194
|
+
const { open: a } = K({
|
|
187
195
|
onChange: async (t) => {
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
const r = [...
|
|
196
|
+
const n = t == null ? void 0 : t[0];
|
|
197
|
+
if (n && v.value && o.value) {
|
|
198
|
+
const r = [...b.value];
|
|
191
199
|
r[e] = {
|
|
192
200
|
...r[e],
|
|
193
|
-
file:
|
|
201
|
+
file: n,
|
|
202
|
+
value: n.name,
|
|
203
|
+
key: n.name,
|
|
204
|
+
enabled: !0
|
|
194
205
|
}, i.edit(
|
|
195
206
|
o.value.uid,
|
|
196
207
|
"body.formData.value",
|
|
@@ -203,26 +214,29 @@ const se = {
|
|
|
203
214
|
});
|
|
204
215
|
a();
|
|
205
216
|
};
|
|
206
|
-
function
|
|
207
|
-
!
|
|
217
|
+
function I() {
|
|
218
|
+
!v.value || !o.value || i.edit(o.value.uid, "body.binary", void 0);
|
|
208
219
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!
|
|
211
|
-
const t = [...
|
|
220
|
+
function J(e) {
|
|
221
|
+
if (!v.value || !o.value) return;
|
|
222
|
+
const t = [...b.value];
|
|
212
223
|
t[e] = {
|
|
213
224
|
...t[e],
|
|
214
|
-
file: void 0
|
|
225
|
+
file: void 0,
|
|
226
|
+
value: "",
|
|
227
|
+
key: "",
|
|
228
|
+
enabled: !1
|
|
215
229
|
}, i.edit(
|
|
216
230
|
o.value.uid,
|
|
217
231
|
"body.formData.value",
|
|
218
232
|
t
|
|
219
233
|
);
|
|
220
234
|
}
|
|
221
|
-
function
|
|
222
|
-
const { open: e } =
|
|
235
|
+
function ee() {
|
|
236
|
+
const { open: e } = K({
|
|
223
237
|
onChange: async (a) => {
|
|
224
238
|
const t = a == null ? void 0 : a[0];
|
|
225
|
-
t &&
|
|
239
|
+
t && v.value && o.value && i.edit(
|
|
226
240
|
o.value.uid,
|
|
227
241
|
"body.binary",
|
|
228
242
|
t
|
|
@@ -233,82 +247,82 @@ const se = {
|
|
|
233
247
|
});
|
|
234
248
|
e();
|
|
235
249
|
}
|
|
236
|
-
|
|
237
|
-
|
|
250
|
+
$(
|
|
251
|
+
y,
|
|
238
252
|
(e) => {
|
|
239
|
-
["multipartForm", "formUrlEncoded"].includes(e == null ? void 0 : e.id) &&
|
|
253
|
+
["multipartForm", "formUrlEncoded"].includes((e == null ? void 0 : e.id) || "") && j();
|
|
240
254
|
},
|
|
241
255
|
{ immediate: !0 }
|
|
242
|
-
),
|
|
256
|
+
), $(
|
|
243
257
|
() => {
|
|
244
258
|
var e;
|
|
245
259
|
return (e = o.value) == null ? void 0 : e.uid;
|
|
246
260
|
},
|
|
247
261
|
() => {
|
|
248
262
|
var e;
|
|
249
|
-
(e =
|
|
250
|
-
|
|
251
|
-
) &&
|
|
263
|
+
(e = v.value) != null && e.method && ce(v.value.method) && W(E.value), ["multipartForm", "formUrlEncoded"].includes(
|
|
264
|
+
E.value
|
|
265
|
+
) && j();
|
|
252
266
|
},
|
|
253
267
|
{ immediate: !0 }
|
|
254
268
|
);
|
|
255
|
-
const
|
|
256
|
-
var
|
|
257
|
-
const e =
|
|
258
|
-
return Object.entries(
|
|
259
|
-
id:
|
|
260
|
-
label:
|
|
261
|
-
value:
|
|
269
|
+
const B = w(() => {
|
|
270
|
+
var l, r, d, f;
|
|
271
|
+
const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((d = (r = v.value) == null ? void 0 : r.requestBody) == null ? void 0 : d.content) || {}, n = a ? ((f = t[a]) == null ? void 0 : f.examples) || {} : {};
|
|
272
|
+
return Object.entries(n).map(([p, h]) => ({
|
|
273
|
+
id: p,
|
|
274
|
+
label: p,
|
|
275
|
+
value: h
|
|
262
276
|
}));
|
|
263
|
-
}),
|
|
277
|
+
}), T = w({
|
|
264
278
|
get: () => {
|
|
265
|
-
var
|
|
266
|
-
const e = ((
|
|
267
|
-
return
|
|
268
|
-
const
|
|
269
|
-
return JSON.stringify(
|
|
270
|
-
}) ??
|
|
279
|
+
var n, l;
|
|
280
|
+
const e = ((l = (n = o.value) == null ? void 0 : n.body.raw) == null ? void 0 : l.value) ?? "{}", a = JSON.parse(e);
|
|
281
|
+
return B.value.find((r) => {
|
|
282
|
+
const d = r.value;
|
|
283
|
+
return JSON.stringify(d.value) === JSON.stringify(a);
|
|
284
|
+
}) ?? B.value[0];
|
|
271
285
|
},
|
|
272
286
|
set: (e) => {
|
|
273
287
|
if (e != null && e.id) {
|
|
274
|
-
const a =
|
|
288
|
+
const a = B.value.find(
|
|
275
289
|
(t) => t.id === e.id
|
|
276
290
|
);
|
|
277
291
|
if (a) {
|
|
278
292
|
const t = a.value;
|
|
279
|
-
|
|
293
|
+
L(JSON.stringify(t.value, null, 2));
|
|
280
294
|
}
|
|
281
295
|
}
|
|
282
296
|
}
|
|
283
297
|
});
|
|
284
|
-
return (e, a) => (
|
|
285
|
-
title:
|
|
286
|
-
|
|
298
|
+
return (e, a) => (g(), x(de, null, {
|
|
299
|
+
title: c(() => [
|
|
300
|
+
H(_(e.title), 1)
|
|
287
301
|
]),
|
|
288
|
-
default:
|
|
289
|
-
|
|
290
|
-
default:
|
|
291
|
-
|
|
292
|
-
default:
|
|
293
|
-
|
|
294
|
-
default:
|
|
295
|
-
s(
|
|
296
|
-
modelValue:
|
|
297
|
-
"onUpdate:modelValue": a[0] || (a[0] = (t) =>
|
|
298
|
-
options:
|
|
302
|
+
default: c(() => [
|
|
303
|
+
m(ie, { columns: [""] }, {
|
|
304
|
+
default: c(() => [
|
|
305
|
+
m(P, null, {
|
|
306
|
+
default: c(() => [
|
|
307
|
+
m(ue, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
|
|
308
|
+
default: c(() => [
|
|
309
|
+
m(s(X), {
|
|
310
|
+
modelValue: y.value,
|
|
311
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => y.value = t),
|
|
312
|
+
options: s(F),
|
|
299
313
|
teleport: ""
|
|
300
314
|
}, {
|
|
301
|
-
default:
|
|
302
|
-
s(
|
|
315
|
+
default: c(() => [
|
|
316
|
+
m(s(U), {
|
|
303
317
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
304
318
|
fullWidth: "",
|
|
305
319
|
variant: "ghost"
|
|
306
320
|
}, {
|
|
307
|
-
default:
|
|
321
|
+
default: c(() => {
|
|
308
322
|
var t;
|
|
309
323
|
return [
|
|
310
|
-
|
|
311
|
-
s(
|
|
324
|
+
D("span", null, _((t = y.value) == null ? void 0 : t.label), 1),
|
|
325
|
+
m(s(C), {
|
|
312
326
|
icon: "ChevronDown",
|
|
313
327
|
size: "md"
|
|
314
328
|
})
|
|
@@ -319,25 +333,25 @@ const se = {
|
|
|
319
333
|
]),
|
|
320
334
|
_: 1
|
|
321
335
|
}, 8, ["modelValue", "options"]),
|
|
322
|
-
|
|
336
|
+
B.value.length > 0 ? (g(), x(s(X), {
|
|
323
337
|
key: 0,
|
|
324
|
-
modelValue:
|
|
325
|
-
"onUpdate:modelValue": a[1] || (a[1] = (t) =>
|
|
326
|
-
options:
|
|
338
|
+
modelValue: T.value,
|
|
339
|
+
"onUpdate:modelValue": a[1] || (a[1] = (t) => T.value = t),
|
|
340
|
+
options: B.value,
|
|
327
341
|
side: "left",
|
|
328
342
|
teleport: ""
|
|
329
343
|
}, {
|
|
330
|
-
default:
|
|
331
|
-
s(
|
|
344
|
+
default: c(() => [
|
|
345
|
+
m(s(U), {
|
|
332
346
|
class: "flex gap-1.5 h-full px-2 text-c-2 font-normal hover:text-c-1 w-fit",
|
|
333
347
|
fullWidth: "",
|
|
334
348
|
variant: "ghost"
|
|
335
349
|
}, {
|
|
336
|
-
default:
|
|
350
|
+
default: c(() => {
|
|
337
351
|
var t;
|
|
338
352
|
return [
|
|
339
|
-
|
|
340
|
-
s(
|
|
353
|
+
D("span", null, _((t = T.value) == null ? void 0 : t.label), 1),
|
|
354
|
+
m(s(C), {
|
|
341
355
|
icon: "ChevronDown",
|
|
342
356
|
size: "md"
|
|
343
357
|
})
|
|
@@ -347,43 +361,43 @@ const se = {
|
|
|
347
361
|
})
|
|
348
362
|
]),
|
|
349
363
|
_: 1
|
|
350
|
-
}, 8, ["modelValue", "options"])) :
|
|
364
|
+
}, 8, ["modelValue", "options"])) : oe("", !0)
|
|
351
365
|
]),
|
|
352
366
|
_: 1
|
|
353
367
|
})
|
|
354
368
|
]),
|
|
355
369
|
_: 1
|
|
356
370
|
}),
|
|
357
|
-
|
|
358
|
-
default:
|
|
359
|
-
var t,
|
|
371
|
+
m(P, null, {
|
|
372
|
+
default: c(() => {
|
|
373
|
+
var t, n, l, r, d, f, p, h, k;
|
|
360
374
|
return [
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
]))) :
|
|
364
|
-
(
|
|
365
|
-
|
|
366
|
-
s(
|
|
375
|
+
((t = y.value) == null ? void 0 : t.id) === "none" ? (g(), V("div", ve, a[2] || (a[2] = [
|
|
376
|
+
D("span", null, "No Body", -1)
|
|
377
|
+
]))) : ((n = y.value) == null ? void 0 : n.id) === "binaryFile" ? (g(), V("div", fe, [
|
|
378
|
+
(l = s(o)) != null && l.body.binary ? (g(), V(ne, { key: 0 }, [
|
|
379
|
+
D("span", pe, _(((r = s(o)) == null ? void 0 : r.body.binary).name), 1),
|
|
380
|
+
m(s(U), {
|
|
367
381
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1 shadow-none",
|
|
368
382
|
size: "sm",
|
|
369
383
|
variant: "outlined",
|
|
370
|
-
onClick:
|
|
384
|
+
onClick: I
|
|
371
385
|
}, {
|
|
372
|
-
default:
|
|
373
|
-
|
|
386
|
+
default: c(() => a[3] || (a[3] = [
|
|
387
|
+
H(" Delete ")
|
|
374
388
|
])),
|
|
375
389
|
_: 1
|
|
376
390
|
})
|
|
377
|
-
], 64)) : (
|
|
391
|
+
], 64)) : (g(), x(s(U), {
|
|
378
392
|
key: 1,
|
|
379
393
|
class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 shadow-none",
|
|
380
394
|
size: "sm",
|
|
381
395
|
variant: "outlined",
|
|
382
|
-
onClick:
|
|
396
|
+
onClick: ee
|
|
383
397
|
}, {
|
|
384
|
-
default:
|
|
385
|
-
a[4] || (a[4] =
|
|
386
|
-
s(
|
|
398
|
+
default: c(() => [
|
|
399
|
+
a[4] || (a[4] = D("span", null, "Upload File", -1)),
|
|
400
|
+
m(s(C), {
|
|
387
401
|
class: "ml-1",
|
|
388
402
|
icon: "UploadSimple",
|
|
389
403
|
size: "xs",
|
|
@@ -392,47 +406,47 @@ const se = {
|
|
|
392
406
|
]),
|
|
393
407
|
_: 1
|
|
394
408
|
}))
|
|
395
|
-
])) :
|
|
409
|
+
])) : ((d = y.value) == null ? void 0 : d.id) == "multipartForm" ? (g(), x(G, {
|
|
396
410
|
key: 2,
|
|
397
411
|
ref_key: "tableWrapperRef",
|
|
398
|
-
ref:
|
|
412
|
+
ref: R,
|
|
399
413
|
class: "!m-0 rounded-t-none shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
|
|
400
414
|
columns: ["32px", "", "", "61px"],
|
|
401
|
-
items:
|
|
415
|
+
items: b.value,
|
|
402
416
|
showUploadButton: "",
|
|
403
|
-
onDeleteRow:
|
|
404
|
-
onRemoveFile:
|
|
405
|
-
onToggleRow:
|
|
406
|
-
onUpdateRow:
|
|
407
|
-
onUploadFile:
|
|
408
|
-
}, null, 8, ["items"])) :
|
|
417
|
+
onDeleteRow: N,
|
|
418
|
+
onRemoveFile: J,
|
|
419
|
+
onToggleRow: q,
|
|
420
|
+
onUpdateRow: S,
|
|
421
|
+
onUploadFile: z
|
|
422
|
+
}, null, 8, ["items"])) : ((f = y.value) == null ? void 0 : f.id) == "formUrlEncoded" ? (g(), x(G, {
|
|
409
423
|
key: 3,
|
|
410
424
|
ref_key: "tableWrapperRef",
|
|
411
|
-
ref:
|
|
425
|
+
ref: R,
|
|
412
426
|
class: "!m-0 rounded-t-none border-t-0 shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
|
|
413
427
|
columns: ["32px", "", "", "61px"],
|
|
414
|
-
items:
|
|
428
|
+
items: b.value,
|
|
415
429
|
showUploadButton: "",
|
|
416
|
-
onDeleteRow:
|
|
417
|
-
onRemoveFile:
|
|
418
|
-
onToggleRow:
|
|
419
|
-
onUpdateRow:
|
|
420
|
-
onUploadFile:
|
|
421
|
-
}, null, 8, ["items"])) : (
|
|
430
|
+
onDeleteRow: N,
|
|
431
|
+
onRemoveFile: J,
|
|
432
|
+
onToggleRow: q,
|
|
433
|
+
onUpdateRow: S,
|
|
434
|
+
onUploadFile: z
|
|
435
|
+
}, null, 8, ["items"])) : (g(), x(re, {
|
|
422
436
|
key: 4,
|
|
423
437
|
class: "border-t-1/2",
|
|
424
438
|
content: "",
|
|
425
|
-
language:
|
|
439
|
+
language: Z.value,
|
|
426
440
|
lineNumbers: "",
|
|
427
441
|
lint: "",
|
|
428
|
-
modelValue: ((
|
|
429
|
-
"onUpdate:modelValue":
|
|
442
|
+
modelValue: ((k = (h = (p = s(o)) == null ? void 0 : p.body) == null ? void 0 : h.raw) == null ? void 0 : k.value) ?? "",
|
|
443
|
+
"onUpdate:modelValue": L
|
|
430
444
|
}, null, 8, ["language", "modelValue"]))
|
|
431
445
|
];
|
|
432
446
|
}),
|
|
433
447
|
_: 1
|
|
434
448
|
}),
|
|
435
|
-
|
|
449
|
+
m(P)
|
|
436
450
|
]),
|
|
437
451
|
_: 1
|
|
438
452
|
})
|
|
@@ -442,5 +456,5 @@ const se = {
|
|
|
442
456
|
}
|
|
443
457
|
});
|
|
444
458
|
export {
|
|
445
|
-
|
|
459
|
+
Ce as default
|
|
446
460
|
};
|
|
@@ -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":"AAkNA,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;;AA2UF,wBAOG"}
|