@scalar/api-reference 1.28.20 → 1.28.22

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 (29) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/browser/standalone.js +5526 -5537
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +3 -3
  6. package/dist/components/ApiReferenceLayout.vue2.js +17 -16
  7. package/dist/components/DocumentSelector/DocumentSelector.vue.js +2 -2
  8. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  9. package/dist/features/ApiClientModal/ApiClientModal.vue.js +27 -22
  10. package/dist/features/ApiClientModal/useApiClient.d.ts +18 -12
  11. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  12. package/dist/helpers/parse.d.ts +1 -2
  13. package/dist/helpers/parse.d.ts.map +1 -1
  14. package/dist/helpers/parse.js +54 -59
  15. package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
  16. package/dist/hooks/useMultipleDocuments.js +29 -27
  17. package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
  18. package/dist/hooks/useReactiveSpec.js +25 -27
  19. package/dist/index.js +1 -1
  20. package/dist/style.css +1 -1
  21. package/package.json +9 -9
  22. package/dist/browser/examples/openapi-3.1/openapi.yaml +0 -18
  23. package/dist/browser/examples/openapi-3.1/pathItems.yaml +0 -12
  24. package/dist/browser/examples/swagger-2.0/openapi.yaml +0 -17
  25. package/dist/browser/examples/swagger-2.0/pathItems.yaml +0 -6
  26. package/dist/examples/openapi-3.1/openapi.yaml +0 -18
  27. package/dist/examples/openapi-3.1/pathItems.yaml +0 -12
  28. package/dist/examples/swagger-2.0/openapi.yaml +0 -17
  29. package/dist/examples/swagger-2.0/pathItems.yaml +0 -6
@@ -1,68 +1,63 @@
1
- import { redirectToProxy as A, shouldIgnoreEntity as u } from "@scalar/oas-utils/helpers";
2
- import { load as M, dereference as R } from "@scalar/openapi-parser";
3
- import { fetchUrls as q } from "@scalar/openapi-parser/plugins/fetch-urls";
1
+ import { redirectToProxy as R, shouldIgnoreEntity as u } from "@scalar/oas-utils/helpers";
2
+ import { load as M, dereference as q } from "@scalar/openapi-parser";
3
+ import { fetchUrls as D } from "@scalar/openapi-parser/plugins/fetch-urls";
4
4
  import { createEmptySpecification as O } from "./createEmptySpecification.js";
