@scalar/api-client 2.1.12 → 2.1.14
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 +16 -0
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +18 -18
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +4 -0
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.js +29 -24
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +90 -49
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +25 -20
- package/dist/libs/getOpenApiDocumentVersion.d.ts +8 -0
- package/dist/libs/getOpenApiDocumentVersion.d.ts.map +1 -0
- package/dist/libs/getOpenApiDocumentVersion.js +20 -0
- package/dist/libs/index.d.ts +3 -0
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +29 -23
- package/dist/libs/isDocument.d.ts +3 -0
- package/dist/libs/isDocument.d.ts.map +1 -0
- package/dist/libs/isDocument.js +7 -0
- package/dist/libs/isUrl.d.ts +3 -0
- package/dist/libs/isUrl.d.ts.map +1 -0
- package/dist/libs/isUrl.js +6 -0
- package/dist/libs/send-request.js +41 -41
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +65 -65
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +39 -39
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +49 -50
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.1.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dea7b57: feat: adds open api document content import from command palette
|
|
8
|
+
- 008eca4: fix: Basic Auth should still include a colon after the username
|
|
9
|
+
- 9ba2c9f: fix: updates sidebar call to action position
|
|
10
|
+
|
|
11
|
+
## 2.1.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- cebca7a: feat: updates request and response section order and naming
|
|
16
|
+
- 3b12248: fix: removed showing servers dropdown if empty
|
|
17
|
+
- a78b0a6: fix(api-client): don't error if there aren't any collections
|
|
18
|
+
|
|
3
19
|
## 2.1.12
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA+YA,wBAKG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as U, computed as u, watch as O,
|
|
2
|
-
import { ScalarDropdown as V, ScalarDropdownDivider as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as U, computed as u, watch as O, openBlock as l, createBlock as h, unref as s, withCtx as _, createElementBlock as n, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as c, withModifiers as R, toDisplayString as b } from "vue";
|
|
2
|
+
import { ScalarDropdown as V, ScalarDropdownDivider as C, ScalarDropdownItem as W, ScalarIcon as E } from "@scalar/components";
|
|
3
|
+
import D from "./AddressBarServerItem.vue.js";
|
|
4
4
|
import { useWorkspace as I } from "../../store/store.js";
|
|
5
5
|
import { commandPaletteBus as L } from "../../libs/event-busses/command-palette-bus.js";
|
|
6
6
|
const M = {
|
|
@@ -16,8 +16,8 @@ const M = {
|
|
|
16
16
|
activeRequest: S,
|
|
17
17
|
activeCollection: k,
|
|
18
18
|
activeServer: x,
|
|
19
|
-
isReadOnly:
|
|
20
|
-
servers:
|
|
19
|
+
isReadOnly: A,
|
|
20
|
+
servers: w,
|
|
21
21
|
collectionMutators: B
|
|
22
22
|
} = I(), i = u(
|
|
23
23
|
() => {
|
|
@@ -26,7 +26,7 @@ const M = {
|
|
|
26
26
|
var o;
|
|
27
27
|
return {
|
|
28
28
|
id: r,
|
|
29
|
-
label: ((o =
|
|
29
|
+
label: ((o = w[r]) == null ? void 0 : o.url) ?? "Unknown server"
|
|
30
30
|
};
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -37,11 +37,11 @@ const M = {
|
|
|
37
37
|
var o;
|
|
38
38
|
return {
|
|
39
39
|
id: r,
|
|
40
|
-
label: ((o =
|
|
40
|
+
label: ((o = w[r]) == null ? void 0 : o.url) ?? "Unknown server"
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
),
|
|
44
|
+
), y = u(
|
|
45
45
|
() => {
|
|
46
46
|
var t, e;
|
|
47
47
|
return ((t = i.value) == null ? void 0 : t.length) && ((e = d.value) == null ? void 0 : e.length);
|
|
@@ -62,28 +62,28 @@ const M = {
|
|
|
62
62
|
});
|
|
63
63
|
return (t, e) => {
|
|
64
64
|
var r, o;
|
|
65
|
-
return
|
|
65
|
+
return i.value && ((r = i.value) == null ? void 0 : r.length) > 1 || d.value && ((o = d.value) == null ? void 0 : o.length) > 1 ? (l(), h(s(V), {
|
|
66
66
|
key: 0,
|
|
67
67
|
teleport: ".scalar-client"
|
|
68
68
|
}, {
|
|
69
69
|
items: _(() => [
|
|
70
|
-
|
|
71
|
-
(l(!0), n(m, null,
|
|
70
|
+
y.value ? (l(), n("div", M, " Request Servers ")) : v("", !0),
|
|
71
|
+
(l(!0), n(m, null, g(i.value, (a) => (l(), h(D, {
|
|
72
72
|
key: a.id,
|
|
73
73
|
serverOption: a,
|
|
74
74
|
type: "request"
|
|
75
75
|
}, null, 8, ["serverOption"]))), 128)),
|
|
76
|
-
|
|
77
|
-
p(s(
|
|
76
|
+
y.value ? (l(), n(m, { key: 1 }, [
|
|
77
|
+
p(s(C)),
|
|
78
78
|
j
|
|
79
79
|
], 64)) : v("", !0),
|
|
80
|
-
(l(!0), n(m, null,
|
|
80
|
+
(l(!0), n(m, null, g(d.value, (a) => (l(), h(D, {
|
|
81
81
|
key: a.id,
|
|
82
82
|
serverOption: a,
|
|
83
83
|
type: "collection"
|
|
84
84
|
}, null, 8, ["serverOption"]))), 128)),
|
|
85
|
-
s(
|
|
86
|
-
p(s(
|
|
85
|
+
s(A) ? v("", !0) : (l(), n(m, { key: 2 }, [
|
|
86
|
+
p(s(C)),
|
|
87
87
|
p(s(W), null, {
|
|
88
88
|
default: _(() => [
|
|
89
89
|
c("div", {
|
|
@@ -109,10 +109,10 @@ const M = {
|
|
|
109
109
|
type: "button",
|
|
110
110
|
onClick: e[0] || (e[0] = R(() => {
|
|
111
111
|
}, ["stop"]))
|
|
112
|
-
},
|
|
112
|
+
}, b(f.value), 1)
|
|
113
113
|
]),
|
|
114
114
|
_: 1
|
|
115
|
-
})) : f.value ? (l(), n("div", P,
|
|
115
|
+
})) : f.value ? (l(), n("div", P, b(f.value), 1)) : v("", !0);
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
});
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
2
|
modelValue?: string;
|
|
3
|
+
placeholder?: string;
|
|
3
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
5
|
"update:modelValue": (v: string) => void;
|
|
5
6
|
onDelete: (event: KeyboardEvent) => void;
|
|
7
|
+
paste: (event: ClipboardEvent) => void;
|
|
6
8
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
9
|
modelValue?: string;
|
|
10
|
+
placeholder?: string;
|
|
8
11
|
}>>> & {
|
|
12
|
+
onPaste?: ((event: ClipboardEvent) => any) | undefined;
|
|
9
13
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
10
14
|
onOnDelete?: ((event: KeyboardEvent) => any) | undefined;
|
|
11
15
|
}, {}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandActionInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionInput.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CommandActionInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionInput.vue"],"names":[],"mappings":";iBA6De,MAAM;kBACL,MAAM;;;;;;iBADP,MAAM;kBACL,MAAM;;;;;;AAoGtB,wBAOG;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"}
|
|
@@ -1,42 +1,47 @@
|
|
|
1
|
-
import { defineComponent as f, ref as
|
|
2
|
-
import { nanoid as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as f, ref as h, onMounted as y, nextTick as v, computed as w, openBlock as V, createElementBlock as k, Fragment as g, createElementVNode as u, unref as d, withDirectives as x, mergeProps as D, withKeys as _, withModifiers as b, vModelDynamic as B } from "vue";
|
|
2
|
+
import { nanoid as M } from "nanoid";
|
|
3
|
+
const P = ["for"], A = ["id", "placeholder"], K = /* @__PURE__ */ f({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "CommandActionInput",
|
|
6
6
|
props: {
|
|
7
|
-
modelValue: {}
|
|
7
|
+
modelValue: {},
|
|
8
|
+
placeholder: {}
|
|
8
9
|
},
|
|
9
|
-
emits: ["update:modelValue", "onDelete"],
|
|
10
|
-
setup(i, { emit:
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
emits: ["update:modelValue", "onDelete", "paste"],
|
|
11
|
+
setup(i, { emit: p }) {
|
|
12
|
+
const r = i, l = p, a = M(), s = h(null);
|
|
13
|
+
y(() => v(() => {
|
|
13
14
|
var e;
|
|
14
|
-
return (e =
|
|
15
|
+
return (e = s.value) == null ? void 0 : e.focus();
|
|
15
16
|
}));
|
|
16
|
-
const
|
|
17
|
-
get: () =>
|
|
17
|
+
const n = w({
|
|
18
|
+
get: () => r.modelValue ?? "",
|
|
18
19
|
set: (e) => l("update:modelValue", e)
|
|
19
|
-
}),
|
|
20
|
-
|
|
20
|
+
}), m = (e) => {
|
|
21
|
+
n.value === "" && l("onDelete", e);
|
|
22
|
+
}, c = (e) => {
|
|
23
|
+
l("paste", e);
|
|
21
24
|
};
|
|
22
|
-
return (e, t) => (
|
|
23
|
-
|
|
25
|
+
return (e, t) => (V(), k(g, null, [
|
|
26
|
+
u("label", {
|
|
24
27
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
25
|
-
for:
|
|
26
|
-
}, null, 8,
|
|
27
|
-
|
|
28
|
-
id:
|
|
28
|
+
for: d(a)
|
|
29
|
+
}, null, 8, P),
|
|
30
|
+
x(u("input", D({
|
|
31
|
+
id: d(a),
|
|
29
32
|
ref_key: "input",
|
|
30
|
-
ref:
|
|
31
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
33
|
+
ref: s,
|
|
34
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => n.value = o),
|
|
32
35
|
autocomplete: "off",
|
|
33
36
|
class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
|
|
34
37
|
"data-form-type": "other",
|
|
35
|
-
"data-lpignore": "true"
|
|
38
|
+
"data-lpignore": "true",
|
|
39
|
+
placeholder: r.placeholder
|
|
36
40
|
}, e.$attrs, {
|
|
37
|
-
onKeydown: t[1] || (t[1] =
|
|
41
|
+
onKeydown: t[1] || (t[1] = _(b((o) => m(o), ["stop"]), ["delete"])),
|
|
42
|
+
onPaste: t[2] || (t[2] = (o) => c(o))
|
|
38
43
|
}), null, 16, A), [
|
|
39
|
-
[
|
|
44
|
+
[B, n.value]
|
|
40
45
|
])
|
|
41
46
|
], 64));
|
|
42
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA0bA,wBAMG"}
|
|
@@ -1,78 +1,119 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarButton as
|
|
3
|
-
import { useToasts as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useFileDialog as
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { defineComponent as V, ref as _, openBlock as s, createBlock as u, withCtx as l, createVNode as p, unref as r, createTextVNode as d, createElementBlock as h, Fragment as A, createCommentVNode as O } from "vue";
|
|
2
|
+
import { ScalarButton as x, ScalarIcon as P, ScalarCodeBlock as B } from "@scalar/components";
|
|
3
|
+
import { useToasts as $ } from "@scalar/use-toasts";
|
|
4
|
+
import N from "./CommandActionForm.vue.js";
|
|
5
|
+
import T from "./CommandActionInput.vue.js";
|
|
6
|
+
import { useFileDialog as L } from "../../hooks/useFileDialog.js";
|
|
7
|
+
import { getOpenApiDocumentVersion as f } from "../../libs/getOpenApiDocumentVersion.js";
|
|
8
|
+
import { isUrl as v } from "../../libs/isUrl.js";
|
|
9
|
+
import { isDocument as M } from "../../libs/isDocument.js";
|
|
10
|
+
import { useWorkspace as R } from "../../store/store.js";
|
|
11
|
+
const X = /* @__PURE__ */ V({
|
|
9
12
|
__name: "CommandPaletteImport",
|
|
10
13
|
emits: ["close", "back"],
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
onChange: async (
|
|
14
|
-
const o =
|
|
14
|
+
setup(j, { emit: b }) {
|
|
15
|
+
const m = b, { activeWorkspace: c, importSpecFile: g, importSpecFromUrl: C } = R(), { toast: n } = $(), e = _(""), { open: y } = L({
|
|
16
|
+
onChange: async (a) => {
|
|
17
|
+
const o = a == null ? void 0 : a[0];
|
|
15
18
|
if (o) {
|
|
16
19
|
const t = new FileReader();
|
|
17
|
-
t.onload = async (
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
+
t.onload = async (w) => {
|
|
21
|
+
var k;
|
|
22
|
+
const F = (k = w.target) == null ? void 0 : k.result;
|
|
20
23
|
try {
|
|
21
|
-
await
|
|
22
|
-
} catch (
|
|
23
|
-
console.error(
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
await g(F, c.value.uid), n("Import successful", "info"), m("close");
|
|
25
|
+
} catch (i) {
|
|
26
|
+
console.error(i);
|
|
27
|
+
const U = (i == null ? void 0 : i.message) || "Unknown error";
|
|
28
|
+
n(`Import failed: ${U}`, "error");
|
|
26
29
|
}
|
|
27
30
|
}, t.readAsText(o);
|
|
28
31
|
}
|
|
29
32
|
},
|
|
30
33
|
multiple: !1,
|
|
31
34
|
accept: ".json,.yaml,.yml"
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
});
|
|
36
|
+
async function I() {
|
|
37
|
+
try {
|
|
38
|
+
e.value && (v(e.value) ? await C(
|
|
39
|
+
e.value,
|
|
40
|
+
void 0,
|
|
41
|
+
void 0,
|
|
42
|
+
c.value.uid
|
|
43
|
+
) : M(e.value) ? await g(
|
|
44
|
+
String(e.value),
|
|
45
|
+
c.value.uid
|
|
46
|
+
) : n("Import failed: Invalid URL or OpenAPI document", "error")), m("close"), n("Import successful", "info");
|
|
47
|
+
} catch (a) {
|
|
48
|
+
console.error("[importCollection]", a);
|
|
49
|
+
const o = (a == null ? void 0 : a.message) || "Unknown error";
|
|
50
|
+
n(`Import failed: ${o}`, "error");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function S() {
|
|
54
|
+
return (f(e.value) || {}).type ?? "json";
|
|
55
|
+
}
|
|
56
|
+
function D(a) {
|
|
57
|
+
var t;
|
|
58
|
+
const o = (t = a.clipboardData) == null ? void 0 : t.getData("text");
|
|
59
|
+
o && (e.value = o);
|
|
60
|
+
}
|
|
61
|
+
return (a, o) => (s(), u(N, {
|
|
62
|
+
disabled: !e.value.trim(),
|
|
63
|
+
onSubmit: I
|
|
64
|
+
}, {
|
|
43
65
|
options: l(() => [
|
|
44
|
-
|
|
45
|
-
class: "p-2 max-h-8 gap-1 text-xs hover:bg-b-2 relative",
|
|
66
|
+
p(r(x), {
|
|
67
|
+
class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
46
68
|
variant: "outlined",
|
|
47
|
-
onClick:
|
|
69
|
+
onClick: r(y)
|
|
48
70
|
}, {
|
|
49
71
|
default: l(() => [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class: "text-c-3
|
|
53
|
-
icon: "
|
|
54
|
-
size: "
|
|
72
|
+
d(" JSON, or YAML File "),
|
|
73
|
+
p(r(P), {
|
|
74
|
+
class: "text-c-3",
|
|
75
|
+
icon: "UploadSimple",
|
|
76
|
+
size: "md"
|
|
55
77
|
})
|
|
56
78
|
]),
|
|
57
79
|
_: 1
|
|
58
80
|
}, 8, ["onClick"])
|
|
59
81
|
]),
|
|
60
82
|
submit: l(() => [
|
|
61
|
-
|
|
83
|
+
d("Import Collection")
|
|
62
84
|
]),
|
|
63
85
|
default: l(() => [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
placeholder: "Paste Swagger File URL",
|
|
69
|
-
onOnDelete: o[1] || (o[1] = (t) =>
|
|
70
|
-
|
|
86
|
+
!r(f)(e.value) || r(v)(e.value) ? (s(), u(T, {
|
|
87
|
+
key: 0,
|
|
88
|
+
modelValue: e.value,
|
|
89
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => e.value = t),
|
|
90
|
+
placeholder: "Paste Swagger/OpenAPI File URL or content",
|
|
91
|
+
onOnDelete: o[1] || (o[1] = (t) => m("back", t)),
|
|
92
|
+
onPaste: o[2] || (o[2] = (t) => D(t))
|
|
93
|
+
}, null, 8, ["modelValue"])) : (s(), h(A, { key: 1 }, [
|
|
94
|
+
p(r(x), {
|
|
95
|
+
class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
96
|
+
variant: "ghost",
|
|
97
|
+
onClick: o[3] || (o[3] = (t) => e.value = "")
|
|
98
|
+
}, {
|
|
99
|
+
default: l(() => [
|
|
100
|
+
d(" Clear ")
|
|
101
|
+
]),
|
|
102
|
+
_: 1
|
|
103
|
+
}),
|
|
104
|
+
r(f)(e.value) && !r(v)(e.value) ? (s(), u(r(B), {
|
|
105
|
+
key: 0,
|
|
106
|
+
class: "bg-backdropdark border max-h-[25dvh] mt-2 rounded",
|
|
107
|
+
content: e.value,
|
|
108
|
+
copy: !1,
|
|
109
|
+
lang: S()
|
|
110
|
+
}, null, 8, ["content", "lang"])) : O("", !0)
|
|
111
|
+
], 64))
|
|
71
112
|
]),
|
|
72
113
|
_: 1
|
|
73
|
-
}));
|
|
114
|
+
}, 8, ["disabled"]));
|
|
74
115
|
}
|
|
75
116
|
});
|
|
76
117
|
export {
|
|
77
|
-
|
|
118
|
+
X as default
|
|
78
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AAqNA,iBAAS,cAAc;oBA2GK,GAAG;oBACH,GAAG;oBAEH,GAAG;qBADF,GAAG;EAsB/B;AACD,QAAA,MAAM,eAAe;YArMT,MAAM;kBACA,OAAO;;;;YADb,MAAM;kBACA,OAAO;;;;iBAAP,OAAO;MA0MvB,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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Sidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c7a612bc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,50 +1,55 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as _, ref as b, withDirectives as L, openBlock as r, createElementBlock as i, normalizeClass as g, normalizeStyle as B, unref as t, renderSlot as n, createElementVNode as w, toDisplayString as W, createCommentVNode as d, vShow as $ } from "vue";
|
|
2
2
|
import { useMediaQuery as y } from "@vueuse/core";
|
|
3
|
-
import { useWorkspace as
|
|
4
|
-
const
|
|
3
|
+
import { useWorkspace as z } from "../../store/store.js";
|
|
4
|
+
const C = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "xl:min-h-header flex items-center justify-between border-b-1/2 p-2 md:px-4 md:py-2.5 text-sm"
|
|
7
|
-
}, I = { class: "font-medium m-0 text-sm whitespace-nowrap" },
|
|
7
|
+
}, I = { class: "font-medium m-0 text-sm whitespace-nowrap" }, M = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "relative z-10 pt-0 md:px-2.5 md:pb-2.5 -translate-y-full w-[inherit] has-[.empty-sidebar-item]:border-t-1/2"
|
|
10
|
+
}, V = /* @__PURE__ */ _({
|
|
8
11
|
__name: "Sidebar",
|
|
9
12
|
props: {
|
|
10
13
|
title: {},
|
|
11
14
|
showSideBar: { type: Boolean, default: !0 }
|
|
12
15
|
},
|
|
13
16
|
setup(x) {
|
|
14
|
-
const E = x, { isReadOnly: m, sidebarWidth: o, setSidebarWidth:
|
|
17
|
+
const E = x, { isReadOnly: m, sidebarWidth: o, setSidebarWidth: a } = z(), l = b(!1), u = y("(max-width: 780px)"), c = b(null), p = y("(max-width: 800px)"), k = (e) => {
|
|
15
18
|
e.preventDefault();
|
|
16
19
|
const f = e.clientX, S = parseInt(
|
|
17
20
|
getComputedStyle(c.value).width || o.value,
|
|
18
21
|
10
|
|
19
22
|
), v = (D) => {
|
|
20
|
-
|
|
23
|
+
l.value = !0, document.body.classList.add("dragging");
|
|
21
24
|
let s = S + D.clientX - f;
|
|
22
|
-
s > 420 && (s = 420 + (s - 420) * 0.2), s < 240 && (s = 240),
|
|
25
|
+
s > 420 && (s = 420 + (s - 420) * 0.2), s < 240 && (s = 240), a(`${s}px`);
|
|
23
26
|
}, h = () => {
|
|
24
|
-
|
|
27
|
+
l.value = !1, document.body.classList.remove("dragging"), document.documentElement.removeEventListener("mousemove", v, !1), document.documentElement.removeEventListener("mouseup", h, !1), parseInt(o.value, 10) > 420 ? a("360px") : parseInt(o.value, 10) < 240 && a("240px");
|
|
25
28
|
};
|
|
26
29
|
document.documentElement.addEventListener("mousemove", v, !1), document.documentElement.addEventListener("mouseup", h, !1);
|
|
27
30
|
};
|
|
28
|
-
return (e, f) =>
|
|
31
|
+
return (e, f) => L((r(), i("aside", {
|
|
29
32
|
ref_key: "sidebarRef",
|
|
30
33
|
ref: c,
|
|
31
|
-
class: g(["sidebar overflow-hidden relative flex flex-col flex-1 md:flex-none bg-b-1 md:border-b-0 md:border-r-1/2 min-w-full md:min-w-fit", { dragging:
|
|
32
|
-
style:
|
|
34
|
+
class: g(["sidebar overflow-hidden relative flex flex-col flex-1 md:flex-none bg-b-1 md:border-b-0 md:border-r-1/2 min-w-full md:min-w-fit", { dragging: l.value }]),
|
|
35
|
+
style: B({ width: t(u) ? "100%" : t(o) })
|
|
33
36
|
}, [
|
|
34
|
-
|
|
35
|
-
!t(m) && e.title ? (
|
|
36
|
-
w("h2", I,
|
|
37
|
-
t(p) ?
|
|
38
|
-
])) :
|
|
37
|
+
n(e.$slots, "header", {}, void 0, !0),
|
|
38
|
+
!t(m) && e.title ? (r(), i("div", C, [
|
|
39
|
+
w("h2", I, W(e.title), 1),
|
|
40
|
+
t(p) ? n(e.$slots, "button", { key: 0 }, void 0, !0) : d("", !0)
|
|
41
|
+
])) : d("", !0),
|
|
39
42
|
w("div", {
|
|
40
43
|
class: g(["custom-scroll sidebar-height pb-0 md:pb-[37px] w-[inherit]", {
|
|
41
44
|
"sidebar-mask": !t(m)
|
|
42
45
|
}])
|
|
43
46
|
}, [
|
|
44
|
-
|
|
47
|
+
n(e.$slots, "content", {}, void 0, !0)
|
|
45
48
|
], 2),
|
|
46
|
-
t(p) ?
|
|
47
|
-
|
|
49
|
+
t(p) ? d("", !0) : (r(), i("div", M, [
|
|
50
|
+
n(e.$slots, "button", {}, void 0, !0)
|
|
51
|
+
])),
|
|
52
|
+
t(u) ? d("", !0) : (r(), i("div", {
|
|
48
53
|
key: 2,
|
|
49
54
|
class: "resizer",
|
|
50
55
|
onMousedown: k
|
|
@@ -55,5 +60,5 @@ const z = {
|
|
|
55
60
|
}
|
|
56
61
|
});
|
|
57
62
|
export {
|
|
58
|
-
|
|
63
|
+
V as default
|
|
59
64
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOpenApiDocumentVersion.d.ts","sourceRoot":"","sources":["../../src/libs/getOpenApiDocumentVersion.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;;;EAsC7D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { json as n, yaml as o } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { isDocument as t } from "./isDocument.js";
|
|
3
|
+
function i(r) {
|
|
4
|
+
if (!t(r))
|
|
5
|
+
return !1;
|
|
6
|
+
try {
|
|
7
|
+
const e = n.parse(r ?? "");
|
|
8
|
+
return typeof (e == null ? void 0 : e.openapi) == "string" ? { version: `OpenAPI ${e.openapi}`, type: "json" } : typeof (e == null ? void 0 : e.swagger) == "string" ? { version: `Swagger ${e.swagger}`, type: "json" } : !1;
|
|
9
|
+
} catch {
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
const e = o.parse(r ?? "");
|
|
13
|
+
return typeof (e == null ? void 0 : e.openapi) == "string" ? { version: `OpenAPI ${e.openapi}`, type: "yaml" } : typeof (e == null ? void 0 : e.swagger) == "string" ? { version: `Swagger ${e.swagger}`, type: "yaml" } : !1;
|
|
14
|
+
} catch {
|
|
15
|
+
}
|
|
16
|
+
return !1;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
i as getOpenApiDocumentVersion
|
|
20
|
+
};
|
package/dist/libs/index.d.ts
CHANGED
|
@@ -6,5 +6,8 @@ export * from './errors.js';
|
|
|
6
6
|
export * from './normalize-headers.js';
|
|
7
7
|
export * from './local-storage.js';
|
|
8
8
|
export * from './environment-parser.js';
|
|
9
|
+
export * from './isUrl.js';
|
|
10
|
+
export * from './isDocument.js';
|
|
11
|
+
export * from './getOpenApiDocumentVersion.js';
|
|
9
12
|
export { createRequestOperation } from './send-request.js';
|
|
10
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/libs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,6BAA6B,CAAA;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/libs/index.js
CHANGED
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
import { createApiClient as o } from "./create-client.js";
|
|
2
|
-
import { formatBytes as
|
|
3
|
-
import { ERRORS as
|
|
4
|
-
import { formatHeaderKey as
|
|
2
|
+
import { formatBytes as m, formatMs as s } from "./formatters.js";
|
|
3
|
+
import { ERRORS as a, normalizeError as f, prettyErrorMessage as x } from "./errors.js";
|
|
4
|
+
import { formatHeaderKey as n, normalizeHeaders as i } from "./normalize-headers.js";
|
|
5
5
|
import { loadAllResources as c } from "./local-storage.js";
|
|
6
6
|
import { parseEnvVariables as d } from "./environment-parser.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { isUrl as E } from "./isUrl.js";
|
|
8
|
+
import { isDocument as q } from "./isDocument.js";
|
|
9
|
+
import { getOpenApiDocumentVersion as D } from "./getOpenApiDocumentVersion.js";
|
|
10
|
+
import { createRequestOperation as K } from "./send-request.js";
|
|
11
|
+
import { commandPaletteBus as g } from "./event-busses/command-palette-bus.js";
|
|
12
|
+
import { DEFAULT_HOTKEYS as S, getModifiers as h, handleHotKeyDown as z, hotKeyBus as T } from "./event-busses/hot-keys-bus.js";
|
|
13
|
+
import { executeRequestBus as V } from "./event-busses/execute-request-bus.js";
|
|
14
|
+
import { cancelRequestBus as v } from "./event-busses/cancel-request-bus.js";
|
|
15
|
+
import { requestStatusBus as C } from "./event-busses/request-status-bus.js";
|
|
13
16
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
S as DEFAULT_HOTKEYS,
|
|
18
|
+
a as ERRORS,
|
|
19
|
+
v as cancelRequestBus,
|
|
20
|
+
g as commandPaletteBus,
|
|
18
21
|
o as createApiClient,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
K as createRequestOperation,
|
|
23
|
+
V as executeRequestBus,
|
|
24
|
+
m as formatBytes,
|
|
25
|
+
n as formatHeaderKey,
|
|
23
26
|
s as formatMs,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
h as getModifiers,
|
|
28
|
+
D as getOpenApiDocumentVersion,
|
|
29
|
+
z as handleHotKeyDown,
|
|
30
|
+
T as hotKeyBus,
|
|
31
|
+
q as isDocument,
|
|
32
|
+
E as isUrl,
|
|
27
33
|
c as loadAllResources,
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
f as normalizeError,
|
|
35
|
+
i as normalizeHeaders,
|
|
30
36
|
d as parseEnvVariables,
|
|
31
37
|
x as prettyErrorMessage,
|
|
32
|
-
|
|
38
|
+
C as requestStatusBus
|
|
33
39
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDocument.d.ts","sourceRoot":"","sources":["../../src/libs/isDocument.ts"],"names":[],"mappings":"AAEA,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,uBAE9C"}
|