@scalar/api-client 2.2.3 → 2.2.6

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 (106) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarServer.vue.js +15 -15
  4. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +24 -24
  8. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +2 -2
  9. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -5
  10. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  11. package/dist/components/DataTable/DataTableCheckbox.vue.js +5 -6
  12. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  13. package/dist/components/DataTable/DataTableInputSelect.vue.js +8 -8
  14. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  15. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +37 -47
  16. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  17. package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
  18. package/dist/components/HttpMethod/HttpMethod.vue2.js +16 -17
  19. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  20. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +85 -84
  21. package/dist/components/ImportCollection/ImportNowButton.vue.js +3 -3
  22. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  23. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +24 -26
  24. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +6 -0
  25. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  26. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +28 -23
  27. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  28. package/dist/components/OpenApiClientButton.vue.js +1 -1
  29. package/dist/components/OpenApiClientButton.vue2.js +16 -16
  30. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  31. package/dist/components/TopNav/TopNav.vue.js +72 -70
  32. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  33. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  34. package/dist/components/TopNav/TopNavItem.vue2.js +83 -81
  35. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  36. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +5 -6
  37. package/dist/layouts/App/create-api-client-app.d.ts +3 -2
  38. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  39. package/dist/layouts/App/create-api-client-app.js +6 -6
  40. package/dist/layouts/Modal/create-api-client-modal.d.ts +6 -4
  41. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  42. package/dist/layouts/Modal/create-api-client-modal.js +1 -1
  43. package/dist/layouts/Web/create-api-client-web.d.ts +3 -2
  44. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  45. package/dist/layouts/Web/create-api-client-web.js +4 -4
  46. package/dist/libs/create-client.d.ts +6 -5
  47. package/dist/libs/create-client.d.ts.map +1 -1
  48. package/dist/libs/create-client.js +38 -37
  49. package/dist/libs/index.d.ts +1 -2
  50. package/dist/libs/index.d.ts.map +1 -1
  51. package/dist/libs/index.js +20 -20
  52. package/dist/libs/send-request/index.d.ts +2 -0
  53. package/dist/libs/send-request/index.d.ts.map +1 -0
  54. package/dist/libs/send-request/index.js +9 -0
  55. package/dist/libs/{send-request.d.ts → send-request/send-request.d.ts} +6 -6
  56. package/dist/libs/send-request/send-request.d.ts.map +1 -0
  57. package/dist/libs/{send-request.js → send-request/send-request.js} +29 -29
  58. package/dist/store/events.d.ts +1 -1
  59. package/dist/store/import-spec.d.ts +1 -1
  60. package/dist/store/import-spec.d.ts.map +1 -1
  61. package/dist/store/import-spec.js +1 -1
  62. package/dist/store/store.d.ts +6 -4
  63. package/dist/store/store.d.ts.map +1 -1
  64. package/dist/store/store.js +47 -45
  65. package/dist/style.css +1 -1
  66. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  67. package/dist/views/Cookies/Cookies.vue2.js +18 -20
  68. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  69. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +76 -72
  70. package/dist/views/Request/Request.vue.js +1 -1
  71. package/dist/views/Request/Request.vue2.js +30 -30
  72. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +20 -19
  74. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  76. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +2 -2
  77. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  79. package/dist/views/Request/RequestSection/RequestBody.vue2.js +245 -191
  80. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  81. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  82. package/dist/views/Request/RequestSidebar.vue2.js +60 -61
  83. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  84. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  85. package/dist/views/Request/RequestSidebarItem.vue2.js +188 -196
  86. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  87. package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
  88. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +153 -147
  89. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  90. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  91. package/dist/views/Request/RequestSubpageHeader.vue2.js +24 -28
  92. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -1
  93. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
  94. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +5 -5
  95. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  96. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  97. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -25
  98. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  99. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +41 -30
  100. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  101. package/dist/views/Request/components/WorkspaceDropdown.vue.js +50 -58
  102. package/dist/views/Request/libs/oauth2.d.ts +6 -2
  103. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  104. package/dist/views/Request/libs/oauth2.js +43 -37
  105. package/package.json +18 -14
  106. package/dist/libs/send-request.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import t from "./HttpMethod.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-a2902675"]]);
