@scalar/api-reference 1.25.104 → 1.25.106

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