@scalar/api-reference 1.28.14 → 1.28.15

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