@scalar/api-client 2.0.12 → 2.0.13
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 +11 -0
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +38 -27
- package/dist/Modal/api-client-modal.d.ts +2 -1
- package/dist/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/Modal/api-client-modal.js +49 -40
- package/dist/components/ActionModal/ActionModalFolder.vue.js +37 -35
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +42 -42
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts +1 -14
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +50 -55
- package/dist/components/Sidebar/Sidebar.vue.js +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -9
- package/dist/libs/index.d.ts +1 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +10 -8
- package/dist/libs/local-storage.d.ts +9 -0
- package/dist/libs/local-storage.d.ts.map +1 -0
- package/dist/libs/local-storage.js +36 -0
- package/dist/router.d.ts +2 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +13 -13
- package/dist/store/workspace.d.ts +511 -269
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +213 -157
- 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 +93 -91
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +25 -25
- 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 +56 -56
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +11 -11
- package/package.json +4 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useWorkspace as
|
|
1
|
+
import { defineComponent as D, computed as C, ref as y, watch as m, nextTick as f, openBlock as c, createBlock as p, withCtx as r, createTextVNode as L, toDisplayString as v, createVNode as i, createElementVNode as u, unref as g, withDirectives as B, withModifiers as S, createElementBlock as h, Fragment as V, renderList as T, vModelSelect as W, createCommentVNode as N } from "vue";
|
|
2
|
+
import $ from "../../../components/DataTable/DataTable.vue.js";
|
|
3
|
+
import j from "../../../components/DataTable/DataTableHeader.vue.js";
|
|
4
|
+
import k from "../../../components/DataTable/DataTableRow.vue.js";
|
|
5
|
+
import z from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
6
|
+
import { useWorkspace as I } from "../../../store/workspace.js";
|
|
7
7
|
import { ScalarIcon as M, ScalarCodeBlock as E } from "@scalar/components";
|
|
8
|
-
import { getThemeStyles as
|
|
9
|
-
import { useDarkModeState as
|
|
10
|
-
const
|
|
8
|
+
import { getThemeStyles as R } from "@scalar/themes";
|
|
9
|
+
import { useDarkModeState as F } from "../../../hooks/useDarkModeState.js";
|
|
10
|
+
const H = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-center justify-start rounded px-1.5" }, O = { class: "capitalize" }, P = ["value"], Z = /* @__PURE__ */ D({
|
|
11
11
|
__name: "ResponseBody",
|
|
12
12
|
props: {
|
|
13
13
|
title: {},
|
|
@@ -15,80 +15,80 @@ const F = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-cente
|
|
|
15
15
|
data: { default: null },
|
|
16
16
|
headers: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
18
|
+
setup(_) {
|
|
19
|
+
const d = _, { activeWorkspace: w } = I(), x = C(() => {
|
|
20
20
|
var t;
|
|
21
|
-
const o = ((t =
|
|
21
|
+
const o = ((t = d.headers.find((e) => e.name.toLowerCase() === "content-type")) == null ? void 0 : t.value) ?? "";
|
|
22
22
|
return o.includes("json") ? "json" : o.includes("html") ? "html" : "plaintext";
|
|
23
|
-
}), a =
|
|
24
|
-
return
|
|
25
|
-
() =>
|
|
23
|
+
}), a = y(null), n = y("raw"), b = ["raw", "preview"], { isDark: s } = F();
|
|
24
|
+
return m(
|
|
25
|
+
() => n.value,
|
|
26
26
|
async (o) => {
|
|
27
27
|
var t;
|
|
28
|
-
if (o === "preview" && (await
|
|
28
|
+
if (o === "preview" && (await f(), a.value)) {
|
|
29
29
|
const e = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
|
|
30
30
|
if (!e) return;
|
|
31
|
-
e.open(), e.write(
|
|
31
|
+
e.open(), e.write(d.data), e.close();
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
),
|
|
35
|
-
() =>
|
|
34
|
+
), m(
|
|
35
|
+
() => s.value,
|
|
36
36
|
async (o) => {
|
|
37
37
|
var t;
|
|
38
|
-
if (await
|
|
38
|
+
if (await f(), a.value) {
|
|
39
39
|
const e = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
|
|
40
40
|
if (!e) return;
|
|
41
|
-
e.body.classList.toggle("dark-mode",
|
|
41
|
+
e.body.classList.toggle("dark-mode", s.value), e.body.classList.toggle("light-mode", !s.value);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
),
|
|
45
|
-
() =>
|
|
44
|
+
), m(
|
|
45
|
+
() => n.value,
|
|
46
46
|
async (o) => {
|
|
47
|
-
var t;
|
|
48
|
-
if (o === "preview" && (await
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
|
|
47
|
+
var t, e;
|
|
48
|
+
if (o === "preview" && (await f(), a.value)) {
|
|
49
|
+
const l = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
|
|
50
|
+
if (!l) return;
|
|
51
|
+
l.open(), l.write(d.data), l.body.classList.toggle("dark-mode", s.value), l.body.classList.toggle("light-mode", !s.value), l.write(
|
|
52
52
|
"<style>body,html {body:not(:has(* + style + style)) {font-family: var(--scalar-font-code); font-size: 12px; font-weight: 400;background:var(--scalar-background-1); color: var(--scalar-color-2)}</style>"
|
|
53
|
-
), e.write(
|
|
54
|
-
`<style>${
|
|
55
|
-
),
|
|
53
|
+
), (e = w.value) != null && e.themeId && l.write(
|
|
54
|
+
`<style>${R(w.value.themeId)}</style>`
|
|
55
|
+
), l.close();
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
), (o, t) => (
|
|
59
|
-
title:
|
|
60
|
-
|
|
58
|
+
), (o, t) => (c(), p(z, null, {
|
|
59
|
+
title: r(() => [
|
|
60
|
+
L(v(o.title), 1)
|
|
61
61
|
]),
|
|
62
|
-
default:
|
|
63
|
-
o.active ? (
|
|
62
|
+
default: r(() => [
|
|
63
|
+
o.active ? (c(), p($, {
|
|
64
64
|
key: 0,
|
|
65
65
|
columns: [""]
|
|
66
66
|
}, {
|
|
67
|
-
default:
|
|
68
|
-
|
|
69
|
-
default:
|
|
70
|
-
|
|
71
|
-
default:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
default: r(() => [
|
|
68
|
+
i(k, null, {
|
|
69
|
+
default: r(() => [
|
|
70
|
+
i(j, { class: "relative col-span-full flex h-8 cursor-pointer items-center px-[2.25px] py-[2.25px]" }, {
|
|
71
|
+
default: r(() => [
|
|
72
|
+
u("div", H, [
|
|
73
|
+
u("span", O, v(n.value), 1),
|
|
74
|
+
i(g(M), {
|
|
75
75
|
class: "text-c-3 ml-1 mt-px",
|
|
76
76
|
icon: "ChevronDown",
|
|
77
77
|
size: "xs"
|
|
78
78
|
})
|
|
79
79
|
]),
|
|
80
|
-
|
|
81
|
-
"onUpdate:modelValue": t[0] || (t[0] = (e) =>
|
|
80
|
+
B(u("select", {
|
|
81
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => n.value = e),
|
|
82
82
|
class: "absolute inset-0 w-auto opacity-0",
|
|
83
|
-
onClick: t[1] || (t[1] =
|
|
83
|
+
onClick: t[1] || (t[1] = S(() => {
|
|
84
84
|
}, ["prevent"]))
|
|
85
85
|
}, [
|
|
86
|
-
(
|
|
86
|
+
(c(), h(V, null, T(b, (e) => u("option", {
|
|
87
87
|
key: e,
|
|
88
88
|
value: e
|
|
89
|
-
},
|
|
89
|
+
}, v(e), 9, P)), 64))
|
|
90
90
|
], 512), [
|
|
91
|
-
[
|
|
91
|
+
[W, n.value]
|
|
92
92
|
])
|
|
93
93
|
]),
|
|
94
94
|
_: 1
|
|
@@ -96,14 +96,14 @@ const F = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-cente
|
|
|
96
96
|
]),
|
|
97
97
|
_: 1
|
|
98
98
|
}),
|
|
99
|
-
|
|
100
|
-
default:
|
|
101
|
-
|
|
99
|
+
i(k, null, {
|
|
100
|
+
default: r(() => [
|
|
101
|
+
n.value === "raw" ? (c(), p(g(E), {
|
|
102
102
|
key: 0,
|
|
103
103
|
class: "force-text-sm rounded-b border-t-0",
|
|
104
104
|
content: o.data,
|
|
105
|
-
lang:
|
|
106
|
-
}, null, 8, ["content", "lang"])) : (
|
|
105
|
+
lang: x.value
|
|
106
|
+
}, null, 8, ["content", "lang"])) : (c(), h("iframe", {
|
|
107
107
|
key: 1,
|
|
108
108
|
ref_key: "iframe",
|
|
109
109
|
ref: a,
|
|
@@ -124,5 +124,5 @@ const F = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-cente
|
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
export {
|
|
127
|
-
|
|
127
|
+
Z as default
|
|
128
128
|
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as a, openBlock as r, createElementBlock as c, createElementVNode as e, createVNode as t, unref as o, createTextVNode as n, createCommentVNode as m } from "vue";
|
|
2
2
|
import p from "../../../assets/computer.ascii.js";
|
|
3
3
|
import u from "../../../components/ScalarAsciiArt.vue.js";
|
|
4
|
-
import
|
|
4
|
+
import i from "../../../components/ScalarHotkey.vue.js";
|
|
5
5
|
import { useWorkspace as f } from "../../../store/workspace.js";
|
|
6
6
|
import { executeRequestBus as _ } from "../../../libs/eventBusses/executeRequestBus.js";
|
|
7
|
-
const d = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, x = { class: "flex h-[calc(100%_-_50px)] flex-col items-center justify-center" },
|
|
7
|
+
const d = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, x = { class: "flex h-[calc(100%_-_50px)] flex-col items-center justify-center" }, y = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, h = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "flex items-center gap-1.5",
|
|
10
10
|
type: "button"
|
|
11
|
-
},
|
|
11
|
+
}, B = /* @__PURE__ */ a({
|
|
12
12
|
__name: "ResponseEmpty",
|
|
13
|
-
setup(
|
|
14
|
-
const {
|
|
13
|
+
setup(k) {
|
|
14
|
+
const { isReadOnly: l } = f();
|
|
15
15
|
return (N, s) => (r(), c("div", d, [
|
|
16
16
|
e("div", x, [
|
|
17
17
|
t(u, { art: o(p) }, null, 8, ["art"])
|
|
18
18
|
]),
|
|
19
|
-
e("div",
|
|
19
|
+
e("div", y, [
|
|
20
20
|
e("button", {
|
|
21
21
|
class: "flex items-center gap-1.5",
|
|
22
22
|
type: "button",
|
|
23
23
|
onClick: s[0] || (s[0] = (g) => o(_).emit())
|
|
24
24
|
}, [
|
|
25
25
|
n(" Send Request "),
|
|
26
|
-
t(
|
|
26
|
+
t(i, { hotkey: "↵" })
|
|
27
27
|
]),
|
|
28
|
-
o(
|
|
28
|
+
o(l) ? m("", !0) : (r(), c("button", h, [
|
|
29
29
|
n(" New Request "),
|
|
30
|
-
t(
|
|
30
|
+
t(i, { hotkey: "N" })
|
|
31
31
|
]))
|
|
32
32
|
])
|
|
33
33
|
]));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
B as default
|
|
38
38
|
};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.0.
|
|
21
|
+
"version": "2.0.13",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
@@ -112,9 +112,9 @@
|
|
|
112
112
|
"zod": "^3.22.4",
|
|
113
113
|
"@scalar/components": "0.12.10",
|
|
114
114
|
"@scalar/draggable": "0.1.3",
|
|
115
|
-
"@scalar/oas-utils": "0.2.
|
|
116
|
-
"@scalar/object-utils": "1.1.
|
|
117
|
-
"@scalar/themes": "0.9.
|
|
115
|
+
"@scalar/oas-utils": "0.2.12",
|
|
116
|
+
"@scalar/object-utils": "1.1.4",
|
|
117
|
+
"@scalar/themes": "0.9.13",
|
|
118
118
|
"@scalar/use-codemirror": "0.11.4",
|
|
119
119
|
"@scalar/use-toasts": "0.7.4",
|
|
120
120
|
"@scalar/use-tooltip": "1.0.2"
|