@scalar/api-reference 1.25.30 → 1.25.32
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 +26 -0
- package/dist/browser/standalone.js +10978 -11434
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- 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 +11 -13
- package/dist/components/Content/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/Operation.vue.js +2 -2
- package/dist/components/Content/Operation/Operation.vue2.js +21 -18
- package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
- package/dist/components/Content/Operation/OperationAccordion.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +6 -0
- 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 +123 -101
- package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
- package/dist/hooks/useReactiveSpec.js +31 -26
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
import { isValidUrl as d, fetchSpecFromUrl as f, prettyPrintJson as
|
|
2
|
-
import { ref as u, reactive as
|
|
3
|
-
import { parse as
|
|
1
|
+
import { isValidUrl as d, fetchSpecFromUrl as f, prettyPrintJson as h } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { ref as u, reactive as v, watch as m, toValue as a } from "vue";
|
|
3
|
+
import { parse as g } from "../helpers/parse.js";
|
|
4
4
|
import { createEmptySpecification as l } from "../helpers/createEmptySpecification.js";
|
|
5
|
-
const y = async ({ url: e, content: r },
|
|
5
|
+
const y = async ({ url: e, content: r }, n) => {
|
|
6
6
|
if (e) {
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const s = performance.now();
|
|
8
|
+
try {
|
|
9
|
+
const c = d(e) ? await f(e, n) : await f(e), o = performance.now();
|
|
10
|
+
return console.log(`fetch: ${Math.round(o - s)} ms (${e})`), console.log("size:", Math.round(c.length / 1024), "kB"), c;
|
|
11
|
+
} catch (c) {
|
|
12
|
+
console.error("Failed to fetch spec from URL:", c);
|
|
13
|
+
}
|
|
9
14
|
}
|
|
10
15
|
const t = typeof r == "function" ? r() : r;
|
|
11
16
|
if (typeof t == "string")
|
|
12
17
|
return t;
|
|
13
18
|
if (typeof t == "object")
|
|
14
|
-
return
|
|
19
|
+
return h(t);
|
|
15
20
|
};
|
|
16
|
-
function
|
|
21
|
+
function U({
|
|
17
22
|
specConfig: e,
|
|
18
23
|
proxy: r
|
|
19
24
|
}) {
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
return
|
|
25
|
+
const n = u(""), t = v(l()), s = u(null);
|
|
26
|
+
function c(o) {
|
|
27
|
+
return o ? g(o, {
|
|
23
28
|
proxy: r ? a(r) : void 0
|
|
24
|
-
}).then((
|
|
25
|
-
|
|
29
|
+
}).then((i) => {
|
|
30
|
+
s.value = null, Object.assign(t, {
|
|
26
31
|
servers: [],
|
|
27
|
-
...
|
|
32
|
+
...i
|
|
28
33
|
});
|
|
29
|
-
}).catch((
|
|
30
|
-
|
|
34
|
+
}).catch((i) => {
|
|
35
|
+
s.value = i.toString();
|
|
31
36
|
}) : Object.assign(t, l());
|
|
32
37
|
}
|
|
33
38
|
return m(
|
|
34
39
|
() => a(e),
|
|
35
|
-
async (
|
|
36
|
-
var
|
|
37
|
-
if (
|
|
38
|
-
const p = (
|
|
39
|
-
typeof p == "string" && (
|
|
40
|
+
async (o) => {
|
|
41
|
+
var i;
|
|
42
|
+
if (o) {
|
|
43
|
+
const p = (i = await y(o, a(r))) == null ? void 0 : i.trim();
|
|
44
|
+
typeof p == "string" && (n.value = p);
|
|
40
45
|
}
|
|
41
46
|
},
|
|
42
47
|
{ immediate: !0, deep: !0 }
|
|
43
|
-
), m(
|
|
44
|
-
|
|
48
|
+
), m(n, () => {
|
|
49
|
+
c(n.value);
|
|
45
50
|
}), {
|
|
46
|
-
rawSpec:
|
|
51
|
+
rawSpec: n,
|
|
47
52
|
parsedSpec: t,
|
|
48
|
-
specErrors:
|
|
53
|
+
specErrors: s
|
|
49
54
|
};
|
|
50
55
|
}
|
|
51
56
|
export {
|
|
52
|
-
|
|
57
|
+
U as useReactiveSpec
|
|
53
58
|
};
|