@scalar/api-reference 1.25.79 → 1.25.80
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getRequest as j } from "../../../helpers/get-request.js";
|
|
2
2
|
import { createRequestOperation as k } from "@scalar/api-client/libs";
|
|
3
|
-
import { computed as
|
|
3
|
+
import { computed as a } from "vue";
|
|
4
4
|
import { getUrlFromServerState as x } from "../../../legacy/helpers/getUrlFromServerState.js";
|
|
5
5
|
import { useServerStore as R } from "../../../legacy/stores/useServerStore.js";
|
|
6
6
|
const { server: w } = R(), T = ({
|
|
@@ -9,13 +9,13 @@ const { server: w } = R(), T = ({
|
|
|
9
9
|
requests: y,
|
|
10
10
|
requestExamples: q,
|
|
11
11
|
securitySchemes: m,
|
|
12
|
-
server:
|
|
12
|
+
server: b
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
14
|
+
const i = a(
|
|
15
15
|
() => j(y, p.path, p.httpVerb)
|
|
16
|
-
), v =
|
|
17
|
-
var
|
|
18
|
-
const t = ((
|
|
16
|
+
), v = a(() => {
|
|
17
|
+
var u, n, o, l;
|
|
18
|
+
const t = ((u = i.value) == null ? void 0 : u.security) ?? ((n = d.value) == null ? void 0 : n.security) ?? [], r = t.filter(
|
|
19
19
|
(s) => Object.keys(s).length
|
|
20
20
|
), e = r.map((s) => Object.keys(s)[0]);
|
|
21
21
|
if (r.length < t.length)
|
|
@@ -25,24 +25,24 @@ const { server: w } = R(), T = ({
|
|
|
25
25
|
var c;
|
|
26
26
|
return (c = s.find((U) => U.nameKey === f)) == null ? void 0 : c.uid;
|
|
27
27
|
}).filter(Boolean);
|
|
28
|
-
return (
|
|
28
|
+
return (l = d.value) == null ? void 0 : l.selectedSecuritySchemeUids.filter(
|
|
29
29
|
(f) => O.find((c) => c === f)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
}),
|
|
33
|
-
const t =
|
|
32
|
+
}), h = a(() => {
|
|
33
|
+
const t = b.value, { modifiedUrl: r } = x(w, t);
|
|
34
34
|
return {
|
|
35
|
-
uid: t.uid,
|
|
35
|
+
uid: (t == null ? void 0 : t.uid) || "",
|
|
36
36
|
url: r || ""
|
|
37
37
|
};
|
|
38
|
-
}),
|
|
39
|
-
var
|
|
40
|
-
const t = q[((o = (
|
|
41
|
-
if (!
|
|
38
|
+
}), S = a(() => {
|
|
39
|
+
var n, o, l, s;
|
|
40
|
+
const t = q[((o = (n = i.value) == null ? void 0 : n.examples) == null ? void 0 : o[0]) ?? ""];
|
|
41
|
+
if (!i.value || !t) return null;
|
|
42
42
|
const [r, e] = k({
|
|
43
|
-
request:
|
|
43
|
+
request: i.value,
|
|
44
44
|
example: t,
|
|
45
|
-
server:
|
|
45
|
+
server: h.value,
|
|
46
46
|
securitySchemes: m,
|
|
47
47
|
selectedSecuritySchemeUids: v.value,
|
|
48
48
|
// TODO: env vars if we want em
|
|
@@ -52,11 +52,11 @@ const { server: w } = R(), T = ({
|
|
|
52
52
|
});
|
|
53
53
|
if (r)
|
|
54
54
|
return console.error("[useRequestExample]", r), null;
|
|
55
|
-
const
|
|
56
|
-
((s = (
|
|
55
|
+
const u = Object.keys(
|
|
56
|
+
((s = (l = p.information) == null ? void 0 : l.requestBody) == null ? void 0 : s.content) ?? {}
|
|
57
57
|
);
|
|
58
|
-
return e.request.headers.get("content-type") === "text/plain;charset=UTF-8" &&
|
|
59
|
-
}), g =
|
|
58
|
+
return e.request.headers.get("content-type") === "text/plain;charset=UTF-8" && u.length && e.request.headers.set("content-type", u[0]), e.request;
|
|
59
|
+
}), g = a(
|
|
60
60
|
() => {
|
|
61
61
|
var t;
|
|
62
62
|
return ((t = v.value) == null ? void 0 : t.flatMap((r) => {
|
|
@@ -65,11 +65,11 @@ const { server: w } = R(), T = ({
|
|
|
65
65
|
e.token,
|
|
66
66
|
e.password,
|
|
67
67
|
btoa(`${e.username}:${e.password}`)
|
|
68
|
-
] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((
|
|
68
|
+
] : (e == null ? void 0 : e.type) === "oauth2" ? Object.values(e.flows).map((u) => u.token) : [];
|
|
69
69
|
})) ?? [];
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
|
-
return { request:
|
|
72
|
+
return { request: S, secretCredentials: g };
|
|
73
73
|
};
|
|
74
74
|
export {
|
|
75
75
|
T as useRequestExample
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.25.
|
|
23
|
+
"version": "1.25.80",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=18"
|
|
26
26
|
},
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@scalar/api-client": "2.2.11",
|
|
59
59
|
"@scalar/code-highlight": "0.0.18",
|
|
60
60
|
"@scalar/components": "0.13.4",
|
|
61
|
-
"@scalar/oas-utils": "0.2.87",
|
|
62
61
|
"@scalar/openapi-parser": "0.9.0",
|
|
62
|
+
"@scalar/oas-utils": "0.2.87",
|
|
63
63
|
"@scalar/openapi-types": "0.1.5",
|
|
64
64
|
"@scalar/snippetz": "0.2.8",
|
|
65
65
|
"@scalar/themes": "0.9.54",
|