@scalar/api-reference 1.31.2 → 1.31.4
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/dist/browser/standalone.js +9428 -9384
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +72 -73
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- 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 +77 -113
- 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.d.ts +16 -0
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/schema-name.js +32 -0
- 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/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 +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 +45 -28
- 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/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
- 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.js +1 -1
- package/dist/legacy/fixtures/httpRequestMethods.js +2 -6
- package/dist/libs/download.d.ts +2 -1
- package/dist/libs/download.d.ts.map +1 -1
- package/dist/libs/download.js +23 -11
- package/dist/stores/useHttpClientStore.js +18 -18
- package/dist/style.css +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -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/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/local-storage.d.ts +0 -8
- package/dist/helpers/local-storage.d.ts.map +0 -1
- package/dist/helpers/local-storage.js +0 -6
- 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/download.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare const downloadEventBus: import("@vueuse/core").UseEventBusReturn<{
|
|
2
2
|
id: string;
|
|
3
3
|
filename?: string;
|
|
4
|
+
format?: "json" | "yaml";
|
|
4
5
|
}, any>;
|
|
5
6
|
/**
|
|
6
7
|
* Trigger the download of the OpenAPI document
|
|
7
8
|
*/
|
|
8
|
-
export declare function downloadDocument(content: string, filename?: string): void;
|
|
9
|
+
export declare function downloadDocument(content: string, filename?: string, format?: 'json' | 'yaml'): void;
|
|
9
10
|
//# sourceMappingURL=download.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/libs/download.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/libs/download.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB;QADgB,MAAM;eAAa,MAAM;aAAW,MAAM,GAAG,MAAM;OAChC,CAAA;AAsChE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,QAsB5F"}
|
package/dist/libs/download.js
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import { isJsonString as
|
|
2
|
-
import { useEventBus as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { isDefined as b, isJsonString as r } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { useEventBus as p } from "@vueuse/core";
|
|
3
|
+
import { toJson as w, normalize as a, toYaml as f } from "@scalar/openapi-parser";
|
|
4
|
+
const v = Symbol("download"), L = p(v);
|
|
5
|
+
function E(e, n) {
|
|
6
|
+
return n && !r(e) ? w(a(e)) : !n && r(e) ? f(a(e)) : e;
|
|
7
|
+
}
|
|
8
|
+
function y() {
|
|
9
|
+
try {
|
|
10
|
+
return new MouseEvent("click", {
|
|
8
11
|
bubbles: !0,
|
|
9
12
|
cancelable: !0,
|
|
10
13
|
view: window
|
|
11
|
-
})
|
|
12
|
-
|
|
14
|
+
});
|
|
15
|
+
} catch {
|
|
16
|
+
return new MouseEvent("click", {
|
|
17
|
+
bubbles: !0,
|
|
18
|
+
cancelable: !0
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function R(e, n, c) {
|
|
23
|
+
const t = c === "json" || !b(c) && r(e), l = E(e, t), i = t ? ".json" : ".yaml", u = t ? "application/json" : "application/x-yaml", m = n ? n + i : "openapi" + i, d = new Blob([l], { type: u }), s = URL.createObjectURL(d), o = document.createElement("a");
|
|
24
|
+
o.href = s, o.download = m, o.dispatchEvent(y()), setTimeout(() => {
|
|
13
25
|
window.URL.revokeObjectURL(s), o.remove();
|
|
14
26
|
}, 100);
|
|
15
27
|
}
|
|
16
28
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
R as downloadDocument,
|
|
30
|
+
L as downloadEventBus
|
|
19
31
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { snippetz as
|
|
4
|
-
import { computed as o, readonly as a, ref as C, reactive as
|
|
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";
|
|
3
|
+
import { snippetz as k } from "@scalar/snippetz";
|
|
4
|
+
import { computed as o, readonly as a, ref as C, reactive as A } from "vue";
|
|
5
5
|
const y = {
|
|
6
6
|
targetKey: "shell",
|
|
7
7
|
clientKey: "curl"
|
|
8
|
-
}, { clients:
|
|
8
|
+
}, { clients: H } = k();
|
|
9
9
|
function d(t) {
|
|
10
10
|
var n;
|
|
11
11
|
return ((n = r.value.find((e) => e.key === t.targetKey)) == null ? void 0 : n.title) ?? t.targetKey;
|
|
@@ -14,8 +14,8 @@ function K(t) {
|
|
|
14
14
|
var n, e;
|
|
15
15
|
return ((e = (n = r.value.find((i) => i.key === t.targetKey)) == null ? void 0 : n.clients.find((i) => i.client === t.clientKey)) == null ? void 0 : e.title) ?? t.clientKey;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
17
|
+
const L = o(() => d(l)), S = o(() => K(l));
|
|
18
|
+
function b(t, n) {
|
|
19
19
|
return n.value === !0 ? [] : t.flatMap((e) => {
|
|
20
20
|
var i;
|
|
21
21
|
return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (e.clients = e.clients.filter(
|
|
@@ -25,8 +25,8 @@ function L(t, n) {
|
|
|
25
25
|
n.value[e.key].includes(s.client))), (i = e == null ? void 0 : e.clients) != null && i.length ? [e] : []);
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
const r = o(() =>
|
|
29
|
-
function
|
|
28
|
+
const r = o(() => b(H(), c)), c = C({}), f = C();
|
|
29
|
+
function _(t) {
|
|
30
30
|
t !== void 0 && (f.value = t, T(u()));
|
|
31
31
|
}
|
|
32
32
|
const u = () => {
|
|
@@ -41,19 +41,19 @@ function v(t) {
|
|
|
41
41
|
(n) => n.key === t.targetKey && n.clients.find((e) => e.client === t.clientKey)
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function h() {
|
|
45
45
|
p(l, u());
|
|
46
46
|
}
|
|
47
|
-
const l =
|
|
47
|
+
const l = A(u()), T = (t) => {
|
|
48
48
|
Object.assign(l, {
|
|
49
49
|
...l,
|
|
50
50
|
...t
|
|
51
|
-
}),
|
|
52
|
-
},
|
|
51
|
+
}), E().setItem(m.SELECTED_CLIENT, JSON.stringify(l));
|
|
52
|
+
}, R = () => ({
|
|
53
53
|
httpClient: a(l),
|
|
54
|
-
resetState:
|
|
54
|
+
resetState: h,
|
|
55
55
|
setHttpClient: T,
|
|
56
|
-
setDefaultHttpClient:
|
|
56
|
+
setDefaultHttpClient: _,
|
|
57
57
|
excludedClients: a(c),
|
|
58
58
|
setExcludedClients: (t) => {
|
|
59
59
|
c.value = t, p(l, u());
|
|
@@ -61,10 +61,10 @@ const l = k(u()), T = (t) => {
|
|
|
61
61
|
availableTargets: r,
|
|
62
62
|
getClientTitle: K,
|
|
63
63
|
getTargetTitle: d,
|
|
64
|
-
httpTargetTitle:
|
|
64
|
+
httpTargetTitle: L,
|
|
65
65
|
httpClientTitle: S
|
|
66
66
|
});
|
|
67
67
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
b as filterHiddenClients,
|
|
69
|
+
R as useHttpClientStore
|
|
70
70
|
};
|