@scalar/api-client 2.3.16 → 2.3.18
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 +33 -0
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +9 -9
- package/dist/components/SideNav/SideHelp.vue.js +1 -1
- package/dist/hooks/useClientConfig.d.ts +69 -0
- package/dist/hooks/useClientConfig.d.ts.map +1 -0
- package/dist/hooks/useClientConfig.js +7 -0
- package/dist/hooks/useResponseBody.d.ts +4 -3
- package/dist/hooks/useResponseBody.d.ts.map +1 -1
- package/dist/hooks/useResponseBody.js +15 -15
- package/dist/layouts/App/create-api-client-app.d.ts +34 -34
- package/dist/layouts/Modal/create-api-client-modal.d.ts +68 -68
- package/dist/layouts/Web/create-api-client-web.d.ts +34 -34
- package/dist/libs/create-client.d.ts +34 -34
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +63 -62
- package/dist/libs/hot-keys.d.ts +1 -1
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/request-example.d.ts +2 -2
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/security-schemes.d.ts +10 -10
- package/dist/store/servers.d.ts +4 -4
- package/dist/store/store.d.ts +34 -34
- package/dist/store/tags.d.ts +2 -2
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +67 -66
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +5 -5
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +31 -31
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +20 -20
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +116 -116
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"RequestRoot.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestRoot.vue"],"names":[],"mappings":";;cAkQ8C,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAmTjE,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestRoot.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-985ee6ae"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isDefined as
|
|
3
|
-
import { safeJSON as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import { RouterView as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
1
|
+
import { defineComponent as Q, ref as m, computed as F, onMounted as G, onBeforeUnmount as K, watch as X, openBlock as d, createElementBlock as Y, normalizeClass as g, unref as r, createBlock as B, isRef as Z, createCommentVNode as T, createElementVNode as A, createVNode as ee } from "vue";
|
|
2
|
+
import { isDefined as te } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { safeJSON as oe } from "@scalar/object-utils/parse";
|
|
4
|
+
import { useToasts as re } from "@scalar/use-toasts";
|
|
5
|
+
import { RouterView as se } from "vue-router";
|
|
6
|
+
import ae from "../../components/Sidebar/SidebarToggle.vue.js";
|
|
7
|
+
import { useClientConfig as le } from "../../hooks/useClientConfig.js";
|
|
8
|
+
import { useSidebar as ne } from "../../hooks/useSidebar.js";
|
|
9
|
+
import { validateParameters as ue } from "../../libs/validate-parameters.js";
|
|
10
|
+
import { useActiveEntities as ie } from "../../store/active-entities.js";
|
|
11
|
+
import { useOpenApiWatcher as ce } from "./hooks/useOpenApiWatcher.js";
|
|
12
|
+
import me from "./RequestSidebar.vue.js";
|
|
13
|
+
import { createRequestOperation as fe } from "../../libs/send-request/create-request-operation.js";
|
|
14
|
+
import { ERRORS as de } from "../../libs/errors.js";
|
|
15
|
+
import { useWorkspace as pe } from "../../store/store.js";
|
|
16
|
+
import { useLayout as ve } from "../../hooks/useLayout.js";
|
|
17
|
+
const Se = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col" }, Ae = /* @__PURE__ */ Q({
|
|
17
18
|
__name: "RequestRoot",
|
|
18
19
|
emits: ["newTab"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
20
|
+
setup(ye) {
|
|
21
|
+
const D = pe(), { toast: p } = re(), { layout: v } = ve(), P = le(), { isSidebarOpen: s } = ne(), {
|
|
21
22
|
activeCollection: l,
|
|
22
23
|
activeExample: n,
|
|
23
|
-
activeEnvironment:
|
|
24
|
-
activeRequest:
|
|
25
|
-
activeWorkspace:
|
|
26
|
-
activeServer:
|
|
27
|
-
} =
|
|
24
|
+
activeEnvironment: S,
|
|
25
|
+
activeRequest: u,
|
|
26
|
+
activeWorkspace: R,
|
|
27
|
+
activeServer: z
|
|
28
|
+
} = ie(), { cookies: I, requestHistory: J, showSidebar: y, securitySchemes: W, events: i } = D, j = m(), q = m(), f = m(/* @__PURE__ */ new Set()), x = m(null), b = F(
|
|
28
29
|
() => {
|
|
29
30
|
var e, t, o;
|
|
30
|
-
return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o =
|
|
31
|
+
return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o = u.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
|
|
31
32
|
}
|
|
32
|
-
),
|
|
33
|
-
var U, _, w, O;
|
|
34
|
-
if (!
|
|
33
|
+
), h = async () => {
|
|
34
|
+
var U, _, w, O, c, V;
|
|
35
|
+
if (!u.value || !n.value || !l.value)
|
|
35
36
|
return;
|
|
36
|
-
|
|
37
|
-
const e = typeof
|
|
37
|
+
f.value = ue(n.value);
|
|
38
|
+
const e = typeof S.value == "object" ? S.value.value : "{}", t = oe.parse(e);
|
|
38
39
|
t.error && console.error("INVALID ENVIRONMENT!");
|
|
39
|
-
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((U =
|
|
40
|
-
request:
|
|
40
|
+
const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, a = ((U = R.value) == null ? void 0 : U.cookies.map((H) => I[H]).filter(te)) ?? [], $ = ((w = (_ = l.value) == null ? void 0 : _.info) == null ? void 0 : w.title) === "Drafts" ? void 0 : z.value, [k, E] = fe({
|
|
41
|
+
request: u.value,
|
|
41
42
|
example: n.value,
|
|
42
|
-
selectedSecuritySchemeUids:
|
|
43
|
-
proxyUrl: ((O =
|
|
43
|
+
selectedSecuritySchemeUids: b.value,
|
|
44
|
+
proxyUrl: ((O = R.value) == null ? void 0 : O.proxyUrl) ?? "",
|
|
44
45
|
environment: o,
|
|
45
46
|
globalCookies: a,
|
|
46
|
-
status:
|
|
47
|
-
securitySchemes:
|
|
48
|
-
server:
|
|
47
|
+
status: i.requestStatus,
|
|
48
|
+
securitySchemes: W,
|
|
49
|
+
server: $
|
|
49
50
|
});
|
|
50
|
-
if (
|
|
51
|
-
|
|
51
|
+
if ((V = (c = P.value) == null ? void 0 : c.onRequestSent) == null || V.call(c, u.value.path ?? ""), k) {
|
|
52
|
+
p(k.message, "error");
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
},
|
|
55
|
+
q.value = E.controller;
|
|
56
|
+
const [C, N] = await E.sendRequest();
|
|
57
|
+
x.value = N, C ? p(C.message, "error") : J.push(M(N));
|
|
58
|
+
}, L = async () => {
|
|
58
59
|
var e;
|
|
59
|
-
return (e =
|
|
60
|
+
return (e = q.value) == null ? void 0 : e.abort(de.REQUEST_ABORTED);
|
|
60
61
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}),
|
|
62
|
+
G(() => {
|
|
63
|
+
i.executeRequest.on(h), i.cancelRequest.on(L);
|
|
64
|
+
}), ce(), K(() => i.executeRequest.off(h)), X(
|
|
64
65
|
() => {
|
|
65
66
|
var e;
|
|
66
67
|
return (e = n.value) == null ? void 0 : e.parameters;
|
|
67
68
|
},
|
|
68
69
|
() => {
|
|
69
|
-
|
|
70
|
+
f.value.clear();
|
|
70
71
|
},
|
|
71
72
|
{ deep: !0 }
|
|
72
73
|
);
|
|
73
|
-
const
|
|
74
|
+
const M = (e) => {
|
|
74
75
|
var t;
|
|
75
76
|
try {
|
|
76
77
|
return structuredClone(e);
|
|
@@ -79,33 +80,33 @@ const fe = { class: "flex h-full" }, de = { class: "flex h-full flex-1 flex-col"
|
|
|
79
80
|
return (t = e.response) != null && t.data && (e.response.data instanceof Blob || e.response.data instanceof ArrayBuffer ? a.response.data = e.response.data : a.response.data = JSON.parse(JSON.stringify(e.response.data))), a;
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
|
-
return (e, t) => (
|
|
83
|
+
return (e, t) => (d(), Y("div", {
|
|
83
84
|
ref_key: "element",
|
|
84
|
-
ref:
|
|
85
|
-
class:
|
|
86
|
-
"!mb-0 !mr-0 !border-0": r(
|
|
85
|
+
ref: j,
|
|
86
|
+
class: g(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
|
|
87
|
+
"!mb-0 !mr-0 !border-0": r(v) === "modal"
|
|
87
88
|
}])
|
|
88
89
|
}, [
|
|
89
|
-
r(
|
|
90
|
+
r(y) ? (d(), B(ae, {
|
|
90
91
|
key: 0,
|
|
91
92
|
modelValue: r(s),
|
|
92
|
-
"onUpdate:modelValue": t[0] || (t[0] = (o) =>
|
|
93
|
-
class:
|
|
93
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => Z(s) ? s.value = o : null),
|
|
94
|
+
class: g(["absolute left-3 top-2 z-50", [
|
|
94
95
|
{ hidden: r(s) },
|
|
95
96
|
{ "xl:!flex": !r(s) },
|
|
96
|
-
{ "!flex": r(
|
|
97
|
+
{ "!flex": r(v) === "modal" }
|
|
97
98
|
]])
|
|
98
|
-
}, null, 8, ["modelValue", "class"])) :
|
|
99
|
-
|
|
100
|
-
r(
|
|
99
|
+
}, null, 8, ["modelValue", "class"])) : T("", !0),
|
|
100
|
+
A("div", Se, [
|
|
101
|
+
r(y) ? (d(), B(me, {
|
|
101
102
|
key: 0,
|
|
102
103
|
onNewTab: t[1] || (t[1] = (o) => e.$emit("newTab", o))
|
|
103
|
-
})) :
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
invalidParams:
|
|
107
|
-
selectedSecuritySchemeUids:
|
|
108
|
-
requestResult:
|
|
104
|
+
})) : T("", !0),
|
|
105
|
+
A("div", Re, [
|
|
106
|
+
ee(r(se), {
|
|
107
|
+
invalidParams: f.value,
|
|
108
|
+
selectedSecuritySchemeUids: b.value,
|
|
109
|
+
requestResult: x.value
|
|
109
110
|
}, null, 8, ["invalidParams", "selectedSecuritySchemeUids", "requestResult"])
|
|
110
111
|
])
|
|
111
112
|
])
|
|
@@ -113,5 +114,5 @@ const fe = { class: "flex h-full" }, de = { class: "flex h-full flex-1 flex-col"
|
|
|
113
114
|
}
|
|
114
115
|
});
|
|
115
116
|
export {
|
|
116
|
-
|
|
117
|
+
Ae as default
|
|
117
118
|
};
|
|
@@ -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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-435b665f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestTable.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-682f7941"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -30,9 +30,9 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
30
30
|
setup(C, { emit: F }) {
|
|
31
31
|
const b = C, s = F, U = ["", "", "36px"], y = (e, a, l) => {
|
|
32
32
|
s("updateRow", e, a, l);
|
|
33
|
-
},
|
|
33
|
+
}, $ = (e) => {
|
|
34
34
|
s("uploadFile", e);
|
|
35
|
-
},
|
|
35
|
+
}, S = (e) => Array.isArray(e.default) && e.default.length === 1 ? e.default[0] : e.default;
|
|
36
36
|
return (e, a) => (r(), p(E, {
|
|
37
37
|
class: "group/table flex-1",
|
|
38
38
|
columns: U
|
|
@@ -157,7 +157,7 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
157
157
|
icon: n(() => [
|
|
158
158
|
u(R)(l) ? (r(), p(P, {
|
|
159
159
|
key: 0,
|
|
160
|
-
item: { ...l, default:
|
|
160
|
+
item: { ...l, default: S(l) }
|
|
161
161
|
}, null, 8, ["item"])) : g("", !0)
|
|
162
162
|
]),
|
|
163
163
|
_: 2
|
|
@@ -186,13 +186,13 @@ const j = { class: "text-c-2 filemask flex w-full max-w-[100%] items-end justify
|
|
|
186
186
|
class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
|
|
187
187
|
size: "sm",
|
|
188
188
|
variant: "outlined",
|
|
189
|
-
onClick: (T) =>
|
|
189
|
+
onClick: (T) => $(d)
|
|
190
190
|
}, {
|
|
191
191
|
default: n(() => [
|
|
192
192
|
a[6] || (a[6] = i("span", null, "Upload File", -1)),
|
|
193
193
|
t(u(B), {
|
|
194
194
|
class: "ml-1",
|
|
195
|
-
icon: "
|
|
195
|
+
icon: "Upload",
|
|
196
196
|
size: "xs",
|
|
197
197
|
thickness: "2.5"
|
|
198
198
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-233b510c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useResponseBody as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { mediaTypes as
|
|
10
|
-
const
|
|
1
|
+
import { defineComponent as C, ref as N, computed as d, toRef as w, openBlock as o, createBlock as n, createSlots as T, withCtx as u, createTextVNode as g, toDisplayString as _, createElementBlock as $, createElementVNode as x, unref as a, createCommentVNode as s, createVNode as E } from "vue";
|
|
2
|
+
import P from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
|
+
import { useResponseBody as S } from "../../../hooks/useResponseBody.js";
|
|
4
|
+
import U from "./ResponseBodyDownload.vue.js";
|
|
5
|
+
import j from "./ResponseBodyInfo.vue.js";
|
|
6
|
+
import D from "./ResponseBodyPreview.vue.js";
|
|
7
|
+
import F from "./ResponseBodyRaw.vue.js";
|
|
8
|
+
import I from "./ResponseBodyToggle.vue.js";
|
|
9
|
+
import { mediaTypes as q } from "../consts/mediaTypes.js";
|
|
10
|
+
const z = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "bg-b-1 flex max-h-[calc(100%-32px)] flex-col overflow-hidden"
|
|
13
|
-
},
|
|
13
|
+
}, A = { class: "flex min-h-8 items-center justify-between border-y px-3 py-1.5" }, G = { class: "text-xxs font-code leading-3" }, Y = /* @__PURE__ */ C({
|
|
14
14
|
__name: "ResponseBody",
|
|
15
15
|
props: {
|
|
16
16
|
title: {},
|
|
17
17
|
data: {},
|
|
18
18
|
headers: {}
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const c =
|
|
20
|
+
setup(k) {
|
|
21
|
+
const c = k, r = N(!0), p = d(
|
|
22
22
|
() => {
|
|
23
23
|
var t;
|
|
24
24
|
return !!((t = e.value) != null && t.raw && e.value.preview);
|
|
25
25
|
}
|
|
26
|
-
),
|
|
27
|
-
data: c
|
|
28
|
-
headers: c
|
|
29
|
-
}), e = d(() =>
|
|
30
|
-
return (t, m) => (o(), n(
|
|
26
|
+
), B = d(() => r.value || !p.value), R = d(() => !r.value || !p.value), { mimeType: i, attachmentFilename: V, dataUrl: l } = S({
|
|
27
|
+
data: w(c, "data"),
|
|
28
|
+
headers: w(c, "headers")
|
|
29
|
+
}), e = d(() => q[i.value.essence]);
|
|
30
|
+
return (t, m) => (o(), n(P, { class: "max-h-content overflow-y-hidden" }, T({
|
|
31
31
|
title: u(() => [
|
|
32
|
-
|
|
32
|
+
g(_(t.title), 1)
|
|
33
33
|
]),
|
|
34
34
|
default: u(() => {
|
|
35
35
|
var f, v, y, h;
|
|
36
36
|
return [
|
|
37
|
-
t.data ? (o(),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
p.value ? (o(), n(
|
|
37
|
+
t.data ? (o(), $("div", z, [
|
|
38
|
+
x("div", A, [
|
|
39
|
+
x("span", G, _(a(i).essence), 1),
|
|
40
|
+
p.value ? (o(), n(I, {
|
|
41
41
|
key: 0,
|
|
42
42
|
modelValue: r.value,
|
|
43
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
43
|
+
"onUpdate:modelValue": m[0] || (m[0] = (b) => r.value = b)
|
|
44
44
|
}, null, 8, ["modelValue"])) : s("", !0)
|
|
45
45
|
]),
|
|
46
|
-
(f = e.value) != null && f.raw &&
|
|
46
|
+
(f = e.value) != null && f.raw && R.value ? (o(), n(F, {
|
|
47
47
|
key: a(l),
|
|
48
48
|
content: t.data,
|
|
49
49
|
language: e.value.language
|
|
50
50
|
}, null, 8, ["content", "language"])) : s("", !0),
|
|
51
|
-
(v = e.value) != null && v.preview &&
|
|
51
|
+
(v = e.value) != null && v.preview && B.value ? (o(), n(D, {
|
|
52
52
|
key: a(l),
|
|
53
53
|
alpha: e.value.alpha,
|
|
54
54
|
mode: e.value.preview,
|
|
55
55
|
src: a(l),
|
|
56
56
|
type: a(i).essence
|
|
57
57
|
}, null, 8, ["alpha", "mode", "src", "type"])) : s("", !0),
|
|
58
|
-
!((y = e.value) != null && y.raw) && !((h = e.value) != null && h.preview) ? (o(), n(
|
|
58
|
+
!((y = e.value) != null && y.raw) && !((h = e.value) != null && h.preview) ? (o(), n(j, { key: 2 }, {
|
|
59
59
|
default: u(() => m[1] || (m[1] = [
|
|
60
|
-
|
|
60
|
+
g(" Binary file ")
|
|
61
61
|
])),
|
|
62
62
|
_: 1
|
|
63
63
|
})) : s("", !0)
|
|
@@ -69,8 +69,8 @@ const q = {
|
|
|
69
69
|
t.data && a(l) ? {
|
|
70
70
|
name: "actions",
|
|
71
71
|
fn: u(() => [
|
|
72
|
-
|
|
73
|
-
filename: a(
|
|
72
|
+
E(U, {
|
|
73
|
+
filename: a(V),
|
|
74
74
|
href: a(l),
|
|
75
75
|
type: a(i).essence
|
|
76
76
|
}, null, 8, ["filename", "href", "type"])
|
|
@@ -81,5 +81,5 @@ const q = {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
Y as default
|
|
85
85
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarVirtualText as
|
|
3
|
-
import { formatJsonOrYamlString as
|
|
4
|
-
import
|
|
5
|
-
import { useResponseBody as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as c, computed as p, toRef as a, openBlock as f, createBlock as x, createSlots as u, withCtx as r, createTextVNode as h, createElementVNode as y, createVNode as s, unref as e } from "vue";
|
|
2
|
+
import { ScalarVirtualText as b } from "@scalar/components";
|
|
3
|
+
import { formatJsonOrYamlString as g } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import _ from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
5
|
+
import { useResponseBody as v } from "../../../hooks/useResponseBody.js";
|
|
6
|
+
import k from "./ResponseBodyDownload.vue.js";
|
|
7
|
+
const R = /* @__PURE__ */ c({
|
|
8
8
|
__name: "ResponseBodyVirtual",
|
|
9
9
|
props: {
|
|
10
10
|
content: {},
|
|
11
11
|
data: {},
|
|
12
12
|
headers: {}
|
|
13
13
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const o =
|
|
16
|
-
data: o
|
|
17
|
-
headers: o
|
|
14
|
+
setup(l) {
|
|
15
|
+
const o = l, i = p(() => g(o.content)), { mimeType: m, attachmentFilename: d, dataUrl: n } = v({
|
|
16
|
+
data: a(o, "data"),
|
|
17
|
+
headers: a(o, "headers")
|
|
18
18
|
});
|
|
19
|
-
return (
|
|
19
|
+
return (w, t) => (f(), x(_, { class: "!max-h-100% response-body-virtual overflow-x-auto" }, u({
|
|
20
20
|
title: r(() => [
|
|
21
|
-
t[0] || (t[0] =
|
|
21
|
+
t[0] || (t[0] = h("Body"))
|
|
22
22
|
]),
|
|
23
23
|
default: r(() => [
|
|
24
|
-
t[1] || (t[1] =
|
|
25
|
-
|
|
24
|
+
t[1] || (t[1] = y("div", { class: "font-code text-xxs border-1/2 rounded-t border-b-0 px-2.5 py-1.5" }, " This response body is massive! Syntax highlighting won’t work here. ", -1)),
|
|
25
|
+
s(e(b), {
|
|
26
26
|
containerClass: "custom-scroll scalar-code-block border-1/2 rounded-b flex flex-1 max-h-screen",
|
|
27
27
|
contentClass: "language-plaintext whitespace-pre font-code text-base",
|
|
28
28
|
lineHeight: 20,
|
|
29
|
-
text:
|
|
29
|
+
text: i.value
|
|
30
30
|
}, null, 8, ["text"])
|
|
31
31
|
]),
|
|
32
32
|
_: 2
|
|
@@ -34,10 +34,10 @@ const N = /* @__PURE__ */ d({
|
|
|
34
34
|
e(n) ? {
|
|
35
35
|
name: "actions",
|
|
36
36
|
fn: r(() => [
|
|
37
|
-
|
|
38
|
-
filename: e(
|
|
37
|
+
s(k, {
|
|
38
|
+
filename: e(d),
|
|
39
39
|
href: e(n),
|
|
40
|
-
type: e(
|
|
40
|
+
type: e(m).essence
|
|
41
41
|
}, null, 8, ["filename", "href", "type"])
|
|
42
42
|
]),
|
|
43
43
|
key: "0"
|
|
@@ -46,5 +46,5 @@ const N = /* @__PURE__ */ d({
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
R as default
|
|
50
50
|
};
|
|
@@ -34,7 +34,7 @@ const W = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, $ = {
|
|
|
34
34
|
}));
|
|
35
35
|
}, k = (o) => {
|
|
36
36
|
o != null && o.createNew && x.name === "request" && f();
|
|
37
|
-
}, w = "2.3.
|
|
37
|
+
}, w = "2.3.18";
|
|
38
38
|
return R(() => a.hotKeys.on(k)), v(() => a.hotKeys.off(k)), (o, e) => (l(), u("div", W, [
|
|
39
39
|
s("div", {
|
|
40
40
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|