@scalar/api-reference 0.5.3 → 0.5.4

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.
Files changed (2) hide show
  1. package/dist/index.js +77 -67
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  var Yp = Object.defineProperty;
3
3
  var Wp = (n, e, t) => e in n ? Yp(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
4
  var W0 = (n, e, t) => (Wp(n, typeof e != "symbol" ? e + "" : e, t), t);
5
- import { cloneVNode as Lp, h as Ye, Fragment as se, inject as wt, provide as At, ref as L, onMounted as Se, watchEffect as Mt, computed as E, defineComponent as W, onUnmounted as yt, watch as De, Teleport as zp, reactive as ln, unref as _, shallowRef as Bp, nextTick as rn, toRaw as qt, getCurrentScope as Ip, onScopeDispose as Hp, toRef as m2, readonly as xs, customRef as Np, getCurrentInstance as Gp, openBlock as Q, createElementBlock as X, createBlock as H, withCtx as Y, createElementVNode as x, createVNode as U, normalizeClass as he, normalizeStyle as Ji, createTextVNode as Ze, toDisplayString as G, createCommentVNode as te, renderSlot as ae, renderList as Ue, createStaticVNode as _s, withDirectives as xe, withModifiers as Fp, vShow as bn, vModelSelect as Dp, vModelText as ft, vModelCheckbox as pl, withKeys as Jp, defineAsyncComponent as v2, pushScopeId as Qs, popScopeId as $s, useCssVars as w2, mergeProps as Kp, resolveDynamicComponent as L0, createSlots as z0, TransitionGroup as eO } from "vue";
5
+ import { cloneVNode as Lp, h as Ye, Fragment as se, inject as wt, provide as At, ref as L, onMounted as Se, watchEffect as Mt, computed as E, defineComponent as W, onUnmounted as yt, watch as Ge, Teleport as zp, reactive as ln, unref as _, shallowRef as Bp, nextTick as rn, toRaw as qt, getCurrentScope as Ip, onScopeDispose as Hp, toRef as m2, readonly as xs, customRef as Np, getCurrentInstance as Gp, openBlock as Q, createElementBlock as X, createBlock as H, withCtx as Y, createElementVNode as x, createVNode as U, normalizeClass as he, normalizeStyle as Ji, createTextVNode as Ze, toDisplayString as G, createCommentVNode as te, renderSlot as ae, renderList as Ue, createStaticVNode as _s, withDirectives as xe, withModifiers as Fp, vShow as bn, vModelSelect as Dp, vModelText as ft, vModelCheckbox as pl, withKeys as Jp, defineAsyncComponent as v2, pushScopeId as Qs, popScopeId as $s, useCssVars as w2, mergeProps as Kp, resolveDynamicComponent as L0, createSlots as z0, TransitionGroup as eO } from "vue";
6
6
  import tO from "rehype-document";
7
7
  import nO from "rehype-format";
8
8
  import rO, { defaultSchema as B0 } from "rehype-sanitize";
@@ -482,7 +482,7 @@ CO(() => {
482
482
  });
483
483
  function ZO(n) {
484
484
  let e = L(Fn.slice());
485
- return De([n], ([t], [r]) => {
485
+ return Ge([n], ([t], [r]) => {
486
486
  r === !0 && t === !1 ? U1(() => {
487
487
  e.value.splice(0);
488
488
  }) : r === !1 && t === !0 && (e.value = Fn.slice());
@@ -505,7 +505,7 @@ function XO({ ownerDocument: n }, e) {
505
505
  function RO({ ownerDocument: n, container: e, initialFocus: t }, r) {
506
506
  let i = L(null), o = L(!1);
507
507
  return Se(() => o.value = !0), yt(() => o.value = !1), Se(() => {
508
- De([e, t, r], (s, l) => {
508
+ Ge([e, t, r], (s, l) => {
509
509
  if (s.every((c, u) => (l == null ? void 0 : l[u]) === c) || !r.value)
510
510
  return;
511
511
  let a = K(e);
@@ -651,7 +651,7 @@ function VO({ type: n, enabled: e, element: t, onUpdate: r }) {
651
651
  r == null || r(...s), i(...s);
652
652
  }
653
653
  Se(() => {
654
- De(e, (s, l) => {
654
+ Ge(e, (s, l) => {
655
655
  s ? o(0, n, t) : l === !0 && o(1, n, t);
656
656
  }, { immediate: !0, flush: "sync" });
657
657
  }), yt(() => {
@@ -779,7 +779,7 @@ function FO(n, e, t) {
779
779
  let o = n.value ? r.value.get(n.value) : void 0;
780
780
  return o ? o.count > 0 : !1;
781
781
  });
782
- return De([n, e], ([o, s], [l], a) => {
782
+ return Ge([n, e], ([o, s], [l], a) => {
783
783
  if (!o || !s)
784
784
  return;
785
785
  er.dispatch("PUSH", o, t);
@@ -860,8 +860,8 @@ let fo = "DC8F892D-2EBD-447C-A4C8-A03058436FF4", V2 = W({ name: "Dialog", inheri
860
860
  Z2((o = h.value) == null ? void 0 : o.defaultView, "keydown", (Oe) => {
861
861
  $e.value && (Oe.defaultPrevented || Oe.key === fe.Escape && (Oe.preventDefault(), Oe.stopPropagation(), I.close()));
862
862
  });
863
- let Fe = E(() => !(A.value || d.value !== 0 || m));
864
- return FO(h, Fe, (Oe) => {
863
+ let De = E(() => !(A.value || d.value !== 0 || m));
864
+ return FO(h, De, (Oe) => {
865
865
  var we;
866
866
  return { containers: [...(we = Oe.containers) != null ? we : [], k] };
867
867
  }), Mt((Oe) => {
@@ -1120,7 +1120,7 @@ let h3 = W({ name: "Listbox", emits: { "update:modelValue": (n) => !0 }, props:
1120
1120
  return (k = K(s)) == null ? void 0 : k.closest("form");
1121
1121
  });
1122
1122
  return Se(() => {
1123
- De([b], () => {
1123
+ Ge([b], () => {
1124
1124
  if (!b.value || n.defaultValue === void 0)
1125
1125
  return;
1126
1126
  function k() {
@@ -1249,7 +1249,7 @@ let d3 = W({ name: "ListboxButton", props: { as: { type: [Object, String], defau
1249
1249
  return c();
1250
1250
  }, domRef: o }));
1251
1251
  Se(() => i.registerOption(n.id, u)), yt(() => i.unregisterOption(n.id)), Se(() => {
1252
- De([i.listboxState, l], () => {
1252
+ Ge([i.listboxState, l], () => {
1253
1253
  i.listboxState.value === 0 && l.value && ze(i.mode.value, { 1: () => {
1254
1254
  a.value && i.goToOption(pt.Specific, n.id);
1255
1255
  }, 0: () => {
@@ -1368,7 +1368,7 @@ let j1 = Symbol("TabsSSRContext"), N2 = W({ name: "TabGroup", emits: { change: (
1368
1368
  }), At(j1, E(() => f.value ? null : d.value));
1369
1369
  let O = E(() => n.selectedIndex);
1370
1370
  return Se(() => {
1371
- De([O], () => {
1371
+ Ge([O], () => {
1372
1372
  var m;
1373
1373
  return u((m = n.selectedIndex) != null ? m : n.defaultIndex);
1374
1374
  }, { immediate: !0 });
@@ -1500,7 +1500,7 @@ function Ar({
1500
1500
  a() && (f.preventDefault(), t(f));
1501
1501
  };
1502
1502
  return Se(() => {
1503
- De(
1503
+ Ge(
1504
1504
  c,
1505
1505
  (f, O) => {
1506
1506
  const m = O === "document" ? document : O;
@@ -2090,10 +2090,10 @@ V1.write = function(n, e, t, r, i, o) {
2090
2090
  }
2091
2091
  q === null ? (q = 65533, ue = 1) : q > 65535 && (q -= 65536, y.push(q >>> 10 & 1023 | 55296), q = 56320 | q & 1023), y.push(q), T += ue;
2092
2092
  }
2093
- return Fe(y);
2093
+ return De(y);
2094
2094
  }
2095
2095
  const $e = 4096;
2096
- function Fe(w) {
2096
+ function De(w) {
2097
2097
  const p = w.length;
2098
2098
  if (p <= $e)
2099
2099
  return String.fromCharCode.apply(String, w);
@@ -2743,7 +2743,7 @@ function rd(n, e, t = {}) {
2743
2743
  s && (s.disconnect(), s = void 0);
2744
2744
  }, c = E(
2745
2745
  () => Array.isArray(n) ? n.map((d) => _i(d)) : [_i(n)]
2746
- ), u = De(
2746
+ ), u = Ge(
2747
2747
  c,
2748
2748
  (d) => {
2749
2749
  if (a(), l.value && i) {
@@ -2773,7 +2773,7 @@ function id(n, e, t = {}) {
2773
2773
  return (Array.isArray(O) ? O : [O]).map(_i).filter(X3);
2774
2774
  });
2775
2775
  let u = qo;
2776
- const h = L(l), d = a.value ? De(
2776
+ const h = L(l), d = a.value ? Ge(
2777
2777
  () => [c.value, _i(r), h.value],
2778
2778
  ([O, m]) => {
2779
2779
  if (u(), !h.value || !O.length)
@@ -3840,12 +3840,12 @@ function t4(n) {
3840
3840
  return;
3841
3841
  } else
3842
3842
  throw new RangeError(`Unrecognized record size: ${N}`);
3843
- let oe = a[ee], $e, Fe, Oe = j - P;
3844
- if (B - j <= i && (Fe = m(l.pos - R, re))) {
3845
- let we = new Uint16Array(Fe.size - Fe.skip), Re = l.pos - Fe.size, Ee = we.length;
3843
+ let oe = a[ee], $e, De, Oe = j - P;
3844
+ if (B - j <= i && (De = m(l.pos - R, re))) {
3845
+ let we = new Uint16Array(De.size - De.skip), Re = l.pos - De.size, Ee = we.length;
3846
3846
  for (; l.pos > Re; )
3847
- Ee = v(Fe.start, we, Ee);
3848
- $e = new br(we, B - Fe.start, r), Oe = Fe.start - P;
3847
+ Ee = v(De.start, we, Ee);
3848
+ $e = new br(we, B - De.start, r), Oe = De.start - P;
3849
3849
  } else {
3850
3850
  let we = l.pos - N;
3851
3851
  l.next();
@@ -3900,7 +3900,7 @@ function t4(n) {
3900
3900
  let oe = A.pos - I;
3901
3901
  if (I < 0 || oe < N || A.start < j)
3902
3902
  break;
3903
- let $e = A.id >= s ? 4 : 0, Fe = A.start;
3903
+ let $e = A.id >= s ? 4 : 0, De = A.start;
3904
3904
  for (A.next(); A.pos > oe; ) {
3905
3905
  if (A.size < 0)
3906
3906
  if (A.size == -3)
@@ -3911,7 +3911,7 @@ function t4(n) {
3911
3911
  A.id >= s && ($e += 4);
3912
3912
  A.next();
3913
3913
  }
3914
- re = Fe, V += I, ee += $e;
3914
+ re = De, V += I, ee += $e;
3915
3915
  }
3916
3916
  return (R < 0 || V == P) && (B.size = V, B.start = re, B.skip = ee), B.size > 4 ? B : void 0;
3917
3917
  }
@@ -16873,9 +16873,9 @@ function Tt(n) {
16873
16873
  for (; I.type == "statement" && n.dontIndentStatements.test(I.info); )
16874
16874
  I = I.prev;
16875
16875
  if (c.indent) {
16876
- var Fe = c.indent(j, I, B, N.unit);
16877
- if (typeof Fe == "number")
16878
- return Fe;
16876
+ var De = c.indent(j, I, B, N.unit);
16877
+ if (typeof De == "number")
16878
+ return De;
16879
16879
  }
16880
16880
  var Oe = I.prev && I.prev.info == "switch";
16881
16881
  if (n.allmanIndentation && /[{(]/.test(oe)) {
@@ -19745,7 +19745,7 @@ const Lu = _5({
19745
19745
  ]
19746
19746
  }), Il = L(!1), C9 = (n) => {
19747
19747
  const { extensions: e, content: t, forceDarkMode: r, forceLightMode: i, withoutTheme: o } = n, s = L(t ?? ""), l = L(null), a = L(null);
19748
- De(l, () => {
19748
+ Ge(l, () => {
19749
19749
  d(), c(e);
19750
19750
  });
19751
19751
  const c = (v) => {
@@ -19760,7 +19760,7 @@ const Lu = _5({
19760
19760
  le.theme({}, { dark: r ? !1 : Il.value }),
19761
19761
  u()
19762
19762
  ].filter((k) => k !== null), v];
19763
- De(Il, () => {
19763
+ Ge(Il, () => {
19764
19764
  const { extensions: v } = n;
19765
19765
  r || O(v);
19766
19766
  });
@@ -19882,12 +19882,12 @@ const Lu = _5({
19882
19882
  }, o = ["scalar-api-client__codemirror"];
19883
19883
  r.readOnly && o.push("scalar-api-client__codemirror--read-only");
19884
19884
  const s = () => {
19885
- const u = [];
19886
- return u.push(le.editorAttributes.of({ class: o.join(" ") })), r.extensions && r.extensions.forEach((h) => {
19887
- u.push(h);
19888
- }), r.readOnly && u.push(le.editable.of(!1)), r.languages && r.languages.filter((h) => typeof i[h] < "u").forEach((h) => {
19889
- u.push(i[h]);
19890
- }), r.lineNumbers && u.push(P7()), r.withVariables && u.push(Z9()), r.disableEnter && u.push(
19885
+ const h = [];
19886
+ return h.push(le.editorAttributes.of({ class: o.join(" ") })), r.extensions && r.extensions.forEach((d) => {
19887
+ h.push(d);
19888
+ }), r.readOnly && h.push(le.editable.of(!1)), r.languages && r.languages.filter((d) => typeof i[d] < "u").forEach((d) => {
19889
+ h.push(i[d]);
19890
+ }), r.lineNumbers && h.push(P7()), r.withVariables && h.push(Z9()), r.disableEnter && h.push(
19891
19891
  i0.of([
19892
19892
  {
19893
19893
  key: "Enter",
@@ -19903,22 +19903,32 @@ const Lu = _5({
19903
19903
  run: () => !0
19904
19904
  }
19905
19905
  ])
19906
- ), u.push(
19907
- le.updateListener.of((h) => {
19908
- h.docChanged && t("change", h.state.doc.toString());
19906
+ ), h.push(
19907
+ le.updateListener.of((d) => {
19908
+ d.docChanged && t("change", d.state.doc.toString());
19909
19909
  })
19910
- ), u;
19911
- }, { codeMirrorRef: l, setCodeMirrorContent: a, reconfigureCodeMirror: c } = C9({
19910
+ ), h;
19911
+ }, {
19912
+ codeMirrorRef: l,
19913
+ setCodeMirrorContent: a,
19914
+ reconfigureCodeMirror: c,
19915
+ restartCodeMirror: u
19916
+ } = C9({
19912
19917
  content: r.content ?? "",
19913
19918
  extensions: s(),
19914
19919
  withoutTheme: r.withoutTheme,
19915
19920
  forceDarkMode: r.forceDarkMode
19916
19921
  });
19917
- return De(r, () => {
19922
+ return Ge(r, () => {
19918
19923
  a(r.content ?? ""), c(s());
19919
- }), e({
19924
+ }), Ge(
19925
+ () => r.extensions,
19926
+ () => {
19927
+ u(s());
19928
+ }
19929
+ ), e({
19920
19930
  setCodeMirrorContent: a
19921
- }), (u, h) => (Q(), X("div", {
19931
+ }), (h, d) => (Q(), X("div", {
19922
19932
  ref_key: "codeMirrorRef",
19923
19933
  ref: l,
19924
19934
  class: "scalar-api-client__codemirror__wrapper"
@@ -25678,7 +25688,7 @@ function Hi(n, e = {}) {
25678
25688
  return [...n.toString()].map((s) => s === "\b" ? `${r}b` : s === " " ? `${r}t` : s === `
25679
25689
  ` ? i ? `${r}n` : s : s === "\f" ? `${r}f` : s === "\r" ? i ? `${r}r` : s : s === r ? r + r : s === t ? r + t : s < " " || s > "~" ? JSON.stringify(s).slice(1, -1) : s).join("");
25680
25690
  }
25681
- const Ni = (n) => Hi(n, { delimiter: "'" }), Ge = (n) => Hi(n, { delimiter: '"' }), pk = {
25691
+ const Ni = (n) => Hi(n, { delimiter: "'" }), Fe = (n) => Hi(n, { delimiter: '"' }), pk = {
25682
25692
  info: {
25683
25693
  key: "libcurl",
25684
25694
  title: "Libcurl",
@@ -25690,7 +25700,7 @@ const Ni = (n) => Hi(n, { delimiter: "'" }), Ge = (n) => Hi(n, { delimiter: '"'
25690
25700
  o("CURL *hnd = curl_easy_init();"), s(), o(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${n.toUpperCase()}");`), o(`curl_easy_setopt(hnd, CURLOPT_URL, "${e}");`);
25691
25701
  const a = Object.keys(t);
25692
25702
  return a.length && (s(), o("struct curl_slist *headers = NULL;"), a.forEach((c) => {
25693
- o(`headers = curl_slist_append(headers, "${c}: ${Ge(t[c])}");`);
25703
+ o(`headers = curl_slist_append(headers, "${c}: ${Fe(t[c])}");`);
25694
25704
  }), o("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), r.cookie && (s(), o(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${r.cookie}");`)), i != null && i.text && (s(), o(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(i.text)});`)), s(), o("CURLcode ret = curl_easy_perform(hnd);"), l();
25695
25705
  }
25696
25706
  }, Ok = {
@@ -25874,7 +25884,7 @@ ${t}`);
25874
25884
  }
25875
25885
  });
25876
25886
  if (O.length && (a("Headers =", 1), a("{", 1), O.forEach((m) => {
25877
- a(`{ "${m}", "${Ge(n[m])}" },`, 2);
25887
+ a(`{ "${m}", "${Fe(n[m])}" },`, 2);
25878
25888
  }), a("},", 1)), e != null && e.text) {
25879
25889
  const m = e.mimeType;
25880
25890
  switch (m) {
@@ -25907,7 +25917,7 @@ ${t}`);
25907
25917
  if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(e.toUpperCase()))
25908
25918
  return "Method not supported";
25909
25919
  if (s(`var client = new RestClient("${t}");`), s(`var request = new RestRequest(Method.${e.toUpperCase()});`), Object.keys(r).forEach((c) => {
25910
- s(`request.AddHeader("${c}", "${Ge(r[c])}");`);
25920
+ s(`request.AddHeader("${c}", "${Fe(r[c])}");`);
25911
25921
  }), i == null || i.forEach(({ name: c, value: u }) => {
25912
25922
  s(`request.AddCookie("${c}", "${u}");`);
25913
25923
  }), o != null && o.text) {
@@ -25941,7 +25951,7 @@ ${t}`);
25941
25951
  a && (s("package main"), o(), s("import ("), s('"fmt"', O), h > 0 && s('"time"', O), d && s('"crypto/tls"', O), n != null && n.text && s('"strings"', O), s('"net/http"', O), u && s('"io"', O), s(")"), o(), s("func main() {"), o()), d && (s("insecureTransport := http.DefaultTransport.(*http.Transport).Clone()", O), s("insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}", O));
25942
25952
  const v = h > 0, b = v || d, k = b ? "client" : "http.DefaultClient";
25943
25953
  return b && (s("client := http.Client{", O), v && s(`Timeout: time.Duration(${h} * time.Second),`, O + 1), d && s("Transport: insecureTransport,", O + 1), s("}", O), o()), s(`url := "${r}"`, O), o(), n != null && n.text ? (s(`payload := strings.NewReader(${JSON.stringify(n.text)})`, O), o(), s(`req, ${f} := http.NewRequest("${e}", url, payload)`, O), o()) : (s(`req, ${f} := http.NewRequest("${e}", url, nil)`, O), o()), m(), Object.keys(t).length && (Object.keys(t).forEach(($) => {
25944
- s(`req.Header.Add("${$}", "${Ge(t[$])}")`, O);
25954
+ s(`req.Header.Add("${$}", "${Fe(t[$])}")`, O);
25945
25955
  }), o()), s(`res, ${f} := ${k}.Do(req)`, O), m(), u && (o(), s("defer res.Body.Close()", O), s(`body, ${f} := io.ReadAll(res.Body)`, O), m()), o(), s("fmt.Println(res)", O), u && s("fmt.Println(string(body))", O), a && (o(), s("}")), l();
25946
25956
  }
25947
25957
  }, xk = {
@@ -26001,7 +26011,7 @@ ${t}`);
26001
26011
  ...i
26002
26012
  }, { blank: s, push: l, join: a } = new de({ indent: o.indent });
26003
26013
  return l("AsyncHttpClient client = new DefaultAsyncHttpClient();"), l(`client.prepare("${n.toUpperCase()}", "${r}")`), Object.keys(e).forEach((c) => {
26004
- l(`.setHeader("${c}", "${Ge(e[c])}")`, 1);
26014
+ l(`.setHeader("${c}", "${Fe(e[c])}")`, 1);
26005
26015
  }), t != null && t.text && l(`.setBody(${JSON.stringify(t.text)})`, 1), l(".execute()", 1), l(".toCompletableFuture()", 1), l(".thenAccept(System.out::println)", 1), l(".join();", 1), s(), l("client.close();"), a();
26006
26016
  }
26007
26017
  }, Pk = {
@@ -26017,7 +26027,7 @@ ${t}`);
26017
26027
  ...i
26018
26028
  }, { push: s, join: l } = new de({ indent: o.indent });
26019
26029
  return s("HttpRequest request = HttpRequest.newBuilder()"), s(`.uri(URI.create("${e}"))`, 2), Object.keys(n).forEach((a) => {
26020
- s(`.header("${a}", "${Ge(n[a])}")`, 2);
26030
+ s(`.header("${a}", "${Fe(n[a])}")`, 2);
26021
26031
  }), r != null && r.text ? s(`.method("${t.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(r.text)}))`, 2) : s(`.method("${t.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`, 2), s(".build();", 2), s("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"), s("System.out.println(response.body());"), l();
26022
26032
  }
26023
26033
  }, Tk = {
@@ -26033,7 +26043,7 @@ ${t}`);
26033
26043
  ...i
26034
26044
  }, { push: s, blank: l, join: a } = new de({ indent: o.indent }), c = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
26035
26045
  return s("OkHttpClient client = new OkHttpClient();"), l(), n != null && n.text && (n.boundary ? s(`MediaType mediaType = MediaType.parse("${n.mimeType}; boundary=${n.boundary}");`) : s(`MediaType mediaType = MediaType.parse("${n.mimeType}");`), s(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(n.text)});`)), s("Request request = new Request.Builder()"), s(`.url("${t}")`, 1), c.includes(e.toUpperCase()) ? u.includes(e.toUpperCase()) ? n != null && n.text ? s(`.${e.toLowerCase()}(body)`, 1) : s(`.${e.toLowerCase()}(null)`, 1) : s(`.${e.toLowerCase()}()`, 1) : n != null && n.text ? s(`.method("${e.toUpperCase()}", body)`, 1) : s(`.method("${e.toUpperCase()}", null)`, 1), Object.keys(r).forEach((h) => {
26036
- s(`.addHeader("${h}", "${Ge(r[h])}")`, 1);
26046
+ s(`.addHeader("${h}", "${Fe(r[h])}")`, 1);
26037
26047
  }), s(".build();", 1), l(), s("Response response = client.newCall(request).execute();"), a();
26038
26048
  }
26039
26049
  }, Ck = {
@@ -26049,7 +26059,7 @@ ${t}`);
26049
26059
  ...i
26050
26060
  }, { join: s, push: l } = new de({ indent: o.indent });
26051
26061
  return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(n.toUpperCase()) ? l(`HttpResponse<String> response = Unirest.${n.toLowerCase()}("${r}")`) : l(`HttpResponse<String> response = Unirest.customMethod("${n.toUpperCase()}","${r}")`), Object.keys(e).forEach((c) => {
26052
- l(`.header("${c}", "${Ge(e[c])}")`, 1);
26062
+ l(`.header("${c}", "${Fe(e[c])}")`, 1);
26053
26063
  }), t != null && t.text && l(`.body(${JSON.stringify(t.text)})`, 1), l(".asString();", 1), s();
26054
26064
  }
26055
26065
  }, Zk = {
@@ -26321,7 +26331,7 @@ const st = /* @__PURE__ */ w3(Uk), Ek = {
26321
26331
  ...i
26322
26332
  }, { blank: s, join: l, push: a } = new de({ indent: o.indent }), c = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
26323
26333
  return a("val client = OkHttpClient()"), s(), n != null && n.text && (n.boundary ? a(`val mediaType = MediaType.parse("${n.mimeType}; boundary=${n.boundary}")`) : a(`val mediaType = MediaType.parse("${n.mimeType}")`), a(`val body = RequestBody.create(mediaType, ${JSON.stringify(n.text)})`)), a("val request = Request.Builder()"), a(`.url("${e}")`, 1), c.includes(t.toUpperCase()) ? u.includes(t.toUpperCase()) ? n != null && n.text ? a(`.${t.toLowerCase()}(body)`, 1) : a(`.${t.toLowerCase()}(null)`, 1) : a(`.${t.toLowerCase()}()`, 1) : n != null && n.text ? a(`.method("${t.toUpperCase()}", body)`, 1) : a(`.method("${t.toUpperCase()}", null)`, 1), Object.keys(r).forEach((h) => {
26324
- a(`.addHeader("${h}", "${Ge(r[h])}")`, 1);
26334
+ a(`.addHeader("${h}", "${Fe(r[h])}")`, 1);
26325
26335
  }), a(".build()", 1), s(), a("val response = client.newCall(request).execute()"), l();
26326
26336
  }
26327
26337
  }, zk = {
@@ -26643,8 +26653,8 @@ const st = /* @__PURE__ */ w3(Uk), Ek = {
26643
26653
  }, s = ["get", "post", "head", "delete", "patch", "put", "options"], { push: l, blank: a, join: c } = new de({ indent: o.indent });
26644
26654
  l("open Cohttp_lwt_unix"), l("open Cohttp"), l("open Lwt"), a(), l(`let uri = Uri.of_string "${n}" in`);
26645
26655
  const u = Object.keys(e);
26646
- u.length === 1 ? l(`let headers = Header.add (Header.init ()) "${u[0]}" "${Ge(e[u[0]])}" in`) : u.length > 1 && (l("let headers = Header.add_list (Header.init ()) ["), u.forEach((O) => {
26647
- l(`("${O}", "${Ge(e[O])}");`, 1);
26656
+ u.length === 1 ? l(`let headers = Header.add (Header.init ()) "${u[0]}" "${Fe(e[u[0]])}" in`) : u.length > 1 && (l("let headers = Header.add_list (Header.init ()) ["), u.forEach((O) => {
26657
+ l(`("${O}", "${Fe(e[O])}");`, 1);
26648
26658
  }), l("] in")), t != null && t.text && l(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(t.text)} in`), a();
26649
26659
  const h = u.length ? "~headers " : "", d = t != null && t.text ? "~body " : "", f = s.includes(r.toLowerCase()) ? `\`${r.toUpperCase()}` : `(Code.method_of_string "${r}")`;
26650
26660
  return l(`Client.call ${h}${d}${f} uri`), l(">>= fun (res, body_stream) ->"), l("(* Do stuff with the result *)", 1), c();
@@ -26781,7 +26791,7 @@ ${c}` });
26781
26791
  });
26782
26792
  const P = o.map((A) => `${encodeURIComponent(A.name)}=${encodeURIComponent(A.value)}`);
26783
26793
  P.length && $.push(`CURLOPT_COOKIE => "${P.join("; ")}",`);
26784
- const R = Object.keys(s).sort().map((A) => `"${A}: ${Ge(s[A])}"`);
26794
+ const R = Object.keys(s).sort().map((A) => `"${A}: ${Fe(s[A])}"`);
26785
26795
  return R.length && ($.push("CURLOPT_HTTPHEADER => ["), $.push(R.join(`,
26786
26796
  ${c}${c}`), 1), $.push("],")), m($.join(), 1), m("]);"), v(), m("$response = curl_exec($curl);"), m("$err = curl_error($curl);"), v(), m("curl_close($curl);"), v(), m("if ($err) {"), m(h ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), m("} else {"), m("echo $response;", 1), m("}"), !d && a && (v(), m("?>")), b();
26787
26797
  }
@@ -26971,12 +26981,12 @@ ${c}${c}`), 1), $.push("],")), m($.join(), 1), m("]);"), v(), m("$response = cur
26971
26981
  const d = i, f = Object.keys(d).length;
26972
26982
  if (f === 1)
26973
26983
  for (const O in d)
26974
- a(`headers = { '${O}': "${Ge(d[O])}" }`), c();
26984
+ a(`headers = { '${O}': "${Fe(d[O])}" }`), c();
26975
26985
  else if (f > 1) {
26976
26986
  let O = 1;
26977
26987
  a("headers = {");
26978
26988
  for (const m in d)
26979
- O++ !== f ? a(` '${m}': "${Ge(d[m])}",`) : a(` '${m}': "${Ge(d[m])}"`);
26989
+ O++ !== f ? a(` '${m}': "${Fe(d[m])}",`) : a(` '${m}': "${Fe(d[m])}"`);
26980
26990
  a("}"), c();
26981
26991
  }
26982
26992
  return a(h && f ? `conn.request("${o}", "${n}", payload, headers)` : h && !f ? `conn.request("${o}", "${n}", payload)` : !h && f ? `conn.request("${o}", "${n}", headers=headers)` : `conn.request("${o}", "${n}")`), c(), a("res = conn.getresponse()"), a("data = res.read()"), c(), a('print(data.decode("utf-8"))'), u();
@@ -27065,12 +27075,12 @@ const Rr = (n, e, t) => {
27065
27075
  a();
27066
27076
  else if (b === 1)
27067
27077
  for (const $ in h)
27068
- l(`headers = {"${$}": "${Ge(h[$])}"}`), a();
27078
+ l(`headers = {"${$}": "${Fe(h[$])}"}`), a();
27069
27079
  else if (b > 1) {
27070
27080
  let $ = 1;
27071
27081
  l("headers = {");
27072
27082
  for (const P in h)
27073
- l($ !== b ? `"${P}": "${Ge(h[P])}",` : `"${P}": "${Ge(h[P])}"`, 1), $ += 1;
27083
+ l($ !== b ? `"${P}": "${Fe(h[P])}",` : `"${P}": "${Fe(h[P])}"`, 1), $ += 1;
27074
27084
  l("}"), a();
27075
27085
  }
27076
27086
  let k = ux.includes(i) ? `response = requests.${i.toLowerCase()}(url` : `response = requests.request("${i}", url`;
@@ -27127,7 +27137,7 @@ const Rr = (n, e, t) => {
27127
27137
  c('encode <- "raw"'), u();
27128
27138
  break;
27129
27139
  }
27130
- const v = Vt(i, "cookie"), b = Vt(i, "accept"), k = v ? `set_cookies(\`${String(v).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, $ = b ? `accept("${Ge(b)}")` : void 0, P = `content_type("${Ge((a = r == null ? void 0 : r.mimeType) !== null && a !== void 0 ? a : "application/octet-stream")}")`, R = Object.entries(i).filter(([ee]) => !["cookie", "accept", "content-type"].includes(ee.toLowerCase())).map(([ee, j]) => `'${ee}' = '${Ni(j)}'`).join(", "), A = R ? `add_headers(${R})` : void 0;
27140
+ const v = Vt(i, "cookie"), b = Vt(i, "accept"), k = v ? `set_cookies(\`${String(v).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, $ = b ? `accept("${Fe(b)}")` : void 0, P = `content_type("${Fe((a = r == null ? void 0 : r.mimeType) !== null && a !== void 0 ? a : "application/octet-stream")}")`, R = Object.entries(i).filter(([ee]) => !["cookie", "accept", "content-type"].includes(ee.toLowerCase())).map(([ee, j]) => `'${ee}' = '${Ni(j)}'`).join(", "), A = R ? `add_headers(${R})` : void 0;
27131
27141
  let V = `response <- VERB("${o}", url`;
27132
27142
  m && (V += ", body = payload"), t.length && (V += ", query = queryString");
27133
27143
  const re = [A, P, $, k].filter((ee) => !!ee).join(", ");
@@ -29281,7 +29291,7 @@ const bR = ["innerHTML"], yR = /* @__PURE__ */ W({
29281
29291
  },
29282
29292
  setup(n) {
29283
29293
  const e = n, t = L("");
29284
- return De(
29294
+ return Ge(
29285
29295
  () => e.value,
29286
29296
  () => {
29287
29297
  var r;
@@ -30430,7 +30440,7 @@ const WM = { class: "request-path" }, LM = { class: "language-select" }, zM = ["
30430
30440
  }
30431
30441
  Se(async () => {
30432
30442
  const v = await h();
30433
- t.value = v, De(
30443
+ t.value = v, Ge(
30434
30444
  () => s.preferredLanguage,
30435
30445
  async () => {
30436
30446
  const b = await h();
@@ -31365,8 +31375,8 @@ function pU(n, e, t, {
31365
31375
  let j = Math.max(1, d - ee + 1), B = s ? h : Math.min(d + ee, h) + u, N = Array(B + 2);
31366
31376
  N[B + 1] = (1 << V) - 1;
31367
31377
  for (let oe = B; oe >= j; oe -= 1) {
31368
- let $e = oe - 1, Fe = t[n.charAt($e)];
31369
- if (m && (v[$e] = +!!Fe), N[oe] = (N[oe + 1] << 1 | 1) & Fe, V && (N[oe] |= (k[oe + 1] | k[oe]) << 1 | 1 | k[oe + 1]), N[oe] & R && ($ = Ao(e, {
31378
+ let $e = oe - 1, De = t[n.charAt($e)];
31379
+ if (m && (v[$e] = +!!De), N[oe] = (N[oe + 1] << 1 | 1) & De, V && (N[oe] |= (k[oe + 1] | k[oe]) << 1 | 1 | k[oe + 1]), N[oe] & R && ($ = Ao(e, {
31370
31380
  errors: V,
31371
31381
  currentLocation: $e,
31372
31382
  expectedLocation: d,
@@ -32138,12 +32148,12 @@ const VU = /* @__PURE__ */ ce(jU, [["__scopeId", "data-v-3f4ab567"]]), YU = { ke
32138
32148
  }), { state: u, setItem: h, setCollapsedSidebarItem: d } = Qn(), f = () => {
32139
32149
  s.value = 0, o.value = c.search(l.value);
32140
32150
  };
32141
- De(
32151
+ Ge(
32142
32152
  () => u.showSearch,
32143
32153
  () => {
32144
32154
  u.showSearch ? (l.value = "", s.value = 0, o.value = [], r.show()) : r.hide();
32145
32155
  }
32146
- ), De(
32156
+ ), Ge(
32147
32157
  () => r.open,
32148
32158
  () => {
32149
32159
  r.open || h("showSearch", !1);
@@ -32157,7 +32167,7 @@ const VU = /* @__PURE__ */ ce(jU, [["__scopeId", "data-v-3f4ab567"]]), YU = { ke
32157
32167
  const $ = k ? `endpoint/${k}` : `tag/${b}`, P = document.getElementById($);
32158
32168
  P == null || P.scrollIntoView();
32159
32169
  }
32160
- De(t.value, () => {
32170
+ Ge(t.value, () => {
32161
32171
  if (i = [], !e.spec.tags.length) {
32162
32172
  c.setCollection([]);
32163
32173
  return;
@@ -32274,7 +32284,7 @@ const NU = /* @__PURE__ */ ce(HU, [["__scopeId", "data-v-44a5ef51"]]), GU = {
32274
32284
  const e = n, t = v2(
32275
32285
  () => import("@scalar/swagger-editor").then((b) => b.SwaggerEditor)
32276
32286
  ), r = L(e.spec ?? "");
32277
- De(
32287
+ Ge(
32278
32288
  () => e.spec,
32279
32289
  () => {
32280
32290
  e.spec && (r.value = e.spec);
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "documentation",
12
12
  "component"
13
13
  ],
14
- "version": "0.5.3",
14
+ "version": "0.5.4",
15
15
  "author": "Scalar (https://github.com/scalar)",
16
16
  "homepage": "https://github.com/scalar/scalar",
17
17
  "repository": {
@@ -57,12 +57,12 @@
57
57
  "typographic-base": "1.0.4",
58
58
  "unified": "10.1.2",
59
59
  "xmldom": "0.6.0",
60
- "@scalar/api-client": "0.5.2",
60
+ "@scalar/api-client": "0.5.3",
61
61
  "@scalar/default-theme": "0.2.1",
62
- "@scalar/swagger-editor": "0.5.3",
62
+ "@scalar/swagger-editor": "0.5.4",
63
63
  "@scalar/swagger-parser": "0.4.3",
64
64
  "@scalar/use-clipboard": "0.4.2",
65
- "@scalar/use-codemirror": "0.5.1",
65
+ "@scalar/use-codemirror": "0.5.2",
66
66
  "@scalar/use-keyboard-event": "0.4.2",
67
67
  "@scalar/use-toasts": "0.4.1",
68
68
  "@scalar/use-tooltip": "0.4.2"