@scalar/api-client 2.20.2 → 2.21.0
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 +29 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +56 -59
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +52 -51
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +4 -0
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +23 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +24 -23
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +2 -8
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +2 -2
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +57 -60
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +61 -41
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +0 -3
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -34
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts +3 -3
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -2
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +26 -20
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts +4 -2
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +39 -33
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +64 -64
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +12 -11
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +152 -95
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/code-input/CodeInput.vue2.js +87 -99
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +12 -12
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarErrorBoundary as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as T, computed as i, ref as $, useId as S, createBlock as r, openBlock as o, withCtx as d, createElementVNode as c, normalizeClass as h, createElementBlock as p, createVNode as R, Fragment as y, createCommentVNode as u, createTextVNode as A, renderList as g, unref as I, withDirectives as E, resolveDynamicComponent as O, vShow as z } from "vue";
|
|
2
|
+
import { ScalarErrorBoundary as N } from "@scalar/components";
|
|
3
|
+
import { isDefined as P } from "@scalar/helpers/array/is-defined";
|
|
4
|
+
import D from "../../../components/SectionFilter.vue.js";
|
|
5
|
+
import L from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
6
6
|
import V from "./components/Headers.vue.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import j from "./components/ResponseBody.vue.js";
|
|
8
|
+
import w from "./components/ResponseBodyStreaming.vue.js";
|
|
9
|
+
import F from "./components/ResponseBodyVirtual.vue.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { textMediaTypes as
|
|
16
|
-
import { parseSetCookie as
|
|
17
|
-
const
|
|
11
|
+
import U from "./components/ResponseCookies.vue.js";
|
|
12
|
+
import K from "./components/ResponseEmpty.vue.js";
|
|
13
|
+
import M from "./components/ResponseLoadingOverlay.vue.js";
|
|
14
|
+
import Z from "./components/ResponseMetaInformation.vue.js";
|
|
15
|
+
import { textMediaTypes as G } from "./helpers/media-types.js";
|
|
16
|
+
import { parseSetCookie as J } from "./helpers/parse-set-cookie.js";
|
|
17
|
+
const Q = { class: "flex h-8 flex-1 items-center" }, W = ["id", "role"], b = 2e5, ve = /* @__PURE__ */ T({
|
|
18
18
|
__name: "ResponseBlock",
|
|
19
19
|
props: {
|
|
20
20
|
response: {},
|
|
@@ -23,29 +23,27 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
|
|
|
23
23
|
totalPerformedRequests: {},
|
|
24
24
|
appVersion: {},
|
|
25
25
|
plugins: {},
|
|
26
|
-
events: {},
|
|
27
26
|
eventBus: {}
|
|
28
27
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const H = C, m = i(() => {
|
|
28
|
+
setup(e, { expose: x }) {
|
|
29
|
+
const m = i(() => {
|
|
32
30
|
const t = e.response?.headers;
|
|
33
31
|
return t ? Object.keys(t).map((s) => ({
|
|
34
32
|
name: s,
|
|
35
33
|
value: t[s] ?? ""
|
|
36
34
|
})) : [];
|
|
37
35
|
}), k = i(
|
|
38
|
-
() => e.response?.cookieHeaderKeys.map((t) =>
|
|
39
|
-
),
|
|
36
|
+
() => e.response?.cookieHeaderKeys.map((t) => J(t)).filter(P) ?? []
|
|
37
|
+
), C = ["Cookies", "Headers", "Body"], n = $("All"), v = i(() => ["All", ...C]), a = i(
|
|
40
38
|
() => Object.fromEntries(
|
|
41
|
-
v.value.map((t) => [t,
|
|
39
|
+
v.value.map((t) => [t, S()])
|
|
42
40
|
)
|
|
43
|
-
),
|
|
41
|
+
), B = i(() => {
|
|
44
42
|
if (!e.response || !("size" in e.response))
|
|
45
43
|
return !1;
|
|
46
44
|
const t = e.response.headers?.["content-type"] || e.response.headers?.["Content-Type"];
|
|
47
|
-
return !t || (e.response.size ?? 0) <= b || t.includes("text/html") ? !1 :
|
|
48
|
-
}),
|
|
45
|
+
return !t || (e.response.size ?? 0) <= b || t.includes("text/html") ? !1 : G.some((l) => t.includes(l)) && (e.response.size ?? 0) > b;
|
|
46
|
+
}), q = i(
|
|
49
47
|
() => e.request?.headers ? [...e.request.headers].map((t) => ({
|
|
50
48
|
name: t[0],
|
|
51
49
|
value: t[1],
|
|
@@ -55,26 +53,26 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
|
|
|
55
53
|
return x({
|
|
56
54
|
responseHeaders: m,
|
|
57
55
|
responseCookies: k,
|
|
58
|
-
requestHeaders:
|
|
59
|
-
shouldVirtualize:
|
|
56
|
+
requestHeaders: q,
|
|
57
|
+
shouldVirtualize: B,
|
|
60
58
|
activeFilter: n,
|
|
61
59
|
filters: v
|
|
62
|
-
}), (t, s) => (o(), r(
|
|
63
|
-
title:
|
|
64
|
-
c("div",
|
|
60
|
+
}), (t, s) => (o(), r(L, { "aria-label": "Response" }, {
|
|
61
|
+
title: d(() => [
|
|
62
|
+
c("div", Q, [
|
|
65
63
|
c("div", {
|
|
66
64
|
"aria-live": "polite",
|
|
67
|
-
class:
|
|
65
|
+
class: h(["flex items-center", { "animate-response-heading": e.response }])
|
|
68
66
|
}, [
|
|
69
67
|
s[4] || (s[4] = c("span", { class: "response-heading pointer-events-none absolute" }, " Response ", -1)),
|
|
70
|
-
e.response ? (o(), r(
|
|
68
|
+
e.response ? (o(), r(Z, {
|
|
71
69
|
key: 0,
|
|
72
70
|
class: "animate-response-children",
|
|
73
|
-
|
|
71
|
+
eventBus: e.eventBus,
|
|
74
72
|
response: e.response
|
|
75
|
-
}, null, 8, ["
|
|
73
|
+
}, null, 8, ["eventBus", "response"])) : u("", !0)
|
|
76
74
|
], 2),
|
|
77
|
-
|
|
75
|
+
R(D, {
|
|
78
76
|
modelValue: n.value,
|
|
79
77
|
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
80
78
|
filterIds: a.value,
|
|
@@ -82,34 +80,34 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
|
|
|
82
80
|
}, null, 8, ["modelValue", "filterIds", "filters"])
|
|
83
81
|
])
|
|
84
82
|
]),
|
|
85
|
-
default:
|
|
83
|
+
default: d(() => [
|
|
86
84
|
c("div", {
|
|
87
85
|
id: a.value.All,
|
|
88
|
-
class:
|
|
86
|
+
class: h(["custom-scroll response-section-content relative grid h-full justify-stretch", {
|
|
89
87
|
"content-start": e.response
|
|
90
88
|
}]),
|
|
91
89
|
role: n.value === "All" && e.response ? "tabpanel" : "none"
|
|
92
90
|
}, [
|
|
93
91
|
e.response ? (o(), p(y, { key: 1 }, [
|
|
94
|
-
f("Cookies") ? (o(), r(
|
|
92
|
+
f("Cookies") ? (o(), r(U, {
|
|
95
93
|
key: 0,
|
|
96
94
|
id: a.value.Cookies,
|
|
97
95
|
class: "response-section-content-cookies",
|
|
98
96
|
cookies: k.value,
|
|
99
97
|
role: n.value === "All" ? "none" : "tabpanel"
|
|
100
|
-
}, null, 8, ["id", "cookies", "role"])) :
|
|
98
|
+
}, null, 8, ["id", "cookies", "role"])) : u("", !0),
|
|
101
99
|
f("Headers") ? (o(), r(V, {
|
|
102
100
|
key: 1,
|
|
103
101
|
id: a.value.Headers,
|
|
104
102
|
class: "response-section-content-headers",
|
|
105
|
-
headers:
|
|
103
|
+
headers: q.value,
|
|
106
104
|
role: n.value === "All" ? "none" : "tabpanel"
|
|
107
105
|
}, {
|
|
108
|
-
title:
|
|
106
|
+
title: d(() => [...s[5] || (s[5] = [
|
|
109
107
|
A("Request Headers", -1)
|
|
110
108
|
])]),
|
|
111
109
|
_: 1
|
|
112
|
-
}, 8, ["id", "headers", "role"])) :
|
|
110
|
+
}, 8, ["id", "headers", "role"])) : u("", !0),
|
|
113
111
|
f("Headers") ? (o(), r(V, {
|
|
114
112
|
key: 2,
|
|
115
113
|
id: a.value.Headers,
|
|
@@ -117,37 +115,37 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
|
|
|
117
115
|
headers: m.value,
|
|
118
116
|
role: n.value === "All" ? "none" : "tabpanel"
|
|
119
117
|
}, {
|
|
120
|
-
title:
|
|
118
|
+
title: d(() => [...s[6] || (s[6] = [
|
|
121
119
|
A("Response Headers", -1)
|
|
122
120
|
])]),
|
|
123
121
|
_: 1
|
|
124
|
-
}, 8, ["id", "headers", "role"])) :
|
|
125
|
-
(o(!0), p(y, null,
|
|
126
|
-
default:
|
|
127
|
-
l.components?.response && e.request && e.response ?
|
|
122
|
+
}, 8, ["id", "headers", "role"])) : u("", !0),
|
|
123
|
+
(o(!0), p(y, null, g(e.plugins, (l, H) => (o(), r(I(N), { key: H }, {
|
|
124
|
+
default: d(() => [
|
|
125
|
+
l.components?.response && e.request && e.response ? E((o(), r(O(l.components.response), {
|
|
128
126
|
key: 0,
|
|
129
127
|
request: e.request,
|
|
130
128
|
response: e.response
|
|
131
129
|
}, null, 8, ["request", "response"])), [
|
|
132
|
-
[
|
|
133
|
-
]) :
|
|
130
|
+
[z, n.value === "All"]
|
|
131
|
+
]) : u("", !0)
|
|
134
132
|
]),
|
|
135
133
|
_: 2
|
|
136
134
|
}, 1024))), 128)),
|
|
137
135
|
n.value === "All" || n.value === "Body" ? (o(), p(y, { key: 3 }, [
|
|
138
|
-
"reader" in e.response ? (o(), r(
|
|
136
|
+
"reader" in e.response ? (o(), r(w, {
|
|
139
137
|
key: 0,
|
|
140
138
|
id: a.value.Body,
|
|
141
139
|
class: "response-section-content-body",
|
|
142
140
|
reader: e.response.reader
|
|
143
|
-
}, null, 8, ["id", "reader"])) :
|
|
141
|
+
}, null, 8, ["id", "reader"])) : B.value && typeof e.response?.data == "string" ? (o(), r(F, {
|
|
144
142
|
key: 1,
|
|
145
143
|
id: a.value.Body,
|
|
146
144
|
content: e.response.data,
|
|
147
145
|
data: e.response?.data,
|
|
148
146
|
headers: m.value,
|
|
149
147
|
role: n.value === "All" ? "none" : "tabpanel"
|
|
150
|
-
}, null, 8, ["id", "content", "data", "headers", "role"])) : (o(), r(
|
|
148
|
+
}, null, 8, ["id", "content", "data", "headers", "role"])) : (o(), r(j, {
|
|
151
149
|
key: 2,
|
|
152
150
|
id: a.value.Body,
|
|
153
151
|
active: !0,
|
|
@@ -158,11 +156,10 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
|
|
|
158
156
|
role: n.value === "All" ? "none" : "tabpanel",
|
|
159
157
|
title: "Body"
|
|
160
158
|
}, null, 8, ["id", "data", "headers", "role"]))
|
|
161
|
-
], 64)) :
|
|
162
|
-
], 64)) : (o(), r(
|
|
159
|
+
], 64)) : u("", !0)
|
|
160
|
+
], 64)) : (o(), r(K, {
|
|
163
161
|
key: 0,
|
|
164
162
|
appVersion: e.appVersion,
|
|
165
|
-
events: e.events,
|
|
166
163
|
layout: e.layout,
|
|
167
164
|
totalPerformedRequests: e.totalPerformedRequests,
|
|
168
165
|
onAddRequest: s[1] || (s[1] = (l) => e.eventBus.emit("ui:open:command-palette", {
|
|
@@ -170,15 +167,15 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
|
|
|
170
167
|
payload: void 0
|
|
171
168
|
})),
|
|
172
169
|
onOpenCommandPalette: s[2] || (s[2] = (l) => e.eventBus.emit("ui:open:command-palette")),
|
|
173
|
-
onSendRequest: s[3] || (s[3] = (l) =>
|
|
174
|
-
}, null, 8, ["appVersion", "
|
|
175
|
-
|
|
176
|
-
], 10,
|
|
170
|
+
onSendRequest: s[3] || (s[3] = (l) => e.eventBus.emit("operation:send:request:hotkey"))
|
|
171
|
+
}, null, 8, ["appVersion", "layout", "totalPerformedRequests"])),
|
|
172
|
+
R(M, { eventBus: e.eventBus }, null, 8, ["eventBus"])
|
|
173
|
+
], 10, W)
|
|
177
174
|
]),
|
|
178
175
|
_: 1
|
|
179
176
|
}));
|
|
180
177
|
}
|
|
181
178
|
});
|
|
182
179
|
export {
|
|
183
|
-
|
|
180
|
+
ve as default
|
|
184
181
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyStreaming.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseBodyStreaming.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponseBodyStreaming.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseBodyStreaming.vue"],"names":[],"mappings":"AAuKA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAA;CAChD,CAAC;;AAmPF,wBAMG"}
|
|
@@ -1,74 +1,94 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLoadingState as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as B, ref as i, watch as y, nextTick as C, onBeforeUnmount as b, createBlock as L, openBlock as u, unref as n, createSlots as T, withCtx as d, createElementVNode as v, createElementBlock as m, createCommentVNode as g, toDisplayString as k, createVNode as w, createTextVNode as N } from "vue";
|
|
2
|
+
import { useLoadingState as V, ScalarLoading as E, ScalarButton as z } from "@scalar/components";
|
|
3
|
+
import D from "../../../components/layout/CollapsibleSection.vue.js";
|
|
4
|
+
const j = { class: "flex w-full items-center justify-between" }, H = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "mr-2 flex items-center gap-2"
|
|
7
|
-
},
|
|
7
|
+
}, U = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-red bg-b-danger sticky top-0 border-b p-2"
|
|
10
|
-
},
|
|
10
|
+
}, $ = {
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "p-2"
|
|
13
|
-
},
|
|
13
|
+
}, G = /* @__PURE__ */ B({
|
|
14
14
|
__name: "ResponseBodyStreaming",
|
|
15
15
|
props: {
|
|
16
16
|
reader: {}
|
|
17
17
|
},
|
|
18
18
|
setup(f) {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const a = V(), o = i(""), s = i(null), c = i(null), t = i(null), r = i(null), S = () => {
|
|
20
|
+
c.value && (c.value.scrollTop = c.value.scrollHeight);
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
y(o, async () => {
|
|
23
|
+
await C(S);
|
|
24
24
|
});
|
|
25
|
-
async function
|
|
25
|
+
async function h(l) {
|
|
26
26
|
try {
|
|
27
|
-
for (;
|
|
28
|
-
const { done:
|
|
29
|
-
if (
|
|
30
|
-
|
|
27
|
+
for (; a.isLoading && t.value === l; ) {
|
|
28
|
+
const { done: e, value: x } = await l.read();
|
|
29
|
+
if (t.value !== l)
|
|
30
|
+
break;
|
|
31
|
+
if (e) {
|
|
32
|
+
a.clear();
|
|
31
33
|
break;
|
|
32
34
|
}
|
|
33
|
-
|
|
35
|
+
x && r.value && (o.value += r.value.decode(x, { stream: !0 }));
|
|
34
36
|
}
|
|
35
|
-
} catch (
|
|
36
|
-
console.error("Error reading stream:",
|
|
37
|
+
} catch (e) {
|
|
38
|
+
t.value === l && (console.error("Error reading stream:", e), a.clear(), s.value = e);
|
|
37
39
|
} finally {
|
|
38
|
-
o.value +=
|
|
40
|
+
t.value === l && r.value && (o.value += r.value.decode());
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
const _ = () => {
|
|
44
|
+
t.value && t.value.cancel(), t.value = f.reader, r.value = new TextDecoder(), a.start(), o.value = "", s.value = null, h(f.reader);
|
|
45
|
+
}, p = () => {
|
|
46
|
+
t.value && (t.value.cancel(), t.value = null), a.clear();
|
|
47
|
+
};
|
|
48
|
+
return y(() => f.reader, _, { immediate: !0 }), b(p), (l, e) => (u(), L(n(D), { class: "max-h-content overflow-y-hidden" }, T({
|
|
49
|
+
title: d(() => [
|
|
50
|
+
v("div", j, [
|
|
51
|
+
e[1] || (e[1] = v("div", null, "Body", -1)),
|
|
52
|
+
n(a).isLoading ? (u(), m("div", H, [
|
|
53
|
+
w(n(E), {
|
|
54
|
+
loadingState: n(a),
|
|
52
55
|
size: "xs"
|
|
53
56
|
}, null, 8, ["loadingState"]),
|
|
54
|
-
|
|
55
|
-
])) :
|
|
57
|
+
e[0] || (e[0] = v("span", { class: "text-c-2" }, " Listening… ", -1))
|
|
58
|
+
])) : g("", !0)
|
|
56
59
|
])
|
|
57
60
|
]),
|
|
58
|
-
default:
|
|
59
|
-
|
|
61
|
+
default: d(() => [
|
|
62
|
+
v("div", {
|
|
60
63
|
ref_key: "contentContainer",
|
|
61
|
-
ref:
|
|
64
|
+
ref: c,
|
|
62
65
|
class: "text-xxs font-code h-full overflow-auto leading-2 whitespace-pre-wrap"
|
|
63
66
|
}, [
|
|
64
|
-
|
|
65
|
-
o.value ? (
|
|
67
|
+
s.value ? (u(), m("div", U, k(s.value.message), 1)) : g("", !0),
|
|
68
|
+
o.value ? (u(), m("div", $, k(o.value), 1)) : g("", !0)
|
|
66
69
|
], 512)
|
|
67
70
|
]),
|
|
68
|
-
_:
|
|
69
|
-
}
|
|
71
|
+
_: 2
|
|
72
|
+
}, [
|
|
73
|
+
n(a).isLoading ? {
|
|
74
|
+
name: "actions",
|
|
75
|
+
fn: d(() => [
|
|
76
|
+
w(n(z), {
|
|
77
|
+
size: "sm",
|
|
78
|
+
variant: "ghost",
|
|
79
|
+
onClick: p
|
|
80
|
+
}, {
|
|
81
|
+
default: d(() => [...e[2] || (e[2] = [
|
|
82
|
+
N(" Cancel ", -1)
|
|
83
|
+
])]),
|
|
84
|
+
_: 1
|
|
85
|
+
})
|
|
86
|
+
]),
|
|
87
|
+
key: "0"
|
|
88
|
+
} : void 0
|
|
89
|
+
]), 1024));
|
|
70
90
|
}
|
|
71
91
|
});
|
|
72
92
|
export {
|
|
73
|
-
|
|
93
|
+
G as default
|
|
74
94
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type ClientLayout } from '../../../../hooks/index.js';
|
|
2
|
-
import type { createStoreEvents } from '../../../../store/events.js';
|
|
3
2
|
type __VLS_Props = {
|
|
4
3
|
/** Client layout */
|
|
5
4
|
layout: ClientLayout;
|
|
@@ -7,8 +6,6 @@ type __VLS_Props = {
|
|
|
7
6
|
totalPerformedRequests: number;
|
|
8
7
|
/** Application version */
|
|
9
8
|
appVersion: string;
|
|
10
|
-
/** Event bus */
|
|
11
|
-
events: ReturnType<typeof createStoreEvents>;
|
|
12
9
|
};
|
|
13
10
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
11
|
sendRequest: () => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseEmpty.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseEmpty.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponseEmpty.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseEmpty.vue"],"names":[],"mappings":"AAoIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,KAAK,WAAW,GAAG;IACjB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,yCAAyC;IACzC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAA;CACnB,CAAC;;;;;;;;;;AAwMF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseEmpty.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-651d0186"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, createElementBlock as a, openBlock as s, createElementVNode as o, createCommentVNode as r, normalizeClass as f, createVNode as l, createTextVNode as n, toDisplayString as y, unref as i } from "vue";
|
|
2
2
|
import { ScalarHotkey as d } from "@scalar/components";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
3
|
+
import x from "../../../../assets/computer.ascii.js";
|
|
4
|
+
import k from "../../../../components/EmptyState.vue.js";
|
|
5
|
+
import b from "../../../../components/ScalarAsciiArt.vue.js";
|
|
6
|
+
const v = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitalize" }, g = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "scalar-version-number"
|
|
9
|
-
},
|
|
9
|
+
}, R = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, P = /* @__PURE__ */ p({
|
|
10
10
|
__name: "ResponseEmpty",
|
|
11
11
|
props: {
|
|
12
12
|
layout: {},
|
|
13
13
|
totalPerformedRequests: {},
|
|
14
|
-
appVersion: {}
|
|
15
|
-
events: {}
|
|
14
|
+
appVersion: {}
|
|
16
15
|
},
|
|
17
16
|
emits: ["addRequest", "sendRequest", "openCommandPalette"],
|
|
18
|
-
setup(t, { emit:
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
return k(() => t.events.hotKeys.on(u)), v(() => t.events.hotKeys.off(u)), (f, e) => (a(), s("div", C, [
|
|
17
|
+
setup(t, { emit: c }) {
|
|
18
|
+
const m = c;
|
|
19
|
+
return (q, e) => (s(), a("div", v, [
|
|
23
20
|
o("div", {
|
|
24
|
-
class:
|
|
21
|
+
class: f(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
|
25
22
|
"hidden opacity-0": t.totalPerformedRequests < 1 && t.layout !== "modal"
|
|
26
23
|
}])
|
|
27
24
|
}, [
|
|
28
|
-
t.layout !== "modal" ? (
|
|
29
|
-
|
|
25
|
+
t.layout !== "modal" ? (s(), a("div", g, [
|
|
26
|
+
n(" Scalar App V" + y(t.appVersion) + " Beta ", 1),
|
|
30
27
|
e[3] || (e[3] = o("div", { class: "mt-2" }, [
|
|
31
28
|
o("a", {
|
|
32
29
|
href: "https://github.com/scalar/scalar/issues/2669",
|
|
@@ -39,53 +36,53 @@ const C = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
39
36
|
href: "https://www.scalar.com",
|
|
40
37
|
target: "_blank"
|
|
41
38
|
}, " Powered By Scalar.com ", -1)),
|
|
42
|
-
l(
|
|
43
|
-
art:
|
|
39
|
+
l(b, {
|
|
40
|
+
art: i(x),
|
|
44
41
|
class: "text-c-3"
|
|
45
42
|
}, null, 8, ["art"])
|
|
46
43
|
], 2),
|
|
47
|
-
t.layout !== "modal" ? (
|
|
44
|
+
t.layout !== "modal" ? (s(), a("div", {
|
|
48
45
|
key: 0,
|
|
49
|
-
class:
|
|
46
|
+
class: f(["hidden h-[calc(100%_-_50px)] items-center justify-center pb-5", {
|
|
50
47
|
"!flex opacity-100": t.totalPerformedRequests == 0
|
|
51
48
|
}])
|
|
52
49
|
}, [
|
|
53
|
-
l(
|
|
50
|
+
l(k)
|
|
54
51
|
], 2)) : r("", !0),
|
|
55
|
-
o("div",
|
|
56
|
-
t.layout !== "modal" ? (
|
|
52
|
+
o("div", R, [
|
|
53
|
+
t.layout !== "modal" ? (s(), a("button", {
|
|
57
54
|
key: 0,
|
|
58
55
|
class: "flex items-center gap-1.5",
|
|
59
56
|
type: "button",
|
|
60
|
-
onClick: e[0] || (e[0] = (
|
|
57
|
+
onClick: e[0] || (e[0] = (u) => m("openCommandPalette"))
|
|
61
58
|
}, [
|
|
62
|
-
e[5] || (e[5] =
|
|
63
|
-
l(
|
|
59
|
+
e[5] || (e[5] = n(" Get Started ", -1)),
|
|
60
|
+
l(i(d), {
|
|
64
61
|
hotkey: "p",
|
|
65
62
|
modifier: ["default", "Shift"]
|
|
66
63
|
})
|
|
67
64
|
])) : r("", !0),
|
|
68
|
-
t.layout === "desktop" ? (
|
|
65
|
+
t.layout === "desktop" ? (s(), a("button", {
|
|
69
66
|
key: 1,
|
|
70
67
|
class: "flex items-center gap-1.5",
|
|
71
68
|
type: "button",
|
|
72
|
-
onClick: e[1] || (e[1] = (
|
|
69
|
+
onClick: e[1] || (e[1] = (u) => m("addRequest"))
|
|
73
70
|
}, [
|
|
74
|
-
e[6] || (e[6] =
|
|
75
|
-
l(
|
|
71
|
+
e[6] || (e[6] = n(" New Request ", -1)),
|
|
72
|
+
l(i(d), { hotkey: "N" })
|
|
76
73
|
])) : r("", !0),
|
|
77
74
|
o("button", {
|
|
78
75
|
class: "flex items-center gap-1.5",
|
|
79
76
|
type: "button",
|
|
80
|
-
onClick: e[2] || (e[2] = (
|
|
77
|
+
onClick: e[2] || (e[2] = (u) => m("sendRequest"))
|
|
81
78
|
}, [
|
|
82
|
-
e[7] || (e[7] =
|
|
83
|
-
l(
|
|
79
|
+
e[7] || (e[7] = n(" Send Request ", -1)),
|
|
80
|
+
l(i(d), { hotkey: "↵" })
|
|
84
81
|
])
|
|
85
82
|
])
|
|
86
83
|
]));
|
|
87
84
|
}
|
|
88
85
|
});
|
|
89
86
|
export {
|
|
90
|
-
|
|
87
|
+
P as default
|
|
91
88
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/** Workspace event bus */
|
|
4
|
+
eventBus: WorkspaceEventBus;
|
|
5
5
|
};
|
|
6
6
|
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
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseLoadingOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseLoadingOverlay.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponseLoadingOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseLoadingOverlay.vue"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,KAAK,WAAW,GAAG;IACjB,0BAA0B;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AAwHF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseLoadingOverlay.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const p = /* @__PURE__ */
|
|
3
|
+
import e from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-1f35725e"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import { defineComponent as c, ref as
|
|
2
|
-
import { useLoadingState as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as c, ref as d, onMounted as m, onBeforeUnmount as f, createBlock as v, openBlock as l, Transition as B, withCtx as u, createElementBlock as k, createCommentVNode as g, unref as n, createVNode as i, createTextVNode as x } from "vue";
|
|
2
|
+
import { useLoadingState as p, ScalarLoading as q, ScalarButton as C } from "@scalar/components";
|
|
3
|
+
const L = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "bg-b-1 z-overlay absolute inset-0 flex flex-col items-center justify-center gap-6"
|
|
6
|
-
},
|
|
6
|
+
}, N = /* @__PURE__ */ c({
|
|
7
7
|
__name: "ResponseLoadingOverlay",
|
|
8
8
|
props: {
|
|
9
|
-
|
|
9
|
+
eventBus: {}
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
setup(e) {
|
|
12
|
+
const t = p(), s = d(), r = () => {
|
|
13
|
+
s.value = setTimeout(() => t.start(), 1e3);
|
|
14
|
+
}, a = () => {
|
|
15
|
+
clearTimeout(s.value), s.value = void 0, t.clear();
|
|
16
|
+
};
|
|
17
|
+
return m(() => {
|
|
18
|
+
e.eventBus.on("hooks:on:request:sent", r), e.eventBus.on("hooks:on:request:complete", a);
|
|
19
|
+
}), f(() => {
|
|
20
|
+
e.eventBus.off("hooks:on:request:sent", r), e.eventBus.off("hooks:on:request:complete", a), a();
|
|
21
|
+
}), (h, o) => (l(), v(B, null, {
|
|
22
|
+
default: u(() => [
|
|
23
|
+
n(t).isActive ? (l(), k("div", L, [
|
|
24
|
+
i(n(q), {
|
|
19
25
|
class: "text-c-3",
|
|
20
|
-
loader:
|
|
26
|
+
loader: n(t),
|
|
21
27
|
size: "3xl"
|
|
22
28
|
}, null, 8, ["loader"]),
|
|
23
|
-
i(
|
|
29
|
+
i(n(C), {
|
|
24
30
|
variant: "ghost",
|
|
25
|
-
onClick:
|
|
31
|
+
onClick: o[0] || (o[0] = (y) => e.eventBus.emit("operation:cancel:request"))
|
|
26
32
|
}, {
|
|
27
|
-
default:
|
|
28
|
-
|
|
33
|
+
default: u(() => [...o[1] || (o[1] = [
|
|
34
|
+
x(" Cancel ", -1)
|
|
29
35
|
])]),
|
|
30
36
|
_: 1
|
|
31
37
|
})
|
|
32
|
-
])) :
|
|
38
|
+
])) : g("", !0)
|
|
33
39
|
]),
|
|
34
40
|
_: 1
|
|
35
41
|
}));
|
|
36
42
|
}
|
|
37
43
|
});
|
|
38
44
|
export {
|
|
39
|
-
|
|
45
|
+
N as default
|
|
40
46
|
};
|