@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.
Files changed (30) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/browser/standalone.js +9215 -9242
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  6. package/dist/components/ApiReferenceLayout.vue2.js +24 -21
  7. package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Operation/OperationAccordion.vue.js +2 -2
  9. package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
  10. package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
  11. package/dist/components/Content/Operation/TestRequestButton.vue2.js +9 -9
  12. package/dist/components/SearchButton.vue.d.ts.map +1 -1
  13. package/dist/components/SearchButton.vue.js +2 -2
  14. package/dist/components/SearchButton.vue2.js +10 -9
  15. package/dist/components/SearchModal.vue.js +2 -2
  16. package/dist/components/SearchModal.vue2.js +36 -36
  17. package/dist/components/Sidebar/Sidebar.vue.d.ts +3 -2
  18. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  19. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  20. package/dist/components/Sidebar/Sidebar.vue2.js +29 -27
  21. package/dist/helpers/getModels.d.ts.map +1 -1
  22. package/dist/helpers/getModels.js +13 -7
  23. package/dist/hooks/useSidebar.d.ts +9 -4
  24. package/dist/hooks/useSidebar.d.ts.map +1 -1
  25. package/dist/hooks/useSidebar.js +123 -122
  26. package/dist/index.js +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/types.d.ts +5 -0
  29. package/dist/types.d.ts.map +1 -1
  30. package/package.json +5 -5
