@scalar/api-reference 1.28.13 → 1.28.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 +16 -0
- package/dist/browser/standalone.js +7124 -7120
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Card/Card.vue.d.ts.map +1 -1
- package/dist/components/Card/Card.vue.js +7 -7
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +18 -19
- package/dist/components/Content/Lazy/Loading.vue.d.ts +8 -17
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +50 -44
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +84 -71
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +1 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +23 -20
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -1
- 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 +159 -148
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue2.js +1 -0
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/RequestBody.vue2.js +29 -26
- 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 +42 -29
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +3 -3
- package/dist/features/Search/SearchModal.vue2.js +102 -96
- package/dist/features/Search/useSearchIndex.d.ts +2 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +55 -52
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SearchModal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-05a312ab"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import { defineComponent as Y, toRef as A, ref as W, watch as
|
|
2
|
-
import { ScalarModal as Z, ScalarSearchInput as
|
|
3
|
-
import { nanoid as
|
|
1
|
+
import { defineComponent as Y, toRef as A, ref as W, watch as x, openBlock as h, createBlock as $, unref as s, withCtx as l, createElementVNode as n, createVNode as g, isRef as j, withKeys as b, withModifiers as R, createTextVNode as d, toDisplayString as c, createElementBlock as y, Fragment as E, renderList as G, createSlots as J, normalizeClass as Q, createCommentVNode as X } from "vue";
|
|
2
|
+
import { ScalarModal as Z, ScalarSearchInput as _, ScalarSearchResultList as ee, ScalarSearchResultItem as te } from "@scalar/components";
|
|
3
|
+
import { nanoid as oe } from "nanoid";
|
|
4
4
|
import { lazyBus as ae } from "../../components/Content/Lazy/lazyBus.js";
|
|
5
|
-
import
|
|
6
|
-
import { useSearchIndex as
|
|
7
|
-
import { useSidebar as
|
|
8
|
-
import { scrollToId as
|
|
9
|
-
const
|
|
5
|
+
import se from "../../components/Sidebar/SidebarHttpBadge.vue.js";
|
|
6
|
+
import { useSearchIndex as ne } from "./useSearchIndex.js";
|
|
7
|
+
import { useSidebar as re } from "../../hooks/useSidebar.js";
|
|
8
|
+
import { scrollToId as N } from "../../helpers/scrollToId.js";
|
|
9
|
+
const le = { class: "sr-only" }, ie = { class: "sr-only" }, ve = /* @__PURE__ */ Y({
|
|
10
10
|
__name: "SearchModal",
|
|
11
11
|
props: {
|
|
12
12
|
parsedSpec: {},
|
|
13
13
|
modalState: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const m =
|
|
17
|
-
resetSearch:
|
|
18
|
-
fuseSearch:
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
setup(F) {
|
|
16
|
+
const m = F, q = A(m, "parsedSpec"), S = oe(), I = `${S}-search-result`, w = `${S}-search-instructions`, v = (o) => `${S}${o}`, {
|
|
17
|
+
resetSearch: D,
|
|
18
|
+
fuseSearch: L,
|
|
19
|
+
selectedSearchIndex: r,
|
|
20
|
+
selectedSearchResult: k,
|
|
21
|
+
searchResultsWithPlaceholderResults: u,
|
|
21
22
|
searchText: p
|
|
22
|
-
} =
|
|
23
|
-
specification:
|
|
24
|
-
}),
|
|
23
|
+
} = ne({
|
|
24
|
+
specification: q
|
|
25
|
+
}), M = {
|
|
25
26
|
heading: "DocsPage",
|
|
26
27
|
model: "Brackets",
|
|
27
28
|
req: "Terminal",
|
|
28
29
|
tag: "CodeFolder",
|
|
29
30
|
webhook: "Terminal"
|
|
30
|
-
},
|
|
31
|
+
}, P = {
|
|
31
32
|
heading: "Document Heading",
|
|
32
33
|
req: "Request",
|
|
33
34
|
tag: "Tag",
|
|
@@ -35,114 +36,119 @@ const ie = { class: "sr-only" }, ce = { class: "sr-only" }, ve = /* @__PURE__ */
|
|
|
35
36
|
// The title of the entry is already "Model"
|
|
36
37
|
webhook: ""
|
|
37
38
|
// The title of the entry is already "Webhook"
|
|
38
|
-
},
|
|
39
|
-
|
|
39
|
+
}, H = W(null);
|
|
40
|
+
x(
|
|
40
41
|
() => m.modalState.open,
|
|
41
42
|
(o) => {
|
|
42
|
-
o &&
|
|
43
|
+
o && D();
|
|
43
44
|
}
|
|
44
45
|
);
|
|
45
|
-
const { setCollapsedSidebarItem:
|
|
46
|
-
function
|
|
46
|
+
const { setCollapsedSidebarItem: U } = re(), K = /#(tag\/[^/]*)/;
|
|
47
|
+
function V(o) {
|
|
47
48
|
let t = "models";
|
|
48
|
-
const e = o.item.href.match(
|
|
49
|
-
e != null && e.length && e.length > 1 && (t = e[1]),
|
|
50
|
-
const
|
|
51
|
-
if (document.getElementById(
|
|
52
|
-
|
|
49
|
+
const e = o.item.href.match(K);
|
|
50
|
+
e != null && e.length && e.length > 1 && (t = e[1]), U(t, !0);
|
|
51
|
+
const a = o.item.href.replace("#", "");
|
|
52
|
+
if (document.getElementById(a))
|
|
53
|
+
N(a), m.modalState.hide();
|
|
53
54
|
else {
|
|
54
|
-
const
|
|
55
|
-
|
|
55
|
+
const i = ae.on((f) => {
|
|
56
|
+
f.id === a && (N(a), i(), m.modalState.hide());
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
x(r, (o) => {
|
|
61
|
+
var a;
|
|
62
|
+
if (typeof o != "number")
|
|
63
|
+
return;
|
|
64
|
+
const t = u.value[o], e = v(t == null ? void 0 : t.item.href);
|
|
65
|
+
(a = document.getElementById(e)) == null || a.scrollIntoView({
|
|
63
66
|
behavior: "smooth",
|
|
64
67
|
block: "nearest"
|
|
65
68
|
});
|
|
66
69
|
});
|
|
67
|
-
const
|
|
68
|
-
const o =
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const t = o === "up" ? -1 : 1, e = c.value.length, s = (l.value + t + e) % e;
|
|
75
|
-
l.value = s;
|
|
70
|
+
const B = (o) => {
|
|
71
|
+
const t = o === "up" ? -1 : 1, e = u.value.length;
|
|
72
|
+
if (typeof r.value == "number") {
|
|
73
|
+
const a = (r.value + t + e) % e;
|
|
74
|
+
r.value = a;
|
|
75
|
+
} else
|
|
76
|
+
r.value = t === -1 ? e - 1 : 0;
|
|
76
77
|
};
|
|
77
78
|
function z(o) {
|
|
78
79
|
const t = new URL(window.location.href);
|
|
79
80
|
return t.hash = o, t.toString();
|
|
80
81
|
}
|
|
81
82
|
function O() {
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
if (!r.value)
|
|
84
|
+
return;
|
|
85
|
+
const o = u.value;
|
|
86
|
+
V(o[r.value]);
|
|
84
87
|
}
|
|
85
|
-
return (o, t) => (
|
|
88
|
+
return (o, t) => (h(), $(s(Z), {
|
|
89
|
+
"aria-label": "Reference Search",
|
|
86
90
|
state: o.modalState,
|
|
87
91
|
variant: "search"
|
|
88
92
|
}, {
|
|
89
|
-
default:
|
|
90
|
-
|
|
93
|
+
default: l(() => [
|
|
94
|
+
n("div", {
|
|
91
95
|
ref_key: "searchModalRef",
|
|
92
|
-
ref:
|
|
93
|
-
"aria-label": "Reference Search",
|
|
96
|
+
ref: H,
|
|
94
97
|
class: "ref-search-container",
|
|
95
98
|
role: "search"
|
|
96
99
|
}, [
|
|
97
|
-
g(
|
|
98
|
-
modelValue:
|
|
100
|
+
g(s(_), {
|
|
101
|
+
modelValue: s(p),
|
|
99
102
|
"onUpdate:modelValue": t[0] || (t[0] = (e) => j(p) ? p.value = e : null),
|
|
100
|
-
"aria-
|
|
103
|
+
"aria-activedescendant": s(k) ? v(s(k).item.href) : void 0,
|
|
104
|
+
"aria-autocomplete": "list",
|
|
105
|
+
"aria-controls": I,
|
|
101
106
|
"aria-describedby": w,
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
role: "combobox",
|
|
108
|
+
onBlur: t[1] || (t[1] = (e) => r.value = void 0),
|
|
109
|
+
onInput: s(L),
|
|
104
110
|
onKeydown: [
|
|
105
|
-
t[
|
|
106
|
-
|
|
107
|
-
t[
|
|
111
|
+
t[2] || (t[2] = b(R((e) => B("down"), ["stop", "prevent"]), ["down"])),
|
|
112
|
+
b(R(O, ["stop", "prevent"]), ["enter"]),
|
|
113
|
+
t[3] || (t[3] = b(R((e) => B("up"), ["stop", "prevent"]), ["up"]))
|
|
108
114
|
]
|
|
109
|
-
}, null, 8, ["modelValue", "
|
|
115
|
+
}, null, 8, ["modelValue", "aria-activedescendant", "onInput", "onKeydown"])
|
|
110
116
|
], 512),
|
|
111
|
-
g(
|
|
112
|
-
id:
|
|
117
|
+
g(s(ee), {
|
|
118
|
+
id: I,
|
|
113
119
|
"aria-label": "Reference Search Results",
|
|
114
120
|
class: "ref-search-results custom-scroll",
|
|
115
|
-
noResults: !
|
|
121
|
+
noResults: !s(u).length
|
|
116
122
|
}, {
|
|
117
|
-
query:
|
|
118
|
-
d(
|
|
123
|
+
query: l(() => [
|
|
124
|
+
d(c(s(p)), 1)
|
|
119
125
|
]),
|
|
120
|
-
default:
|
|
121
|
-
(
|
|
122
|
-
id:
|
|
126
|
+
default: l(() => [
|
|
127
|
+
(h(!0), y(E, null, G(s(u), (e, a) => (h(), $(s(te), {
|
|
128
|
+
id: v(e.item.href),
|
|
123
129
|
key: e.refIndex,
|
|
124
|
-
active: n(l) === s,
|
|
125
130
|
href: z(e.item.href),
|
|
126
|
-
icon:
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
icon: M[e.item.type],
|
|
132
|
+
selected: s(r) === a,
|
|
133
|
+
onClick: (i) => V(e),
|
|
134
|
+
onFocus: (i) => r.value = a
|
|
129
135
|
}, J({
|
|
130
|
-
default:
|
|
131
|
-
var
|
|
136
|
+
default: l(() => {
|
|
137
|
+
var i, f, C, T;
|
|
132
138
|
return [
|
|
133
|
-
|
|
139
|
+
n("span", {
|
|
134
140
|
class: Q({
|
|
135
|
-
deprecated: (
|
|
141
|
+
deprecated: (f = (i = e.item.operation) == null ? void 0 : i.information) == null ? void 0 : f.deprecated
|
|
136
142
|
})
|
|
137
143
|
}, [
|
|
138
|
-
|
|
139
|
-
d(
|
|
140
|
-
(
|
|
144
|
+
n("span", le, [
|
|
145
|
+
d(c(P[e.item.type]) + ": ", 1),
|
|
146
|
+
(T = (C = e.item.operation) == null ? void 0 : C.information) != null && T.deprecated ? (h(), y(E, { key: 0 }, [
|
|
141
147
|
d(" (Deprecated) ")
|
|
142
148
|
], 64)) : X("", !0)
|
|
143
149
|
]),
|
|
144
|
-
d(" " +
|
|
145
|
-
t[
|
|
150
|
+
d(" " + c(e.item.title) + " ", 1),
|
|
151
|
+
t[4] || (t[4] = n("span", { class: "sr-only" }, ",", -1))
|
|
146
152
|
], 2)
|
|
147
153
|
];
|
|
148
154
|
}),
|
|
@@ -150,46 +156,46 @@ const ie = { class: "sr-only" }, ce = { class: "sr-only" }, ve = /* @__PURE__ */
|
|
|
150
156
|
}, [
|
|
151
157
|
e.item.type !== "webhook" && (e.item.httpVerb || e.item.path) && e.item.path !== e.item.title ? {
|
|
152
158
|
name: "description",
|
|
153
|
-
fn:
|
|
154
|
-
t[
|
|
155
|
-
d(" " +
|
|
159
|
+
fn: l(() => [
|
|
160
|
+
t[5] || (t[5] = n("span", { class: "sr-only" }, "Path: ", -1)),
|
|
161
|
+
d(" " + c(e.item.path), 1)
|
|
156
162
|
]),
|
|
157
163
|
key: "0"
|
|
158
164
|
} : e.item.description ? {
|
|
159
165
|
name: "description",
|
|
160
|
-
fn:
|
|
161
|
-
t[
|
|
162
|
-
d(" " +
|
|
166
|
+
fn: l(() => [
|
|
167
|
+
t[6] || (t[6] = n("span", { class: "sr-only" }, "Description: ", -1)),
|
|
168
|
+
d(" " + c(e.item.description), 1)
|
|
163
169
|
]),
|
|
164
170
|
key: "1"
|
|
165
171
|
} : void 0,
|
|
166
172
|
e.item.type === "req" ? {
|
|
167
173
|
name: "addon",
|
|
168
|
-
fn:
|
|
169
|
-
g(
|
|
174
|
+
fn: l(() => [
|
|
175
|
+
g(se, {
|
|
170
176
|
"aria-hidden": "true",
|
|
171
177
|
method: e.item.httpVerb ?? "get"
|
|
172
178
|
}, null, 8, ["method"]),
|
|
173
|
-
|
|
179
|
+
n("span", ie, " HTTP Method: " + c(e.item.httpVerb ?? "get") + ", ", 1)
|
|
174
180
|
]),
|
|
175
181
|
key: "2"
|
|
176
182
|
} : void 0
|
|
177
|
-
]), 1032, ["id", "
|
|
183
|
+
]), 1032, ["id", "href", "icon", "selected", "onClick", "onFocus"]))), 128))
|
|
178
184
|
]),
|
|
179
185
|
_: 1
|
|
180
186
|
}, 8, ["noResults"]),
|
|
181
|
-
|
|
187
|
+
n("div", {
|
|
182
188
|
id: w,
|
|
183
189
|
class: "ref-search-meta"
|
|
184
|
-
}, t[
|
|
185
|
-
|
|
190
|
+
}, t[7] || (t[7] = [
|
|
191
|
+
n("span", {
|
|
186
192
|
"aria-hidden": "true",
|
|
187
193
|
class: "contents"
|
|
188
194
|
}, [
|
|
189
|
-
|
|
190
|
-
|
|
195
|
+
n("span", null, "↑↓ Navigate"),
|
|
196
|
+
n("span", null, "⏎ Select")
|
|
191
197
|
], -1),
|
|
192
|
-
|
|
198
|
+
n("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)
|
|
193
199
|
]))
|
|
194
200
|
]),
|
|
195
201
|
_: 1
|
|
@@ -23,7 +23,8 @@ export declare function useSearchIndex({ specification, }: {
|
|
|
23
23
|
}): {
|
|
24
24
|
resetSearch: () => void;
|
|
25
25
|
fuseSearch: () => void;
|
|
26
|
-
|
|
26
|
+
selectedSearchIndex: Ref<number | undefined, number | undefined>;
|
|
27
|
+
selectedSearchResult: import("vue").ComputedRef<FuseResult<FuseData> | undefined>;
|
|
27
28
|
searchResultsWithPlaceholderResults: import("vue").ComputedRef<FuseResult<FuseData>[]>;
|
|
28
29
|
searchText: Ref<string, string>;
|
|
29
30
|
};
|
|
@@ -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,EAAE,KAAK,QAAQ,EAAyC,MAAM,aAAa,CAAA;AAElF,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;uBA0ByB,IAAI;sBAbL,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,EAAE,KAAK,QAAQ,EAAyC,MAAM,aAAa,CAAA;AAElF,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;uBA0ByB,IAAI;sBAbL,IAAI;;;;;EA0K5B"}
|
|
@@ -1,63 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ref as
|
|
3
|
-
import { extractRequestBody as
|
|
4
|
-
import { useOperation as
|
|
5
|
-
import { useSidebar as
|
|
6
|
-
import { useNavState as
|
|
7
|
-
import { getHeadingsFromMarkdown as
|
|
8
|
-
import { getModels as
|
|
9
|
-
function
|
|
10
|
-
specification:
|
|
1
|
+
import N from "fuse.js";
|
|
2
|
+
import { ref as d, watch as E, computed as O } from "vue";
|
|
3
|
+
import { extractRequestBody as V } from "../../helpers/specHelpers.js";
|
|
4
|
+
import { useOperation as A } from "../../hooks/useOperation.js";
|
|
5
|
+
import { useSidebar as B } from "../../hooks/useSidebar.js";
|
|
6
|
+
import { useNavState as P } from "../../hooks/useNavState.js";
|
|
7
|
+
import { getHeadingsFromMarkdown as z } from "../../helpers/getHeadingsFromMarkdown.js";
|
|
8
|
+
import { getModels as G } from "../../helpers/getModels.js";
|
|
9
|
+
function w({
|
|
10
|
+
specification: R
|
|
11
11
|
}) {
|
|
12
|
-
const { hideModels:
|
|
12
|
+
const { hideModels: T } = B(), { getHeadingId: j, getWebhookId: L, getModelId: W, getOperationId: q, getTagId: C } = P(), s = d([]), l = d([]), a = d(), r = d(""), c = new N(s.value, {
|
|
13
13
|
keys: ["title", "description", "body"]
|
|
14
14
|
}), m = () => {
|
|
15
|
-
|
|
15
|
+
a.value = 0, l.value = c.search(r.value);
|
|
16
16
|
};
|
|
17
|
-
E(
|
|
18
|
-
e.length ? m() :
|
|
17
|
+
E(r, (e) => {
|
|
18
|
+
e.length ? m() : l.value = [];
|
|
19
19
|
});
|
|
20
|
-
function
|
|
21
|
-
|
|
20
|
+
function F() {
|
|
21
|
+
r.value = "", a.value = void 0, l.value = [];
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
item:
|
|
25
|
-
})) :
|
|
23
|
+
const v = O(() => r.value.length === 0 ? s.value.slice(0, 25).map((i) => ({
|
|
24
|
+
item: i
|
|
25
|
+
})) : l.value.slice(0, 25)), H = O(
|
|
26
|
+
() => typeof a.value == "number" ? v.value[a.value] : void 0
|
|
27
|
+
);
|
|
26
28
|
return E(
|
|
27
|
-
|
|
29
|
+
R,
|
|
28
30
|
(e) => {
|
|
29
|
-
var
|
|
30
|
-
if (s.value = [], !((
|
|
31
|
+
var I, p, k, M;
|
|
32
|
+
if (s.value = [], !((I = e == null ? void 0 : e.tags) != null && I.length) && !((p = e == null ? void 0 : e.webhooks) != null && p.length)) {
|
|
31
33
|
c.setCollection([]);
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
const i = [], b = z(((k = e == null ? void 0 : e.info) == null ? void 0 : k.description) ?? "");
|
|
37
|
+
b.length && (b.forEach((t) => {
|
|
38
|
+
i.push({
|
|
37
39
|
type: "heading",
|
|
38
40
|
title: `Info > ${t.value}`,
|
|
39
41
|
description: "",
|
|
40
|
-
href: `#${
|
|
42
|
+
href: `#${j(t)}`,
|
|
41
43
|
tag: t.slug,
|
|
42
44
|
body: ""
|
|
43
45
|
});
|
|
44
|
-
}), s.value = s.value.concat(
|
|
45
|
-
const
|
|
46
|
+
}), s.value = s.value.concat(i)), (M = e == null ? void 0 : e.tags) == null || M.forEach((t) => {
|
|
47
|
+
const D = {
|
|
46
48
|
title: t["x-displayName"] ?? t.name,
|
|
47
|
-
href: `#${
|
|
49
|
+
href: `#${C(t)}`,
|
|
48
50
|
description: t.description,
|
|
49
51
|
type: "tag",
|
|
50
52
|
tag: t.name,
|
|
51
53
|
body: ""
|
|
52
54
|
};
|
|
53
|
-
s.value.push(
|
|
54
|
-
const { parameterMap:
|
|
55
|
+
s.value.push(D), t.operations && t.operations.forEach((o) => {
|
|
56
|
+
const { parameterMap: h } = A(o), $ = V(o) || h.value;
|
|
55
57
|
let n = null;
|
|
56
|
-
typeof
|
|
57
|
-
const
|
|
58
|
+
typeof $ != "boolean" && (n = $);
|
|
59
|
+
const x = {
|
|
58
60
|
type: "req",
|
|
59
61
|
title: o.name ?? o.path,
|
|
60
|
-
href: `#${
|
|
62
|
+
href: `#${q(o, t)}`,
|
|
61
63
|
operationId: o.operationId,
|
|
62
64
|
description: o.description ?? "",
|
|
63
65
|
httpVerb: o.httpVerb,
|
|
@@ -65,45 +67,46 @@ function _({
|
|
|
65
67
|
tag: t.name,
|
|
66
68
|
operation: o
|
|
67
69
|
};
|
|
68
|
-
n && (
|
|
70
|
+
n && (x.body = n), s.value.push(x);
|
|
69
71
|
});
|
|
70
72
|
});
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
Object.keys(
|
|
74
|
-
var
|
|
75
|
-
|
|
73
|
+
const u = e == null ? void 0 : e.webhooks, y = [];
|
|
74
|
+
u && Object.keys(u).forEach((t) => {
|
|
75
|
+
Object.keys(u[t]).forEach((o) => {
|
|
76
|
+
var h;
|
|
77
|
+
y.push({
|
|
76
78
|
type: "webhook",
|
|
77
79
|
title: "Webhook",
|
|
78
|
-
href: `#${
|
|
79
|
-
description: `${(
|
|
80
|
+
href: `#${L({ name: t, method: o })}`,
|
|
81
|
+
description: `${(h = u[t][o]) == null ? void 0 : h.name}`,
|
|
80
82
|
httpVerb: o,
|
|
81
83
|
tag: t,
|
|
82
84
|
body: ""
|
|
83
85
|
});
|
|
84
|
-
}), s.value = s.value.concat(
|
|
86
|
+
}), s.value = s.value.concat(y);
|
|
85
87
|
});
|
|
86
|
-
const f =
|
|
88
|
+
const f = T.value ? {} : G(e), g = [];
|
|
87
89
|
f && (Object.keys(f).forEach((t) => {
|
|
88
|
-
|
|
90
|
+
g.push({
|
|
89
91
|
type: "model",
|
|
90
92
|
title: "Model",
|
|
91
|
-
href: `#${
|
|
93
|
+
href: `#${W({ name: t })}`,
|
|
92
94
|
description: f[t].title ?? t,
|
|
93
95
|
tag: t,
|
|
94
96
|
body: ""
|
|
95
97
|
});
|
|
96
|
-
}), s.value = s.value.concat(
|
|
98
|
+
}), s.value = s.value.concat(g)), c.setCollection(s.value);
|
|
97
99
|
},
|
|
98
100
|
{ immediate: !0 }
|
|
99
101
|
), {
|
|
100
|
-
resetSearch:
|
|
102
|
+
resetSearch: F,
|
|
101
103
|
fuseSearch: m,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
selectedSearchIndex: a,
|
|
105
|
+
selectedSearchResult: H,
|
|
106
|
+
searchResultsWithPlaceholderResults: v,
|
|
107
|
+
searchText: r
|
|
105
108
|
};
|
|
106
109
|
}
|
|
107
110
|
export {
|
|
108
|
-
|
|
111
|
+
w as useSearchIndex
|
|
109
112
|
};
|