@scalar/api-client 2.0.13 → 2.0.15
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 +23 -0
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +44 -32
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +3 -3
- package/dist/components/AddressBar/AddressBarServer.vue.js +23 -23
- package/dist/components/CodeInput/CodeInput.vue.d.ts +2 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +16 -14
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue2.js +63 -61
- package/dist/components/DataTable/DataTableInputEnumSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputEnumSelect.vue.js +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +15 -17
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +12 -12
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/components/TopNav/TopNavItem.vue2.js +10 -7
- 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 +101 -100
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -0
- package/package.json +6 -6
|
@@ -1,148 +1,149 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as P, ref as G, onMounted as J, onBeforeUnmount as Q, computed as X, openBlock as p, createElementBlock as _, Fragment as q, createElementVNode as d, createVNode as r, unref as e, createCommentVNode as k, withCtx as m, withDirectives as Y, normalizeClass as S, createTextVNode as $, toDisplayString as Z, withModifiers as E, renderList as ee, createBlock as C, vShow as te } from "vue";
|
|
2
|
+
import oe from "../../components/ActionModal/ActionModal.vue.js";
|
|
3
|
+
import se from "../../components/AddressBar/AddressBar.vue.js";
|
|
4
4
|
import re from "../../components/Search/SearchButton.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useWorkspace as
|
|
10
|
-
import
|
|
5
|
+
import ne from "../../components/Search/SearchModal.vue.js";
|
|
6
|
+
import ae from "../../components/Sidebar/SidebarButton.vue.js";
|
|
7
|
+
import le from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
8
|
+
import ie from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
9
|
+
import { useWorkspace as ue } from "../../store/workspace.js";
|
|
10
|
+
import ce from "./RequestSection/RequestSection.vue.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
import { useModal as
|
|
12
|
+
import de from "./ResponseSection/ResponseSection.vue.js";
|
|
13
|
+
import { useModal as me, ScalarIcon as b } from "@scalar/components";
|
|
14
14
|
import { isMacOS as I } from "@scalar/use-tooltip";
|
|
15
|
-
import { useMagicKeys as
|
|
16
|
-
import
|
|
17
|
-
import { useActionModal as
|
|
18
|
-
import
|
|
15
|
+
import { useMagicKeys as pe, useEventListener as fe } from "@vueuse/core";
|
|
16
|
+
import ve from "./RequestSidebarItem.vue.js";
|
|
17
|
+
import { useActionModal as ge } from "../../hooks/useActionModal.js";
|
|
18
|
+
import xe from "../../components/Sidebar/Sidebar.vue.js";
|
|
19
19
|
/* empty css */
|
|
20
|
-
import { useSidebar as
|
|
21
|
-
import { sendRequest as
|
|
20
|
+
import { useSidebar as he } from "../../hooks/useSidebar.js";
|
|
21
|
+
import { sendRequest as be } from "../../libs/sendRequest.js";
|
|
22
22
|
import { executeRequestBus as V } from "../../libs/eventBusses/executeRequestBus.js";
|
|
23
|
-
const
|
|
24
|
-
key: 0,
|
|
25
|
-
class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full"
|
|
26
|
-
}, ye = { class: "lg:min-h-header flex items-center w-full justify-center p-1 flex-wrap t-app__top-container" }, we = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, _e = { 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" }, Ke = /* @__PURE__ */ K({
|
|
23
|
+
const ye = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full" }, we = { class: "lg:min-h-header flex items-center w-full justify-center p-1 flex-wrap t-app__top-container" }, _e = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, ke = { 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" }, Pe = /* @__PURE__ */ P({
|
|
27
24
|
__name: "Request",
|
|
28
|
-
setup(
|
|
29
|
-
var
|
|
25
|
+
setup(Se) {
|
|
26
|
+
var O;
|
|
30
27
|
const {
|
|
31
|
-
activeExample:
|
|
32
|
-
activeRequest:
|
|
33
|
-
activeServer:
|
|
28
|
+
activeExample: y,
|
|
29
|
+
activeRequest: i,
|
|
30
|
+
activeServer: x,
|
|
34
31
|
activeSecurityScheme: z,
|
|
35
|
-
activeWorkspace:
|
|
32
|
+
activeWorkspace: u,
|
|
36
33
|
collections: N,
|
|
37
|
-
modalState:
|
|
38
|
-
} =
|
|
39
|
-
|
|
34
|
+
modalState: j
|
|
35
|
+
} = ue(), { collapsedSidebarFolders: A } = he(), w = ge(), f = me(), l = G(!((O = u.value) != null && O.isReadOnly)), L = (s) => {
|
|
36
|
+
w.tab = s;
|
|
40
37
|
}, D = async () => {
|
|
41
|
-
var n,
|
|
42
|
-
if (!
|
|
38
|
+
var n, c, v, g;
|
|
39
|
+
if (!i.value || !y.value) {
|
|
43
40
|
console.warn(
|
|
44
41
|
"There is no request active at the moment. Please select one then try again."
|
|
45
42
|
);
|
|
46
43
|
return;
|
|
47
44
|
}
|
|
48
|
-
let s = (
|
|
49
|
-
if ((
|
|
50
|
-
const
|
|
51
|
-
s = s.replace(
|
|
52
|
-
var
|
|
53
|
-
const a = (
|
|
54
|
-
return (a == null ? void 0 : a.value) || (a == null ? void 0 : a.default) || ((B = a == null ? void 0 : a.enum) == null ? void 0 : B[0]) ||
|
|
45
|
+
let s = (n = x.value) != null && n.url ? ((c = x.value) == null ? void 0 : c.url) + i.value.path : i.value.path;
|
|
46
|
+
if ((v = x.value) != null && v.variables) {
|
|
47
|
+
const W = /{\s*([\w.-]+)\s*}/g;
|
|
48
|
+
s = s.replace(W, (H, K) => {
|
|
49
|
+
var R, M, B;
|
|
50
|
+
const a = (M = (R = x.value) == null ? void 0 : R.variables) == null ? void 0 : M[K];
|
|
51
|
+
return (a == null ? void 0 : a.value) || (a == null ? void 0 : a.default) || ((B = a == null ? void 0 : a.enum) == null ? void 0 : B[0]) || H;
|
|
55
52
|
});
|
|
56
53
|
}
|
|
57
|
-
const { request: o, response: t } = await
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
const { request: o, response: t } = await be(
|
|
55
|
+
i.value,
|
|
56
|
+
y.value,
|
|
60
57
|
s,
|
|
61
58
|
z.value,
|
|
62
|
-
(
|
|
59
|
+
(g = u.value) == null ? void 0 : g.proxyUrl
|
|
63
60
|
);
|
|
64
|
-
o && t ?
|
|
61
|
+
o && t ? i.value.history.push({
|
|
65
62
|
request: o,
|
|
66
63
|
response: t,
|
|
67
64
|
timestamp: Date.now()
|
|
68
65
|
}) : console.warn("No response or request was returned");
|
|
69
66
|
};
|
|
70
|
-
|
|
71
|
-
const
|
|
67
|
+
J(() => V.on(D)), Q(() => V.off(D));
|
|
68
|
+
const U = X(() => {
|
|
69
|
+
const s = Object.values(N), o = s.findIndex((n) => n.uid === "drafts"), [t] = s.splice(o, 1);
|
|
70
|
+
return s.push(t), s;
|
|
71
|
+
}), F = (s, o, t, n) => {
|
|
72
72
|
}, T = () => {
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
return
|
|
76
|
-
(I() ?
|
|
77
|
-
}), (s, o) => (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
w.show();
|
|
74
|
+
}, h = pe();
|
|
75
|
+
return fe(document, "keydown", (s) => {
|
|
76
|
+
(I() ? h.meta.value : h.ctrl.value) && s.key === "b" && (l.value = !l.value), (I() ? h.meta.value : h.ctrl.value) && s.key === "k" && (f.open ? f.hide() : f.show());
|
|
77
|
+
}), (s, o) => (p(), _(q, null, [
|
|
78
|
+
d("div", ye, [
|
|
79
|
+
d("div", we, [
|
|
80
|
+
d("div", _e, [
|
|
81
|
+
d("button", {
|
|
82
82
|
class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
|
|
83
83
|
type: "button",
|
|
84
|
-
onClick: o[0] || (o[0] = (t) =>
|
|
84
|
+
onClick: o[0] || (o[0] = (t) => l.value = !l.value)
|
|
85
85
|
}, [
|
|
86
|
-
r(e(
|
|
87
|
-
icon:
|
|
86
|
+
r(e(b), {
|
|
87
|
+
icon: l.value ? "SideBarOpen" : "SideBarClosed",
|
|
88
88
|
size: "sm"
|
|
89
89
|
}, null, 8, ["icon"])
|
|
90
90
|
])
|
|
91
91
|
]),
|
|
92
|
-
r(
|
|
93
|
-
|
|
94
|
-
e(
|
|
92
|
+
r(se),
|
|
93
|
+
d("div", ke, [
|
|
94
|
+
e(u).isReadOnly ? (p(), _("button", {
|
|
95
95
|
key: 0,
|
|
96
96
|
class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
|
|
97
97
|
type: "button",
|
|
98
|
-
onClick: o[1] || (o[1] = (t) => e(
|
|
98
|
+
onClick: o[1] || (o[1] = (t) => e(j).hide())
|
|
99
99
|
}, [
|
|
100
|
-
r(e(
|
|
100
|
+
r(e(b), {
|
|
101
|
+
class: "stroke-[1.75]",
|
|
101
102
|
icon: "Close",
|
|
102
|
-
size: "
|
|
103
|
+
size: "lg"
|
|
103
104
|
})
|
|
104
|
-
])) :
|
|
105
|
+
])) : k("", !0)
|
|
105
106
|
])
|
|
106
107
|
]),
|
|
107
|
-
r(
|
|
108
|
-
default:
|
|
109
|
-
|
|
110
|
-
class: S([
|
|
108
|
+
r(le, null, {
|
|
109
|
+
default: m(() => [
|
|
110
|
+
Y(r(e(xe), {
|
|
111
|
+
class: S([l.value ? "sidebar-active-width" : ""])
|
|
111
112
|
}, {
|
|
112
|
-
title:
|
|
113
|
-
$(
|
|
113
|
+
title: m(() => [
|
|
114
|
+
$(Z(e(u).name), 1)
|
|
114
115
|
]),
|
|
115
|
-
content:
|
|
116
|
+
content: m(() => [
|
|
116
117
|
r(re, {
|
|
117
118
|
onOpenSearchModal: o[2] || (o[2] = (t) => e(f).show())
|
|
118
119
|
}),
|
|
119
|
-
|
|
120
|
+
d("div", {
|
|
120
121
|
class: "custom-scroll flex flex-1 flex-col overflow-visible px-3 pb-12 pt-2.5",
|
|
121
122
|
onDragenter: o[3] || (o[3] = E(() => {
|
|
122
123
|
}, ["prevent"])),
|
|
123
124
|
onDragover: o[4] || (o[4] = E(() => {
|
|
124
125
|
}, ["prevent"]))
|
|
125
126
|
}, [
|
|
126
|
-
(
|
|
127
|
+
(p(!0), _(q, null, ee(U.value, (t, n) => (p(), C(ve, {
|
|
127
128
|
key: t.uid,
|
|
128
|
-
isDraggable: !e(
|
|
129
|
-
isDroppable: !e(
|
|
129
|
+
isDraggable: !e(u).isReadOnly,
|
|
130
|
+
isDroppable: !e(u).isReadOnly,
|
|
130
131
|
item: t,
|
|
131
132
|
parentUids: [],
|
|
132
|
-
onOnDragEnd: (...
|
|
133
|
+
onOnDragEnd: (...c) => F(t, n, ...c)
|
|
133
134
|
}, {
|
|
134
|
-
leftIcon:
|
|
135
|
-
r(e(
|
|
135
|
+
leftIcon: m(() => [
|
|
136
|
+
r(e(b), {
|
|
136
137
|
class: "text-sidebar-c-2 stroke-[1] text-sm group-hover:hidden",
|
|
137
138
|
icon: "CodeFolder",
|
|
138
139
|
size: "sm"
|
|
139
140
|
}),
|
|
140
|
-
|
|
141
|
+
d("div", {
|
|
141
142
|
class: S({
|
|
142
|
-
"rotate-90": e(
|
|
143
|
+
"rotate-90": e(A)[t.uid]
|
|
143
144
|
})
|
|
144
145
|
}, [
|
|
145
|
-
r(e(
|
|
146
|
+
r(e(b), {
|
|
146
147
|
class: "text-c-3 hidden text-sm group-hover:block",
|
|
147
148
|
icon: "ChevronRight",
|
|
148
149
|
size: "sm"
|
|
@@ -153,12 +154,12 @@ const be = {
|
|
|
153
154
|
}, 1032, ["isDraggable", "isDroppable", "item", "onOnDragEnd"]))), 128))
|
|
154
155
|
], 32)
|
|
155
156
|
]),
|
|
156
|
-
button:
|
|
157
|
-
e(
|
|
157
|
+
button: m(() => [
|
|
158
|
+
e(u).isReadOnly ? k("", !0) : (p(), C(ae, {
|
|
158
159
|
key: 0,
|
|
159
160
|
click: T
|
|
160
161
|
}, {
|
|
161
|
-
title:
|
|
162
|
+
title: m(() => [
|
|
162
163
|
$("Add Item")
|
|
163
164
|
]),
|
|
164
165
|
_: 1
|
|
@@ -166,35 +167,35 @@ const be = {
|
|
|
166
167
|
]),
|
|
167
168
|
_: 1
|
|
168
169
|
}, 8, ["class"]), [
|
|
169
|
-
[
|
|
170
|
+
[te, l.value]
|
|
170
171
|
]),
|
|
171
|
-
e(
|
|
172
|
+
e(y) ? (p(), C(ie, {
|
|
172
173
|
key: 0,
|
|
173
|
-
class: S(["flex-1", [
|
|
174
|
+
class: S(["flex-1", [l.value ? "sidebar-active-hide-layout" : ""]])
|
|
174
175
|
}, {
|
|
175
|
-
default:
|
|
176
|
-
var t, n,
|
|
176
|
+
default: m(() => {
|
|
177
|
+
var t, n, c, v, g;
|
|
177
178
|
return [
|
|
178
|
-
r(
|
|
179
|
-
r(
|
|
180
|
-
response: (
|
|
179
|
+
r(ce),
|
|
180
|
+
r(de, {
|
|
181
|
+
response: (g = (v = (t = e(i)) == null ? void 0 : t.history) == null ? void 0 : v[((c = (n = e(i)) == null ? void 0 : n.history) == null ? void 0 : c.length) - 1]) == null ? void 0 : g.response
|
|
181
182
|
}, null, 8, ["response"])
|
|
182
183
|
];
|
|
183
184
|
}),
|
|
184
185
|
_: 1
|
|
185
|
-
}, 8, ["class"])) :
|
|
186
|
-
r(
|
|
187
|
-
state: e(
|
|
188
|
-
"onUpdate:tab":
|
|
186
|
+
}, 8, ["class"])) : k("", !0),
|
|
187
|
+
r(oe, {
|
|
188
|
+
state: e(w),
|
|
189
|
+
"onUpdate:tab": L
|
|
189
190
|
}, null, 8, ["state"])
|
|
190
191
|
]),
|
|
191
192
|
_: 1
|
|
192
193
|
})
|
|
193
|
-
])
|
|
194
|
-
r(
|
|
194
|
+
]),
|
|
195
|
+
r(ne, { modalState: e(f) }, null, 8, ["modalState"])
|
|
195
196
|
], 64));
|
|
196
197
|
}
|
|
197
198
|
});
|
|
198
199
|
export {
|
|
199
|
-
|
|
200
|
+
Pe as default
|
|
200
201
|
};
|
|
@@ -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":";WAobS,MAAM;WACN,MAAM;eACF,GAAG,EAAE;;WAFT,MAAM;WACN,MAAM;eACF,GAAG,EAAE;;AAkwBlB,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"}
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.0.
|
|
21
|
+
"version": "2.0.15",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@headlessui/tailwindcss": "^0.2.0",
|
|
100
100
|
"@headlessui/vue": "^1.7.20",
|
|
101
|
-
"@scalar/openapi-parser": "^0.7.
|
|
101
|
+
"@scalar/openapi-parser": "^0.7.2",
|
|
102
102
|
"@vueuse/core": "^10.10.0",
|
|
103
103
|
"axios": "^1.6.8",
|
|
104
104
|
"cva": "1.0.0-beta.1",
|
|
@@ -110,14 +110,14 @@
|
|
|
110
110
|
"vue": "^3.4.22",
|
|
111
111
|
"vue-router": "^4.3.0",
|
|
112
112
|
"zod": "^3.22.4",
|
|
113
|
-
"@scalar/components": "0.12.
|
|
113
|
+
"@scalar/components": "0.12.12",
|
|
114
114
|
"@scalar/draggable": "0.1.3",
|
|
115
|
-
"@scalar/oas-utils": "0.2.
|
|
115
|
+
"@scalar/oas-utils": "0.2.13",
|
|
116
116
|
"@scalar/object-utils": "1.1.4",
|
|
117
117
|
"@scalar/themes": "0.9.13",
|
|
118
|
-
"@scalar/use-codemirror": "0.11.4",
|
|
119
118
|
"@scalar/use-toasts": "0.7.4",
|
|
120
|
-
"@scalar/use-tooltip": "1.0.2"
|
|
119
|
+
"@scalar/use-tooltip": "1.0.2",
|
|
120
|
+
"@scalar/use-codemirror": "0.11.5"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@types/content-type": "^1.1.8",
|