@scalar/api-client 2.0.39 → 2.0.41
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 +24 -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 +1 -1
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +1 -1
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +11 -11
- package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchButton.vue.js +5 -28
- package/dist/components/Search/SearchButton.vue2.js +28 -2
- package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideHelp.vue.js +26 -28
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +2 -2
- package/dist/components/SideNav/SideNav.vue2.js +5 -5
- package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavLink.vue.js +6 -6
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +14 -10
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +4 -4
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +20 -20
- package/dist/layouts/Modal/create-api-client-modal.d.ts +40 -40
- package/dist/libs/create-client.d.ts +20 -20
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +87 -70
- package/dist/store/workspace.d.ts +64 -64
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +129 -132
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +206 -146
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +4 -4
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItem.vue2.js +105 -92
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +44 -44
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +3 -17
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +89 -5
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +2 -37
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts +18 -0
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +34 -0
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue2.js +4 -0
- package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.d.ts +12 -0
- package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseBodyInfo.vue.js +14 -0
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts +23 -0
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +7 -0
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +65 -0
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts +19 -0
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +7 -0
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +29 -0
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.d.ts +20 -0
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue.js +25 -0
- package/dist/views/Request/ResponseSection/ResponseBodyToggle.vue2.js +4 -0
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +61 -63
- package/dist/views/Request/consts/index.d.ts +2 -0
- package/dist/views/Request/consts/index.d.ts.map +1 -1
- package/dist/views/Request/consts/index.js +6 -3
- package/dist/views/Request/consts/mediaTypes.d.ts +16 -0
- package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -0
- package/dist/views/Request/consts/mediaTypes.js +108 -0
- package/package.json +9 -7
|
@@ -1,114 +1,124 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { PathId as
|
|
3
|
-
import { useWorkspace as
|
|
4
|
-
import { ScalarIcon as
|
|
5
|
-
import { Draggable as
|
|
6
|
-
import { RouterLink as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useSidebar as
|
|
10
|
-
const te = { class: "flex flex-row gap-1" },
|
|
1
|
+
import { defineComponent as G, useCssVars as H, computed as l, ref as J, resolveComponent as K, openBlock as o, createElementBlock as m, normalizeClass as d, unref as i, createVNode as U, withCtx as C, createBlock as c, createElementVNode as s, toDisplayString as I, createCommentVNode as b, createTextVNode as E, renderSlot as Q, withDirectives as X, Fragment as Y, renderList as Z, vShow as ee, pushScopeId as te, popScopeId as ie } from "vue";
|
|
2
|
+
import { PathId as re } from "../../router.js";
|
|
3
|
+
import { useWorkspace as se } from "../../store/workspace.js";
|
|
4
|
+
import { ScalarIcon as ae } from "@scalar/components";
|
|
5
|
+
import { Draggable as le } from "@scalar/draggable";
|
|
6
|
+
import { RouterLink as ne } from "vue-router";
|
|
7
|
+
import z from "./RequestSidebarItemMenu.vue.js";
|
|
8
|
+
import oe from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
9
|
+
import { useSidebar as de } from "../../hooks/useSidebar.js";
|
|
10
|
+
const ue = (u) => (te("data-v-0285aba2"), u = u(), ie(), u), pe = { class: "flex flex-row gap-1 items-center" }, fe = { class: "relative" }, me = { class: "flex" }, ce = { class: "z-10 flex h-fit items-center justify-center max-w-[14px]" }, be = { class: "flex flex-1 flex-row justify-between editable-sidebar-hover" }, ge = { class: "relative flex h-fit" }, ve = /* @__PURE__ */ ue(() => /* @__PURE__ */ s("span", null, " ", -1)), he = { key: 2 }, O = "hover:bg-sidebar-active-b indent-padding-left", $e = /* @__PURE__ */ G({
|
|
11
11
|
__name: "RequestSidebarItem",
|
|
12
12
|
props: {
|
|
13
13
|
isDraggable: { type: Boolean, default: !1 },
|
|
14
|
-
isDroppable: { type: Boolean, default: !1 },
|
|
14
|
+
isDroppable: { type: [Boolean, Function], default: !1 },
|
|
15
15
|
parentUids: {},
|
|
16
16
|
item: {}
|
|
17
17
|
},
|
|
18
18
|
emits: ["onDragEnd"],
|
|
19
|
-
setup(
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
19
|
+
setup(u) {
|
|
20
|
+
H((e) => ({
|
|
21
|
+
"6aa00981": F.value,
|
|
22
|
+
efd61ec6: N.value
|
|
23
23
|
}));
|
|
24
|
-
const t =
|
|
25
|
-
activeRequest:
|
|
26
|
-
activeRouterParams:
|
|
27
|
-
activeWorkspace:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
const t = u, {
|
|
25
|
+
activeRequest: w,
|
|
26
|
+
activeRouterParams: _,
|
|
27
|
+
activeWorkspace: g,
|
|
28
|
+
collections: D,
|
|
29
|
+
folders: B,
|
|
30
|
+
isReadOnly: a,
|
|
31
|
+
requests: k,
|
|
32
|
+
requestExamples: v
|
|
33
|
+
} = se(), { collapsedSidebarFolders: y, toggleSidebarFolder: V } = de(), j = l(() => "childUids" in t.item), q = l(() => "spec" in t.item), x = l(() => "summary" in t.item), F = l(() => t.parentUids.length ? a.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "12px"), N = l(() => t.parentUids.length ? a.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "0px"), R = (e) => {
|
|
34
|
+
var r;
|
|
35
|
+
return "spec" in e ? (r = e.spec.info) == null ? void 0 : r.title : "summary" in e ? e.summary || e.path : "name" in e ? e.name : "";
|
|
36
|
+
}, L = l(() => ("requestUid" in t.item ? k[t.item.requestUid] : t.item).method), P = l(
|
|
36
37
|
() => {
|
|
37
38
|
var e;
|
|
38
|
-
return
|
|
39
|
+
return y[t.item.uid] || ((e = w.value) == null ? void 0 : e.uid) === t.item.uid && t.item.childUids.length > 1;
|
|
39
40
|
}
|
|
40
|
-
),
|
|
41
|
-
() =>
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
), T = () => "requestUid" in t.item ? `/workspace/${g.value.uid}/request/${t.item.requestUid}/examples/${t.item.uid}` : `/workspace/${g.value.uid}/request/${t.item.uid}`, W = l(
|
|
42
|
+
() => _.value[re.Request] === "default" && w.value.uid === t.item.uid
|
|
43
|
+
), h = J(null), S = l(() => {
|
|
44
|
+
let e = 0.5, r = 0.5;
|
|
45
|
+
if (!h.value) return { ceiling: e, floor: r };
|
|
46
|
+
const { draggingItem: p } = h.value;
|
|
47
|
+
return !D[p == null ? void 0 : p.id] && q.value ? (e = 1, r = 0) : j.value && !x.value && !q.value && (e = 0.8, r = 0.2), { ceiling: e, floor: r };
|
|
48
|
+
}), A = (e, r) => !(g.value.isReadOnly || v[r.id] || D[e.id]);
|
|
49
|
+
return (e, r) => {
|
|
50
|
+
const p = K("RequestSidebarItem", !0);
|
|
51
|
+
return o(), m("div", {
|
|
46
52
|
class: d(["relative flex flex-row", [
|
|
47
|
-
i(
|
|
53
|
+
i(a) && e.parentUids.length > 1 || !i(a) && e.parentUids.length ? "before:bg-b-3 before:absolute before:left-[calc(.75rem_+_.5px)] before:top-0 before:z-10 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-px mb-[.5px] last:mb-0 indent-border-line-offset" : ""
|
|
48
54
|
]])
|
|
49
55
|
}, [
|
|
50
|
-
|
|
56
|
+
U(i(le), {
|
|
51
57
|
id: e.item.uid,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
ref_key: "draggableRef",
|
|
59
|
+
ref: h,
|
|
60
|
+
ceiling: S.value.ceiling,
|
|
61
|
+
class: "flex flex-1 flex-col gap-[.5px] text-sm",
|
|
62
|
+
floor: S.value.floor,
|
|
63
|
+
isDraggable: e.isDraggable,
|
|
56
64
|
isDroppable: e.isDroppable,
|
|
57
65
|
parentIds: e.parentUids,
|
|
58
|
-
onOnDragEnd:
|
|
66
|
+
onOnDragEnd: r[2] || (r[2] = (...f) => e.$emit("onDragEnd", ...f))
|
|
59
67
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
var
|
|
68
|
+
default: C(() => {
|
|
69
|
+
var f, $;
|
|
62
70
|
return [
|
|
63
|
-
"summary" in e.item || "requestUid" in e.item ? (
|
|
71
|
+
"summary" in e.item || "requestUid" in e.item ? (o(), c(i(ne), {
|
|
64
72
|
key: 0,
|
|
65
73
|
class: "no-underline",
|
|
66
|
-
to:
|
|
74
|
+
to: T()
|
|
67
75
|
}, {
|
|
68
|
-
default:
|
|
69
|
-
|
|
76
|
+
default: C(({ isExactActive: n }) => [
|
|
77
|
+
s("div", {
|
|
70
78
|
class: d(["group relative flex min-h-8 cursor-pointer flex-row items-start justify-between gap-2 py-1.5 pr-2 rounded editable-sidebar-hover", [
|
|
71
|
-
|
|
72
|
-
n ||
|
|
79
|
+
O,
|
|
80
|
+
n || W.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
|
|
73
81
|
]]),
|
|
74
82
|
tabindex: "0"
|
|
75
83
|
}, [
|
|
76
|
-
|
|
84
|
+
s("span", {
|
|
77
85
|
class: d(["z-10 font-medium w-full pl-2 word-break-break-word", {
|
|
78
|
-
"editable-sidebar-hover-item": !i(
|
|
86
|
+
"editable-sidebar-hover-item": !i(a)
|
|
79
87
|
}])
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
}, I(R(e.item)), 3),
|
|
89
|
+
s("div", pe, [
|
|
90
|
+
s("div", fe, [
|
|
91
|
+
i(a) ? b("", !0) : (o(), c(z, {
|
|
92
|
+
key: 0,
|
|
93
|
+
item: e.item,
|
|
94
|
+
parentUids: e.parentUids
|
|
95
|
+
}, null, 8, ["item", "parentUids"]))
|
|
96
|
+
]),
|
|
97
|
+
s("span", me, [
|
|
98
|
+
E(" "),
|
|
99
|
+
U(i(oe), {
|
|
90
100
|
class: "font-bold",
|
|
91
|
-
method:
|
|
101
|
+
method: L.value
|
|
92
102
|
}, null, 8, ["method"])
|
|
93
103
|
])
|
|
94
104
|
])
|
|
95
105
|
], 2)
|
|
96
106
|
]),
|
|
97
107
|
_: 1
|
|
98
|
-
}, 8, ["to"])) : !i(
|
|
108
|
+
}, 8, ["to"])) : !i(a) || e.parentUids.length ? (o(), m("button", {
|
|
99
109
|
key: 1,
|
|
100
|
-
class: d(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]",
|
|
110
|
+
class: d(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", O]),
|
|
101
111
|
type: "button",
|
|
102
|
-
onClick:
|
|
112
|
+
onClick: r[0] || (r[0] = (n) => i(V)(e.item.uid))
|
|
103
113
|
}, [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
s("span", ce, [
|
|
115
|
+
Q(e.$slots, "leftIcon", {}, () => [
|
|
116
|
+
s("div", {
|
|
107
117
|
class: d({
|
|
108
|
-
"rotate-90": i(
|
|
118
|
+
"rotate-90": i(y)[e.item.uid]
|
|
109
119
|
})
|
|
110
120
|
}, [
|
|
111
|
-
|
|
121
|
+
U(i(ae), {
|
|
112
122
|
class: "text-c-3 text-sm",
|
|
113
123
|
icon: "ChevronRight",
|
|
114
124
|
size: "sm",
|
|
@@ -116,33 +126,36 @@ const te = { class: "flex flex-row gap-1" }, ie = { class: "flex" }, re = { clas
|
|
|
116
126
|
})
|
|
117
127
|
], 2)
|
|
118
128
|
], !0),
|
|
119
|
-
|
|
129
|
+
E(" ")
|
|
120
130
|
]),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
class: d(["z-10 font-medium w-full word-break-break-word
|
|
124
|
-
"editable-sidebar-hover-item": !i(
|
|
131
|
+
s("div", be, [
|
|
132
|
+
s("span", {
|
|
133
|
+
class: d(["z-10 font-medium text-left w-full word-break-break-word", {
|
|
134
|
+
"editable-sidebar-hover-item": !i(a)
|
|
125
135
|
}])
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
}, I(R(e.item)), 3),
|
|
137
|
+
s("div", ge, [
|
|
138
|
+
!i(a) && (($ = (f = e.item.spec) == null ? void 0 : f.info) == null ? void 0 : $.title) !== "Drafts" ? (o(), c(z, {
|
|
139
|
+
key: 0,
|
|
140
|
+
item: e.item,
|
|
141
|
+
parentUids: e.parentUids
|
|
142
|
+
}, null, 8, ["item", "parentUids"])) : b("", !0),
|
|
143
|
+
ve
|
|
144
|
+
])
|
|
132
145
|
])
|
|
133
|
-
])) :
|
|
134
|
-
"childUids" in e.item ?
|
|
135
|
-
(
|
|
146
|
+
])) : b("", !0),
|
|
147
|
+
"childUids" in e.item ? X((o(), m("div", he, [
|
|
148
|
+
(o(!0), m(Y, null, Z(x.value ? e.item.childUids.slice(1) : e.item.childUids, (n) => (o(), c(p, {
|
|
136
149
|
key: n,
|
|
137
|
-
isDraggable:
|
|
138
|
-
isDroppable:
|
|
139
|
-
item: i(
|
|
150
|
+
isDraggable: !i(v)[n],
|
|
151
|
+
isDroppable: A,
|
|
152
|
+
item: i(B)[n] || i(k)[n] || i(v)[n],
|
|
140
153
|
parentUids: [...e.parentUids, e.item.uid],
|
|
141
|
-
onOnDragEnd:
|
|
142
|
-
}, null, 8, ["isDraggable", "
|
|
154
|
+
onOnDragEnd: r[1] || (r[1] = (...M) => e.$emit("onDragEnd", ...M))
|
|
155
|
+
}, null, 8, ["isDraggable", "item", "parentUids"]))), 128))
|
|
143
156
|
], 512)), [
|
|
144
|
-
[
|
|
145
|
-
]) :
|
|
157
|
+
[ee, P.value]
|
|
158
|
+
]) : b("", !0)
|
|
146
159
|
];
|
|
147
160
|
}),
|
|
148
161
|
_: 3
|
|
@@ -152,5 +165,5 @@ const te = { class: "flex flex-row gap-1" }, ie = { class: "flex" }, re = { clas
|
|
|
152
165
|
}
|
|
153
166
|
});
|
|
154
167
|
export {
|
|
155
|
-
|
|
168
|
+
$e as default
|
|
156
169
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA4PA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;IAOhD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;IAFpD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;
|
|
1
|
+
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA4PA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;IAOhD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;IAFpD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;AAyhBtD,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./RequestSidebarItemMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b4adf477"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as V, computed as f, ref as B, openBlock as
|
|
1
|
+
import { defineComponent as V, computed as f, ref as B, openBlock as S, createElementBlock as A, Fragment as F, createVNode as i, unref as t, withCtx as l, createBlock as P, createCommentVNode as T, withKeys as K, withModifiers as W, createElementVNode as d, createTextVNode as E, pushScopeId as j, popScopeId as G } from "vue";
|
|
2
2
|
import H from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
3
3
|
import { commandPaletteBus as J } from "../../libs/eventBusses/command-palette.js";
|
|
4
4
|
import { PathId as R } from "../../router.js";
|
|
5
5
|
import { useWorkspace as L } from "../../store/workspace.js";
|
|
6
|
-
import { useModal as I, ScalarDropdown as O, ScalarDropdownItem as v, ScalarIcon as u, ScalarButton as
|
|
6
|
+
import { useModal as I, ScalarDropdown as O, ScalarDropdownItem as v, ScalarIcon as u, ScalarButton as h, ScalarModal as N, ScalarTextField as Q } from "@scalar/components";
|
|
7
7
|
import { useRouter as X } from "vue-router";
|
|
8
|
-
const
|
|
8
|
+
const x = (o) => (j("data-v-b4adf477"), o = o(), G(), o), Y = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Add Example", -1)), Z = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Rename", -1)), ee = /* @__PURE__ */ x(() => /* @__PURE__ */ d("span", null, "Delete", -1)), te = { class: "flex gap-3" }, me = /* @__PURE__ */ V({
|
|
9
9
|
__name: "RequestSidebarItemMenu",
|
|
10
10
|
props: {
|
|
11
11
|
parentUids: {},
|
|
@@ -17,36 +17,36 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
|
|
|
17
17
|
activeRouterParams: g,
|
|
18
18
|
collectionMutators: _,
|
|
19
19
|
folderMutators: w,
|
|
20
|
-
requestMutators:
|
|
21
|
-
requestExampleMutators:
|
|
22
|
-
} = L(), { replace:
|
|
20
|
+
requestMutators: y,
|
|
21
|
+
requestExampleMutators: C
|
|
22
|
+
} = L(), { replace: b } = X(), U = () => J.emit({
|
|
23
23
|
commandName: "Add Example",
|
|
24
24
|
metaData: e.item.uid
|
|
25
25
|
}), D = () => {
|
|
26
|
-
"requestUid" in e.item ? (
|
|
26
|
+
"requestUid" in e.item ? (C.delete(e.item), g.value[R.Examples] === e.item.uid && b(`/workspace/${k.value}/request/default`)) : "summary" in e.item ? (y.delete(
|
|
27
27
|
e.item,
|
|
28
28
|
e.parentUids[e.parentUids.length - 1]
|
|
29
|
-
), g.value[R.Request] === e.item.uid &&
|
|
29
|
+
), g.value[R.Request] === e.item.uid && b(`/workspace/${k.value.uid}/request/default`)) : "spec" in e.item ? _.delete(e.item) : "name" in e.item && w.delete(
|
|
30
30
|
e.item,
|
|
31
31
|
e.parentUids[e.parentUids.length - 1]
|
|
32
32
|
);
|
|
33
|
-
}, $ = f(() => "summary" in e.item),
|
|
33
|
+
}, $ = f(() => "summary" in e.item), q = f(() => {
|
|
34
34
|
var p;
|
|
35
35
|
return "summary" in e.item ? e.item.summary || "" : "name" in e.item ? e.item.name || "" : "spec" in e.item && ((p = e.item.spec.info) == null ? void 0 : p.title) || "";
|
|
36
|
-
}), s = B(""),
|
|
37
|
-
"summary" in e.item ?
|
|
38
|
-
},
|
|
39
|
-
s.value =
|
|
40
|
-
},
|
|
41
|
-
return (p,
|
|
36
|
+
}), s = B(""), M = () => {
|
|
37
|
+
"summary" in e.item ? y.edit(e.item.uid, "summary", s.value) : "requestUid" in e.item ? C.edit(e.item.uid, "name", s.value) : "spec" in e.item ? _.edit(e.item.uid, "spec.info.title", s.value) : w.edit(e.item.uid, "name", s.value), m.hide();
|
|
38
|
+
}, m = I(), c = I(), z = () => {
|
|
39
|
+
s.value = q.value, m.show();
|
|
40
|
+
}, r = f(() => "requestUid" in e.item ? "Example" : "summary" in e.item ? "Request" : "spec" in e.item ? "Collection" : "Folder");
|
|
41
|
+
return (p, a) => (S(), A(F, null, [
|
|
42
42
|
i(t(O), { teleport: "#scalar-client" }, {
|
|
43
|
-
items:
|
|
44
|
-
$.value ? (
|
|
43
|
+
items: l(() => [
|
|
44
|
+
$.value ? (S(), P(t(v), {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "flex !gap-2",
|
|
47
47
|
onClick: U
|
|
48
48
|
}, {
|
|
49
|
-
default:
|
|
49
|
+
default: l(() => [
|
|
50
50
|
i(t(u), {
|
|
51
51
|
class: "inline-flex",
|
|
52
52
|
icon: "Add",
|
|
@@ -61,7 +61,7 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
|
|
|
61
61
|
class: "flex !gap-2",
|
|
62
62
|
onClick: z
|
|
63
63
|
}, {
|
|
64
|
-
default:
|
|
64
|
+
default: l(() => [
|
|
65
65
|
i(t(u), {
|
|
66
66
|
class: "inline-flex",
|
|
67
67
|
icon: "Edit",
|
|
@@ -74,9 +74,9 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
|
|
|
74
74
|
}),
|
|
75
75
|
i(t(v), {
|
|
76
76
|
class: "flex !gap-2",
|
|
77
|
-
onClick:
|
|
77
|
+
onClick: a[1] || (a[1] = (n) => t(c).show())
|
|
78
78
|
}, {
|
|
79
|
-
default:
|
|
79
|
+
default: l(() => [
|
|
80
80
|
i(t(u), {
|
|
81
81
|
class: "inline-flex",
|
|
82
82
|
icon: "Trash",
|
|
@@ -88,16 +88,16 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
|
|
|
88
88
|
_: 1
|
|
89
89
|
})
|
|
90
90
|
]),
|
|
91
|
-
default:
|
|
92
|
-
i(t(
|
|
93
|
-
class: "px-
|
|
91
|
+
default: l(() => [
|
|
92
|
+
i(t(h), {
|
|
93
|
+
class: "px-0.5 py-0 z-10 hover:bg-b-3 hidden group-hover:flex ui-open:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit",
|
|
94
94
|
size: "sm",
|
|
95
95
|
variant: "ghost",
|
|
96
|
-
onClick:
|
|
97
|
-
(
|
|
96
|
+
onClick: a[0] || (a[0] = (n) => {
|
|
97
|
+
(r.value === "Collection" || r.value === "Folder") && n.stopPropagation();
|
|
98
98
|
})
|
|
99
99
|
}, {
|
|
100
|
-
default:
|
|
100
|
+
default: l(() => [
|
|
101
101
|
i(t(u), {
|
|
102
102
|
icon: "Ellipses",
|
|
103
103
|
size: "sm"
|
|
@@ -111,47 +111,47 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
|
|
|
111
111
|
i(t(N), {
|
|
112
112
|
size: "sm",
|
|
113
113
|
state: t(c),
|
|
114
|
-
title: `Delete ${
|
|
114
|
+
title: `Delete ${r.value}`
|
|
115
115
|
}, {
|
|
116
|
-
default:
|
|
116
|
+
default: l(() => [
|
|
117
117
|
i(H, {
|
|
118
|
-
variableName:
|
|
118
|
+
variableName: q.value,
|
|
119
119
|
warningMessage: "Warning: Deleting this will delete all items inside of this",
|
|
120
|
-
onClose:
|
|
120
|
+
onClose: a[2] || (a[2] = (n) => t(c).hide()),
|
|
121
121
|
onDelete: D
|
|
122
122
|
}, null, 8, ["variableName"])
|
|
123
123
|
]),
|
|
124
124
|
_: 1
|
|
125
125
|
}, 8, ["state", "title"]),
|
|
126
126
|
i(t(N), {
|
|
127
|
-
state: t(
|
|
128
|
-
title: `Rename ${
|
|
127
|
+
state: t(m),
|
|
128
|
+
title: `Rename ${r.value}`
|
|
129
129
|
}, {
|
|
130
|
-
default:
|
|
130
|
+
default: l(() => [
|
|
131
131
|
i(t(Q), {
|
|
132
132
|
modelValue: s.value,
|
|
133
|
-
"onUpdate:modelValue":
|
|
134
|
-
label:
|
|
133
|
+
"onUpdate:modelValue": a[3] || (a[3] = (n) => s.value = n),
|
|
134
|
+
label: r.value,
|
|
135
135
|
labelShadowColor: "var(--scalar-background-1)",
|
|
136
|
-
onKeydown: K(W(
|
|
136
|
+
onKeydown: K(W(M, ["prevent"]), ["enter"])
|
|
137
137
|
}, null, 8, ["modelValue", "label", "onKeydown"]),
|
|
138
138
|
d("div", te, [
|
|
139
|
-
i(t(
|
|
139
|
+
i(t(h), {
|
|
140
140
|
class: "flex-1",
|
|
141
141
|
variant: "outlined",
|
|
142
|
-
onClick:
|
|
142
|
+
onClick: a[4] || (a[4] = (n) => t(m).hide())
|
|
143
143
|
}, {
|
|
144
|
-
default:
|
|
144
|
+
default: l(() => [
|
|
145
145
|
E(" Cancel ")
|
|
146
146
|
]),
|
|
147
147
|
_: 1
|
|
148
148
|
}),
|
|
149
|
-
i(t(
|
|
149
|
+
i(t(h), {
|
|
150
150
|
class: "flex-1",
|
|
151
151
|
type: "submit",
|
|
152
|
-
onClick:
|
|
152
|
+
onClick: M
|
|
153
153
|
}, {
|
|
154
|
-
default:
|
|
154
|
+
default: l(() => [
|
|
155
155
|
E(" Save ")
|
|
156
156
|
]),
|
|
157
157
|
_: 1
|
|
@@ -164,5 +164,5 @@ const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(
|
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
export {
|
|
167
|
-
|
|
167
|
+
me as default
|
|
168
168
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
2
|
title: string;
|
|
3
3
|
data: any;
|
|
4
4
|
headers: {
|
|
@@ -6,9 +6,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
6
6
|
value: string;
|
|
7
7
|
required: boolean;
|
|
8
8
|
}[];
|
|
9
|
-
}>, {
|
|
10
|
-
data: null;
|
|
11
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
9
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
12
10
|
title: string;
|
|
13
11
|
data: any;
|
|
14
12
|
headers: {
|
|
@@ -16,20 +14,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
16
14
|
value: string;
|
|
17
15
|
required: boolean;
|
|
18
16
|
}[];
|
|
19
|
-
}
|
|
20
|
-
data: null;
|
|
21
|
-
}>>>, {
|
|
22
|
-
data: any;
|
|
23
|
-
}, {}>;
|
|
17
|
+
}>>>, {}, {}>;
|
|
24
18
|
export default _default;
|
|
25
|
-
type __VLS_WithDefaults<P, D> = {
|
|
26
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
27
|
-
default: D[K];
|
|
28
|
-
}> : P[K];
|
|
29
|
-
};
|
|
30
|
-
type __VLS_Prettify<T> = {
|
|
31
|
-
[K in keyof T]: T[K];
|
|
32
|
-
} & {};
|
|
33
19
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
34
20
|
type __VLS_TypePropsToOption<T> = {
|
|
35
21
|
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":";WA8GS,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;WAFtD,MAAM;UACP,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;AAuL/D,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,7 +1,91 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as U, ref as x, computed as l, openBlock as r, createBlock as u, createSlots as L, withCtx as p, createTextVNode as w, toDisplayString as g, createElementBlock as V, createElementVNode as b, createCommentVNode as i, createVNode as j } from "vue";
|
|
2
|
+
import T from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import C from "whatwg-mimetype";
|
|
4
|
+
import N from "./ResponseBodyDownload.vue.js";
|
|
5
|
+
import O from "./ResponseBodyInfo.vue.js";
|
|
6
|
+
import S from "./ResponseBodyPreview.vue.js";
|
|
7
|
+
import E from "./ResponseBodyRaw.vue.js";
|
|
8
|
+
import $ from "./ResponseBodyToggle.vue.js";
|
|
9
|
+
import { mediaTypes as I } from "../consts/mediaTypes.js";
|
|
10
|
+
const M = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "mx-1 border-1/2 flex flex-col rounded bg-b-1"
|
|
13
|
+
}, P = { class: "flex justify-between items-center border-b-1/2 p-1.5" }, D = { class: "text-xxs leading-3 font-code" }, W = /* @__PURE__ */ U({
|
|
14
|
+
__name: "ResponseBody",
|
|
15
|
+
props: {
|
|
16
|
+
title: {},
|
|
17
|
+
data: {},
|
|
18
|
+
headers: {}
|
|
19
|
+
},
|
|
20
|
+
setup(h) {
|
|
21
|
+
const a = h, _ = (e) => e instanceof Blob, d = x(!0), m = l(
|
|
22
|
+
() => {
|
|
23
|
+
var e;
|
|
24
|
+
return !!((e = t.value) != null && e.raw && t.value.preview);
|
|
25
|
+
}
|
|
26
|
+
), B = l(() => d.value || !m.value), R = l(() => !d.value || !m.value), o = l(() => {
|
|
27
|
+
var s;
|
|
28
|
+
const e = ((s = a.headers.find((c) => c.name.toLowerCase() === "content-type")) == null ? void 0 : s.value) ?? "";
|
|
29
|
+
return new C(e);
|
|
30
|
+
}), t = l(() => I[o.value.essence]), n = l(() => _(a.data) ? URL.createObjectURL(a.data) : typeof a.data == "string" ? URL.createObjectURL(
|
|
31
|
+
new Blob([a.data], { type: o.value.toString() })
|
|
32
|
+
) : typeof a.data == "object" && Object.keys(a.data).length ? URL.createObjectURL(
|
|
33
|
+
new Blob([JSON.stringify(a.data)], {
|
|
34
|
+
type: o.value.toString()
|
|
35
|
+
})
|
|
36
|
+
) : "");
|
|
37
|
+
return (e, s) => (r(), u(T, null, L({
|
|
38
|
+
title: p(() => [
|
|
39
|
+
w(g(e.title), 1)
|
|
40
|
+
]),
|
|
41
|
+
default: p(() => {
|
|
42
|
+
var c, v, f, y;
|
|
43
|
+
return [
|
|
44
|
+
e.data ? (r(), V("div", M, [
|
|
45
|
+
b("div", P, [
|
|
46
|
+
b("span", D, g(o.value.essence), 1),
|
|
47
|
+
m.value ? (r(), u($, {
|
|
48
|
+
key: 0,
|
|
49
|
+
modelValue: d.value,
|
|
50
|
+
"onUpdate:modelValue": s[0] || (s[0] = (k) => d.value = k)
|
|
51
|
+
}, null, 8, ["modelValue"])) : i("", !0)
|
|
52
|
+
]),
|
|
53
|
+
(c = t.value) != null && c.raw && R.value ? (r(), u(E, {
|
|
54
|
+
key: n.value,
|
|
55
|
+
data: e.data,
|
|
56
|
+
language: t.value.language
|
|
57
|
+
}, null, 8, ["data", "language"])) : i("", !0),
|
|
58
|
+
(v = t.value) != null && v.preview && B.value ? (r(), u(S, {
|
|
59
|
+
key: n.value,
|
|
60
|
+
alpha: t.value.alpha,
|
|
61
|
+
mode: t.value.preview,
|
|
62
|
+
src: n.value,
|
|
63
|
+
type: o.value.essence
|
|
64
|
+
}, null, 8, ["alpha", "mode", "src", "type"])) : i("", !0),
|
|
65
|
+
!((f = t.value) != null && f.raw) && !((y = t.value) != null && y.preview) ? (r(), u(O, { key: 2 }, {
|
|
66
|
+
default: p(() => [
|
|
67
|
+
w(" Binary file ")
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
})) : i("", !0)
|
|
71
|
+
])) : i("", !0)
|
|
72
|
+
];
|
|
73
|
+
}),
|
|
74
|
+
_: 2
|
|
75
|
+
}, [
|
|
76
|
+
e.data && n.value ? {
|
|
77
|
+
name: "actions",
|
|
78
|
+
fn: p(() => [
|
|
79
|
+
j(N, {
|
|
80
|
+
href: n.value,
|
|
81
|
+
type: o.value.essence
|
|
82
|
+
}, null, 8, ["href", "type"])
|
|
83
|
+
]),
|
|
84
|
+
key: "0"
|
|
85
|
+
} : void 0
|
|
86
|
+
]), 1024));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
5
89
|
export {
|
|
6
|
-
|
|
90
|
+
W as default
|
|
7
91
|
};
|