@scalar/api-reference 1.24.75 → 1.24.77
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 +28 -0
- package/dist/browser/standalone.js +7450 -7448
- 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 +71 -71
- package/dist/components/Content/Lazy/Loading.vue.js +1 -1
- package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.js +1 -1
- package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue2.js +28 -22
- package/dist/components/Content/Tag/Endpoints.vue.d.ts +2 -6
- package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
- package/dist/components/Content/Tag/Endpoints.vue2.js +57 -60
- package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/Tag.vue.js +2 -2
- package/dist/components/Content/Tag/Tag.vue2.js +21 -33
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +4 -4
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +11 -10
- package/dist/hooks/useSidebar.d.ts +9 -0
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +123 -108
- package/dist/index.js +20 -19
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/dist/components/Content/Tag/mutationObserver.d.ts +0 -3
- package/dist/components/Content/Tag/mutationObserver.d.ts.map +0 -1
- package/dist/components/Content/Tag/mutationObserver.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Tag.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-33927e3b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,52 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const H = /* @__PURE__ */ b({
|
|
1
|
+
import { defineComponent as c, ref as f, computed as u, openBlock as r, createBlock as a, unref as i, withCtx as g, createCommentVNode as h, renderSlot as k } from "vue";
|
|
2
|
+
import C from "../../ShowMoreButton.vue.js";
|
|
3
|
+
import S from "./Endpoints.vue.js";
|
|
4
|
+
import y from "../../Section/SectionContainer.vue.js";
|
|
5
|
+
import { useSidebar as T } from "../../../hooks/useSidebar.js";
|
|
6
|
+
import { useNavState as v } from "../../../hooks/useNavState.js";
|
|
7
|
+
const _ = /* @__PURE__ */ c({
|
|
9
8
|
__name: "Tag",
|
|
10
9
|
props: {
|
|
11
10
|
id: {},
|
|
12
11
|
tag: {},
|
|
13
12
|
spec: {}
|
|
14
13
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
14
|
+
setup(s) {
|
|
15
|
+
const o = s, d = f(null), { collapsedSidebarItems: l } = T(), { getTagId: m } = v(), p = u(
|
|
17
16
|
() => {
|
|
18
|
-
var e,
|
|
19
|
-
return ((e =
|
|
17
|
+
var e, n, t;
|
|
18
|
+
return ((e = o.spec.tags) == null ? void 0 : e.length) !== 1 || ((n = o.tag) == null ? void 0 : n.name) !== "default" || ((t = o.tag) == null ? void 0 : t.description) !== "";
|
|
20
19
|
}
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
}, u = (e) => {
|
|
24
|
-
N(s, (o, t) => {
|
|
25
|
-
o.forEach((v) => {
|
|
26
|
-
Array.from(v.addedNodes).some((c) => c instanceof HTMLElement && c.id === e) && (d(e), t.disconnect());
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}, g = (e) => {
|
|
30
|
-
document.getElementById(e) ? d(e) : u(e);
|
|
31
|
-
};
|
|
32
|
-
return (e, o) => (r(), a(i(w), {
|
|
20
|
+
);
|
|
21
|
+
return (e, n) => (r(), a(i(y), {
|
|
33
22
|
ref_key: "sectionContainerRef",
|
|
34
|
-
ref:
|
|
23
|
+
ref: d,
|
|
35
24
|
class: "tag-section-container"
|
|
36
25
|
}, {
|
|
37
|
-
default:
|
|
26
|
+
default: g(() => {
|
|
38
27
|
var t;
|
|
39
28
|
return [
|
|
40
|
-
p.value ? (r(), a(
|
|
29
|
+
p.value ? (r(), a(S, {
|
|
41
30
|
key: 0,
|
|
42
31
|
id: e.id,
|
|
43
|
-
tag: e.tag
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
!i(l)[i(f)(e.tag)] && ((t = e.tag.operations) == null ? void 0 : t.length) > 1 ? (r(), a(T, {
|
|
32
|
+
tag: e.tag
|
|
33
|
+
}, null, 8, ["id", "tag"])) : h("", !0),
|
|
34
|
+
!i(l)[i(m)(e.tag)] && ((t = e.tag.operations) == null ? void 0 : t.length) > 1 ? (r(), a(C, {
|
|
47
35
|
key: 1,
|
|
48
36
|
id: e.id ?? ""
|
|
49
|
-
}, null, 8, ["id"])) :
|
|
37
|
+
}, null, 8, ["id"])) : k(e.$slots, "default", { key: 2 }, void 0, !0)
|
|
50
38
|
];
|
|
51
39
|
}),
|
|
52
40
|
_: 3
|
|
@@ -54,5 +42,5 @@ const H = /* @__PURE__ */ b({
|
|
|
54
42
|
}
|
|
55
43
|
});
|
|
56
44
|
export {
|
|
57
|
-
|
|
45
|
+
_ as default
|
|
58
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AAoXA,OAAO,KAAK,EACV,oBAAoB,EAGpB,oBAAoB,EACrB,MAAM,mBAAmB,CAAA;AA2P1B,iBAAS,cAAc;oBA+MM,GAAG;oBACH,GAAG;EAiC/B;AACD,QAAA,MAAM,eAAe;qBA3cF,oBAAoB,EAAE,GAAG,IAAI;eACnC,oBAAoB;;qBADd,oBAAoB,EAAE,GAAG,IAAI;eACnC,oBAAoB;aAgd/B,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
|
-
import
|
|
1
|
+
import o from "./ExampleRequest.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b5a8fcbc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as U, ref as _, watch as L, computed as y, inject as I, onServerPrefetch as M, useSSRContext as Y, openBlock as d, createBlock as b, unref as s, withCtx as c, createVNode as p, createElementBlock as
|
|
1
|
+
import { defineComponent as U, ref as _, watch as L, computed as y, inject as I, onServerPrefetch as M, useSSRContext as Y, openBlock as d, createBlock as b, unref as s, withCtx as c, createVNode as p, createElementBlock as h, Fragment as V, createTextVNode as H, toDisplayString as v, createElementVNode as O, renderSlot as j, createCommentVNode as N } from "vue";
|
|
2
2
|
import { ScalarCodeBlock as z } from "@scalar/components";
|
|
3
3
|
import { createHash as D, ssrState as Q } from "@scalar/oas-utils/helpers";
|
|
4
4
|
import { getRequestFromOperation as W } from "@scalar/oas-utils/spec-getters";
|
|
@@ -21,7 +21,7 @@ import { useServerStore as me } from "../../legacy/stores/useServerStore.js";
|
|
|
21
21
|
import { useAuthenticationStore as ue } from "../../legacy/stores/useAuthenticationStore.js";
|
|
22
22
|
import { getHarRequest as de } from "../../helpers/getHarRequest.js";
|
|
23
23
|
import { getUrlFromServerState as fe } from "../../legacy/helpers/getUrlFromServerState.js";
|
|
24
|
-
const ye = { class: "request-header" },
|
|
24
|
+
const ye = { class: "request-header" }, ge = { class: "code-snippet" }, he = {
|
|
25
25
|
key: 0,
|
|
26
26
|
class: "request-card-footer-addon"
|
|
27
27
|
}, Ue = /* @__PURE__ */ U({
|
|
@@ -40,7 +40,7 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
|
|
|
40
40
|
availableTargets: $,
|
|
41
41
|
httpTargetTitle: w,
|
|
42
42
|
httpClientTitle: F
|
|
43
|
-
} = ce(), { server: E } = me(), { authentication:
|
|
43
|
+
} = ce(), { server: E } = me(), { authentication: g } = ue(), l = _(
|
|
44
44
|
// Default to first custom example
|
|
45
45
|
(k = a.customExamples) != null && k.length ? {
|
|
46
46
|
targetKey: "customExamples",
|
|
@@ -83,7 +83,7 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
|
|
|
83
83
|
x.value
|
|
84
84
|
),
|
|
85
85
|
le(
|
|
86
|
-
|
|
86
|
+
g,
|
|
87
87
|
((u = a.operation.information) == null ? void 0 : u.security) ?? (i == null ? void 0 : i())
|
|
88
88
|
)
|
|
89
89
|
), o = n.clientKey === "undici" || n.clientKey === "fetch" || n.clientKey === "ofetch" ? n.clientKey : null, t = n.targetKey.replace("javascript", "js");
|
|
@@ -110,7 +110,7 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
|
|
|
110
110
|
e.payload.data[K] = await S();
|
|
111
111
|
}), y(() => pe({
|
|
112
112
|
serverState: E,
|
|
113
|
-
authenticationState:
|
|
113
|
+
authenticationState: g,
|
|
114
114
|
operation: a.operation,
|
|
115
115
|
globalSecurity: i == null ? void 0 : i()
|
|
116
116
|
}));
|
|
@@ -166,9 +166,9 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
|
|
|
166
166
|
default: c(() => {
|
|
167
167
|
var t;
|
|
168
168
|
return [
|
|
169
|
-
l.value.targetKey === "customExamples" ? (d(),
|
|
169
|
+
l.value.targetKey === "customExamples" ? (d(), h(V, { key: 0 }, [
|
|
170
170
|
H(v(((t = a.customExamples) == null ? void 0 : t[l.value.clientKey].label) ?? "Example"), 1)
|
|
171
|
-
], 64)) : (d(),
|
|
171
|
+
], 64)) : (d(), h(V, { key: 1 }, [
|
|
172
172
|
H(v(s(w)) + " " + v(s(F)), 1)
|
|
173
173
|
], 64))
|
|
174
174
|
];
|
|
@@ -194,10 +194,11 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
|
|
|
194
194
|
frameless: ""
|
|
195
195
|
}, {
|
|
196
196
|
default: c(() => [
|
|
197
|
-
O("div",
|
|
197
|
+
O("div", ge, [
|
|
198
198
|
p(s(z), {
|
|
199
|
+
class: "bg-b-2",
|
|
199
200
|
content: s(q),
|
|
200
|
-
hideCredentials: s(se)(s(
|
|
201
|
+
hideCredentials: s(se)(s(g)),
|
|
201
202
|
lang: A.value,
|
|
202
203
|
lineNumbers: ""
|
|
203
204
|
}, null, 8, ["content", "hideCredentials", "lang"])
|
|
@@ -213,7 +214,7 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
|
|
|
213
214
|
default: c(() => {
|
|
214
215
|
var t, r, m, u;
|
|
215
216
|
return [
|
|
216
|
-
C.value ? (d(),
|
|
217
|
+
C.value ? (d(), h("div", he, [
|
|
217
218
|
p(G, {
|
|
218
219
|
class: "request-example-selector",
|
|
219
220
|
examples: ((u = (m = (r = (t = e.operation.information) == null ? void 0 : t.requestBody) == null ? void 0 : r.content) == null ? void 0 : m["application/json"]) == null ? void 0 : u.examples) ?? [],
|
|
@@ -21,6 +21,14 @@ export type ParsedSpecOption = {
|
|
|
21
21
|
export type TagsSorterOption = {
|
|
22
22
|
tagsSorter?: 'alpha' | ((a: Tag, b: Tag) => number);
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Scroll to operation
|
|
26
|
+
*
|
|
27
|
+
* Similar to scrollToId BUT in the case of a section not being open,
|
|
28
|
+
* it uses the lazyBus to ensure the section is open before scrolling to it
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export declare const scrollToOperation: (operationId: string) => void;
|
|
24
32
|
/**
|
|
25
33
|
* Provides the sidebar state and methods to control it.
|
|
26
34
|
*/
|
|
@@ -37,6 +45,7 @@ export declare function useSidebar(options?: ParsedSpecOption & TagsSorterOption
|
|
|
37
45
|
hideModels: import("vue").Ref<boolean>;
|
|
38
46
|
setParsedSpec: typeof setParsedSpec;
|
|
39
47
|
defaultOpenAllTags: import("vue").Ref<boolean>;
|
|
48
|
+
scrollToOperation: (operationId: string) => void;
|
|
40
49
|
};
|
|
41
50
|
export {};
|
|
42
51
|
//# 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,EAAE,GAAG,EAAwB,MAAM,mBAAmB,CAAA;
|
|
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;AAiBxE,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;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,SAepD,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,gBAAgB;;;;;;;;;;;;;qCApBzB,MAAM;EAsEpD"}
|
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -1,75 +1,77 @@
|
|
|
1
|
-
import { ssrState as
|
|
2
|
-
import { ref as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { ssrState as $ } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { ref as m, reactive as J, computed as K, watch as B } from "vue";
|
|
3
|
+
import { lazyBus as ee } from "../components/Content/Lazy/lazyBus.js";
|
|
4
|
+
import { useNavState as te } from "./useNavState.js";
|
|
5
|
+
import { getLowestHeadingLevel as N } from "../helpers/getLowestHeadingLevel.js";
|
|
6
|
+
import { openClientFor as D } from "../helpers/openClientFor.js";
|
|
7
|
+
import { hasModels as se } from "../helpers/hasModels.js";
|
|
8
|
+
import { getModels as F } from "../helpers/getModels.js";
|
|
9
|
+
import { hasWebhooks as oe } from "../helpers/hasWebhooks.js";
|
|
10
|
+
import { scrollToId as V } from "../helpers/scrollToId.js";
|
|
11
|
+
import { getHeadingsFromMarkdown as ie } from "../helpers/getHeadingsFromMarkdown.js";
|
|
12
|
+
import { useApiClientStore as re } from "../legacy/stores/useApiClientStore.js";
|
|
13
|
+
import { useOpenApiStore as le } from "../legacy/stores/useOpenApiStore.js";
|
|
12
14
|
const {
|
|
13
|
-
getHeadingId:
|
|
15
|
+
getHeadingId: z,
|
|
14
16
|
getModelId: P,
|
|
15
17
|
getOperationId: R,
|
|
16
|
-
getSectionId:
|
|
17
|
-
getTagId:
|
|
18
|
+
getSectionId: Q,
|
|
19
|
+
getTagId: U,
|
|
18
20
|
getWebhookId: A,
|
|
19
|
-
hash:
|
|
20
|
-
} =
|
|
21
|
+
hash: O
|
|
22
|
+
} = te(), l = m(void 0), S = J({});
|
|
21
23
|
function q(t) {
|
|
22
|
-
var s,
|
|
23
|
-
return
|
|
24
|
+
var s, o;
|
|
25
|
+
return S.tagsSorter === "alpha" ? t.tags = (s = t.tags) == null ? void 0 : s.sort((r, c) => r.name.localeCompare(c.name)) : typeof S.tagsSorter == "function" && (t.tags = (o = t.tags) == null ? void 0 : o.sort(S.tagsSorter)), l.value = t;
|
|
24
26
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
+
const X = m(!1), Y = m(!1), f = J(
|
|
28
|
+
$["useSidebarContent-collapsedSidebarItems"] ?? {}
|
|
27
29
|
);
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
+
function ne(t) {
|
|
31
|
+
f[t] = !f[t];
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
+
function h(t, s) {
|
|
34
|
+
f[t] = s;
|
|
33
35
|
}
|
|
34
|
-
const C =
|
|
35
|
-
function
|
|
36
|
-
const s =
|
|
37
|
-
return s.filter((
|
|
36
|
+
const C = m([]);
|
|
37
|
+
function ae(t) {
|
|
38
|
+
const s = ie(t), o = N(s);
|
|
39
|
+
return s.filter((r) => (
|
|
38
40
|
// highest level, eg. # Introduction
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
r.depth === o || // second highest level, eg. ## Authentication
|
|
42
|
+
r.depth === o + 1
|
|
41
43
|
));
|
|
42
44
|
}
|
|
43
|
-
const
|
|
44
|
-
var
|
|
45
|
-
const { state: t } =
|
|
46
|
-
openApi: { globalSecurity:
|
|
47
|
-
} =
|
|
45
|
+
const Z = K(() => {
|
|
46
|
+
var T, I, y, H, M, j, x, E, G, L;
|
|
47
|
+
const { state: t } = re(), s = {}, {
|
|
48
|
+
openApi: { globalSecurity: o }
|
|
49
|
+
} = le(), r = [];
|
|
48
50
|
let c = null;
|
|
49
51
|
C.value.forEach((e) => {
|
|
50
|
-
var
|
|
51
|
-
e.depth ===
|
|
52
|
-
id:
|
|
52
|
+
var i;
|
|
53
|
+
e.depth === N(C.value) ? (c = {
|
|
54
|
+
id: z(e),
|
|
53
55
|
title: e.value,
|
|
54
56
|
show: !t.showApiClient,
|
|
55
57
|
children: []
|
|
56
|
-
},
|
|
57
|
-
id:
|
|
58
|
+
}, r.push(c)) : c && ((i = c.children) == null || i.push({
|
|
59
|
+
id: z(e),
|
|
58
60
|
title: e.value,
|
|
59
61
|
show: !t.showApiClient
|
|
60
62
|
}));
|
|
61
63
|
});
|
|
62
|
-
const p = (
|
|
63
|
-
var
|
|
64
|
-
return ((
|
|
64
|
+
const p = (I = (T = l.value) == null ? void 0 : T.tags) == null ? void 0 : I[0], v = p && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((y = l.value) == null ? void 0 : y.tags) ? (M = (H = l.value) == null ? void 0 : H.tags) == null ? void 0 : M.filter((e) => {
|
|
65
|
+
var i;
|
|
66
|
+
return ((i = e.operations) == null ? void 0 : i.length) > 0;
|
|
65
67
|
}).map((e) => {
|
|
66
|
-
var
|
|
68
|
+
var i;
|
|
67
69
|
return {
|
|
68
|
-
id:
|
|
70
|
+
id: U(e),
|
|
69
71
|
title: e.name,
|
|
70
72
|
displayTitle: e["x-displayName"] ?? e.name,
|
|
71
73
|
show: !0,
|
|
72
|
-
children: (
|
|
74
|
+
children: (i = e.operations) == null ? void 0 : i.map(
|
|
73
75
|
(n) => {
|
|
74
76
|
var d;
|
|
75
77
|
const a = R(n, e), u = n.name ?? n.path;
|
|
@@ -80,7 +82,7 @@ const X = J(() => {
|
|
|
80
82
|
deprecated: ((d = n.information) == null ? void 0 : d.deprecated) ?? !1,
|
|
81
83
|
show: !0,
|
|
82
84
|
select: () => {
|
|
83
|
-
t.showApiClient &&
|
|
85
|
+
t.showApiClient && D(n, o);
|
|
84
86
|
}
|
|
85
87
|
};
|
|
86
88
|
}
|
|
@@ -88,50 +90,50 @@ const X = J(() => {
|
|
|
88
90
|
};
|
|
89
91
|
}) : (j = p == null ? void 0 : p.operations) == null ? void 0 : j.map((e) => {
|
|
90
92
|
var a;
|
|
91
|
-
const
|
|
92
|
-
return s[
|
|
93
|
-
id:
|
|
93
|
+
const i = R(e, p), n = e.name ?? e.path;
|
|
94
|
+
return s[i] = n, {
|
|
95
|
+
id: i,
|
|
94
96
|
title: n,
|
|
95
97
|
httpVerb: e.httpVerb,
|
|
96
98
|
deprecated: ((a = e.information) == null ? void 0 : a.deprecated) ?? !1,
|
|
97
99
|
show: !0,
|
|
98
100
|
select: () => {
|
|
99
|
-
t.showApiClient &&
|
|
101
|
+
t.showApiClient && D(e, o);
|
|
100
102
|
}
|
|
101
103
|
};
|
|
102
104
|
});
|
|
103
|
-
let
|
|
105
|
+
let g = se(l.value) && !X.value ? [
|
|
104
106
|
{
|
|
105
107
|
id: P(),
|
|
106
108
|
title: "Models",
|
|
107
109
|
show: !t.showApiClient,
|
|
108
|
-
children: Object.keys(
|
|
110
|
+
children: Object.keys(F(l.value) ?? {}).map(
|
|
109
111
|
(e) => {
|
|
110
112
|
var n;
|
|
111
|
-
const
|
|
112
|
-
return s[
|
|
113
|
-
id:
|
|
114
|
-
title: ((n =
|
|
113
|
+
const i = P(e);
|
|
114
|
+
return s[i] = e, {
|
|
115
|
+
id: i,
|
|
116
|
+
title: ((n = F(l.value)) == null ? void 0 : n[e]).title ?? e,
|
|
115
117
|
show: !t.showApiClient
|
|
116
118
|
};
|
|
117
119
|
}
|
|
118
120
|
)
|
|
119
121
|
}
|
|
120
|
-
] : [],
|
|
122
|
+
] : [], w = oe(l.value) ? [
|
|
121
123
|
{
|
|
122
124
|
id: A(),
|
|
123
125
|
title: "Webhooks",
|
|
124
126
|
show: !t.showApiClient,
|
|
125
|
-
children: Object.keys(((x =
|
|
127
|
+
children: Object.keys(((x = l.value) == null ? void 0 : x.webhooks) ?? {}).map((e) => {
|
|
126
128
|
var n, a;
|
|
127
|
-
const
|
|
128
|
-
return s[
|
|
129
|
-
((a = (n =
|
|
129
|
+
const i = A(e);
|
|
130
|
+
return s[i] = e, Object.keys(
|
|
131
|
+
((a = (n = l.value) == null ? void 0 : n.webhooks) == null ? void 0 : a[e]) ?? {}
|
|
130
132
|
).map((u) => {
|
|
131
|
-
var d,
|
|
133
|
+
var d, b, W;
|
|
132
134
|
return {
|
|
133
135
|
id: A(e, u),
|
|
134
|
-
title: (W = (
|
|
136
|
+
title: (W = (b = (d = l.value) == null ? void 0 : d.webhooks) == null ? void 0 : b[e][u]) == null ? void 0 : W.name,
|
|
135
137
|
httpVerb: u,
|
|
136
138
|
show: !t.showApiClient
|
|
137
139
|
};
|
|
@@ -139,84 +141,97 @@ const X = J(() => {
|
|
|
139
141
|
}).flat()
|
|
140
142
|
}
|
|
141
143
|
] : [];
|
|
142
|
-
const
|
|
144
|
+
const _ = (E = l.value) != null && E["x-tagGroups"] ? (L = (G = l.value) == null ? void 0 : G["x-tagGroups"]) == null ? void 0 : L.map((e) => {
|
|
143
145
|
var a;
|
|
144
|
-
const
|
|
146
|
+
const i = [];
|
|
145
147
|
return (a = e.tags) == null || a.map((u) => {
|
|
146
|
-
if (u === "models" &&
|
|
147
|
-
|
|
148
|
-
else if (u === "webhooks" &&
|
|
149
|
-
|
|
148
|
+
if (u === "models" && g.length > 0)
|
|
149
|
+
i.push(g[0]), g = [];
|
|
150
|
+
else if (u === "webhooks" && w.length > 0)
|
|
151
|
+
i.push(w[0]), w = [];
|
|
150
152
|
else {
|
|
151
|
-
const d =
|
|
152
|
-
(
|
|
153
|
+
const d = v == null ? void 0 : v.find(
|
|
154
|
+
(b) => b.title === u
|
|
153
155
|
);
|
|
154
|
-
d &&
|
|
156
|
+
d && i.push(d);
|
|
155
157
|
}
|
|
156
158
|
}), {
|
|
157
159
|
id: e.name,
|
|
158
160
|
title: e.name,
|
|
159
|
-
children:
|
|
161
|
+
children: i,
|
|
160
162
|
show: !0,
|
|
161
163
|
isGroup: !0
|
|
162
164
|
};
|
|
163
165
|
}) : void 0, k = [
|
|
164
|
-
...
|
|
165
|
-
...
|
|
166
|
-
...
|
|
167
|
-
...
|
|
166
|
+
...r,
|
|
167
|
+
..._ ?? v ?? [],
|
|
168
|
+
...w,
|
|
169
|
+
...g
|
|
168
170
|
];
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
+
return Y.value && k.forEach((e) => {
|
|
172
|
+
h(e.id, !0), e.show = !0;
|
|
171
173
|
}), {
|
|
172
174
|
entries: k,
|
|
173
175
|
titles: s
|
|
174
176
|
};
|
|
175
|
-
}),
|
|
177
|
+
}), ue = m(!1), de = K(() => {
|
|
176
178
|
var t, s;
|
|
177
|
-
return ((s = (t =
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
return ((s = (t = Z.value) == null ? void 0 : t.titles) == null ? void 0 : s[O.value]) ?? "";
|
|
180
|
+
}), ce = (t) => {
|
|
181
|
+
const s = Q(t);
|
|
182
|
+
if (s !== t)
|
|
183
|
+
if (f[s])
|
|
184
|
+
V(t);
|
|
185
|
+
else {
|
|
186
|
+
const o = ee.on((r) => {
|
|
187
|
+
r.id === t && (V(t), o());
|
|
188
|
+
});
|
|
189
|
+
h(s, !0);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
function Ie(t) {
|
|
193
|
+
return Object.assign(S, t), t != null && t.parsedSpec && (q(t.parsedSpec), B(
|
|
181
194
|
() => {
|
|
182
|
-
var s,
|
|
183
|
-
return (
|
|
195
|
+
var s, o;
|
|
196
|
+
return (o = (s = l.value) == null ? void 0 : s.tags) == null ? void 0 : o.length;
|
|
184
197
|
},
|
|
185
198
|
() => {
|
|
186
|
-
var s,
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
189
|
-
|
|
199
|
+
var s, o;
|
|
200
|
+
if (O.value) {
|
|
201
|
+
const r = Q(O.value);
|
|
202
|
+
r && h(r, !0);
|
|
190
203
|
} else {
|
|
191
|
-
const
|
|
192
|
-
|
|
204
|
+
const r = (o = (s = l.value) == null ? void 0 : s.tags) == null ? void 0 : o[0];
|
|
205
|
+
r && h(U(r), !0);
|
|
193
206
|
}
|
|
194
207
|
}
|
|
195
|
-
),
|
|
208
|
+
), B(
|
|
196
209
|
() => {
|
|
197
|
-
var s,
|
|
198
|
-
return (
|
|
210
|
+
var s, o;
|
|
211
|
+
return (o = (s = l.value) == null ? void 0 : s.info) == null ? void 0 : o.description;
|
|
199
212
|
},
|
|
200
213
|
() => {
|
|
201
|
-
var
|
|
202
|
-
const s = (
|
|
203
|
-
return s ? C.value =
|
|
214
|
+
var o, r;
|
|
215
|
+
const s = (r = (o = l.value) == null ? void 0 : o.info) == null ? void 0 : r.description;
|
|
216
|
+
return s ? C.value = ae(s) : C.value = [];
|
|
204
217
|
},
|
|
205
218
|
{
|
|
206
219
|
immediate: !0
|
|
207
220
|
}
|
|
208
221
|
)), {
|
|
209
|
-
breadcrumb:
|
|
210
|
-
items:
|
|
211
|
-
isSidebarOpen:
|
|
212
|
-
collapsedSidebarItems:
|
|
213
|
-
toggleCollapsedSidebarItem:
|
|
214
|
-
setCollapsedSidebarItem:
|
|
215
|
-
hideModels:
|
|
222
|
+
breadcrumb: de,
|
|
223
|
+
items: Z,
|
|
224
|
+
isSidebarOpen: ue,
|
|
225
|
+
collapsedSidebarItems: f,
|
|
226
|
+
toggleCollapsedSidebarItem: ne,
|
|
227
|
+
setCollapsedSidebarItem: h,
|
|
228
|
+
hideModels: X,
|
|
216
229
|
setParsedSpec: q,
|
|
217
|
-
defaultOpenAllTags:
|
|
230
|
+
defaultOpenAllTags: Y,
|
|
231
|
+
scrollToOperation: ce
|
|
218
232
|
};
|
|
219
233
|
}
|
|
220
234
|
export {
|
|
221
|
-
|
|
235
|
+
ce as scrollToOperation,
|
|
236
|
+
Ie as useSidebar
|
|
222
237
|
};
|