@@ -1,18 +1,20 @@
1
- import { defineComponent as B, ref as E, watch as N, onMounted as I, openBlock as l, createElementBlock as a, renderSlot as g, createElementVNode as V, createVNode as F, withCtx as u, Fragment as d, renderList as h, unref as i, toDisplayString as L, createBlock as f, createCommentVNode as b } from "vue";
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 w } from "../../helpers/sleep.js";
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(C) {
13
- const A = C, { hash: o, isIntersectionEnabled: $ } = x(), { items: O, toggleCollapsedSidebarItem: S, collapsedSidebarItems: T } = G(
13
+ setup(A) {
14
+ const S = A, { hash: o, isIntersectionEnabled: $ } = x(), { items: O, toggleCollapsedSidebarItem: T, collapsedSidebarItems: g } = G(
14
15
  {
15
- parsedSpec: A.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 I(() => {
30
+ return F(() => {
29
31
  setTimeout(() => k(o.value), 500), c.value = !1;
30
32
  }), (p, n) => (l(), a("div", D, [
31
- g(p.$slots, "sidebar-start", {}, void 0, !0),
32
- V("div", {
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
- F(m, { level: 0 }, {
38
- default: u(() => [
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
- V("li", H, L(e.displayTitle ?? e.title), 1),
44
- (l(!0), a(d, null, h(e.children, (t) => (l(), f(v, {
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(T)[t.id] ?? !1,
59
+ open: i(g)[t.id] ?? !1,
58
60
  onToggleOpen: async () => {
59
- c.value = !0, i(S)(t.id), await i(w)(100), c.value = !1;
61
+ c.value = !0, i(T)(t.id), await i(C)(100), c.value = !1;
60
62
  }
61
63
  }, {
62
- default: u(() => {
64
+ default: f(() => {
63
65
  var r;
64
66
  return [
65
- t.children && ((r = t.children) == null ? void 0 : r.length) > 0 ? (l(), f(m, {
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: u(() => [
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(), f(v, {
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(), f(v, {
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(T)[e.id] ?? !1,
109
+ open: i(g)[e.id] ?? !1,
108
110
  onToggleOpen: async () => {
109
- c.value = !0, i(S)(e.id), await i(w)(100), c.value = !1;
111
+ c.value = !0, i(T)(e.id), await i(C)(100), c.value = !1;
110
112
  }
111
113
  }, {
112
- default: u(() => {
114
+ default: f(() => {
113
115
  var t;
114
116
  return [
115
- e.children && ((t = e.children) == null ? void 0 : t.length) > 0 ? (l(), f(m, {
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: u(() => [
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(), f(v, {
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
- g(p.$slots, "sidebar-end", {}, void 0, !0)
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,mHAoBpC"}
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 i(n) {
2
- var t, o;
3
- return n ? (
1
+ function l(t) {
2
+ var o, i;
3
+ if (!t)
4
+ return {};
5
+ const n = (
4
6
  // OpenAPI 3.x
5
- Object.keys(((t = n == null ? void 0 : n.components) == null ? void 0 : t.schemas) ?? {}).length ? (o = n == null ? void 0 : n.components) == null ? void 0 : o.schemas : (
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((n == null ? void 0 : n.definitions) ?? {}).length ? n == null ? void 0 : n.definitions : (
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
- i as getModels
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,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"}
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"}
@@ -1,134 +1,135 @@
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";
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: 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
- return o.value = t;
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 K = p(!1), N = p(!1), g = X(
25
- U["useSidebarContent-collapsedSidebarItems"] ?? {}
25
+ const Q = h(!1), U = h(!1), S = z(
26
+ Z["useSidebarContent-collapsedSidebarItems"] ?? {}
26
27
  );
27
- function oe(t) {
28
- g[t] = !g[t];
28
+ function re(t) {
29
+ S[t] = !S[t];
29
30
  }
30
31
  function b(t, s) {
31
- g[t] = s;
32
+ S[t] = s;
32
33
  }
33
- const S = p([]), le = async (t) => {
34
- const s = await $(t), l = z(s);
35
- return s.filter((n) => (
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
- n.depth === l || // second highest level, eg. ## Authentication
38
- n.depth === l + 1
38
+ l.depth === i || // second highest level, eg. ## Authentication
39
+ l.depth === i + 1
39
40
  ));
40
- }, Q = q(() => {
41
- var k, O, T, y, H, M, x, E, j, G;
42
- const { state: t } = ee(), s = {}, {
43
- openApi: { globalSecurity: l }
44
- } = te(), n = [];
45
- let h = null;
46
- S.value.forEach((e) => {
47
- var i;
48
- e.depth === z(S.value) ? (h = {
49
- id: V(e),
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
- }, n.push(h)) : h && ((i = h.children) == null || i.push({
54
- id: V(e),
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 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
- var i;
61
- return ((i = e.operations) == null ? void 0 : i.length) > 0;
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 i;
64
+ var o;
64
65
  return {
65
- id: J(e),
66
+ id: N(e),
66
67
  title: e.name,
67
68
  displayTitle: e["x-displayName"] ?? e.name,
68
69
  show: !0,
69
- children: (i = e.operations) == null ? void 0 : i.map(
70
- (r) => {
70
+ children: (o = e.operations) == null ? void 0 : o.map(
71
+ (a) => {
71
72
  var d;
72
- const a = P(r, e), u = r.name ?? r.path;
73
- return s[a] = u, {
74
- id: a,
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: r.httpVerb,
77
- deprecated: ((d = r.information) == null ? void 0 : d.deprecated) ?? !1,
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 && D(r, l);
81
+ t.showApiClient && F(a, i);
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
- var a;
88
- const i = P(e, c), r = e.name ?? e.path;
89
- return s[i] = r, {
90
- id: i,
91
- title: r,
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: ((a = e.information) == null ? void 0 : a.deprecated) ?? !1,
94
+ deprecated: ((n = e.information) == null ? void 0 : n.deprecated) ?? !1,
94
95
  show: !0,
95
96
  select: () => {
96
- t.showApiClient && D(e, l);
97
+ t.showApiClient && F(e, i);
97
98
  }
98
99
  };
99
100
  });
100
- let m = Z(o.value) && !K.value ? [
101
+ let m = $(r.value) && !Q.value ? [
101
102
  {
102
- id: B(),
103
+ id: P(),
103
104
  title: "Models",
104
105
  show: !t.showApiClient,
105
- children: Object.keys(F(o.value) ?? {}).map(
106
+ children: Object.keys(V(r.value) ?? {}).map(
106
107
  (e) => {
107
- var r;
108
- const i = B(e);
109
- return s[i] = e, {
110
- id: i,
111
- title: ((r = F(o.value)) == null ? void 0 : r[e]).title ?? e,
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 = _(o.value) ? [
118
+ ] : [], v = ee(r.value) ? [
118
119
  {
119
- id: C(),
120
- title: "Webhook",
120
+ id: A(),
121
+ title: "Webhooks",
121
122
  show: !t.showApiClient,
122
- children: Object.keys(((x = o.value) == null ? void 0 : x.webhooks) ?? {}).map((e) => {
123
- var r, a;
124
- const i = C(e);
125
- return s[i] = e, Object.keys(
126
- ((a = (r = o.value) == null ? void 0 : r.webhooks) == null ? void 0 : a[e]) ?? {}
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, L;
129
+ var d, w, W;
129
130
  return {
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,
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 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
- var a;
141
- const i = [];
142
- return (a = e.tags) == null || a.map((u) => {
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
- i.push(m[0]), m = [];
145
+ o.push(m[0]), m = [];
145
146
  else if (u === "webhooks" && v.length > 0)
146
- i.push(v[0]), v = [];
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 && i.push(d);
152
+ d && o.push(d);
152
153
  }
153
154
  }), {
154
155
  id: e.name,
155
156
  title: e.name,
156
- children: i,
157
+ children: o,
157
158
  show: !0,
158
159
  isGroup: !0
159
160
  };
160
- }) : void 0, I = [
161
- ...n,
162
- ...R ?? f ?? [],
161
+ }) : void 0, k = [
162
+ ...l,
163
+ ...Y ?? f ?? [],
163
164
  ...v,
164
165
  ...m
165
166
  ];
166
- return N.value && I.forEach((e) => {
167
+ return U.value && k.forEach((e) => {
167
168
  b(e.id, !0), e.show = !0;
168
169
  }), {
169
- entries: I,
170
+ entries: k,
170
171
  titles: s
171
172
  };
172
- }), re = p(!1), ne = q(() => {
173
+ }), ae = h(!1), ne = J(() => {
173
174
  var t, s;
174
- return ((s = (t = Q.value) == null ? void 0 : t.titles) == null ? void 0 : s[A.value]) ?? "";
175
+ return ((s = (t = X.value) == null ? void 0 : t.titles) == null ? void 0 : s[I.value]) ?? "";
175
176
  });
176
- function Se(t) {
177
- return t != null && t.parsedSpec && (o.value = t.parsedSpec, W(
177
+ function Ce(t) {
178
+ return Object.assign(g, t), t != null && t.parsedSpec && (q(t.parsedSpec), D(
178
179
  () => {
179
- var s, l;
180
- return (l = (s = o.value) == null ? void 0 : s.tags) == null ? void 0 : l.length;
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, l;
184
- if (A.value) {
185
- const n = se(A.value);
186
- n && b(n, !0);
184
+ var s, i;
185
+ if (I.value) {
186
+ const l = ie(I.value);
187
+ l && b(l, !0);
187
188
  } else {
188
- const n = (l = (s = o.value) == null ? void 0 : s.tags) == null ? void 0 : l[0];
189
- n && b(J(n), !0);
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
- ), W(
193
+ ), D(
193
194
  () => {
194
- var s, l;
195
- return (l = (s = o.value) == null ? void 0 : s.info) == null ? void 0 : l.description;
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 l, n;
199
- const s = (n = (l = o.value) == null ? void 0 : l.info) == null ? void 0 : n.description;
200
- return s ? S.value = await le(s) : S.value = [];
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: Q,
205
- isSidebarOpen: re,
206
- collapsedSidebarItems: g,
207
- toggleCollapsedSidebarItem: oe,
205
+ items: X,
206
+ isSidebarOpen: ae,
207
+ collapsedSidebarItems: S,
208
+ toggleCollapsedSidebarItem: re,
208
209
  setCollapsedSidebarItem: b,
209
- hideModels: K,
210
- setParsedSpec: ie,
211
- defaultOpenAllTags: N
210
+ hideModels: Q,
211
+ setParsedSpec: q,
212
+ defaultOpenAllTags: U
212
213
  };
213
214
  }
214
215
  export {
215
- Se as useSidebar
216
+ Ce as useSidebar
216
217
  };