@scalar/api-reference 1.25.62 → 1.25.64

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,40 +1,40 @@
1
- import { defineComponent as f, ref as v, onMounted as p, watch as l, onBeforeUnmount as m, openBlock as d, createElementBlock as S } from "vue";
2
- import { useApiClient as _ } from "./useApiClient.js";
3
- import { useServerStore as g } from "../../legacy/stores/useServerStore.js";
1
+ import { defineComponent as s, ref as p, onMounted as v, watch as u, onBeforeUnmount as m, openBlock as d, createElementBlock as S } from "vue";
2
+ import { useApiClient as g } from "./useApiClient.js";
3
+ import { useServerStore as _ } from "../../legacy/stores/useServerStore.js";
4
4
  import { getUrlFromServerState as x } from "../../legacy/helpers/getUrlFromServerState.js";
5
- const h = /* @__PURE__ */ f({
5
+ const h = /* @__PURE__ */ s({
6
6
  __name: "ApiClientModal",
7
7
  props: {
8
8
  configuration: {}
9
9
  },
10
10
  setup(i) {
11
- const n = v(null), { server: o, setServer: a } = g(), { client: t, init: c } = _();
12
- return p(async () => {
13
- if (!n.value) return;
11
+ const t = p(null), { server: o, setServer: a } = _(), { client: n, init: c } = g();
12
+ return v(async () => {
13
+ if (!t.value) return;
14
14
  (await c({
15
- el: n.value,
15
+ el: t.value,
16
16
  configuration: i.configuration
17
17
  })).onUpdateServer((r) => {
18
18
  if (!o.servers) return;
19
- const u = o.servers.findIndex((s) => s.url === r);
20
- u >= 0 && a({ selectedServer: u });
19
+ const l = o.servers.findIndex((f) => f.url === r);
20
+ l >= 0 && a({ selectedServer: l });
21
21
  });
22
- }), l(o, (e) => {
23
- const r = x(e);
24
- r && t.value && t.value.updateServer(r);
25
- }), l(
22
+ }), u(o, (e) => {
23
+ const { originalUrl: r } = x(e);
24
+ r && n.value && n.value.updateServer(r);
25
+ }), u(
26
26
  () => i.configuration,
27
27
  (e) => {
28
28
  var r;
29
- return e && ((r = t.value) == null ? void 0 : r.updateConfig(e));
29
+ return e && ((r = n.value) == null ? void 0 : r.updateConfig(e));
30
30
  },
31
31
  { deep: !0 }
32
32
  ), m(() => {
33
33
  var e;
34
- return (e = t.value) == null ? void 0 : e.app.unmount();
34
+ return (e = n.value) == null ? void 0 : e.app.unmount();
35
35
  }), (e, r) => (d(), S("div", {
36
36
  ref_key: "el",
37
- ref: n
37
+ ref: t
38
38
  }, null, 512));
39
39
  }
40
40
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ServerVariablesSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesSelect.vue"],"names":[],"mappings":"AAkFA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;;;;;;AAyGF,wBAQG"}
1
+ {"version":3,"file":"ServerVariablesSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/features/BaseUrl/ServerVariablesSelect.vue"],"names":[],"mappings":"AAsFA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;;;;;;AA4GF,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import e from "./ServerVariablesSelect.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ r(e, [["__scopeId", "data-v-59e1c2f1"]]);
4
+ const f = /* @__PURE__ */ r(e, [["__scopeId", "data-v-7e5c5f9f"]]);
5
5
  export {
6
- c as default
6
+ f as default
7
7
  };
@@ -1,6 +1,9 @@
1
- import { defineComponent as f, computed as r, openBlock as v, createBlock as S, unref as l, withCtx as s, createVNode as i, createElementVNode as u, createTextVNode as V, toDisplayString as g } from "vue";
2
- import { ScalarListbox as b, ScalarButton as h, ScalarIcon as x } from "@scalar/components";
3
- const N = /* @__PURE__ */ f({
1
+ import { defineComponent as v, computed as s, openBlock as r, createBlock as f, unref as a, withCtx as c, createVNode as i, createElementVNode as S, normalizeClass as V, createElementBlock as h, createCommentVNode as g, createTextVNode as C, toDisplayString as b } from "vue";
2
+ import { ScalarListbox as k, ScalarButton as B, ScalarIcon as N } from "@scalar/components";
3
+ const _ = {
4
+ key: 0,
5
+ class: "sr-only"
6
+ }, w = /* @__PURE__ */ v({
4
7
  __name: "ServerVariablesSelect",
5
8
  props: {
6
9
  enum: {},
@@ -8,32 +11,34 @@ const N = /* @__PURE__ */ f({
8
11
  controls: {}
9
12
  },
10
13
  emits: ["change"],
11
- setup(c, { emit: d }) {
12
- const o = c, m = d, a = r(
13
- () => o.enum.map((e) => ({ id: e, label: e }))
14
- ), n = r({
15
- get: () => a.value.find((e) => e.id === o.value),
14
+ setup(u, { emit: d }) {
15
+ const t = u, m = d, l = s(
16
+ () => t.enum.map((e) => ({ id: e, label: e }))
17
+ ), o = s({
18
+ get: () => l.value.find((e) => e.id === t.value),
16
19
  set: (e) => m("change", (e == null ? void 0 : e.id) ?? "")
17
20
  });
18
- return (e, t) => (v(), S(l(b), {
19
- modelValue: n.value,
20
- "onUpdate:modelValue": t[0] || (t[0] = (p) => n.value = p),
21
+ return (e, n) => (r(), f(a(k), {
22
+ modelValue: o.value,
23
+ "onUpdate:modelValue": n[0] || (n[0] = (p) => o.value = p),
21
24
  fullWidth: "",
22
- options: a.value
25
+ options: l.value
23
26
  }, {
24
- default: s(() => [
25
- i(l(h), {
27
+ default: c(() => [
28
+ i(a(B), {
26
29
  "aria-controls": e.controls,
27
30
  class: "variable-select",
28
31
  fullWidth: "",
29
32
  variant: "ghost"
30
33
  }, {
31
- default: s(() => [
32
- u("span", null, [
33
- t[1] || (t[1] = u("span", { class: "sr-only" }, "Selected:", -1)),
34
- V(" " + g(e.value), 1)
35
- ]),
36
- i(l(x), {
34
+ default: c(() => [
35
+ S("span", {
36
+ class: V({ "text-c-1": e.value })
37
+ }, [
38
+ e.value ? (r(), h("span", _, "Selected:")) : g("", !0),
39
+ C(" " + b(e.value || "Select value"), 1)
40
+ ], 2),
41
+ i(a(N), {
37
42
  icon: "ChevronDown",
38
43
  size: "xs"
39
44
  })
@@ -46,5 +51,5 @@ const N = /* @__PURE__ */ f({
46
51
  }
47
52
  });
48
53
  export {
49
- N as default
54
+ w as default
50
55
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ExampleRequest.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-cd795a2e"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a5c927ad"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -36,9 +36,9 @@ const ve = ["id"], he = ["id"], ge = {
36
36
  httpClient: u,
37
37
  setHttpClient: w,
38
38
  availableTargets: b,
39
- httpTargetTitle: A,
40
- httpClientTitle: J
41
- } = ce(), { server: U } = pe(), { authentication: q } = de(), v = D(), m = d(() => {
39
+ httpTargetTitle: U,
40
+ httpClientTitle: A
41
+ } = ce(), { server: J } = pe(), { authentication: q } = de(), v = D(), m = d(() => {
42
42
  var t;
43
43
  const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
44
44
  for (const o of e)
@@ -78,7 +78,7 @@ const ve = ["id"], he = ["id"], ge = {
78
78
  return ((n = m.value[s.value.clientKey]) == null ? void 0 : n.source) ?? "";
79
79
  const e = fe(
80
80
  {
81
- url: ye(U)
81
+ url: ye(J).modifiedUrl
82
82
  },
83
83
  te(
84
84
  i.operation,
@@ -173,7 +173,7 @@ const ve = ["id"], he = ["id"], ge = {
173
173
  ])),
174
174
  _: 1
175
175
  }),
176
- f(" " + S(a(A)) + " " + S(a(J)), 1)
176
+ f(" " + S(a(U)) + " " + S(a(A)), 1)
177
177
  ], 64))
178
178
  ]),
179
179
  _: 1
@@ -1 +1 @@
1
- {"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EACL,KAAK,QAAQ,EAId,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBAoByB,IAAI;sBALL,IAAI;;;;EAyK5B"}
1
+ {"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EACL,KAAK,QAAQ,EAId,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBAoByB,IAAI;sBALL,IAAI;;;;EAoK5B"}
@@ -1,65 +1,64 @@
1
- import V from "fuse.js";
2
- import { ref as c, computed as A, watch as B } from "vue";
3
- import { extractRequestBody as P } from "../../helpers/specHelpers.js";
4
- import { useSidebar as z } from "../../hooks/useSidebar.js";
5
- import { useOperation as G } from "../../hooks/useOperation.js";
6
- import { useNavState as J } from "../../hooks/useNavState.js";
7
- import { getHeadingsFromMarkdown as K } from "../../helpers/getHeadingsFromMarkdown.js";
8
- import { getModels as Q } from "../../helpers/getModels.js";
9
- function ae({
1
+ import H from "fuse.js";
2
+ import { ref as c, computed as N, watch as V } from "vue";
3
+ import { extractRequestBody as A } from "../../helpers/specHelpers.js";
4
+ import { useSidebar as B } from "../../hooks/useSidebar.js";
5
+ import { useOperation as P } from "../../hooks/useOperation.js";
6
+ import { useNavState as z } from "../../hooks/useNavState.js";
7
+ import { getHeadingsFromMarkdown as G } from "../../helpers/getHeadingsFromMarkdown.js";
8
+ import { getModels as J } from "../../helpers/getModels.js";
9
+ function te({
10
10
  specification: a
11
11
  }) {
12
- const { getHeadingId: R, getWebhookId: T, getModelId: j, getOperationId: L, getTagId: W } = J(), { hideModels: q } = z(), o = c([]), u = c([]), h = c(0), s = c(""), d = new V(o.value, {
12
+ const { getHeadingId: O, getWebhookId: R, getModelId: T, getOperationId: j, getTagId: L } = z(), { hideModels: W } = B(), o = c([]), n = c([]), h = c(0), s = c(""), d = new H(o.value, {
13
13
  keys: ["title", "description", "body"]
14
- }), C = () => {
15
- h.value = 0, u.value = d.search(s.value);
14
+ }), q = () => {
15
+ h.value = 0, n.value = d.search(s.value);
16
16
  };
17
- function F() {
18
- s.value = "", h.value = 0, u.value = [];
17
+ function C() {
18
+ s.value = "", h.value = 0, n.value = [];
19
19
  }
20
- const H = A(
20
+ const F = N(
21
21
  () => s.value.length === 0 ? o.value.slice(0, 25).map((r) => ({
22
22
  item: r
23
- })) : u.value.slice(0, 25)
23
+ })) : n.value.slice(0, 25)
24
24
  );
25
- return B(
25
+ return V(
26
26
  a.value,
27
27
  async () => {
28
- var y, g, I, w, M, k, $, D, x;
29
- const f = performance.now();
30
- if (o.value = [], !((g = (y = a.value) == null ? void 0 : y.tags) != null && g.length) && !((w = (I = a.value) == null ? void 0 : I.webhooks) != null && w.length)) {
28
+ var b, y, g, I, k, M, w, D, $;
29
+ if (o.value = [], !((y = (b = a.value) == null ? void 0 : b.tags) != null && y.length) && !((I = (g = a.value) == null ? void 0 : g.webhooks) != null && I.length)) {
31
30
  d.setCollection([]);
32
31
  return;
33
32
  }
34
- const r = [], v = K(
35
- ((k = (M = a.value) == null ? void 0 : M.info) == null ? void 0 : k.description) ?? ""
33
+ const i = [], r = G(
34
+ ((M = (k = a.value) == null ? void 0 : k.info) == null ? void 0 : M.description) ?? ""
36
35
  );
37
- v.length && (v.forEach((e) => {
38
- r.push({
36
+ r.length && (r.forEach((e) => {
37
+ i.push({
39
38
  type: "heading",
40
39
  title: `Info > ${e.value}`,
41
40
  description: "",
42
- href: `#${R(e)}`,
41
+ href: `#${O(e)}`,
43
42
  tag: e.slug,
44
43
  body: ""
45
44
  });
46
- }), o.value = o.value.concat(r)), (D = ($ = a.value) == null ? void 0 : $.tags) == null || D.forEach((e) => {
45
+ }), o.value = o.value.concat(i)), (D = (w = a.value) == null ? void 0 : w.tags) == null || D.forEach((e) => {
47
46
  const E = {
48
47
  title: e["x-displayName"] ?? e.name,
49
- href: `#${W(e)}`,
48
+ href: `#${L(e)}`,
50
49
  description: e.description,
51
50
  type: "tag",
52
51
  tag: e.name,
53
52
  body: ""
54
53
  };
55
54
  o.value.push(E), e.operations && e.operations.forEach((t) => {
56
- const { parameterMap: n } = G({ operation: t }), S = P(t) || n.value;
57
- let p = null;
58
- typeof S != "boolean" && (p = S);
59
- const O = {
55
+ const { parameterMap: u } = P({ operation: t }), S = A(t) || u.value;
56
+ let v = null;
57
+ typeof S != "boolean" && (v = S);
58
+ const x = {
60
59
  type: "req",
61
60
  title: t.name ?? t.path,
62
- href: `#${L(t, e)}`,
61
+ href: `#${j(t, e)}`,
63
62
  operationId: t.operationId,
64
63
  description: t.description ?? "",
65
64
  httpVerb: t.httpVerb,
@@ -67,49 +66,47 @@ function ae({
67
66
  tag: e.name,
68
67
  operation: t
69
68
  };
70
- p && (O.body = p), o.value.push(O);
69
+ v && (x.body = v), o.value.push(x);
71
70
  });
72
71
  });
73
- const l = (x = a.value) == null ? void 0 : x.webhooks, m = [];
72
+ const l = ($ = a.value) == null ? void 0 : $.webhooks, f = [];
74
73
  l && Object.keys(l).forEach((e) => {
75
74
  Object.keys(
76
75
  l[e]
77
76
  ).forEach((t) => {
78
- var n;
79
- m.push({
77
+ var u;
78
+ f.push({
80
79
  type: "webhook",
81
- title: `Webhook: ${(n = l[e][t]) == null ? void 0 : n.name}`,
82
- href: `#${T(e, t)}`,
80
+ title: `Webhook: ${(u = l[e][t]) == null ? void 0 : u.name}`,
81
+ href: `#${R(e, t)}`,
83
82
  description: e,
84
83
  httpVerb: t,
85
84
  tag: e,
86
85
  body: ""
87
86
  });
88
- }), o.value = o.value.concat(m);
87
+ }), o.value = o.value.concat(f);
89
88
  });
90
- const i = q.value ? {} : Q(a.value), b = [];
91
- i && (Object.keys(i).forEach((e) => {
92
- b.push({
89
+ const p = W.value ? {} : J(a.value), m = [];
90
+ p && (Object.keys(p).forEach((e) => {
91
+ m.push({
93
92
  type: "model",
94
93
  title: "Model",
95
- href: `#${j(e)}`,
96
- description: i[e].title ?? e,
94
+ href: `#${T(e)}`,
95
+ description: p[e].title ?? e,
97
96
  tag: e,
98
97
  body: ""
99
98
  });
100
- }), o.value = o.value.concat(b)), d.setCollection(o.value);
101
- const N = performance.now();
102
- console.log(`create-search-index: ${Math.round(N - f)} ms`);
99
+ }), o.value = o.value.concat(m)), d.setCollection(o.value);
103
100
  },
104
101
  { immediate: !0 }
105
102
  ), {
106
- resetSearch: F,
107
- fuseSearch: C,
103
+ resetSearch: C,
104
+ fuseSearch: q,
108
105
  selectedSearchResult: h,
109
- searchResultsWithPlaceholderResults: H,
106
+ searchResultsWithPlaceholderResults: F,
110
107
  searchText: s
111
108
  };
112
109
  }
113
110
  export {
114
- ae as useSearchIndex
111
+ te as useSearchIndex
115
112
  };
@@ -1,41 +1,41 @@
1
- import { getRequestFromOperation as n, getParametersFromOperation as d } from "@scalar/oas-utils/spec-getters";
2
- import { getHarRequest as f } from "./getHarRequest.js";
1
+ import { getRequestFromOperation as a, getParametersFromOperation as p } from "@scalar/oas-utils/spec-getters";
2
+ import { getHarRequest as q } from "./getHarRequest.js";
3
3
  import { getRequestFromAuthentication as c } from "../legacy/helpers/getRequestFromAuthentication.js";
4
- import { getUrlFromServerState as s } from "../legacy/helpers/getUrlFromServerState.js";
4
+ import { getUrlFromServerState as n } from "../legacy/helpers/getUrlFromServerState.js";
5
5
  function O({
6
6
  serverState: t,
7
7
  authenticationState: o,
8
8
  operation: e,
9
- globalSecurity: l
9
+ globalSecurity: d
10
10
  }) {
11
- var u, a;
12
- const r = f(
11
+ var m, u;
12
+ const r = q(
13
13
  {
14
- url: s(t)
14
+ url: n(t).modifiedUrl
15
15
  },
16
- n(e, { requiredOnly: !1 }),
16
+ a(e, { requiredOnly: !1 }),
17
17
  // Only generate authentication parameters if an authentication state is passed.
18
18
  o ? c(
19
19
  o,
20
- ((u = e.information) == null ? void 0 : u.security) ?? l ?? []
20
+ ((m = e.information) == null ? void 0 : m.security) ?? d ?? []
21
21
  ) : {}
22
- ), p = n(e, {
22
+ ), l = a(e, {
23
23
  requiredOnly: !1
24
- }), q = d(e, "path", !1);
24
+ }), f = p(e, "path", !1);
25
25
  return {
26
26
  id: e.operationId,
27
27
  name: e.name,
28
28
  type: r.method,
29
- path: p.path ?? "",
30
- variables: q,
31
- cookies: i(r.cookies),
32
- query: r.queryString.map((m) => ({ ...m, enabled: m.required ?? !0 })),
33
- headers: i(r.headers),
34
- url: s(t) ?? "",
35
- body: (a = r.postData) == null ? void 0 : a.text
29
+ path: l.path ?? "",
30
+ variables: f,
31
+ cookies: s(r.cookies),
32
+ query: r.queryString.map((i) => ({ ...i, enabled: i.required ?? !0 })),
33
+ headers: s(r.headers),
34
+ url: n(t).modifiedUrl ?? "",
35
+ body: (u = r.postData) == null ? void 0 : u.text
36
36
  };
37
37
  }
38
- function i(t) {
38
+ function s(t) {
39
39
  return (t ?? []).map((o) => ({ ...o, enabled: !0 }));
40
40
  }
41
41
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,QAAQ,IAAI,uBAAuB,EACxC,KAAK,QAAQ,IAAI,uBAAuB,EACzC,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AACjE,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AAEjE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,mBAoCjB"}
1
+ {"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,QAAQ,IAAI,uBAAuB,EACxC,KAAK,QAAQ,IAAI,uBAAuB,EACzC,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AACjE,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AAEjE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,mBAyCjB"}
@@ -1,30 +1,32 @@
1
- import { snippetz as i } from "@scalar/snippetz";
1
+ import { snippetz as r } from "@scalar/snippetz";
2
2
  import { HTTPSnippet as s } from "httpsnippet-lite";
3
- async function m(n, e, t) {
4
- const r = e;
5
- if (i().hasPlugin(r, t))
6
- return i().print(
7
- e,
3
+ async function f(e, t, p) {
4
+ const o = t;
5
+ if (r().hasPlugin(o, p))
6
+ return r().print(
8
7
  t,
9
- n
8
+ p,
9
+ e
10
10
  );
11
+ if (e.url.startsWith("__"))
12
+ return e.url;
11
13
  try {
12
- const p = e == null ? void 0 : e.replace(
14
+ const n = t == null ? void 0 : t.replace(
13
15
  "js",
14
16
  "javascript"
15
- ), c = t, o = await new s(n).convert(
16
- p,
17
+ ), c = p, i = await new s(e).convert(
18
+ n,
17
19
  c
18
20
  );
19
- if (typeof o == "string") return o;
20
- } catch (p) {
21
+ if (typeof i == "string") return i;
22
+ } catch (n) {
21
23
  console.error(
22
24
  "[getExampleCode] Failed to generate example code with httpsnippet-lite:",
23
- p
25
+ n
24
26
  );
25
27
  }
26
28
  return "";
27
29
  }
28
30
  export {
29
- m as getExampleCode
31
+ f as getExampleCode
30
32
  };