@scalar/api-reference 1.25.62 → 1.25.63
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 +16 -0
- package/dist/browser/standalone.js +12466 -12470
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +48 -51
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EACL,KAAK,QAAQ,EAId,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBAoByB,IAAI;sBALL,IAAI;;;;
|
|
1
|
+
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EACL,KAAK,QAAQ,EAId,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBAoByB,IAAI;sBALL,IAAI;;;;EAoK5B"}
|
|
@@ -1,65 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ref as c, computed as
|
|
3
|
-
import { extractRequestBody as
|
|
4
|
-
import { useSidebar as
|
|
5
|
-
import { useOperation as
|
|
6
|
-
import { useNavState as
|
|
7
|
-
import { getHeadingsFromMarkdown as
|
|
8
|
-
import { getModels as
|
|
9
|
-
function
|
|
1
|
+
import H from "fuse.js";
|
|
2
|
+
import { ref as c, computed as N, watch as V } from "vue";
|
|
3
|
+
import { extractRequestBody as A } from "../../helpers/specHelpers.js";
|
|
4
|
+
import { useSidebar as B } from "../../hooks/useSidebar.js";
|
|
5
|
+
import { useOperation as P } from "../../hooks/useOperation.js";
|
|
6
|
+
import { useNavState as z } from "../../hooks/useNavState.js";
|
|
7
|
+
import { getHeadingsFromMarkdown as G } from "../../helpers/getHeadingsFromMarkdown.js";
|
|
8
|
+
import { getModels as J } from "../../helpers/getModels.js";
|
|
9
|
+
function te({
|
|
10
10
|
specification: a
|
|
11
11
|
}) {
|
|
12
|
-
const { getHeadingId:
|
|
12
|
+
const { getHeadingId: O, getWebhookId: R, getModelId: T, getOperationId: j, getTagId: L } = z(), { hideModels: W } = B(), o = c([]), n = c([]), h = c(0), s = c(""), d = new H(o.value, {
|
|
13
13
|
keys: ["title", "description", "body"]
|
|
14
|
-
}),
|
|
15
|
-
h.value = 0,
|
|
14
|
+
}), q = () => {
|
|
15
|
+
h.value = 0, n.value = d.search(s.value);
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
s.value = "", h.value = 0,
|
|
17
|
+
function C() {
|
|
18
|
+
s.value = "", h.value = 0, n.value = [];
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const F = N(
|
|
21
21
|
() => s.value.length === 0 ? o.value.slice(0, 25).map((r) => ({
|
|
22
22
|
item: r
|
|
23
|
-
})) :
|
|
23
|
+
})) : n.value.slice(0, 25)
|
|
24
24
|
);
|
|
25
|
-
return
|
|
25
|
+
return V(
|
|
26
26
|
a.value,
|
|
27
27
|
async () => {
|
|
28
|
-
var y, g, I,
|
|
29
|
-
|
|
30
|
-
if (o.value = [], !((g = (y = a.value) == null ? void 0 : y.tags) != null && g.length) && !((w = (I = a.value) == null ? void 0 : I.webhooks) != null && w.length)) {
|
|
28
|
+
var b, y, g, I, k, M, w, D, $;
|
|
29
|
+
if (o.value = [], !((y = (b = a.value) == null ? void 0 : b.tags) != null && y.length) && !((I = (g = a.value) == null ? void 0 : g.webhooks) != null && I.length)) {
|
|
31
30
|
d.setCollection([]);
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
34
|
-
const
|
|
35
|
-
((
|
|
33
|
+
const i = [], r = G(
|
|
34
|
+
((M = (k = a.value) == null ? void 0 : k.info) == null ? void 0 : M.description) ?? ""
|
|
36
35
|
);
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
r.length && (r.forEach((e) => {
|
|
37
|
+
i.push({
|
|
39
38
|
type: "heading",
|
|
40
39
|
title: `Info > ${e.value}`,
|
|
41
40
|
description: "",
|
|
42
|
-
href: `#${
|
|
41
|
+
href: `#${O(e)}`,
|
|
43
42
|
tag: e.slug,
|
|
44
43
|
body: ""
|
|
45
44
|
});
|
|
46
|
-
}), o.value = o.value.concat(
|
|
45
|
+
}), o.value = o.value.concat(i)), (D = (w = a.value) == null ? void 0 : w.tags) == null || D.forEach((e) => {
|
|
47
46
|
const E = {
|
|
48
47
|
title: e["x-displayName"] ?? e.name,
|
|
49
|
-
href: `#${
|
|
48
|
+
href: `#${L(e)}`,
|
|
50
49
|
description: e.description,
|
|
51
50
|
type: "tag",
|
|
52
51
|
tag: e.name,
|
|
53
52
|
body: ""
|
|
54
53
|
};
|
|
55
54
|
o.value.push(E), e.operations && e.operations.forEach((t) => {
|
|
56
|
-
const { parameterMap:
|
|
57
|
-
let
|
|
58
|
-
typeof S != "boolean" && (
|
|
59
|
-
const
|
|
55
|
+
const { parameterMap: u } = P({ operation: t }), S = A(t) || u.value;
|
|
56
|
+
let v = null;
|
|
57
|
+
typeof S != "boolean" && (v = S);
|
|
58
|
+
const x = {
|
|
60
59
|
type: "req",
|
|
61
60
|
title: t.name ?? t.path,
|
|
62
|
-
href: `#${
|
|
61
|
+
href: `#${j(t, e)}`,
|
|
63
62
|
operationId: t.operationId,
|
|
64
63
|
description: t.description ?? "",
|
|
65
64
|
httpVerb: t.httpVerb,
|
|
@@ -67,49 +66,47 @@ function ae({
|
|
|
67
66
|
tag: e.name,
|
|
68
67
|
operation: t
|
|
69
68
|
};
|
|
70
|
-
|
|
69
|
+
v && (x.body = v), o.value.push(x);
|
|
71
70
|
});
|
|
72
71
|
});
|
|
73
|
-
const l = (
|
|
72
|
+
const l = ($ = a.value) == null ? void 0 : $.webhooks, f = [];
|
|
74
73
|
l && Object.keys(l).forEach((e) => {
|
|
75
74
|
Object.keys(
|
|
76
75
|
l[e]
|
|
77
76
|
).forEach((t) => {
|
|
78
|
-
var
|
|
79
|
-
|
|
77
|
+
var u;
|
|
78
|
+
f.push({
|
|
80
79
|
type: "webhook",
|
|
81
|
-
title: `Webhook: ${(
|
|
82
|
-
href: `#${
|
|
80
|
+
title: `Webhook: ${(u = l[e][t]) == null ? void 0 : u.name}`,
|
|
81
|
+
href: `#${R(e, t)}`,
|
|
83
82
|
description: e,
|
|
84
83
|
httpVerb: t,
|
|
85
84
|
tag: e,
|
|
86
85
|
body: ""
|
|
87
86
|
});
|
|
88
|
-
}), o.value = o.value.concat(
|
|
87
|
+
}), o.value = o.value.concat(f);
|
|
89
88
|
});
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
const p = W.value ? {} : J(a.value), m = [];
|
|
90
|
+
p && (Object.keys(p).forEach((e) => {
|
|
91
|
+
m.push({
|
|
93
92
|
type: "model",
|
|
94
93
|
title: "Model",
|
|
95
|
-
href: `#${
|
|
96
|
-
description:
|
|
94
|
+
href: `#${T(e)}`,
|
|
95
|
+
description: p[e].title ?? e,
|
|
97
96
|
tag: e,
|
|
98
97
|
body: ""
|
|
99
98
|
});
|
|
100
|
-
}), o.value = o.value.concat(
|
|
101
|
-
const N = performance.now();
|
|
102
|
-
console.log(`create-search-index: ${Math.round(N - f)} ms`);
|
|
99
|
+
}), o.value = o.value.concat(m)), d.setCollection(o.value);
|
|
103
100
|
},
|
|
104
101
|
{ immediate: !0 }
|
|
105
102
|
), {
|
|
106
|
-
resetSearch:
|
|
107
|
-
fuseSearch:
|
|
103
|
+
resetSearch: C,
|
|
104
|
+
fuseSearch: q,
|
|
108
105
|
selectedSearchResult: h,
|
|
109
|
-
searchResultsWithPlaceholderResults:
|
|
106
|
+
searchResultsWithPlaceholderResults: F,
|
|
110
107
|
searchText: s
|
|
111
108
|
};
|
|
112
109
|
}
|
|
113
110
|
export {
|
|
114
|
-
|
|
111
|
+
te as useSearchIndex
|
|
115
112
|
};
|