@scalar/api-reference 1.25.105 → 1.25.106
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 +7065 -7056
- 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 +119 -131
- package/dist/components/Content/Lazy/Loading.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +2 -2
- package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
- package/dist/components/Content/Models/ModelsAccordion.vue2.js +2 -2
- package/dist/components/Content/Tag/Endpoints.vue2.js +3 -3
- package/dist/components/Content/Tag/TagList.vue.js +3 -3
- package/dist/components/Section/CompactSection.vue2.js +4 -4
- package/dist/components/Section/Section.vue2.js +3 -3
- package/dist/components/Sidebar/Sidebar.vue2.js +3 -3
- package/dist/components/Sidebar/SidebarElement.vue2.js +6 -6
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +2 -2
- package/dist/features/DownloadLink/DownloadLink.vue2.js +14 -21
- package/dist/features/Operation/Webhooks.vue.js +3 -3
- package/dist/features/Operation/Webhooks.vue2.js +9 -9
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -2
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +34 -49
- package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +34 -31
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue2.js +37 -33
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +34 -34
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +12 -12
- package/dist/features/Search/useSearchIndex.js +11 -11
- package/dist/features/TestRequestButton/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/features/TestRequestButton/TestRequestButton.vue.js +2 -2
- package/dist/features/TestRequestButton/TestRequestButton.vue2.js +21 -21
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +59 -60
- package/dist/hooks/useConfig.d.ts +6 -0
- package/dist/hooks/useConfig.d.ts.map +1 -0
- package/dist/hooks/useConfig.js +6 -0
- package/dist/hooks/useNavState.d.ts +8 -3
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +71 -59
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +149 -149
- package/dist/index.js +58 -63
- package/dist/style.css +1 -1
- package/package.json +9 -9
- package/dist/features/Operation/components/RequestBodyPropertiesChild.vue.d.ts +0 -7
- package/dist/features/Operation/components/RequestBodyPropertiesChild.vue.d.ts.map +0 -1
- package/dist/helpers/provideSymbols.d.ts +0 -7
- package/dist/helpers/provideSymbols.d.ts.map +0 -1
- package/dist/helpers/provideSymbols.js +0 -7
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as u,
|
|
1
|
+
import { defineComponent as u, openBlock as a, createBlock as s, unref as o, createSlots as f, withCtx as r, createElementVNode as t, createVNode as i, toDisplayString as h, createCommentVNode as _, withModifiers as y } from "vue";
|
|
2
2
|
import C from "../../../components/OperationPath.vue.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { useConfig as v } from "../../../hooks/useConfig.js";
|
|
4
|
+
import { ScalarIcon as q, ScalarIconButton as b, ScalarMarkdown as k } from "@scalar/components";
|
|
5
|
+
import { useClipboard as E } from "@scalar/use-hooks/useClipboard";
|
|
6
|
+
import S from "../components/OperationParameters.vue.js";
|
|
7
|
+
import g from "../components/OperationResponses.vue.js";
|
|
7
8
|
import B from "../../../components/Section/SectionAccordion.vue.js";
|
|
8
9
|
import R from "../../../components/HttpMethod/HttpMethod.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
const $ = { class: "operation-title" }, L = { class: "operation-details" }, M = { class: "endpoint-label" }, O = { class: "endpoint-label-path" }, U = { class: "endpoint-label-name" }, A = { class: "endpoint-content" }, D = { class: "operation-details-card" }, H = { class: "operation-details-card-item" }, P = { class: "operation-details-card-item" }, ie = /* @__PURE__ */ u({
|
|
10
|
+
import w from "../../../components/Anchor/Anchor.vue.js";
|
|
11
|
+
import I from "../../TestRequestButton/TestRequestButton.vue.js";
|
|
12
|
+
import V from "../../ExampleResponses/ExampleResponses.vue.js";
|
|
13
|
+
import $ from "../../ExampleRequest/ExampleRequest.vue.js";
|
|
14
|
+
const N = { class: "operation-title" }, T = { class: "operation-details" }, A = { class: "endpoint-label" }, L = { class: "endpoint-label-path" }, M = { class: "endpoint-label-name" }, P = { class: "endpoint-content" }, z = { class: "operation-details-card" }, D = { class: "operation-details-card-item" }, O = { class: "operation-details-card-item" }, te = /* @__PURE__ */ u({
|
|
15
15
|
__name: "ClassicLayout",
|
|
16
16
|
props: {
|
|
17
17
|
id: {},
|
|
@@ -20,38 +20,38 @@ const $ = { class: "operation-title" }, L = { class: "operation-details" }, M =
|
|
|
20
20
|
request: {},
|
|
21
21
|
secretCredentials: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const { copyToClipboard: c } =
|
|
23
|
+
setup(U) {
|
|
24
|
+
const { copyToClipboard: c } = E(), m = v();
|
|
25
25
|
return (e, p) => {
|
|
26
26
|
var l;
|
|
27
27
|
return a(), s(o(B), {
|
|
28
28
|
id: e.id,
|
|
29
29
|
class: "reference-endpoint",
|
|
30
30
|
transparent: ""
|
|
31
|
-
},
|
|
31
|
+
}, f({
|
|
32
32
|
title: r(() => [
|
|
33
|
-
t("h3",
|
|
34
|
-
t("div",
|
|
33
|
+
t("h3", N, [
|
|
34
|
+
t("div", T, [
|
|
35
35
|
i(o(R), {
|
|
36
36
|
class: "endpoint-type",
|
|
37
37
|
method: e.operation.httpVerb,
|
|
38
38
|
short: ""
|
|
39
39
|
}, null, 8, ["method"]),
|
|
40
|
-
i(o(
|
|
40
|
+
i(o(w), {
|
|
41
41
|
id: e.id ?? "",
|
|
42
42
|
class: "endpoint-anchor"
|
|
43
43
|
}, {
|
|
44
44
|
default: r(() => {
|
|
45
45
|
var n;
|
|
46
46
|
return [
|
|
47
|
-
t("div",
|
|
48
|
-
t("div",
|
|
47
|
+
t("div", A, [
|
|
48
|
+
t("div", L, [
|
|
49
49
|
i(C, {
|
|
50
50
|
deprecated: (n = e.operation.information) == null ? void 0 : n.deprecated,
|
|
51
51
|
path: e.operation.path
|
|
52
52
|
}, null, 8, ["deprecated", "path"])
|
|
53
53
|
]),
|
|
54
|
-
t("div",
|
|
54
|
+
t("div", M, h(e.operation.name), 1)
|
|
55
55
|
])
|
|
56
56
|
];
|
|
57
57
|
}),
|
|
@@ -63,40 +63,40 @@ const $ = { class: "operation-title" }, L = { class: "operation-details" }, M =
|
|
|
63
63
|
actions: r(({ active: n }) => {
|
|
64
64
|
var d;
|
|
65
65
|
return [
|
|
66
|
-
n ? (a(), s(o(
|
|
66
|
+
n ? (a(), s(o(I), {
|
|
67
67
|
key: 0,
|
|
68
68
|
operation: e.operation
|
|
69
|
-
}, null, 8, ["operation"])) : (d = o(m)) != null && d
|
|
69
|
+
}, null, 8, ["operation"])) : (d = o(m)) != null && d.hideTestRequestButton ? _("", !0) : (a(), s(o(q), {
|
|
70
70
|
key: 1,
|
|
71
71
|
class: "endpoint-try-hint",
|
|
72
72
|
icon: "Play",
|
|
73
73
|
thickness: "1.75px"
|
|
74
74
|
})),
|
|
75
|
-
i(o(
|
|
75
|
+
i(o(b), {
|
|
76
76
|
class: "endpoint-copy",
|
|
77
77
|
icon: "Clipboard",
|
|
78
78
|
label: "Copy endpoint URL",
|
|
79
79
|
size: "xs",
|
|
80
80
|
variant: "ghost",
|
|
81
|
-
onClick: p[0] || (p[0] =
|
|
81
|
+
onClick: p[0] || (p[0] = y((j) => o(c)(e.operation.path), ["stop"]))
|
|
82
82
|
})
|
|
83
83
|
];
|
|
84
84
|
}),
|
|
85
85
|
default: r(() => [
|
|
86
|
-
t("div",
|
|
87
|
-
t("div",
|
|
88
|
-
t("div",
|
|
89
|
-
i(
|
|
86
|
+
t("div", P, [
|
|
87
|
+
t("div", z, [
|
|
88
|
+
t("div", D, [
|
|
89
|
+
i(S, { operation: e.requestEntity }, null, 8, ["operation"])
|
|
90
90
|
]),
|
|
91
|
-
t("div",
|
|
92
|
-
i(
|
|
91
|
+
t("div", O, [
|
|
92
|
+
i(g, {
|
|
93
93
|
collapsableItems: !1,
|
|
94
94
|
operation: e.operation
|
|
95
95
|
}, null, 8, ["operation"])
|
|
96
96
|
])
|
|
97
97
|
]),
|
|
98
|
-
i(o(
|
|
99
|
-
i(o(
|
|
98
|
+
i(o(V), { operation: e.operation }, null, 8, ["operation"]),
|
|
99
|
+
i(o($), {
|
|
100
100
|
operation: e.operation,
|
|
101
101
|
request: e.request,
|
|
102
102
|
secretCredentials: e.secretCredentials
|
|
@@ -110,7 +110,7 @@ const $ = { class: "operation-title" }, L = { class: "operation-details" }, M =
|
|
|
110
110
|
fn: r(() => {
|
|
111
111
|
var n;
|
|
112
112
|
return [
|
|
113
|
-
i(o(
|
|
113
|
+
i(o(k), {
|
|
114
114
|
value: (n = e.requestEntity) == null ? void 0 : n.description,
|
|
115
115
|
withImages: ""
|
|
116
116
|
}, null, 8, ["value"])
|
|
@@ -123,5 +123,5 @@ const $ = { class: "operation-title" }, L = { class: "operation-details" }, M =
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
export {
|
|
126
|
-
|
|
126
|
+
te as default
|
|
127
127
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ModernLayout.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-00148270"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as c, openBlock as d, createBlock as m, unref as t, withCtx as r, createVNode as o, createTextVNode as s, createCommentVNode as C, createElementVNode as n, normalizeClass as h, toDisplayString as
|
|
2
|
-
import
|
|
3
|
-
import { ScalarMarkdown as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as c, openBlock as d, createBlock as m, unref as t, withCtx as r, createVNode as o, createTextVNode as s, createCommentVNode as C, createElementVNode as n, normalizeClass as h, toDisplayString as q } from "vue";
|
|
2
|
+
import _ from "../../../components/OperationPath.vue.js";
|
|
3
|
+
import { ScalarMarkdown as y, ScalarErrorBoundary as u } from "@scalar/components";
|
|
4
|
+
import S from "../components/OperationParameters.vue.js";
|
|
5
|
+
import E from "../components/OperationResponses.vue.js";
|
|
6
|
+
import v from "../../../components/Section/Section.vue.js";
|
|
7
7
|
import k from "../../../components/Section/SectionContent.vue.js";
|
|
8
8
|
import B from "../../../components/Badge/Badge.vue.js";
|
|
9
9
|
import g from "../../../components/Section/SectionHeader.vue.js";
|
|
@@ -23,7 +23,7 @@ const D = { class: "operation-details" }, M = { class: "examples" }, W = /* @__P
|
|
|
23
23
|
secretCredentials: {}
|
|
24
24
|
},
|
|
25
25
|
setup(T) {
|
|
26
|
-
return (e, i) => (d(), m(t(
|
|
26
|
+
return (e, i) => (d(), m(t(v), {
|
|
27
27
|
id: e.id,
|
|
28
28
|
label: e.operation.name
|
|
29
29
|
}, {
|
|
@@ -47,7 +47,7 @@ const D = { class: "operation-details" }, M = { class: "examples" }, W = /* @__P
|
|
|
47
47
|
id: e.id ?? ""
|
|
48
48
|
}, {
|
|
49
49
|
default: r(() => [
|
|
50
|
-
s(
|
|
50
|
+
s(q(e.operation.name), 1)
|
|
51
51
|
]),
|
|
52
52
|
_: 1
|
|
53
53
|
}, 8, ["id"])
|
|
@@ -62,12 +62,12 @@ const D = { class: "operation-details" }, M = { class: "examples" }, W = /* @__P
|
|
|
62
62
|
var a;
|
|
63
63
|
return [
|
|
64
64
|
n("div", D, [
|
|
65
|
-
o(t(
|
|
65
|
+
o(t(y), {
|
|
66
66
|
value: (a = e.requestEntity) == null ? void 0 : a.description,
|
|
67
67
|
withImages: ""
|
|
68
68
|
}, null, 8, ["value"]),
|
|
69
|
-
o(
|
|
70
|
-
o(
|
|
69
|
+
o(S, { operation: e.requestEntity }, null, 8, ["operation"]),
|
|
70
|
+
o(E, { operation: e.operation }, null, 8, ["operation"])
|
|
71
71
|
])
|
|
72
72
|
];
|
|
73
73
|
}),
|
|
@@ -87,7 +87,7 @@ const D = { class: "operation-details" }, M = { class: "examples" }, W = /* @__P
|
|
|
87
87
|
header: r(() => {
|
|
88
88
|
var a;
|
|
89
89
|
return [
|
|
90
|
-
o(
|
|
90
|
+
o(_, {
|
|
91
91
|
class: "example-path",
|
|
92
92
|
deprecated: (a = e.operation.information) == null ? void 0 : a.deprecated,
|
|
93
93
|
path: e.operation.path
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import N from "fuse.js";
|
|
2
2
|
import { ref as h, watch as R, computed as V } from "vue";
|
|
3
3
|
import { extractRequestBody as A } from "../../helpers/specHelpers.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { useOperation as B } from "../../hooks/useOperation.js";
|
|
5
|
+
import { useNavState as P } from "../../hooks/useNavState.js";
|
|
6
|
+
import { useSidebar as z } from "../../hooks/useSidebar.js";
|
|
7
|
+
import { getHeadingsFromMarkdown as G } from "../../helpers/getHeadingsFromMarkdown.js";
|
|
8
|
+
import { getModels as J } from "../../helpers/getModels.js";
|
|
9
9
|
function te({
|
|
10
10
|
specification: a
|
|
11
11
|
}) {
|
|
12
|
-
const { getHeadingId: T, getWebhookId: j, getModelId: L, getOperationId: W, getTagId: q } =
|
|
12
|
+
const { getHeadingId: T, getWebhookId: j, getModelId: L, getOperationId: W, getTagId: q } = P(), { hideModels: C } = z(), o = h([]), r = h([]), d = h(0), s = h(""), i = new N(o.value, {
|
|
13
13
|
keys: ["title", "description", "body"]
|
|
14
14
|
}), p = () => {
|
|
15
15
|
d.value = 0, r.value = i.search(s.value);
|
|
@@ -33,7 +33,7 @@ function te({
|
|
|
33
33
|
i.setCollection([]);
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
const l = [], u =
|
|
36
|
+
const l = [], u = G(
|
|
37
37
|
((w = (M = a.value) == null ? void 0 : M.info) == null ? void 0 : w.description) ?? ""
|
|
38
38
|
);
|
|
39
39
|
u.length && (u.forEach((e) => {
|
|
@@ -55,7 +55,7 @@ function te({
|
|
|
55
55
|
body: ""
|
|
56
56
|
};
|
|
57
57
|
o.value.push(S), e.operations && e.operations.forEach((t) => {
|
|
58
|
-
const { parameterMap: n } =
|
|
58
|
+
const { parameterMap: n } = B(t), x = A(t) || n.value;
|
|
59
59
|
let f = null;
|
|
60
60
|
typeof x != "boolean" && (f = x);
|
|
61
61
|
const O = {
|
|
@@ -81,7 +81,7 @@ function te({
|
|
|
81
81
|
m.push({
|
|
82
82
|
type: "webhook",
|
|
83
83
|
title: `Webhook: ${(n = c[e][t]) == null ? void 0 : n.name}`,
|
|
84
|
-
href: `#${j(e, t)}`,
|
|
84
|
+
href: `#${j({ name: e, method: t })}`,
|
|
85
85
|
description: e,
|
|
86
86
|
httpVerb: t,
|
|
87
87
|
tag: e,
|
|
@@ -89,12 +89,12 @@ function te({
|
|
|
89
89
|
});
|
|
90
90
|
}), o.value = o.value.concat(m);
|
|
91
91
|
});
|
|
92
|
-
const v = C.value ? {} :
|
|
92
|
+
const v = C.value ? {} : J(a.value), b = [];
|
|
93
93
|
v && (Object.keys(v).forEach((e) => {
|
|
94
94
|
b.push({
|
|
95
95
|
type: "model",
|
|
96
96
|
title: "Model",
|
|
97
|
-
href: `#${L(e)}`,
|
|
97
|
+
href: `#${L({ name: e })}`,
|
|
98
98
|
description: v[e].title ?? e,
|
|
99
99
|
tag: e,
|
|
100
100
|
body: ""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestRequestButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/TestRequestButton/TestRequestButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TestRequestButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/TestRequestButton/TestRequestButton.vue"],"names":[],"mappings":"AA2EA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAIhE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAiGF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./TestRequestButton.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-7497300b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { defineComponent as d,
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useApiClient as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as d, unref as o, openBlock as p, createElementBlock as i, withModifiers as f, createVNode as s, createElementVNode as h, withCtx as c, createTextVNode as a, toDisplayString as m, Fragment as b } from "vue";
|
|
2
|
+
import V from "../../components/ScreenReader.vue.js";
|
|
3
|
+
import { useConfig as k } from "../../hooks/useConfig.js";
|
|
4
|
+
import { ScalarIcon as y } from "@scalar/components";
|
|
5
|
+
import { useApiClient as C } from "../ApiClientModal/useApiClient.js";
|
|
6
|
+
const g = ["method"], E = /* @__PURE__ */ d({
|
|
7
7
|
__name: "TestRequestButton",
|
|
8
8
|
props: {
|
|
9
9
|
operation: {}
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
return (
|
|
11
|
+
setup(B) {
|
|
12
|
+
const { client: u } = C(), l = k();
|
|
13
|
+
return (e, t) => {
|
|
14
14
|
var n;
|
|
15
|
-
return ((n = o(l)) == null ? void 0 : n
|
|
15
|
+
return ((n = o(l)) == null ? void 0 : n.hideTestRequestButton) !== !0 ? (p(), i("button", {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "show-api-client-button",
|
|
18
|
-
method:
|
|
18
|
+
method: e.operation.httpVerb,
|
|
19
19
|
type: "button",
|
|
20
|
-
onClick:
|
|
20
|
+
onClick: t[0] || (t[0] = f((R) => {
|
|
21
21
|
var r;
|
|
22
22
|
return (r = o(u)) == null ? void 0 : r.open({
|
|
23
|
-
path:
|
|
24
|
-
method:
|
|
23
|
+
path: e.operation.path,
|
|
24
|
+
method: e.operation.httpVerb
|
|
25
25
|
});
|
|
26
26
|
}, ["stop"]))
|
|
27
27
|
}, [
|
|
28
|
-
s(o(
|
|
28
|
+
s(o(y), {
|
|
29
29
|
icon: "Play",
|
|
30
30
|
size: "sm"
|
|
31
31
|
}),
|
|
32
|
-
|
|
33
|
-
s(
|
|
34
|
-
default:
|
|
35
|
-
a("(" + m(
|
|
32
|
+
t[1] || (t[1] = h("span", null, "Test Request", -1)),
|
|
33
|
+
s(V, null, {
|
|
34
|
+
default: c(() => [
|
|
35
|
+
a("(" + m(e.operation.httpVerb) + " " + m(e.operation.path) + ")", 1)
|
|
36
36
|
]),
|
|
37
37
|
_: 1
|
|
38
38
|
})
|
|
39
|
-
], 8,
|
|
39
|
+
], 8, g)) : (p(), i(b, { key: 1 }, [
|
|
40
40
|
a(" ")
|
|
41
41
|
], 64));
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
E as default
|
|
47
47
|
};
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export * from './joinWithSlash.js';
|
|
|
14
14
|
export * from './mapFromObject.js';
|
|
15
15
|
export * from './mergeAllObjects.js';
|
|
16
16
|
export * from './parse.js';
|
|
17
|
-
export * from './provideSymbols.js';
|
|
18
17
|
export * from './scrollToId.js';
|
|
19
18
|
export * from './sleep.js';
|
|
20
19
|
export * from './specDownloads.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAMxD;;;;GAIG;AACH,eAAO,MAAM,KAAK,kBACD,aAAa,GAAG,MAAM,GAAG,SAAS,kBAG9C;IACD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,KACA,OAAO,CAAC,IAAI,CA0Dd,CAAA"}
|
package/dist/helpers/parse.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createEmptySpecification as O } from "./createEmptySpecification.js";
|
|
|
5
5
|
import { normalizeRequestMethod as k } from "../legacy/helpers/normalizeRequestMethod.js";
|
|
6
6
|
import { validRequestMethods as F } from "../legacy/fixtures/httpRequestMethods.js";
|
|
7
7
|
const H = (m, {
|
|
8
|
-
proxyUrl:
|
|
8
|
+
proxyUrl: t
|
|
9
9
|
} = {}) => new Promise(async (o, E) => {
|
|
10
10
|
var h;
|
|
11
11
|
try {
|
|
@@ -13,51 +13,51 @@ const H = (m, {
|
|
|
13
13
|
return o(
|
|
14
14
|
I(O())
|
|
15
15
|
);
|
|
16
|
-
const
|
|
16
|
+
const f = performance.now(), { filesystem: s } = await M(m, {
|
|
17
17
|
plugins: [
|
|
18
18
|
C({
|
|
19
|
-
fetch: (
|
|
19
|
+
fetch: (n) => fetch(t ? R(t, n) : n)
|
|
20
20
|
})
|
|
21
21
|
]
|
|
22
|
-
}), { schema:
|
|
23
|
-
return console.log(`dereference: ${Math.round(
|
|
22
|
+
}), { schema: a, errors: r } = await q(s), e = performance.now();
|
|
23
|
+
return console.log(`dereference: ${Math.round(e - f)} ms`), r != null && r.length && console.warn(
|
|
24
24
|
`Please open an issue on https://github.com/scalar/scalar
|
|
25
25
|
`,
|
|
26
26
|
`Scalar OpenAPI Parser Warning:
|
|
27
27
|
`,
|
|
28
|
-
|
|
29
|
-
),
|
|
28
|
+
r
|
|
29
|
+
), a === void 0 ? (E(((h = r == null ? void 0 : r[0]) == null ? void 0 : h.message) ?? "Failed to parse the OpenAPI file."), o(
|
|
30
30
|
I(O())
|
|
31
|
-
)) : o(I(
|
|
32
|
-
} catch (
|
|
31
|
+
)) : o(I(a));
|
|
32
|
+
} catch (f) {
|
|
33
33
|
console.error(
|
|
34
34
|
"[@scalar/api-reference]",
|
|
35
35
|
"Failed to parse the OpenAPI document. It might be invalid?"
|
|
36
|
-
), console.error(
|
|
36
|
+
), console.error(f), E(f);
|
|
37
37
|
}
|
|
38
38
|
return o(
|
|
39
39
|
I(O())
|
|
40
40
|
);
|
|
41
41
|
}), I = (m) => {
|
|
42
|
-
var h;
|
|
43
|
-
let
|
|
44
|
-
m && typeof m == "object" ?
|
|
42
|
+
var h, f;
|
|
43
|
+
let t = {};
|
|
44
|
+
m && typeof m == "object" ? t = structuredClone(m) : t = O(), t.tags || (t.tags = []), t.paths || (t.paths = {});
|
|
45
45
|
const o = {};
|
|
46
|
-
return Object.keys(
|
|
47
|
-
var
|
|
48
|
-
Object.keys(((
|
|
49
|
-
var n,
|
|
50
|
-
const
|
|
51
|
-
if (!(!
|
|
52
|
-
if (Array.isArray(
|
|
53
|
-
const
|
|
54
|
-
var
|
|
55
|
-
return (
|
|
46
|
+
return Object.keys(t.webhooks ?? {}).forEach((s) => {
|
|
47
|
+
var a;
|
|
48
|
+
Object.keys(((a = t.webhooks) == null ? void 0 : a[s]) ?? {}).forEach((r) => {
|
|
49
|
+
var n, l, g, y;
|
|
50
|
+
const e = (n = t.webhooks) == null ? void 0 : n[s][r];
|
|
51
|
+
if (!(!e || u(e))) {
|
|
52
|
+
if (Array.isArray(e.tags)) {
|
|
53
|
+
const i = (l = e.tags) == null ? void 0 : l.map((c) => {
|
|
54
|
+
var w;
|
|
55
|
+
return (w = t.tags) == null ? void 0 : w.find((p) => p.name === c);
|
|
56
56
|
});
|
|
57
|
-
if (
|
|
58
|
-
(
|
|
59
|
-
),
|
|
60
|
-
(
|
|
57
|
+
if (e.tags = i == null ? void 0 : i.filter(
|
|
58
|
+
(c) => !u(c)
|
|
59
|
+
), i != null && i.some(
|
|
60
|
+
(c) => u(c)
|
|
61
61
|
))
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
@@ -65,70 +65,69 @@ const H = (m, {
|
|
|
65
65
|
// Transformed data
|
|
66
66
|
httpVerb: k(r),
|
|
67
67
|
path: s,
|
|
68
|
-
operationId: (
|
|
69
|
-
name: (
|
|
70
|
-
description: (
|
|
71
|
-
pathParameters: (
|
|
68
|
+
operationId: (e == null ? void 0 : e.operationId) || s,
|
|
69
|
+
name: (e == null ? void 0 : e.summary) || s || "",
|
|
70
|
+
description: (e == null ? void 0 : e.description) || "",
|
|
71
|
+
pathParameters: (y = (g = t.paths) == null ? void 0 : g[s]) == null ? void 0 : y.parameters,
|
|
72
72
|
// Original webhook
|
|
73
73
|
information: {
|
|
74
|
-
...
|
|
74
|
+
...e
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
}), Object.keys(((h =
|
|
80
|
-
var
|
|
81
|
-
u((r = (
|
|
82
|
-
}), Object.keys(
|
|
83
|
-
Object.keys(
|
|
79
|
+
}), Object.keys(((h = t.components) == null ? void 0 : h.schemas) ?? {}).forEach((s) => {
|
|
80
|
+
var a, r, e, n;
|
|
81
|
+
u((r = (a = t.components) == null ? void 0 : a.schemas) == null ? void 0 : r[s]) && ((n = (e = t.components) == null ? void 0 : e.schemas) == null || delete n[s]);
|
|
82
|
+
}), Object.keys(t.paths).forEach((s) => {
|
|
83
|
+
Object.keys(t.paths[s]).filter(
|
|
84
84
|
(r) => F.includes(r.toUpperCase())
|
|
85
85
|
).forEach((r) => {
|
|
86
|
-
var
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
86
|
+
var l, g, y, i, c, w;
|
|
87
|
+
const e = t.paths[s][r];
|
|
88
|
+
if (e === void 0 || u(e))
|
|
89
89
|
return;
|
|
90
90
|
const n = {
|
|
91
91
|
httpVerb: k(r),
|
|
92
92
|
path: s,
|
|
93
|
-
operationId:
|
|
94
|
-
name:
|
|
95
|
-
description:
|
|
93
|
+
operationId: e.operationId || s,
|
|
94
|
+
name: e.summary || s || "",
|
|
95
|
+
description: e.description || "",
|
|
96
96
|
information: {
|
|
97
|
-
...
|
|
97
|
+
...e
|
|
98
98
|
},
|
|
99
|
-
pathParameters: (
|
|
99
|
+
pathParameters: (g = (l = t.paths) == null ? void 0 : l[s]) == null ? void 0 : g.parameters
|
|
100
100
|
};
|
|
101
|
-
if (!
|
|
102
|
-
(
|
|
101
|
+
if (!e.tags || e.tags.length === 0) {
|
|
102
|
+
(y = t.tags) != null && y.find(
|
|
103
103
|
(d) => d.name === "default"
|
|
104
|
-
) || (
|
|
104
|
+
) || (i = t.tags) == null || i.push({
|
|
105
105
|
name: "default",
|
|
106
106
|
description: "",
|
|
107
107
|
operations: []
|
|
108
108
|
});
|
|
109
|
-
const p = (
|
|
109
|
+
const p = (c = t.tags) == null ? void 0 : c.findIndex(
|
|
110
110
|
(d) => d.name === "default"
|
|
111
111
|
);
|
|
112
|
-
p >= 0 && ((
|
|
112
|
+
p >= 0 && ((w = t.tags[p]) == null || w.operations.push(n));
|
|
113
113
|
} else
|
|
114
|
-
|
|
114
|
+
e.tags.forEach((p) => {
|
|
115
115
|
var b, x, j;
|
|
116
|
-
const d = (b =
|
|
116
|
+
const d = (b = t.tags) == null ? void 0 : b.findIndex(
|
|
117
117
|
(A) => A.name === p
|
|
118
118
|
);
|
|
119
|
-
d === -1 && ((x =
|
|
119
|
+
d === -1 && ((x = t.tags) == null || x.push({
|
|
120
120
|
name: p,
|
|
121
121
|
description: ""
|
|
122
122
|
}));
|
|
123
|
-
const P = d !== -1 ? d :
|
|
124
|
-
typeof ((j =
|
|
123
|
+
const P = d !== -1 ? d : t.tags.length - 1;
|
|
124
|
+
typeof ((j = t.tags[P]) == null ? void 0 : j.operations) > "u" && (t.tags[P].operations = []), t.tags[P].operations.push(n);
|
|
125
125
|
});
|
|
126
|
-
e.tags = (w = e.tags) == null ? void 0 : w.filter(
|
|
127
|
-
(p) => !u(p)
|
|
128
|
-
);
|
|
129
126
|
});
|
|
130
|
-
}),
|
|
131
|
-
|
|
127
|
+
}), t.tags = (f = t.tags) == null ? void 0 : f.filter(
|
|
128
|
+
(s) => !u(s)
|
|
129
|
+
), {
|
|
130
|
+
...t,
|
|
132
131
|
webhooks: o
|
|
133
132
|
};
|
|
134
133
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReferenceConfiguration } from '../types';
|
|
2
|
+
import { type InjectionKey } from 'vue';
|
|
3
|
+
export declare const CONFIGURATION_SYMBOL: InjectionKey<ReferenceConfiguration>;
|
|
4
|
+
/** Hook for easy access to the reference configuration */
|
|
5
|
+
export declare const useConfig: () => ReferenceConfiguration | undefined;
|
|
6
|
+
//# sourceMappingURL=useConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,KAAK,CAAA;AAE/C,eAAO,MAAM,oBAAoB,EACnB,YAAY,CAAC,sBAAsB,CAAC,CAAA;AAElD,0DAA0D;AAC1D,eAAO,MAAM,SAAS,0CAGrB,CAAA"}
|
|
@@ -31,13 +31,18 @@ export declare const useNavState: () => {
|
|
|
31
31
|
replaceUrlState: (replacementHash: string, url?: string) => void;
|
|
32
32
|
/** Gets the portion of the hash used by the references */
|
|
33
33
|
getReferenceHash: () => string;
|
|
34
|
-
getWebhookId: (
|
|
35
|
-
|
|
34
|
+
getWebhookId: (webhook?: {
|
|
35
|
+
name: string;
|
|
36
|
+
method?: string;
|
|
37
|
+
}) => string;
|
|
38
|
+
getModelId: (model?: {
|
|
39
|
+
name: string;
|
|
40
|
+
}) => string;
|
|
36
41
|
getHeadingId: (heading: Heading) => string;
|
|
37
42
|
getOperationId: (operation: TransformedOperation, parentTag: Tag) => string;
|
|
38
43
|
getPathRoutingId: (pathName: string) => string;
|
|
39
44
|
getSectionId: (hashStr?: string) => string;
|
|
40
|
-
getTagId: (
|
|
45
|
+
getTagId: (tag: Tag) => string;
|
|
41
46
|
isIntersectionEnabled: import("vue").Ref<boolean, boolean>;
|
|
42
47
|
pathRouting: import("vue").Ref<PathRouting | undefined, PathRouting | undefined>;
|
|
43
48
|
updateHash: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAI9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAqF3C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;IAsDpB,mCAAmC;4BACX,MAAM;IAG9B;;;;OAIG;+BAnF0B,MAAM;IAqFnC;;;;;OAKG;oCApGY,MAAM;IAsGrB;;;OAGG;uCA9HY,MAAM;IAgIrB,0DAA0D;;6BAjC5B;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;yBA5BrC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;4BATb,OAAO;gCAyBH,oBAAoB,aAAa,GAAG;iCA9GrC,MAAM;;oBAuGjB,GAAG;;;;CAiE3B,CAAA"}
|