5
- import { normalizeRequestMethod as $ } from "../legacy/helpers/normalizeRequestMethod.js";
6
- import { validRequestMethods as D } from "../legacy/fixtures/httpRequestMethods.js";
5
+ import { normalizeRequestMethod as j } from "../legacy/helpers/normalizeRequestMethod.js";
6
+ import { validRequestMethods as C } from "../legacy/fixtures/httpRequestMethods.js";
7
7
  const G = (m, {
8
- proxyUrl: e,
9
- source: h
10
- } = {}) => new Promise(async (l, g) => {
11
- var y;
8
+ proxyUrl: e
9
+ } = {}) => new Promise(async (n, b) => {
10
+ var h;
12
11
  try {
13
12
  if (!m)
14
- return l(x(O()));
15
- const s = performance.now(), { filesystem: c } = await M(m, {
16
- source: h,
13
+ return n(I(O()));
14
+ const f = performance.now(), { filesystem: s } = await M(m, {
17
15
  plugins: [
18
- q({
19
- fetch: async (a) => {
20
- const n = await fetch(e ? A(e, a) : a);
21
- return n.ok ? console.info(`fetch($ref): ${a} (${Math.round((await n.clone().text()).length / 1024)} kB)`) : console.error(`fetch($ref): ${a} (${n.status} ${n.statusText})`), n;
22
- }
16
+ D({
17
+ fetch: (o) => fetch(e ? R(e, o) : o)
23
18
  })
24
19
  ]
25
- }), { schema: o, errors: t } = await R(c), r = performance.now();
26
- return console.info(`dereference: ${Math.round(r - s)} ms`), t != null && t.length && console.warn(
20
+ }), { schema: a, errors: r } = await q(s), t = performance.now();
21
+ return console.log(`dereference: ${Math.round(t - f)} ms`), r != null && r.length && console.warn(
27
22
  `Please open an issue on https://github.com/scalar/scalar
28
23
  `,
29
24
  `Scalar OpenAPI Parser Warning:
30
25
  `,
31
- t
32
- ), o === void 0 ? (g(((y = t == null ? void 0 : t[0]) == null ? void 0 : y.message) ?? "Failed to parse the OpenAPI file."), l(x(O()))) : l(x(o));
33
- } catch (s) {
34
- console.error("[@scalar/api-reference]", "Failed to parse the OpenAPI document. It might be invalid?"), console.error(s), g(s);
26
+ r
27
+ ), a === void 0 ? (b(((h = r == null ? void 0 : r[0]) == null ? void 0 : h.message) ?? "Failed to parse the OpenAPI file."), n(I(O()))) : n(I(a));
28
+ } catch (f) {
29
+ console.error("[@scalar/api-reference]", "Failed to parse the OpenAPI document. It might be invalid?"), console.error(f), b(f);
35
30
  }
36
- return l(x(O()));
37
- }), x = (m) => {
38
- var g, y;
31
+ return n(I(O()));
32
+ }), I = (m) => {
33
+ var h, f;
39
34
  let e = {};
40
35
  m && typeof m == "object" ? e = structuredClone(m) : e = O(), e.tags || (e.tags = []), e.paths || (e.paths = {}), e.components || (e.components = {}), e.webhooks || (e.webhooks = {}), e.servers || (e.servers = []), e.security || (e.security = []), e.externalDocs || (e.externalDocs = {});
41
- const h = {};
36
+ const n = {};
42
37
  return Object.keys(e.webhooks ?? {}).forEach((s) => {
43
- var c;
44
- Object.keys(((c = e.webhooks) == null ? void 0 : c[s]) ?? {}).forEach((o) => {
45
- var r, a, n, w;
46
- const t = (r = e.webhooks) == null ? void 0 : r[s][o];
38
+ var a;
39
+ Object.keys(((a = e.webhooks) == null ? void 0 : a[s]) ?? {}).forEach((r) => {
40
+ var o, l, g, y;
41
+ const t = (o = e.webhooks) == null ? void 0 : o[s][r];
47
42
  if (!(!t || u(t))) {
48
43
  if (Array.isArray(t.tags)) {
49
- const i = (a = t.tags) == null ? void 0 : a.map(
50
- (f) => {
51
- var I;
52
- return (I = e.tags) == null ? void 0 : I.find((p) => p.name === f);
44
+ const i = (l = t.tags) == null ? void 0 : l.map(
45
+ (c) => {
46
+ var w;
47
+ return (w = e.tags) == null ? void 0 : w.find((p) => p.name === c);
53
48
  }
54
49
  );
55
- if (t.tags = i == null ? void 0 : i.filter((f) => !u(f)), i != null && i.some((f) => u(f)))
50
+ if (t.tags = i == null ? void 0 : i.filter((c) => !u(c)), i != null && i.some((c) => u(c)))
56
51
  return;
57
52
  }
58
- h[s] === void 0 && (h[s] = {}), h[s][o] = {
53
+ n[s] === void 0 && (n[s] = {}), n[s][r] = {
59
54
  // Transformed data
60
- httpVerb: $(o),
55
+ httpVerb: j(r),
61
56
  path: s,
62
57
  operationId: (t == null ? void 0 : t.operationId) || s,
63
58
  name: (t == null ? void 0 : t.summary) || s || "",
64
59
  description: (t == null ? void 0 : t.description) || "",
65
- pathParameters: (w = (n = e.paths) == null ? void 0 : n[s]) == null ? void 0 : w.parameters,
60
+ pathParameters: (y = (g = e.paths) == null ? void 0 : g[s]) == null ? void 0 : y.parameters,
66
61
  // Original webhook
67
62
  information: {
68
63
  ...t
@@ -70,19 +65,19 @@ const G = (m, {
70
65
  };
71
66
  }
72
67
  });
73
- }), Object.keys(((g = e.components) == null ? void 0 : g.schemas) ?? {}).forEach((s) => {
74
- var c, o, t, r;
75
- u((o = (c = e.components) == null ? void 0 : c.schemas) == null ? void 0 : o[s]) && ((r = (t = e.components) == null ? void 0 : t.schemas) == null || delete r[s]);
68
+ }), Object.keys(((h = e.components) == null ? void 0 : h.schemas) ?? {}).forEach((s) => {
69
+ var a, r, t, o;
70
+ u((r = (a = e.components) == null ? void 0 : a.schemas) == null ? void 0 : r[s]) && ((o = (t = e.components) == null ? void 0 : t.schemas) == null || delete o[s]);
76
71
  }), Object.keys(e.paths).forEach((s) => {
77
72
  Object.keys(e.paths[s]).filter(
78
- (o) => D.includes(o.toUpperCase())
79
- ).forEach((o) => {
80
- var a, n, w, i, f, I;
81
- const t = e.paths[s][o];
73
+ (r) => C.includes(r.toUpperCase())
74
+ ).forEach((r) => {
75
+ var l, g, y, i, c, w;
76
+ const t = e.paths[s][r];
82
77
  if (t === void 0 || u(t))
83
78
  return;
84
- const r = {
85
- httpVerb: $(o),
79
+ const o = {
80
+ httpVerb: j(r),
86
81
  path: s,
87
82
  operationId: t.operationId || s,
88
83
  name: t.summary || s || "",
@@ -90,33 +85,33 @@ const G = (m, {
90
85
  information: {
91
86
  ...t
92
87
  },
93
- pathParameters: (n = (a = e.paths) == null ? void 0 : a[s]) == null ? void 0 : n.parameters
88
+ pathParameters: (g = (l = e.paths) == null ? void 0 : l[s]) == null ? void 0 : g.parameters
94
89
  };
95
90
  if (!t.tags || t.tags.length === 0) {
96
- (w = e.tags) != null && w.find((d) => d.name === "default") || (i = e.tags) == null || i.push({
91
+ (y = e.tags) != null && y.find((d) => d.name === "default") || (i = e.tags) == null || i.push({
97
92
  name: "default",
98
93
  description: "",
99
94
  operations: []
100
95
  });
101
- const p = (f = e.tags) == null ? void 0 : f.findIndex(
96
+ const p = (c = e.tags) == null ? void 0 : c.findIndex(
102
97
  (d) => d.name === "default"
103
98
  );
104
- p >= 0 && ((I = e.tags[p]) == null || I.operations.push(r));
99
+ p >= 0 && ((w = e.tags[p]) == null || w.operations.push(o));
105
100
  } else
106
101
  t.tags.forEach((p) => {
107
- var k, E, P;
108
- const d = (k = e.tags) == null ? void 0 : k.findIndex((j) => j.name === p);
109
- d === -1 && ((E = e.tags) == null || E.push({
102
+ var E, P, k;
103
+ const d = (E = e.tags) == null ? void 0 : E.findIndex((A) => A.name === p);
104
+ d === -1 && ((P = e.tags) == null || P.push({
110
105
  name: p,
111
106
  description: ""
112
107
  }));
113
- const b = d !== -1 ? d : e.tags.length - 1;
114
- typeof ((P = e.tags[b]) == null ? void 0 : P.operations) > "u" && (e.tags[b].operations = []), e.tags[b].operations.push(r);
108
+ const x = d !== -1 ? d : e.tags.length - 1;
109
+ typeof ((k = e.tags[x]) == null ? void 0 : k.operations) > "u" && (e.tags[x].operations = []), e.tags[x].operations.push(o);
115
110
  });
116
111
  });
117
- }), e.tags = (y = e.tags) == null ? void 0 : y.filter((s) => !u(s)), {
112
+ }), e.tags = (f = e.tags) == null ? void 0 : f.filter((s) => !u(s)), {
118
113
  ...e,
119
- webhooks: h
114
+ webhooks: n
120
115
  };
121
116
  };
122
117
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"useMultipleDocuments.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultipleDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAA;AAGpC,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAKpD,KAAK,yBAAyB,GAAG;IAC/B;;;OAGG;IACH,aAAa,EAAE,GAAG,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAAA;IAC5D,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,QAAQ,CAAA;AAIZ;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBACnB,4BAA4B,GAAG,SAAS,KACtD,iBAAiB,EA6BnB,CAAA;AA0CD,eAAO,MAAM,oBAAoB,8EAM9B,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;0CA8H2zoB,GAAI;oBAAuF,GAAG;;;;yBAAiH,CAAC;;;;;;;;;;;;;yCAAymB,GAAI;2CAA6E,GAAI;6BAAgE,GAAG;qBAAwE,GAAG;uCAAyF,GAAI;2CAA6F,GAAI;;;;;gBAA0K,CAAC;WAA4B,GAAI;;gBAAyF,CAAC;WAA4B,GAAI;;gBAAuF,CAAC;WAA4B,GAAI;;;;uBAAkJ,CAAC;mBAAqC,CAAC;WAA4B,GAAI;;;kBAAmH,CAAC;WAA4B,GAAI;qCAAyE,GAAI;;2DAAgK,GAAI;4EAAgH,GAAI;;;uDA/K7otB,GAAG;;;;;;;;;mDAAH,GAAG;;;;;;;;CA8KrD,CAAA"}
1
+ {"version":3,"file":"useMultipleDocuments.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultipleDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAA;AAGpC,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAKpD,KAAK,yBAAyB,GAAG;IAC/B;;;OAGG;IACH,aAAa,EAAE,GAAG,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAAA;IAC5D,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,QAAQ,CAAA;AAIZ;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBACnB,4BAA4B,GAAG,SAAS,KACtD,iBAAiB,EA6BnB,CAAA;AA0CD,eAAO,MAAM,oBAAoB,8EAM9B,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;0CAmIgooB,GAAI;oBAAuF,GAAG;;;;yBAAiH,CAAC;;;;;;;;;;;;;yCAAymB,GAAI;2CAA6E,GAAI;6BAAgE,GAAG;qBAAwE,GAAG;uCAAyF,GAAI;2CAA6F,GAAI;;;;;gBAA0K,CAAC;WAA4B,GAAI;;gBAAyF,CAAC;WAA4B,GAAI;;gBAAuF,CAAC;WAA4B,GAAI;;;;uBAAkJ,CAAC;mBAAqC,CAAC;WAA4B,GAAI;;;kBAAmH,CAAC;WAA4B,GAAI;qCAAyE,GAAI;;2DAAgK,GAAI;4EAAgH,GAAI;;;uDApLl9sB,GAAG;;;;;;;;;mDAAH,GAAG;;;;;;;;CAmLrD,CAAA"}
@@ -1,45 +1,45 @@
1
- import { isDefined as h } from "@scalar/oas-utils/helpers";
1
+ import { isDefined as S } from "@scalar/oas-utils/helpers";
2
2
  import { isConfigurationWithSources as y } from "@scalar/types/api-reference";
3
- import S from "github-slugger";
4
- import { computed as v, ref as A, watch as b } from "vue";
5
- const w = "api", g = new S(), C = (t) => t ? (Array.isArray(t) ? t : [t]).flatMap((u) => {
3
+ import R from "github-slugger";
4
+ import { computed as g, ref as b, watch as A } from "vue";
5
+ const w = "api", h = new R(), C = (t) => t ? (Array.isArray(t) ? t : [t]).flatMap((u) => {
6
6
  if (y(u)) {
7
- const { sources: a, ...r } = u;
8
- return (a == null ? void 0 : a.map((m) => ({ ...r, ...m }))) ?? [];
7
+ const { sources: s, ...r } = u;
8
+ return (s == null ? void 0 : s.map((m) => ({ ...r, ...m }))) ?? [];
9
9
  }
10
10
  return [u];
11
- }).map((u, a) => u && I(u, a)).filter(h) : [], I = (t, s = 0) => {
11
+ }).map((u, s) => u && I(u, s)).filter(S) : [], I = (t, a = 0) => {
12
12
  const e = {
13
13
  ...t,
14
14
  // @ts-expect-error this is before parsing so we transform the old style
15
15
  ...t.spec ?? {}
16
16
  };
17
17
  if (!(!(e != null && e.url) && !(e != null && e.content)))
18
- return g.reset(), e.title ? {
18
+ return h.reset(), e.title ? {
19
19
  ...e,
20
- slug: e.slug || g.slug(e.title),
20
+ slug: e.slug || h.slug(e.title),
21
21
  title: e.title
22
22
  } : e.slug ? {
23
23
  ...e,
24
24
  title: e.slug
25
25
  } : {
26
26
  ...e,
27
- slug: `api-${s + 1}`,
28
- title: `API #${s + 1}`
27
+ slug: `api-${a + 1}`,
28
+ title: `API #${a + 1}`
29
29
  };
30
- }, P = ({
30
+ }, T = ({
31
31
  configuration: t,
32
- initialIndex: s,
32
+ initialIndex: a,
33
33
  isIntersectionEnabled: e,
34
34
  hash: u,
35
- hashPrefix: a
35
+ hashPrefix: s
36
36
  }) => {
37
- const r = v(() => C(t.value)), f = A((() => {
37
+ const r = g(() => C(t.value)), f = b((() => {
38
38
  if (typeof window > "u")
39
- return typeof s == "number" ? s : 0;
39
+ return typeof a == "number" ? a : 0;
40
40
  const n = new URL(window.location.href).searchParams.get(w);
41
41
  if (n) {
42
- const o = r.value.findIndex((d) => d.slug === n);
42
+ const o = r.value.findIndex((p) => p.slug === n);
43
43
  if (o !== -1)
44
44
  return o;
45
45
  const i = Number.parseInt(n, 10);
@@ -47,8 +47,8 @@ const w = "api", g = new S(), C = (t) => t ? (Array.isArray(t) ? t : [t]).flatMa
47
47
  return i;
48
48
  }
49
49
  const l = r.value.findIndex((o) => "default" in o && o.default === !0);
50
- return l !== -1 ? l : typeof s == "number" ? s : 0;
51
- })()), p = v(() => {
50
+ return l !== -1 ? l : typeof a == "number" ? a : 0;
51
+ })()), c = g(() => {
52
52
  var n, l;
53
53
  return t.value && y(t.value) ? {
54
54
  ...t.value,
@@ -59,26 +59,28 @@ const w = "api", g = new S(), C = (t) => t ? (Array.isArray(t) ? t : [t]).flatMa
59
59
  ...r.value[f.value]
60
60
  };
61
61
  });
62
- return b(
62
+ return A(
63
63
  f,
64
- (c) => {
65
- var i, d;
64
+ (d) => {
65
+ var i, p, v;
66
66
  if (typeof window > "u" || r.value.length === 1)
67
67
  return;
68
- const n = new URL(window.location.href), l = r.value[c], o = (l == null ? void 0 : l.slug) ?? c.toString();
69
- n.searchParams.set(w, o), n.hash = "", window.history.replaceState({}, "", n.toString()), u.value = "", a.value = "", e.value = !1, typeof window < "u" && window.scrollTo({ top: 0, behavior: "instant" }), (d = (i = p.value).onDocumentSelect) == null || d.call(i);
68
+ const n = new URL(window.location.href), l = r.value[d];
69
+ c.value.pathRouting && (n.pathname = ((i = c.value.pathRouting) == null ? void 0 : i.basePath) ?? "");
70
+ const o = (l == null ? void 0 : l.slug) ?? d.toString();
71
+ n.searchParams.set(w, o), n.hash = "", window.history.replaceState({}, "", n.toString()), u.value = "", s.value = "", e.value = !1, typeof window < "u" && window.scrollTo({ top: 0, behavior: "instant" }), (v = (p = c.value).onDocumentSelect) == null || v.call(p);
70
72
  },
71
73
  { flush: "sync" }
72
74
  ), {
73
- selectedConfiguration: p,
75
+ selectedConfiguration: c,
74
76
  availableDocuments: r,
75
77
  selectedDocumentIndex: f,
76
78
  isIntersectionEnabled: e,
77
79
  hash: u,
78
- hashPrefix: a
80
+ hashPrefix: s
79
81
  };
80
82
  };
81
83
  export {
82
84
  C as normalizeConfigurations,
83
- P as useMultipleDocuments
85
+ T as useMultipleDocuments
84
86
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useReactiveSpec.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactiveSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,KAAK,CAAA;AAgDhE;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAChD,QAAQ,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDA"}
1
+ {"version":3,"file":"useReactiveSpec.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactiveSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,KAAK,CAAA;AAgDhE;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAChD,QAAQ,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDA"}
@@ -1,15 +1,15 @@
1
1
  import { fetchDocument as l, prettyPrintJson as d } from "@scalar/oas-utils/helpers";
2
- import { ref as f, watch as p, toValue as u } from "vue";
2
+ import { ref as s, watch as u, toValue as f } from "vue";
3
3
  import { parse as h } from "../helpers/parse.js";
4
4
  import { createEmptySpecification as m } from "../helpers/createEmptySpecification.js";
5
- const v = async ({ url: r, content: e }, n) => {
6
- if (r) {
5
+ const v = async ({ url: a, content: e }, r) => {
6
+ if (a) {
7
7
  const i = performance.now();
8
8
  try {
9
- const c = await l(r, n), o = performance.now();
10
- return console.log(`fetch: ${Math.round(o - i)} ms (${r})`), console.log("size:", Math.round(c.length / 1024), "kB"), c;
11
- } catch (c) {
12
- console.error("Failed to fetch OpenAPI document from URL:", c);
9
+ const n = await l(a, r), o = performance.now();
10
+ return console.log(`fetch: ${Math.round(o - i)} ms (${a})`), console.log("size:", Math.round(n.length / 1024), "kB"), n;
11
+ } catch (n) {
12
+ console.error("Failed to fetch OpenAPI document from URL:", n);
13
13
  }
14
14
  }
15
15
  const t = typeof e == "function" ? e() : e;
@@ -18,44 +18,42 @@ const v = async ({ url: r, content: e }, n) => {
18
18
  if (typeof t == "object")
19
19
  return d(t);
20
20
  };
21
- function E({
22
- specConfig: r,
21
+ function C({
22
+ specConfig: a,
23
23
  proxyUrl: e
24
24
  }) {
25
- const n = f(""), t = f(m()), i = f(null);
26
- function c(o) {
27
- var s;
25
+ const r = s(""), t = s(m()), i = s(null);
26
+ function n(o) {
28
27
  if (!o) {
29
28
  t.value = m();
30
29
  return;
31
30
  }
32
31
  h(o, {
33
- proxyUrl: e ? u(e) : void 0,
34
- source: (s = u(r)) == null ? void 0 : s.url
35
- }).then((a) => {
36
- i.value = null, t.value = a;
37
- }).catch((a) => {
38
- i.value = a.toString();
32
+ proxyUrl: e ? f(e) : void 0
33
+ }).then((c) => {
34
+ i.value = null, t.value = c;
35
+ }).catch((c) => {
36
+ i.value = c.toString();
39
37
  });
40
38
  }
41
- return p(
42
- () => u(r),
39
+ return u(
40
+ () => f(a),
43
41
  async (o) => {
44
- var s;
42
+ var c;
45
43
  if (o) {
46
- const a = (s = await v(o, u(e))) == null ? void 0 : s.trim();
47
- typeof a == "string" && (n.value = a);
44
+ const p = (c = await v(o, f(e))) == null ? void 0 : c.trim();
45
+ typeof p == "string" && (r.value = p);
48
46
  }
49
47
  },
50
48
  { immediate: !0, deep: !0 }
51
- ), p(n, () => {
52
- c(n.value);
49
+ ), u(r, () => {
50
+ n(r.value);
53
51
  }), {
54
- rawSpec: n,
52
+ rawSpec: r,
55
53
  parsedSpec: t,
56
54
  specErrors: i
57
55
  };
58
56
  }
59
57
  export {
60
- E as useReactiveSpec
58
+ C as useReactiveSpec
61
59
  };