@scalar/api-reference 1.31.3 → 1.31.6
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 +55 -0
- package/dist/browser/standalone.js +15752 -15637
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.js +6 -6
- package/dist/components/ApiReferenceLayout.vue.d.ts +6 -3
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +4 -2
- package/dist/components/ApiReferenceLayout.vue2.js +230 -153
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +1 -1
- package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Description.vue.js +2 -2
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +81 -101
- 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 +114 -105
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +35 -35
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +17 -15
- package/dist/components/Content/Schema/helpers/schema-name.js +13 -21
- package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/OperationsList.vue.js +1 -1
- package/dist/components/Content/Tag/OperationsList.vue2.js +10 -9
- package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +29 -28
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +35 -34
- package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/components/DocumentSelector/DocumentSelector.vue.js +21 -28
- package/dist/components/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.js +3 -3
- package/dist/components/GettingStarted.vue2.js +23 -23
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +1 -20
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +12 -13
- package/dist/components/Section/CompactSection.vue.js +2 -2
- package/dist/components/Section/CompactSection.vue2.js +6 -6
- 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 +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +5 -5
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentSource.js +11 -11
- 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 +21 -21
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +1 -1
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +16 -16
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +2 -2
- package/dist/features/Search/SearchModal.vue2.js +1 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +29 -28
- package/dist/features/sidebar/helpers/create-sidebar.d.ts +26 -0
- package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -0
- package/dist/features/sidebar/hooks/useSidebar.d.ts +23 -0
- package/dist/features/sidebar/hooks/useSidebar.d.ts.map +1 -0
- package/dist/features/sidebar/index.d.ts +2 -0
- package/dist/features/sidebar/index.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/get-tag.d.ts +4 -0
- package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/operation-id-params.d.ts +8 -0
- package/dist/features/traverse-schema/helpers/operation-id-params.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/operation-id-params.js +8 -0
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts +9 -0
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts +16 -0
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +11 -0
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +6 -0
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +9 -0
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +6 -0
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -0
- package/dist/features/traverse-schema/index.d.ts +4 -0
- package/dist/features/traverse-schema/index.d.ts.map +1 -0
- package/dist/features/traverse-schema/types.d.ts +51 -0
- package/dist/features/traverse-schema/types.d.ts.map +1 -0
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +16 -16
- package/dist/hooks/useNavState.d.ts +9 -4
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +31 -29
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +69 -68
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -44
- package/dist/legacy/fixtures/httpRequestMethods.js +2 -6
- package/dist/libs/openapi.js +32 -32
- package/dist/stores/useHttpClientStore.js +9 -8
- package/dist/style.css +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts +40 -0
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -0
- package/dist/v2/ApiReferenceWorkspace.vue.js +65 -0
- package/dist/v2/ApiReferenceWorkspace.vue3.js +5 -0
- package/dist/v2/events/definitions.d.ts +35 -0
- package/dist/v2/events/definitions.d.ts.map +1 -0
- package/dist/v2/events/index.d.ts +3 -0
- package/dist/v2/events/index.d.ts.map +1 -0
- package/dist/v2/events/listeners.d.ts +8 -0
- package/dist/v2/events/listeners.d.ts.map +1 -0
- package/dist/v2/events/listeners.js +15 -0
- package/dist/v2/styles.d.ts +2 -0
- package/dist/v2/styles.d.ts.map +1 -0
- package/package.json +13 -11
- package/dist/components/HttpMethod/constants.d.ts +0 -9
- package/dist/components/HttpMethod/constants.d.ts.map +0 -1
- package/dist/components/HttpMethod/constants.js +0 -36
- package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +0 -4
- package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +0 -1
- package/dist/components/HttpMethod/utils/isRequestMethod.js +0 -7
- package/dist/components/Layouts/ClassicLayout.vue.d.ts +0 -23
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +0 -1
- package/dist/components/Layouts/ClassicLayout.vue.js +0 -67
- package/dist/components/Layouts/ClassicLayout.vue2.js +0 -4
- package/dist/components/Layouts/Layouts.vue.d.ts +0 -26
- package/dist/components/Layouts/Layouts.vue.d.ts.map +0 -1
- package/dist/components/Layouts/Layouts.vue.js +0 -35
- package/dist/components/Layouts/Layouts.vue2.js +0 -4
- package/dist/components/Layouts/ModernLayout.vue.d.ts +0 -23
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +0 -1
- package/dist/components/Layouts/ModernLayout.vue.js +0 -8
- package/dist/components/Layouts/ModernLayout.vue2.js +0 -102
- package/dist/components/Layouts/index.d.ts +0 -2
- package/dist/components/Layouts/index.d.ts.map +0 -1
- package/dist/components/SingleApiReference.vue.d.ts +0 -29
- package/dist/components/SingleApiReference.vue.d.ts.map +0 -1
- package/dist/components/SingleApiReference.vue.js +0 -57
- package/dist/components/SingleApiReference.vue3.js +0 -5
- package/dist/helpers/freeze-element.d.ts +0 -11
- package/dist/helpers/freeze-element.d.ts.map +0 -1
- package/dist/helpers/freeze-element.js +0 -20
- package/dist/helpers/is-mac-os.d.ts +0 -5
- package/dist/helpers/is-mac-os.d.ts.map +0 -1
- package/dist/helpers/is-mac-os.js +0 -4
- package/dist/helpers/measure.d.ts +0 -21
- package/dist/helpers/measure.d.ts.map +0 -1
- package/dist/helpers/measure.js +0 -7
- package/dist/helpers/scroll-to-id.d.ts +0 -7
- package/dist/helpers/scroll-to-id.d.ts.map +0 -1
- package/dist/helpers/scroll-to-id.js +0 -21
- package/dist/helpers/sleep.d.ts +0 -6
- package/dist/helpers/sleep.d.ts.map +0 -1
- package/dist/helpers/sleep.js +0 -4
- package/dist/legacy/helpers/index.d.ts +0 -2
- package/dist/legacy/helpers/index.d.ts.map +0 -1
- package/dist/legacy/helpers/normalizeRequestMethod.d.ts +0 -6
- package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +0 -1
- package/dist/legacy/helpers/normalizeRequestMethod.js +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const T = [
|
|
2
2
|
"GET",
|
|
3
3
|
"POST",
|
|
4
4
|
"PUT",
|
|
@@ -9,10 +9,6 @@ const t = [
|
|
|
9
9
|
"CONNECT",
|
|
10
10
|
"TRACE"
|
|
11
11
|
];
|
|
12
|
-
function T(e) {
|
|
13
|
-
return t.includes(e);
|
|
14
|
-
}
|
|
15
12
|
export {
|
|
16
|
-
T as
|
|
17
|
-
t as validRequestMethods
|
|
13
|
+
T as validRequestMethods
|
|
18
14
|
};
|
package/dist/libs/openapi.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { XScalarStability as o } from "@scalar/types/legacy";
|
|
2
|
-
function l(e,
|
|
2
|
+
function l(e, t) {
|
|
3
3
|
var n;
|
|
4
|
-
let
|
|
5
|
-
const i = (n =
|
|
6
|
-
return
|
|
4
|
+
let r = e;
|
|
5
|
+
const i = (n = t.required) == null ? void 0 : n.includes(e);
|
|
6
|
+
return r += i ? " REQUIRED " : " optional ", t.properties[e] && (r += t.properties[e].type, t.properties[e].description && (r += " " + t.properties[e].description)), r;
|
|
7
7
|
}
|
|
8
8
|
function p(e) {
|
|
9
9
|
var i;
|
|
10
|
-
const
|
|
11
|
-
return
|
|
10
|
+
const t = ["Body"], r = (i = e == null ? void 0 : e.schema) == null ? void 0 : i.properties;
|
|
11
|
+
return r && Object.keys(r).forEach((n) => {
|
|
12
12
|
if (!e.schema)
|
|
13
13
|
return;
|
|
14
|
-
|
|
15
|
-
const s =
|
|
14
|
+
t.push(l(n, e.schema));
|
|
15
|
+
const s = r[n];
|
|
16
16
|
s.type === "object" && !!s.properties && s.properties && Object.keys(s.properties).forEach((c) => {
|
|
17
17
|
var u, f;
|
|
18
|
-
|
|
18
|
+
t.push(`${c} ${(f = (u = s.properties) == null ? void 0 : u[c]) == null ? void 0 : f.type}`);
|
|
19
19
|
});
|
|
20
|
-
}),
|
|
20
|
+
}), t;
|
|
21
21
|
}
|
|
22
22
|
function O(e) {
|
|
23
|
-
var
|
|
23
|
+
var t, r, i;
|
|
24
24
|
try {
|
|
25
|
-
const n = (i = (
|
|
25
|
+
const n = (i = (r = (t = e == null ? void 0 : e.information) == null ? void 0 : t.requestBody) == null ? void 0 : r.content) == null ? void 0 : i["application/json"];
|
|
26
26
|
if (!n)
|
|
27
27
|
throw new Error("Body not found");
|
|
28
28
|
return p(n);
|
|
@@ -31,28 +31,28 @@ function O(e) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function d(e) {
|
|
34
|
-
var
|
|
34
|
+
var r, i;
|
|
35
35
|
if (!e)
|
|
36
36
|
return {};
|
|
37
|
-
const
|
|
37
|
+
const t = (
|
|
38
38
|
// OpenAPI 3.x
|
|
39
|
-
Object.keys(((
|
|
39
|
+
Object.keys(((r = e == null ? void 0 : e.components) == null ? void 0 : r.schemas) ?? {}).length ? (i = e == null ? void 0 : e.components) == null ? void 0 : i.schemas : (
|
|
40
40
|
// Fallback
|
|
41
41
|
{}
|
|
42
42
|
)
|
|
43
43
|
);
|
|
44
|
-
return Object.keys(
|
|
44
|
+
return Object.keys(t ?? {}).forEach((n) => {
|
|
45
45
|
var s;
|
|
46
|
-
((s =
|
|
47
|
-
}),
|
|
46
|
+
((s = t[n]) == null ? void 0 : s["x-internal"]) === !0 && delete t[n];
|
|
47
|
+
}), t;
|
|
48
48
|
}
|
|
49
49
|
const b = (e) => e ? !!Object.keys(d(e) ?? {}).length : !1, x = (e) => e ? !!Object.keys((e == null ? void 0 : e.webhooks) ?? {}).length : !1;
|
|
50
|
-
function a(e,
|
|
51
|
-
for (const [
|
|
52
|
-
i !== null && typeof i == "object" ? (
|
|
53
|
-
return
|
|
50
|
+
function a(e, t) {
|
|
51
|
+
for (const [r, i] of Object.entries(e))
|
|
52
|
+
i !== null && typeof i == "object" ? (t[r] ??= new i.__proto__.constructor(), a(i, t[r])) : typeof i < "u" && (t[r] = i);
|
|
53
|
+
return t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function g(e) {
|
|
56
56
|
return a(e ?? {}, {
|
|
57
57
|
info: {
|
|
58
58
|
title: "",
|
|
@@ -71,25 +71,25 @@ function E(e) {
|
|
|
71
71
|
tags: []
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function E(e) {
|
|
75
75
|
return e.deprecated !== void 0 ? e.deprecated : !!(e["x-scalar-stability"] && e["x-scalar-stability"] === o.Deprecated);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function y(e) {
|
|
78
78
|
return e.deprecated ? o.Deprecated : e["x-scalar-stability"];
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
const
|
|
82
|
-
return
|
|
80
|
+
function S(e) {
|
|
81
|
+
const t = y(e);
|
|
82
|
+
return t === o.Deprecated ? "text-red" : t === o.Experimental ? "text-orange" : t === o.Stable ? "text-green" : "";
|
|
83
83
|
}
|
|
84
84
|
export {
|
|
85
|
-
|
|
85
|
+
g as createEmptySpecification,
|
|
86
86
|
a as deepMerge,
|
|
87
87
|
O as extractRequestBody,
|
|
88
88
|
l as formatProperty,
|
|
89
89
|
d as getModels,
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
y as getOperationStability,
|
|
91
|
+
S as getOperationStabilityColor,
|
|
92
92
|
b as hasModels,
|
|
93
93
|
x as hasWebhooks,
|
|
94
|
-
|
|
94
|
+
E as isOperationDeprecated
|
|
95
95
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { safeLocalStorage as E, REFERENCE_LS_KEYS as m } from "@scalar/helpers/object/local-storage";
|
|
2
|
+
import { objectReplace as p } from "@scalar/helpers/object/object-replace";
|
|
2
3
|
import { snippetz as k } from "@scalar/snippetz";
|
|
3
|
-
import { computed as o, readonly as a, ref as
|
|
4
|
+
import { computed as o, readonly as a, ref as C, reactive as A } from "vue";
|
|
4
5
|
const y = {
|
|
5
6
|
targetKey: "shell",
|
|
6
7
|
clientKey: "curl"
|
|
@@ -24,7 +25,7 @@ function b(t, n) {
|
|
|
24
25
|
n.value[e.key].includes(s.client))), (i = e == null ? void 0 : e.clients) != null && i.length ? [e] : []);
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
|
-
const r = o(() => b(H(), c)), c =
|
|
28
|
+
const r = o(() => b(H(), c)), c = C({}), f = C();
|
|
28
29
|
function _(t) {
|
|
29
30
|
t !== void 0 && (f.value = t, T(u()));
|
|
30
31
|
}
|
|
@@ -41,21 +42,21 @@ function v(t) {
|
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
44
|
function h() {
|
|
44
|
-
|
|
45
|
+
p(l, u());
|
|
45
46
|
}
|
|
46
47
|
const l = A(u()), T = (t) => {
|
|
47
48
|
Object.assign(l, {
|
|
48
49
|
...l,
|
|
49
50
|
...t
|
|
50
|
-
}), E.setItem(m.SELECTED_CLIENT, JSON.stringify(l));
|
|
51
|
-
},
|
|
51
|
+
}), E().setItem(m.SELECTED_CLIENT, JSON.stringify(l));
|
|
52
|
+
}, R = () => ({
|
|
52
53
|
httpClient: a(l),
|
|
53
54
|
resetState: h,
|
|
54
55
|
setHttpClient: T,
|
|
55
56
|
setDefaultHttpClient: _,
|
|
56
57
|
excludedClients: a(c),
|
|
57
58
|
setExcludedClients: (t) => {
|
|
58
|
-
c.value = t,
|
|
59
|
+
c.value = t, p(l, u());
|
|
59
60
|
},
|
|
60
61
|
availableTargets: r,
|
|
61
62
|
getClientTitle: K,
|
|
@@ -65,5 +66,5 @@ const l = A(u()), T = (t) => {
|
|
|
65
66
|
});
|
|
66
67
|
export {
|
|
67
68
|
b as filterHiddenClients,
|
|
68
|
-
|
|
69
|
+
R as useHttpClientStore
|
|
69
70
|
};
|