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