@scalar/api-reference 1.24.46 → 1.24.48
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 +26 -0
- package/dist/browser/standalone.js +9215 -9242
- package/dist/browser/webpack-stats.json +1 -1
- 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/style.css +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -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"}
|
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -1,134 +1,135 @@
|
|
|
1
|
-
import { ssrState as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { useNavState as
|
|
4
|
-
import { getLowestHeadingLevel as
|
|
5
|
-
import { openClientFor as
|
|
6
|
-
import { hasModels as
|
|
7
|
-
import { getModels as
|
|
8
|
-
import { hasWebhooks as
|
|
9
|
-
import { getHeadingsFromMarkdown as
|
|
10
|
-
import { useApiClientStore as
|
|
11
|
-
import { useOpenApiStore as
|
|
1
|
+
import { ssrState as Z } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { ref as h, reactive as z, computed as J, watch as D } from "vue";
|
|
3
|
+
import { useNavState as _ } from "./useNavState.js";
|
|
4
|
+
import { getLowestHeadingLevel as K } from "../helpers/getLowestHeadingLevel.js";
|
|
5
|
+
import { openClientFor as F } from "../helpers/openClientFor.js";
|
|
6
|
+
import { hasModels as $ } from "../helpers/hasModels.js";
|
|
7
|
+
import { getModels as V } from "../helpers/getModels.js";
|
|
8
|
+
import { hasWebhooks as ee } from "../helpers/hasWebhooks.js";
|
|
9
|
+
import { getHeadingsFromMarkdown as te } from "../helpers/getHeadingsFromMarkdown.js";
|
|
10
|
+
import { useApiClientStore as se } from "../legacy/stores/useApiClientStore.js";
|
|
11
|
+
import { useOpenApiStore as oe } from "../legacy/stores/useOpenApiStore.js";
|
|
12
12
|
const {
|
|
13
|
-
getHeadingId:
|
|
14
|
-
getModelId:
|
|
15
|
-
getOperationId:
|
|
16
|
-
getSectionId:
|
|
17
|
-
getTagId:
|
|
18
|
-
getWebhookId:
|
|
19
|
-
hash:
|
|
20
|
-
} =
|
|
21
|
-
function
|
|
22
|
-
|
|
13
|
+
getHeadingId: B,
|
|
14
|
+
getModelId: P,
|
|
15
|
+
getOperationId: R,
|
|
16
|
+
getSectionId: ie,
|
|
17
|
+
getTagId: N,
|
|
18
|
+
getWebhookId: A,
|
|
19
|
+
hash: I
|
|
20
|
+
} = _(), r = h(void 0), g = z({});
|
|
21
|
+
function q(t) {
|
|
22
|
+
var s, i;
|
|
23
|
+
return g.tagsSorter === "alpha" ? t.tags = (s = t.tags) == null ? void 0 : s.sort((l, c) => l.name.localeCompare(c.name)) : typeof g.tagsSorter == "function" && (t.tags = (i = t.tags) == null ? void 0 : i.sort(g.tagsSorter)), r.value = t;
|
|
23
24
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
25
|
+
const Q = h(!1), U = h(!1), S = z(
|
|
26
|
+
Z["useSidebarContent-collapsedSidebarItems"] ?? {}
|
|
26
27
|
);
|
|
27
|
-
function
|
|
28
|
-
|
|
28
|
+
function re(t) {
|
|
29
|
+
S[t] = !S[t];
|
|
29
30
|
}
|
|
30
31
|
function b(t, s) {
|
|
31
|
-
|
|
32
|
+
S[t] = s;
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
-
const s =
|
|
35
|
-
return s.filter((
|
|
34
|
+
const C = h([]), le = async (t) => {
|
|
35
|
+
const s = te(t), i = K(s);
|
|
36
|
+
return s.filter((l) => (
|
|
36
37
|
// highest level, eg. # Introduction
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
l.depth === i || // second highest level, eg. ## Authentication
|
|
39
|
+
l.depth === i + 1
|
|
39
40
|
));
|
|
40
|
-
},
|
|
41
|
-
var
|
|
42
|
-
const { state: t } =
|
|
43
|
-
openApi: { globalSecurity:
|
|
44
|
-
} =
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
var
|
|
48
|
-
e.depth ===
|
|
49
|
-
id:
|
|
41
|
+
}, X = J(() => {
|
|
42
|
+
var O, T, y, H, M, j, x, E, G, L;
|
|
43
|
+
const { state: t } = se(), s = {}, {
|
|
44
|
+
openApi: { globalSecurity: i }
|
|
45
|
+
} = oe(), l = [];
|
|
46
|
+
let c = null;
|
|
47
|
+
C.value.forEach((e) => {
|
|
48
|
+
var o;
|
|
49
|
+
e.depth === K(C.value) ? (c = {
|
|
50
|
+
id: B(e),
|
|
50
51
|
title: e.value,
|
|
51
52
|
show: !t.showApiClient,
|
|
52
53
|
children: []
|
|
53
|
-
},
|
|
54
|
-
id:
|
|
54
|
+
}, l.push(c)) : c && ((o = c.children) == null || o.push({
|
|
55
|
+
id: B(e),
|
|
55
56
|
title: e.value,
|
|
56
57
|
show: !t.showApiClient
|
|
57
58
|
}));
|
|
58
59
|
});
|
|
59
|
-
const
|
|
60
|
-
var
|
|
61
|
-
return ((
|
|
60
|
+
const p = (T = (O = r.value) == null ? void 0 : O.tags) == null ? void 0 : T[0], f = p && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((y = r.value) == null ? void 0 : y.tags) ? (M = (H = r.value) == null ? void 0 : H.tags) == null ? void 0 : M.filter((e) => {
|
|
61
|
+
var o;
|
|
62
|
+
return ((o = e.operations) == null ? void 0 : o.length) > 0;
|
|
62
63
|
}).map((e) => {
|
|
63
|
-
var
|
|
64
|
+
var o;
|
|
64
65
|
return {
|
|
65
|
-
id:
|
|
66
|
+
id: N(e),
|
|
66
67
|
title: e.name,
|
|
67
68
|
displayTitle: e["x-displayName"] ?? e.name,
|
|
68
69
|
show: !0,
|
|
69
|
-
children: (
|
|
70
|
-
(
|
|
70
|
+
children: (o = e.operations) == null ? void 0 : o.map(
|
|
71
|
+
(a) => {
|
|
71
72
|
var d;
|
|
72
|
-
const
|
|
73
|
-
return s[
|
|
74
|
-
id:
|
|
73
|
+
const n = R(a, e), u = a.name ?? a.path;
|
|
74
|
+
return s[n] = u, {
|
|
75
|
+
id: n,
|
|
75
76
|
title: u,
|
|
76
|
-
httpVerb:
|
|
77
|
-
deprecated: ((d =
|
|
77
|
+
httpVerb: a.httpVerb,
|
|
78
|
+
deprecated: ((d = a.information) == null ? void 0 : d.deprecated) ?? !1,
|
|
78
79
|
show: !0,
|
|
79
80
|
select: () => {
|
|
80
|
-
t.showApiClient &&
|
|
81
|
+
t.showApiClient && F(a, i);
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
85
|
)
|
|
85
86
|
};
|
|
86
|
-
}) : (
|
|
87
|
-
var
|
|
88
|
-
const
|
|
89
|
-
return s[
|
|
90
|
-
id:
|
|
91
|
-
title:
|
|
87
|
+
}) : (j = p == null ? void 0 : p.operations) == null ? void 0 : j.map((e) => {
|
|
88
|
+
var n;
|
|
89
|
+
const o = R(e, p), a = e.name ?? e.path;
|
|
90
|
+
return s[o] = a, {
|
|
91
|
+
id: o,
|
|
92
|
+
title: a,
|
|
92
93
|
httpVerb: e.httpVerb,
|
|
93
|
-
deprecated: ((
|
|
94
|
+
deprecated: ((n = e.information) == null ? void 0 : n.deprecated) ?? !1,
|
|
94
95
|
show: !0,
|
|
95
96
|
select: () => {
|
|
96
|
-
t.showApiClient &&
|
|
97
|
+
t.showApiClient && F(e, i);
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
});
|
|
100
|
-
let m =
|
|
101
|
+
let m = $(r.value) && !Q.value ? [
|
|
101
102
|
{
|
|
102
|
-
id:
|
|
103
|
+
id: P(),
|
|
103
104
|
title: "Models",
|
|
104
105
|
show: !t.showApiClient,
|
|
105
|
-
children: Object.keys(
|
|
106
|
+
children: Object.keys(V(r.value) ?? {}).map(
|
|
106
107
|
(e) => {
|
|
107
|
-
var
|
|
108
|
-
const
|
|
109
|
-
return s[
|
|
110
|
-
id:
|
|
111
|
-
title: ((
|
|
108
|
+
var a;
|
|
109
|
+
const o = P(e);
|
|
110
|
+
return s[o] = e, {
|
|
111
|
+
id: o,
|
|
112
|
+
title: ((a = V(r.value)) == null ? void 0 : a[e]).title ?? e,
|
|
112
113
|
show: !t.showApiClient
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
)
|
|
116
117
|
}
|
|
117
|
-
] : [], v =
|
|
118
|
+
] : [], v = ee(r.value) ? [
|
|
118
119
|
{
|
|
119
|
-
id:
|
|
120
|
-
title: "
|
|
120
|
+
id: A(),
|
|
121
|
+
title: "Webhooks",
|
|
121
122
|
show: !t.showApiClient,
|
|
122
|
-
children: Object.keys(((x =
|
|
123
|
-
var
|
|
124
|
-
const
|
|
125
|
-
return s[
|
|
126
|
-
((
|
|
123
|
+
children: Object.keys(((x = r.value) == null ? void 0 : x.webhooks) ?? {}).map((e) => {
|
|
124
|
+
var a, n;
|
|
125
|
+
const o = A(e);
|
|
126
|
+
return s[o] = e, Object.keys(
|
|
127
|
+
((n = (a = r.value) == null ? void 0 : a.webhooks) == null ? void 0 : n[e]) ?? {}
|
|
127
128
|
).map((u) => {
|
|
128
|
-
var d, w,
|
|
129
|
+
var d, w, W;
|
|
129
130
|
return {
|
|
130
|
-
id:
|
|
131
|
-
title: (
|
|
131
|
+
id: A(e, u),
|
|
132
|
+
title: (W = (w = (d = r.value) == null ? void 0 : d.webhooks) == null ? void 0 : w[e][u]) == null ? void 0 : W.name,
|
|
132
133
|
httpVerb: u,
|
|
133
134
|
show: !t.showApiClient
|
|
134
135
|
};
|
|
@@ -136,81 +137,81 @@ const S = p([]), le = async (t) => {
|
|
|
136
137
|
}).flat()
|
|
137
138
|
}
|
|
138
139
|
] : [];
|
|
139
|
-
const
|
|
140
|
-
var
|
|
141
|
-
const
|
|
142
|
-
return (
|
|
140
|
+
const Y = (E = r.value) != null && E["x-tagGroups"] ? (L = (G = r.value) == null ? void 0 : G["x-tagGroups"]) == null ? void 0 : L.map((e) => {
|
|
141
|
+
var n;
|
|
142
|
+
const o = [];
|
|
143
|
+
return (n = e.tags) == null || n.map((u) => {
|
|
143
144
|
if (u === "models" && m.length > 0)
|
|
144
|
-
|
|
145
|
+
o.push(m[0]), m = [];
|
|
145
146
|
else if (u === "webhooks" && v.length > 0)
|
|
146
|
-
|
|
147
|
+
o.push(v[0]), v = [];
|
|
147
148
|
else {
|
|
148
149
|
const d = f == null ? void 0 : f.find(
|
|
149
150
|
(w) => w.title === u
|
|
150
151
|
);
|
|
151
|
-
d &&
|
|
152
|
+
d && o.push(d);
|
|
152
153
|
}
|
|
153
154
|
}), {
|
|
154
155
|
id: e.name,
|
|
155
156
|
title: e.name,
|
|
156
|
-
children:
|
|
157
|
+
children: o,
|
|
157
158
|
show: !0,
|
|
158
159
|
isGroup: !0
|
|
159
160
|
};
|
|
160
|
-
}) : void 0,
|
|
161
|
-
...
|
|
162
|
-
...
|
|
161
|
+
}) : void 0, k = [
|
|
162
|
+
...l,
|
|
163
|
+
...Y ?? f ?? [],
|
|
163
164
|
...v,
|
|
164
165
|
...m
|
|
165
166
|
];
|
|
166
|
-
return
|
|
167
|
+
return U.value && k.forEach((e) => {
|
|
167
168
|
b(e.id, !0), e.show = !0;
|
|
168
169
|
}), {
|
|
169
|
-
entries:
|
|
170
|
+
entries: k,
|
|
170
171
|
titles: s
|
|
171
172
|
};
|
|
172
|
-
}),
|
|
173
|
+
}), ae = h(!1), ne = J(() => {
|
|
173
174
|
var t, s;
|
|
174
|
-
return ((s = (t =
|
|
175
|
+
return ((s = (t = X.value) == null ? void 0 : t.titles) == null ? void 0 : s[I.value]) ?? "";
|
|
175
176
|
});
|
|
176
|
-
function
|
|
177
|
-
return t != null && t.parsedSpec && (
|
|
177
|
+
function Ce(t) {
|
|
178
|
+
return Object.assign(g, t), t != null && t.parsedSpec && (q(t.parsedSpec), D(
|
|
178
179
|
() => {
|
|
179
|
-
var s,
|
|
180
|
-
return (
|
|
180
|
+
var s, i;
|
|
181
|
+
return (i = (s = r.value) == null ? void 0 : s.tags) == null ? void 0 : i.length;
|
|
181
182
|
},
|
|
182
183
|
() => {
|
|
183
|
-
var s,
|
|
184
|
-
if (
|
|
185
|
-
const
|
|
186
|
-
|
|
184
|
+
var s, i;
|
|
185
|
+
if (I.value) {
|
|
186
|
+
const l = ie(I.value);
|
|
187
|
+
l && b(l, !0);
|
|
187
188
|
} else {
|
|
188
|
-
const
|
|
189
|
-
|
|
189
|
+
const l = (i = (s = r.value) == null ? void 0 : s.tags) == null ? void 0 : i[0];
|
|
190
|
+
l && b(N(l), !0);
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
|
-
),
|
|
193
|
+
), D(
|
|
193
194
|
() => {
|
|
194
|
-
var s,
|
|
195
|
-
return (
|
|
195
|
+
var s, i;
|
|
196
|
+
return (i = (s = r.value) == null ? void 0 : s.info) == null ? void 0 : i.description;
|
|
196
197
|
},
|
|
197
198
|
async () => {
|
|
198
|
-
var
|
|
199
|
-
const s = (
|
|
200
|
-
return s ?
|
|
199
|
+
var i, l;
|
|
200
|
+
const s = (l = (i = r.value) == null ? void 0 : i.info) == null ? void 0 : l.description;
|
|
201
|
+
return s ? C.value = await le(s) : C.value = [];
|
|
201
202
|
}
|
|
202
203
|
)), {
|
|
203
204
|
breadcrumb: ne,
|
|
204
|
-
items:
|
|
205
|
-
isSidebarOpen:
|
|
206
|
-
collapsedSidebarItems:
|
|
207
|
-
toggleCollapsedSidebarItem:
|
|
205
|
+
items: X,
|
|
206
|
+
isSidebarOpen: ae,
|
|
207
|
+
collapsedSidebarItems: S,
|
|
208
|
+
toggleCollapsedSidebarItem: re,
|
|
208
209
|
setCollapsedSidebarItem: b,
|
|
209
|
-
hideModels:
|
|
210
|
-
setParsedSpec:
|
|
211
|
-
defaultOpenAllTags:
|
|
210
|
+
hideModels: Q,
|
|
211
|
+
setParsedSpec: q,
|
|
212
|
+
defaultOpenAllTags: U
|
|
212
213
|
};
|
|
213
214
|
}
|
|
214
215
|
export {
|
|
215
|
-
|
|
216
|
+
Ce as useSidebar
|
|
216
217
|
};
|