@scalar/api-reference 1.24.46 → 1.24.49
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 +33 -0
- package/dist/browser/standalone.js +9227 -9250
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +29 -29
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +24 -21
- package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/OperationAccordion.vue.js +2 -2
- package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
- package/dist/components/Content/Operation/TestRequestButton.vue2.js +9 -9
- package/dist/components/SearchButton.vue.d.ts.map +1 -1
- package/dist/components/SearchButton.vue.js +2 -2
- package/dist/components/SearchButton.vue2.js +10 -9
- package/dist/components/SearchModal.vue.js +2 -2
- package/dist/components/SearchModal.vue2.js +36 -36
- package/dist/components/Sidebar/Sidebar.vue.d.ts +3 -2
- 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 +29 -27
- package/dist/helpers/getModels.d.ts.map +1 -1
- package/dist/helpers/getModels.js +13 -7
- package/dist/hooks/useSidebar.d.ts +9 -4
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +123 -122
- package/dist/index.js +1 -1
- package/dist/stores/useHttpClientStore.d.ts +12 -0
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +63 -54
- package/dist/style.css +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as ee, toRef as te, ref as m, computed as q, watch as U, openBlock as E, createBlock as
|
|
2
|
-
import { ScalarModal as
|
|
1
|
+
import { defineComponent as ee, toRef as te, ref as m, computed as q, watch as U, openBlock as E, createBlock as H, unref as S, withCtx as n, createElementVNode as w, createVNode as V, createTextVNode as g, toDisplayString as b, createElementBlock as oe, Fragment as ae, renderList as le, createSlots as re, pushScopeId as se, popScopeId as ce } from "vue";
|
|
2
|
+
import { ScalarModal as ne, ScalarSearchInput as ie, ScalarSearchResultList as de, ScalarSearchResultItem as ue } from "@scalar/components";
|
|
3
3
|
import { useMagicKeys as pe, whenever as _ } from "@vueuse/core";
|
|
4
4
|
import he from "fuse.js";
|
|
5
5
|
import { extractRequestBody as me } from "../helpers/specHelpers.js";
|
|
@@ -9,19 +9,19 @@ import { getHeadingsFromMarkdown as Se } from "../helpers/getHeadingsFromMarkdow
|
|
|
9
9
|
import { useOperation as ge } from "../hooks/useOperation.js";
|
|
10
10
|
import { getModels as be } from "../helpers/getModels.js";
|
|
11
11
|
import { useNavState as we } from "../hooks/useNavState.js";
|
|
12
|
-
const ke = (d) => (se("data-v-
|
|
12
|
+
const ke = (d) => (se("data-v-241cc7e9"), d = d(), ce(), d), ye = /* @__PURE__ */ ke(() => /* @__PURE__ */ w("div", { class: "ref-search-meta" }, [
|
|
13
13
|
/* @__PURE__ */ w("span", null, "↑↓ Navigate"),
|
|
14
14
|
/* @__PURE__ */ w("span", null, "⏎ Select")
|
|
15
|
-
], -1)),
|
|
15
|
+
], -1)), Ne = /* @__PURE__ */ ee({
|
|
16
16
|
__name: "SearchModal",
|
|
17
17
|
props: {
|
|
18
18
|
parsedSpec: {},
|
|
19
19
|
modalState: {}
|
|
20
20
|
},
|
|
21
21
|
setup(d) {
|
|
22
|
-
const l = d,
|
|
22
|
+
const l = d, j = te(l, "parsedSpec"), A = {
|
|
23
23
|
heading: "DocsPage",
|
|
24
|
-
model: "
|
|
24
|
+
model: "Brackets",
|
|
25
25
|
req: "Terminal",
|
|
26
26
|
tag: "CodeFolder",
|
|
27
27
|
webhook: "Terminal"
|
|
@@ -31,26 +31,26 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
31
31
|
s.value = 0, y.value = I.search(i.value);
|
|
32
32
|
}, f = q(
|
|
33
33
|
() => u.value[s.value]
|
|
34
|
-
), { getHeadingId: P, getWebhookId:
|
|
34
|
+
), { getHeadingId: P, getWebhookId: K, getModelId: Y, getOperationId: z, getTagId: G } = we();
|
|
35
35
|
U(
|
|
36
36
|
() => l.modalState.open,
|
|
37
37
|
(o) => {
|
|
38
38
|
o && (i.value = "", s.value = 0, y.value = []);
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
|
-
const { setCollapsedSidebarItem:
|
|
41
|
+
const { setCollapsedSidebarItem: J, hideModels: Q } = ve();
|
|
42
42
|
U(
|
|
43
|
-
|
|
43
|
+
j.value,
|
|
44
44
|
async () => {
|
|
45
|
-
var M, $, F, N
|
|
46
|
-
if (r.value = [], !(($ = (M = l.parsedSpec) == null ? void 0 : M.tags) != null && $.length) && !((
|
|
45
|
+
var M, $, B, F, N;
|
|
46
|
+
if (r.value = [], !(($ = (M = l.parsedSpec) == null ? void 0 : M.tags) != null && $.length) && !((B = l.parsedSpec) != null && B.webhooks)) {
|
|
47
47
|
I.setCollection([]);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
const o = [],
|
|
51
|
-
((
|
|
50
|
+
const o = [], c = Se(
|
|
51
|
+
((F = l.parsedSpec.info) == null ? void 0 : F.description) ?? ""
|
|
52
52
|
);
|
|
53
|
-
|
|
53
|
+
c.length && (c.forEach((t) => {
|
|
54
54
|
o.push({
|
|
55
55
|
type: "heading",
|
|
56
56
|
title: `Info > ${t.value}`,
|
|
@@ -59,23 +59,23 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
59
59
|
tag: t.slug,
|
|
60
60
|
body: ""
|
|
61
61
|
});
|
|
62
|
-
}), r.value = r.value.concat(o)), (
|
|
63
|
-
const
|
|
62
|
+
}), r.value = r.value.concat(o)), (N = l.parsedSpec.tags) == null || N.forEach((t) => {
|
|
63
|
+
const x = {
|
|
64
64
|
title: t["x-displayName"] ?? t.name,
|
|
65
|
-
href: `#${
|
|
65
|
+
href: `#${G(t)}`,
|
|
66
66
|
description: t.description,
|
|
67
67
|
type: "tag",
|
|
68
68
|
tag: t.name,
|
|
69
69
|
body: ""
|
|
70
70
|
};
|
|
71
|
-
r.value.push(
|
|
71
|
+
r.value.push(x), t.operations && t.operations.forEach((a) => {
|
|
72
72
|
const { parameterMap: v } = ge({ operation: a }), O = me(a) || v.value;
|
|
73
73
|
let R = null;
|
|
74
74
|
typeof O != "boolean" && (R = O);
|
|
75
75
|
const T = {
|
|
76
76
|
type: "req",
|
|
77
77
|
title: a.name ?? a.path,
|
|
78
|
-
href: `#${
|
|
78
|
+
href: `#${z(a, t)}`,
|
|
79
79
|
operationId: a.operationId,
|
|
80
80
|
description: a.description ?? "",
|
|
81
81
|
httpVerb: a.httpVerb,
|
|
@@ -95,7 +95,7 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
95
95
|
p.push({
|
|
96
96
|
type: "webhook",
|
|
97
97
|
title: `Webhook: ${(v = e[t][a]) == null ? void 0 : v.name}`,
|
|
98
|
-
href: `#${
|
|
98
|
+
href: `#${K(t, a)}`,
|
|
99
99
|
description: t,
|
|
100
100
|
httpVerb: a,
|
|
101
101
|
tag: t,
|
|
@@ -108,7 +108,7 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
108
108
|
D.push({
|
|
109
109
|
type: "model",
|
|
110
110
|
title: "Model",
|
|
111
|
-
href: `#${
|
|
111
|
+
href: `#${Y(t)}`,
|
|
112
112
|
description: h[t].title ?? t,
|
|
113
113
|
tag: t,
|
|
114
114
|
body: ""
|
|
@@ -136,19 +136,19 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
136
136
|
item: o
|
|
137
137
|
})) : y.value
|
|
138
138
|
), X = /#(tag\/[^/]*)/, C = (o) => {
|
|
139
|
-
let
|
|
139
|
+
let c = "models";
|
|
140
140
|
const e = o.item.href.match(X);
|
|
141
|
-
e != null && e.length && e.length > 1 && (
|
|
141
|
+
e != null && e.length && e.length > 1 && (c = e[1]), J(c, !0), l.modalState.hide();
|
|
142
142
|
};
|
|
143
143
|
function Z(o) {
|
|
144
|
-
const
|
|
145
|
-
return
|
|
144
|
+
const c = new URL(window.location.href);
|
|
145
|
+
return c.hash = o, c.toString();
|
|
146
146
|
}
|
|
147
|
-
return (o,
|
|
147
|
+
return (o, c) => (E(), H(S(ne), {
|
|
148
148
|
state: o.modalState,
|
|
149
149
|
variant: "search"
|
|
150
150
|
}, {
|
|
151
|
-
default:
|
|
151
|
+
default: n(() => [
|
|
152
152
|
w("div", {
|
|
153
153
|
ref_key: "searchModalRef",
|
|
154
154
|
ref: L,
|
|
@@ -156,7 +156,7 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
156
156
|
}, [
|
|
157
157
|
V(S(ie), {
|
|
158
158
|
modelValue: i.value,
|
|
159
|
-
"onUpdate:modelValue":
|
|
159
|
+
"onUpdate:modelValue": c[0] || (c[0] = (e) => i.value = e),
|
|
160
160
|
onInput: W
|
|
161
161
|
}, null, 8, ["modelValue"])
|
|
162
162
|
], 512),
|
|
@@ -164,11 +164,11 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
164
164
|
class: "ref-search-results custom-scroll",
|
|
165
165
|
noResults: !u.value.length
|
|
166
166
|
}, {
|
|
167
|
-
query:
|
|
167
|
+
query: n(() => [
|
|
168
168
|
g(b(i.value), 1)
|
|
169
169
|
]),
|
|
170
|
-
default:
|
|
171
|
-
(E(!0), oe(ae, null, le(u.value, (e, p) => (E(),
|
|
170
|
+
default: n(() => [
|
|
171
|
+
(E(!0), oe(ae, null, le(u.value, (e, p) => (E(), H(S(ue), {
|
|
172
172
|
id: e.item.href,
|
|
173
173
|
key: e.refIndex,
|
|
174
174
|
active: s.value === p,
|
|
@@ -177,27 +177,27 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
177
177
|
onClick: (h) => C(e),
|
|
178
178
|
onFocus: (h) => s.value = p
|
|
179
179
|
}, re({
|
|
180
|
-
default:
|
|
180
|
+
default: n(() => [
|
|
181
181
|
g(b(e.item.title) + " ", 1)
|
|
182
182
|
]),
|
|
183
183
|
_: 2
|
|
184
184
|
}, [
|
|
185
185
|
(e.item.httpVerb || e.item.path) && e.item.path !== e.item.title ? {
|
|
186
186
|
name: "description",
|
|
187
|
-
fn:
|
|
187
|
+
fn: n(() => [
|
|
188
188
|
g(b(e.item.path), 1)
|
|
189
189
|
]),
|
|
190
190
|
key: "0"
|
|
191
191
|
} : e.item.description ? {
|
|
192
192
|
name: "description",
|
|
193
|
-
fn:
|
|
193
|
+
fn: n(() => [
|
|
194
194
|
g(b(e.item.description), 1)
|
|
195
195
|
]),
|
|
196
196
|
key: "1"
|
|
197
197
|
} : void 0,
|
|
198
198
|
e.item.type === "req" ? {
|
|
199
199
|
name: "addon",
|
|
200
|
-
fn:
|
|
200
|
+
fn: n(() => [
|
|
201
201
|
V(fe, {
|
|
202
202
|
method: e.item.httpVerb ?? "get"
|
|
203
203
|
}, null, 8, ["method"])
|
|
@@ -215,5 +215,5 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
|
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
export {
|
|
218
|
-
|
|
218
|
+
Ne as default
|
|
219
219
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Spec } from '@scalar/oas-utils';
|
|
2
|
+
import { type TagsSorterOption } from '../../hooks';
|
|
2
3
|
declare function __VLS_template(): {
|
|
3
4
|
"sidebar-start"?(_: {}): any;
|
|
4
5
|
"sidebar-end"?(_: {}): any;
|
|
5
6
|
};
|
|
6
7
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
7
8
|
parsedSpec: Spec;
|
|
8
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
9
|
+
} & TagsSorterOption>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
9
10
|
parsedSpec: Spec;
|
|
10
|
-
}>>>, {}, {}>;
|
|
11
|
+
} & TagsSorterOption>>>, {}, {}>;
|
|
11
12
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
12
13
|
export default _default;
|
|
13
14
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -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":"AAgOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAI7C,OAAO,EAAE,KAAK,gBAAgB,EAA2B,MAAM,aAAa,CAAA;AAuE5E,iBAAS,cAAc;6BA4Oc,GAAG;2BACJ,GAAG;EAuBtC;AACD,QAAA,MAAM,eAAe;gBArUL,IAAI;;gBAAJ,IAAI;gCA2UlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-14598096"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { defineComponent as B, ref as E, watch as N, onMounted as
|
|
1
|
+
import { defineComponent as B, ref as E, watch as N, onMounted as F, openBlock as l, createElementBlock as a, renderSlot as V, createElementVNode as w, createVNode as I, withCtx as f, Fragment as d, renderList as h, unref as i, toDisplayString as L, createBlock as u, createCommentVNode as b } from "vue";
|
|
2
2
|
import v from "./SidebarElement.vue.js";
|
|
3
3
|
import m from "./SidebarGroup.vue.js";
|
|
4
4
|
import { useSidebar as G } from "../../hooks/useSidebar.js";
|
|
5
|
-
import { sleep as
|
|
5
|
+
import { sleep as C } from "../../helpers/sleep.js";
|
|
6
6
|
import { useNavState as x } from "../../hooks/useNavState.js";
|
|
7
7
|
const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160, P = /* @__PURE__ */ B({
|
|
8
8
|
__name: "Sidebar",
|
|
9
9
|
props: {
|
|
10
|
-
parsedSpec: {}
|
|
10
|
+
parsedSpec: {},
|
|
11
|
+
tagsSorter: { type: [String, Function] }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
13
|
+
setup(A) {
|
|
14
|
+
const S = A, { hash: o, isIntersectionEnabled: $ } = x(), { items: O, toggleCollapsedSidebarItem: T, collapsedSidebarItems: g } = G(
|
|
14
15
|
{
|
|
15
|
-
parsedSpec:
|
|
16
|
+
parsedSpec: S.parsedSpec,
|
|
17
|
+
tagsSorter: S.tagsSorter
|
|
16
18
|
}
|
|
17
19
|
), y = E(null), c = E(!0);
|
|
18
20
|
N(o, (p) => {
|
|
@@ -25,23 +27,23 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
|
|
|
25
27
|
let e = M;
|
|
26
28
|
n.getAttribute("data-sidebar-type") === "heading" ? e += n.offsetTop + ((t = n.getElementsByClassName("sidebar-heading")) == null ? void 0 : t[0]).offsetHeight : e += n.offsetTop + (((r = n.parentElement) == null ? void 0 : r.offsetTop) ?? 0) + (((_ = (s = n.parentElement) == null ? void 0 : s.parentElement) == null ? void 0 : _.offsetTop) ?? 0), y.value.scrollTo({ top: e, behavior: "smooth" });
|
|
27
29
|
};
|
|
28
|
-
return
|
|
30
|
+
return F(() => {
|
|
29
31
|
setTimeout(() => k(o.value), 500), c.value = !1;
|
|
30
32
|
}), (p, n) => (l(), a("div", D, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
V(p.$slots, "sidebar-start", {}, void 0, !0),
|
|
34
|
+
w("div", {
|
|
33
35
|
ref_key: "scrollerEl",
|
|
34
36
|
ref: y,
|
|
35
37
|
class: "sidebar-pages custom-scroll custom-scroll-self-contain-overflow"
|
|
36
38
|
}, [
|
|
37
|
-
|
|
38
|
-
default:
|
|
39
|
+
I(m, { level: 0 }, {
|
|
40
|
+
default: f(() => [
|
|
39
41
|
(l(!0), a(d, null, h(i(O).entries, (e) => (l(), a(d, {
|
|
40
42
|
key: e.id
|
|
41
43
|
}, [
|
|
42
44
|
e.isGroup ? (l(), a(d, { key: 0 }, [
|
|
43
|
-
|
|
44
|
-
(l(!0), a(d, null, h(e.children, (t) => (l(),
|
|
45
|
+
w("li", H, L(e.displayTitle ?? e.title), 1),
|
|
46
|
+
(l(!0), a(d, null, h(e.children, (t) => (l(), u(v, {
|
|
45
47
|
key: t.id,
|
|
46
48
|
id: `sidebar-${t.id}`,
|
|
47
49
|
"data-sidebar-type": "heading",
|
|
@@ -54,23 +56,23 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
|
|
|
54
56
|
httpVerb: t.httpVerb,
|
|
55
57
|
deprecated: t.deprecated ?? !1
|
|
56
58
|
},
|
|
57
|
-
open: i(
|
|
59
|
+
open: i(g)[t.id] ?? !1,
|
|
58
60
|
onToggleOpen: async () => {
|
|
59
|
-
c.value = !0, i(
|
|
61
|
+
c.value = !0, i(T)(t.id), await i(C)(100), c.value = !1;
|
|
60
62
|
}
|
|
61
63
|
}, {
|
|
62
|
-
default:
|
|
64
|
+
default: f(() => {
|
|
63
65
|
var r;
|
|
64
66
|
return [
|
|
65
|
-
t.children && ((r = t.children) == null ? void 0 : r.length) > 0 ? (l(),
|
|
67
|
+
t.children && ((r = t.children) == null ? void 0 : r.length) > 0 ? (l(), u(m, {
|
|
66
68
|
key: 0,
|
|
67
69
|
level: 1
|
|
68
70
|
}, {
|
|
69
|
-
default:
|
|
71
|
+
default: f(() => [
|
|
70
72
|
(l(!0), a(d, null, h(t.children, (s) => (l(), a(d, {
|
|
71
73
|
key: s.id
|
|
72
74
|
}, [
|
|
73
|
-
e.show ? (l(),
|
|
75
|
+
e.show ? (l(), u(v, {
|
|
74
76
|
key: 0,
|
|
75
77
|
id: `sidebar-${s.id}`,
|
|
76
78
|
isActive: i(o) === s.id,
|
|
@@ -91,7 +93,7 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
|
|
|
91
93
|
_: 2
|
|
92
94
|
}, 1032, ["id", "hasChildren", "isActive", "item", "open", "onToggleOpen"]))), 128))
|
|
93
95
|
], 64)) : (l(), a(d, { key: 1 }, [
|
|
94
|
-
e.show ? (l(),
|
|
96
|
+
e.show ? (l(), u(v, {
|
|
95
97
|
key: 0,
|
|
96
98
|
id: `sidebar-${e.id}`,
|
|
97
99
|
"data-sidebar-type": "heading",
|
|
@@ -104,23 +106,23 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
|
|
|
104
106
|
httpVerb: e.httpVerb,
|
|
105
107
|
deprecated: e.deprecated ?? !1
|
|
106
108
|
},
|
|
107
|
-
open: i(
|
|
109
|
+
open: i(g)[e.id] ?? !1,
|
|
108
110
|
onToggleOpen: async () => {
|
|
109
|
-
c.value = !0, i(
|
|
111
|
+
c.value = !0, i(T)(e.id), await i(C)(100), c.value = !1;
|
|
110
112
|
}
|
|
111
113
|
}, {
|
|
112
|
-
default:
|
|
114
|
+
default: f(() => {
|
|
113
115
|
var t;
|
|
114
116
|
return [
|
|
115
|
-
e.children && ((t = e.children) == null ? void 0 : t.length) > 0 ? (l(),
|
|
117
|
+
e.children && ((t = e.children) == null ? void 0 : t.length) > 0 ? (l(), u(m, {
|
|
116
118
|
key: 0,
|
|
117
119
|
level: 1
|
|
118
120
|
}, {
|
|
119
|
-
default:
|
|
121
|
+
default: f(() => [
|
|
120
122
|
(l(!0), a(d, null, h(e.children, (r) => (l(), a(d, {
|
|
121
123
|
key: r.id
|
|
122
124
|
}, [
|
|
123
|
-
e.show ? (l(),
|
|
125
|
+
e.show ? (l(), u(v, {
|
|
124
126
|
key: 0,
|
|
125
127
|
id: `sidebar-${r.id}`,
|
|
126
128
|
isActive: i(o) === r.id,
|
|
@@ -146,7 +148,7 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
|
|
|
146
148
|
_: 1
|
|
147
149
|
})
|
|
148
150
|
], 512),
|
|
149
|
-
|
|
151
|
+
V(p.$slots, "sidebar-end", {}, void 0, !0)
|
|
150
152
|
]));
|
|
151
153
|
}
|
|
152
154
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../src/helpers/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE/E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../src/helpers/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE/E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,mHA6BpC"}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
function
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
function l(t) {
|
|
2
|
+
var o, i;
|
|
3
|
+
if (!t)
|
|
4
|
+
return {};
|
|
5
|
+
const n = (
|
|
4
6
|
// OpenAPI 3.x
|
|
5
|
-
Object.keys(((
|
|
7
|
+
Object.keys(((o = t == null ? void 0 : t.components) == null ? void 0 : o.schemas) ?? {}).length ? (i = t == null ? void 0 : t.components) == null ? void 0 : i.schemas : (
|
|
6
8
|
// Swagger 2.0
|
|
7
|
-
Object.keys((
|
|
9
|
+
Object.keys((t == null ? void 0 : t.definitions) ?? {}).length ? t == null ? void 0 : t.definitions : (
|
|
8
10
|
// Fallback
|
|
9
11
|
{}
|
|
10
12
|
)
|
|
11
13
|
)
|
|
12
|
-
)
|
|
14
|
+
);
|
|
15
|
+
return Object.keys(n ?? {}).forEach((r) => {
|
|
16
|
+
var f;
|
|
17
|
+
((f = n[r]) == null ? void 0 : f["x-internal"]) === !0 && delete n[r];
|
|
18
|
+
}), n;
|
|
13
19
|
}
|
|
14
20
|
export {
|
|
15
|
-
|
|
21
|
+
l as getModels
|
|
16
22
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Spec } from '@scalar/oas-utils';
|
|
1
|
+
import type { Spec, Tag } from '@scalar/oas-utils';
|
|
2
2
|
export type SidebarEntry = {
|
|
3
3
|
id: string;
|
|
4
4
|
title: string;
|
|
@@ -10,16 +10,21 @@ export type SidebarEntry = {
|
|
|
10
10
|
deprecated?: boolean;
|
|
11
11
|
isGroup?: boolean;
|
|
12
12
|
};
|
|
13
|
+
/** Helper to overwrite the current OpenAPI document */
|
|
13
14
|
declare function setParsedSpec(spec: Spec): Spec;
|
|
14
15
|
type CollapsedSidebarItems = Record<string, boolean>;
|
|
15
16
|
declare function toggleCollapsedSidebarItem(key: string): void;
|
|
16
17
|
declare function setCollapsedSidebarItem(key: string, value: boolean): void;
|
|
18
|
+
export type ParsedSpecOption = {
|
|
19
|
+
parsedSpec: Spec;
|
|
20
|
+
};
|
|
21
|
+
export type TagsSorterOption = {
|
|
22
|
+
tagsSorter?: 'alpha' | ((a: Tag, b: Tag) => number);
|
|
23
|
+
};
|
|
17
24
|
/**
|
|
18
25
|
* Provides the sidebar state and methods to control it.
|
|
19
26
|
*/
|
|
20
|
-
export declare function useSidebar(options?: {
|
|
21
|
-
parsedSpec: Spec;
|
|
22
|
-
}): {
|
|
27
|
+
export declare function useSidebar(options?: ParsedSpecOption & TagsSorterOption): {
|
|
23
28
|
breadcrumb: import("vue").ComputedRef<string>;
|
|
24
29
|
items: import("vue").ComputedRef<{
|
|
25
30
|
entries: SidebarEntry[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAwB,MAAM,mBAAmB,CAAA;AAexE,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAkBD,uDAAuD;AACvD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAWhC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AA2OD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAA;CACpD,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,gBAAgB;;;;;;;;;;;;;EA8CvE"}
|