@scalar/api-reference 1.25.47 → 1.25.49

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