@scalar/api-client 2.0.26 → 2.0.27
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 +13 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +48 -46
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +23 -30
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts +20 -0
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarToggle.vue.js +48 -0
- package/dist/components/Sidebar/SidebarToggle.vue2.js +4 -0
- package/dist/style.css +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -30
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +83 -88
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +155 -125
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +0 -5
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +24 -113
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";AAi/BA,wBAKG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Request.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-60c28ddd"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { defineComponent as W, ref as j, onMounted as F, onBeforeUnmount as A, openBlock as
|
|
1
|
+
import { defineComponent as W, ref as j, onMounted as F, onBeforeUnmount as A, openBlock as p, createElementBlock as y, Fragment as R, createElementVNode as f, normalizeClass as b, createVNode as r, unref as e, createCommentVNode as _, withCtx as m, withDirectives as H, createSlots as P, withModifiers as O, renderList as J, createBlock as w, createTextVNode as K, vShow as Q } from "vue";
|
|
2
2
|
import G from "../../components/AddressBar/AddressBar.vue.js";
|
|
3
3
|
import X from "../../components/Search/SearchButton.vue.js";
|
|
4
4
|
import Y from "../../components/Search/SearchModal.vue.js";
|
|
5
5
|
import Z from "../../components/Sidebar/SidebarButton.vue.js";
|
|
6
|
-
import ee from "../../components/
|
|
7
|
-
import te from "../../components/ViewLayout/
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import se from "
|
|
6
|
+
import ee from "../../components/Sidebar/SidebarToggle.vue.js";
|
|
7
|
+
import te from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
8
|
+
import oe from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
9
|
+
import { commandPaletteBus as re } from "../../libs/eventBusses/command-palette.js";
|
|
10
|
+
import { useWorkspace as se } from "../../store/workspace.js";
|
|
11
|
+
import ae from "./RequestSection/RequestSection.vue.js";
|
|
11
12
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
import { useModal as
|
|
14
|
-
import { REQUEST_METHODS as
|
|
15
|
-
import { isMacOS as
|
|
16
|
-
import { useMagicKeys as
|
|
13
|
+
import ne from "./ResponseSection/ResponseSection.vue.js";
|
|
14
|
+
import { useModal as le, ScalarIcon as k } from "@scalar/components";
|
|
15
|
+
import { REQUEST_METHODS as ie } from "@scalar/oas-utils/helpers";
|
|
16
|
+
import { isMacOS as D } from "@scalar/use-tooltip";
|
|
17
|
+
import { useMagicKeys as ue, useEventListener as me } from "@vueuse/core";
|
|
17
18
|
import ce from "./RequestSidebarItem.vue.js";
|
|
18
|
-
import
|
|
19
|
+
import de from "../../components/Sidebar/Sidebar.vue.js";
|
|
19
20
|
/* empty css */
|
|
20
|
-
import
|
|
21
|
-
import { useSidebar as
|
|
22
|
-
import { sendRequest as
|
|
23
|
-
import { executeRequestBus as
|
|
24
|
-
const
|
|
21
|
+
import pe from "./components/WorkspaceDropdown.vue.js";
|
|
22
|
+
import { useSidebar as fe } from "../../hooks/useSidebar.js";
|
|
23
|
+
import { sendRequest as ve } from "../../libs/sendRequest.js";
|
|
24
|
+
import { executeRequestBus as E } from "../../libs/eventBusses/executeRequestBus.js";
|
|
25
|
+
const ge = { class: "lg:min-h-header flex items-center w-full justify-center p-1 flex-wrap t-app__top-container" }, he = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, xe = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 justify-end w-6/12" }, Ae = /* @__PURE__ */ W({
|
|
25
26
|
__name: "Request",
|
|
26
|
-
setup(
|
|
27
|
+
setup(be) {
|
|
27
28
|
var C;
|
|
28
29
|
const {
|
|
29
30
|
activeExample: h,
|
|
30
31
|
activeRequest: n,
|
|
31
|
-
activeSecurityScheme:
|
|
32
|
-
activeWorkspaceServers:
|
|
33
|
-
activeWorkspace:
|
|
32
|
+
activeSecurityScheme: q,
|
|
33
|
+
activeWorkspaceServers: B,
|
|
34
|
+
activeWorkspace: l,
|
|
34
35
|
environments: M,
|
|
35
|
-
requestMutators:
|
|
36
|
-
activeWorkspaceCollections:
|
|
37
|
-
modalState:
|
|
38
|
-
} =
|
|
36
|
+
requestMutators: V,
|
|
37
|
+
activeWorkspaceCollections: $,
|
|
38
|
+
modalState: I
|
|
39
|
+
} = se(), { collapsedSidebarFolders: N } = fe(), v = le(), i = j(!((C = l.value) != null && C.isReadOnly)), S = async () => {
|
|
39
40
|
var g;
|
|
40
41
|
if (!n.value || !h.value) {
|
|
41
42
|
console.warn(
|
|
@@ -45,27 +46,27 @@ const ve = { class: "lg:min-h-header flex items-center w-full justify-center p-1
|
|
|
45
46
|
}
|
|
46
47
|
let s = h.value.url;
|
|
47
48
|
const o = Object.values(M).reduce(
|
|
48
|
-
(
|
|
49
|
+
(c, d) => {
|
|
49
50
|
try {
|
|
50
|
-
return { ...
|
|
51
|
+
return { ...c, ...JSON.parse(d.raw) };
|
|
51
52
|
} catch {
|
|
52
|
-
return
|
|
53
|
+
return c;
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
56
|
{}
|
|
56
57
|
), t = /\{\{(.*?)\}\}/g;
|
|
57
|
-
s = s.replace(t, (
|
|
58
|
-
if (
|
|
59
|
-
return
|
|
60
|
-
}), o[
|
|
61
|
-
const { request: a, response: u } = await
|
|
58
|
+
s = s.replace(t, (c, d) => (B.value.forEach((T) => {
|
|
59
|
+
if (T.url === d)
|
|
60
|
+
return d;
|
|
61
|
+
}), o[d] || d));
|
|
62
|
+
const { request: a, response: u } = await ve(
|
|
62
63
|
n.value,
|
|
63
64
|
h.value,
|
|
64
65
|
s,
|
|
65
|
-
|
|
66
|
-
(g =
|
|
66
|
+
q.value,
|
|
67
|
+
(g = l.value) == null ? void 0 : g.proxyUrl
|
|
67
68
|
);
|
|
68
|
-
a && u ?
|
|
69
|
+
a && u ? V.edit(n.value.uid, "history", [
|
|
69
70
|
...n.value.history,
|
|
70
71
|
{
|
|
71
72
|
request: a,
|
|
@@ -74,43 +75,37 @@ const ve = { class: "lg:min-h-header flex items-center w-full justify-center p-1
|
|
|
74
75
|
}
|
|
75
76
|
]) : console.warn("No response or request was returned");
|
|
76
77
|
};
|
|
77
|
-
F(() =>
|
|
78
|
-
const
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
(
|
|
78
|
+
F(() => E.on(S)), A(() => E.off(S));
|
|
79
|
+
const U = (s, o, t, a) => {
|
|
80
|
+
}, z = () => re.emit(), x = ue();
|
|
81
|
+
me(document, "keydown", (s) => {
|
|
82
|
+
(D() ? x.meta.value : x.ctrl.value) && s.key === "b" && (i.value = !i.value), (D() ? x.meta.value : x.ctrl.value) && s.key === "k" && (v.open ? v.hide() : v.show());
|
|
82
83
|
});
|
|
83
|
-
const
|
|
84
|
+
const L = () => {
|
|
84
85
|
if (!n.value) return "";
|
|
85
86
|
const { method: s } = n.value;
|
|
86
|
-
return
|
|
87
|
+
return ie[s].backgroundColor;
|
|
87
88
|
};
|
|
88
|
-
return (s, o) => (
|
|
89
|
-
|
|
90
|
-
class: b(["flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full client-wrapper-bg-color",
|
|
89
|
+
return (s, o) => (p(), y(R, null, [
|
|
90
|
+
f("div", {
|
|
91
|
+
class: b(["flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full client-wrapper-bg-color", L()])
|
|
91
92
|
}, [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
r(e(y), {
|
|
100
|
-
icon: l.value ? "SideBarOpen" : "SideBarClosed",
|
|
101
|
-
size: "sm"
|
|
102
|
-
}, null, 8, ["icon"])
|
|
103
|
-
])
|
|
93
|
+
f("div", ge, [
|
|
94
|
+
f("div", he, [
|
|
95
|
+
r(ee, {
|
|
96
|
+
modelValue: i.value,
|
|
97
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => i.value = t)
|
|
98
|
+
}, null, 8, ["modelValue"])
|
|
104
99
|
]),
|
|
105
100
|
r(G),
|
|
106
|
-
|
|
107
|
-
e(
|
|
101
|
+
f("div", xe, [
|
|
102
|
+
e(l).isReadOnly ? (p(), y("button", {
|
|
108
103
|
key: 0,
|
|
109
104
|
class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
|
|
110
105
|
type: "button",
|
|
111
|
-
onClick: o[1] || (o[1] = (t) => e(
|
|
106
|
+
onClick: o[1] || (o[1] = (t) => e(I).hide())
|
|
112
107
|
}, [
|
|
113
|
-
r(e(
|
|
108
|
+
r(e(k), {
|
|
114
109
|
icon: "Close",
|
|
115
110
|
size: "lg",
|
|
116
111
|
thickness: "1.75"
|
|
@@ -118,43 +113,43 @@ const ve = { class: "lg:min-h-header flex items-center w-full justify-center p-1
|
|
|
118
113
|
])) : _("", !0)
|
|
119
114
|
])
|
|
120
115
|
]),
|
|
121
|
-
r(
|
|
116
|
+
r(te, null, {
|
|
122
117
|
default: m(() => [
|
|
123
|
-
H(r(e(
|
|
124
|
-
class: b([
|
|
118
|
+
H(r(e(de), {
|
|
119
|
+
class: b([i.value ? "sidebar-active-width" : ""])
|
|
125
120
|
}, P({
|
|
126
121
|
content: m(() => [
|
|
127
122
|
r(X, {
|
|
128
123
|
onOpenSearchModal: o[2] || (o[2] = (t) => e(v).show())
|
|
129
124
|
}),
|
|
130
|
-
|
|
125
|
+
f("div", {
|
|
131
126
|
class: "custom-scroll flex flex-1 flex-col overflow-visible px-3 pb-12 pt-2.5",
|
|
132
|
-
onDragenter: o[3] || (o[3] =
|
|
127
|
+
onDragenter: o[3] || (o[3] = O(() => {
|
|
133
128
|
}, ["prevent"])),
|
|
134
|
-
onDragover: o[4] || (o[4] =
|
|
129
|
+
onDragover: o[4] || (o[4] = O(() => {
|
|
135
130
|
}, ["prevent"]))
|
|
136
131
|
}, [
|
|
137
|
-
(
|
|
132
|
+
(p(!0), y(R, null, J(e($), (t, a) => (p(), w(ce, {
|
|
138
133
|
key: t.uid,
|
|
139
|
-
isDraggable: !e(
|
|
140
|
-
isDroppable: !e(
|
|
134
|
+
isDraggable: !e(l).isReadOnly,
|
|
135
|
+
isDroppable: !e(l).isReadOnly,
|
|
141
136
|
item: t,
|
|
142
137
|
parentUids: [],
|
|
143
|
-
onOnDragEnd: (...u) =>
|
|
138
|
+
onOnDragEnd: (...u) => U(t, a, ...u)
|
|
144
139
|
}, {
|
|
145
140
|
leftIcon: m(() => [
|
|
146
|
-
r(e(
|
|
141
|
+
r(e(k), {
|
|
147
142
|
class: "text-sidebar-c-2 text-sm group-hover:hidden",
|
|
148
143
|
icon: "CodeFolder",
|
|
149
144
|
size: "sm",
|
|
150
145
|
thickness: "2"
|
|
151
146
|
}),
|
|
152
|
-
|
|
147
|
+
f("div", {
|
|
153
148
|
class: b({
|
|
154
|
-
"rotate-90": e(
|
|
149
|
+
"rotate-90": e(N)[t.uid]
|
|
155
150
|
})
|
|
156
151
|
}, [
|
|
157
|
-
r(e(
|
|
152
|
+
r(e(k), {
|
|
158
153
|
class: "text-c-3 hidden text-sm group-hover:block",
|
|
159
154
|
icon: "ChevronRight",
|
|
160
155
|
size: "sm"
|
|
@@ -166,9 +161,9 @@ const ve = { class: "lg:min-h-header flex items-center w-full justify-center p-1
|
|
|
166
161
|
], 32)
|
|
167
162
|
]),
|
|
168
163
|
button: m(() => [
|
|
169
|
-
e(
|
|
164
|
+
e(l).isReadOnly ? _("", !0) : (p(), w(Z, {
|
|
170
165
|
key: 0,
|
|
171
|
-
click:
|
|
166
|
+
click: z
|
|
172
167
|
}, {
|
|
173
168
|
title: m(() => [
|
|
174
169
|
K("Add Item")
|
|
@@ -178,26 +173,26 @@ const ve = { class: "lg:min-h-header flex items-center w-full justify-center p-1
|
|
|
178
173
|
]),
|
|
179
174
|
_: 2
|
|
180
175
|
}, [
|
|
181
|
-
e(
|
|
176
|
+
e(l).isReadOnly ? void 0 : {
|
|
182
177
|
name: "header",
|
|
183
178
|
fn: m(() => [
|
|
184
|
-
r(e(
|
|
179
|
+
r(e(pe))
|
|
185
180
|
]),
|
|
186
181
|
key: "0"
|
|
187
182
|
}
|
|
188
183
|
]), 1032, ["class"]), [
|
|
189
|
-
[Q,
|
|
184
|
+
[Q, i.value]
|
|
190
185
|
]),
|
|
191
|
-
e(h) ? (
|
|
186
|
+
e(h) ? (p(), w(oe, {
|
|
192
187
|
key: 0,
|
|
193
|
-
class: b(["flex-1", [
|
|
188
|
+
class: b(["flex-1", [i.value ? "sidebar-active-hide-layout" : ""]])
|
|
194
189
|
}, {
|
|
195
190
|
default: m(() => {
|
|
196
|
-
var t, a, u, g,
|
|
191
|
+
var t, a, u, g, c;
|
|
197
192
|
return [
|
|
198
|
-
r(
|
|
199
|
-
r(
|
|
200
|
-
response: (
|
|
193
|
+
r(ae),
|
|
194
|
+
r(ne, {
|
|
195
|
+
response: (c = (g = (t = e(n)) == null ? void 0 : t.history) == null ? void 0 : g[((u = (a = e(n)) == null ? void 0 : a.history) == null ? void 0 : u.length) - 1]) == null ? void 0 : c.response
|
|
201
196
|
}, null, 8, ["response"])
|
|
202
197
|
];
|
|
203
198
|
}),
|
|
@@ -212,5 +207,5 @@ const ve = { class: "lg:min-h-header flex items-center w-full justify-center p-1
|
|
|
212
207
|
}
|
|
213
208
|
});
|
|
214
209
|
export {
|
|
215
|
-
|
|
210
|
+
Ae as default
|
|
216
211
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestBody.vue"],"names":[],"mappings":";WA4dS,MAAM;WACN,MAAM;eACF,GAAG,EAAE;;WAFT,MAAM;WACN,MAAM;eACF,GAAG,EAAE;;AAuyBlB,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"}
|