@scalar/api-reference 1.25.78 → 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.
- package/CHANGELOG.md +21 -0
- package/dist/browser/standalone.js +6969 -6969
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Section/CompactSection.vue.js +2 -2
- package/dist/components/Section/CompactSection.vue2.js +16 -16
- package/dist/features/Operation/hooks/useRequestExample.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useRequestExample.js +46 -38
- package/dist/index.js +1 -1
- package/dist/legacy/helpers/getUrlFromServerState.js +8 -8
- package/dist/style.css +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CompactSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f61b582b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as d, ref as m, watch as p, nextTick as u, openBlock as a, createElementBlock as f, createElementVNode as v, normalizeClass as h, createVNode as i, unref as b, withCtx as n, renderSlot as r, createBlock as C, createCommentVNode as k } from "vue";
|
|
2
2
|
import { ScalarIcon as g } from "@scalar/components";
|
|
3
3
|
import S from "../Anchor/Anchor.vue.js";
|
|
4
4
|
import w from "./Section.vue.js";
|
|
5
5
|
import { scrollToId as N } from "../../helpers/scrollToId.js";
|
|
6
6
|
import { useNavState as B } from "../../hooks/useNavState.js";
|
|
7
|
-
const V = ["aria-expanded"], x = /* @__PURE__ */
|
|
7
|
+
const V = ["aria-expanded"], x = /* @__PURE__ */ d({
|
|
8
8
|
__name: "CompactSection",
|
|
9
9
|
props: {
|
|
10
10
|
id: {},
|
|
11
11
|
label: {}
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const l =
|
|
15
|
-
return
|
|
16
|
-
|
|
13
|
+
setup(s) {
|
|
14
|
+
const l = s, { hash: c } = B(), e = m(!1);
|
|
15
|
+
return p(
|
|
16
|
+
c,
|
|
17
17
|
async (o) => {
|
|
18
|
-
o === l.id && !e.value && (e.value = !0, await
|
|
18
|
+
o === l.id && !e.value && (e.value = !0, await u(), N(l.id));
|
|
19
19
|
},
|
|
20
20
|
{ immediate: !0 }
|
|
21
|
-
), (o, t) => (a(),
|
|
21
|
+
), (o, t) => (a(), f("div", {
|
|
22
22
|
"aria-expanded": e.value,
|
|
23
23
|
class: "collapsible-section"
|
|
24
24
|
}, [
|
|
25
|
-
|
|
26
|
-
class:
|
|
25
|
+
v("div", {
|
|
26
|
+
class: h(["collapsible-section-trigger", { "collapsible-section-trigger-open": e.value }]),
|
|
27
27
|
onClick: t[0] || (t[0] = (_) => e.value = !e.value)
|
|
28
28
|
}, [
|
|
29
|
-
i(
|
|
29
|
+
i(b(g), {
|
|
30
30
|
icon: e.value ? "ChevronDown" : "ChevronRight",
|
|
31
31
|
size: "md",
|
|
32
32
|
thickness: "1.5"
|
|
@@ -35,20 +35,20 @@ const V = ["aria-expanded"], x = /* @__PURE__ */ m({
|
|
|
35
35
|
id: o.id,
|
|
36
36
|
class: "collapsible-section-header"
|
|
37
37
|
}, {
|
|
38
|
-
default:
|
|
39
|
-
|
|
38
|
+
default: n(() => [
|
|
39
|
+
r(o.$slots, "heading", {}, void 0, !0)
|
|
40
40
|
]),
|
|
41
41
|
_: 3
|
|
42
42
|
}, 8, ["id"])
|
|
43
43
|
], 2),
|
|
44
|
-
e.value ? (a(), C(
|
|
44
|
+
e.value ? (a(), C(w, {
|
|
45
45
|
key: 0,
|
|
46
46
|
id: o.id,
|
|
47
47
|
class: "collapsible-section-content",
|
|
48
48
|
label: o.label
|
|
49
49
|
}, {
|
|
50
|
-
default:
|
|
51
|
-
|
|
50
|
+
default: n(() => [
|
|
51
|
+
r(o.$slots, "default", {}, void 0, !0)
|
|
52
52
|
]),
|
|
53
53
|
_: 3
|
|
54
54
|
}, 8, ["id", "label"])) : k("", !0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRequestExample.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useRequestExample.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRequestExample.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/hooks/useRequestExample.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,KAAK,CAAA;AAKhD,qGAAqG;AACrG,eAAO,MAAM,iBAAiB,mFAO3B;IACD,SAAS,EAAE,oBAAoB,CAAA;IAC/B,UAAU,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC/C,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IACpC,eAAe,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAClD,eAAe,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAClD,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC5B;;;CAsGA,CAAA"}
|
|
@@ -1,68 +1,76 @@
|
|
|
1
|
-
import { getRequest as
|
|
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
|
|
4
|
-
|
|
3
|
+
import { computed as a } from "vue";
|
|
4
|
+
import { getUrlFromServerState as x } from "../../../legacy/helpers/getUrlFromServerState.js";
|
|
5
|
+
import { useServerStore as R } from "../../../legacy/stores/useServerStore.js";
|
|
6
|
+
const { server: w } = R(), T = ({
|
|
5
7
|
operation: p,
|
|
6
8
|
collection: d,
|
|
7
|
-
requests:
|
|
9
|
+
requests: y,
|
|
8
10
|
requestExamples: q,
|
|
9
|
-
securitySchemes:
|
|
11
|
+
securitySchemes: m,
|
|
10
12
|
server: b
|
|
11
13
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
() =>
|
|
14
|
-
),
|
|
15
|
-
var
|
|
16
|
-
const t = ((
|
|
17
|
-
(
|
|
18
|
-
), e =
|
|
19
|
-
if (
|
|
20
|
-
return ((
|
|
14
|
+
const i = a(
|
|
15
|
+
() => j(y, p.path, p.httpVerb)
|
|
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
|
+
(s) => Object.keys(s).length
|
|
20
|
+
), e = r.map((s) => Object.keys(s)[0]);
|
|
21
|
+
if (r.length < t.length)
|
|
22
|
+
return ((o = d.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
|
|
21
23
|
{
|
|
22
|
-
const
|
|
23
|
-
var
|
|
24
|
-
return (
|
|
24
|
+
const s = Object.values(m), O = e.map((f) => {
|
|
25
|
+
var c;
|
|
26
|
+
return (c = s.find((U) => U.nameKey === f)) == null ? void 0 : c.uid;
|
|
25
27
|
}).filter(Boolean);
|
|
26
28
|
return (l = d.value) == null ? void 0 : l.selectedSecuritySchemeUids.filter(
|
|
27
|
-
(
|
|
29
|
+
(f) => O.find((c) => c === f)
|
|
28
30
|
);
|
|
29
31
|
}
|
|
30
|
-
}), h =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
}), h = a(() => {
|
|
33
|
+
const t = b.value, { modifiedUrl: r } = x(w, t);
|
|
34
|
+
return {
|
|
35
|
+
uid: (t == null ? void 0 : t.uid) || "",
|
|
36
|
+
url: r || ""
|
|
37
|
+
};
|
|
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
|
+
const [r, e] = k({
|
|
43
|
+
request: i.value,
|
|
36
44
|
example: t,
|
|
37
|
-
server:
|
|
38
|
-
securitySchemes:
|
|
39
|
-
selectedSecuritySchemeUids:
|
|
45
|
+
server: h.value,
|
|
46
|
+
securitySchemes: m,
|
|
47
|
+
selectedSecuritySchemeUids: v.value,
|
|
40
48
|
// TODO: env vars if we want em
|
|
41
49
|
environment: {},
|
|
42
50
|
// TODO: cookies if we want em
|
|
43
51
|
globalCookies: []
|
|
44
52
|
});
|
|
45
|
-
if (
|
|
46
|
-
return console.error("[useRequestExample]",
|
|
47
|
-
const
|
|
48
|
-
((
|
|
53
|
+
if (r)
|
|
54
|
+
return console.error("[useRequestExample]", r), null;
|
|
55
|
+
const u = Object.keys(
|
|
56
|
+
((s = (l = p.information) == null ? void 0 : l.requestBody) == null ? void 0 : s.content) ?? {}
|
|
49
57
|
);
|
|
50
|
-
return e.request.headers.get("content-type") === "text/plain;charset=UTF-8" &&
|
|
51
|
-
}),
|
|
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(
|
|
52
60
|
() => {
|
|
53
61
|
var t;
|
|
54
|
-
return ((t =
|
|
55
|
-
const e =
|
|
62
|
+
return ((t = v.value) == null ? void 0 : t.flatMap((r) => {
|
|
63
|
+
const e = m[r];
|
|
56
64
|
return (e == null ? void 0 : e.type) === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
|
|
57
65
|
e.token,
|
|
58
66
|
e.password,
|
|
59
67
|
btoa(`${e.username}:${e.password}`)
|
|
60
|
-
] : (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) : [];
|
|
61
69
|
})) ?? [];
|
|
62
70
|
}
|
|
63
71
|
);
|
|
64
|
-
return { request:
|
|
72
|
+
return { request: S, secretCredentials: g };
|
|
65
73
|
};
|
|
66
74
|
export {
|
|
67
|
-
|
|
75
|
+
T as useRequestExample
|
|
68
76
|
};
|