@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.
- package/CHANGELOG.md +54 -0
- package/dist/browser/standalone.js +7981 -7915
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +45 -42
- package/dist/components/Content/Lazy/Loading.vue.js +15 -15
- package/dist/components/Content/Tag/{Endpoints.vue.d.ts → OperationsList.vue.d.ts} +1 -3
- package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -0
- package/dist/components/Content/Tag/OperationsList.vue.js +7 -0
- package/dist/components/Content/Tag/OperationsList.vue2.js +62 -0
- package/dist/components/Content/Tag/OperationsListItem.vue.d.ts +9 -0
- package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -0
- package/dist/components/Content/Tag/OperationsListItem.vue.js +7 -0
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +66 -0
- package/dist/components/Content/Tag/Tag.vue.d.ts +4 -64
- package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/Tag.vue.js +87 -5
- package/dist/components/Content/Tag/Tag.vue2.js +2 -63
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +11 -11
- package/dist/components/Content/Tag/TagSection.vue.d.ts +70 -0
- package/dist/components/Content/Tag/TagSection.vue.d.ts.map +1 -0
- package/dist/components/Content/Tag/TagSection.vue.js +7 -0
- package/dist/components/Content/Tag/TagSection.vue2.js +65 -0
- package/dist/components/Content/Tag/index.d.ts +1 -2
- package/dist/components/Content/Tag/index.d.ts.map +1 -1
- package/dist/features/ApiClientModal/useApiClient.d.ts +30 -10
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +31 -30
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +54 -54
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +65 -67
- package/dist/features/TestRequestButton/TestRequestButton.vue.js +2 -2
- package/dist/features/TestRequestButton/TestRequestButton.vue2.js +16 -14
- package/dist/helpers/get-request.d.ts +1 -0
- package/dist/helpers/get-request.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useConfig.d.ts +3 -3
- package/dist/hooks/useConfig.d.ts.map +1 -1
- package/dist/hooks/useConfig.js +7 -4
- package/dist/hooks/useNavState.js +38 -38
- package/dist/hooks/useReactiveSpec.d.ts +8 -8
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +126 -116
- package/dist/index.js +55 -59
- package/dist/libs/operation.d.ts +15 -0
- package/dist/libs/operation.d.ts.map +1 -0
- package/dist/libs/operation.js +16 -0
- package/dist/stores/useHttpClientStore.d.ts +1 -1
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -14
- package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +0 -1
- package/dist/components/Content/Tag/Endpoints.vue.js +0 -7
- package/dist/components/Content/Tag/Endpoints.vue2.js +0 -161
- package/dist/helpers/operation.d.ts +0 -14
- package/dist/helpers/operation.d.ts.map +0 -1
- package/dist/helpers/operation.js +0 -18
- package/dist/standalone/lib/html-rendering.d.ts +0 -50
- package/dist/standalone/lib/html-rendering.d.ts.map +0 -1
- package/dist/standalone/lib/html-rendering.js +0 -64
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isOperationDeprecated as F } from "../
|
|
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 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
|
|
12
|
+
const y = S(null), n = S(void 0), v = q({});
|
|
13
13
|
function _(t) {
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
},
|
|
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
|
|
22
|
-
var
|
|
23
|
-
s.operations = (
|
|
24
|
-
})),
|
|
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 =
|
|
27
|
-
function
|
|
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
|
|
31
|
-
T[t] =
|
|
30
|
+
function w(t, o) {
|
|
31
|
+
T[t] = o;
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
return
|
|
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 ===
|
|
39
|
-
d.depth ===
|
|
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,
|
|
44
|
-
if (!
|
|
45
|
-
const { getHeadingId: t, getModelId:
|
|
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
|
-
|
|
48
|
-
var
|
|
49
|
-
e.depth === K(
|
|
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
|
-
},
|
|
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
|
|
61
|
-
var
|
|
62
|
-
return ((
|
|
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
|
|
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: (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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 =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
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(
|
|
105
|
+
let I = ee(n.value) && !N.value ? [
|
|
96
106
|
{
|
|
97
|
-
id:
|
|
107
|
+
id: o(),
|
|
98
108
|
title: "Models",
|
|
99
109
|
show: !0,
|
|
100
|
-
children: Object.keys(P(
|
|
101
|
-
var
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
id:
|
|
105
|
-
title: ((
|
|
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(
|
|
120
|
+
] : [], O = te(n.value) ? [
|
|
111
121
|
{
|
|
112
|
-
id:
|
|
122
|
+
id: p(),
|
|
113
123
|
title: "Webhooks",
|
|
114
124
|
show: !0,
|
|
115
|
-
children: Object.keys(((D =
|
|
116
|
-
var
|
|
117
|
-
const
|
|
118
|
-
return
|
|
119
|
-
(
|
|
120
|
-
var
|
|
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:
|
|
123
|
-
title: (A = (
|
|
124
|
-
httpVerb:
|
|
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
|
-
})
|
|
139
|
+
})
|
|
130
140
|
}
|
|
131
141
|
] : [];
|
|
132
|
-
const X = (G =
|
|
133
|
-
var
|
|
134
|
-
const
|
|
135
|
-
return (
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
else if (
|
|
139
|
-
|
|
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
|
|
142
|
-
|
|
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:
|
|
157
|
+
children: r,
|
|
148
158
|
show: !0,
|
|
149
159
|
isGroup: !0
|
|
150
160
|
};
|
|
151
|
-
}) : void 0,
|
|
152
|
-
...
|
|
153
|
-
...X ??
|
|
161
|
+
}) : void 0, M = [
|
|
162
|
+
...l,
|
|
163
|
+
...X ?? g ?? [],
|
|
154
164
|
...O,
|
|
155
165
|
...I
|
|
156
166
|
];
|
|
157
|
-
return Q.value &&
|
|
158
|
-
|
|
167
|
+
return Q.value && M.forEach((e) => {
|
|
168
|
+
w(e.id, !0), e.show = !0;
|
|
159
169
|
}), {
|
|
160
|
-
entries:
|
|
161
|
-
titles:
|
|
170
|
+
entries: M,
|
|
171
|
+
titles: a
|
|
162
172
|
};
|
|
163
|
-
}),
|
|
164
|
-
var t,
|
|
165
|
-
return ((
|
|
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
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
if (T[
|
|
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((
|
|
174
|
-
|
|
183
|
+
const d = Z.on((p) => {
|
|
184
|
+
p.id === t && (R(t), d());
|
|
175
185
|
});
|
|
176
|
-
|
|
186
|
+
w(o, !0);
|
|
177
187
|
}
|
|
178
188
|
};
|
|
179
189
|
function Se(t) {
|
|
180
|
-
Object.assign(
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
const { hash:
|
|
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
|
|
187
|
-
return (
|
|
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
|
|
191
|
-
if (
|
|
192
|
-
const s = d(
|
|
193
|
-
s &&
|
|
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 = (
|
|
196
|
-
s &&
|
|
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
|
|
202
|
-
return (
|
|
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
|
|
206
|
-
const
|
|
207
|
-
return
|
|
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:
|
|
223
|
+
breadcrumb: le,
|
|
214
224
|
items: U,
|
|
215
|
-
isSidebarOpen:
|
|
225
|
+
isSidebarOpen: ae,
|
|
216
226
|
collapsedSidebarItems: T,
|
|
217
|
-
toggleCollapsedSidebarItem:
|
|
218
|
-
setCollapsedSidebarItem:
|
|
227
|
+
toggleCollapsedSidebarItem: re,
|
|
228
|
+
setCollapsedSidebarItem: w,
|
|
219
229
|
hideModels: N,
|
|
220
230
|
setParsedSpec: _,
|
|
221
231
|
defaultOpenAllTags: Q,
|