@scalar/api-reference 1.25.68 → 1.25.70
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 +42 -0
- package/dist/browser/standalone.js +10519 -10533
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +1 -1
- package/dist/components/Content/Content.vue.d.ts +4 -2
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +1 -1
- package/dist/components/Content/Content.vue2.js +33 -33
- package/dist/components/Content/Lazy/Loading.vue.d.ts +3 -3
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +27 -27
- 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/Tag/TagList.vue.d.ts +1 -1
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +33 -35
- package/dist/components/Content/Webhooks/index.d.ts +1 -1
- package/dist/components/Content/Webhooks/index.d.ts.map +1 -1
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/{Content/Operation/EndpointPath.vue.d.ts → OperationPath.vue.d.ts} +1 -1
- package/dist/components/OperationPath.vue.d.ts.map +1 -0
- package/dist/components/OperationPath.vue.js +7 -0
- package/dist/components/OperationPath.vue2.js +23 -0
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +2 -2
- package/dist/components/Section/Section.vue2.js +4 -4
- package/dist/components/Section/SectionContainer.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainer.vue.js +2 -2
- package/dist/embeds/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +3 -3
- package/dist/features/BaseUrl/ServerVariablesForm.vue.js +1 -1
- package/dist/{components/Content/Operation/EndpointDetailsCard.vue.d.ts → features/Operation/Operation.vue.d.ts} +6 -2
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -0
- package/dist/features/Operation/Operation.vue.js +25 -0
- package/dist/features/Operation/Operation.vue2.js +4 -0
- package/dist/features/Operation/Webhooks.vue.d.ts.map +1 -0
- package/dist/features/Operation/Webhooks.vue.js +7 -0
- package/dist/{components/Content/Webhooks → features/Operation}/Webhooks.vue2.js +12 -12
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -0
- package/dist/{components/Content/Operation → features/Operation/components}/ContentTypeSelect.vue.js +2 -2
- package/dist/{components/Content/Operation → features/Operation/components}/ContentTypeSelect.vue2.js +8 -8
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +7 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/OperationParameters.vue.js +71 -0
- package/dist/features/Operation/components/OperationParameters.vue2.js +4 -0
- package/dist/{components/Content/Operation/EndpointDetails.vue.d.ts → features/Operation/components/OperationResponses.vue.d.ts} +5 -2
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/OperationResponses.vue.js +25 -0
- package/dist/features/Operation/components/OperationResponses.vue2.js +4 -0
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/ParameterHeaders.vue.js +7 -0
- package/dist/{components/Content/Operation → features/Operation/components}/ParameterHeaders.vue2.js +8 -8
- package/dist/{components/Content/Operation/Parameters.vue.d.ts → features/Operation/components/ParameterList.vue.d.ts} +3 -3
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/ParameterList.vue.js +7 -0
- package/dist/{components/Content/Operation/Parameters.vue2.js → features/Operation/components/ParameterList.vue2.js} +7 -7
- package/dist/{components/Content/Operation/ParameterItem.vue.d.ts → features/Operation/components/ParameterListItem.vue.d.ts} +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/ParameterListItem.vue.js +7 -0
- package/dist/{components/Content/Operation/ParameterItem.vue2.js → features/Operation/components/ParameterListItem.vue2.js} +20 -20
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -0
- package/dist/{components/Content/Operation → features/Operation/components}/RequestBody.vue.js +1 -1
- package/dist/{components/Content/Operation → features/Operation/components}/RequestBody.vue2.js +1 -1
- package/dist/features/Operation/components/RequestBodyPropertiesChild.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/Webhook.vue.d.ts.map +1 -0
- package/dist/{components/Content/Webhooks → features/Operation/components}/Webhook.vue.js +2 -2
- package/dist/features/Operation/components/Webhook.vue2.js +29 -0
- package/dist/{hooks → features/Operation/hooks}/useResponses.d.ts +1 -1
- package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -0
- package/dist/features/Operation/index.d.ts +3 -0
- package/dist/features/Operation/index.d.ts.map +1 -0
- package/dist/{components/Content/Operation/OperationAccordion.vue.d.ts → features/Operation/layouts/ClassicLayout.vue.d.ts} +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +7 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +114 -0
- package/dist/{components/Content/Operation/Operation.vue.d.ts → features/Operation/layouts/ModernLayout.vue.d.ts} +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.js +7 -0
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +114 -0
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +1 -1
- package/dist/features/Search/useSearchIndex.js +8 -8
- package/dist/features/TestRequestButton/TestRequestButton.vue.d.ts.map +1 -0
- package/dist/features/TestRequestButton/TestRequestButton.vue.js +7 -0
- package/dist/{components/Content/Operation → features/TestRequestButton}/TestRequestButton.vue2.js +6 -6
- package/dist/features/TestRequestButton/index.d.ts +2 -0
- package/dist/features/TestRequestButton/index.d.ts.map +1 -0
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +55 -52
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useOperation.d.ts +7 -10
- package/dist/hooks/useOperation.d.ts.map +1 -1
- package/dist/hooks/useOperation.js +13 -11
- package/dist/index.js +12 -14
- package/dist/legacy/components/CardFormGroup.vue.d.ts.map +1 -1
- package/dist/legacy/components/CardFormGroup.vue.js +1 -1
- package/dist/legacy/components/SecurityScheme.vue2.js +6 -6
- package/dist/legacy/components/SecuritySchemeSelector.vue.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +11 -10
- package/dist/components/Content/Operation/ContentTypeSelect.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/EndpointDetails.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/EndpointDetails.vue.js +0 -88
- package/dist/components/Content/Operation/EndpointDetails.vue2.js +0 -4
- package/dist/components/Content/Operation/EndpointDetailsCard.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/EndpointDetailsCard.vue.js +0 -7
- package/dist/components/Content/Operation/EndpointDetailsCard.vue2.js +0 -67
- package/dist/components/Content/Operation/EndpointPath.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/EndpointPath.vue.js +0 -7
- package/dist/components/Content/Operation/EndpointPath.vue2.js +0 -23
- package/dist/components/Content/Operation/Operation.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/Operation.vue.js +0 -7
- package/dist/components/Content/Operation/Operation.vue2.js +0 -105
- package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/OperationAccordion.vue.js +0 -7
- package/dist/components/Content/Operation/OperationAccordion.vue2.js +0 -103
- package/dist/components/Content/Operation/ParameterHeaders.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/ParameterHeaders.vue.js +0 -7
- package/dist/components/Content/Operation/ParameterItem.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/ParameterItem.vue.js +0 -7
- package/dist/components/Content/Operation/Parameters.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/Parameters.vue.js +0 -7
- package/dist/components/Content/Operation/RequestBody.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/RequestBodyPropertiesChild.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +0 -1
- package/dist/components/Content/Operation/TestRequestButton.vue.js +0 -7
- package/dist/components/Content/Operation/index.d.ts +0 -3
- package/dist/components/Content/Operation/index.d.ts.map +0 -1
- package/dist/components/Content/Webhooks/Webhook.vue.d.ts.map +0 -1
- package/dist/components/Content/Webhooks/Webhook.vue2.js +0 -39
- package/dist/components/Content/Webhooks/Webhooks.vue.d.ts.map +0 -1
- package/dist/components/Content/Webhooks/Webhooks.vue.js +0 -7
- package/dist/hooks/useResponses.d.ts.map +0 -1
- /package/dist/{components/Content/Webhooks → features/Operation}/Webhooks.vue.d.ts +0 -0
- /package/dist/{components/Content/Operation → features/Operation/components}/ContentTypeSelect.vue.d.ts +0 -0
- /package/dist/{components/Content/Operation → features/Operation/components}/ParameterHeaders.vue.d.ts +0 -0
- /package/dist/{components/Content/Operation → features/Operation/components}/RequestBody.vue.d.ts +0 -0
- /package/dist/{components/Content/Operation → features/Operation/components}/RequestBodyPropertiesChild.vue.d.ts +0 -0
- /package/dist/{components/Content/Webhooks → features/Operation/components}/Webhook.vue.d.ts +0 -0
- /package/dist/{hooks → features/Operation/hooks}/useResponses.js +0 -0
- /package/dist/{components/Content/Operation → features/TestRequestButton}/TestRequestButton.vue.d.ts +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as n, openBlock as a, createElementBlock as m, Fragment as s, createVNode as r, withCtx as p, createTextVNode as i, createCommentVNode as d } from "vue";
|
|
2
|
+
import u from "./OperationResponses.vue.js";
|
|
3
|
+
import k from "./RequestBody.vue.js";
|
|
4
|
+
const c = /* @__PURE__ */ n({
|
|
5
|
+
__name: "Webhook",
|
|
6
|
+
props: {
|
|
7
|
+
webhook: {}
|
|
8
|
+
},
|
|
9
|
+
setup(l) {
|
|
10
|
+
return (e, o) => {
|
|
11
|
+
var t;
|
|
12
|
+
return e.webhook ? (a(), m(s, { key: 0 }, [
|
|
13
|
+
r(k, {
|
|
14
|
+
class: "webhook-request-body",
|
|
15
|
+
requestBody: (t = e.webhook.information) == null ? void 0 : t.requestBody
|
|
16
|
+
}, {
|
|
17
|
+
title: p(() => o[0] || (o[0] = [
|
|
18
|
+
i("Payload")
|
|
19
|
+
])),
|
|
20
|
+
_: 1
|
|
21
|
+
}, 8, ["requestBody"]),
|
|
22
|
+
r(u, { operation: e.webhook }, null, 8, ["operation"])
|
|
23
|
+
], 64)) : d("", !0);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
c as default
|
|
29
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OpenAPI } from '@scalar/openapi-types';
|
|
2
2
|
import type { RequestBodyMimeTypes, TransformedOperation } from '@scalar/types/legacy';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Generates the responses for the request from the parameters in the OpenAPI document
|
|
5
5
|
*/
|
|
6
6
|
export declare function useResponses(operation: TransformedOperation): {
|
|
7
7
|
responses: import("vue").ComputedRef<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResponses.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useResponses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAG7B;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,oBAAoB;;cAOhD,MAAM;qBACC,MAAM;iBACV,oBAAoB;kBACnB;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAA;SAAE;;EAkBtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/Operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -5,4 +5,4 @@ type __VLS_Props = {
|
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
export default _default;
|
|
8
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=ClassicLayout.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"names":[],"mappings":"AA4RA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAShE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAsPF,wBAOG"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { defineComponent as m, inject as f, openBlock as r, createBlock as s, unref as e, createSlots as h, withCtx as n, createElementVNode as t, createVNode as i, toDisplayString as u, createCommentVNode as _, withModifiers as v } from "vue";
|
|
2
|
+
import y from "../../../components/OperationPath.vue.js";
|
|
3
|
+
import { ScalarIcon as b, ScalarIconButton as C, ScalarMarkdown as S } from "@scalar/components";
|
|
4
|
+
import { useClipboard as k } from "@scalar/use-hooks/useClipboard";
|
|
5
|
+
import T from "../components/OperationParameters.vue.js";
|
|
6
|
+
import B from "../components/OperationResponses.vue.js";
|
|
7
|
+
import E from "../../../components/Section/SectionAccordion.vue.js";
|
|
8
|
+
import R from "../../../components/HttpMethod/HttpMethod.vue.js";
|
|
9
|
+
import I from "../../../components/Anchor/Anchor.vue.js";
|
|
10
|
+
import g from "../../TestRequestButton/TestRequestButton.vue.js";
|
|
11
|
+
import w from "../../ExampleResponses/ExampleResponses.vue.js";
|
|
12
|
+
import N from "../../ExampleRequest/ExampleRequest.vue.js";
|
|
13
|
+
import { HIDE_TEST_REQUEST_BUTTON_SYMBOL as V } from "../../../helpers/provideSymbols.js";
|
|
14
|
+
const $ = { class: "operation-title" }, q = { class: "operation-details" }, L = { class: "endpoint-label" }, M = { class: "endpoint-label-path" }, O = { class: "endpoint-label-name" }, U = { class: "endpoint-content" }, A = { class: "operation-details-card" }, D = { class: "operation-details-card-item" }, H = { class: "operation-details-card-item" }, to = /* @__PURE__ */ m({
|
|
15
|
+
__name: "ClassicLayout",
|
|
16
|
+
props: {
|
|
17
|
+
id: {},
|
|
18
|
+
operation: {}
|
|
19
|
+
},
|
|
20
|
+
setup(P) {
|
|
21
|
+
const { copyToClipboard: d } = k(), c = f(V);
|
|
22
|
+
return (o, p) => (r(), s(e(E), {
|
|
23
|
+
id: o.id,
|
|
24
|
+
class: "reference-endpoint",
|
|
25
|
+
transparent: ""
|
|
26
|
+
}, h({
|
|
27
|
+
title: n(() => [
|
|
28
|
+
t("h3", $, [
|
|
29
|
+
t("div", q, [
|
|
30
|
+
i(e(R), {
|
|
31
|
+
class: "endpoint-type",
|
|
32
|
+
method: o.operation.httpVerb,
|
|
33
|
+
short: ""
|
|
34
|
+
}, null, 8, ["method"]),
|
|
35
|
+
i(e(I), {
|
|
36
|
+
id: o.id ?? "",
|
|
37
|
+
class: "endpoint-anchor"
|
|
38
|
+
}, {
|
|
39
|
+
default: n(() => {
|
|
40
|
+
var a;
|
|
41
|
+
return [
|
|
42
|
+
t("div", L, [
|
|
43
|
+
t("div", M, [
|
|
44
|
+
i(y, {
|
|
45
|
+
deprecated: (a = o.operation.information) == null ? void 0 : a.deprecated,
|
|
46
|
+
path: o.operation.path
|
|
47
|
+
}, null, 8, ["deprecated", "path"])
|
|
48
|
+
]),
|
|
49
|
+
t("div", O, u(o.operation.name), 1)
|
|
50
|
+
])
|
|
51
|
+
];
|
|
52
|
+
}),
|
|
53
|
+
_: 1
|
|
54
|
+
}, 8, ["id"])
|
|
55
|
+
])
|
|
56
|
+
])
|
|
57
|
+
]),
|
|
58
|
+
actions: n(({ active: a }) => {
|
|
59
|
+
var l;
|
|
60
|
+
return [
|
|
61
|
+
a ? (r(), s(e(g), {
|
|
62
|
+
key: 0,
|
|
63
|
+
operation: o.operation
|
|
64
|
+
}, null, 8, ["operation"])) : (l = e(c)) != null && l() ? _("", !0) : (r(), s(e(b), {
|
|
65
|
+
key: 1,
|
|
66
|
+
class: "endpoint-try-hint",
|
|
67
|
+
icon: "Play",
|
|
68
|
+
thickness: "1.75px"
|
|
69
|
+
})),
|
|
70
|
+
i(e(C), {
|
|
71
|
+
class: "endpoint-copy",
|
|
72
|
+
icon: "Clipboard",
|
|
73
|
+
label: "Copy endpoint URL",
|
|
74
|
+
size: "xs",
|
|
75
|
+
variant: "ghost",
|
|
76
|
+
onClick: p[0] || (p[0] = v((j) => e(d)(o.operation.path), ["stop"]))
|
|
77
|
+
})
|
|
78
|
+
];
|
|
79
|
+
}),
|
|
80
|
+
default: n(() => [
|
|
81
|
+
t("div", U, [
|
|
82
|
+
t("div", A, [
|
|
83
|
+
t("div", D, [
|
|
84
|
+
i(T, { operation: o.operation }, null, 8, ["operation"])
|
|
85
|
+
]),
|
|
86
|
+
t("div", H, [
|
|
87
|
+
i(B, {
|
|
88
|
+
collapsableItems: !1,
|
|
89
|
+
operation: o.operation
|
|
90
|
+
}, null, 8, ["operation"])
|
|
91
|
+
])
|
|
92
|
+
]),
|
|
93
|
+
i(e(w), { operation: o.operation }, null, 8, ["operation"]),
|
|
94
|
+
i(e(N), { operation: o.operation }, null, 8, ["operation"])
|
|
95
|
+
])
|
|
96
|
+
]),
|
|
97
|
+
_: 2
|
|
98
|
+
}, [
|
|
99
|
+
o.operation.description ? {
|
|
100
|
+
name: "description",
|
|
101
|
+
fn: n(() => [
|
|
102
|
+
i(e(S), {
|
|
103
|
+
value: o.operation.description,
|
|
104
|
+
withImages: ""
|
|
105
|
+
}, null, 8, ["value"])
|
|
106
|
+
]),
|
|
107
|
+
key: "0"
|
|
108
|
+
} : void 0
|
|
109
|
+
]), 1032, ["id"]));
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
export {
|
|
113
|
+
to as default
|
|
114
|
+
};
|
|
@@ -5,4 +5,4 @@ type __VLS_Props = {
|
|
|
5
5
|
};
|
|
6
6
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
export default _default;
|
|
8
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=ModernLayout.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"names":[],"mappings":"AA0GA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAOhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAoMF,wBAOG"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { defineComponent as f, openBlock as l, createBlock as m, unref as t, withCtx as r, createVNode as o, createTextVNode as d, createCommentVNode as u, createElementVNode as n, normalizeClass as c, toDisplayString as h } from "vue";
|
|
2
|
+
import _ from "../../../components/OperationPath.vue.js";
|
|
3
|
+
import { ScalarMarkdown as C } from "@scalar/components";
|
|
4
|
+
import S from "../components/OperationParameters.vue.js";
|
|
5
|
+
import v from "../components/OperationResponses.vue.js";
|
|
6
|
+
import k from "../../../components/Section/Section.vue.js";
|
|
7
|
+
import g from "../../../components/Section/SectionContent.vue.js";
|
|
8
|
+
import y from "../../../components/Section/SectionColumns.vue.js";
|
|
9
|
+
import s from "../../../components/Section/SectionColumn.vue.js";
|
|
10
|
+
import B from "../../../components/Badge/Badge.vue.js";
|
|
11
|
+
import N from "../../../components/Section/SectionHeader.vue.js";
|
|
12
|
+
import V from "../../../components/Anchor/Anchor.vue.js";
|
|
13
|
+
import b from "../../ExampleRequest/ExampleRequest.vue.js";
|
|
14
|
+
import w from "../../TestRequestButton/TestRequestButton.vue.js";
|
|
15
|
+
import E from "../../ExampleResponses/ExampleResponses.vue.js";
|
|
16
|
+
const R = { class: "operation-details" }, q = { class: "examples" }, Q = /* @__PURE__ */ f({
|
|
17
|
+
__name: "ModernLayout",
|
|
18
|
+
props: {
|
|
19
|
+
id: {},
|
|
20
|
+
operation: {}
|
|
21
|
+
},
|
|
22
|
+
setup(D) {
|
|
23
|
+
return (e, i) => (l(), m(t(k), {
|
|
24
|
+
id: e.id,
|
|
25
|
+
label: e.operation.name
|
|
26
|
+
}, {
|
|
27
|
+
default: r(() => [
|
|
28
|
+
o(t(g), null, {
|
|
29
|
+
default: r(() => [
|
|
30
|
+
o(t(y), null, {
|
|
31
|
+
default: r(() => [
|
|
32
|
+
o(t(s), null, {
|
|
33
|
+
default: r(() => {
|
|
34
|
+
var a, p;
|
|
35
|
+
return [
|
|
36
|
+
(a = e.operation.information) != null && a.deprecated ? (l(), m(t(B), { key: 0 }, {
|
|
37
|
+
default: r(() => i[0] || (i[0] = [
|
|
38
|
+
d(" Deprecated ")
|
|
39
|
+
])),
|
|
40
|
+
_: 1
|
|
41
|
+
})) : u("", !0),
|
|
42
|
+
n("div", {
|
|
43
|
+
class: c((p = e.operation.information) != null && p.deprecated ? "deprecated" : "")
|
|
44
|
+
}, [
|
|
45
|
+
o(t(N), { level: 3 }, {
|
|
46
|
+
default: r(() => [
|
|
47
|
+
o(t(V), {
|
|
48
|
+
id: e.id ?? ""
|
|
49
|
+
}, {
|
|
50
|
+
default: r(() => [
|
|
51
|
+
d(h(e.operation.name), 1)
|
|
52
|
+
]),
|
|
53
|
+
_: 1
|
|
54
|
+
}, 8, ["id"])
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
})
|
|
58
|
+
], 2),
|
|
59
|
+
n("div", R, [
|
|
60
|
+
o(t(C), {
|
|
61
|
+
value: e.operation.description,
|
|
62
|
+
withImages: ""
|
|
63
|
+
}, null, 8, ["value"]),
|
|
64
|
+
o(S, { operation: e.operation }, null, 8, ["operation"]),
|
|
65
|
+
o(v, { operation: e.operation }, null, 8, ["operation"])
|
|
66
|
+
])
|
|
67
|
+
];
|
|
68
|
+
}),
|
|
69
|
+
_: 1
|
|
70
|
+
}),
|
|
71
|
+
o(t(s), null, {
|
|
72
|
+
default: r(() => [
|
|
73
|
+
n("div", q, [
|
|
74
|
+
o(t(b), {
|
|
75
|
+
fallback: "",
|
|
76
|
+
operation: e.operation
|
|
77
|
+
}, {
|
|
78
|
+
header: r(() => {
|
|
79
|
+
var a;
|
|
80
|
+
return [
|
|
81
|
+
o(_, {
|
|
82
|
+
class: "example-path",
|
|
83
|
+
deprecated: (a = e.operation.information) == null ? void 0 : a.deprecated,
|
|
84
|
+
path: e.operation.path
|
|
85
|
+
}, null, 8, ["deprecated", "path"])
|
|
86
|
+
];
|
|
87
|
+
}),
|
|
88
|
+
footer: r(() => [
|
|
89
|
+
o(t(w), { operation: e.operation }, null, 8, ["operation"])
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
}, 8, ["operation"]),
|
|
93
|
+
o(t(E), {
|
|
94
|
+
operation: e.operation,
|
|
95
|
+
style: { "margin-top": "12px" }
|
|
96
|
+
}, null, 8, ["operation"])
|
|
97
|
+
])
|
|
98
|
+
]),
|
|
99
|
+
_: 1
|
|
100
|
+
})
|
|
101
|
+
]),
|
|
102
|
+
_: 1
|
|
103
|
+
})
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
})
|
|
107
|
+
]),
|
|
108
|
+
_: 1
|
|
109
|
+
}, 8, ["id", "label"]));
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
export {
|
|
113
|
+
Q as default
|
|
114
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SearchButton.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3ed69c39"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -2,14 +2,14 @@ import H from "fuse.js";
|
|
|
2
2
|
import { ref as c, computed as N, watch as V } from "vue";
|
|
3
3
|
import { extractRequestBody as A } from "../../helpers/specHelpers.js";
|
|
4
4
|
import { useSidebar as B } from "../../hooks/useSidebar.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { getHeadingsFromMarkdown as P } from "../../helpers/getHeadingsFromMarkdown.js";
|
|
6
|
+
import { useOperation as z } from "../../hooks/useOperation.js";
|
|
7
|
+
import { getModels as G } from "../../helpers/getModels.js";
|
|
8
|
+
import { useNavState as J } from "../../hooks/useNavState.js";
|
|
9
9
|
function te({
|
|
10
10
|
specification: a
|
|
11
11
|
}) {
|
|
12
|
-
const { getHeadingId: O, getWebhookId: R, getModelId: T, getOperationId: j, getTagId: L } =
|
|
12
|
+
const { getHeadingId: O, getWebhookId: R, getModelId: T, getOperationId: j, getTagId: L } = J(), { hideModels: W } = B(), o = c([]), n = c([]), h = c(0), s = c(""), d = new H(o.value, {
|
|
13
13
|
keys: ["title", "description", "body"]
|
|
14
14
|
}), q = () => {
|
|
15
15
|
h.value = 0, n.value = d.search(s.value);
|
|
@@ -30,7 +30,7 @@ function te({
|
|
|
30
30
|
d.setCollection([]);
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
const i = [], r =
|
|
33
|
+
const i = [], r = P(
|
|
34
34
|
((M = (k = a.value) == null ? void 0 : k.info) == null ? void 0 : M.description) ?? ""
|
|
35
35
|
);
|
|
36
36
|
r.length && (r.forEach((e) => {
|
|
@@ -52,7 +52,7 @@ function te({
|
|
|
52
52
|
body: ""
|
|
53
53
|
};
|
|
54
54
|
o.value.push(E), e.operations && e.operations.forEach((t) => {
|
|
55
|
-
const { parameterMap: u } =
|
|
55
|
+
const { parameterMap: u } = z(t), S = A(t) || u.value;
|
|
56
56
|
let v = null;
|
|
57
57
|
typeof S != "boolean" && (v = S);
|
|
58
58
|
const x = {
|
|
@@ -86,7 +86,7 @@ function te({
|
|
|
86
86
|
});
|
|
87
87
|
}), o.value = o.value.concat(f);
|
|
88
88
|
});
|
|
89
|
-
const p = W.value ? {} :
|
|
89
|
+
const p = W.value ? {} : G(a.value), m = [];
|
|
90
90
|
p && (Object.keys(p).forEach((e) => {
|
|
91
91
|
m.push({
|
|
92
92
|
type: "model",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestRequestButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/TestRequestButton/TestRequestButton.vue"],"names":[],"mappings":"AA4EA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAKhE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAiGF,wBAMG"}
|
package/dist/{components/Content/Operation → features/TestRequestButton}/TestRequestButton.vue2.js
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as d, inject as f, unref as o, openBlock as p, createElementBlock as i, withModifiers as c, createVNode as s, createElementVNode as h, withCtx as T, createTextVNode as a, toDisplayString as m, Fragment as b } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import E from "
|
|
4
|
-
import { HIDE_TEST_REQUEST_BUTTON_SYMBOL as S } from "
|
|
5
|
-
import { useApiClient as V } from "
|
|
2
|
+
import B from "../../components/ScreenReader.vue.js";
|
|
3
|
+
import { ScalarIcon as E } from "@scalar/components";
|
|
4
|
+
import { HIDE_TEST_REQUEST_BUTTON_SYMBOL as S } from "../../helpers/provideSymbols.js";
|
|
5
|
+
import { useApiClient as V } from "../ApiClientModal/useApiClient.js";
|
|
6
6
|
const _ = ["method"], w = /* @__PURE__ */ d({
|
|
7
7
|
__name: "TestRequestButton",
|
|
8
8
|
props: {
|
|
@@ -25,12 +25,12 @@ const _ = ["method"], w = /* @__PURE__ */ d({
|
|
|
25
25
|
});
|
|
26
26
|
}, ["stop"]))
|
|
27
27
|
}, [
|
|
28
|
-
s(o(
|
|
28
|
+
s(o(E), {
|
|
29
29
|
icon: "Play",
|
|
30
30
|
size: "sm"
|
|
31
31
|
}),
|
|
32
32
|
e[1] || (e[1] = h("span", null, "Test Request", -1)),
|
|
33
|
-
s(
|
|
33
|
+
s(B, null, {
|
|
34
34
|
default: T(() => [
|
|
35
35
|
a("(" + m(t.operation.httpVerb) + " " + m(t.operation.path) + ")", 1)
|
|
36
36
|
]),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/TestRequestButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAMhD,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAMhD,eAAO,MAAM,KAAK,kBACD,GAAG,eAGf;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,KACA,OAAO,CAAC,IAAI,CAyDd,CAAA"}
|
package/dist/helpers/parse.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { redirectToProxy as
|
|
1
|
+
import { redirectToProxy as R } from "@scalar/oas-utils/helpers";
|
|
2
2
|
import { load as j, dereference as M } from "@scalar/openapi-parser";
|
|
3
3
|
import { fetchUrls as q } from "@scalar/openapi-parser/plugins/fetch-urls";
|
|
4
4
|
import { createEmptySpecification as m } from "./createEmptySpecification.js";
|
|
5
5
|
import { normalizeRequestMethod as E } from "../legacy/helpers/normalizeRequestMethod.js";
|
|
6
|
-
import { validRequestMethods as
|
|
7
|
-
const
|
|
8
|
-
proxy:
|
|
6
|
+
import { validRequestMethods as A } from "../legacy/fixtures/httpRequestMethods.js";
|
|
7
|
+
const z = (p, {
|
|
8
|
+
proxy: e
|
|
9
9
|
} = {}) => new Promise(async (a, h) => {
|
|
10
10
|
var s;
|
|
11
11
|
try {
|
|
@@ -13,102 +13,105 @@ const D = (p, {
|
|
|
13
13
|
return a(
|
|
14
14
|
u(m())
|
|
15
15
|
);
|
|
16
|
-
const
|
|
16
|
+
const o = performance.now(), { filesystem: n } = await j(p, {
|
|
17
17
|
plugins: [
|
|
18
18
|
q({
|
|
19
|
-
fetch: (
|
|
19
|
+
fetch: (i) => fetch(e ? R(e, i) : i)
|
|
20
20
|
})
|
|
21
21
|
]
|
|
22
|
-
}), { schema:
|
|
23
|
-
return console.log(`dereference: ${Math.round(
|
|
22
|
+
}), { schema: t, errors: r } = await M(n), c = performance.now();
|
|
23
|
+
return console.log(`dereference: ${Math.round(c - o)} 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
28
|
r
|
|
29
|
-
),
|
|
29
|
+
), t === void 0 ? (h(((s = r == null ? void 0 : r[0]) == null ? void 0 : s.message) ?? "Failed to parse the OpenAPI file."), a(
|
|
30
30
|
u(m())
|
|
31
|
-
)) : a(u(
|
|
32
|
-
} catch (
|
|
33
|
-
|
|
31
|
+
)) : a(u(t));
|
|
32
|
+
} catch (o) {
|
|
33
|
+
console.error(
|
|
34
|
+
"[@scalar/api-reference]",
|
|
35
|
+
"Failed to parse the OpenAPI document. It might be invalid?"
|
|
36
|
+
), console.error(o), h(o);
|
|
34
37
|
}
|
|
35
38
|
return a(
|
|
36
39
|
u(m())
|
|
37
40
|
);
|
|
38
41
|
}), u = (p) => {
|
|
39
|
-
let
|
|
40
|
-
p && typeof p == "object" ?
|
|
42
|
+
let e = {};
|
|
43
|
+
p && typeof p == "object" ? e = structuredClone(p) : e = m(), e.tags || (e.tags = []), e.paths || (e.paths = {});
|
|
41
44
|
const a = {};
|
|
42
|
-
return Object.keys(
|
|
43
|
-
var
|
|
44
|
-
Object.keys(((
|
|
45
|
-
var r,
|
|
46
|
-
const
|
|
47
|
-
(
|
|
45
|
+
return Object.keys(e.webhooks ?? {}).forEach((s) => {
|
|
46
|
+
var o;
|
|
47
|
+
Object.keys(((o = e.webhooks) == null ? void 0 : o[s]) ?? {}).forEach((n) => {
|
|
48
|
+
var r, c, i;
|
|
49
|
+
const t = (r = e.webhooks) == null ? void 0 : r[s][n];
|
|
50
|
+
(t == null ? void 0 : t["x-internal"]) !== !0 && (a[s] === void 0 && (a[s] = {}), a[s][n] = {
|
|
48
51
|
// Transformed data
|
|
49
52
|
httpVerb: E(n),
|
|
50
53
|
path: s,
|
|
51
|
-
operationId: (
|
|
52
|
-
name: (
|
|
53
|
-
description: (
|
|
54
|
-
pathParameters: (
|
|
54
|
+
operationId: (t == null ? void 0 : t.operationId) || s,
|
|
55
|
+
name: (t == null ? void 0 : t.summary) || s || "",
|
|
56
|
+
description: (t == null ? void 0 : t.description) || "",
|
|
57
|
+
pathParameters: (i = (c = e.paths) == null ? void 0 : c[s]) == null ? void 0 : i.parameters,
|
|
55
58
|
// Original webhook
|
|
56
59
|
information: {
|
|
57
|
-
...
|
|
60
|
+
...t
|
|
58
61
|
}
|
|
59
62
|
});
|
|
60
63
|
});
|
|
61
|
-
}), Object.keys(
|
|
62
|
-
Object.keys(
|
|
63
|
-
(n) =>
|
|
64
|
+
}), Object.keys(e.paths).forEach((s) => {
|
|
65
|
+
Object.keys(e.paths[s]).filter(
|
|
66
|
+
(n) => A.includes(n.toUpperCase())
|
|
64
67
|
).forEach((n) => {
|
|
65
|
-
var
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
+
var c, i, g, w, y, I;
|
|
69
|
+
const t = e.paths[s][n];
|
|
70
|
+
if (t === void 0 || t["x-internal"] === !0)
|
|
68
71
|
return;
|
|
69
72
|
const r = {
|
|
70
73
|
httpVerb: E(n),
|
|
71
74
|
path: s,
|
|
72
|
-
operationId:
|
|
73
|
-
name:
|
|
74
|
-
description:
|
|
75
|
+
operationId: t.operationId || s,
|
|
76
|
+
name: t.summary || s || "",
|
|
77
|
+
description: t.description || "",
|
|
75
78
|
information: {
|
|
76
|
-
...
|
|
79
|
+
...t
|
|
77
80
|
},
|
|
78
|
-
pathParameters: (
|
|
81
|
+
pathParameters: (i = (c = e.paths) == null ? void 0 : c[s]) == null ? void 0 : i.parameters
|
|
79
82
|
};
|
|
80
|
-
if (!
|
|
81
|
-
(g =
|
|
82
|
-
(
|
|
83
|
-
) || (w =
|
|
83
|
+
if (!t.tags || t.tags.length === 0) {
|
|
84
|
+
(g = e.tags) != null && g.find(
|
|
85
|
+
(f) => f.name === "default"
|
|
86
|
+
) || (w = e.tags) == null || w.push({
|
|
84
87
|
name: "default",
|
|
85
88
|
description: "",
|
|
86
89
|
operations: []
|
|
87
90
|
});
|
|
88
|
-
const d = (y =
|
|
89
|
-
(
|
|
91
|
+
const d = (y = e.tags) == null ? void 0 : y.findIndex(
|
|
92
|
+
(f) => f.name === "default"
|
|
90
93
|
);
|
|
91
|
-
d >= 0 && ((
|
|
94
|
+
d >= 0 && ((I = e.tags[d]) == null || I.operations.push(r));
|
|
92
95
|
} else
|
|
93
|
-
|
|
94
|
-
var
|
|
95
|
-
const
|
|
96
|
+
t.tags.forEach((d) => {
|
|
97
|
+
var O, x, P;
|
|
98
|
+
const f = (O = e.tags) == null ? void 0 : O.findIndex(
|
|
96
99
|
// @ts-expect-error TODO: The types are just screwed, needs refactoring
|
|
97
|
-
(
|
|
100
|
+
(b) => b.name === d
|
|
98
101
|
);
|
|
99
|
-
|
|
102
|
+
f === -1 && ((x = e.tags) == null || x.push({
|
|
100
103
|
name: d,
|
|
101
104
|
description: ""
|
|
102
105
|
}));
|
|
103
|
-
const l =
|
|
104
|
-
typeof ((P =
|
|
106
|
+
const l = f !== -1 ? f : e.tags.length - 1;
|
|
107
|
+
typeof ((P = e.tags[l]) == null ? void 0 : P.operations) > "u" && (e.tags[l].operations = []), e.tags[l].operations.push(r);
|
|
105
108
|
});
|
|
106
109
|
});
|
|
107
110
|
}), {
|
|
108
|
-
...
|
|
111
|
+
...e,
|
|
109
112
|
webhooks: a
|
|
110
113
|
};
|
|
111
114
|
};
|
|
112
115
|
export {
|
|
113
|
-
|
|
116
|
+
z as parse
|
|
114
117
|
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|