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