@scalar/api-client 2.0.50 → 2.0.52
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 +24 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +105 -99
- package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey.vue.js +4 -4
- package/dist/components/Sidebar/Sidebar.vue.d.ts +4 -8
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +32 -43
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +36 -32
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +15 -13
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +30 -26
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +15 -13
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -3
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.js +45 -15
- package/dist/libs/local-storage.js +1 -1
- package/dist/store/workspace.d.ts +186 -94
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +117 -113
- package/dist/style.css +1 -1
- 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 +62 -62
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +205 -199
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as se, ref as ie, watch as
|
|
1
|
+
import { defineComponent as se, ref as ie, watch as P, onMounted as ae, onBeforeUnmount as le, openBlock as h, createElementBlock as k, Fragment as F, createElementVNode as v, normalizeClass as b, unref as s, createVNode as c, createCommentVNode as U, withCtx as p, withDirectives as ne, createSlots as de, withModifiers as N, renderList as ce, createBlock as R, createTextVNode as ue, vShow as me, pushScopeId as fe, popScopeId as pe } from "vue";
|
|
2
2
|
import ve from "../../components/AddressBar/AddressBar.vue.js";
|
|
3
3
|
import he from "../../components/Search/SearchButton.vue.js";
|
|
4
4
|
import be from "../../components/Search/SearchModal.vue.js";
|
|
@@ -10,24 +10,24 @@ import { useWorkspace as Se } from "../../store/workspace.js";
|
|
|
10
10
|
import _e from "./RequestSection/RequestSection.vue.js";
|
|
11
11
|
/* empty css */
|
|
12
12
|
import ke from "./ResponseSection/ResponseSection.vue.js";
|
|
13
|
-
import { useModal as Ue, ScalarIcon as
|
|
13
|
+
import { useModal as Ue, ScalarIcon as C } from "@scalar/components";
|
|
14
14
|
import { useToasts as Re } from "@scalar/use-toasts";
|
|
15
|
-
import { useMediaQuery as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
15
|
+
import { useMediaQuery as Ce } from "@vueuse/core";
|
|
16
|
+
import Be from "./RequestSidebarItem.vue.js";
|
|
17
|
+
import De from "../../components/Sidebar/Sidebar.vue.js";
|
|
18
18
|
/* empty css */
|
|
19
|
-
import
|
|
20
|
-
import { useSidebar as
|
|
19
|
+
import Oe from "./components/WorkspaceDropdown.vue.js";
|
|
20
|
+
import { useSidebar as qe } from "../../hooks/useSidebar.js";
|
|
21
21
|
import { sendRequest as Me } from "../../libs/sendRequest.js";
|
|
22
22
|
import { executeRequestBus as W } from "../../libs/event-busses/execute-request-bus.js";
|
|
23
23
|
import { hotKeyBus as z } from "../../libs/event-busses/hot-keys-bus.js";
|
|
24
24
|
import { commandPaletteBus as j } from "../../libs/event-busses/command-palette-bus.js";
|
|
25
25
|
import { requestStatusBus as S } from "../../libs/event-busses/request-status-bus.js";
|
|
26
|
-
const Ie = (w) => (fe("data-v-
|
|
26
|
+
const Ie = (w) => (fe("data-v-b7bd40a0"), w = w(), pe(), w), Ve = { class: "lg:min-h-header flex items-center w-full justify-center p-1 flex-wrap t-app__top-container border-b-1/2" }, $e = { class: "flex flex-row items-center gap-1 lg:px-1 lg:mb-0 mb-0.5 lg:flex-1 w-6/12" }, Ee = /* @__PURE__ */ Ie(() => /* @__PURE__ */ v("a", {
|
|
27
27
|
class: "text-c-2 text-sm font-medium gitbook-show ml-.5 hover:text-c-1 border p-1 rounded hover:bg-b-3",
|
|
28
28
|
href: "https://scalar.com/",
|
|
29
29
|
target: "_blank"
|
|
30
|
-
}, " Powered by Scalar.com ", -1)),
|
|
30
|
+
}, " Powered by Scalar.com ", -1)), Pe = { 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" }, dt = /* @__PURE__ */ se({
|
|
31
31
|
__name: "Request",
|
|
32
32
|
setup(w) {
|
|
33
33
|
var E;
|
|
@@ -39,21 +39,21 @@ const Ie = (w) => (fe("data-v-1a28a88b"), w = w(), pe(), w), Ve = { class: "lg:m
|
|
|
39
39
|
activeWorkspaceCollections: T,
|
|
40
40
|
activeWorkspaceServers: A,
|
|
41
41
|
activeWorkspaceRequests: K,
|
|
42
|
-
collectionMutators:
|
|
42
|
+
collectionMutators: B,
|
|
43
43
|
collections: m,
|
|
44
44
|
cookies: H,
|
|
45
45
|
environments: J,
|
|
46
46
|
findRequestFolders: Q,
|
|
47
47
|
folders: x,
|
|
48
|
-
folderMutators:
|
|
48
|
+
folderMutators: D,
|
|
49
49
|
modalState: G,
|
|
50
50
|
requestMutators: X,
|
|
51
|
-
workspaceMutators:
|
|
52
|
-
} = Se(), { collapsedSidebarFolders: Y, setCollapsedSidebarFolder: Z } =
|
|
53
|
-
|
|
51
|
+
workspaceMutators: O
|
|
52
|
+
} = Se(), { collapsedSidebarFolders: Y, setCollapsedSidebarFolder: Z } = qe(), { toast: q } = Re(), M = Ue(), ee = Ce("(max-width: 780px)"), u = ie(!((E = l.value) != null && E.isReadOnly));
|
|
53
|
+
P(ee, (o) => u.value = !o), P(
|
|
54
54
|
f,
|
|
55
|
-
(
|
|
56
|
-
|
|
55
|
+
(o) => {
|
|
56
|
+
o && Q(o.uid).forEach(
|
|
57
57
|
(e) => Z(e, !0)
|
|
58
58
|
);
|
|
59
59
|
},
|
|
@@ -67,88 +67,88 @@ const Ie = (w) => (fe("data-v-1a28a88b"), w = w(), pe(), w), Ve = { class: "lg:m
|
|
|
67
67
|
);
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
let
|
|
70
|
+
let o = y.value.url;
|
|
71
71
|
const e = Object.values(J).reduce(
|
|
72
|
-
(
|
|
72
|
+
(r, a) => {
|
|
73
73
|
try {
|
|
74
|
-
return { ...
|
|
74
|
+
return { ...r, ...JSON.parse(a.raw) };
|
|
75
75
|
} catch {
|
|
76
|
-
return
|
|
76
|
+
return r;
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
{}
|
|
80
80
|
), t = /\{\{(.*?)\}\}/g;
|
|
81
|
-
|
|
81
|
+
o = o.replace(t, (r, a) => (A.value.forEach((n) => {
|
|
82
82
|
if (n.url === a)
|
|
83
83
|
return a;
|
|
84
84
|
}), e[a] || a)), S.emit("start");
|
|
85
85
|
try {
|
|
86
|
-
const { request:
|
|
86
|
+
const { request: r, response: a, error: n } = await Me(
|
|
87
87
|
f.value,
|
|
88
88
|
y.value,
|
|
89
|
-
|
|
89
|
+
o,
|
|
90
90
|
L.value,
|
|
91
91
|
(i = l.value) == null ? void 0 : i.proxyUrl,
|
|
92
92
|
H
|
|
93
93
|
);
|
|
94
|
-
|
|
94
|
+
r && a ? (X.edit(f.value.uid, "history", [
|
|
95
95
|
...f.value.history,
|
|
96
96
|
{
|
|
97
|
-
request:
|
|
97
|
+
request: r,
|
|
98
98
|
response: a,
|
|
99
99
|
timestamp: Date.now()
|
|
100
100
|
}
|
|
101
|
-
]), S.emit("stop")) : (
|
|
102
|
-
} catch (
|
|
103
|
-
console.error(
|
|
104
|
-
${
|
|
101
|
+
]), S.emit("stop")) : (q((n == null ? void 0 : n.message) ?? "Send Request Failed", "error"), S.emit("abort"));
|
|
102
|
+
} catch (r) {
|
|
103
|
+
console.error(r), q(`Oops!
|
|
104
|
+
${r}`, "error"), S.emit("abort");
|
|
105
105
|
}
|
|
106
|
-
}, V = (
|
|
107
|
-
|
|
106
|
+
}, V = (o) => {
|
|
107
|
+
o.toggleSidebar && (u.value = !u.value), o.openCommandPalette && (o.openCommandPalette.preventDefault(), j.emit());
|
|
108
108
|
};
|
|
109
109
|
ae(() => {
|
|
110
110
|
W.on(I), z.on(V);
|
|
111
111
|
}), le(() => {
|
|
112
112
|
W.off(I), z.off(V);
|
|
113
113
|
});
|
|
114
|
-
const $ = (
|
|
115
|
-
m[
|
|
116
|
-
}, te = (
|
|
117
|
-
if (!
|
|
118
|
-
const { id: t, parentId: i } =
|
|
119
|
-
if (i ? m[i] ?
|
|
114
|
+
const $ = (o, e) => {
|
|
115
|
+
m[o] ? B.edit(o, "childUids", e) : x[o] && D.edit(o, "childUids", e);
|
|
116
|
+
}, te = (o, e) => {
|
|
117
|
+
if (!o || !e) return;
|
|
118
|
+
const { id: t, parentId: i } = o, { id: r, parentId: a, offset: n } = e;
|
|
119
|
+
if (i ? m[i] ? B.edit(
|
|
120
120
|
i,
|
|
121
121
|
"childUids",
|
|
122
122
|
m[i].childUids.filter(
|
|
123
123
|
(d) => d !== t
|
|
124
124
|
)
|
|
125
|
-
) : x[i] &&
|
|
125
|
+
) : x[i] && D.edit(
|
|
126
126
|
i,
|
|
127
127
|
"childUids",
|
|
128
128
|
x[i].childUids.filter((d) => d !== t)
|
|
129
|
-
) :
|
|
129
|
+
) : O.edit(
|
|
130
130
|
l.value.uid,
|
|
131
131
|
"collectionUids",
|
|
132
132
|
l.value.collectionUids.filter((d) => d !== t)
|
|
133
133
|
), n === 2) {
|
|
134
|
-
const d = m[
|
|
135
|
-
$(
|
|
134
|
+
const d = m[r] || x[r];
|
|
135
|
+
$(r, [...d.childUids, t]);
|
|
136
136
|
} else if (a) {
|
|
137
|
-
const g = [...(m[a] || x[a]).childUids], _ = g.findIndex((re) =>
|
|
137
|
+
const g = [...(m[a] || x[a]).childUids], _ = g.findIndex((re) => r === re) ?? 0;
|
|
138
138
|
g.splice(_ + n, 0, t), $(a, g);
|
|
139
139
|
} else {
|
|
140
|
-
const d = [...l.value.collectionUids], g = d.findIndex((_) =>
|
|
141
|
-
d.splice(g + n, 0, t),
|
|
140
|
+
const d = [...l.value.collectionUids], g = d.findIndex((_) => r === _) ?? 0;
|
|
141
|
+
d.splice(g + n, 0, t), O.edit(
|
|
142
142
|
l.value.uid,
|
|
143
143
|
"collectionUids",
|
|
144
144
|
d
|
|
145
145
|
);
|
|
146
146
|
}
|
|
147
|
-
}, oe = (
|
|
148
|
-
var t, i,
|
|
149
|
-
return !(l.value.isReadOnly || !m[
|
|
147
|
+
}, oe = (o, e) => {
|
|
148
|
+
var t, i, r;
|
|
149
|
+
return !(l.value.isReadOnly || !m[o.id] && e.offset !== 2 || m[o.id] && ((r = (i = (t = m[e.id]) == null ? void 0 : t.spec) == null ? void 0 : i.info) == null ? void 0 : r.title) === "Drafts");
|
|
150
150
|
};
|
|
151
|
-
return (
|
|
151
|
+
return (o, e) => (h(), k(F, null, [
|
|
152
152
|
v("div", {
|
|
153
153
|
class: b(["flex flex-1 flex-col rounded pt-0 h-full bg-b-1 relative border-1/2 rounded mr-1.5 mb-1.5 overflow-hidden", {
|
|
154
154
|
"!mr-0 !mb-0 !border-0": s(l).isReadOnly
|
|
@@ -164,14 +164,14 @@ ${o}`, "error"), S.emit("abort");
|
|
|
164
164
|
Ee
|
|
165
165
|
]),
|
|
166
166
|
c(ve),
|
|
167
|
-
v("div",
|
|
167
|
+
v("div", Pe, [
|
|
168
168
|
s(l).isReadOnly ? (h(), k("button", {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "text-c-3 hover:bg-b-2 active:text-c-1 p-2 rounded",
|
|
171
171
|
type: "button",
|
|
172
172
|
onClick: e[1] || (e[1] = (t) => s(G).hide())
|
|
173
173
|
}, [
|
|
174
|
-
c(s(
|
|
174
|
+
c(s(C), {
|
|
175
175
|
icon: "Close",
|
|
176
176
|
size: "lg",
|
|
177
177
|
thickness: "1.75"
|
|
@@ -181,7 +181,7 @@ ${o}`, "error"), S.emit("abort");
|
|
|
181
181
|
]),
|
|
182
182
|
c(we, null, {
|
|
183
183
|
default: p(() => [
|
|
184
|
-
ne(c(s(
|
|
184
|
+
ne(c(s(De), {
|
|
185
185
|
class: b([u.value ? "sidebar-active-width" : ""]),
|
|
186
186
|
showSideBar: u.value,
|
|
187
187
|
"onUpdate:showSideBar": e[5] || (e[5] = (t) => u.value = t)
|
|
@@ -194,23 +194,23 @@ ${o}`, "error"), S.emit("abort");
|
|
|
194
194
|
class: b(["custom-scroll flex flex-1 flex-col overflow-visible px-3 pb-3 pt-0", {
|
|
195
195
|
"pb-14": !s(l).isReadOnly
|
|
196
196
|
}]),
|
|
197
|
-
onDragenter: e[3] || (e[3] =
|
|
197
|
+
onDragenter: e[3] || (e[3] = N(() => {
|
|
198
198
|
}, ["prevent"])),
|
|
199
|
-
onDragover: e[4] || (e[4] =
|
|
199
|
+
onDragover: e[4] || (e[4] = N(() => {
|
|
200
200
|
}, ["prevent"]))
|
|
201
201
|
}, [
|
|
202
|
-
(h(!0), k(
|
|
203
|
-
var i,
|
|
204
|
-
return h(), R(
|
|
202
|
+
(h(!0), k(F, null, ce(s(T), (t) => {
|
|
203
|
+
var i, r;
|
|
204
|
+
return h(), R(Be, {
|
|
205
205
|
key: t.uid,
|
|
206
|
-
isDraggable: !s(l).isReadOnly && ((
|
|
206
|
+
isDraggable: !s(l).isReadOnly && ((r = (i = t.spec) == null ? void 0 : i.info) == null ? void 0 : r.title) !== "Drafts",
|
|
207
207
|
isDroppable: oe,
|
|
208
208
|
item: t,
|
|
209
209
|
parentUids: [],
|
|
210
210
|
onOnDragEnd: te
|
|
211
211
|
}, {
|
|
212
212
|
leftIcon: p(() => [
|
|
213
|
-
c(s(
|
|
213
|
+
c(s(C), {
|
|
214
214
|
class: "text-sidebar-c-2 text-sm group-hover:hidden",
|
|
215
215
|
icon: "CodeFolder",
|
|
216
216
|
size: "sm",
|
|
@@ -221,7 +221,7 @@ ${o}`, "error"), S.emit("abort");
|
|
|
221
221
|
"rotate-90": s(Y)[t.uid]
|
|
222
222
|
})
|
|
223
223
|
}, [
|
|
224
|
-
c(s(
|
|
224
|
+
c(s(C), {
|
|
225
225
|
class: "text-c-3 hidden text-sm group-hover:block",
|
|
226
226
|
icon: "ChevronRight",
|
|
227
227
|
size: "sm"
|
|
@@ -252,7 +252,7 @@ ${o}`, "error"), S.emit("abort");
|
|
|
252
252
|
s(l).isReadOnly ? void 0 : {
|
|
253
253
|
name: "header",
|
|
254
254
|
fn: p(() => [
|
|
255
|
-
c(s(
|
|
255
|
+
c(s(Oe))
|
|
256
256
|
]),
|
|
257
257
|
key: "0"
|
|
258
258
|
}
|
|
@@ -264,11 +264,11 @@ ${o}`, "error"), S.emit("abort");
|
|
|
264
264
|
class: b(["flex-1", [u.value ? "sidebar-active-hide-layout" : ""]])
|
|
265
265
|
}, {
|
|
266
266
|
default: p(() => {
|
|
267
|
-
var t, i,
|
|
267
|
+
var t, i, r, a, n;
|
|
268
268
|
return [
|
|
269
269
|
c(_e),
|
|
270
270
|
c(ke, {
|
|
271
|
-
response: (n = (a = (t = s(f)) == null ? void 0 : t.history) == null ? void 0 : a[((
|
|
271
|
+
response: (n = (a = (t = s(f)) == null ? void 0 : t.history) == null ? void 0 : a[((r = (i = s(f)) == null ? void 0 : i.history) == null ? void 0 : r.length) - 1]) == null ? void 0 : n.response
|
|
272
272
|
}, null, 8, ["response"])
|
|
273
273
|
];
|
|
274
274
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItem.vue"],"names":[],"mappings":"AAweA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;AAkPlD,iBAAS,cAAc;gBA/MT,IAAI;;gBAAJ,IAAI;EAg3BjB;AACD,QAAA,MAAM,eAAe;IA34BjB;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,cAAc,CAAC,aAAa,CAAC;IAC3C,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;;;;;;;IAdpD;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,cAAc,CAAC,aAAa,CAAC;IAC3C,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;;;;;;;;iBATtC,OAAO;MA64BvB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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"}
|
|
@@ -2,7 +2,7 @@ import t from "./RequestSidebarItem.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
5
|
+
const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-17dc8b59"]]);
|
|
6
6
|
export {
|
|
7
7
|
a as default
|
|
8
8
|
};
|