@scalar/api-reference 1.25.128 → 1.26.0

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