@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.
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-85dc7ad0"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f61b582b"]]);
5
5
  export {
6
- p as default
6
+ a as default
7
7
  };
@@ -1,32 +1,32 @@
1
- import { defineComponent as m, ref as p, watch as u, nextTick as f, openBlock as a, createElementBlock as v, createElementVNode as h, normalizeClass as b, createVNode as i, unref as n, withCtx as r, renderSlot as s, createBlock as C, createCommentVNode as k } from "vue";
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__ */ m({
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(c) {
14
- const l = c, { hash: d } = B(), e = p(!1);
15
- return u(
16
- d,
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 f(), N(l.id));
18
+ o === l.id && !e.value && (e.value = !0, await u(), N(l.id));
19
19
  },
20
20
  { immediate: !0 }
21
- ), (o, t) => (a(), v("div", {
21
+ ), (o, t) => (a(), f("div", {
22
22
  "aria-expanded": e.value,
23
23
  class: "collapsible-section"
24
24
  }, [
25
- h("div", {
26
- class: b(["collapsible-section-trigger", { "collapsible-section-trigger-open": e.value }]),
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(n(g), {
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: r(() => [
39
- s(o.$slots, "heading", {}, void 0, !0)
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(n(w), {
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: r(() => [
51
- s(o.$slots, "default", {}, void 0, !0)
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":"AAEA,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;AAEhD,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;;;CA6FA,CAAA"}
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 S } from "../../../helpers/get-request.js";
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 c } from "vue";
4
- const w = ({
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: v,
9
+ requests: y,
8
10
  requestExamples: q,
9
- securitySchemes: f,
11
+ securitySchemes: m,
10
12
  server: b
11
13
  }) => {
12
- const o = c(
13
- () => S(v, p.path, p.httpVerb)
14
- ), y = c(() => {
15
- var n, u, a, l;
16
- const t = ((n = o.value) == null ? void 0 : n.security) ?? ((u = d.value) == null ? void 0 : u.security) ?? [], s = t.filter(
17
- (r) => Object.keys(r).length
18
- ), e = s.map((r) => Object.keys(r)[0]);
19
- if (s.length < t.length)
20
- return ((a = d.value) == null ? void 0 : a.selectedSecuritySchemeUids) ?? [];
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 r = Object.values(f), g = e.map((m) => {
23
- var i;
24
- return (i = r.find((j) => j.nameKey === m)) == null ? void 0 : i.uid;
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
- (m) => g.find((i) => i === m)
29
+ (f) => O.find((c) => c === f)
28
30
  );
29
31
  }
30
- }), h = c(() => {
31
- var u, a, l, r;
32
- const t = q[((a = (u = o.value) == null ? void 0 : u.examples) == null ? void 0 : a[0]) ?? ""];
33
- if (!o.value || !t) return null;
34
- const [s, e] = k({
35
- request: o.value,
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: b.value,
38
- securitySchemes: f,
39
- selectedSecuritySchemeUids: y.value,
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 (s)
46
- return console.error("[useRequestExample]", s), null;
47
- const n = Object.keys(
48
- ((r = (l = p.information) == null ? void 0 : l.requestBody) == null ? void 0 : r.content) ?? {}
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" && n.length && e.request.headers.set("content-type", n[0]), e.request;
51
- }), O = c(
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 = y.value) == null ? void 0 : t.flatMap((s) => {
55
- const e = f[s];
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((n) => n.token) : [];
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: h, secretCredentials: O };
72
+ return { request: S, secretCredentials: g };
65
73
  };
66
74
  export {
67
- w as useRequestExample
75
+ T as useRequestExample
68
76
  };