@scalar/api-reference 1.31.11 → 1.31.14
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 +12820 -11753
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.js +3 -3
- 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 +27 -26
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +73 -73
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +12 -14
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +97 -73
- package/dist/helpers/parse.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -15
- package/dist/libs/openapi.js +24 -24
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +8 -7
- package/package.json +10 -10
|
@@ -1,78 +1,102 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ref as
|
|
3
|
-
import { useNavState as
|
|
4
|
-
import { useOperation as
|
|
5
|
-
import { getHeadingsFromMarkdown as
|
|
6
|
-
import { extractRequestBody as
|
|
7
|
-
import { useConfig as
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import A from "fuse.js";
|
|
2
|
+
import { ref as m, watch as T, computed as k } from "vue";
|
|
3
|
+
import { useNavState as B } from "../../hooks/useNavState.js";
|
|
4
|
+
import { useOperation as O } from "../../hooks/useOperation.js";
|
|
5
|
+
import { getHeadingsFromMarkdown as P } from "../../libs/markdown.js";
|
|
6
|
+
import { extractRequestBody as j, getModels as z } from "../../libs/openapi.js";
|
|
7
|
+
import { useConfig as G } from "../../hooks/useConfig.js";
|
|
8
|
+
import { isHttpMethod as J } from "@scalar/helpers/http/is-http-method";
|
|
9
|
+
function w({
|
|
10
|
+
specification: q
|
|
10
11
|
}) {
|
|
11
|
-
const { getHeadingId:
|
|
12
|
+
const { getHeadingId: H, getModelId: L, getTagId: C } = B(), F = G(), a = m([]), d = m([]), i = m(), l = m(""), y = new A(a.value, {
|
|
12
13
|
keys: ["title", "description", "body"]
|
|
13
|
-
}),
|
|
14
|
-
|
|
14
|
+
}), b = () => {
|
|
15
|
+
i.value = 0, d.value = y.search(l.value);
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
e.length ?
|
|
17
|
+
T(l, (e) => {
|
|
18
|
+
e.length ? b() : d.value = [];
|
|
18
19
|
});
|
|
19
|
-
function
|
|
20
|
-
|
|
20
|
+
function N() {
|
|
21
|
+
l.value = "", i.value = void 0, d.value = [];
|
|
21
22
|
}
|
|
22
|
-
const
|
|
23
|
-
item:
|
|
24
|
-
})) :
|
|
25
|
-
() => typeof
|
|
23
|
+
const g = k(() => l.value.length === 0 ? a.value.slice(0, 25).map((f) => ({
|
|
24
|
+
item: f
|
|
25
|
+
})) : d.value.slice(0, 25)), W = k(
|
|
26
|
+
() => typeof i.value == "number" ? g.value[i.value] : void 0
|
|
26
27
|
);
|
|
27
|
-
return
|
|
28
|
-
|
|
28
|
+
return T(
|
|
29
|
+
q,
|
|
29
30
|
(e) => {
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const i = [], m = A(((p = e == null ? void 0 : e.info) == null ? void 0 : p.description) ?? "");
|
|
36
|
-
m.length && (m.forEach((t) => {
|
|
37
|
-
i.push({
|
|
31
|
+
var E, x, V;
|
|
32
|
+
a.value = [];
|
|
33
|
+
const f = [], I = P(((E = e == null ? void 0 : e.info) == null ? void 0 : E.description) ?? "");
|
|
34
|
+
if (I.length && (I.forEach((t) => {
|
|
35
|
+
f.push({
|
|
38
36
|
type: "heading",
|
|
39
37
|
title: `Info > ${t.value}`,
|
|
40
38
|
description: "",
|
|
41
|
-
href: `#${
|
|
39
|
+
href: `#${H(t)}`,
|
|
42
40
|
tag: t.slug,
|
|
43
41
|
body: ""
|
|
44
42
|
});
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
body: ""
|
|
53
|
-
};
|
|
54
|
-
o.value.push(H), t.operations && t.operations.forEach((a) => {
|
|
55
|
-
var x;
|
|
56
|
-
const { parameterMap: N } = j(a), D = B(a) || N.value;
|
|
57
|
-
let n = null;
|
|
58
|
-
typeof D != "boolean" && (n = D);
|
|
59
|
-
const $ = {
|
|
60
|
-
type: "req",
|
|
61
|
-
title: a.name ?? a.path,
|
|
62
|
-
href: `#${a.id}`,
|
|
63
|
-
operationId: (x = a.information) == null ? void 0 : x.operationId,
|
|
64
|
-
description: a.description ?? "",
|
|
65
|
-
httpVerb: a.httpVerb,
|
|
66
|
-
path: a.path,
|
|
43
|
+
}), a.value = a.value.concat(f)), (x = e == null ? void 0 : e.tags) != null && x.length)
|
|
44
|
+
(V = e == null ? void 0 : e.tags) == null || V.forEach((t) => {
|
|
45
|
+
const h = {
|
|
46
|
+
title: t["x-displayName"] ?? t.name,
|
|
47
|
+
href: `#${C(t)}`,
|
|
48
|
+
description: t.description,
|
|
49
|
+
type: "tag",
|
|
67
50
|
tag: t.name,
|
|
68
|
-
|
|
51
|
+
body: ""
|
|
69
52
|
};
|
|
70
|
-
|
|
53
|
+
a.value.push(h), t.operations && t.operations.forEach((s) => {
|
|
54
|
+
var n;
|
|
55
|
+
const { parameterMap: o } = O(s), u = j(s) || o.value;
|
|
56
|
+
let r = null;
|
|
57
|
+
typeof u != "boolean" && (r = u);
|
|
58
|
+
const c = {
|
|
59
|
+
type: "req",
|
|
60
|
+
title: s.name ?? s.path,
|
|
61
|
+
href: `#${s.id}`,
|
|
62
|
+
operationId: (n = s.information) == null ? void 0 : n.operationId,
|
|
63
|
+
description: s.description ?? "",
|
|
64
|
+
httpVerb: s.httpVerb,
|
|
65
|
+
path: s.path,
|
|
66
|
+
tag: t.name,
|
|
67
|
+
operation: s
|
|
68
|
+
};
|
|
69
|
+
r && (c.body = r), a.value.push(c);
|
|
70
|
+
});
|
|
71
71
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
else if (e != null && e.paths) {
|
|
73
|
+
const t = e.paths;
|
|
74
|
+
Object.keys(t ?? {}).forEach((h) => {
|
|
75
|
+
Object.keys((t == null ? void 0 : t[h]) ?? {}).forEach((s) => {
|
|
76
|
+
var u, r;
|
|
77
|
+
const o = (u = t == null ? void 0 : t[h]) == null ? void 0 : u[s];
|
|
78
|
+
if (J(s) && o) {
|
|
79
|
+
const { parameterMap: c } = O({ ...o, information: o }), n = j(o) || c.value;
|
|
80
|
+
let p = null;
|
|
81
|
+
typeof n != "boolean" && (p = n);
|
|
82
|
+
const R = {
|
|
83
|
+
type: "req",
|
|
84
|
+
title: o.name ?? o.path,
|
|
85
|
+
href: `#${o.id}`,
|
|
86
|
+
operationId: (r = o.information) == null ? void 0 : r.operationId,
|
|
87
|
+
description: o.description ?? "",
|
|
88
|
+
httpVerb: o.httpVerb,
|
|
89
|
+
path: o.path,
|
|
90
|
+
operation: o
|
|
91
|
+
};
|
|
92
|
+
p && (R.body = p), a.value.push(R);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const M = e == null ? void 0 : e.webhooks, D = [];
|
|
98
|
+
M && M.forEach((t) => {
|
|
99
|
+
D.push({
|
|
76
100
|
type: "webhook",
|
|
77
101
|
title: "Webhook",
|
|
78
102
|
href: `#${t.id}`,
|
|
@@ -80,30 +104,30 @@ function Z({
|
|
|
80
104
|
httpVerb: t.httpVerb,
|
|
81
105
|
tag: t.name,
|
|
82
106
|
body: ""
|
|
83
|
-
}),
|
|
107
|
+
}), a.value = a.value.concat(D);
|
|
84
108
|
});
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
109
|
+
const v = F.value.hideModels ? {} : z(e), $ = [];
|
|
110
|
+
v && (Object.keys(v).forEach((t) => {
|
|
111
|
+
$.push({
|
|
88
112
|
type: "model",
|
|
89
113
|
title: "Model",
|
|
90
|
-
href: `#${
|
|
91
|
-
description:
|
|
114
|
+
href: `#${L({ name: t })}`,
|
|
115
|
+
description: v[t].title ?? t,
|
|
92
116
|
tag: t,
|
|
93
117
|
body: ""
|
|
94
118
|
});
|
|
95
|
-
}),
|
|
119
|
+
}), a.value = a.value.concat($)), y.setCollection(a.value);
|
|
96
120
|
},
|
|
97
121
|
{ immediate: !0 }
|
|
98
122
|
), {
|
|
99
|
-
resetSearch:
|
|
100
|
-
fuseSearch:
|
|
101
|
-
selectedSearchIndex:
|
|
102
|
-
selectedSearchResult:
|
|
103
|
-
searchResultsWithPlaceholderResults:
|
|
104
|
-
searchText:
|
|
123
|
+
resetSearch: N,
|
|
124
|
+
fuseSearch: b,
|
|
125
|
+
selectedSearchIndex: i,
|
|
126
|
+
selectedSearchResult: W,
|
|
127
|
+
searchResultsWithPlaceholderResults: g,
|
|
128
|
+
searchText: l
|
|
105
129
|
};
|
|
106
130
|
}
|
|
107
131
|
export {
|
|
108
|
-
|
|
132
|
+
w as useSearchIndex
|
|
109
133
|
};
|
package/dist/helpers/parse.js
CHANGED
|
@@ -58,7 +58,7 @@ const I = (s, i) => new Promise((e, b) => {
|
|
|
58
58
|
pathParameters: (r = (a = e.paths) == null ? void 0 : a[o.path ?? ""]) == null ? void 0 : r.parameters
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
"tag" in o && o.isGroup && ((f = o.children) != null && f.length)
|
|
61
|
+
"tag" in o && o.isGroup && ((f = o.children) != null && f.length) ? o.children.forEach(p) : "tag" in o && p(o), "isWebhooks" in o && o.isWebhooks && ((u = o.children) != null && u.length) && o.children.forEach((t) => {
|
|
62
62
|
var n, g;
|
|
63
63
|
"webhook" in t && t.name && t.method && b.push({
|
|
64
64
|
id: t.id,
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { SearchButton, SearchModal } from './features/Search';
|
|
|
4
4
|
export { default as GettingStarted } from './components/GettingStarted.vue.js';
|
|
5
5
|
export { createApiReference } from './standalone/lib/html-api.js';
|
|
6
6
|
export { Sidebar } from './components/Sidebar';
|
|
7
|
+
export { useSidebar } from './features/sidebar';
|
|
7
8
|
export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } from './components/Card';
|
|
8
9
|
export { parse } from './helpers/parse.js';
|
|
9
10
|
export { createEmptySpecification } from './libs/openapi.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAGrG,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBA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