@scalar/api-reference 1.29.3 → 1.31.0
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 +58 -0
- package/README.md +13 -114
- package/dist/browser/standalone.js +6525 -6416
- 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 +164 -181
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +56 -51
- 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 +5 -5
- package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Introduction/Introduction.vue2.js +57 -63
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +46 -46
- package/dist/components/Content/Models/Models.vue.d.ts +2 -2
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +7 -6
- package/dist/components/Content/Models/ModelsAccordion.vue.d.ts +2 -2
- package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.preview.d.ts +98 -56
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +6 -3
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue2.js +140 -97
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +57 -53
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +13 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +49 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +4 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -2
- 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 +40 -38
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +147 -143
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -2
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +9 -1
- package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-discriminator.js +45 -0
- package/dist/components/Content/Tag/TagList.vue.d.ts +2 -2
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/DocumentSelector/DocumentSelector.vue.js +3 -3
- package/dist/components/Layouts/ClassicLayout.vue.js +10 -8
- package/dist/components/Layouts/Layouts.vue.js +11 -9
- package/dist/components/Layouts/ModernLayout.vue2.js +22 -20
- package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionHeader.vue.js +2 -2
- package/dist/components/Section/SectionHeaderTag.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.js +2 -2
- 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 +56 -56
- package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
- package/dist/components/SingleApiReference.vue.js +27 -33
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -2
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -50
- package/dist/features/ApiClientModal/useApiClient.d.ts +224 -204
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts +11 -0
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts.map +1 -0
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +38 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +21 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -0
- package/dist/features/DocumentSource/hooks/useDocumentSource.js +94 -0
- package/dist/features/DocumentSource/index.d.ts +2 -0
- package/dist/features/DocumentSource/index.d.ts.map +1 -0
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue2.js +18 -17
- package/dist/features/DownloadLink/index.d.ts +1 -0
- package/dist/features/DownloadLink/index.d.ts.map +1 -1
- package/dist/features/DownloadLink/openapi-version-symbol.d.ts +2 -0
- package/dist/features/DownloadLink/openapi-version-symbol.d.ts.map +1 -0
- package/dist/features/DownloadLink/openapi-version-symbol.js +4 -0
- package/dist/features/Operation/Operation.vue.d.ts +2 -2
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- 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/OperationResponses.vue.d.ts +2 -2
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
- 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 +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -6
- package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -2
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +14 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/callbacks/Callback.vue.js +7 -0
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +62 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +10 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +30 -0
- package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +4 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +2 -2
- 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 +55 -55
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +94 -79
- package/dist/features/Operation/types/schemas.d.ts +3 -0
- package/dist/features/Operation/types/schemas.d.ts.map +1 -0
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/helpers/local-storage.d.ts +8 -0
- package/dist/helpers/local-storage.d.ts.map +1 -0
- package/dist/helpers/local-storage.js +6 -0
- package/dist/helpers/measure.d.ts +21 -0
- package/dist/helpers/measure.d.ts.map +1 -0
- package/dist/helpers/measure.js +7 -0
- package/dist/helpers/parse.d.ts +3 -5
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +64 -86
- package/dist/helpers/scroll-to-id.d.ts.map +1 -1
- package/dist/helpers/scroll-to-id.js +18 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -35
- package/dist/libs/openapi.d.ts +3 -3
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +35 -42
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/html-api.js +15 -15
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +19 -18
- package/dist/style.css +1 -1
- package/dist/types.d.ts +27 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -16
- package/dist/hooks/useReactiveSpec.d.ts +0 -448
- package/dist/hooks/useReactiveSpec.d.ts.map +0 -1
- package/dist/hooks/useReactiveSpec.js +0 -59
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarMarkdown as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as y, useId as O, computed as S, createBlock as t, openBlock as n, unref as o, withCtx as r, createVNode as a, createCommentVNode as c, createElementVNode as i, normalizeClass as f, createTextVNode as u, toDisplayString as h } from "vue";
|
|
2
|
+
import { ScalarMarkdown as k, ScalarErrorBoundary as l } from "@scalar/components";
|
|
3
|
+
import C from "../../../components/OperationPath.vue.js";
|
|
4
4
|
import { useConfig as B } from "../../../hooks/useConfig.js";
|
|
5
|
-
import { getOperationStability as
|
|
6
|
-
import N from "../components/
|
|
5
|
+
import { getOperationStability as b, getOperationStabilityColor as w, isOperationDeprecated as E } from "../../../libs/openapi.js";
|
|
6
|
+
import N from "../components/callbacks/Callbacks.vue.js";
|
|
7
|
+
import T from "../components/OperationParameters.vue.js";
|
|
7
8
|
import V from "../components/OperationResponses.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
9
|
+
import I from "../../../components/Section/Section.vue.js";
|
|
10
|
+
import P from "../../../components/Section/SectionContent.vue.js";
|
|
10
11
|
import R from "../../../components/Badge/Badge.vue.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
import _ from "../../../components/Section/SectionHeader.vue.js";
|
|
13
|
+
import $ from "../../../components/Anchor/Anchor.vue.js";
|
|
14
|
+
import q from "../../../components/Section/SectionHeaderTag.vue.js";
|
|
15
|
+
import A from "../../../components/Section/SectionColumns.vue.js";
|
|
15
16
|
import g from "../../../components/Section/SectionColumn.vue.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
17
|
+
import D from "../../ExampleRequest/ExampleRequest.vue.js";
|
|
18
|
+
import H from "../../TestRequestButton/TestRequestButton.vue.js";
|
|
19
|
+
import L from "../../ExampleResponses/ExampleResponses.vue.js";
|
|
20
|
+
const M = { class: "operation-details" }, z = { class: "examples" }, se = /* @__PURE__ */ y({
|
|
20
21
|
__name: "ModernLayout",
|
|
21
22
|
props: {
|
|
22
23
|
id: {},
|
|
@@ -26,43 +27,43 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
|
|
|
26
27
|
transformedOperation: {},
|
|
27
28
|
schemas: {}
|
|
28
29
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
return (
|
|
32
|
-
id:
|
|
33
|
-
"aria-labelledby":
|
|
34
|
-
label:
|
|
30
|
+
setup(s) {
|
|
31
|
+
const p = O(), v = B(), m = S(() => s.operation.summary || s.operation.path);
|
|
32
|
+
return (e, j) => (n(), t(o(I), {
|
|
33
|
+
id: e.id,
|
|
34
|
+
"aria-labelledby": o(p),
|
|
35
|
+
label: m.value,
|
|
35
36
|
tabindex: "-1"
|
|
36
37
|
}, {
|
|
37
|
-
default:
|
|
38
|
-
|
|
39
|
-
loading:
|
|
38
|
+
default: r(() => [
|
|
39
|
+
a(o(P), {
|
|
40
|
+
loading: o(v).isLoading
|
|
40
41
|
}, {
|
|
41
|
-
default:
|
|
42
|
-
|
|
42
|
+
default: r(() => [
|
|
43
|
+
o(b)(e.operation) ? (n(), t(o(R), {
|
|
43
44
|
key: 0,
|
|
44
|
-
class:
|
|
45
|
+
class: f(o(w)(e.operation))
|
|
45
46
|
}, {
|
|
46
|
-
default:
|
|
47
|
-
|
|
47
|
+
default: r(() => [
|
|
48
|
+
u(h(o(b)(e.operation)), 1)
|
|
48
49
|
]),
|
|
49
50
|
_: 1
|
|
50
|
-
}, 8, ["class"])) :
|
|
51
|
-
|
|
52
|
-
class:
|
|
51
|
+
}, 8, ["class"])) : c("", !0),
|
|
52
|
+
i("div", {
|
|
53
|
+
class: f(o(E)(e.operation) ? "deprecated" : "")
|
|
53
54
|
}, [
|
|
54
|
-
|
|
55
|
-
default:
|
|
56
|
-
|
|
57
|
-
id:
|
|
55
|
+
a(o(_), null, {
|
|
56
|
+
default: r(() => [
|
|
57
|
+
a(o($), {
|
|
58
|
+
id: e.id ?? ""
|
|
58
59
|
}, {
|
|
59
|
-
default:
|
|
60
|
-
|
|
61
|
-
id:
|
|
60
|
+
default: r(() => [
|
|
61
|
+
a(o(q), {
|
|
62
|
+
id: o(p),
|
|
62
63
|
level: 3
|
|
63
64
|
}, {
|
|
64
|
-
default:
|
|
65
|
-
|
|
65
|
+
default: r(() => [
|
|
66
|
+
u(h(m.value), 1)
|
|
66
67
|
]),
|
|
67
68
|
_: 1
|
|
68
69
|
}, 8, ["id"])
|
|
@@ -73,61 +74,75 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
|
|
|
73
74
|
_: 1
|
|
74
75
|
})
|
|
75
76
|
], 2),
|
|
76
|
-
|
|
77
|
-
default:
|
|
78
|
-
|
|
79
|
-
default:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
value:
|
|
83
|
-
withImages: ""
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
a(o(A), null, {
|
|
78
|
+
default: r(() => [
|
|
79
|
+
a(o(g), null, {
|
|
80
|
+
default: r(() => [
|
|
81
|
+
i("div", M, [
|
|
82
|
+
a(o(k), {
|
|
83
|
+
value: e.operation.description,
|
|
84
|
+
withImages: "",
|
|
85
|
+
withAnchors: "",
|
|
86
|
+
transformType: "heading",
|
|
87
|
+
anchorPrefix: e.id
|
|
88
|
+
}, null, 8, ["value", "anchorPrefix"]),
|
|
89
|
+
a(T, {
|
|
90
|
+
operation: e.operation,
|
|
91
|
+
schemas: e.schemas
|
|
88
92
|
}, null, 8, ["operation", "schemas"]),
|
|
89
|
-
|
|
90
|
-
operation:
|
|
91
|
-
schemas:
|
|
92
|
-
}, null, 8, ["operation", "schemas"])
|
|
93
|
+
a(V, {
|
|
94
|
+
operation: e.transformedOperation,
|
|
95
|
+
schemas: e.schemas
|
|
96
|
+
}, null, 8, ["operation", "schemas"]),
|
|
97
|
+
a(o(l), null, {
|
|
98
|
+
default: r(() => [
|
|
99
|
+
e.operation.callbacks ? (n(), t(N, {
|
|
100
|
+
key: 0,
|
|
101
|
+
callbacks: e.operation.callbacks,
|
|
102
|
+
collection: e.collection,
|
|
103
|
+
schemas: e.schemas
|
|
104
|
+
}, null, 8, ["callbacks", "collection", "schemas"])) : c("", !0)
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
})
|
|
93
108
|
])
|
|
94
109
|
]),
|
|
95
110
|
_: 1
|
|
96
111
|
}),
|
|
97
|
-
|
|
98
|
-
default:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
default:
|
|
102
|
-
|
|
103
|
-
collection:
|
|
112
|
+
a(o(g), null, {
|
|
113
|
+
default: r(() => [
|
|
114
|
+
i("div", z, [
|
|
115
|
+
a(o(l), null, {
|
|
116
|
+
default: r(() => [
|
|
117
|
+
a(o(D), {
|
|
118
|
+
collection: e.collection,
|
|
104
119
|
fallback: "",
|
|
105
|
-
operation:
|
|
106
|
-
server:
|
|
107
|
-
transformedOperation:
|
|
120
|
+
operation: e.operation,
|
|
121
|
+
server: e.server,
|
|
122
|
+
transformedOperation: e.transformedOperation
|
|
108
123
|
}, {
|
|
109
|
-
header:
|
|
110
|
-
var
|
|
124
|
+
header: r(() => {
|
|
125
|
+
var d;
|
|
111
126
|
return [
|
|
112
|
-
|
|
127
|
+
a(C, {
|
|
113
128
|
class: "example-path",
|
|
114
|
-
deprecated: (
|
|
115
|
-
path:
|
|
129
|
+
deprecated: (d = e.transformedOperation.information) == null ? void 0 : d.deprecated,
|
|
130
|
+
path: e.transformedOperation.path
|
|
116
131
|
}, null, 8, ["deprecated", "path"])
|
|
117
132
|
];
|
|
118
133
|
}),
|
|
119
|
-
footer:
|
|
120
|
-
|
|
134
|
+
footer: r(() => [
|
|
135
|
+
a(o(H), { operation: e.operation }, null, 8, ["operation"])
|
|
121
136
|
]),
|
|
122
137
|
_: 1
|
|
123
138
|
}, 8, ["collection", "operation", "server", "transformedOperation"])
|
|
124
139
|
]),
|
|
125
140
|
_: 1
|
|
126
141
|
}),
|
|
127
|
-
|
|
128
|
-
default:
|
|
129
|
-
|
|
130
|
-
responses:
|
|
142
|
+
a(o(l), null, {
|
|
143
|
+
default: r(() => [
|
|
144
|
+
a(o(L), {
|
|
145
|
+
responses: e.operation.responses,
|
|
131
146
|
style: { "margin-top": "12px" }
|
|
132
147
|
}, null, 8, ["responses"])
|
|
133
148
|
]),
|
|
@@ -149,5 +164,5 @@ const z = { class: "operation-details" }, A = { class: "examples" }, ie = /* @__
|
|
|
149
164
|
}
|
|
150
165
|
});
|
|
151
166
|
export {
|
|
152
|
-
|
|
167
|
+
se as default
|
|
153
168
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/types/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,OAAO,CAAA"}
|
|
@@ -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-ec9c0928"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../src/helpers/local-storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;CAEpB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Measures the execution time of a function and logs it.
|
|
3
|
+
* Works with both async and sync functions.
|
|
4
|
+
* Returns the result of the measured function.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* // Async function
|
|
9
|
+
* const result = await measure('api-call', async () => {
|
|
10
|
+
* return await fetchData()
|
|
11
|
+
* })
|
|
12
|
+
*
|
|
13
|
+
* // Sync function
|
|
14
|
+
* const result = measure('computation', () => {
|
|
15
|
+
* return heavyComputation()
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function measure<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
20
|
+
export declare function measure<T>(name: string, fn: () => T): T;
|
|
21
|
+
//# sourceMappingURL=measure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../src/helpers/measure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAC1E,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA"}
|
package/dist/helpers/parse.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
1
2
|
import type { Spec } from '@scalar/types/legacy';
|
|
2
|
-
import type { UnknownObject } from '@scalar/types/utils';
|
|
3
3
|
/**
|
|
4
|
-
* Parse the given
|
|
4
|
+
* Parse the given dereferencedDocument and return a super custom transformed dereferencedDocument.
|
|
5
5
|
*
|
|
6
6
|
* @deprecated Try to use a store instead.
|
|
7
7
|
*/
|
|
8
|
-
export declare const parse: (
|
|
9
|
-
proxyUrl?: string;
|
|
10
|
-
}) => Promise<Spec>;
|
|
8
|
+
export declare const parse: (dereferencedDocument: OpenAPIV3_1.Document) => Promise<Spec>;
|
|
11
9
|
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -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":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAOhD;;;;GAIG;AACH,eAAO,MAAM,KAAK,yBAA0B,WAAW,CAAC,QAAQ,KAAG,OAAO,CAAC,IAAI,CAmB9E,CAAA"}
|
package/dist/helpers/parse.js
CHANGED
|
@@ -1,119 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { validRequestMethods as C } from "../legacy/fixtures/httpRequestMethods.js";
|
|
7
|
-
const G = (m, {
|
|
8
|
-
proxyUrl: e
|
|
9
|
-
} = {}) => new Promise(async (n, b) => {
|
|
10
|
-
var h;
|
|
1
|
+
import { shouldIgnoreEntity as u } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { createEmptySpecification as w } from "../libs/openapi.js";
|
|
3
|
+
import { normalizeRequestMethod as R } from "../legacy/helpers/normalizeRequestMethod.js";
|
|
4
|
+
import { validRequestMethods as q } from "../legacy/fixtures/httpRequestMethods.js";
|
|
5
|
+
const C = (c) => new Promise(async (t, p) => {
|
|
11
6
|
try {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
plugins: [
|
|
16
|
-
D({
|
|
17
|
-
fetch: (o) => fetch(e ? R(e, o) : o)
|
|
18
|
-
})
|
|
19
|
-
]
|
|
20
|
-
}), { schema: a, errors: r } = await q(s), t = performance.now();
|
|
21
|
-
return console.log(`dereference: ${Math.round(t - f)} ms`), r != null && r.length && console.warn(
|
|
22
|
-
`Please open an issue on https://github.com/scalar/scalar
|
|
23
|
-
`,
|
|
24
|
-
`Scalar OpenAPI Parser Warning:
|
|
25
|
-
`,
|
|
26
|
-
r
|
|
27
|
-
), a === void 0 ? (b(((h = r == null ? void 0 : r[0]) == null ? void 0 : h.message) ?? "Failed to parse the OpenAPI file."), n(I(O()))) : n(I(a));
|
|
28
|
-
} catch (f) {
|
|
29
|
-
console.error("[@scalar/api-reference]", "Failed to parse the OpenAPI document. It might be invalid?"), console.error(f), b(f);
|
|
7
|
+
return t(b(c || w()));
|
|
8
|
+
} catch (l) {
|
|
9
|
+
console.error("[@scalar/api-reference]", "Failed to parse the OpenAPI document. It might be invalid?"), console.error(l), p(l);
|
|
30
10
|
}
|
|
31
|
-
return
|
|
32
|
-
}),
|
|
33
|
-
var
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
return Object.keys(
|
|
38
|
-
var
|
|
39
|
-
Object.keys(((
|
|
40
|
-
var
|
|
41
|
-
const
|
|
42
|
-
if (!(!
|
|
43
|
-
if (Array.isArray(
|
|
44
|
-
const
|
|
45
|
-
(
|
|
46
|
-
var
|
|
47
|
-
return (
|
|
11
|
+
return t(b(w()));
|
|
12
|
+
}), b = (c) => {
|
|
13
|
+
var E, O;
|
|
14
|
+
let t = {};
|
|
15
|
+
c && typeof c == "object" ? t = c : t = w(), t.tags || (t.tags = []), t.paths || (t.paths = {}), t.components || (t.components = {}), t.webhooks || (t.webhooks = {}), t.servers || (t.servers = []), t.security || (t.security = []);
|
|
16
|
+
const p = {};
|
|
17
|
+
return Object.keys(t.webhooks ?? {}).forEach((s) => {
|
|
18
|
+
var d;
|
|
19
|
+
Object.keys(((d = t.webhooks) == null ? void 0 : d[s]) ?? {}).forEach((r) => {
|
|
20
|
+
var n, m, h, g;
|
|
21
|
+
const e = (n = t.webhooks) == null ? void 0 : n[s][r];
|
|
22
|
+
if (!(!e || u(e))) {
|
|
23
|
+
if (Array.isArray(e.tags)) {
|
|
24
|
+
const o = (m = e.tags) == null ? void 0 : m.map(
|
|
25
|
+
(a) => {
|
|
26
|
+
var y;
|
|
27
|
+
return (y = t.tags) == null ? void 0 : y.find((i) => i.name === a);
|
|
48
28
|
}
|
|
49
29
|
);
|
|
50
|
-
if (
|
|
30
|
+
if (e.tags = o == null ? void 0 : o.filter((a) => !u(a)), o != null && o.some((a) => u(a)))
|
|
51
31
|
return;
|
|
52
32
|
}
|
|
53
|
-
|
|
33
|
+
p[s] === void 0 && (p[s] = {}), p[s][r] = {
|
|
54
34
|
// Transformed data
|
|
55
|
-
httpVerb:
|
|
35
|
+
httpVerb: R(r),
|
|
56
36
|
path: s,
|
|
57
|
-
operationId: (
|
|
58
|
-
name: (
|
|
59
|
-
description: (
|
|
60
|
-
pathParameters: (
|
|
37
|
+
operationId: (e == null ? void 0 : e.operationId) || s,
|
|
38
|
+
name: (e == null ? void 0 : e.summary) || s || "",
|
|
39
|
+
description: (e == null ? void 0 : e.description) || "",
|
|
40
|
+
pathParameters: (g = (h = t.paths) == null ? void 0 : h[s]) == null ? void 0 : g.parameters,
|
|
61
41
|
// Original webhook
|
|
62
42
|
information: {
|
|
63
|
-
...
|
|
43
|
+
...e
|
|
64
44
|
}
|
|
65
45
|
};
|
|
66
46
|
}
|
|
67
47
|
});
|
|
68
|
-
}), Object.keys(((
|
|
69
|
-
var
|
|
70
|
-
u((r = (
|
|
71
|
-
}), Object.keys(
|
|
72
|
-
Object.keys(
|
|
73
|
-
(r) =>
|
|
48
|
+
}), Object.keys(((E = t.components) == null ? void 0 : E.schemas) ?? {}).forEach((s) => {
|
|
49
|
+
var d, r, e, n;
|
|
50
|
+
u((r = (d = t.components) == null ? void 0 : d.schemas) == null ? void 0 : r[s]) && ((n = (e = t.components) == null ? void 0 : e.schemas) == null || delete n[s]);
|
|
51
|
+
}), Object.keys(t.paths).forEach((s) => {
|
|
52
|
+
Object.keys(t.paths[s]).filter(
|
|
53
|
+
(r) => q.includes(r.toUpperCase())
|
|
74
54
|
).forEach((r) => {
|
|
75
|
-
var
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
55
|
+
var m, h, g, o, a, y;
|
|
56
|
+
const e = t.paths[s][r];
|
|
57
|
+
if (e === void 0 || u(e))
|
|
78
58
|
return;
|
|
79
|
-
const
|
|
80
|
-
httpVerb:
|
|
59
|
+
const n = {
|
|
60
|
+
httpVerb: R(r),
|
|
81
61
|
path: s,
|
|
82
|
-
operationId:
|
|
83
|
-
name:
|
|
84
|
-
description:
|
|
62
|
+
operationId: e.operationId || s,
|
|
63
|
+
name: e.summary || s || "",
|
|
64
|
+
description: e.description || "",
|
|
85
65
|
information: {
|
|
86
|
-
...
|
|
66
|
+
...e
|
|
87
67
|
},
|
|
88
|
-
pathParameters: (
|
|
68
|
+
pathParameters: (h = (m = t.paths) == null ? void 0 : m[s]) == null ? void 0 : h.parameters
|
|
89
69
|
};
|
|
90
|
-
if (!
|
|
91
|
-
(
|
|
70
|
+
if (!e.tags || e.tags.length === 0) {
|
|
71
|
+
(g = t.tags) != null && g.find((f) => f.name === "default") || (o = t.tags) == null || o.push({
|
|
92
72
|
name: "default",
|
|
93
73
|
description: "",
|
|
94
74
|
operations: []
|
|
95
75
|
});
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
);
|
|
99
|
-
p >= 0 && ((w = e.tags[p]) == null || w.operations.push(o));
|
|
76
|
+
const i = (a = t.tags) == null ? void 0 : a.findIndex((f) => f.name === "default");
|
|
77
|
+
i >= 0 && ((y = t.tags[i]) == null || y.operations.push(n));
|
|
100
78
|
} else
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
name:
|
|
79
|
+
e.tags.forEach((i) => {
|
|
80
|
+
var k, x, j;
|
|
81
|
+
const f = (k = t.tags) == null ? void 0 : k.findIndex((P) => P.name === i);
|
|
82
|
+
f === -1 && ((x = t.tags) == null || x.push({
|
|
83
|
+
name: i,
|
|
106
84
|
description: ""
|
|
107
85
|
}));
|
|
108
|
-
const
|
|
109
|
-
typeof ((
|
|
86
|
+
const I = f !== -1 ? f : t.tags.length - 1;
|
|
87
|
+
typeof ((j = t.tags[I]) == null ? void 0 : j.operations) > "u" && (t.tags[I].operations = []), t.tags[I].operations.push(n);
|
|
110
88
|
});
|
|
111
89
|
});
|
|
112
|
-
}),
|
|
113
|
-
...
|
|
114
|
-
webhooks:
|
|
90
|
+
}), t.tags = (O = t.tags) == null ? void 0 : O.filter((s) => !u(s)), {
|
|
91
|
+
...t,
|
|
92
|
+
webhooks: p
|
|
115
93
|
};
|
|
116
94
|
};
|
|
117
95
|
export {
|
|
118
|
-
|
|
96
|
+
C as parse
|
|
119
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-to-id.d.ts","sourceRoot":"","sources":["../../src/helpers/scroll-to-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,OAAc,MAAM,UAAU,OAAO,
|
|
1
|
+
{"version":3,"file":"scroll-to-id.d.ts","sourceRoot":"","sources":["../../src/helpers/scroll-to-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,OAAc,MAAM,UAAU,OAAO,kBAkC3D,CAAA"}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
const l = async (t, r) => {
|
|
2
|
+
const n = (e) => {
|
|
3
|
+
e.scrollIntoView(), r && e.focus();
|
|
4
|
+
}, o = document.getElementById(t);
|
|
5
|
+
if (o) {
|
|
6
|
+
n(o);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const s = Date.now() + 1e3, c = () => {
|
|
10
|
+
const e = document.getElementById(t);
|
|
11
|
+
if (e) {
|
|
12
|
+
n(e);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
Date.now() < s && requestAnimationFrame(c);
|
|
16
|
+
};
|
|
17
|
+
requestAnimationFrame(c);
|
|
4
18
|
};
|
|
5
19
|
export {
|
|
6
|
-
|
|
20
|
+
l as scrollToId
|
|
7
21
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export { default as ApiReferenceLayout } from './components/ApiReferenceLayout.v
|
|
|
4
4
|
export { default as ModernLayout } from './components/Layouts/ModernLayout.vue.js';
|
|
5
5
|
export { SearchButton, SearchModal } from './features/Search';
|
|
6
6
|
export { default as GettingStarted } from './components/GettingStarted.vue.js';
|
|
7
|
-
export { useReactiveSpec } from './hooks/useReactiveSpec.js';
|
|
8
7
|
export { createApiReference } from './standalone/lib/html-api.js';
|
|
9
8
|
export { Sidebar } from './components/Sidebar';
|
|
10
9
|
export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } from './components/Card';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,YAAY,EACV,yBAAyB,EACzB,cAAc,GACf,MAAM,SAAS,CAAA"}
|