@scalar/api-reference 1.28.11 → 1.28.12
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 +27 -0
- package/dist/browser/standalone.js +5740 -5724
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Schema/Schema.preview.d.ts +232 -0
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +3 -3
- package/dist/components/Content/Schema/Schema.vue2.js +52 -51
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +9 -7
- 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 +55 -51
- package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/ShowMoreButton.vue.js +2 -2
- package/dist/components/ShowMoreButton.vue2.js +15 -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 +55 -55
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarElement.vue2.js +53 -53
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +4 -4
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +76 -76
- package/dist/hooks/useMultipleDocuments.d.ts +3 -1
- package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
- package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
- package/dist/hooks/useReactiveSpec.js +36 -36
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +10 -9
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarSidebarGroupToggle as
|
|
3
|
-
import { combineUrlAndPath as
|
|
4
|
-
import { useConfig as
|
|
5
|
-
import
|
|
6
|
-
import { sleep as
|
|
7
|
-
import { useNavState as
|
|
8
|
-
import { scrollToId as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as A, openBlock as s, createElementBlock as p, createElementVNode as r, normalizeClass as T, unref as c, withModifiers as V, createVNode as v, withCtx as E, createTextVNode as h, toDisplayString as u, createCommentVNode as l, createBlock as N, renderSlot as C } from "vue";
|
|
2
|
+
import { ScalarSidebarGroupToggle as O, ScalarIcon as R } from "@scalar/components";
|
|
3
|
+
import { combineUrlAndPath as U } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { useConfig as H } from "../../hooks/useConfig.js";
|
|
5
|
+
import I from "./SidebarHttpBadge.vue.js";
|
|
6
|
+
import { sleep as k } from "../../helpers/sleep.js";
|
|
7
|
+
import { useNavState as P } from "../../hooks/useNavState.js";
|
|
8
|
+
import { scrollToId as D } from "../../helpers/scrollToId.js";
|
|
9
|
+
const L = ["id"], M = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "sidebar-heading-chevron"
|
|
12
|
-
},
|
|
12
|
+
}, z = ["aria-expanded"], F = ["href", "tabindex"], G = { class: "sidebar-heading-link-title" }, j = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "sidebar-heading-link-method"
|
|
15
|
-
},
|
|
15
|
+
}, q = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "action-menu"
|
|
18
|
-
},
|
|
18
|
+
}, x = /* @__PURE__ */ A({
|
|
19
19
|
__name: "SidebarElement",
|
|
20
20
|
props: {
|
|
21
21
|
id: {},
|
|
@@ -25,82 +25,82 @@ const D = ["id"], L = {
|
|
|
25
25
|
open: { type: Boolean }
|
|
26
26
|
},
|
|
27
27
|
emits: ["toggleOpen"],
|
|
28
|
-
setup(
|
|
29
|
-
const i =
|
|
28
|
+
setup(y, { emit: w }) {
|
|
29
|
+
const i = y, m = w, { getFullHash: f, isIntersectionEnabled: d, replaceUrlState: S } = P(), n = H(), g = async () => {
|
|
30
30
|
var e, t;
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
31
|
+
d.value = !1, i.hasChildren && m("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), await k(100), d.value = !0;
|
|
32
|
+
}, B = () => {
|
|
33
|
+
if (n.value.pathRouting)
|
|
34
|
+
return U(n.value.pathRouting.basePath, i.item.id);
|
|
35
35
|
if (typeof window < "u") {
|
|
36
36
|
const e = new URL(window.location.href);
|
|
37
|
-
return e.hash =
|
|
37
|
+
return e.hash = f(i.item.id), `${e.pathname}${e.search}${e.hash}`;
|
|
38
38
|
}
|
|
39
|
-
return `#${
|
|
40
|
-
},
|
|
41
|
-
var t, o;
|
|
42
|
-
|
|
39
|
+
return `#${f(i.item.id)}`;
|
|
40
|
+
}, $ = async (e) => {
|
|
41
|
+
var t, a, o, b;
|
|
42
|
+
(a = (t = n.value).onSidebarClick) == null || a.call(t, i.item.id), n.value.pathRouting && (e.preventDefault(), i.hasChildren && m("toggleOpen"), (b = (o = i.item) == null ? void 0 : o.select) == null || b.call(o), m("toggleOpen"), d.value = !1, S(i.item.id), D(i.item.id), await k(100), d.value = !0);
|
|
43
43
|
};
|
|
44
44
|
return (e, t) => {
|
|
45
|
-
var
|
|
46
|
-
return
|
|
45
|
+
var a, o;
|
|
46
|
+
return s(), p("li", {
|
|
47
47
|
id: e.id,
|
|
48
48
|
class: "sidebar-group-item"
|
|
49
49
|
}, [
|
|
50
|
-
|
|
51
|
-
class:
|
|
50
|
+
r("div", {
|
|
51
|
+
class: T(["sidebar-heading", {
|
|
52
52
|
"sidebar-group-item__folder": e.hasChildren,
|
|
53
53
|
active_page: e.isActive,
|
|
54
54
|
deprecated: e.item.deprecated ?? !1
|
|
55
55
|
}]),
|
|
56
|
-
onClick:
|
|
56
|
+
onClick: g
|
|
57
57
|
}, [
|
|
58
|
-
e.hasChildren && !
|
|
59
|
-
|
|
58
|
+
e.hasChildren && !c(n).defaultOpenAllTags ? (s(), p("p", M, [
|
|
59
|
+
r("button", {
|
|
60
60
|
"aria-expanded": e.open,
|
|
61
61
|
class: "toggle-nested-icon",
|
|
62
62
|
type: "button",
|
|
63
|
-
onClick:
|
|
63
|
+
onClick: V(g, ["stop"])
|
|
64
64
|
}, [
|
|
65
|
-
|
|
66
|
-
label:
|
|
67
|
-
h(
|
|
65
|
+
v(c(O), { open: e.open }, {
|
|
66
|
+
label: E(() => [
|
|
67
|
+
h(u(e.open ? "Collapse" : "Expand") + " " + u(e.item.title), 1)
|
|
68
68
|
]),
|
|
69
69
|
_: 1
|
|
70
70
|
}, 8, ["open"])
|
|
71
|
-
], 8,
|
|
71
|
+
], 8, z),
|
|
72
72
|
t[0] || (t[0] = h(" "))
|
|
73
|
-
])) :
|
|
74
|
-
|
|
73
|
+
])) : l("", !0),
|
|
74
|
+
r("a", {
|
|
75
75
|
class: "sidebar-heading-link",
|
|
76
|
-
href:
|
|
76
|
+
href: B(),
|
|
77
77
|
tabindex: e.hasChildren ? -1 : 0,
|
|
78
|
-
onClick:
|
|
78
|
+
onClick: $
|
|
79
79
|
}, [
|
|
80
|
-
(
|
|
80
|
+
(o = (a = e.item) == null ? void 0 : a.icon) != null && o.src ? (s(), N(c(R), {
|
|
81
81
|
key: 0,
|
|
82
82
|
class: "sidebar-icon",
|
|
83
83
|
icon: e.item.icon.src
|
|
84
|
-
}, null, 8, ["icon"])) :
|
|
85
|
-
|
|
86
|
-
e.item.httpVerb && !e.hasChildren ? (
|
|
84
|
+
}, null, 8, ["icon"])) : l("", !0),
|
|
85
|
+
r("p", G, u(e.item.title), 1),
|
|
86
|
+
e.item.httpVerb && !e.hasChildren ? (s(), p("p", j, [
|
|
87
87
|
t[1] || (t[1] = h(" ")),
|
|
88
|
-
t[2] || (t[2] =
|
|
89
|
-
|
|
88
|
+
t[2] || (t[2] = r("span", { class: "sr-only" }, "HTTP Method: ", -1)),
|
|
89
|
+
v(I, {
|
|
90
90
|
active: e.isActive,
|
|
91
91
|
method: e.item.httpVerb
|
|
92
92
|
}, null, 8, ["active", "method"])
|
|
93
|
-
])) :
|
|
94
|
-
], 8,
|
|
93
|
+
])) : l("", !0)
|
|
94
|
+
], 8, F)
|
|
95
95
|
], 2),
|
|
96
|
-
e.open ?
|
|
97
|
-
e.$slots["action-menu"] ? (
|
|
98
|
-
|
|
99
|
-
])) :
|
|
100
|
-
], 8,
|
|
96
|
+
e.open ? C(e.$slots, "default", { key: 0 }, void 0, !0) : l("", !0),
|
|
97
|
+
e.$slots["action-menu"] ? (s(), p("div", q, [
|
|
98
|
+
C(e.$slots, "action-menu", {}, void 0, !0)
|
|
99
|
+
])) : l("", !0)
|
|
100
|
+
], 8, L);
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
export {
|
|
105
|
-
|
|
105
|
+
x as default
|
|
106
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AAkaA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,OAAO,EAML,KAAK,uBAAuB,EAC7B,MAAM,KAAK,CAAA;AAcZ,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,UAAU,EAAE,UAAU,CAAA;IACtB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CAAC;AAwOF,iBAAS,cAAc;WAiPT,OAAO,IAA6B;;wBAZrB,GAAG;wBAEH,GAAG;wBADH,GAAG;wBAEH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAtGqJ,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DACnO,GAAG;;;;;;;;EAmHpC;AAiCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./ExampleRequest.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = /* @__PURE__ */ o(e, [["__scopeId", "data-v-c499eee4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as G, useId as L, computed as c, ref as T, watch as Q, unref as
|
|
1
|
+
import { defineComponent as G, useId as L, computed as c, ref as T, watch as Q, unref as o, openBlock as d, createBlock as k, withCtx as a, createVNode as n, createElementBlock as b, Fragment as B, createTextVNode as f, toDisplayString as E, createElementVNode as h, renderSlot as K, createCommentVNode as C } from "vue";
|
|
2
2
|
import { useWorkspace as X } from "@scalar/api-client/store";
|
|
3
3
|
import { getSnippet as Y } from "@scalar/api-client/views/Components/CodeSnippet";
|
|
4
4
|
import { filterSecurityRequirements as Z } from "@scalar/api-client/views/Request/RequestSection";
|
|
@@ -6,8 +6,8 @@ import { ScalarCodeBlock as _ } from "@scalar/components";
|
|
|
6
6
|
import S from "../../components/ScreenReader.vue.js";
|
|
7
7
|
import { freezeElement as ee } from "../../helpers/freeze-element.js";
|
|
8
8
|
import { useConfig as te } from "../../hooks/useConfig.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import le from "./ExamplePicker.vue.js";
|
|
10
|
+
import oe from "./TextSelect.vue.js";
|
|
11
11
|
/* empty css */
|
|
12
12
|
import V from "../../components/Card/Card.vue.js";
|
|
13
13
|
import re from "../../components/Card/CardHeader.vue.js";
|
|
@@ -28,9 +28,9 @@ const ie = ["id"], ue = ["id"], me = {
|
|
|
28
28
|
fallback: { type: Boolean },
|
|
29
29
|
transformedOperation: {}
|
|
30
30
|
},
|
|
31
|
-
setup(
|
|
31
|
+
setup(i) {
|
|
32
32
|
const { selectedExampleKey: R, operationId: w } = ne(), { requestExamples: J, securitySchemes: q } = X(), I = te(), {
|
|
33
|
-
httpClient:
|
|
33
|
+
httpClient: s,
|
|
34
34
|
setHttpClient: U,
|
|
35
35
|
availableTargets: $,
|
|
36
36
|
httpTargetTitle: z,
|
|
@@ -38,11 +38,11 @@ const ie = ["id"], ue = ["id"], me = {
|
|
|
38
38
|
} = se(), y = L(), m = c(() => {
|
|
39
39
|
var t;
|
|
40
40
|
const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
|
|
41
|
-
for (const
|
|
42
|
-
if ((t =
|
|
43
|
-
return [...
|
|
41
|
+
for (const l of e)
|
|
42
|
+
if ((t = i.transformedOperation.information) != null && t[l])
|
|
43
|
+
return [...i.transformedOperation.information[l]];
|
|
44
44
|
return [];
|
|
45
|
-
}),
|
|
45
|
+
}), r = T(
|
|
46
46
|
// Default to first custom example
|
|
47
47
|
m.value.length ? {
|
|
48
48
|
targetKey: "customExamples",
|
|
@@ -50,39 +50,39 @@ const ie = ["id"], ue = ["id"], me = {
|
|
|
50
50
|
} : (
|
|
51
51
|
// Otherwise use the globally selected HTTP client
|
|
52
52
|
{
|
|
53
|
-
targetKey:
|
|
54
|
-
clientKey:
|
|
53
|
+
targetKey: s.targetKey,
|
|
54
|
+
clientKey: s.clientKey
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
);
|
|
58
|
-
Q(
|
|
59
|
-
|
|
60
|
-
targetKey:
|
|
61
|
-
clientKey:
|
|
58
|
+
Q(s, () => {
|
|
59
|
+
r.value = {
|
|
60
|
+
targetKey: s.targetKey,
|
|
61
|
+
clientKey: s.clientKey
|
|
62
62
|
};
|
|
63
63
|
});
|
|
64
64
|
const O = c(
|
|
65
65
|
() => {
|
|
66
|
-
var e, t,
|
|
66
|
+
var e, t, l, u;
|
|
67
67
|
return Object.keys(
|
|
68
|
-
((u = (
|
|
68
|
+
((u = (l = (t = (e = i.transformedOperation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : l["application/json"]) == null ? void 0 : u.examples) ?? {}
|
|
69
69
|
).length > 1;
|
|
70
70
|
}
|
|
71
71
|
), M = () => {
|
|
72
72
|
var g;
|
|
73
|
-
if (
|
|
74
|
-
return ((g = m.value[
|
|
75
|
-
const e =
|
|
76
|
-
if (!
|
|
73
|
+
if (r.value.targetKey === "customExamples")
|
|
74
|
+
return ((g = m.value[r.value.clientKey]) == null ? void 0 : g.source) ?? "";
|
|
75
|
+
const e = s.clientKey, t = s.targetKey, l = J[i.operation.examples[0]];
|
|
76
|
+
if (!l)
|
|
77
77
|
return "";
|
|
78
78
|
const u = Z(
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
i.operation.security || i.collection.security,
|
|
80
|
+
i.collection.selectedSecuritySchemeUids,
|
|
81
81
|
q
|
|
82
82
|
), [p, v] = Y(t, e, {
|
|
83
|
-
operation:
|
|
84
|
-
example:
|
|
85
|
-
server:
|
|
83
|
+
operation: i.operation,
|
|
84
|
+
example: l,
|
|
85
|
+
server: i.server,
|
|
86
86
|
securitySchemes: u
|
|
87
87
|
});
|
|
88
88
|
return p ? p.message ?? "" : v;
|
|
@@ -93,12 +93,12 @@ const ie = ["id"], ue = ["id"], me = {
|
|
|
93
93
|
return console.error("[generateSnippet]", e), "";
|
|
94
94
|
}
|
|
95
95
|
}), P = c(() => {
|
|
96
|
-
var t,
|
|
96
|
+
var t, l;
|
|
97
97
|
const e = (
|
|
98
98
|
// Specified language
|
|
99
|
-
((t =
|
|
99
|
+
((t = r.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((l = m.value[r.value.clientKey]) == null ? void 0 : l.lang) ?? "plaintext" : (
|
|
100
100
|
// Or language for the globally selected HTTP client
|
|
101
|
-
|
|
101
|
+
s.targetKey
|
|
102
102
|
)
|
|
103
103
|
);
|
|
104
104
|
return e === "shell" && N.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
|
|
@@ -112,88 +112,88 @@ const ie = ["id"], ue = ["id"], me = {
|
|
|
112
112
|
const e = $.value.map((t) => ({
|
|
113
113
|
value: t.key,
|
|
114
114
|
label: t.title,
|
|
115
|
-
options: t.clients.map((
|
|
115
|
+
options: t.clients.map((l) => ({
|
|
116
116
|
value: JSON.stringify({
|
|
117
117
|
targetKey: t.key,
|
|
118
|
-
clientKey:
|
|
118
|
+
clientKey: l.client
|
|
119
119
|
}),
|
|
120
|
-
label:
|
|
120
|
+
label: l.title
|
|
121
121
|
}))
|
|
122
122
|
}));
|
|
123
123
|
return m.value.length && e.unshift({
|
|
124
124
|
value: "customExamples",
|
|
125
125
|
label: "Examples",
|
|
126
|
-
options: m.value.map((t,
|
|
126
|
+
options: m.value.map((t, l) => ({
|
|
127
127
|
value: JSON.stringify({
|
|
128
128
|
targetKey: "customExamples",
|
|
129
|
-
clientKey:
|
|
129
|
+
clientKey: l
|
|
130
130
|
}),
|
|
131
|
-
label: t.label ?? t.lang ?? `Example #${
|
|
131
|
+
label: t.label ?? t.lang ?? `Example #${l + 1}`
|
|
132
132
|
}))
|
|
133
133
|
}), e;
|
|
134
134
|
}), x = T(null);
|
|
135
135
|
function A(e) {
|
|
136
136
|
const t = JSON.parse(e);
|
|
137
137
|
if (x.value) {
|
|
138
|
-
const
|
|
138
|
+
const l = ee(x.value.$el);
|
|
139
139
|
setTimeout(() => {
|
|
140
|
-
|
|
140
|
+
l();
|
|
141
141
|
}, 300);
|
|
142
142
|
}
|
|
143
|
-
t.targetKey === "customExamples"
|
|
143
|
+
t.targetKey === "customExamples" || r.value.targetKey === "customExamples" && t.targetKey === s.targetKey && t.clientKey === s.clientKey ? r.value = t : U(t);
|
|
144
144
|
}
|
|
145
|
-
return (e, t) =>
|
|
145
|
+
return (e, t) => o($).length || m.value.length ? (d(), k(o(V), {
|
|
146
146
|
key: 0,
|
|
147
|
-
"aria-labelledby": `${
|
|
147
|
+
"aria-labelledby": `${o(y)}-header`,
|
|
148
148
|
class: "dark-mode",
|
|
149
149
|
ref_key: "elem",
|
|
150
150
|
ref: x,
|
|
151
151
|
role: "region"
|
|
152
152
|
}, {
|
|
153
|
-
default:
|
|
154
|
-
|
|
155
|
-
actions:
|
|
156
|
-
|
|
153
|
+
default: a(() => [
|
|
154
|
+
n(o(re), { muted: "" }, {
|
|
155
|
+
actions: a(() => [
|
|
156
|
+
n(oe, {
|
|
157
157
|
class: "request-client-picker",
|
|
158
|
-
controls: `${
|
|
159
|
-
modelValue: JSON.stringify(
|
|
158
|
+
controls: `${o(y)}-example`,
|
|
159
|
+
modelValue: JSON.stringify(r.value),
|
|
160
160
|
options: W.value,
|
|
161
161
|
"onUpdate:modelValue": A
|
|
162
162
|
}, {
|
|
163
|
-
default:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
default:
|
|
163
|
+
default: a(() => [
|
|
164
|
+
r.value.targetKey === "customExamples" ? (d(), b(B, { key: 0 }, [
|
|
165
|
+
n(S, null, {
|
|
166
|
+
default: a(() => t[2] || (t[2] = [
|
|
167
167
|
f("Selected Example:")
|
|
168
168
|
])),
|
|
169
169
|
_: 1
|
|
170
170
|
}),
|
|
171
|
-
f(" " +
|
|
171
|
+
f(" " + E(m.value[r.value.clientKey].label ?? "Example"), 1)
|
|
172
172
|
], 64)) : (d(), b(B, { key: 1 }, [
|
|
173
|
-
|
|
174
|
-
default:
|
|
173
|
+
n(S, null, {
|
|
174
|
+
default: a(() => t[3] || (t[3] = [
|
|
175
175
|
f("Selected HTTP client:")
|
|
176
176
|
])),
|
|
177
177
|
_: 1
|
|
178
178
|
}),
|
|
179
|
-
f(" " +
|
|
179
|
+
f(" " + E(o(z)) + " " + E(o(F)), 1)
|
|
180
180
|
], 64))
|
|
181
181
|
]),
|
|
182
182
|
_: 1
|
|
183
183
|
}, 8, ["controls", "modelValue", "options"])
|
|
184
184
|
]),
|
|
185
|
-
default:
|
|
186
|
-
|
|
187
|
-
id: `${
|
|
185
|
+
default: a(() => [
|
|
186
|
+
h("div", {
|
|
187
|
+
id: `${o(y)}-header`,
|
|
188
188
|
class: "request-header"
|
|
189
189
|
}, [
|
|
190
|
-
|
|
191
|
-
default:
|
|
190
|
+
n(S, null, {
|
|
191
|
+
default: a(() => t[1] || (t[1] = [
|
|
192
192
|
f("Request Example for")
|
|
193
193
|
])),
|
|
194
194
|
_: 1
|
|
195
195
|
}),
|
|
196
|
-
|
|
196
|
+
n(o(j), {
|
|
197
197
|
as: "span",
|
|
198
198
|
class: "request-method",
|
|
199
199
|
method: e.operation.method
|
|
@@ -203,17 +203,17 @@ const ie = ["id"], ue = ["id"], me = {
|
|
|
203
203
|
]),
|
|
204
204
|
_: 3
|
|
205
205
|
}),
|
|
206
|
-
|
|
206
|
+
n(o(H), {
|
|
207
207
|
borderless: "",
|
|
208
208
|
class: "request-editor-section custom-scroll",
|
|
209
209
|
frameless: ""
|
|
210
210
|
}, {
|
|
211
|
-
default:
|
|
212
|
-
|
|
213
|
-
id: `${
|
|
211
|
+
default: a(() => [
|
|
212
|
+
h("div", {
|
|
213
|
+
id: `${o(y)}-example`,
|
|
214
214
|
class: "code-snippet"
|
|
215
215
|
}, [
|
|
216
|
-
|
|
216
|
+
n(o(_), {
|
|
217
217
|
class: "bg-b-2 -outline-offset-2",
|
|
218
218
|
content: N.value,
|
|
219
219
|
hideCredentials: D.value,
|
|
@@ -224,18 +224,18 @@ const ie = ["id"], ue = ["id"], me = {
|
|
|
224
224
|
]),
|
|
225
225
|
_: 1
|
|
226
226
|
}),
|
|
227
|
-
(O.value || !
|
|
227
|
+
(O.value || !o(I).hideTestRequestButton) && e.$slots.footer ? (d(), k(o(ae), {
|
|
228
228
|
key: 0,
|
|
229
229
|
class: "request-card-footer",
|
|
230
230
|
contrast: ""
|
|
231
231
|
}, {
|
|
232
|
-
default:
|
|
233
|
-
var
|
|
232
|
+
default: a(() => {
|
|
233
|
+
var l, u, p, v;
|
|
234
234
|
return [
|
|
235
235
|
O.value ? (d(), b("div", me, [
|
|
236
|
-
|
|
236
|
+
n(le, {
|
|
237
237
|
class: "request-example-selector",
|
|
238
|
-
examples: ((v = (p = (u = (
|
|
238
|
+
examples: ((v = (p = (u = (l = e.transformedOperation.information) == null ? void 0 : l.requestBody) == null ? void 0 : u.content) == null ? void 0 : p["application/json"]) == null ? void 0 : v.examples) ?? [],
|
|
239
239
|
"onUpdate:modelValue": t[0] || (t[0] = (g) => (R.value = g, w.value = e.operation.operationId))
|
|
240
240
|
}, null, 8, ["examples"])
|
|
241
241
|
])) : C("", !0),
|
|
@@ -246,15 +246,15 @@ const ie = ["id"], ue = ["id"], me = {
|
|
|
246
246
|
})) : C("", !0)
|
|
247
247
|
]),
|
|
248
248
|
_: 3
|
|
249
|
-
}, 8, ["aria-labelledby"])) : e.fallback ? (d(), k(
|
|
249
|
+
}, 8, ["aria-labelledby"])) : e.fallback ? (d(), k(o(V), {
|
|
250
250
|
key: 1,
|
|
251
251
|
class: "dark-mode"
|
|
252
252
|
}, {
|
|
253
|
-
default:
|
|
254
|
-
|
|
255
|
-
default:
|
|
256
|
-
|
|
257
|
-
|
|
253
|
+
default: a(() => [
|
|
254
|
+
n(o(H), { class: "request-card-simple" }, {
|
|
255
|
+
default: a(() => [
|
|
256
|
+
h("div", ce, [
|
|
257
|
+
n(o(j), {
|
|
258
258
|
as: "span",
|
|
259
259
|
class: "request-method",
|
|
260
260
|
method: e.operation.method
|
|
@@ -52,6 +52,9 @@ export declare const useMultipleDocuments: ({ configuration, initialIndex, isInt
|
|
|
52
52
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
53
53
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
54
54
|
onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
55
|
+
onLoaded?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
56
|
+
onShowMore?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
57
|
+
onSidebarClick?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
|
|
55
58
|
pathRouting?: {
|
|
56
59
|
basePath: string;
|
|
57
60
|
} | undefined;
|
|
@@ -74,7 +77,6 @@ export declare const useMultipleDocuments: ({ configuration, initialIndex, isInt
|
|
|
74
77
|
name: string;
|
|
75
78
|
method?: string | undefined;
|
|
76
79
|
}, ...args: unknown[]) => string) | undefined;
|
|
77
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
78
80
|
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
79
81
|
defaultOpenAllTags?: boolean | undefined;
|
|
80
82
|
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMultipleDocuments.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultipleDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAA;AAGpC,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAKpD,KAAK,yBAAyB,GAAG;IAC/B;;;OAGG;IACH,aAAa,EAAE,GAAG,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAAA;IAC5D,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,QAAQ,CAAA;AAIZ;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBACnB,4BAA4B,GAAG,SAAS,KACtD,iBAAiB,EA6BnB,CAAA;AA0CD,eAAO,MAAM,oBAAoB,8EAM9B,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useMultipleDocuments.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultipleDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAA;AAGpC,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAKpD,KAAK,yBAAyB,GAAG;IAC/B;;;OAGG;IACH,aAAa,EAAE,GAAG,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAAA;IAC5D,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,QAAQ,CAAA;AAIZ;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBACnB,4BAA4B,GAAG,SAAS,KACtD,iBAAiB,EA6BnB,CAAA;AA0CD,eAAO,MAAM,oBAAoB,8EAM9B,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCA8H6mnB,GAAI;2CAA6E,GAAI;6BAAgE,GAAG;qBAAwE,GAAG;uCAAyF,GAAI;2CAA6F,GAAI;;;;;gBAA0K,CAAC;WAA4B,GAAI;;gBAAyF,CAAC;WAA4B,GAAI;;gBAAuF,CAAC;WAA4B,GAAI;;;;uBAAkJ,CAAC;mBAAqC,CAAC;WAA4B,GAAI;;;kBAAmH,CAAC;WAA4B,GAAI;qCAAyE,GAAI;;2DAAgK,GAAI;4EAAgH,GAAI;;;uDA/KvnqB,GAAG;;;;;;;;;mDAAH,GAAG;;;;;;;;CA8KpE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactiveSpec.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactiveSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"useReactiveSpec.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactiveSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,KAAK,CAAA;AAgDhE;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAChD,QAAQ,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDA"}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ref as s, watch as
|
|
3
|
-
import { parse as
|
|
4
|
-
import { createEmptySpecification as
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
1
|
+
import { fetchDocument as l, prettyPrintJson as d } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { ref as s, watch as u, toValue as f } from "vue";
|
|
3
|
+
import { parse as h } from "../helpers/parse.js";
|
|
4
|
+
import { createEmptySpecification as m } from "../helpers/createEmptySpecification.js";
|
|
5
|
+
const v = async ({ url: a, content: e }, r) => {
|
|
6
|
+
if (a) {
|
|
7
7
|
const i = performance.now();
|
|
8
8
|
try {
|
|
9
|
-
const
|
|
10
|
-
return console.log(`fetch: ${Math.round(
|
|
11
|
-
} catch (
|
|
12
|
-
console.error("Failed to fetch
|
|
9
|
+
const n = await l(a, r), o = performance.now();
|
|
10
|
+
return console.log(`fetch: ${Math.round(o - i)} ms (${a})`), console.log("size:", Math.round(n.length / 1024), "kB"), n;
|
|
11
|
+
} catch (n) {
|
|
12
|
+
console.error("Failed to fetch OpenAPI document from URL:", n);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
const t = typeof
|
|
15
|
+
const t = typeof e == "function" ? e() : e;
|
|
16
16
|
if (typeof t == "string")
|
|
17
17
|
return t;
|
|
18
18
|
if (typeof t == "object")
|
|
19
|
-
return
|
|
19
|
+
return d(t);
|
|
20
20
|
};
|
|
21
|
-
function
|
|
22
|
-
specConfig:
|
|
23
|
-
proxyUrl:
|
|
21
|
+
function C({
|
|
22
|
+
specConfig: a,
|
|
23
|
+
proxyUrl: e
|
|
24
24
|
}) {
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
if (!
|
|
28
|
-
t.value =
|
|
25
|
+
const r = s(""), t = s(m()), i = s(null);
|
|
26
|
+
function n(o) {
|
|
27
|
+
if (!o) {
|
|
28
|
+
t.value = m();
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
proxyUrl:
|
|
33
|
-
}).then((
|
|
34
|
-
i.value = null, t.value =
|
|
35
|
-
}).catch((
|
|
36
|
-
i.value =
|
|
31
|
+
h(o, {
|
|
32
|
+
proxyUrl: e ? f(e) : void 0
|
|
33
|
+
}).then((c) => {
|
|
34
|
+
i.value = null, t.value = c;
|
|
35
|
+
}).catch((c) => {
|
|
36
|
+
i.value = c.toString();
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
return
|
|
40
|
-
() =>
|
|
41
|
-
async (
|
|
42
|
-
var
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
typeof
|
|
39
|
+
return u(
|
|
40
|
+
() => f(a),
|
|
41
|
+
async (o) => {
|
|
42
|
+
var c;
|
|
43
|
+
if (o) {
|
|
44
|
+
const p = (c = await v(o, f(e))) == null ? void 0 : c.trim();
|
|
45
|
+
typeof p == "string" && (r.value = p);
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
{ immediate: !0, deep: !0 }
|
|
49
|
-
),
|
|
50
|
-
|
|
49
|
+
), u(r, () => {
|
|
50
|
+
n(r.value);
|
|
51
51
|
}), {
|
|
52
|
-
rawSpec:
|
|
52
|
+
rawSpec: r,
|
|
53
53
|
parsedSpec: t,
|
|
54
54
|
specErrors: i
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
C as useReactiveSpec
|
|
59
59
|
};
|