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