4
+ const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-fcbb6eeb"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,8 +1,7 @@
1
1
  import { defineComponent as g, computed as a, openBlock as c, createBlock as y, unref as t, withCtx as q, createElementVNode as s, normalizeClass as l, toDisplayString as p, createElementBlock as w } from "vue";
2
- import { ScalarListbox as x } from "@scalar/components";
3
- import { getHttpMethodInfo as m, REQUEST_METHODS as k } from "@scalar/oas-utils/helpers";
4
- import { cva as B, cx as f } from "cva";
5
- const L = /* @__PURE__ */ g({
2
+ import { cva as k, ScalarListbox as x, cx as m } from "@scalar/components";
3
+ import { getHttpMethodInfo as f, REQUEST_METHODS as B } from "@scalar/oas-utils/helpers";
4
+ const H = /* @__PURE__ */ g({
6
5
  __name: "HttpMethod",
7
6
  props: {
8
7
  isSquare: { type: Boolean, default: !1 },
@@ -11,14 +10,14 @@ const L = /* @__PURE__ */ g({
11
10
  },
12
11
  emits: ["change"],
13
12
  setup(b, { emit: h }) {
14
- const r = b, v = h, o = a(() => m(r.method)), i = Object.entries(k).map(([e]) => ({
13
+ const r = b, v = h, o = a(() => f(r.method)), n = Object.entries(B).map(([e]) => ({
15
14
  id: e,
16
15
  label: e.charAt(0) + e.toLowerCase().slice(1),
17
- color: m(e).color
18
- })), n = a({
19
- get: () => i.find(({ id: e }) => e === r.method),
16
+ color: f(e).color
17
+ })), i = a({
18
+ get: () => n.find(({ id: e }) => e === r.method),
20
19
  set: (e) => (e == null ? void 0 : e.id) && v("change", e.id)
21
- }), d = B({
20
+ }), d = k({
22
21
  base: "text-center font-code text-3xs justify-center items-center flex",
23
22
  variants: {
24
23
  isSquare: {
@@ -26,24 +25,24 @@ const L = /* @__PURE__ */ g({
26
25
  false: "rounded-full"
27
26
  },
28
27
  isEditable: {
29
- true: "px-0 http-bg-gradient rounded-md border-1/2 border-r-1/2",
30
- false: "cusor-pointer"
28
+ true: "http-bg-gradient rounded-md border-1/2 border-r-1/2",
29
+ false: "cursor-auto"
31
30
  }
32
31
  }
33
32
  }), E = a(() => o.value.short);
34
33
  return (e, u) => e.isEditable ? (c(), y(t(x), {
35
34
  key: 0,
36
- modelValue: n.value,
37
- "onUpdate:modelValue": u[0] || (u[0] = (S) => n.value = S),
35
+ modelValue: i.value,
36
+ "onUpdate:modelValue": u[0] || (u[0] = (S) => i.value = S),
38
37
  class: "mt-1 font-code text-sm uppercase",
39
- options: t(i)
38
+ options: t(n)
40
39
  }, {
41
40
  default: q(() => [
42
41
  s("div", {
43
42
  class: l(["h-full", { "pointer-events-none": !e.isEditable }])
44
43
  }, [
45
44
  s("button", {
46
- class: l(["relative h-full", t(f)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
45
+ class: l(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
47
46
  type: "button"
48
47
  }, [
49
48
  s("span", null, p(E.value), 1)
@@ -53,11 +52,11 @@ const L = /* @__PURE__ */ g({
53
52
  _: 1
54
53
  }, 8, ["modelValue", "options"])) : (c(), w("div", {
55
54
  key: 1,
56
- class: l(["relative gap-1 whitespace-nowrap", t(f)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
55
+ class: l(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
57
56
  type: "button"
58
57
  }, p(o.value.short), 3));
59
58
  }
60
59
  });
61
60
  export {
62
- L as default
61
+ H as default
63
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":"AAyXA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;CAC7C,CAAC;;;;;;AAqbF,wBAQG"}
1
+ {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":"AA2XA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;CAC7C,CAAC;;;;;;AAybF,wBAQG"}
@@ -1,29 +1,29 @@
1
- import { defineComponent as F, ref as B, computed as l, watch as x, onMounted as q, onUnmounted as H, openBlock as c, createBlock as R, unref as r, withCtx as W, createElementBlock as a, createCommentVNode as p, createElementVNode as e, normalizeClass as K, Fragment as y, createVNode as d, toDisplayString as G, createTextVNode as I } from "vue";
2
- import J from "../CommandPalette/WatchModeToggle.vue.js";
3
- import Q from "./ImportNowButton.vue.js";
4
- import X from "./IntegrationLogo.vue.js";
5
- import Y from "./PrefetchError.vue.js";
6
- import Z from "./WorkspaceSelector.vue.js";
7
- import { useUrlPrefetcher as ee } from "./hooks/useUrlPrefetcher.js";
8
- import { getOpenApiDocumentVersion as L } from "./utils/getOpenApiDocumentVersion.js";
9
- import { isDocument as M } from "./utils/isDocument.js";
10
- import { isUrl as A } from "./utils/isUrl.js";
11
- import { useActiveEntities as te } from "../../store/active-entities.js";
12
- import { useModal as oe, ScalarModal as se, ScalarIcon as ne } from "@scalar/components";
13
- import { isLocalUrl as ie } from "@scalar/oas-utils/helpers";
14
- import { normalize as re } from "@scalar/openapi-parser";
15
- import { getThemeStyles as le } from "@scalar/themes";
16
- import { useWorkspace as ce } from "../../store/store.js";
17
- const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, me = {
1
+ import { defineComponent as B, ref as q, computed as l, watch as y, onMounted as H, onUnmounted as R, openBlock as c, createBlock as W, unref as r, withCtx as K, createElementBlock as a, createCommentVNode as p, createElementVNode as e, normalizeClass as G, Fragment as _, createVNode as d, toDisplayString as J, createTextVNode as L } from "vue";
2
+ import Q from "../CommandPalette/WatchModeToggle.vue.js";
3
+ import X from "./ImportNowButton.vue.js";
4
+ import Y from "./IntegrationLogo.vue.js";
5
+ import Z from "./PrefetchError.vue.js";
6
+ import ee from "./WorkspaceSelector.vue.js";
7
+ import { useUrlPrefetcher as te } from "./hooks/useUrlPrefetcher.js";
8
+ import { getOpenApiDocumentVersion as M } from "./utils/getOpenApiDocumentVersion.js";
9
+ import { isDocument as A } from "./utils/isDocument.js";
10
+ import { isUrl as T } from "./utils/isUrl.js";
11
+ import { useActiveEntities as oe } from "../../store/active-entities.js";
12
+ import { useModal as se, ScalarModal as ne, ScalarIcon as ie } from "@scalar/components";
13
+ import { isLocalUrl as re } from "@scalar/oas-utils/helpers";
14
+ import { normalize as le } from "@scalar/openapi-parser";
15
+ import { getThemeStyles as ce } from "@scalar/themes";
16
+ import { useWorkspace as ae } from "../../store/store.js";
17
+ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, ue = {
18
18
  key: 0,
19
19
  class: "flex justify-center items-center mb-2 p-1"
20
- }, ue = { class: "rounded-xl size-10" }, pe = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, fe = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, ve = { class: "flex justify-center" }, he = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, xe = {
20
+ }, pe = { class: "rounded-xl size-10" }, fe = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, ve = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, he = { class: "flex justify-center" }, xe = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, ye = {
21
21
  key: 0,
22
22
  class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
23
- }, ye = { class: "flex items-center justify-center" }, _e = { class: "flex flex-col justify-center items-center pb-8" }, be = { class: "text-center flex items-center flex-col" }, ge = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, we = {
23
+ }, _e = { class: "flex items-center justify-center" }, be = { class: "flex flex-col justify-center items-center pb-8" }, ge = { class: "text-center flex items-center flex-col" }, we = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ke = {
24
24
  href: "https://scalar.com/download",
25
25
  target: "_blank"
26
- }, $e = /* @__PURE__ */ F({
26
+ }, Ee = /* @__PURE__ */ B({
27
27
  __name: "ImportCollectionModal",
28
28
  props: {
29
29
  source: {},
@@ -31,83 +31,84 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
31
31
  eventType: {}
32
32
  },
33
33
  emits: ["importFinished"],
34
- setup(T, { emit: U }) {
35
- const o = T, P = U, { activeWorkspace: m } = te(), { workspaceMutators: C, events: D } = ce(), { prefetchResult: n, prefetchUrl: _, resetPrefetchResult: V } = ee(), i = oe(), f = B(!0);
36
- D.hotKeys.on(() => i.hide());
37
- const S = l(() => {
34
+ setup(U, { emit: P }) {
35
+ const o = U, C = P, { activeWorkspace: m } = oe(), { workspaceMutators: D, events: V } = ae(), { prefetchResult: n, prefetchUrl: b, resetPrefetchResult: S } = te(), i = se(), f = q(!0);
36
+ V.hotKeys.on(() => i.hide());
37
+ const j = l(() => {
38
38
  try {
39
- return re(
39
+ return le(
40
40
  n.content || o.source || ""
41
41
  );
42
42
  } catch {
43
43
  return;
44
44
  }
45
- }), j = l(() => {
45
+ }), z = l(() => {
46
46
  var s, t;
47
- return (t = (s = S.value) == null ? void 0 : s.info) == null ? void 0 : t.title;
48
- }), b = l(
49
- () => L(n.content || o.source || "")
47
+ return (t = (s = j.value) == null ? void 0 : s.info) == null ? void 0 : t.title;
48
+ }), g = l(
49
+ () => M(n.content || o.source || "")
50
50
  );
51
- x(
51
+ y(
52
52
  () => o.source,
53
53
  async (s) => {
54
- if (V(), A(s)) {
54
+ var t;
55
+ if (S(), T(s)) {
55
56
  if (o.eventType && ["paste", "drop"].includes(o.eventType)) {
56
- const { error: u } = await _(
57
+ const { error: u } = await b(
57
58
  s,
58
- m.value.proxyUrl
59
+ (t = m.value) == null ? void 0 : t.proxyUrl
59
60
  );
60
61
  u ? i.hide() : i.show();
61
62
  return;
62
63
  }
63
- _(s, m.value.proxyUrl), i.show();
64
+ b(s, m.value.proxyUrl), i.show();
64
65
  return;
65
66
  }
66
- s && M(s) && L(s) ? i.show() : i.hide();
67
+ s && A(s) && M(s) ? i.show() : i.hide();
67
68
  }
68
69
  );
69
- const z = l(() => !!o.source && A(o.source)), N = l(() => !!o.source && M(o.source)), v = l(() => n.url && ie(n.url)), h = (s) => {
70
- document.body.classList.remove("has-no-import-url"), (z.value || N.value) && i.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
71
- }, O = () => {
70
+ const N = l(() => !!o.source && T(o.source)), O = l(() => !!o.source && A(o.source)), v = l(() => n.url && re(n.url)), h = (s) => {
71
+ document.body.classList.remove("has-no-import-url"), (N.value || O.value) && i.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
72
+ }, $ = () => {
72
73
  document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
73
74
  };
74
- x(
75
+ y(
75
76
  () => i.open,
76
77
  (s) => {
77
- s ? h() : O();
78
+ s ? h() : $();
78
79
  }
79
- ), x(
80
+ ), y(
80
81
  () => o.source,
81
82
  () => {
82
83
  h();
83
84
  }
84
- ), q(() => {
85
+ ), H(() => {
85
86
  h();
86
- }), H(() => {
87
+ }), R(() => {
87
88
  document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
88
89
  });
89
- const g = l(
90
- () => m.value && v.value && o.integration && `<style>${le(o.integration)}</style>`
90
+ const w = l(
91
+ () => m.value && v.value && o.integration && `<style>${ce(o.integration)}</style>`
91
92
  );
92
- function $() {
93
- v.value && o.integration && C.edit(
93
+ function E() {
94
+ v.value && o.integration && D.edit(
94
95
  m.value.uid,
95
96
  "themeId",
96
97
  o.integration
97
- ), P("importFinished");
98
+ ), C("importFinished");
98
99
  }
99
- return (s, t) => (c(), R(r(se), {
100
+ return (s, t) => (c(), W(r(ne), {
100
101
  size: "full",
101
102
  state: r(i)
102
103
  }, {
103
- default: W(() => {
104
- var u, w, k;
104
+ default: K(() => {
105
+ var x, u, k, I;
105
106
  return [
106
- g.value ? (c(), a("div", {
107
+ w.value ? (c(), a("div", {
107
108
  key: 0,
108
- innerHTML: g.value
109
- }, null, 8, ae)) : p("", !0),
110
- e("div", de, [
109
+ innerHTML: w.value
110
+ }, null, 8, de)) : p("", !0),
111
+ e("div", me, [
111
112
  t[6] || (t[6] = e("div", { class: "section-flare" }, [
112
113
  e("div", { class: "section-flare-item" }),
113
114
  e("div", { class: "section-flare-item" }),
@@ -119,41 +120,41 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
119
120
  e("div", { class: "section-flare-item" })
120
121
  ], -1)),
121
122
  e("div", {
122
- class: K(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": r(n).state === "loading" }])
123
+ class: G(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": r(n).state === "loading" }])
123
124
  }, [
124
- r(n).error && r(n).state === "idle" && !b.value ? (c(), a(y, { key: 0 }, [
125
+ r(n).error && r(n).state === "idle" && !g.value ? (c(), a(_, { key: 0 }, [
125
126
  t[1] || (t[1] = e("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
126
- d(Y, {
127
- url: ((u = r(n)) == null ? void 0 : u.input) || o.source
127
+ d(Z, {
128
+ url: ((x = r(n)) == null ? void 0 : x.input) || o.source
128
129
  }, null, 8, ["url"])
129
- ], 64)) : (c(), a(y, { key: 1 }, [
130
- v.value ? (c(), a("div", me, [
131
- e("div", ue, [
132
- d(X, { integration: s.integration }, null, 8, ["integration"])
130
+ ], 64)) : (c(), a(_, { key: 1 }, [
131
+ v.value ? (c(), a("div", ue, [
132
+ e("div", pe, [
133
+ d(Y, { integration: s.integration }, null, 8, ["integration"])
133
134
  ])
134
135
  ])) : p("", !0),
135
- e("div", pe, G(j.value || "Untitled Collection"), 1),
136
+ e("div", fe, J(z.value || "Untitled Collection"), 1),
136
137
  t[4] || (t[4] = e("div", { class: "text-c-1 text-sm font-medium text-center text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
137
- b.value ? (c(), a(y, { key: 1 }, [
138
- e("div", fe, [
139
- d(Q, {
140
- source: ((w = r(n)) == null ? void 0 : w.url) ?? s.source,
138
+ g.value ? (c(), a(_, { key: 1 }, [
139
+ e("div", ve, [
140
+ d(X, {
141
+ source: ((u = r(n)) == null ? void 0 : u.url) ?? ((k = r(n)) == null ? void 0 : k.content) ?? s.source,
141
142
  variant: "button",
142
143
  watchMode: f.value,
143
- onImportFinished: $
144
+ onImportFinished: E
144
145
  }, null, 8, ["source", "watchMode"])
145
146
  ]),
146
- e("div", ve, [
147
- e("div", he, [
148
- t[2] || (t[2] = I(" Import to: ")),
149
- d(Z)
147
+ e("div", he, [
148
+ e("div", xe, [
149
+ t[2] || (t[2] = L(" Import to: ")),
150
+ d(ee)
150
151
  ])
151
152
  ]),
152
- (k = r(n)) != null && k.url ? (c(), a("div", xe, [
153
- e("div", ye, [
154
- d(J, {
153
+ (I = r(n)) != null && I.url ? (c(), a("div", ye, [
154
+ e("div", _e, [
155
+ d(Q, {
155
156
  modelValue: f.value,
156
- "onUpdate:modelValue": t[0] || (t[0] = (E) => f.value = E),
157
+ "onUpdate:modelValue": t[0] || (t[0] = (F) => f.value = F),
157
158
  disableToolTip: !0
158
159
  }, null, 8, ["modelValue"])
159
160
  ]),
@@ -162,11 +163,11 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
162
163
  ], 64)) : p("", !0)
163
164
  ], 64))
164
165
  ], 2),
165
- e("div", _e, [
166
- e("div", be, [
167
- e("div", ge, [
168
- e("a", we, [
169
- d(r(ne), {
166
+ e("div", be, [
167
+ e("div", ge, [
168
+ e("div", we, [
169
+ e("a", ke, [
170
+ d(r(ie), {
170
171
  icon: "Logo",
171
172
  size: "xl"
172
173
  })
@@ -179,7 +180,7 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
179
180
  target: "_blank"
180
181
  }, " Download Desktop App "),
181
182
  e("br"),
182
- I(" free · open-source · offline first ")
183
+ L(" free · open-source · offline first ")
183
184
  ], -1))
184
185
  ])
185
186
  ])
@@ -191,5 +192,5 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
191
192
  }
192
193
  });
193
194
  export {
194
- $e as default
195
+ Ee as default
195
196
  };
@@ -4,7 +4,7 @@ import { useActiveEntities as B } from "../../store/active-entities.js";
4
4
  import { ScalarButton as l } from "@scalar/components";
5
5
  import { useToasts as F } from "@scalar/use-toasts";
6
6
  import { useRouter as I } from "vue-router";
7
- import { useWorkspace as q } from "../../store/store.js";
7
+ import { useWorkspace as U } from "../../store/store.js";
8
8
  const R = /* @__PURE__ */ v({
9
9
  __name: "ImportNowButton",
10
10
  props: {
@@ -14,7 +14,7 @@ const R = /* @__PURE__ */ v({
14
14
  },
15
15
  emits: ["importFinished"],
16
16
  setup(f, { emit: d }) {
17
- const o = f, y = d, k = I(), { activeWorkspace: r } = B(), { importSpecFromUrl: w, importSpecFile: h } = q(), { toast: i } = F();
17
+ const o = f, y = d, k = I(), { activeWorkspace: r } = B(), { importSpecFromUrl: w, importSpecFile: h } = U(), { toast: i } = F();
18
18
  async function n() {
19
19
  try {
20
20
  if (o.source) {
@@ -23,7 +23,7 @@ const R = /* @__PURE__ */ v({
23
23
  o.source,
24
24
  r.value.uid,
25
25
  {
26
- proxy: r.value.proxyUrl,
26
+ proxyUrl: r.value.proxyUrl,
27
27
  watchMode: o.watchMode
28
28
  }
29
29
  );
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AA+bA,wBAKG"}
1
+ {"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AA2bA,wBAKG"}
@@ -1,6 +1,6 @@
1
- import { defineComponent as y, ref as W, openBlock as d, createElementBlock as x, Fragment as w, createElementVNode as t, createVNode as s, unref as e, withCtx as o, renderList as D, createBlock as N, withModifiers as k, normalizeClass as M, toDisplayString as h, withDirectives as z, vModelText as B, createTextVNode as V } from "vue";
1
+ import { defineComponent as y, ref as W, openBlock as m, createElementBlock as x, Fragment as w, createElementVNode as t, createVNode as s, unref as e, withCtx as a, renderList as D, createBlock as N, withModifiers as k, normalizeClass as z, toDisplayString as v, withDirectives as M, vModelText as B, createTextVNode as V } from "vue";
2
2
  import { useActiveEntities as j } from "../../store/active-entities.js";
3
- import { useModal as E, ScalarDropdown as T, ScalarDropdownItem as v, ScalarIcon as m, ScalarDropdownDivider as $, ScalarButton as _, ScalarModal as A } from "@scalar/components";
3
+ import { useModal as E, ScalarDropdown as T, ScalarDropdownItem as h, ScalarIcon as d, ScalarDropdownDivider as $, ScalarButton as _, ScalarModal as A } from "@scalar/components";
4
4
  import { useToasts as I } from "@scalar/use-toasts";
5
5
  import { useRouter as F } from "vue-router";
6
6
  import { useWorkspace as L } from "../../store/store.js";
@@ -29,63 +29,61 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
29
29
  }
30
30
  }), r.value = "", c.hide();
31
31
  };
32
- return (n, a) => (d(), x(w, null, [
32
+ return (n, o) => (m(), x(w, null, [
33
33
  t("div", P, [
34
34
  s(e(T), null, {
35
- items: o(() => [
36
- (d(!0), x(w, null, D(e(b), (l, p) => (d(), N(e(v), {
35
+ items: a(() => [
36
+ (m(!0), x(w, null, D(e(b), (l, p) => (m(), N(e(h), {
37
37
  key: p,
38
38
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
39
39
  onClick: k((J) => C(p), ["stop"])
40
40
  }, {
41
- default: o(() => [
41
+ default: a(() => [
42
42
  t("div", {
43
- class: M([
43
+ class: z([
44
44
  "flex items-center justify-center rounded-full p-[3px] w-4 h-4",
45
45
  e(i).uid === p ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
46
46
  ])
47
47
  }, [
48
- s(e(m), {
48
+ s(e(d), {
49
49
  class: "size-2.5",
50
50
  icon: "Checkmark",
51
51
  thickness: "3.5"
52
52
  })
53
53
  ], 2),
54
- t("span", q, h(l.name), 1)
54
+ t("span", q, v(l.name), 1)
55
55
  ]),
56
56
  _: 2
57
57
  }, 1032, ["onClick"]))), 128)),
58
58
  s(e($)),
59
- s(e(v), {
59
+ s(e(h), {
60
60
  class: "flex items-center gap-1.5",
61
- onClick: a[0] || (a[0] = (l) => e(c).show())
61
+ onClick: o[0] || (o[0] = (l) => e(c).show())
62
62
  }, {
63
- default: o(() => [
63
+ default: a(() => [
64
64
  t("div", G, [
65
- s(e(m), {
66
- class: "h-2.5",
65
+ s(e(d), {
67
66
  icon: "Add",
68
- thickness: "3"
67
+ size: "sm"
69
68
  })
70
69
  ]),
71
- a[2] || (a[2] = t("span", null, "New Workspace", -1))
70
+ o[2] || (o[2] = t("span", null, "New Workspace", -1))
72
71
  ]),
73
72
  _: 1
74
73
  })
75
74
  ]),
76
- default: o(() => [
75
+ default: a(() => [
77
76
  s(e(_), {
78
77
  class: "font-normal h-full justify-start line-clamp-1 py-1 px-1.5 text-c-1 hover:bg-b-2 w-fit text-c-3",
79
78
  fullWidth: "",
80
79
  variant: "ghost"
81
80
  }, {
82
- default: o(() => [
81
+ default: a(() => [
83
82
  t("div", R, [
84
- t("h2", U, h(e(i).name), 1),
85
- s(e(m), {
86
- class: "size-3",
83
+ t("h2", U, v(e(i).name), 1),
84
+ s(e(d), {
87
85
  icon: "ChevronDown",
88
- thickness: "3"
86
+ size: "md"
89
87
  })
90
88
  ])
91
89
  ]),
@@ -101,13 +99,13 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
101
99
  state: e(c),
102
100
  variant: "form"
103
101
  }, {
104
- default: o(() => [
102
+ default: a(() => [
105
103
  t("form", {
106
104
  class: "flex gap-1 rounded",
107
105
  onSubmit: k(S, ["prevent"])
108
106
  }, [
109
- z(t("input", {
110
- "onUpdate:modelValue": a[1] || (a[1] = (l) => r.value = l),
107
+ M(t("input", {
108
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => r.value = l),
111
109
  class: "border-none outline-none flex-1 w-full text-sm min-h-8 p-1.5",
112
110
  placeholder: "New Workspace",
113
111
  type: "text"
@@ -119,7 +117,7 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
119
117
  disabled: !r.value.trim(),
120
118
  type: "submit"
121
119
  }, {
122
- default: o(() => a[3] || (a[3] = [
120
+ default: a(() => o[3] || (o[3] = [
123
121
  V(" Continue ")
124
122
  ])),
125
123
  _: 1
@@ -22,6 +22,12 @@ export declare function useUrlPrefetcher(): {
22
22
  url: null;
23
23
  input: string | null;
24
24
  error: null;
25
+ } | {
26
+ state: string;
27
+ content: string;
28
+ url: null;
29
+ error: null;
30
+ input?: undefined;
25
31
  } | {
26
32
  state: string;
27
33
  content: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eAVvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;aACf,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAiHX,MAAM,GAAG,IAAI,UACZ,MAAM;;;;;;;;;;;;;;;;;;;;EAoBjB"}
1
+ {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eAVvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;aACf,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAuHX,MAAM,GAAG,IAAI,UACZ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBjB"}
@@ -2,7 +2,7 @@ import { resolve as i } from "@scalar/import";
2
2
  import { redirectToProxy as f, fetchWithProxyFallback as d } from "@scalar/oas-utils/helpers";
3
3
  import { reactive as h } from "vue";
4
4
  import { isUrl as m } from "../../../libs/isUrl.js";
5
- function b() {
5
+ function y() {
6
6
  const n = h({
7
7
  state: "idle",
8
8
  content: null,
@@ -19,40 +19,45 @@ function b() {
19
19
  error: null
20
20
  });
21
21
  }
22
- async function s(t, r) {
23
- if (!t)
22
+ async function s(e, r) {
23
+ if (!e)
24
24
  return {
25
25
  state: "idle",
26
26
  content: null,
27
27
  url: null,
28
- input: t,
28
+ input: e,
29
29
  error: null
30
30
  };
31
31
  try {
32
- const e = await i(t, {
32
+ const t = await i(e, {
33
33
  fetch: (c) => fetch(r ? f(r, c) : c, {
34
34
  cache: "no-cache"
35
35
  })
36
36
  });
37
- if (typeof e == "object" && e !== null)
38
- return { state: "idle", content: JSON.stringify(e, null, 2), url: t, error: null };
39
- if (e === void 0)
37
+ if (typeof t == "object" && t !== null)
38
+ return {
39
+ state: "idle",
40
+ content: JSON.stringify(t, null, 2),
41
+ url: null,
42
+ error: null
43
+ };
44
+ if (t === void 0)
40
45
  return {
41
46
  state: "idle",
42
47
  content: null,
43
48
  url: null,
44
- input: t,
45
- error: `Could not find an OpenAPI document in ${t}`
49
+ input: e,
50
+ error: `Could not find an OpenAPI document in ${e}`
46
51
  };
47
- if (!m(e))
52
+ if (!m(t))
48
53
  return {
49
54
  state: "idle",
50
55
  content: null,
51
56
  url: null,
52
- input: t,
57
+ input: e,
53
58
  error: "Oops, we got invalid content for the given URL."
54
59
  };
55
- const o = e, l = await d(o, {
60
+ const o = t, l = await d(o, {
56
61
  proxy: r,
57
62
  cache: "no-cache"
58
63
  });
@@ -65,29 +70,29 @@ function b() {
65
70
  state: "idle",
66
71
  content: null,
67
72
  url: null,
68
- input: t,
73
+ input: e,
69
74
  error: `Couldn't fetch ${o}, got error ${[l.status, l.statusText].join(" ").trim()}.`
70
75
  };
71
- } catch (e) {
72
- return console.error("[prefetchDocument]", e), {
76
+ } catch (t) {
77
+ return console.error("[prefetchDocument]", t), {
73
78
  state: "idle",
74
79
  content: null,
75
80
  url: null,
76
- input: t,
77
- error: e.message
81
+ input: e,
82
+ error: t.message
78
83
  };
79
84
  }
80
85
  }
81
- async function a(t, r) {
86
+ async function a(e, r) {
82
87
  Object.assign(n, {
83
88
  state: "loading",
84
89
  content: null,
85
90
  url: null,
86
- input: t,
91
+ input: e,
87
92
  error: null
88
93
  });
89
- const e = await s(t, r);
90
- return Object.assign(n, e), e;
94
+ const t = await s(e, r);
95
+ return Object.assign(n, t), t;
91
96
  }
92
97
  return {
93
98
  prefetchResult: n,
@@ -96,5 +101,5 @@ function b() {
96
101
  };
97
102
  }
98
103
  export {
99
- b as useUrlPrefetcher
104
+ y as useUrlPrefetcher
100
105
  };