@scalar/api-reference 1.31.2 → 1.31.3
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 +22 -0
- package/dist/browser/standalone.js +7530 -7506
- 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 +3 -2
- 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/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +87 -103
- 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 +40 -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 +2 -2
- package/dist/features/DownloadLink/DownloadLink.vue2.js +45 -28
- package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
- package/dist/index.js +1 -1
- 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 +17 -18
- package/dist/style.css +1 -1
- package/package.json +12 -12
- 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/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,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { computed as o, readonly as a, ref as C, reactive as k } from "vue";
|
|
1
|
+
import { objectMerge as C, safeLocalStorage as E, REFERENCE_LS_KEYS as m } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { snippetz as k } from "@scalar/snippetz";
|
|
3
|
+
import { computed as o, readonly as a, ref as p, reactive as A } from "vue";
|
|
5
4
|
const y = {
|
|
6
5
|
targetKey: "shell",
|
|
7
6
|
clientKey: "curl"
|
|
8
|
-
}, { clients:
|
|
7
|
+
}, { clients: H } = k();
|
|
9
8
|
function d(t) {
|
|
10
9
|
var n;
|
|
11
10
|
return ((n = r.value.find((e) => e.key === t.targetKey)) == null ? void 0 : n.title) ?? t.targetKey;
|
|
@@ -14,8 +13,8 @@ function K(t) {
|
|
|
14
13
|
var n, e;
|
|
15
14
|
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
15
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
16
|
+
const L = o(() => d(l)), S = o(() => K(l));
|
|
17
|
+
function b(t, n) {
|
|
19
18
|
return n.value === !0 ? [] : t.flatMap((e) => {
|
|
20
19
|
var i;
|
|
21
20
|
return typeof n.value != "object" ? [] : Array.isArray(n.value) ? (e.clients = e.clients.filter(
|
|
@@ -25,8 +24,8 @@ function L(t, n) {
|
|
|
25
24
|
n.value[e.key].includes(s.client))), (i = e == null ? void 0 : e.clients) != null && i.length ? [e] : []);
|
|
26
25
|
});
|
|
27
26
|
}
|
|
28
|
-
const r = o(() =>
|
|
29
|
-
function
|
|
27
|
+
const r = o(() => b(H(), c)), c = p({}), f = p();
|
|
28
|
+
function _(t) {
|
|
30
29
|
t !== void 0 && (f.value = t, T(u()));
|
|
31
30
|
}
|
|
32
31
|
const u = () => {
|
|
@@ -41,30 +40,30 @@ function v(t) {
|
|
|
41
40
|
(n) => n.key === t.targetKey && n.clients.find((e) => e.client === t.clientKey)
|
|
42
41
|
);
|
|
43
42
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
43
|
+
function h() {
|
|
44
|
+
C(l, u());
|
|
46
45
|
}
|
|
47
|
-
const l =
|
|
46
|
+
const l = A(u()), T = (t) => {
|
|
48
47
|
Object.assign(l, {
|
|
49
48
|
...l,
|
|
50
49
|
...t
|
|
51
|
-
}),
|
|
50
|
+
}), E.setItem(m.SELECTED_CLIENT, JSON.stringify(l));
|
|
52
51
|
}, D = () => ({
|
|
53
52
|
httpClient: a(l),
|
|
54
|
-
resetState:
|
|
53
|
+
resetState: h,
|
|
55
54
|
setHttpClient: T,
|
|
56
|
-
setDefaultHttpClient:
|
|
55
|
+
setDefaultHttpClient: _,
|
|
57
56
|
excludedClients: a(c),
|
|
58
57
|
setExcludedClients: (t) => {
|
|
59
|
-
c.value = t,
|
|
58
|
+
c.value = t, C(l, u());
|
|
60
59
|
},
|
|
61
60
|
availableTargets: r,
|
|
62
61
|
getClientTitle: K,
|
|
63
62
|
getTargetTitle: d,
|
|
64
|
-
httpTargetTitle:
|
|
63
|
+
httpTargetTitle: L,
|
|
65
64
|
httpClientTitle: S
|
|
66
65
|
});
|
|
67
66
|
export {
|
|
68
|
-
|
|
67
|
+
b as filterHiddenClients,
|
|
69
68
|
D as useHttpClientStore
|
|
70
69
|
};
|