@scalar/api-reference 1.24.42 → 1.24.44
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/browser/standalone.js +9323 -9320
- 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 +67 -66
- package/dist/hooks/useSidebar.d.ts +1 -0
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +101 -98
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAsjBA,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkgBjB,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"}
|
|
@@ -2,7 +2,7 @@ import o from "./ApiReferenceLayout.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-cb23ee71"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideUseId as
|
|
3
|
-
import { addScalarClassesToHeadless as
|
|
1
|
+
import { defineComponent as X, ref as h, onMounted as B, onBeforeMount as D, computed as b, watch as Z, onServerPrefetch as _, useSSRContext as x, getCurrentInstance as ee, provide as F, openBlock as v, createElementBlock as S, Fragment as M, createElementVNode as i, normalizeClass as oe, unref as u, normalizeStyle as te, renderSlot as l, normalizeProps as d, guardReactiveProps as c, createVNode as f, withCtx as m, createCommentVNode as w, withDirectives as re, vShow as ae, createSlots as ne } from "vue";
|
|
2
|
+
import { provideUseId as se } from "@headlessui/vue";
|
|
3
|
+
import { addScalarClassesToHeadless as ie } from "@scalar/components";
|
|
4
4
|
import { defaultStateFactory as P } from "@scalar/oas-utils/helpers";
|
|
5
|
-
import { getThemeStyles as
|
|
6
|
-
import { useToasts as
|
|
7
|
-
import { useMediaQuery as
|
|
8
|
-
import
|
|
5
|
+
import { getThemeStyles as le } from "@scalar/themes";
|
|
6
|
+
import { useToasts as de, ScalarToasts as ce } from "@scalar/use-toasts";
|
|
7
|
+
import { useMediaQuery as ue, useResizeObserver as pe, useDebounceFn as fe } from "@vueuse/core";
|
|
8
|
+
import me from "./ApiClientModal.vue.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
import { downloadSpecBus as
|
|
12
|
-
import { useDeprecationWarnings as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { GLOBAL_SECURITY_SYMBOL as
|
|
16
|
-
import { useSidebar as
|
|
17
|
-
import { useNavState as
|
|
18
|
-
import { scrollToId as
|
|
19
|
-
import { sleep as
|
|
20
|
-
const
|
|
10
|
+
import ge from "./GettingStarted.vue.js";
|
|
11
|
+
import { downloadSpecBus as ve, downloadSpecFile as Se } from "../helpers/specDownloads.js";
|
|
12
|
+
import { useDeprecationWarnings as he } from "../hooks/useDeprecationWarnings.js";
|
|
13
|
+
import be from "./Sidebar/Sidebar.vue.js";
|
|
14
|
+
import we from "./Content/Content.vue.js";
|
|
15
|
+
import { GLOBAL_SECURITY_SYMBOL as ye, HIDE_DOWNLOAD_BUTTON_SYMBOL as Te } from "../helpers/provideSymbols.js";
|
|
16
|
+
import { useSidebar as Re } from "../hooks/useSidebar.js";
|
|
17
|
+
import { useNavState as $e } from "../hooks/useNavState.js";
|
|
18
|
+
import { scrollToId as Ce } from "../helpers/scrollToId.js";
|
|
19
|
+
import { sleep as Ie } from "../helpers/sleep.js";
|
|
20
|
+
const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "references-navigation t-doc__sidebar"
|
|
23
|
-
},
|
|
23
|
+
}, Oe = { class: "references-navigation-list" }, Be = { class: "references-editor" }, De = { class: "references-editor-textarea" }, Fe = { class: "references-rendered" }, Me = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "references-footer"
|
|
26
|
-
},
|
|
26
|
+
}, eo = /* @__PURE__ */ X({
|
|
27
27
|
inheritAttrs: !1,
|
|
28
28
|
__name: "ApiReferenceLayout",
|
|
29
29
|
props: {
|
|
@@ -33,19 +33,19 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
|
|
|
33
33
|
},
|
|
34
34
|
emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
|
|
35
35
|
setup(U) {
|
|
36
|
-
const t = U, { initializeToasts: A, toast: H } =
|
|
36
|
+
const t = U, { initializeToasts: A, toast: H } = de();
|
|
37
37
|
A((e) => H(e));
|
|
38
|
-
const N =
|
|
39
|
-
|
|
38
|
+
const N = ue("(min-width: 1150px)"), z = h("100dvh"), p = h(null);
|
|
39
|
+
pe(p, (e) => {
|
|
40
40
|
z.value = e[0].contentRect.height + "px";
|
|
41
41
|
});
|
|
42
42
|
const y = h(0);
|
|
43
|
-
|
|
43
|
+
B(() => {
|
|
44
44
|
var a, r, n;
|
|
45
45
|
const e = (r = (a = p.value) == null ? void 0 : a.parentElement) == null ? void 0 : r.getBoundingClientRect(), o = (n = p.value) == null ? void 0 : n.getBoundingClientRect();
|
|
46
46
|
if (e && o) {
|
|
47
|
-
const
|
|
48
|
-
y.value =
|
|
47
|
+
const O = o.top - e.top;
|
|
48
|
+
y.value = O < 2 ? 0 : O;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
const {
|
|
@@ -54,29 +54,30 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
|
|
|
54
54
|
isSidebarOpen: V,
|
|
55
55
|
setCollapsedSidebarItem: T,
|
|
56
56
|
hideModels: G,
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
defaultOpenAllTags: W,
|
|
58
|
+
setParsedSpec: j
|
|
59
|
+
} = Re(), {
|
|
59
60
|
getPathRoutingId: R,
|
|
60
|
-
getSectionId:
|
|
61
|
-
getTagId:
|
|
61
|
+
getSectionId: K,
|
|
62
|
+
getTagId: Q,
|
|
62
63
|
hash: $,
|
|
63
64
|
isIntersectionEnabled: C,
|
|
64
65
|
pathRouting: I,
|
|
65
66
|
updateHash: L
|
|
66
|
-
} =
|
|
67
|
-
I.value = t.configuration.pathRouting,
|
|
67
|
+
} = $e();
|
|
68
|
+
I.value = t.configuration.pathRouting, D(() => L());
|
|
68
69
|
const E = async (e) => {
|
|
69
70
|
var o;
|
|
70
|
-
C.value = !1, L(), e ?
|
|
71
|
+
C.value = !1, L(), e ? Ce(e) : (o = p.value) == null || o.scrollTo(0, 0), await Ie(100), C.value = !0;
|
|
71
72
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
D(() => ie()), B(() => {
|
|
74
|
+
ve.on(({ specTitle: e }) => {
|
|
75
|
+
Se(t.rawSpec, e);
|
|
75
76
|
}), window.onhashchange = () => E(decodeURIComponent(window.location.hash.replace(/^#/, ""))), window.onpopstate = () => I.value && E(R(window.location.pathname));
|
|
76
77
|
});
|
|
77
|
-
const
|
|
78
|
+
const q = b(
|
|
78
79
|
() => N.value || !t.configuration.isEditable
|
|
79
|
-
), k =
|
|
80
|
+
), k = fe((e) => {
|
|
80
81
|
if ((e.target.scrollTop ?? 0) < 50) {
|
|
81
82
|
const a = t.configuration.pathRouting ? t.configuration.pathRouting.basePath : window.location.pathname;
|
|
82
83
|
window.history.replaceState({}, "", a + window.location.search), $.value = "";
|
|
@@ -85,46 +86,46 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
|
|
|
85
86
|
breadcrumb: Y.value,
|
|
86
87
|
spec: t.parsedSpec
|
|
87
88
|
}));
|
|
88
|
-
|
|
89
|
+
Z(() => t.parsedSpec, j, { deep: !0 }), _(() => {
|
|
89
90
|
var o, a;
|
|
90
|
-
const e =
|
|
91
|
+
const e = x();
|
|
91
92
|
if (e && (e.payload || (e.payload = { data: P() }), (o = e.payload).data || (o.data = P()), t.configuration.pathRouting)) {
|
|
92
93
|
const r = R(e.url);
|
|
93
94
|
$.value = r, e.payload.data.hash = r;
|
|
94
95
|
for (const n in g)
|
|
95
96
|
Object.hasOwn(g, n) && delete g[n];
|
|
96
97
|
if (r)
|
|
97
|
-
T(
|
|
98
|
+
T(K(r), !0);
|
|
98
99
|
else {
|
|
99
100
|
const n = (a = t.parsedSpec.tags) == null ? void 0 : a[0];
|
|
100
|
-
n && T(
|
|
101
|
+
n && T(Q(n), !0);
|
|
101
102
|
}
|
|
102
103
|
e.payload.data["useSidebarContent-collapsedSidebarItems"] = g;
|
|
103
104
|
}
|
|
104
|
-
}),
|
|
105
|
+
}), se(() => {
|
|
105
106
|
var r;
|
|
106
|
-
const e =
|
|
107
|
+
const e = ee(), o = "scalar-instance-id";
|
|
107
108
|
if (!e) return o;
|
|
108
109
|
let a = e.uid;
|
|
109
110
|
return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[o] = a) : (r = e.vnode.el) != null && r.getAttribute && (a = e.vnode.el.getAttribute(o)), `${o}-${a}`;
|
|
110
|
-
}),
|
|
111
|
-
|
|
111
|
+
}), F(ye, () => t.parsedSpec.security), F(
|
|
112
|
+
Te,
|
|
112
113
|
() => t.configuration.hideDownloadButton
|
|
113
|
-
), G.value = t.configuration.hideModels ?? !1,
|
|
114
|
-
const
|
|
114
|
+
), G.value = t.configuration.hideModels ?? !1, W.value = t.configuration.defaultOpenAllTags ?? !1, he(t.configuration);
|
|
115
|
+
const J = b(
|
|
115
116
|
() => `<style>
|
|
116
|
-
${
|
|
117
|
+
${le(t.configuration.theme, {
|
|
117
118
|
fonts: t.configuration.withDefaultFonts
|
|
118
119
|
})}</style>`
|
|
119
120
|
);
|
|
120
121
|
return (e, o) => {
|
|
121
122
|
var a;
|
|
122
|
-
return v(), S(
|
|
123
|
-
i("div", { innerHTML:
|
|
123
|
+
return v(), S(M, null, [
|
|
124
|
+
i("div", { innerHTML: J.value }, null, 8, Le),
|
|
124
125
|
i("div", {
|
|
125
126
|
ref_key: "documentEl",
|
|
126
127
|
ref: p,
|
|
127
|
-
class:
|
|
128
|
+
class: oe(["scalar-app scalar-api-reference references-layout", [
|
|
128
129
|
{
|
|
129
130
|
"references-editable": e.configuration.isEditable,
|
|
130
131
|
"references-sidebar": e.configuration.showSidebar,
|
|
@@ -133,18 +134,18 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
|
|
|
133
134
|
},
|
|
134
135
|
e.$attrs.class
|
|
135
136
|
]]),
|
|
136
|
-
style:
|
|
137
|
+
style: te({
|
|
137
138
|
"--scalar-y-offset": `var(--scalar-custom-header-height, ${y.value}px)`
|
|
138
139
|
}),
|
|
139
140
|
onScrollPassive: o[4] || (o[4] = //@ts-ignore
|
|
140
141
|
(...r) => u(k) && u(k)(...r))
|
|
141
142
|
}, [
|
|
142
|
-
i("div",
|
|
143
|
+
i("div", Ee, [
|
|
143
144
|
l(e.$slots, "header", d(c(s.value)), void 0, !0)
|
|
144
145
|
]),
|
|
145
|
-
e.configuration.showSidebar ? (v(), S("aside",
|
|
146
|
-
i("div",
|
|
147
|
-
f(u(
|
|
146
|
+
e.configuration.showSidebar ? (v(), S("aside", ke, [
|
|
147
|
+
i("div", Oe, [
|
|
148
|
+
f(u(be), { parsedSpec: e.parsedSpec }, {
|
|
148
149
|
"sidebar-start": m(() => [
|
|
149
150
|
l(e.$slots, "sidebar-start", d(c(s.value)), void 0, !0)
|
|
150
151
|
]),
|
|
@@ -155,22 +156,22 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
|
|
|
155
156
|
}, 8, ["parsedSpec"])
|
|
156
157
|
])
|
|
157
158
|
])) : w("", !0),
|
|
158
|
-
|
|
159
|
+
re(i("div", Be, [
|
|
159
160
|
i("div", De, [
|
|
160
161
|
l(e.$slots, "editor", d(c(s.value)), void 0, !0)
|
|
161
162
|
])
|
|
162
163
|
], 512), [
|
|
163
|
-
[
|
|
164
|
+
[ae, e.configuration.isEditable]
|
|
164
165
|
]),
|
|
165
|
-
|
|
166
|
+
q.value ? (v(), S(M, { key: 1 }, [
|
|
166
167
|
i("div", Fe, [
|
|
167
|
-
f(u(
|
|
168
|
+
f(u(we), {
|
|
168
169
|
baseServerURL: e.configuration.baseServerURL,
|
|
169
170
|
layout: e.configuration.layout === "classic" ? "accordion" : "default",
|
|
170
171
|
parsedSpec: e.parsedSpec,
|
|
171
172
|
proxy: e.configuration.proxy,
|
|
172
173
|
servers: e.configuration.servers
|
|
173
|
-
},
|
|
174
|
+
}, ne({
|
|
174
175
|
start: m(() => [
|
|
175
176
|
l(e.$slots, "content-start", d(c(s.value)), void 0, !0)
|
|
176
177
|
]),
|
|
@@ -184,7 +185,7 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
|
|
|
184
185
|
fn: m(() => {
|
|
185
186
|
var r;
|
|
186
187
|
return [
|
|
187
|
-
f(
|
|
188
|
+
f(ge, {
|
|
188
189
|
theme: ((r = e.configuration) == null ? void 0 : r.theme) || "default",
|
|
189
190
|
onChangeTheme: o[0] || (o[0] = (n) => e.$emit("changeTheme", n)),
|
|
190
191
|
onLinkSwaggerFile: o[1] || (o[1] = (n) => e.$emit("linkSwaggerFile")),
|
|
@@ -201,16 +202,16 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
|
|
|
201
202
|
l(e.$slots, "footer", d(c(s.value)), void 0, !0)
|
|
202
203
|
])) : w("", !0)
|
|
203
204
|
], 64)) : w("", !0),
|
|
204
|
-
f(
|
|
205
|
+
f(me, {
|
|
205
206
|
proxyUrl: e.configuration.proxy,
|
|
206
207
|
spec: e.configuration.spec
|
|
207
208
|
}, null, 8, ["proxyUrl", "spec"])
|
|
208
209
|
], 38),
|
|
209
|
-
f(u(
|
|
210
|
+
f(u(ce))
|
|
210
211
|
], 64);
|
|
211
212
|
};
|
|
212
213
|
}
|
|
213
214
|
});
|
|
214
215
|
export {
|
|
215
|
-
|
|
216
|
+
eo as default
|
|
216
217
|
};
|
|
@@ -31,6 +31,7 @@ export declare function useSidebar(options?: {
|
|
|
31
31
|
setCollapsedSidebarItem: typeof setCollapsedSidebarItem;
|
|
32
32
|
hideModels: import("vue").Ref<boolean>;
|
|
33
33
|
setParsedSpec: typeof setParsedSpec;
|
|
34
|
+
defaultOpenAllTags: import("vue").Ref<boolean>;
|
|
34
35
|
};
|
|
35
36
|
export {};
|
|
36
37
|
//# sourceMappingURL=useSidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA6B,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;AAeD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAEhC;
|
|
1
|
+
{"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA6B,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;AAeD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAEhC;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;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE;;;;;;;;;;;;;EA4CxD"}
|
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
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 U } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { ref as p, reactive as X, computed as q, watch as W } from "vue";
|
|
3
|
+
import { useNavState as Y } from "./useNavState.js";
|
|
4
|
+
import { getLowestHeadingLevel as z } from "../helpers/getLowestHeadingLevel.js";
|
|
5
|
+
import { openClientFor as D } from "../helpers/openClientFor.js";
|
|
6
|
+
import { hasModels as Z } from "../helpers/hasModels.js";
|
|
7
|
+
import { getModels as F } from "../helpers/getModels.js";
|
|
8
|
+
import { hasWebhooks as _ } from "../helpers/hasWebhooks.js";
|
|
9
|
+
import { getHeadingsFromMarkdown as $ } from "../helpers/getHeadingsFromMarkdown.js";
|
|
10
|
+
import { useApiClientStore as ee } from "../legacy/stores/useApiClientStore.js";
|
|
11
|
+
import { useOpenApiStore as te } 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
|
|
13
|
+
getHeadingId: V,
|
|
14
|
+
getModelId: B,
|
|
15
|
+
getOperationId: P,
|
|
16
|
+
getSectionId: se,
|
|
17
|
+
getTagId: J,
|
|
18
|
+
getWebhookId: C,
|
|
19
|
+
hash: A
|
|
20
|
+
} = Y(), o = p(void 0);
|
|
21
|
+
function ie(t) {
|
|
22
22
|
return o.value = t;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const K = p(!1), N = p(!1), g = X(
|
|
25
|
+
U["useSidebarContent-collapsedSidebarItems"] ?? {}
|
|
26
26
|
);
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
function oe(t) {
|
|
28
|
+
g[t] = !g[t];
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
30
|
+
function b(t, s) {
|
|
31
|
+
g[t] = s;
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
const s = await
|
|
33
|
+
const S = p([]), le = async (t) => {
|
|
34
|
+
const s = await $(t), l = z(s);
|
|
35
35
|
return s.filter((n) => (
|
|
36
36
|
// highest level, eg. # Introduction
|
|
37
37
|
n.depth === l || // second highest level, eg. ## Authentication
|
|
38
38
|
n.depth === l + 1
|
|
39
39
|
));
|
|
40
|
-
},
|
|
41
|
-
var k,
|
|
42
|
-
const { state: t } =
|
|
40
|
+
}, Q = q(() => {
|
|
41
|
+
var k, O, T, y, H, M, x, E, j, G;
|
|
42
|
+
const { state: t } = ee(), s = {}, {
|
|
43
43
|
openApi: { globalSecurity: l }
|
|
44
|
-
} =
|
|
45
|
-
let
|
|
46
|
-
|
|
44
|
+
} = te(), n = [];
|
|
45
|
+
let h = null;
|
|
46
|
+
S.value.forEach((e) => {
|
|
47
47
|
var i;
|
|
48
|
-
e.depth ===
|
|
49
|
-
id:
|
|
48
|
+
e.depth === z(S.value) ? (h = {
|
|
49
|
+
id: V(e),
|
|
50
50
|
title: e.value,
|
|
51
51
|
show: !t.showApiClient,
|
|
52
52
|
children: []
|
|
53
|
-
}, n.push(
|
|
54
|
-
id:
|
|
53
|
+
}, n.push(h)) : h && ((i = h.children) == null || i.push({
|
|
54
|
+
id: V(e),
|
|
55
55
|
title: e.value,
|
|
56
56
|
show: !t.showApiClient
|
|
57
57
|
}));
|
|
58
58
|
});
|
|
59
|
-
const c = (
|
|
59
|
+
const c = (O = (k = o.value) == null ? void 0 : k.tags) == null ? void 0 : O[0], f = c && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((T = o.value) == null ? void 0 : T.tags) ? (H = (y = o.value) == null ? void 0 : y.tags) == null ? void 0 : H.filter((e) => {
|
|
60
60
|
var i;
|
|
61
61
|
return ((i = e.operations) == null ? void 0 : i.length) > 0;
|
|
62
62
|
}).map((e) => {
|
|
63
63
|
var i;
|
|
64
64
|
return {
|
|
65
|
-
id:
|
|
65
|
+
id: J(e),
|
|
66
66
|
title: e.name,
|
|
67
67
|
displayTitle: e["x-displayName"] ?? e.name,
|
|
68
68
|
show: !0,
|
|
69
69
|
children: (i = e.operations) == null ? void 0 : i.map(
|
|
70
70
|
(r) => {
|
|
71
|
-
var
|
|
72
|
-
const a =
|
|
73
|
-
return s[a] =
|
|
71
|
+
var d;
|
|
72
|
+
const a = P(r, e), u = r.name ?? r.path;
|
|
73
|
+
return s[a] = u, {
|
|
74
74
|
id: a,
|
|
75
|
-
title:
|
|
75
|
+
title: u,
|
|
76
76
|
httpVerb: r.httpVerb,
|
|
77
|
-
deprecated: ((
|
|
77
|
+
deprecated: ((d = r.information) == null ? void 0 : d.deprecated) ?? !1,
|
|
78
78
|
show: !0,
|
|
79
79
|
select: () => {
|
|
80
|
-
t.showApiClient &&
|
|
80
|
+
t.showApiClient && D(r, l);
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
85
|
};
|
|
86
|
-
}) : (
|
|
86
|
+
}) : (M = c == null ? void 0 : c.operations) == null ? void 0 : M.map((e) => {
|
|
87
87
|
var a;
|
|
88
|
-
const i =
|
|
88
|
+
const i = P(e, c), r = e.name ?? e.path;
|
|
89
89
|
return s[i] = r, {
|
|
90
90
|
id: i,
|
|
91
91
|
title: r,
|
|
@@ -93,62 +93,62 @@ const b = g([]), ie = async (t) => {
|
|
|
93
93
|
deprecated: ((a = e.information) == null ? void 0 : a.deprecated) ?? !1,
|
|
94
94
|
show: !0,
|
|
95
95
|
select: () => {
|
|
96
|
-
t.showApiClient &&
|
|
96
|
+
t.showApiClient && D(e, l);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
});
|
|
100
|
-
let
|
|
100
|
+
let m = Z(o.value) && !K.value ? [
|
|
101
101
|
{
|
|
102
|
-
id:
|
|
102
|
+
id: B(),
|
|
103
103
|
title: "Models",
|
|
104
104
|
show: !t.showApiClient,
|
|
105
|
-
children: Object.keys(
|
|
105
|
+
children: Object.keys(F(o.value) ?? {}).map(
|
|
106
106
|
(e) => {
|
|
107
107
|
var r;
|
|
108
|
-
const i =
|
|
108
|
+
const i = B(e);
|
|
109
109
|
return s[i] = e, {
|
|
110
110
|
id: i,
|
|
111
|
-
title: ((r =
|
|
111
|
+
title: ((r = F(o.value)) == null ? void 0 : r[e]).title ?? e,
|
|
112
112
|
show: !t.showApiClient
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
}
|
|
117
|
-
] : [],
|
|
117
|
+
] : [], v = _(o.value) ? [
|
|
118
118
|
{
|
|
119
|
-
id:
|
|
119
|
+
id: C(),
|
|
120
120
|
title: "Webhook",
|
|
121
121
|
show: !t.showApiClient,
|
|
122
|
-
children: Object.keys(((
|
|
122
|
+
children: Object.keys(((x = o.value) == null ? void 0 : x.webhooks) ?? {}).map((e) => {
|
|
123
123
|
var r, a;
|
|
124
|
-
const i =
|
|
124
|
+
const i = C(e);
|
|
125
125
|
return s[i] = e, Object.keys(
|
|
126
126
|
((a = (r = o.value) == null ? void 0 : r.webhooks) == null ? void 0 : a[e]) ?? {}
|
|
127
|
-
).map((
|
|
128
|
-
var
|
|
127
|
+
).map((u) => {
|
|
128
|
+
var d, w, L;
|
|
129
129
|
return {
|
|
130
|
-
id:
|
|
131
|
-
title: (
|
|
132
|
-
httpVerb:
|
|
130
|
+
id: C(e, u),
|
|
131
|
+
title: (L = (w = (d = o.value) == null ? void 0 : d.webhooks) == null ? void 0 : w[e][u]) == null ? void 0 : L.name,
|
|
132
|
+
httpVerb: u,
|
|
133
133
|
show: !t.showApiClient
|
|
134
134
|
};
|
|
135
135
|
});
|
|
136
136
|
}).flat()
|
|
137
137
|
}
|
|
138
138
|
] : [];
|
|
139
|
-
const
|
|
139
|
+
const R = (E = o.value) != null && E["x-tagGroups"] ? (G = (j = o.value) == null ? void 0 : j["x-tagGroups"]) == null ? void 0 : G.map((e) => {
|
|
140
140
|
var a;
|
|
141
141
|
const i = [];
|
|
142
|
-
return (a = e.tags) == null || a.map((
|
|
143
|
-
if (
|
|
144
|
-
i.push(f[0]), f = [];
|
|
145
|
-
else if (d === "webhooks" && m.length > 0)
|
|
142
|
+
return (a = e.tags) == null || a.map((u) => {
|
|
143
|
+
if (u === "models" && m.length > 0)
|
|
146
144
|
i.push(m[0]), m = [];
|
|
145
|
+
else if (u === "webhooks" && v.length > 0)
|
|
146
|
+
i.push(v[0]), v = [];
|
|
147
147
|
else {
|
|
148
|
-
const
|
|
149
|
-
(
|
|
148
|
+
const d = f == null ? void 0 : f.find(
|
|
149
|
+
(w) => w.title === u
|
|
150
150
|
);
|
|
151
|
-
|
|
151
|
+
d && i.push(d);
|
|
152
152
|
}
|
|
153
153
|
}), {
|
|
154
154
|
id: e.name,
|
|
@@ -157,37 +157,39 @@ const b = g([]), ie = async (t) => {
|
|
|
157
157
|
show: !0,
|
|
158
158
|
isGroup: !0
|
|
159
159
|
};
|
|
160
|
-
}) : void 0
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
160
|
+
}) : void 0, I = [
|
|
161
|
+
...n,
|
|
162
|
+
...R ?? f ?? [],
|
|
163
|
+
...v,
|
|
164
|
+
...m
|
|
165
|
+
];
|
|
166
|
+
return N.value && I.forEach((e) => {
|
|
167
|
+
b(e.id, !0), e.show = !0;
|
|
168
|
+
}), {
|
|
169
|
+
entries: I,
|
|
168
170
|
titles: s
|
|
169
171
|
};
|
|
170
|
-
}),
|
|
172
|
+
}), re = p(!1), ne = q(() => {
|
|
171
173
|
var t, s;
|
|
172
|
-
return ((s = (t =
|
|
174
|
+
return ((s = (t = Q.value) == null ? void 0 : t.titles) == null ? void 0 : s[A.value]) ?? "";
|
|
173
175
|
});
|
|
174
|
-
function
|
|
175
|
-
return t != null && t.parsedSpec && (o.value = t.parsedSpec,
|
|
176
|
+
function Se(t) {
|
|
177
|
+
return t != null && t.parsedSpec && (o.value = t.parsedSpec, W(
|
|
176
178
|
() => {
|
|
177
179
|
var s, l;
|
|
178
180
|
return (l = (s = o.value) == null ? void 0 : s.tags) == null ? void 0 : l.length;
|
|
179
181
|
},
|
|
180
182
|
() => {
|
|
181
183
|
var s, l;
|
|
182
|
-
if (
|
|
183
|
-
const n =
|
|
184
|
-
n &&
|
|
184
|
+
if (A.value) {
|
|
185
|
+
const n = se(A.value);
|
|
186
|
+
n && b(n, !0);
|
|
185
187
|
} else {
|
|
186
188
|
const n = (l = (s = o.value) == null ? void 0 : s.tags) == null ? void 0 : l[0];
|
|
187
|
-
n &&
|
|
189
|
+
n && b(J(n), !0);
|
|
188
190
|
}
|
|
189
191
|
}
|
|
190
|
-
),
|
|
192
|
+
), W(
|
|
191
193
|
() => {
|
|
192
194
|
var s, l;
|
|
193
195
|
return (l = (s = o.value) == null ? void 0 : s.info) == null ? void 0 : l.description;
|
|
@@ -195,19 +197,20 @@ function be(t) {
|
|
|
195
197
|
async () => {
|
|
196
198
|
var l, n;
|
|
197
199
|
const s = (n = (l = o.value) == null ? void 0 : l.info) == null ? void 0 : n.description;
|
|
198
|
-
return s ?
|
|
200
|
+
return s ? S.value = await le(s) : S.value = [];
|
|
199
201
|
}
|
|
200
202
|
)), {
|
|
201
|
-
breadcrumb:
|
|
202
|
-
items:
|
|
203
|
-
isSidebarOpen:
|
|
204
|
-
collapsedSidebarItems:
|
|
205
|
-
toggleCollapsedSidebarItem:
|
|
206
|
-
setCollapsedSidebarItem:
|
|
207
|
-
hideModels:
|
|
208
|
-
setParsedSpec:
|
|
203
|
+
breadcrumb: ne,
|
|
204
|
+
items: Q,
|
|
205
|
+
isSidebarOpen: re,
|
|
206
|
+
collapsedSidebarItems: g,
|
|
207
|
+
toggleCollapsedSidebarItem: oe,
|
|
208
|
+
setCollapsedSidebarItem: b,
|
|
209
|
+
hideModels: K,
|
|
210
|
+
setParsedSpec: ie,
|
|
211
|
+
defaultOpenAllTags: N
|
|
209
212
|
};
|
|
210
213
|
}
|
|
211
214
|
export {
|
|
212
|
-
|
|
215
|
+
Se as useSidebar
|
|
213
216
|
};
|