@scalar/api-reference 1.25.106 → 1.25.109

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