@scalar/api-reference 1.28.14 → 1.28.16
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.
- package/CHANGELOG.md +22 -0
- package/dist/browser/standalone.js +5125 -5093
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Introduction/Introduction.vue2.js +44 -35
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +17 -17
- package/dist/components/Content/Models/ModelsAccordion.vue.js +1 -1
- package/dist/components/Content/Models/ModelsAccordion.vue2.js +3 -3
- package/dist/components/Content/Schema/Schema.preview.d.ts +525 -0
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +60 -62
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +32 -50
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +72 -67
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +12 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +70 -0
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue2.js +12 -12
- package/dist/hooks/useSidebar.d.ts +1 -0
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +131 -119
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -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
|
|
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
|
|
6
|
+
import { getLowestHeadingLevel as q } from "../helpers/getLowestHeadingLevel.js";
|
|
7
7
|
import { hasModels as ee } from "../helpers/hasModels.js";
|
|
8
|
-
import { getModels as
|
|
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
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
var p,
|
|
15
|
-
|
|
16
|
-
const a = (
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
let
|
|
21
|
-
return
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
})),
|
|
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
|
|
27
|
-
function
|
|
28
|
-
|
|
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
|
|
31
|
-
|
|
30
|
+
function I(t, a) {
|
|
31
|
+
y[t] = a;
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
const a = se(t),
|
|
36
|
-
return a.filter((
|
|
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
|
-
|
|
39
|
-
|
|
38
|
+
d.depth === i || // second highest level, eg. ## Authentication
|
|
39
|
+
d.depth === i + 1
|
|
40
40
|
));
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
var C,
|
|
44
|
-
if (!
|
|
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:
|
|
47
|
-
let
|
|
48
|
-
|
|
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 ===
|
|
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
|
-
},
|
|
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
|
|
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:
|
|
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((
|
|
72
|
-
var
|
|
73
|
-
const h =
|
|
74
|
-
return
|
|
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:
|
|
77
|
+
httpVerb: u.httpVerb,
|
|
78
78
|
// TODO: Workaround until we’re using the store directly
|
|
79
|
-
deprecated:
|
|
80
|
-
deprecated: (
|
|
81
|
-
"x-scalar-stability": (b =
|
|
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
|
-
}) : (
|
|
89
|
+
}) : (L = n == null ? void 0 : n.operations) == null ? void 0 : L.map((e) => {
|
|
90
90
|
var h, f;
|
|
91
|
-
const o =
|
|
92
|
-
return
|
|
91
|
+
const o = i(e, n), u = e.name ?? e.path;
|
|
92
|
+
return s[o] = u, {
|
|
93
93
|
id: o,
|
|
94
|
-
title:
|
|
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
|
|
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(
|
|
112
|
-
var
|
|
111
|
+
children: Object.keys(_(c.value) ?? {}).map((e) => {
|
|
112
|
+
var u;
|
|
113
113
|
const o = a({ name: e });
|
|
114
|
-
return
|
|
114
|
+
return s[o] = e, {
|
|
115
115
|
id: o,
|
|
116
|
-
title: ((
|
|
116
|
+
title: ((u = _(c.value)) == null ? void 0 : u[e]).title ?? e,
|
|
117
117
|
show: !0
|
|
118
118
|
};
|
|
119
119
|
})
|
|
120
120
|
}
|
|
121
|
-
] : [],
|
|
121
|
+
] : [], k = te(c.value) ? [
|
|
122
122
|
{
|
|
123
123
|
id: p(),
|
|
124
124
|
title: "Webhooks",
|
|
125
125
|
show: !0,
|
|
126
|
-
children: Object.keys(((
|
|
127
|
-
var
|
|
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
|
|
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
|
|
131
|
+
var v, b, A;
|
|
132
132
|
return {
|
|
133
133
|
id: p({ name: e, method: f }),
|
|
134
|
-
title: (A = (b = (
|
|
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 =
|
|
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" &&
|
|
148
|
-
o.push(
|
|
149
|
-
else if (f === "webhooks" &&
|
|
150
|
-
o.push(
|
|
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
|
|
153
|
-
|
|
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,
|
|
163
|
-
...
|
|
164
|
-
...X ??
|
|
165
|
-
...
|
|
166
|
-
...
|
|
162
|
+
}) : void 0, H = [
|
|
163
|
+
...l,
|
|
164
|
+
...X ?? m ?? [],
|
|
165
|
+
...k,
|
|
166
|
+
...S
|
|
167
167
|
];
|
|
168
|
-
return
|
|
169
|
-
|
|
168
|
+
return K.value && H.forEach((e) => {
|
|
169
|
+
I(e.id, !0), e.show = !0;
|
|
170
170
|
}), {
|
|
171
|
-
entries:
|
|
172
|
-
titles:
|
|
171
|
+
entries: H,
|
|
172
|
+
titles: s
|
|
173
173
|
};
|
|
174
|
-
}),
|
|
175
|
-
var t, a,
|
|
176
|
-
return ((
|
|
177
|
-
}),
|
|
178
|
-
var
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
if (
|
|
182
|
-
|
|
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((
|
|
185
|
-
|
|
184
|
+
const p = Z.on((s) => {
|
|
185
|
+
s.id === t && (N(t, a), p());
|
|
186
186
|
});
|
|
187
|
-
|
|
187
|
+
I(i, !0);
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
function
|
|
191
|
-
Object.assign(
|
|
190
|
+
function we(t) {
|
|
191
|
+
Object.assign(g, t);
|
|
192
192
|
const a = $();
|
|
193
|
-
|
|
194
|
-
const { hash:
|
|
195
|
-
return t != null && t.parsedSpec && (
|
|
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
|
|
198
|
-
return (
|
|
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
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
|
|
201
|
+
var s, l;
|
|
202
|
+
if (i.value) {
|
|
203
|
+
const r = d(i.value);
|
|
204
|
+
r && I(r, !0);
|
|
205
205
|
} else {
|
|
206
|
-
const
|
|
207
|
-
|
|
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
|
-
),
|
|
210
|
+
), U(
|
|
211
211
|
() => {
|
|
212
|
-
var
|
|
213
|
-
return (
|
|
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
|
|
217
|
-
const
|
|
218
|
-
|
|
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:
|
|
226
|
-
isSidebarOpen:
|
|
227
|
-
collapsedSidebarItems:
|
|
228
|
-
toggleCollapsedSidebarItem:
|
|
229
|
-
setCollapsedSidebarItem:
|
|
230
|
-
hideModels:
|
|
231
|
-
setParsedSpec:
|
|
232
|
-
defaultOpenAllTags:
|
|
233
|
-
scrollToOperation:
|
|
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
|
-
|
|
238
|
-
|
|
248
|
+
re as DEFAULT_INTRODUCTION_SLUG,
|
|
249
|
+
ne as scrollToOperation,
|
|
250
|
+
we as useSidebar
|
|
239
251
|
};
|