@scalar/api-client 2.3.15 → 2.3.17
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 +21 -0
- package/dist/components/ScalarAsciiArt.vue.d.ts.map +1 -1
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +2 -1
- 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/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 +39 -36
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +58 -58
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +72 -69
- 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.vue.d.ts +5 -0
- 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 +56 -59
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +5 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +40 -34
- package/package.json +113 -113
|
@@ -1,107 +1,104 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as q, onMounted as R, onBeforeUnmount as v, openBlock as l, createElementBlock as u, createElementVNode as s, normalizeClass as y, unref as t, createTextVNode as c, toDisplayString as h, createCommentVNode as p, createVNode as m, nextTick as C } from "vue";
|
|
2
|
+
import { useRoute as N, useRouter as S } from "vue-router";
|
|
3
|
+
import B from "../../../assets/computer.ascii.js";
|
|
4
|
+
import V from "../../../components/EmptyState.vue.js";
|
|
5
|
+
import E from "../../../components/ScalarAsciiArt.vue.js";
|
|
6
6
|
import d from "../../../components/ScalarHotkey.vue.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const P = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, T = {
|
|
7
|
+
import { useWorkspace as K } from "../../../store/store.js";
|
|
8
|
+
import { useLayout as A } from "../../../hooks/useLayout.js";
|
|
9
|
+
const W = { class: "col-1 flex-center relative gap-6 p-2 capitalize" }, $ = {
|
|
11
10
|
key: 0,
|
|
12
11
|
class: "scalar-version-number"
|
|
13
|
-
},
|
|
12
|
+
}, j = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, U = /* @__PURE__ */ q({
|
|
14
13
|
__name: "ResponseEmpty",
|
|
15
14
|
props: {
|
|
15
|
+
collection: {},
|
|
16
|
+
operation: {},
|
|
17
|
+
workspace: {},
|
|
16
18
|
numWorkspaceRequests: {}
|
|
17
19
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const { events:
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const s = (g = (v = p.value) == null ? void 0 : v.tags) != null && g.length ? { tags: p.value.tags[0] ? [p.value.tags[0]] : [] } : {}, e = R.add(
|
|
24
|
-
s,
|
|
25
|
-
(x = f.value) == null ? void 0 : x.uid
|
|
26
|
-
);
|
|
27
|
-
e && (h.push({
|
|
20
|
+
setup(r) {
|
|
21
|
+
const { events: a, requestMutators: g } = K(), x = N(), b = S(), { layout: n } = A(), f = () => {
|
|
22
|
+
var i;
|
|
23
|
+
const o = (i = r.operation.tags) != null && i.length ? { tags: r.operation.tags[0] ? [r.operation.tags[0]] : [] } : {}, e = g.add(o, r.collection.uid);
|
|
24
|
+
e && (b.push({
|
|
28
25
|
name: "request",
|
|
29
26
|
params: {
|
|
30
|
-
workspace:
|
|
27
|
+
workspace: r.workspace.uid,
|
|
31
28
|
request: e.uid
|
|
32
29
|
}
|
|
33
|
-
}),
|
|
34
|
-
|
|
30
|
+
}), C(() => {
|
|
31
|
+
a.hotKeys.emit({
|
|
35
32
|
focusAddressBar: new KeyboardEvent("keydown", { key: "l" })
|
|
36
33
|
});
|
|
37
34
|
}));
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
class:
|
|
44
|
-
"hidden opacity-0":
|
|
35
|
+
}, k = (o) => {
|
|
36
|
+
o != null && o.createNew && x.name === "request" && f();
|
|
37
|
+
}, w = "2.3.17";
|
|
38
|
+
return R(() => a.hotKeys.on(k)), v(() => a.hotKeys.off(k)), (o, e) => (l(), u("div", W, [
|
|
39
|
+
s("div", {
|
|
40
|
+
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
|
41
|
+
"hidden opacity-0": o.numWorkspaceRequests <= 1 && t(n) !== "modal"
|
|
45
42
|
}])
|
|
46
43
|
}, [
|
|
47
|
-
t(
|
|
48
|
-
|
|
49
|
-
e[3] || (e[3] =
|
|
50
|
-
|
|
44
|
+
t(n) !== "modal" ? (l(), u("div", $, [
|
|
45
|
+
c(" Scalar App V" + h(t(w)) + " Beta ", 1),
|
|
46
|
+
e[3] || (e[3] = s("div", { class: "mt-2" }, [
|
|
47
|
+
s("a", {
|
|
51
48
|
href: "https://github.com/scalar/scalar/issues/2669",
|
|
52
49
|
target: "_blank"
|
|
53
50
|
}, " Roadmap ")
|
|
54
51
|
], -1))
|
|
55
|
-
])) :
|
|
56
|
-
e[4] || (e[4] =
|
|
52
|
+
])) : p("", !0),
|
|
53
|
+
e[4] || (e[4] = s("a", {
|
|
57
54
|
class: "gitbook-show scalar-version-number",
|
|
58
55
|
href: "https://www.scalar.com",
|
|
59
56
|
target: "_blank"
|
|
60
57
|
}, " Powered By Scalar.com ", -1)),
|
|
61
|
-
|
|
62
|
-
art: t(
|
|
58
|
+
m(E, {
|
|
59
|
+
art: t(B),
|
|
63
60
|
class: "text-c-3"
|
|
64
61
|
}, null, 8, ["art"])
|
|
65
62
|
], 2),
|
|
66
|
-
t(
|
|
63
|
+
t(n) !== "modal" ? (l(), u("div", {
|
|
67
64
|
key: 0,
|
|
68
|
-
class:
|
|
69
|
-
"!flex opacity-100":
|
|
65
|
+
class: y(["hidden h-[calc(100%_-_50px)] items-center justify-center pb-5", {
|
|
66
|
+
"!flex opacity-100": o.numWorkspaceRequests == 1
|
|
70
67
|
}])
|
|
71
68
|
}, [
|
|
72
|
-
|
|
73
|
-
], 2)) :
|
|
74
|
-
|
|
75
|
-
t(
|
|
69
|
+
m(V)
|
|
70
|
+
], 2)) : p("", !0),
|
|
71
|
+
s("div", j, [
|
|
72
|
+
t(n) !== "modal" ? (l(), u("button", {
|
|
76
73
|
key: 0,
|
|
77
74
|
class: "flex items-center gap-1.5",
|
|
78
75
|
type: "button",
|
|
79
|
-
onClick: e[0] || (e[0] = (
|
|
76
|
+
onClick: e[0] || (e[0] = (i) => t(a).commandPalette.emit())
|
|
80
77
|
}, [
|
|
81
|
-
e[5] || (e[5] =
|
|
82
|
-
|
|
83
|
-
])) :
|
|
84
|
-
t(
|
|
78
|
+
e[5] || (e[5] = c(" Get Started ")),
|
|
79
|
+
m(d, { hotkey: "k" })
|
|
80
|
+
])) : p("", !0),
|
|
81
|
+
t(n) === "desktop" ? (l(), u("button", {
|
|
85
82
|
key: 1,
|
|
86
83
|
class: "flex items-center gap-1.5",
|
|
87
84
|
type: "button",
|
|
88
|
-
onClick: e[1] || (e[1] = (
|
|
85
|
+
onClick: e[1] || (e[1] = (i) => f())
|
|
89
86
|
}, [
|
|
90
|
-
e[6] || (e[6] =
|
|
91
|
-
|
|
92
|
-
])) :
|
|
93
|
-
|
|
87
|
+
e[6] || (e[6] = c(" New Request ")),
|
|
88
|
+
m(d, { hotkey: "N" })
|
|
89
|
+
])) : p("", !0),
|
|
90
|
+
s("button", {
|
|
94
91
|
class: "flex items-center gap-1.5",
|
|
95
92
|
type: "button",
|
|
96
|
-
onClick: e[2] || (e[2] = (
|
|
93
|
+
onClick: e[2] || (e[2] = (i) => t(a).executeRequest.emit())
|
|
97
94
|
}, [
|
|
98
|
-
e[7] || (e[7] =
|
|
99
|
-
|
|
95
|
+
e[7] || (e[7] = c(" Send Request ")),
|
|
96
|
+
m(d, { hotkey: "↵" })
|
|
100
97
|
])
|
|
101
98
|
])
|
|
102
99
|
]));
|
|
103
100
|
}
|
|
104
101
|
});
|
|
105
102
|
export {
|
|
106
|
-
|
|
103
|
+
U as default
|
|
107
104
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
|
|
1
|
+
import type { Collection, Operation, ResponseInstance } from '@scalar/oas-utils/entities/spec';
|
|
2
|
+
import type { Workspace } from '@scalar/oas-utils/entities/workspace';
|
|
2
3
|
import type { SendRequestResult } from '../../../libs/send-request/create-request-operation';
|
|
3
4
|
type __VLS_Props = {
|
|
5
|
+
collection: Collection;
|
|
6
|
+
operation: Operation;
|
|
7
|
+
workspace: Workspace;
|
|
4
8
|
numWorkspaceRequests: number;
|
|
5
9
|
response: ResponseInstance | undefined;
|
|
6
10
|
requestResult: SendRequestResult | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponseSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseSection.vue"],"names":[],"mappings":"AA+PA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAKrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAarF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,SAAS,CAAA;IACpB,SAAS,EAAE,SAAS,CAAA;IACpB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACtC,aAAa,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAA;CACpD,CAAC;;AA0SF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ResponseSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-15bfba2e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import { defineComponent as j, computed as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as j, computed as c, ref as C, useId as T, openBlock as l, createBlock as i, withCtx as f, createElementVNode as d, normalizeClass as y, createCommentVNode as u, createVNode as k, createElementBlock as h, Fragment as b } from "vue";
|
|
2
|
+
import w from "../../../components/SectionFilter.vue.js";
|
|
3
|
+
import V from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
4
|
+
import I from "./RequestHeaders.vue.js";
|
|
5
|
+
import g from "./ResponseBody.vue.js";
|
|
6
|
+
import $ from "./ResponseBodyVirtual.vue.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import E from "./ResponseCookies.vue.js";
|
|
9
|
+
import O from "./ResponseEmpty.vue.js";
|
|
10
10
|
import z from "./ResponseHeaders.vue.js";
|
|
11
11
|
import N from "./ResponseLoadingOverlay.vue.js";
|
|
12
12
|
import S from "./ResponseMetaInformation.vue.js";
|
|
13
13
|
const W = { class: "flex h-8 flex-1 items-center" }, F = ["id", "role"], A = 2e5, _ = /* @__PURE__ */ j({
|
|
14
14
|
__name: "ResponseSection",
|
|
15
15
|
props: {
|
|
16
|
+
collection: {},
|
|
17
|
+
operation: {},
|
|
18
|
+
workspace: {},
|
|
16
19
|
numWorkspaceRequests: {},
|
|
17
20
|
response: {},
|
|
18
21
|
requestResult: {}
|
|
19
22
|
},
|
|
20
23
|
setup(n) {
|
|
21
|
-
const m =
|
|
24
|
+
const m = c(() => {
|
|
22
25
|
var a;
|
|
23
26
|
const e = (a = n.response) == null ? void 0 : a.headers;
|
|
24
27
|
return e ? Object.keys(e).map((o) => ({
|
|
@@ -26,7 +29,7 @@ const W = { class: "flex h-8 flex-1 items-center" }, F = ["id", "role"], A = 2e5
|
|
|
26
29
|
value: e[o] ?? "",
|
|
27
30
|
required: !1
|
|
28
31
|
})) : [];
|
|
29
|
-
}), R =
|
|
32
|
+
}), R = c(
|
|
30
33
|
() => {
|
|
31
34
|
var e;
|
|
32
35
|
return ((e = n.response) == null ? void 0 : e.cookieHeaderKeys.flatMap((a) => {
|
|
@@ -39,11 +42,11 @@ const W = { class: "flex h-8 flex-1 items-center" }, F = ["id", "role"], A = 2e5
|
|
|
39
42
|
} : [];
|
|
40
43
|
})) ?? [];
|
|
41
44
|
}
|
|
42
|
-
),
|
|
45
|
+
), B = ["Cookies", "Headers", "Body"], s = C("All"), v = c(() => ["All", ...B]), p = c(
|
|
43
46
|
() => Object.fromEntries(
|
|
44
47
|
v.value.map((e) => [e, T()])
|
|
45
48
|
)
|
|
46
|
-
),
|
|
49
|
+
), q = c(() => {
|
|
47
50
|
var t, r;
|
|
48
51
|
if (!n.response)
|
|
49
52
|
return !1;
|
|
@@ -76,7 +79,7 @@ const W = { class: "flex h-8 flex-1 items-center" }, F = ["id", "role"], A = 2e5
|
|
|
76
79
|
// Form data
|
|
77
80
|
"application/x-www-form-urlencoded"
|
|
78
81
|
].some((H) => e.includes(H)) && (n.response.size ?? 0) > A;
|
|
79
|
-
}),
|
|
82
|
+
}), x = c(
|
|
80
83
|
() => {
|
|
81
84
|
var e;
|
|
82
85
|
return ((e = n.requestResult) == null ? void 0 : e.request.parameters.headers.filter((a) => a.enabled).map((a) => ({
|
|
@@ -86,21 +89,21 @@ const W = { class: "flex h-8 flex-1 items-center" }, F = ["id", "role"], A = 2e5
|
|
|
86
89
|
}))) ?? [];
|
|
87
90
|
}
|
|
88
91
|
);
|
|
89
|
-
return (e, a) => (l(), i(
|
|
92
|
+
return (e, a) => (l(), i(V, { "aria-label": "Response" }, {
|
|
90
93
|
title: f(() => [
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
d("div", W, [
|
|
95
|
+
d("div", {
|
|
93
96
|
"aria-live": "polite",
|
|
94
97
|
class: y(["flex items-center", { "animate-response-heading": e.response }])
|
|
95
98
|
}, [
|
|
96
|
-
a[1] || (a[1] =
|
|
99
|
+
a[1] || (a[1] = d("span", { class: "response-heading pointer-events-none absolute" }, " Response ", -1)),
|
|
97
100
|
e.response ? (l(), i(S, {
|
|
98
101
|
key: 0,
|
|
99
102
|
class: "animate-response-children",
|
|
100
103
|
response: e.response
|
|
101
|
-
}, null, 8, ["response"])) :
|
|
104
|
+
}, null, 8, ["response"])) : u("", !0)
|
|
102
105
|
], 2),
|
|
103
|
-
|
|
106
|
+
k(w, {
|
|
104
107
|
modelValue: s.value,
|
|
105
108
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => s.value = o),
|
|
106
109
|
filterIds: p.value,
|
|
@@ -111,44 +114,44 @@ const W = { class: "flex h-8 flex-1 items-center" }, F = ["id", "role"], A = 2e5
|
|
|
111
114
|
default: f(() => {
|
|
112
115
|
var o, t, r;
|
|
113
116
|
return [
|
|
114
|
-
|
|
117
|
+
d("div", {
|
|
115
118
|
id: p.value.All,
|
|
116
119
|
class: y(["custom-scroll response-section-content relative grid h-full justify-stretch", {
|
|
117
120
|
"content-start": e.response
|
|
118
121
|
}]),
|
|
119
122
|
role: s.value === "All" && e.response ? "tabpanel" : "none"
|
|
120
123
|
}, [
|
|
121
|
-
e.response ? (l(),
|
|
122
|
-
s.value === "All" || s.value === "Cookies" ? (l(), i(
|
|
124
|
+
e.response ? (l(), h(b, { key: 1 }, [
|
|
125
|
+
s.value === "All" || s.value === "Cookies" ? (l(), i(E, {
|
|
123
126
|
key: 0,
|
|
124
127
|
class: "response-section-content-cookies",
|
|
125
128
|
id: p.value.Cookies,
|
|
126
129
|
cookies: R.value,
|
|
127
130
|
role: s.value === "All" ? "none" : "tabpanel"
|
|
128
|
-
}, null, 8, ["id", "cookies", "role"])) :
|
|
129
|
-
s.value === "All" || s.value === "Headers" ? (l(), i(
|
|
131
|
+
}, null, 8, ["id", "cookies", "role"])) : u("", !0),
|
|
132
|
+
s.value === "All" || s.value === "Headers" ? (l(), i(I, {
|
|
130
133
|
key: 1,
|
|
131
134
|
class: "response-section-content-headers",
|
|
132
135
|
id: p.value.Headers,
|
|
133
|
-
headers:
|
|
136
|
+
headers: x.value,
|
|
134
137
|
role: s.value === "All" ? "none" : "tabpanel"
|
|
135
|
-
}, null, 8, ["id", "headers", "role"])) :
|
|
138
|
+
}, null, 8, ["id", "headers", "role"])) : u("", !0),
|
|
136
139
|
s.value === "All" || s.value === "Headers" ? (l(), i(z, {
|
|
137
140
|
key: 2,
|
|
138
141
|
class: "response-section-content-headers",
|
|
139
142
|
id: p.value.Headers,
|
|
140
143
|
headers: m.value,
|
|
141
144
|
role: s.value === "All" ? "none" : "tabpanel"
|
|
142
|
-
}, null, 8, ["id", "headers", "role"])) :
|
|
143
|
-
s.value === "All" || s.value === "Body" ? (l(),
|
|
144
|
-
|
|
145
|
+
}, null, 8, ["id", "headers", "role"])) : u("", !0),
|
|
146
|
+
s.value === "All" || s.value === "Body" ? (l(), h(b, { key: 3 }, [
|
|
147
|
+
q.value && typeof ((o = e.response) == null ? void 0 : o.data) == "string" ? (l(), i($, {
|
|
145
148
|
key: 0,
|
|
146
149
|
id: p.value.Body,
|
|
147
150
|
content: e.response.data,
|
|
148
151
|
data: (t = e.response) == null ? void 0 : t.data,
|
|
149
152
|
headers: m.value,
|
|
150
153
|
role: s.value === "All" ? "none" : "tabpanel"
|
|
151
|
-
}, null, 8, ["id", "content", "data", "headers", "role"])) : (l(), i(
|
|
154
|
+
}, null, 8, ["id", "content", "data", "headers", "role"])) : (l(), i(g, {
|
|
152
155
|
key: 1,
|
|
153
156
|
class: "response-section-content-body",
|
|
154
157
|
id: p.value.Body,
|
|
@@ -158,12 +161,15 @@ const W = { class: "flex h-8 flex-1 items-center" }, F = ["id", "role"], A = 2e5
|
|
|
158
161
|
role: s.value === "All" ? "none" : "tabpanel",
|
|
159
162
|
title: "Body"
|
|
160
163
|
}, null, 8, ["id", "data", "headers", "role"]))
|
|
161
|
-
], 64)) :
|
|
162
|
-
], 64)) : (l(), i(
|
|
164
|
+
], 64)) : u("", !0)
|
|
165
|
+
], 64)) : (l(), i(O, {
|
|
163
166
|
key: 0,
|
|
167
|
+
collection: e.collection,
|
|
168
|
+
operation: e.operation,
|
|
169
|
+
workspace: e.workspace,
|
|
164
170
|
numWorkspaceRequests: e.numWorkspaceRequests
|
|
165
|
-
}, null, 8, ["numWorkspaceRequests"])),
|
|
166
|
-
|
|
171
|
+
}, null, 8, ["collection", "operation", "workspace", "numWorkspaceRequests"])),
|
|
172
|
+
k(N)
|
|
167
173
|
], 10, F)
|
|
168
174
|
];
|
|
169
175
|
}),
|