@scalar/api-client 2.0.0 → 2.0.2
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 +22 -0
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +25 -736
- package/dist/Modal/ApiClientModal.vue.d.ts +1 -1
- package/dist/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/Modal/ApiClientModal.vue.js +6 -22
- package/dist/Modal/ApiClientModal.vue2.js +32 -0
- package/dist/Modal/api-client-modal.d.ts +3 -1
- package/dist/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/Modal/api-client-modal.js +63 -45
- package/dist/Modal/index.js +4 -4
- package/dist/index.js +11 -12
- package/dist/libs/sendRequest.js +19 -19
- 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 +67 -67
- package/package.json +6 -6
- package/dist/Modal/ApiClientModal.vue3.js +0 -5
|
@@ -1,40 +1,39 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useWorkspace as
|
|
10
|
-
import
|
|
1
|
+
import { defineComponent as K, ref as P, onMounted as W, onBeforeUnmount as G, computed as J, openBlock as c, createElementBlock as S, Fragment as B, createElementVNode as d, createVNode as s, unref as e, createCommentVNode as h, withCtx as m, createBlock as b, normalizeClass as C, createTextVNode as q, toDisplayString as Q, withModifiers as E, renderList as X } from "vue";
|
|
2
|
+
import Y from "../../components/ActionModal/ActionModal.vue.js";
|
|
3
|
+
import Z from "../../components/AddressBar/AddressBar.vue.js";
|
|
4
|
+
import ee from "../../components/Search/SearchButton.vue.js";
|
|
5
|
+
import te from "../../components/Search/SearchModal.vue.js";
|
|
6
|
+
import oe from "../../components/Sidebar/SidebarButton.vue.js";
|
|
7
|
+
import re from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
8
|
+
import se from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
9
|
+
import { useWorkspace as ne } from "../../store/workspace.js";
|
|
10
|
+
import ae from "./RequestSection/RequestSection.vue.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
import { useModal as
|
|
14
|
-
import { isMacOS as
|
|
15
|
-
import { useMagicKeys as
|
|
16
|
-
import
|
|
17
|
-
import { useActionModal as
|
|
18
|
-
import
|
|
19
|
-
import ce from "../../components/Sidebar/Sidebar.vue.js";
|
|
12
|
+
import le from "./ResponseSection/ResponseSection.vue.js";
|
|
13
|
+
import { useModal as ie, ScalarIcon as y } from "@scalar/components";
|
|
14
|
+
import { isMacOS as $ } from "@scalar/use-tooltip";
|
|
15
|
+
import { useMagicKeys as ue, useEventListener as ce } from "@vueuse/core";
|
|
16
|
+
import de from "./RequestSidebarItem.vue.js";
|
|
17
|
+
import { useActionModal as me } from "../../hooks/useActionModal.js";
|
|
18
|
+
import pe from "../../components/Sidebar/Sidebar.vue.js";
|
|
20
19
|
/* empty css */
|
|
21
|
-
import { useSidebar as
|
|
22
|
-
import {
|
|
23
|
-
|
|
20
|
+
import { useSidebar as fe } from "../../hooks/useSidebar.js";
|
|
21
|
+
import { sendRequest as ve } from "../../libs/sendRequest.js";
|
|
22
|
+
import { executeRequestBus as I } from "../../libs/eventBusses/executeRequestBus.js";
|
|
23
|
+
const ge = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full" }, xe = { 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" }, be = { 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" }, V = !0, je = /* @__PURE__ */ K({
|
|
24
24
|
__name: "Request",
|
|
25
|
-
setup(
|
|
25
|
+
setup(ye) {
|
|
26
26
|
const {
|
|
27
27
|
activeExample: w,
|
|
28
28
|
activeRequest: p,
|
|
29
29
|
activeServer: _,
|
|
30
|
-
activeSecurityScheme:
|
|
31
|
-
collections:
|
|
32
|
-
modalState:
|
|
30
|
+
activeSecurityScheme: z,
|
|
31
|
+
collections: L,
|
|
32
|
+
modalState: N,
|
|
33
33
|
workspace: i
|
|
34
|
-
} =
|
|
34
|
+
} = ne(), { collapsedSidebarFolders: U } = fe(), k = me(), f = ie(), l = P(!1), A = (r) => {
|
|
35
35
|
k.tab = r;
|
|
36
|
-
}
|
|
37
|
-
me.on(async () => {
|
|
36
|
+
}, D = async () => {
|
|
38
37
|
var n, u;
|
|
39
38
|
if (!p.value || !w.value) {
|
|
40
39
|
console.warn(
|
|
@@ -45,17 +44,17 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
|
|
|
45
44
|
let r = ((n = _.value) == null ? void 0 : n.url) + p.value.path;
|
|
46
45
|
if ((u = _.value) != null && u.variables) {
|
|
47
46
|
const g = /{\s*([\w.-]+)\s*}/g;
|
|
48
|
-
r = r.replace(g, (x,
|
|
49
|
-
var
|
|
50
|
-
const a = (
|
|
47
|
+
r = r.replace(g, (x, H) => {
|
|
48
|
+
var M, R, O;
|
|
49
|
+
const a = (R = (M = _.value) == null ? void 0 : M.variables) == null ? void 0 : R[H];
|
|
51
50
|
return (a == null ? void 0 : a.value) || (a == null ? void 0 : a.default) || ((O = a == null ? void 0 : a.enum) == null ? void 0 : O[0]) || x;
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
|
-
const { request: o, response: t } = await
|
|
53
|
+
const { request: o, response: t } = await ve(
|
|
55
54
|
p.value,
|
|
56
55
|
w.value,
|
|
57
56
|
r,
|
|
58
|
-
|
|
57
|
+
z.value,
|
|
59
58
|
i.proxyUrl
|
|
60
59
|
);
|
|
61
60
|
o && t ? p.value.history.push({
|
|
@@ -63,19 +62,20 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
|
|
|
63
62
|
response: t,
|
|
64
63
|
timestamp: Date.now()
|
|
65
64
|
}) : console.warn("No response or request was returned");
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
};
|
|
66
|
+
W(() => I.on(D)), G(() => I.off(D));
|
|
67
|
+
const F = J(
|
|
68
|
+
() => i.collectionUids.map((r) => L[r])
|
|
69
|
+
), T = (r, o, t, n) => {
|
|
70
|
+
}, j = () => {
|
|
71
71
|
k.show();
|
|
72
|
-
}, v =
|
|
73
|
-
return
|
|
74
|
-
(
|
|
75
|
-
}), (r, o) => (c(), S(
|
|
76
|
-
d("div",
|
|
77
|
-
d("div",
|
|
78
|
-
d("div",
|
|
72
|
+
}, v = ue();
|
|
73
|
+
return ce(document, "keydown", (r) => {
|
|
74
|
+
($() ? v.meta.value : v.ctrl.value) && r.key === "b" && (l.value = !l.value), ($() ? v.meta.value : v.ctrl.value) && r.key === "k" && (f.open ? f.hide() : f.show());
|
|
75
|
+
}), (r, o) => (c(), S(B, null, [
|
|
76
|
+
d("div", ge, [
|
|
77
|
+
d("div", xe, [
|
|
78
|
+
d("div", he, [
|
|
79
79
|
d("button", {
|
|
80
80
|
class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
|
|
81
81
|
type: "button",
|
|
@@ -87,13 +87,13 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
|
|
|
87
87
|
}, null, 8, ["icon"])
|
|
88
88
|
])
|
|
89
89
|
]),
|
|
90
|
-
s(
|
|
91
|
-
d("div",
|
|
90
|
+
s(Z),
|
|
91
|
+
d("div", be, [
|
|
92
92
|
e(i).isReadOnly ? (c(), S("button", {
|
|
93
93
|
key: 0,
|
|
94
94
|
class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
|
|
95
95
|
type: "button",
|
|
96
|
-
onClick: o[1] || (o[1] = (t) => e(
|
|
96
|
+
onClick: o[1] || (o[1] = (t) => e(N).hide())
|
|
97
97
|
}, [
|
|
98
98
|
s(e(y), {
|
|
99
99
|
icon: "Close",
|
|
@@ -102,17 +102,17 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
|
|
|
102
102
|
])) : h("", !0)
|
|
103
103
|
])
|
|
104
104
|
]),
|
|
105
|
-
s(
|
|
105
|
+
s(re, null, {
|
|
106
106
|
default: m(() => [
|
|
107
|
-
l.value ? (c(), b(e(
|
|
107
|
+
l.value ? (c(), b(e(pe), {
|
|
108
108
|
key: 0,
|
|
109
109
|
class: C([l.value ? "sidebar-active-width" : ""])
|
|
110
110
|
}, {
|
|
111
111
|
title: m(() => [
|
|
112
|
-
|
|
112
|
+
q(Q(e(i).name), 1)
|
|
113
113
|
]),
|
|
114
114
|
content: m(() => [
|
|
115
|
-
s(
|
|
115
|
+
s(ee, {
|
|
116
116
|
onOpenSearchModal: o[2] || (o[2] = (t) => e(f).show())
|
|
117
117
|
}),
|
|
118
118
|
d("div", {
|
|
@@ -122,13 +122,13 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
|
|
|
122
122
|
onDragover: o[4] || (o[4] = E(() => {
|
|
123
123
|
}, ["prevent"]))
|
|
124
124
|
}, [
|
|
125
|
-
(c(!0), S(
|
|
125
|
+
(c(!0), S(B, null, X(F.value, (t, n) => (c(), b(de, {
|
|
126
126
|
key: t.uid,
|
|
127
|
-
isDraggable:
|
|
128
|
-
isDroppable:
|
|
127
|
+
isDraggable: V && !e(i).isReadOnly,
|
|
128
|
+
isDroppable: V && !e(i).isReadOnly,
|
|
129
129
|
item: t,
|
|
130
130
|
parentUids: [],
|
|
131
|
-
onOnDragEnd: (...u) =>
|
|
131
|
+
onOnDragEnd: (...u) => T(t, n, ...u)
|
|
132
132
|
}, {
|
|
133
133
|
leftIcon: m(() => [
|
|
134
134
|
s(e(y), {
|
|
@@ -138,7 +138,7 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
|
|
|
138
138
|
}),
|
|
139
139
|
d("div", {
|
|
140
140
|
class: C({
|
|
141
|
-
"rotate-90": e(
|
|
141
|
+
"rotate-90": e(U)[t.uid]
|
|
142
142
|
})
|
|
143
143
|
}, [
|
|
144
144
|
s(e(y), {
|
|
@@ -153,45 +153,45 @@ const pe = { class: "bg-b-2 flex flex-1 flex-col rounded-lg rounded-b-none round
|
|
|
153
153
|
], 32)
|
|
154
154
|
]),
|
|
155
155
|
button: m(() => [
|
|
156
|
-
e(i).isReadOnly ? h("", !0) : (c(), b(
|
|
156
|
+
e(i).isReadOnly ? h("", !0) : (c(), b(oe, {
|
|
157
157
|
key: 0,
|
|
158
|
-
click:
|
|
158
|
+
click: j
|
|
159
159
|
}, {
|
|
160
160
|
title: m(() => [
|
|
161
|
-
|
|
161
|
+
q("Add Item")
|
|
162
162
|
]),
|
|
163
163
|
_: 1
|
|
164
164
|
}))
|
|
165
165
|
]),
|
|
166
166
|
_: 1
|
|
167
167
|
}, 8, ["class"])) : h("", !0),
|
|
168
|
-
e(w) ? (c(), b(
|
|
168
|
+
e(w) ? (c(), b(se, {
|
|
169
169
|
key: 1,
|
|
170
170
|
class: C(["flex-1", [l.value ? "sidebar-active-hide-layout" : ""]])
|
|
171
171
|
}, {
|
|
172
172
|
default: m(() => {
|
|
173
173
|
var t, n, u, g, x;
|
|
174
174
|
return [
|
|
175
|
-
s(
|
|
176
|
-
s(
|
|
175
|
+
s(ae),
|
|
176
|
+
s(le, {
|
|
177
177
|
response: (x = (g = (t = e(p)) == null ? void 0 : t.history) == null ? void 0 : g[((u = (n = e(p)) == null ? void 0 : n.history) == null ? void 0 : u.length) - 1]) == null ? void 0 : x.response
|
|
178
178
|
}, null, 8, ["response"])
|
|
179
179
|
];
|
|
180
180
|
}),
|
|
181
181
|
_: 1
|
|
182
182
|
}, 8, ["class"])) : h("", !0),
|
|
183
|
-
s(
|
|
183
|
+
s(Y, {
|
|
184
184
|
state: e(k),
|
|
185
|
-
"onUpdate:tab":
|
|
185
|
+
"onUpdate:tab": A
|
|
186
186
|
}, null, 8, ["state"])
|
|
187
187
|
]),
|
|
188
188
|
_: 1
|
|
189
189
|
})
|
|
190
190
|
]),
|
|
191
|
-
s(
|
|
191
|
+
s(te, { modalState: e(f) }, null, 8, ["modalState"])
|
|
192
192
|
], 64));
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
export {
|
|
196
|
-
|
|
196
|
+
je as default
|
|
197
197
|
};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.0.
|
|
21
|
+
"version": "2.0.2",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
"vue": "^3.4.22",
|
|
110
110
|
"vue-router": "^4.3.0",
|
|
111
111
|
"zod": "^3.22.4",
|
|
112
|
-
"@scalar/
|
|
113
|
-
"@scalar/components": "0.12.6",
|
|
112
|
+
"@scalar/components": "0.12.7",
|
|
114
113
|
"@scalar/object-utils": "1.1.2",
|
|
115
|
-
"@scalar/
|
|
114
|
+
"@scalar/draggable": "0.1.3",
|
|
116
115
|
"@scalar/use-tooltip": "1.0.2",
|
|
116
|
+
"@scalar/use-toasts": "0.7.4",
|
|
117
117
|
"@scalar/oas-utils": "0.2.7"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
@@ -132,9 +132,9 @@
|
|
|
132
132
|
"vite-svg-loader": "^5.1.0",
|
|
133
133
|
"vitest": "^1.6.0",
|
|
134
134
|
"vue-tsc": "^2.0.13",
|
|
135
|
+
"@scalar/build-tooling": "0.1.8",
|
|
135
136
|
"@scalar/themes": "0.9.9",
|
|
136
|
-
"@scalar/use-codemirror": "0.11.4"
|
|
137
|
-
"@scalar/build-tooling": "0.1.7"
|
|
137
|
+
"@scalar/use-codemirror": "0.11.4"
|
|
138
138
|
},
|
|
139
139
|
"scripts": {
|
|
140
140
|
"build": "vite build && pnpm types:build && tsc-alias -p tsconfig.build.json",
|