@scalar/api-client 2.0.33 → 2.0.34
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 +17 -0
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +39 -31
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +65 -55
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +53 -44
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +42 -34
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +126 -70
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +37 -29
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +97 -85
- package/dist/components/CommandPalette/handleKeyDown.d.ts +2 -0
- package/dist/components/CommandPalette/handleKeyDown.d.ts.map +1 -0
- package/dist/components/CommandPalette/handleKeyDown.js +7 -0
- package/dist/components/Form/Form.vue.js +1 -1
- package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchButton.vue.js +14 -16
- package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue2.js +9 -9
- package/dist/constants.d.ts +0 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -2
- package/dist/libs/sendRequest.d.ts +2 -1
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +54 -45
- 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 +106 -107
- package/package.json +6 -6
|
@@ -1,49 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { commandPaletteBus as
|
|
10
|
-
import { useWorkspace as
|
|
11
|
-
import
|
|
1
|
+
import { defineComponent as P, ref as A, onMounted as H, onBeforeUnmount as J, openBlock as f, createElementBlock as y, Fragment as O, createElementVNode as m, normalizeClass as x, createVNode as r, unref as e, createCommentVNode as _, withCtx as u, withDirectives as K, createSlots as Q, withModifiers as D, renderList as G, createBlock as w, createTextVNode as X, vShow as Y, pushScopeId as Z, popScopeId as ee } from "vue";
|
|
2
|
+
import te from "../../components/AddressBar/AddressBar.vue.js";
|
|
3
|
+
import oe from "../../components/Search/SearchButton.vue.js";
|
|
4
|
+
import re from "../../components/Search/SearchModal.vue.js";
|
|
5
|
+
import ae from "../../components/Sidebar/SidebarButton.vue.js";
|
|
6
|
+
import se from "../../components/Sidebar/SidebarToggle.vue.js";
|
|
7
|
+
import le from "../../components/ViewLayout/ViewLayout.vue.js";
|
|
8
|
+
import ne from "../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
9
|
+
import { commandPaletteBus as E } from "../../libs/eventBusses/command-palette.js";
|
|
10
|
+
import { useWorkspace as ie } from "../../store/workspace.js";
|
|
11
|
+
import ce from "./RequestSection/RequestSection.vue.js";
|
|
12
12
|
/* empty css */
|
|
13
|
-
import
|
|
14
|
-
import { useModal as
|
|
13
|
+
import ue from "./ResponseSection/ResponseSection.vue.js";
|
|
14
|
+
import { useModal as me, ScalarIcon as k } from "@scalar/components";
|
|
15
15
|
import { REQUEST_METHODS as de } from "@scalar/oas-utils/helpers";
|
|
16
|
-
import { isMacOS as
|
|
17
|
-
import { useMagicKeys as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
16
|
+
import { isMacOS as q } from "@scalar/use-tooltip";
|
|
17
|
+
import { useMagicKeys as pe, useEventListener as fe } from "@vueuse/core";
|
|
18
|
+
import ve from "./RequestSidebarItem.vue.js";
|
|
19
|
+
import ge from "../../components/Sidebar/Sidebar.vue.js";
|
|
20
20
|
/* empty css */
|
|
21
|
-
import
|
|
22
|
-
import { useSidebar as
|
|
21
|
+
import he from "./components/WorkspaceDropdown.vue.js";
|
|
22
|
+
import { useSidebar as be } from "../../hooks/useSidebar.js";
|
|
23
23
|
import { sendRequest as xe } from "../../libs/sendRequest.js";
|
|
24
|
-
import { executeRequestBus as
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
target: "_blank"
|
|
31
|
-
}, "Scalar.com")
|
|
32
|
-
], -1)), Se = { 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__ */ j({
|
|
24
|
+
import { executeRequestBus as B } from "../../libs/eventBusses/executeRequestBus.js";
|
|
25
|
+
const ye = (g) => (Z("data-v-ceecd7c7"), g = g(), ee(), g), _e = { 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" }, ke = /* @__PURE__ */ ye(() => /* @__PURE__ */ m("a", {
|
|
26
|
+
class: "text-c-2 text-sm font-medium gitbook-show ml-.5 hover:text-c-1 border p-1 rounded hover:bg-b-3",
|
|
27
|
+
href: "https://scalar.com/",
|
|
28
|
+
target: "_blank"
|
|
29
|
+
}, " Powered by Scalar.com ", -1)), Se = { 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" }, Qe = /* @__PURE__ */ P({
|
|
33
30
|
__name: "Request",
|
|
34
31
|
setup(g) {
|
|
35
32
|
var R;
|
|
36
33
|
const {
|
|
37
34
|
activeExample: h,
|
|
38
35
|
activeRequest: l,
|
|
39
|
-
activeSecurityScheme:
|
|
40
|
-
activeWorkspaceServers:
|
|
41
|
-
activeWorkspace:
|
|
42
|
-
environments:
|
|
43
|
-
requestMutators:
|
|
44
|
-
activeWorkspaceCollections:
|
|
45
|
-
modalState:
|
|
46
|
-
|
|
36
|
+
activeSecurityScheme: M,
|
|
37
|
+
activeWorkspaceServers: I,
|
|
38
|
+
activeWorkspace: n,
|
|
39
|
+
environments: V,
|
|
40
|
+
requestMutators: $,
|
|
41
|
+
activeWorkspaceCollections: N,
|
|
42
|
+
modalState: U,
|
|
43
|
+
cookies: z
|
|
44
|
+
} = ie(), { collapsedSidebarFolders: L } = be(), S = me(), i = A(!((R = n.value) != null && R.isReadOnly)), C = async () => {
|
|
47
45
|
var v;
|
|
48
46
|
if (!l.value || !h.value) {
|
|
49
47
|
console.warn(
|
|
@@ -51,70 +49,71 @@ const be = (g) => (G("data-v-d592e0db"), g = g(), X(), g), _e = { class: "lg:min
|
|
|
51
49
|
);
|
|
52
50
|
return;
|
|
53
51
|
}
|
|
54
|
-
let
|
|
55
|
-
const o = Object.values(
|
|
56
|
-
(
|
|
52
|
+
let a = h.value.url;
|
|
53
|
+
const o = Object.values(V).reduce(
|
|
54
|
+
(d, p) => {
|
|
57
55
|
try {
|
|
58
|
-
return { ...
|
|
56
|
+
return { ...d, ...JSON.parse(p.raw) };
|
|
59
57
|
} catch {
|
|
60
|
-
return
|
|
58
|
+
return d;
|
|
61
59
|
}
|
|
62
60
|
},
|
|
63
61
|
{}
|
|
64
62
|
), t = /\{\{(.*?)\}\}/g;
|
|
65
|
-
|
|
66
|
-
if (
|
|
63
|
+
a = a.replace(t, (d, p) => (I.value.forEach((F) => {
|
|
64
|
+
if (F.url === p)
|
|
67
65
|
return p;
|
|
68
66
|
}), o[p] || p));
|
|
69
|
-
const { request:
|
|
67
|
+
const { request: s, response: c } = await xe(
|
|
70
68
|
l.value,
|
|
71
69
|
h.value,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(v =
|
|
70
|
+
a,
|
|
71
|
+
M.value,
|
|
72
|
+
(v = n.value) == null ? void 0 : v.proxyUrl,
|
|
73
|
+
z
|
|
75
74
|
);
|
|
76
|
-
|
|
75
|
+
s && c ? $.edit(l.value.uid, "history", [
|
|
77
76
|
...l.value.history,
|
|
78
77
|
{
|
|
79
|
-
request:
|
|
80
|
-
response:
|
|
78
|
+
request: s,
|
|
79
|
+
response: c,
|
|
81
80
|
timestamp: Date.now()
|
|
82
81
|
}
|
|
83
82
|
]) : console.warn("No response or request was returned");
|
|
84
83
|
};
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
(
|
|
84
|
+
H(() => B.on(C)), J(() => B.off(C));
|
|
85
|
+
const T = (a, o, t, s) => {
|
|
86
|
+
}, W = () => E.emit(), b = pe();
|
|
87
|
+
fe(document, "keydown", (a) => {
|
|
88
|
+
(q() ? b.meta.value : b.ctrl.value) && a.key === "b" && (i.value = !i.value), !n.value.isReadOnly && (q() ? b.meta.value : b.ctrl.value) && a.key === "k" && E.emit();
|
|
90
89
|
});
|
|
91
|
-
const
|
|
90
|
+
const j = () => {
|
|
92
91
|
if (!l.value) return "";
|
|
93
|
-
const { method:
|
|
94
|
-
return de[
|
|
92
|
+
const { method: a } = l.value;
|
|
93
|
+
return de[a].backgroundColor;
|
|
95
94
|
};
|
|
96
|
-
return (
|
|
97
|
-
|
|
98
|
-
class: x(["flex flex-1 flex-col rounded rounded-b-none rounded-r-none pt-0 h-full client-wrapper-bg-color relative",
|
|
95
|
+
return (a, o) => (f(), y(O, null, [
|
|
96
|
+
m("div", {
|
|
97
|
+
class: x(["flex flex-1 flex-col rounded rounded-b-none rounded-r-none pt-0 h-full client-wrapper-bg-color relative", j()])
|
|
99
98
|
}, [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
r(
|
|
103
|
-
modelValue:
|
|
104
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) =>
|
|
99
|
+
m("div", _e, [
|
|
100
|
+
m("div", we, [
|
|
101
|
+
r(se, {
|
|
102
|
+
modelValue: i.value,
|
|
103
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => i.value = t),
|
|
105
104
|
class: "gitbook-hidden"
|
|
106
105
|
}, null, 8, ["modelValue"]),
|
|
107
|
-
|
|
106
|
+
ke
|
|
108
107
|
]),
|
|
109
|
-
r(
|
|
110
|
-
|
|
111
|
-
e(
|
|
108
|
+
r(te),
|
|
109
|
+
m("div", Se, [
|
|
110
|
+
e(n).isReadOnly ? (f(), y("button", {
|
|
112
111
|
key: 0,
|
|
113
112
|
class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
|
|
114
113
|
type: "button",
|
|
115
|
-
onClick: o[1] || (o[1] = (t) => e(
|
|
114
|
+
onClick: o[1] || (o[1] = (t) => e(U).hide())
|
|
116
115
|
}, [
|
|
117
|
-
r(e(
|
|
116
|
+
r(e(k), {
|
|
118
117
|
icon: "Close",
|
|
119
118
|
size: "lg",
|
|
120
119
|
thickness: "1.75"
|
|
@@ -122,43 +121,43 @@ const be = (g) => (G("data-v-d592e0db"), g = g(), X(), g), _e = { class: "lg:min
|
|
|
122
121
|
])) : _("", !0)
|
|
123
122
|
])
|
|
124
123
|
]),
|
|
125
|
-
r(
|
|
126
|
-
default:
|
|
127
|
-
|
|
128
|
-
class: x([
|
|
129
|
-
},
|
|
130
|
-
content:
|
|
131
|
-
r(
|
|
124
|
+
r(le, null, {
|
|
125
|
+
default: u(() => [
|
|
126
|
+
K(r(e(ge), {
|
|
127
|
+
class: x([i.value ? "sidebar-active-width" : ""])
|
|
128
|
+
}, Q({
|
|
129
|
+
content: u(() => [
|
|
130
|
+
r(oe, {
|
|
132
131
|
onOpenSearchModal: o[2] || (o[2] = (t) => e(S).show())
|
|
133
132
|
}),
|
|
134
|
-
|
|
133
|
+
m("div", {
|
|
135
134
|
class: "custom-scroll flex flex-1 flex-col overflow-visible px-3 pb-12 pt-2.5",
|
|
136
135
|
onDragenter: o[3] || (o[3] = D(() => {
|
|
137
136
|
}, ["prevent"])),
|
|
138
137
|
onDragover: o[4] || (o[4] = D(() => {
|
|
139
138
|
}, ["prevent"]))
|
|
140
139
|
}, [
|
|
141
|
-
(f(!0),
|
|
140
|
+
(f(!0), y(O, null, G(e(N), (t, s) => (f(), w(ve, {
|
|
142
141
|
key: t.uid,
|
|
143
|
-
isDraggable: !e(
|
|
144
|
-
isDroppable: !e(
|
|
142
|
+
isDraggable: !e(n).isReadOnly,
|
|
143
|
+
isDroppable: !e(n).isReadOnly,
|
|
145
144
|
item: t,
|
|
146
145
|
parentUids: [],
|
|
147
|
-
onOnDragEnd: (...
|
|
146
|
+
onOnDragEnd: (...c) => T(t, s, ...c)
|
|
148
147
|
}, {
|
|
149
|
-
leftIcon:
|
|
150
|
-
r(e(
|
|
148
|
+
leftIcon: u(() => [
|
|
149
|
+
r(e(k), {
|
|
151
150
|
class: "text-sidebar-c-2 text-sm group-hover:hidden",
|
|
152
151
|
icon: "CodeFolder",
|
|
153
152
|
size: "sm",
|
|
154
153
|
thickness: "2"
|
|
155
154
|
}),
|
|
156
|
-
|
|
155
|
+
m("div", {
|
|
157
156
|
class: x({
|
|
158
|
-
"rotate-90": e(
|
|
157
|
+
"rotate-90": e(L)[t.uid]
|
|
159
158
|
})
|
|
160
159
|
}, [
|
|
161
|
-
r(e(
|
|
160
|
+
r(e(k), {
|
|
162
161
|
class: "text-c-3 hidden text-sm group-hover:block",
|
|
163
162
|
icon: "ChevronRight",
|
|
164
163
|
size: "sm"
|
|
@@ -169,39 +168,39 @@ const be = (g) => (G("data-v-d592e0db"), g = g(), X(), g), _e = { class: "lg:min
|
|
|
169
168
|
}, 1032, ["isDraggable", "isDroppable", "item", "onOnDragEnd"]))), 128))
|
|
170
169
|
], 32)
|
|
171
170
|
]),
|
|
172
|
-
button:
|
|
173
|
-
e(
|
|
171
|
+
button: u(() => [
|
|
172
|
+
e(n).isReadOnly ? _("", !0) : (f(), w(ae, {
|
|
174
173
|
key: 0,
|
|
175
|
-
click:
|
|
174
|
+
click: W
|
|
176
175
|
}, {
|
|
177
|
-
title:
|
|
178
|
-
|
|
176
|
+
title: u(() => [
|
|
177
|
+
X("Add Item")
|
|
179
178
|
]),
|
|
180
179
|
_: 1
|
|
181
180
|
}))
|
|
182
181
|
]),
|
|
183
182
|
_: 2
|
|
184
183
|
}, [
|
|
185
|
-
e(
|
|
184
|
+
e(n).isReadOnly ? void 0 : {
|
|
186
185
|
name: "header",
|
|
187
|
-
fn:
|
|
188
|
-
r(e(
|
|
186
|
+
fn: u(() => [
|
|
187
|
+
r(e(he))
|
|
189
188
|
]),
|
|
190
189
|
key: "0"
|
|
191
190
|
}
|
|
192
191
|
]), 1032, ["class"]), [
|
|
193
|
-
[
|
|
192
|
+
[Y, i.value]
|
|
194
193
|
]),
|
|
195
|
-
e(h) ? (f(),
|
|
194
|
+
e(h) ? (f(), w(ne, {
|
|
196
195
|
key: 0,
|
|
197
|
-
class: x(["flex-1", [
|
|
196
|
+
class: x(["flex-1", [i.value ? "sidebar-active-hide-layout" : ""]])
|
|
198
197
|
}, {
|
|
199
|
-
default:
|
|
200
|
-
var t,
|
|
198
|
+
default: u(() => {
|
|
199
|
+
var t, s, c, v, d;
|
|
201
200
|
return [
|
|
202
|
-
r(
|
|
203
|
-
r(
|
|
204
|
-
response: (
|
|
201
|
+
r(ce),
|
|
202
|
+
r(ue, {
|
|
203
|
+
response: (d = (v = (t = e(l)) == null ? void 0 : t.history) == null ? void 0 : v[((c = (s = e(l)) == null ? void 0 : s.history) == null ? void 0 : c.length) - 1]) == null ? void 0 : d.response
|
|
205
204
|
}, null, 8, ["response"])
|
|
206
205
|
];
|
|
207
206
|
}),
|
|
@@ -211,10 +210,10 @@ const be = (g) => (G("data-v-d592e0db"), g = g(), X(), g), _e = { class: "lg:min
|
|
|
211
210
|
_: 1
|
|
212
211
|
})
|
|
213
212
|
], 2),
|
|
214
|
-
r(
|
|
213
|
+
r(re, { modalState: e(S) }, null, 8, ["modalState"])
|
|
215
214
|
], 64));
|
|
216
215
|
}
|
|
217
216
|
});
|
|
218
217
|
export {
|
|
219
|
-
|
|
218
|
+
Qe as default
|
|
220
219
|
};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.0.
|
|
21
|
+
"version": "2.0.34",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -122,14 +122,14 @@
|
|
|
122
122
|
"vue": "^3.4.29",
|
|
123
123
|
"vue-router": "^4.3.0",
|
|
124
124
|
"zod": "^3.22.4",
|
|
125
|
-
"@scalar/components": "0.12.
|
|
126
|
-
"@scalar/oas-utils": "0.2.
|
|
125
|
+
"@scalar/components": "0.12.21",
|
|
126
|
+
"@scalar/oas-utils": "0.2.18",
|
|
127
127
|
"@scalar/object-utils": "1.1.5",
|
|
128
128
|
"@scalar/draggable": "0.1.3",
|
|
129
|
-
"@scalar/use-codemirror": "0.11.8",
|
|
130
129
|
"@scalar/themes": "0.9.16",
|
|
131
|
-
"@scalar/use-
|
|
132
|
-
"@scalar/use-tooltip": "1.0.2"
|
|
130
|
+
"@scalar/use-codemirror": "0.11.8",
|
|
131
|
+
"@scalar/use-tooltip": "1.0.2",
|
|
132
|
+
"@scalar/use-toasts": "0.7.4"
|
|
133
133
|
},
|
|
134
134
|
"devDependencies": {
|
|
135
135
|
"@types/content-type": "^1.1.8",
|