@scalar/api-client 2.2.35 → 2.2.38
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 +61 -0
- 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 +107 -116
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts +2 -1
- 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 +96 -76
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts +5 -1
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +92 -86
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts +7 -10
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +5 -52
- package/dist/components/AddressBar/AddressBarServerItem.vue2.js +75 -2
- package/dist/components/CodeInput/CodeInput.vue.d.ts +5 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +126 -112
- package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +1 -0
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.js +21 -18
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts +1 -0
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +86 -54
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +22 -21
- package/dist/components/Form/Form.vue.d.ts.map +1 -1
- package/dist/components/Form/Form.vue.js +3 -3
- package/dist/components/Server/ServerVariablesForm.vue.d.ts +14 -0
- package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -0
- package/dist/components/Server/ServerVariablesForm.vue.js +47 -0
- package/dist/components/Server/ServerVariablesForm.vue2.js +4 -0
- package/dist/components/Server/ServerVariablesSelect.vue.d.ts +12 -0
- package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -0
- package/dist/components/Server/ServerVariablesSelect.vue.js +54 -0
- package/dist/components/Server/ServerVariablesSelect.vue2.js +4 -0
- package/dist/components/Server/ServerVariablesTextbox.vue.d.ts +11 -0
- package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -0
- package/dist/components/Server/ServerVariablesTextbox.vue.js +29 -0
- package/dist/components/Server/ServerVariablesTextbox.vue2.js +4 -0
- package/dist/components/Server/types.d.ts +9 -0
- package/dist/components/Server/types.d.ts.map +1 -0
- package/dist/components/SideNav/SideHelp.vue.js +16 -16
- 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 +11 -10
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue2.js +10 -9
- package/dist/components/TopNav/TopNav.vue.js +27 -27
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +99 -84
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +198 -168
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +99 -84
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +110 -90
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +86 -81
- package/dist/libs/find-request.d.ts.map +1 -1
- package/dist/libs/importers/curl.js +4 -4
- package/dist/libs/index.js +18 -19
- package/dist/libs/send-request/index.js +3 -4
- package/dist/libs/send-request/send-request.d.ts +0 -14
- package/dist/libs/send-request/send-request.d.ts.map +1 -1
- package/dist/libs/send-request/send-request.js +120 -142
- package/dist/libs/send-request/set-request-cookies.d.ts +27 -0
- package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -0
- package/dist/libs/send-request/set-request-cookies.js +54 -0
- package/dist/store/active-entities.d.ts +13 -4
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +15 -12
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/cookies.d.ts +4 -58
- package/dist/store/cookies.d.ts.map +1 -1
- package/dist/store/cookies.js +5 -17
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/request-example.d.ts +52 -2
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/requests.d.ts +2 -2
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/servers.d.ts +40 -20
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/store.d.ts +99 -86
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +51 -53
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +24 -37
- package/dist/views/Cookies/CookieModal.vue.d.ts +21 -0
- package/dist/views/Cookies/CookieModal.vue.d.ts.map +1 -0
- package/dist/views/Cookies/CookieModal.vue.js +7 -0
- package/dist/views/Cookies/CookieModal.vue2.js +88 -0
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +98 -119
- package/dist/views/Environment/Environment.vue2.js +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/Request.vue2.js +88 -89
- 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 +87 -88
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +2 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +16 -17
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +34 -34
- 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 +79 -66
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +57 -74
- 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 +91 -64
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +9 -2
- 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 +168 -129
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +5 -64
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +46 -2
- 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 +143 -143
- 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 +71 -71
- 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 +37 -37
- package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +19 -17
- 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 +27 -27
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +31 -31
- 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 +27 -26
- package/dist/views/Request/hooks/useOpenApiWatcher.js +1 -1
- package/dist/views/Request/libs/request.d.ts +12 -0
- package/dist/views/Request/libs/request.d.ts.map +1 -0
- package/dist/views/Request/libs/request.js +4 -0
- package/dist/views/Request/libs/{live-sync.d.ts → watch-mode.d.ts} +1 -1
- package/dist/views/Request/libs/watch-mode.d.ts.map +1 -0
- package/dist/views/Request/libs/{live-sync.js → watch-mode.js} +6 -6
- package/dist/views/Servers/Servers.vue2.js +29 -29
- package/package.json +10 -12
- package/dist/views/Cookies/CookieRaw.vue.js +0 -28
- package/dist/views/Cookies/CookieRaw.vue2.js +0 -4
- package/dist/views/Request/libs/live-sync.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as S, ref as f, computed as y, watch as x, openBlock as t, createElementBlock as l, withModifiers as k, Fragment as w, renderList as g, normalizeClass as p, createElementVNode as n, toDisplayString as _, unref as o, createCommentVNode as c, createBlock as C, withCtx as U, createVNode as v } from "vue";
|
|
2
2
|
import { useModal as z } from "@scalar/components";
|
|
3
3
|
import A from "./DeleteRequestAuthModal.vue.js";
|
|
4
4
|
import M from "./RequestExampleAuth.vue.js";
|
|
@@ -14,25 +14,25 @@ const E = {
|
|
|
14
14
|
}, F = {
|
|
15
15
|
key: 2,
|
|
16
16
|
class: "text-c-3 px-4 text-sm border-t min-h-16 justify-center flex items-center bg-b-1"
|
|
17
|
-
}, J = /* @__PURE__ */
|
|
17
|
+
}, J = /* @__PURE__ */ S({
|
|
18
18
|
__name: "RequestAuthDataTable",
|
|
19
19
|
props: {
|
|
20
20
|
selectedSecuritySchemeUids: {},
|
|
21
21
|
layout: { default: "client" }
|
|
22
22
|
},
|
|
23
23
|
setup(u) {
|
|
24
|
-
const { securitySchemes: d } = B(), m = z(), b = f(null), e = f(0), h =
|
|
24
|
+
const { securitySchemes: d } = B(), m = z(), b = f(null), e = f(0), h = y(() => u.selectedSecuritySchemeUids[e.value] || null);
|
|
25
25
|
return x(
|
|
26
26
|
() => u.selectedSecuritySchemeUids,
|
|
27
|
-
(
|
|
28
|
-
|
|
27
|
+
(r) => {
|
|
28
|
+
r[e.value] || (e.value = Math.max(0, e.value - 1));
|
|
29
29
|
}
|
|
30
|
-
), (
|
|
31
|
-
onSubmit:
|
|
30
|
+
), (r, s) => (t(), l("form", {
|
|
31
|
+
onSubmit: s[1] || (s[1] = k(() => {
|
|
32
32
|
}, ["prevent"]))
|
|
33
33
|
}, [
|
|
34
|
-
|
|
35
|
-
(
|
|
34
|
+
r.selectedSecuritySchemeUids.length > 1 ? (t(), l("div", E, [
|
|
35
|
+
(t(!0), l(w, null, g(r.selectedSecuritySchemeUids, (a, i) => (t(), l("div", {
|
|
36
36
|
key: a,
|
|
37
37
|
class: p(["flex relative h-8 z-1 cursor-pointer -mb-[var(--scalar-border-width)]", [e.value === i ? "text-c-1" : "text-c-3"]])
|
|
38
38
|
}, [
|
|
@@ -43,28 +43,27 @@ const E = {
|
|
|
43
43
|
}, [
|
|
44
44
|
n("span", q, _(o(d)[a] ? o(N)(o(d)[a]).label : ""), 1)
|
|
45
45
|
], 8, V),
|
|
46
|
-
|
|
47
|
-
e.value === i ? (
|
|
46
|
+
s[2] || (s[2] = n("div", { class: "absolute bottom-0 z-0 -inset-x-96 h-[var(--scalar-border-width)] bg-border" }, null, -1)),
|
|
47
|
+
e.value === i ? (t(), l("div", D)) : c("", !0)
|
|
48
48
|
], 2))), 128))
|
|
49
49
|
])) : c("", !0),
|
|
50
|
-
h.value ? (
|
|
50
|
+
h.value ? (t(), C(o($), {
|
|
51
51
|
key: 1,
|
|
52
|
-
class: p(["flex-1",
|
|
52
|
+
class: p(["flex-1", r.layout === "reference" && "border-0"]),
|
|
53
53
|
columns: [""]
|
|
54
54
|
}, {
|
|
55
55
|
default: U(() => [
|
|
56
56
|
v(M, {
|
|
57
|
-
layout: t.layout,
|
|
58
57
|
selectedSecuritySchemeUids: [h.value]
|
|
59
|
-
}, null, 8, ["
|
|
58
|
+
}, null, 8, ["selectedSecuritySchemeUids"])
|
|
60
59
|
]),
|
|
61
60
|
_: 1
|
|
62
61
|
}, 8, ["class"])) : c("", !0),
|
|
63
|
-
|
|
62
|
+
r.selectedSecuritySchemeUids.length ? c("", !0) : (t(), l("div", F, " No authentication selected ")),
|
|
64
63
|
v(A, {
|
|
65
64
|
scheme: b.value,
|
|
66
65
|
state: o(m),
|
|
67
|
-
onClose:
|
|
66
|
+
onClose: s[0] || (s[0] = (a) => o(m).hide())
|
|
68
67
|
}, null, 8, ["scheme", "state"])
|
|
69
68
|
], 32));
|
|
70
69
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./RequestExampleAuth.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-6fa7db1d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -145,7 +145,7 @@ const R = {
|
|
|
145
145
|
(a(!0), n(i, null, x(e == null ? void 0 : e.flows, (r, p, k) => (a(), n("button", {
|
|
146
146
|
key: p,
|
|
147
147
|
class: U(["floating-bg py-1 text-sm border-b-[1px] border-transparent relative cursor-pointer font-medium text-c-3", {
|
|
148
|
-
"!text-c-1 !border-current border-b-[1px] !rounded-none": t.layout
|
|
148
|
+
"!text-c-1 !border-current border-b-[1px] !rounded-none": t.layout !== "reference" && (d.value === p || k === 0 && !d.value),
|
|
149
149
|
"!text-c-1 !border-current border-b-[1px] !rounded-none opacity-100": t.layout === "reference" && (d.value === p || k === 0 && !d.value)
|
|
150
150
|
}]),
|
|
151
151
|
type: "button",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8a8f0448"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as ae, computed as w, ref as te, watch as $, openBlock as g, createBlock as x, withCtx as m, createTextVNode as H, toDisplayString as _, createVNode as v, unref as c, createElementVNode as D, createCommentVNode as oe, createElementBlock as V, Fragment as ne, nextTick as le } from "vue";
|
|
2
2
|
import re from "../../../components/CodeInput/CodeInput.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import ue from "../../../components/DataTable/DataTable.vue.js";
|
|
4
|
+
import ie from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
5
5
|
import P from "../../../components/DataTable/DataTableRow.vue.js";
|
|
6
6
|
import de from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
7
7
|
import { useActiveEntities as se } from "../../../store/active-entities.js";
|
|
@@ -23,7 +23,7 @@ const ve = {
|
|
|
23
23
|
title: {}
|
|
24
24
|
},
|
|
25
25
|
setup(ye) {
|
|
26
|
-
const { activeRequest: f, activeExample: o } = se(), { requestExampleMutators:
|
|
26
|
+
const { activeRequest: f, activeExample: o } = se(), { requestExampleMutators: i } = me(), Q = {
|
|
27
27
|
json: "json",
|
|
28
28
|
xml: "xml",
|
|
29
29
|
yaml: "yaml",
|
|
@@ -61,7 +61,7 @@ const ve = {
|
|
|
61
61
|
console.log("deleteRow");
|
|
62
62
|
}
|
|
63
63
|
const S = (e, a, t) => {
|
|
64
|
-
var l, r, d,
|
|
64
|
+
var l, r, d, u, p, h, k;
|
|
65
65
|
if (!f.value || !o.value) return;
|
|
66
66
|
const n = b.value;
|
|
67
67
|
if (n.length > e) {
|
|
@@ -72,14 +72,14 @@ const ve = {
|
|
|
72
72
|
key: ((r = s[e]) == null ? void 0 : r.key) || "",
|
|
73
73
|
enabled: ((d = s[e]) == null ? void 0 : d.enabled) ?? !1,
|
|
74
74
|
[a]: t || ""
|
|
75
|
-
}, (((
|
|
75
|
+
}, (((u = s[e]) == null ? void 0 : u.key) !== "" || ((p = s[e]) == null ? void 0 : p.value) !== "") && (s[e].enabled = !0), ((h = s[e]) == null ? void 0 : h.key) === "" && ((k = s[e]) == null ? void 0 : k.value) === "" && s.splice(e, 1), i.edit(
|
|
76
76
|
o.value.uid,
|
|
77
77
|
"body.formData.value",
|
|
78
78
|
s
|
|
79
79
|
);
|
|
80
80
|
} else {
|
|
81
81
|
const s = [Y.parse({ [a]: t })];
|
|
82
|
-
|
|
82
|
+
i.edit(
|
|
83
83
|
o.value.uid,
|
|
84
84
|
"body.formData.value",
|
|
85
85
|
s
|
|
@@ -103,11 +103,11 @@ const ve = {
|
|
|
103
103
|
const e = Y.parse({
|
|
104
104
|
enabled: !1
|
|
105
105
|
}), a = [...b.value, e];
|
|
106
|
-
o.value.body.formData ?
|
|
106
|
+
o.value.body.formData ? i.edit(
|
|
107
107
|
o.value.uid,
|
|
108
108
|
"body.formData.value",
|
|
109
109
|
a
|
|
110
|
-
) :
|
|
110
|
+
) : i.edit(o.value.uid, "body.formData", {
|
|
111
111
|
value: a,
|
|
112
112
|
encoding: "form-data"
|
|
113
113
|
});
|
|
@@ -116,14 +116,14 @@ const ve = {
|
|
|
116
116
|
const t = b.value;
|
|
117
117
|
if (t.length > e) {
|
|
118
118
|
const n = [...t];
|
|
119
|
-
n[e] && (n[e].enabled = a),
|
|
119
|
+
n[e] && (n[e].enabled = a), i.edit(
|
|
120
120
|
o.value.uid,
|
|
121
121
|
"body.formData.value",
|
|
122
122
|
n
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
}, L = (e) => {
|
|
126
|
-
!f.value || !o.value ||
|
|
126
|
+
!f.value || !o.value || i.edit(o.value.uid, "body.raw.value", e);
|
|
127
127
|
}, M = (e) => e === "multipartForm" ? {
|
|
128
128
|
activeBody: "formData",
|
|
129
129
|
encoding: "form-data",
|
|
@@ -157,35 +157,35 @@ const ve = {
|
|
|
157
157
|
encoding: "html",
|
|
158
158
|
header: "application/html"
|
|
159
159
|
} : { activeBody: "raw", encoding: void 0, header: void 0 }, W = (e) => {
|
|
160
|
-
var d,
|
|
160
|
+
var d, u;
|
|
161
161
|
if (!o.value) return;
|
|
162
162
|
const { activeBody: a, encoding: t, header: n } = M(e);
|
|
163
|
-
if (
|
|
163
|
+
if (i.edit(
|
|
164
164
|
o.value.uid,
|
|
165
165
|
"body.activeBody",
|
|
166
166
|
a
|
|
167
167
|
), t && a === "raw")
|
|
168
|
-
|
|
168
|
+
i.edit(o.value.uid, "body.raw", {
|
|
169
169
|
encoding: t,
|
|
170
170
|
value: ((d = o.value.body.raw) == null ? void 0 : d.value) ?? ""
|
|
171
171
|
});
|
|
172
172
|
else if (t && a === "formData")
|
|
173
|
-
|
|
173
|
+
i.edit(o.value.uid, "body.formData", {
|
|
174
174
|
encoding: t,
|
|
175
|
-
value: ((
|
|
175
|
+
value: ((u = o.value.body.formData) == null ? void 0 : u.value) ?? []
|
|
176
176
|
});
|
|
177
177
|
else if (!t && a !== "binary") {
|
|
178
178
|
const { raw: p, ...h } = o.value.body;
|
|
179
|
-
|
|
179
|
+
i.edit(o.value.uid, "body", h);
|
|
180
180
|
}
|
|
181
181
|
const l = [...o.value.parameters.headers], r = l.findIndex(
|
|
182
182
|
(p) => p.key.toLowerCase() === "content-type"
|
|
183
183
|
);
|
|
184
|
-
r >= 0 ? n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1) : n && l.
|
|
184
|
+
r >= 0 ? n && l[r] ? l[r].value = n : l[r] && l.splice(r, 1) : n && l.push({
|
|
185
185
|
key: "Content-Type",
|
|
186
186
|
value: n,
|
|
187
187
|
enabled: !0
|
|
188
|
-
}),
|
|
188
|
+
}), i.edit(
|
|
189
189
|
o.value.uid,
|
|
190
190
|
"parameters.headers",
|
|
191
191
|
l
|
|
@@ -196,17 +196,17 @@ const ve = {
|
|
|
196
196
|
var l, r;
|
|
197
197
|
const n = t == null ? void 0 : t[0];
|
|
198
198
|
if (n && f.value && o.value) {
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
...
|
|
199
|
+
const u = [...b.value];
|
|
200
|
+
u[e] = {
|
|
201
|
+
...u[e],
|
|
202
202
|
file: n,
|
|
203
|
-
value: ((l =
|
|
204
|
-
key: ((r =
|
|
203
|
+
value: ((l = u[e]) == null ? void 0 : l.value) || n.name,
|
|
204
|
+
key: ((r = u[e]) == null ? void 0 : r.key) || n.name,
|
|
205
205
|
enabled: !0
|
|
206
|
-
},
|
|
206
|
+
}, i.edit(
|
|
207
207
|
o.value.uid,
|
|
208
208
|
"body.formData.value",
|
|
209
|
-
|
|
209
|
+
u
|
|
210
210
|
);
|
|
211
211
|
}
|
|
212
212
|
},
|
|
@@ -216,7 +216,7 @@ const ve = {
|
|
|
216
216
|
a();
|
|
217
217
|
};
|
|
218
218
|
function I() {
|
|
219
|
-
!f.value || !o.value ||
|
|
219
|
+
!f.value || !o.value || i.edit(o.value.uid, "body.binary", void 0);
|
|
220
220
|
}
|
|
221
221
|
function J(e) {
|
|
222
222
|
if (!f.value || !o.value) return;
|
|
@@ -227,7 +227,7 @@ const ve = {
|
|
|
227
227
|
value: "",
|
|
228
228
|
key: "",
|
|
229
229
|
enabled: !1
|
|
230
|
-
},
|
|
230
|
+
}, i.edit(
|
|
231
231
|
o.value.uid,
|
|
232
232
|
"body.formData.value",
|
|
233
233
|
t
|
|
@@ -237,7 +237,7 @@ const ve = {
|
|
|
237
237
|
const { open: e } = K({
|
|
238
238
|
onChange: async (a) => {
|
|
239
239
|
const t = a == null ? void 0 : a[0];
|
|
240
|
-
t && f.value && o.value &&
|
|
240
|
+
t && f.value && o.value && i.edit(
|
|
241
241
|
o.value.uid,
|
|
242
242
|
"body.binary",
|
|
243
243
|
t
|
|
@@ -268,8 +268,8 @@ const ve = {
|
|
|
268
268
|
{ immediate: !0 }
|
|
269
269
|
);
|
|
270
270
|
const B = w(() => {
|
|
271
|
-
var l, r, d,
|
|
272
|
-
const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((d = (r = f.value) == null ? void 0 : r.requestBody) == null ? void 0 : d.content) || {}, n = a ? ((
|
|
271
|
+
var l, r, d, u;
|
|
272
|
+
const e = (l = y.value) == null ? void 0 : l.id, { header: a } = M(e), t = ((d = (r = f.value) == null ? void 0 : r.requestBody) == null ? void 0 : d.content) || {}, n = a ? ((u = t[a]) == null ? void 0 : u.examples) || {} : {};
|
|
273
273
|
return Object.entries(n).map(([p, h]) => ({
|
|
274
274
|
id: p,
|
|
275
275
|
label: p,
|
|
@@ -301,11 +301,11 @@ const ve = {
|
|
|
301
301
|
H(_(e.title), 1)
|
|
302
302
|
]),
|
|
303
303
|
default: m(() => [
|
|
304
|
-
v(
|
|
304
|
+
v(ue, { columns: [""] }, {
|
|
305
305
|
default: m(() => [
|
|
306
306
|
v(P, null, {
|
|
307
307
|
default: m(() => [
|
|
308
|
-
v(
|
|
308
|
+
v(ie, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
|
|
309
309
|
default: m(() => [
|
|
310
310
|
v(c(X), {
|
|
311
311
|
modelValue: y.value,
|
|
@@ -371,7 +371,7 @@ const ve = {
|
|
|
371
371
|
}),
|
|
372
372
|
v(P, null, {
|
|
373
373
|
default: m(() => {
|
|
374
|
-
var t, n, l, r, d,
|
|
374
|
+
var t, n, l, r, d, u, p, h, k;
|
|
375
375
|
return [
|
|
376
376
|
((t = y.value) == null ? void 0 : t.id) === "none" ? (g(), V("div", ve, a[2] || (a[2] = [
|
|
377
377
|
D("span", null, "No Body", -1)
|
|
@@ -420,7 +420,7 @@ const ve = {
|
|
|
420
420
|
onToggleRow: q,
|
|
421
421
|
onUpdateRow: S,
|
|
422
422
|
onUploadFile: z
|
|
423
|
-
}, null, 8, ["items"])) : ((
|
|
423
|
+
}, null, 8, ["items"])) : ((u = y.value) == null ? void 0 : u.id) == "formUrlEncoded" ? (g(), x(G, {
|
|
424
424
|
key: 3,
|
|
425
425
|
ref_key: "tableWrapperRef",
|
|
426
426
|
ref: R,
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { type RequestExample } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
title: string;
|
|
4
5
|
paramKey: keyof RequestExample['parameters'];
|
|
6
|
+
readOnlyEntries?: {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
route: RouteLocationRaw;
|
|
11
|
+
}[];
|
|
5
12
|
};
|
|
6
13
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
14
|
export default _default;
|
|
@@ -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":"AAqOA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;KACxB,EAAE,CAAA;CACJ,CAAC;;AAwVF,wBAOG"}
|
|
@@ -1,74 +1,75 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import
|
|
5
|
-
import { ScalarTooltip as D, ScalarButton as
|
|
6
|
-
import { requestExampleParametersSchema as
|
|
1
|
+
import { defineComponent as A, computed as m, onMounted as N, ref as V, watch as B, openBlock as v, createBlock as d, withCtx as r, createTextVNode as R, toDisplayString as k, createElementVNode as i, unref as b, createVNode as x, withModifiers as M, createCommentVNode as C, nextTick as E } from "vue";
|
|
2
|
+
import W from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useActiveEntities as z } from "../../../store/active-entities.js";
|
|
4
|
+
import _ from "./RequestTable.vue.js";
|
|
5
|
+
import { ScalarTooltip as D, ScalarButton as G } from "@scalar/components";
|
|
6
|
+
import { requestExampleParametersSchema as q } from "@scalar/oas-utils/entities/spec";
|
|
7
7
|
import { useWorkspace as U } from "../../../store/store.js";
|
|
8
|
-
const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, F = { class: "sr-only" },
|
|
8
|
+
const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100 request-meta-buttons" }, F = { class: "sr-only" }, te = /* @__PURE__ */ A({
|
|
9
9
|
__name: "RequestParams",
|
|
10
10
|
props: {
|
|
11
11
|
title: {},
|
|
12
|
-
paramKey: {}
|
|
12
|
+
paramKey: {},
|
|
13
|
+
readOnlyEntries: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
15
|
+
setup(w) {
|
|
16
|
+
const n = w, { activeRequest: u, activeExample: s } = z(), { requestExampleMutators: o } = U(), l = m(
|
|
16
17
|
() => {
|
|
17
18
|
var e;
|
|
18
|
-
return ((e = s.value) == null ? void 0 : e.parameters[
|
|
19
|
+
return ((e = s.value) == null ? void 0 : e.parameters[n.paramKey]) ?? [];
|
|
19
20
|
}
|
|
20
21
|
);
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
N(() => {
|
|
23
|
+
y();
|
|
23
24
|
});
|
|
24
25
|
const p = () => {
|
|
25
26
|
if (!u.value || !s.value) return;
|
|
26
|
-
const e =
|
|
27
|
-
|
|
27
|
+
const e = q.parse({ enabled: !1 }), t = [...l.value, e];
|
|
28
|
+
o.edit(
|
|
28
29
|
s.value.uid,
|
|
29
|
-
`parameters.${
|
|
30
|
+
`parameters.${n.paramKey}`,
|
|
30
31
|
t
|
|
31
32
|
);
|
|
32
|
-
},
|
|
33
|
+
}, c = V(null), P = (e, t, g) => {
|
|
33
34
|
if (!u.value || !s.value) return;
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const a = [...
|
|
35
|
+
const f = l.value;
|
|
36
|
+
if (f.length > e) {
|
|
37
|
+
const a = [...f];
|
|
37
38
|
if (!a[e]) return;
|
|
38
|
-
a[e] = { ...a[e], [t]:
|
|
39
|
+
a[e] = { ...a[e], [t]: g }, (a[e].key !== "" || a[e].value !== "") && (a[e].enabled = !0), a[e].key === "" && a[e].value === "" && a.splice(e, 1), o.edit(
|
|
39
40
|
s.value.uid,
|
|
40
|
-
`parameters.${
|
|
41
|
+
`parameters.${n.paramKey}`,
|
|
41
42
|
a
|
|
42
43
|
);
|
|
43
44
|
} else {
|
|
44
|
-
const a = [
|
|
45
|
-
|
|
45
|
+
const a = [q.parse({ [t]: g })];
|
|
46
|
+
o.edit(
|
|
46
47
|
s.value.uid,
|
|
47
|
-
`parameters.${
|
|
48
|
+
`parameters.${n.paramKey}`,
|
|
48
49
|
a
|
|
49
|
-
),
|
|
50
|
-
var
|
|
51
|
-
if (!
|
|
52
|
-
(
|
|
50
|
+
), E(() => {
|
|
51
|
+
var h;
|
|
52
|
+
if (!c.value) return;
|
|
53
|
+
(h = c.value.querySelectorAll("input")[t === "key" ? 0 : 1]) == null || h.focus();
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
e ===
|
|
56
|
-
},
|
|
56
|
+
e === f.length - 1 && p();
|
|
57
|
+
}, K = (e, t) => u.value && s.value && o.edit(
|
|
57
58
|
s.value.uid,
|
|
58
|
-
`parameters.${
|
|
59
|
+
`parameters.${n.paramKey}.${e}.enabled`,
|
|
59
60
|
t
|
|
60
|
-
),
|
|
61
|
+
), $ = () => {
|
|
61
62
|
if (!u.value || !s.value) return;
|
|
62
63
|
const e = l.value.filter((t) => t.required);
|
|
63
|
-
|
|
64
|
+
o.edit(
|
|
64
65
|
s.value.uid,
|
|
65
|
-
`parameters.${
|
|
66
|
+
`parameters.${n.paramKey}`,
|
|
66
67
|
e
|
|
67
|
-
),
|
|
68
|
+
), E(() => {
|
|
68
69
|
p();
|
|
69
70
|
});
|
|
70
71
|
};
|
|
71
|
-
function
|
|
72
|
+
function y() {
|
|
72
73
|
if (l.value.length === 0)
|
|
73
74
|
p();
|
|
74
75
|
else if (l.value.length >= 1) {
|
|
@@ -76,65 +77,77 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
76
77
|
e && e.key !== "" && e.value !== "" && p();
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
const
|
|
80
|
+
const O = m(
|
|
80
81
|
() => l.value.filter((e) => e.key || e.value).length
|
|
81
|
-
), T =
|
|
82
|
-
|
|
82
|
+
), T = m(() => l.value.length > 1);
|
|
83
|
+
B(
|
|
83
84
|
() => s.value,
|
|
84
85
|
(e, t) => {
|
|
85
|
-
e !== t &&
|
|
86
|
+
e !== t && y();
|
|
86
87
|
},
|
|
87
88
|
{ immediate: !0 }
|
|
88
|
-
)
|
|
89
|
+
);
|
|
90
|
+
const S = m(
|
|
91
|
+
() => (n.readOnlyEntries ?? []).length > 0
|
|
92
|
+
);
|
|
93
|
+
return (e, t) => (v(), d(W, {
|
|
89
94
|
class: "group/params",
|
|
90
|
-
itemCount:
|
|
95
|
+
itemCount: O.value
|
|
91
96
|
}, {
|
|
92
|
-
title:
|
|
93
|
-
k(
|
|
97
|
+
title: r(() => [
|
|
98
|
+
R(k(e.title), 1)
|
|
94
99
|
]),
|
|
95
|
-
actions:
|
|
96
|
-
|
|
97
|
-
T.value ? (
|
|
100
|
+
actions: r(() => [
|
|
101
|
+
i("div", j, [
|
|
102
|
+
T.value ? (v(), d(b(D), {
|
|
98
103
|
key: 0,
|
|
99
104
|
side: "right",
|
|
100
105
|
sideOffset: 12
|
|
101
106
|
}, {
|
|
102
|
-
trigger:
|
|
103
|
-
b(
|
|
107
|
+
trigger: r(() => [
|
|
108
|
+
x(b(G), {
|
|
104
109
|
class: "px-1 transition-none",
|
|
105
110
|
size: "sm",
|
|
106
111
|
variant: "ghost",
|
|
107
|
-
onClick:
|
|
112
|
+
onClick: M($, ["stop"])
|
|
108
113
|
}, {
|
|
109
|
-
default:
|
|
110
|
-
t[0] || (t[0] =
|
|
111
|
-
|
|
114
|
+
default: r(() => [
|
|
115
|
+
t[0] || (t[0] = R(" Clear ")),
|
|
116
|
+
i("span", F, "All " + k(e.title), 1)
|
|
112
117
|
]),
|
|
113
118
|
_: 1
|
|
114
119
|
})
|
|
115
120
|
]),
|
|
116
|
-
content:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
content: r(() => t[1] || (t[1] = [
|
|
122
|
+
i("div", { class: "grid gap-1.5 pointer-events-none min-w-48 w-content shadow-lg rounded bg-b-1 p-2 text-xxs leading-5 z-10 text-c-1" }, [
|
|
123
|
+
i("div", { class: "flex items-center text-c-2" }, [
|
|
124
|
+
i("span", null, "Clear optional parameters")
|
|
120
125
|
])
|
|
121
126
|
], -1)
|
|
122
127
|
])),
|
|
123
128
|
_: 1
|
|
124
|
-
})) :
|
|
129
|
+
})) : C("", !0)
|
|
125
130
|
])
|
|
126
131
|
]),
|
|
127
|
-
default:
|
|
128
|
-
|
|
132
|
+
default: r(() => [
|
|
133
|
+
i("div", {
|
|
129
134
|
ref_key: "tableWrapperRef",
|
|
130
|
-
ref:
|
|
135
|
+
ref: c
|
|
131
136
|
}, [
|
|
132
|
-
|
|
137
|
+
S.value ? (v(), d(_, {
|
|
138
|
+
key: 0,
|
|
139
|
+
class: "flex-1",
|
|
140
|
+
columns: ["32px", "", ""],
|
|
141
|
+
isGlobal: "",
|
|
142
|
+
isReadOnly: "",
|
|
143
|
+
items: e.readOnlyEntries
|
|
144
|
+
}, null, 8, ["items"])) : C("", !0),
|
|
145
|
+
x(_, {
|
|
133
146
|
class: "flex-1",
|
|
134
147
|
columns: ["32px", "", ""],
|
|
135
148
|
items: l.value,
|
|
136
|
-
onToggleRow:
|
|
137
|
-
onUpdateRow:
|
|
149
|
+
onToggleRow: K,
|
|
150
|
+
onUpdateRow: P
|
|
138
151
|
}, null, 8, ["items"])
|
|
139
152
|
], 512)
|
|
140
153
|
]),
|
|
@@ -143,5 +156,5 @@ const j = { class: "text-c-2 flex whitespace-nowrap opacity-0 group-hover/params
|
|
|
143
156
|
}
|
|
144
157
|
});
|
|
145
158
|
export {
|
|
146
|
-
|
|
159
|
+
te as default
|
|
147
160
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestPathParams.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestPathParams.vue"],"names":[],"mappings":"AAuIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAMrE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,CAAA;CAC7C,CAAC;;AAiMF,wBAOG"}
|