@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.
- package/CHANGELOG.md +30 -0
- package/dist/browser/standalone.js +13698 -13755
- 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 +136 -137
- package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
- package/dist/components/Content/Operation/TestRequestButton.vue2.js +18 -17
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts.map +1 -1
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.js +1 -1
- package/dist/components/DarkModeToggle/DarkModeToggle.vue2.js +12 -11
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +146 -142
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +37 -35
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
- package/dist/{components → features/ApiClientModal}/ApiClientModal.vue.d.ts +3 -3
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -0
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -0
- package/dist/features/ApiClientModal/index.d.ts +3 -0
- package/dist/features/ApiClientModal/index.d.ts.map +1 -0
- package/dist/features/ApiClientModal/useApiClient.d.ts +7734 -0
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -0
- package/dist/features/ApiClientModal/useApiClient.js +23 -0
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +2 -2
- package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +10 -7
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +16 -20
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +148 -155
- package/dist/index.js +43 -45
- package/dist/legacy/components/SecurityScheme.vue.d.ts.map +1 -1
- package/dist/legacy/components/SecurityScheme.vue.js +2 -2
- package/dist/legacy/components/SecurityScheme.vue2.js +111 -115
- package/dist/legacy/components/SecuritySchemeSelector.vue.d.ts.map +1 -1
- package/dist/legacy/components/SecuritySchemeSelector.vue.js +1 -1
- package/dist/legacy/components/SecuritySchemeSelector.vue2.js +46 -36
- package/dist/legacy/helpers/index.d.ts +1 -1
- package/dist/legacy/stores/index.d.ts +1 -2
- package/dist/legacy/stores/index.d.ts.map +1 -1
- package/dist/legacy/stores/useOpenApiStore.js +4 -18
- package/dist/style.css +1 -1
- package/package.json +10 -10
- package/dist/components/ApiClientModal.vue.d.ts.map +0 -1
- package/dist/components/ApiClientModal.vue.js +0 -64
- package/dist/components/api-client-bus.d.ts +0 -22
- package/dist/components/api-client-bus.d.ts.map +0 -1
- package/dist/components/api-client-bus.js +0 -6
- package/dist/helpers/openClientFor.d.ts +0 -7
- package/dist/helpers/openClientFor.d.ts.map +0 -1
- package/dist/helpers/openClientFor.js +0 -19
- package/dist/legacy/helpers/createPlaceholderRequest.js +0 -14
- package/dist/legacy/stores/useApiClientStore.d.ts +0 -18
- package/dist/legacy/stores/useApiClientStore.d.ts.map +0 -1
- package/dist/legacy/stores/useApiClientStore.js +0 -32
- package/dist/legacy/stores/useRequestStore.js +0 -33
- /package/dist/{components → features/ApiClientModal}/ApiClientModal.vue2.js +0 -0
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -1,246 +1,239 @@
|
|
|
1
|
-
import { ssrState as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { lazyBus as
|
|
4
|
-
import { useNavState as
|
|
5
|
-
import { getLowestHeadingLevel as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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:
|
|
16
|
-
getModelId:
|
|
17
|
-
getOperationId:
|
|
18
|
-
getSectionId:
|
|
19
|
-
getTagId:
|
|
20
|
-
getWebhookId:
|
|
21
|
-
hash:
|
|
22
|
-
} =
|
|
23
|
-
function
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
}, r = (
|
|
30
|
-
let
|
|
31
|
-
return
|
|
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
|
-
|
|
34
|
-
})),
|
|
30
|
+
n.operations = (u = n.operations) == null ? void 0 : u.sort(o);
|
|
31
|
+
})), a.value = t;
|
|
35
32
|
}
|
|
36
|
-
const
|
|
37
|
-
|
|
33
|
+
const U = g(!1), X = g(!1), b = q(
|
|
34
|
+
Z["useSidebarContent-collapsedSidebarItems"] ?? {}
|
|
38
35
|
);
|
|
39
|
-
function
|
|
40
|
-
|
|
36
|
+
function oe(t) {
|
|
37
|
+
b[t] = !b[t];
|
|
41
38
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
39
|
+
function v(t, s) {
|
|
40
|
+
b[t] = s;
|
|
44
41
|
}
|
|
45
|
-
const
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
return
|
|
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
|
-
|
|
51
|
-
|
|
47
|
+
o.depth === r || // second highest level, eg. ## Authentication
|
|
48
|
+
o.depth === r + 1
|
|
52
49
|
));
|
|
53
50
|
}
|
|
54
|
-
const
|
|
55
|
-
var
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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: !
|
|
60
|
+
show: !0,
|
|
66
61
|
children: []
|
|
67
|
-
}, s.push(
|
|
68
|
-
id:
|
|
62
|
+
}, s.push(r)) : r && ((l = r.children) == null || l.push({
|
|
63
|
+
id: F(e),
|
|
69
64
|
title: e.value,
|
|
70
|
-
show: !
|
|
65
|
+
show: !0
|
|
71
66
|
}));
|
|
72
67
|
});
|
|
73
|
-
const
|
|
74
|
-
var
|
|
75
|
-
return ((
|
|
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
|
|
72
|
+
var l;
|
|
78
73
|
return {
|
|
79
|
-
id:
|
|
74
|
+
id: Q(e),
|
|
80
75
|
title: e.name,
|
|
81
76
|
displayTitle: e["x-displayName"] ?? e.name,
|
|
82
77
|
show: !0,
|
|
83
|
-
children: (
|
|
84
|
-
(
|
|
85
|
-
var
|
|
86
|
-
const c =
|
|
87
|
-
return
|
|
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:
|
|
91
|
-
deprecated: ((
|
|
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
|
-
}) : (
|
|
94
|
+
}) : (E = o == null ? void 0 : o.operations) == null ? void 0 : E.map((e) => {
|
|
101
95
|
var c;
|
|
102
|
-
const
|
|
103
|
-
return
|
|
104
|
-
id:
|
|
105
|
-
title:
|
|
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
|
|
107
|
+
let m = ee(a.value) && !U.value ? [
|
|
115
108
|
{
|
|
116
|
-
id:
|
|
109
|
+
id: z(),
|
|
117
110
|
title: "Models",
|
|
118
|
-
show: !
|
|
119
|
-
children: Object.keys(
|
|
111
|
+
show: !0,
|
|
112
|
+
children: Object.keys(A(a.value) ?? {}).map(
|
|
120
113
|
(e) => {
|
|
121
|
-
var
|
|
122
|
-
const
|
|
123
|
-
return
|
|
124
|
-
id:
|
|
125
|
-
title: ((
|
|
126
|
-
show: !
|
|
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
|
-
] : [],
|
|
124
|
+
] : [], n = te(a.value) ? [
|
|
132
125
|
{
|
|
133
|
-
id:
|
|
126
|
+
id: I(),
|
|
134
127
|
title: "Webhooks",
|
|
135
|
-
show: !
|
|
136
|
-
children: Object.keys(((
|
|
137
|
-
var
|
|
138
|
-
const
|
|
139
|
-
return
|
|
140
|
-
((c = (
|
|
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
|
|
135
|
+
var f, T, L;
|
|
143
136
|
return {
|
|
144
|
-
id:
|
|
145
|
-
title: (L = (
|
|
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: !
|
|
140
|
+
show: !0
|
|
148
141
|
};
|
|
149
142
|
});
|
|
150
143
|
}).flat()
|
|
151
144
|
}
|
|
152
145
|
] : [];
|
|
153
|
-
const
|
|
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
|
|
148
|
+
const l = [];
|
|
156
149
|
return (c = e.tags) == null || c.map((d) => {
|
|
157
|
-
if (d === "models" &&
|
|
158
|
-
|
|
159
|
-
else if (d === "webhooks" &&
|
|
160
|
-
|
|
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
|
|
163
|
-
(
|
|
155
|
+
const f = h == null ? void 0 : h.find(
|
|
156
|
+
(T) => T.title === d
|
|
164
157
|
);
|
|
165
|
-
|
|
158
|
+
f && l.push(f);
|
|
166
159
|
}
|
|
167
160
|
}), {
|
|
168
161
|
id: e.name,
|
|
169
162
|
title: e.name,
|
|
170
|
-
children:
|
|
163
|
+
children: l,
|
|
171
164
|
show: !0,
|
|
172
165
|
isGroup: !0
|
|
173
166
|
};
|
|
174
|
-
}) : void 0,
|
|
167
|
+
}) : void 0, S = [
|
|
175
168
|
...s,
|
|
176
|
-
...
|
|
177
|
-
...
|
|
178
|
-
...
|
|
169
|
+
...u ?? h ?? [],
|
|
170
|
+
...n,
|
|
171
|
+
...m
|
|
179
172
|
];
|
|
180
|
-
return
|
|
181
|
-
|
|
173
|
+
return X.value && S.forEach((e) => {
|
|
174
|
+
v(e.id, !0), e.show = !0;
|
|
182
175
|
}), {
|
|
183
|
-
entries:
|
|
184
|
-
titles:
|
|
176
|
+
entries: S,
|
|
177
|
+
titles: t
|
|
185
178
|
};
|
|
186
|
-
}),
|
|
187
|
-
var t,
|
|
188
|
-
return ((
|
|
189
|
-
}),
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
|
|
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 =
|
|
196
|
-
|
|
188
|
+
const r = _.on((o) => {
|
|
189
|
+
o.id === t && (D(t), r());
|
|
197
190
|
});
|
|
198
|
-
|
|
191
|
+
v(s, !0);
|
|
199
192
|
}
|
|
200
193
|
};
|
|
201
|
-
function
|
|
202
|
-
return Object.assign(
|
|
194
|
+
function ge(t) {
|
|
195
|
+
return Object.assign(p, t), t != null && t.parsedSpec && (R(t.parsedSpec), W(
|
|
203
196
|
() => {
|
|
204
|
-
var
|
|
205
|
-
return (r = (
|
|
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
|
|
209
|
-
if (
|
|
210
|
-
const
|
|
211
|
-
|
|
201
|
+
var s, r;
|
|
202
|
+
if (y.value) {
|
|
203
|
+
const o = N(y.value);
|
|
204
|
+
o && v(o, !0);
|
|
212
205
|
} else {
|
|
213
|
-
const
|
|
214
|
-
|
|
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
|
|
220
|
-
return (r = (
|
|
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,
|
|
224
|
-
const
|
|
225
|
-
return
|
|
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:
|
|
232
|
-
items:
|
|
233
|
-
isSidebarOpen:
|
|
234
|
-
collapsedSidebarItems:
|
|
235
|
-
toggleCollapsedSidebarItem:
|
|
236
|
-
setCollapsedSidebarItem:
|
|
237
|
-
hideModels:
|
|
238
|
-
setParsedSpec:
|
|
239
|
-
defaultOpenAllTags:
|
|
240
|
-
scrollToOperation:
|
|
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
|
-
|
|
245
|
-
|
|
237
|
+
ie as scrollToOperation,
|
|
238
|
+
ge as useSidebar
|
|
246
239
|
};
|