@scalar/api-client 2.2.21 → 2.2.23

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 (144) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +70 -71
  5. package/dist/components/AddressBar/AddressBarServer.vue.js +26 -26
  6. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  7. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  8. package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
  9. package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
  10. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  11. package/dist/components/CodeInput/codeVariableWidget.js +42 -38
  12. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
  13. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  15. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
  16. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
  18. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
  19. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  20. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  21. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
  22. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  23. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
  24. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  25. package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
  26. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
  27. package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
  28. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
  29. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  30. package/dist/components/ScalarAsciiArt.vue2.js +22 -19
  31. package/dist/components/Search/useSearch.d.ts.map +1 -1
  32. package/dist/components/Search/useSearch.js +57 -49
  33. package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
  34. package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
  35. package/dist/components/Sidebar/Sidebar.vue.d.ts +2 -2
  36. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  37. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  38. package/dist/components/Sidebar/Sidebar.vue2.js +16 -16
  39. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  40. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  41. package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
  42. package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -1
  43. package/dist/components/Sidebar/SidebarToggle.vue.js +3 -3
  44. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  45. package/dist/components/TopNav/TopNav.vue.js +71 -64
  46. package/dist/layouts/App/ApiClientApp.vue.js +4 -1
  47. package/dist/layouts/App/create-api-client-app.d.ts +2 -1
  48. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  49. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  50. package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
  51. package/dist/layouts/Modal/create-api-client-modal.d.ts +4 -2
  52. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  53. package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
  54. package/dist/layouts/Web/create-api-client-web.d.ts +2 -1
  55. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  56. package/dist/libs/create-client.d.ts +12 -11
  57. package/dist/libs/create-client.d.ts.map +1 -1
  58. package/dist/libs/create-client.js +54 -47
  59. package/dist/libs/extractAttachmentFilename.d.ts +3 -0
  60. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
  61. package/dist/libs/extractAttachmentFilename.js +7 -7
  62. package/dist/libs/importers/curl.d.ts.map +1 -1
  63. package/dist/libs/importers/curl.js +18 -18
  64. package/dist/libs/normalize-headers.d.ts.map +1 -1
  65. package/dist/libs/normalize-headers.js +2 -2
  66. package/dist/libs/parse-curl.js +39 -36
  67. package/dist/store/active-entities.d.ts +4 -4
  68. package/dist/store/active-entities.d.ts.map +1 -1
  69. package/dist/store/active-entities.js +88 -86
  70. package/dist/store/collections.d.ts.map +1 -1
  71. package/dist/store/collections.js +29 -29
  72. package/dist/store/request-example.d.ts.map +1 -1
  73. package/dist/store/request-example.js +27 -23
  74. package/dist/store/requests.d.ts.map +1 -1
  75. package/dist/store/requests.js +94 -77
  76. package/dist/store/security-schemes.d.ts.map +1 -1
  77. package/dist/store/security-schemes.js +27 -27
  78. package/dist/store/servers.d.ts.map +1 -1
  79. package/dist/store/servers.js +18 -18
  80. package/dist/store/store.d.ts +5 -5
  81. package/dist/store/store.d.ts.map +1 -1
  82. package/dist/store/store.js +53 -48
  83. package/dist/store/tags.d.ts.map +1 -1
  84. package/dist/store/tags.js +35 -33
  85. package/dist/style.css +1 -1
  86. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  87. package/dist/views/Cookies/CookieForm.vue.js +14 -9
  88. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  89. package/dist/views/Cookies/Cookies.vue2.js +39 -37
  90. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  91. package/dist/views/Environment/Environment.vue2.js +94 -89
  92. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  93. package/dist/views/Request/Request.vue.js +1 -1
  94. package/dist/views/Request/Request.vue2.js +118 -119
  95. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  96. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
  97. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  98. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  99. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
  100. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  101. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  102. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
  103. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
  104. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
  105. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  106. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  107. package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
  108. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  109. package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
  110. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  111. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
  112. package/dist/views/Request/RequestSidebar.vue.d.ts +3 -4
  113. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  114. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  115. package/dist/views/Request/RequestSidebar.vue2.js +166 -164
  116. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  117. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  118. package/dist/views/Request/RequestSidebarItem.vue2.js +168 -150
  119. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  120. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  121. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
  122. package/dist/views/Request/RequestSubpageHeader.vue.d.ts +0 -1
  123. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  124. package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
  125. package/dist/views/Request/RequestSubpageHeader.vue2.js +44 -49
  126. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  127. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  128. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
  129. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  130. package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
  131. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  132. package/dist/views/Request/handle-drag.js +37 -31
  133. package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
  134. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  135. package/dist/views/Request/libs/live-sync.js +147 -130
  136. package/dist/views/Request/types/sidebar-item.d.ts +4 -1
  137. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  138. package/dist/views/Servers/ServerForm.vue.js +38 -35
  139. package/dist/views/Servers/Servers.vue2.js +38 -35
  140. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  141. package/dist/views/Settings/Settings.vue2.js +15 -15
  142. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  143. package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
  144. package/package.json +6 -6
@@ -1,109 +1,112 @@
1
- import { defineComponent as N, computed as f, watch as B, onMounted as D, openBlock as l, createElementBlock as x, createVNode as r, unref as n, withCtx as i, Fragment as j, renderList as M, createBlock as w, withModifiers as h, createTextVNode as E, toDisplayString as k, createElementVNode as m, normalizeClass as V, createCommentVNode as z } from "vue";
1
+ import { defineComponent as N, computed as f, watch as B, onMounted as D, openBlock as c, createElementBlock as x, createVNode as s, unref as n, withCtx as l, Fragment as j, renderList as M, createBlock as w, withModifiers as h, createTextVNode as E, toDisplayString as k, createElementVNode as u, normalizeClass as V, createCommentVNode as z } from "vue";
2
2
  import { useActiveEntities as W } from "../../store/active-entities.js";
3
- import { ScalarDropdown as L, ScalarDropdownItem as u, ScalarListboxCheckbox as O, ScalarIcon as g, ScalarDropdownDivider as R, ScalarButton as $ } from "@scalar/components";
3
+ import { ScalarDropdown as L, ScalarDropdownItem as m, ScalarListboxCheckbox as O, ScalarIcon as g, ScalarDropdownDivider as R, ScalarButton as $ } from "@scalar/components";
4
4
  import { useRouter as A } from "vue-router";
5
5
  import { useWorkspace as F } from "../../store/store.js";
6
6
  const T = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap" }, q = { class: "flex items-center justify-center h-4 w-4" }, U = /* @__PURE__ */ N({
7
7
  __name: "EnvironmentSelector",
8
8
  setup(G) {
9
- const { activeCollection: o, activeWorkspace: c, activeEnvironment: v } = W(), { isReadOnly: C, collectionMutators: _ } = F(), b = A(), d = (t) => {
10
- o.value && (_.edit(
9
+ const { activeCollection: o, activeWorkspace: i, activeEnvironment: v } = W(), { isReadOnly: C, collectionMutators: _ } = F(), b = A(), d = (e) => {
10
+ o.value && i.value && (_.edit(
11
11
  o.value.uid,
12
12
  "x-scalar-active-environment",
13
- t
14
- ), c.value.activeEnvironmentId = t);
15
- }, S = () => b.push({
16
- name: "environment",
17
- params: {
18
- environment: c.value.uid
19
- }
20
- }), y = f(() => {
21
- const { value: t } = v, { value: e } = o;
22
- return (t == null ? void 0 : t.uid) || (e == null ? void 0 : e["x-scalar-active-environment"]) || "Environment";
13
+ e
14
+ ), i.value.activeEnvironmentId = e);
15
+ }, S = () => {
16
+ var e;
17
+ return b.push({
18
+ name: "environment",
19
+ params: {
20
+ environment: (e = i.value) == null ? void 0 : e.uid
21
+ }
22
+ });
23
+ }, y = f(() => {
24
+ const { value: e } = v, { value: t } = o;
25
+ return (e == null ? void 0 : e.uid) || (t == null ? void 0 : t["x-scalar-active-environment"]) || "Environment";
23
26
  }), I = f(() => {
24
- const { value: t } = o, e = t == null ? void 0 : t["x-scalar-environments"];
25
- return e ? Object.entries(e).map(([a, s]) => ({
26
- ...s,
27
+ const { value: e } = o, t = e == null ? void 0 : e["x-scalar-environments"];
28
+ return t ? Object.entries(t).map(([a, r]) => ({
29
+ ...r,
27
30
  uid: a,
28
31
  name: a
29
32
  })) : [];
30
- }), p = (t) => {
31
- const e = t["x-scalar-active-environment"];
32
- e && o.value ? (o.value["x-scalar-active-environment"] = e, c.value.activeEnvironmentId = e) : c.value.activeEnvironmentId = "";
33
+ }), p = (e) => {
34
+ const t = e["x-scalar-active-environment"];
35
+ t && o.value && i.value ? (o.value["x-scalar-active-environment"] = t, i.value.activeEnvironmentId = t) : i.value && (i.value.activeEnvironmentId = "");
33
36
  };
34
- return B(o, (t) => {
35
- p(t);
37
+ return B(o, (e) => {
38
+ p(e);
36
39
  }), D(() => {
37
40
  p(o.value);
38
- }), (t, e) => (l(), x("div", null, [
39
- r(n(L), { placement: "bottom-end" }, {
40
- items: i(() => [
41
- (l(!0), x(j, null, M(I.value, (a) => (l(), w(n(u), {
41
+ }), (e, t) => (c(), x("div", null, [
42
+ s(n(L), { placement: "bottom-end" }, {
43
+ items: l(() => [
44
+ (c(!0), x(j, null, M(I.value, (a) => (c(), w(n(m), {
42
45
  key: a.uid,
43
46
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
44
- onClick: h((s) => d(a.uid), ["stop"])
47
+ onClick: h((r) => d(a.uid), ["stop"])
45
48
  }, {
46
- default: i(() => {
47
- var s;
49
+ default: l(() => {
50
+ var r;
48
51
  return [
49
- r(n(O), {
50
- selected: ((s = n(o)) == null ? void 0 : s["x-scalar-active-environment"]) === a.uid
52
+ s(n(O), {
53
+ selected: ((r = n(o)) == null ? void 0 : r["x-scalar-active-environment"]) === a.uid
51
54
  }, null, 8, ["selected"]),
52
55
  E(" " + k(a.name), 1)
53
56
  ];
54
57
  }),
55
58
  _: 2
56
59
  }, 1032, ["onClick"]))), 128)),
57
- r(n(u), {
60
+ s(n(m), {
58
61
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
59
- onClick: e[0] || (e[0] = h((a) => d(""), ["stop"]))
62
+ onClick: t[0] || (t[0] = h((a) => d(""), ["stop"]))
60
63
  }, {
61
- default: i(() => {
62
- var a;
64
+ default: l(() => {
65
+ var a, r;
63
66
  return [
64
- m("div", {
67
+ u("div", {
65
68
  class: V([
66
69
  "flex items-center justify-center rounded-full p-[3px] w-4 h-4",
67
- n(v).uid === "" && ((a = n(o)) == null ? void 0 : a["x-scalar-active-environment"]) === "" ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
70
+ ((a = n(v)) == null ? void 0 : a.uid) === "" && ((r = n(o)) == null ? void 0 : r["x-scalar-active-environment"]) === "" ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
68
71
  ])
69
72
  }, [
70
- r(n(g), {
73
+ s(n(g), {
71
74
  class: "size-2.5",
72
75
  icon: "Checkmark",
73
76
  thickness: "3.5"
74
77
  })
75
78
  ], 2),
76
- e[1] || (e[1] = E(" No Environment "))
79
+ t[1] || (t[1] = E(" No Environment "))
77
80
  ];
78
81
  }),
79
82
  _: 1
80
83
  }),
81
- r(n(R)),
82
- n(C) ? z("", !0) : (l(), w(n(u), {
84
+ s(n(R)),
85
+ n(C) ? z("", !0) : (c(), w(n(m), {
83
86
  key: 0,
84
87
  class: "flex items-center gap-1.5",
85
88
  onClick: S
86
89
  }, {
87
- default: i(() => [
88
- m("div", q, [
89
- r(n(g), {
90
+ default: l(() => [
91
+ u("div", q, [
92
+ s(n(g), {
90
93
  icon: "Brackets",
91
94
  size: "sm"
92
95
  })
93
96
  ]),
94
- e[2] || (e[2] = m("span", { class: "leading-none" }, "Manage Environments", -1))
97
+ t[2] || (t[2] = u("span", { class: "leading-none" }, "Manage Environments", -1))
95
98
  ]),
96
99
  _: 1
97
100
  }))
98
101
  ]),
99
- default: i(() => [
100
- r(n($), {
102
+ default: l(() => [
103
+ s(n($), {
101
104
  class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 w-fit",
102
105
  fullWidth: "",
103
106
  variant: "ghost"
104
107
  }, {
105
- default: i(() => [
106
- m("h2", T, k(y.value), 1)
108
+ default: l(() => [
109
+ u("h2", T, k(y.value), 1)
107
110
  ]),
108
111
  _: 1
109
112
  })
@@ -1 +1 @@
1
- {"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;AAkVA,wBAOG"}
1
+ {"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;AAwVA,wBAOG"}
@@ -1,81 +1,84 @@
1
- import { defineComponent as g, ref as y, onMounted as x, onBeforeUnmount as h, openBlock as p, createBlock as D, Transition as E, withCtx as T, createElementBlock as _, createElementVNode as i, createVNode as L, unref as C, createCommentVNode as b } from "vue";
2
- import { ScalarIcon as k } from "@scalar/components";
3
- const A = {
1
+ import { defineComponent as x, ref as h, onMounted as D, onBeforeUnmount as E, openBlock as g, createBlock as T, Transition as _, withCtx as L, createElementBlock as C, createElementVNode as d, createVNode as b, unref as k, createCommentVNode as A } from "vue";
2
+ import { ScalarIcon as w } from "@scalar/components";
3
+ const B = {
4
4
  key: 0,
5
5
  class: "fixed translate-x-1/2 translate-y-1/2 md:translate-x-0 md:translate-y-0 right-1/2 bottom-1/2 md:bottom-10 md:right-10 w-64 h-64 bg-b-2 z-50 rounded-xl border transition-opacity duration-200"
6
- }, w = { class: "flex flex-col items-center justify-center h-full" }, V = /* @__PURE__ */ g({
6
+ }, F = { class: "flex flex-col items-center justify-center h-full" }, z = /* @__PURE__ */ x({
7
7
  __name: "DropEventListener",
8
8
  emits: ["input"],
9
- setup(B, { emit: v }) {
10
- const l = v, r = y(!1);
11
- let o = 0;
12
- x(() => {
13
- document.addEventListener("dragenter", m), document.addEventListener("dragleave", f), document.addEventListener("dragover", u), document.addEventListener("drop", c);
14
- }), h(() => {
15
- document.removeEventListener("dragenter", m), document.removeEventListener("dragover", u), document.removeEventListener("dragleave", f), document.removeEventListener("drop", c);
9
+ setup(N, { emit: y }) {
10
+ const c = y, a = h(!1);
11
+ let i = 0;
12
+ D(() => {
13
+ document.addEventListener("dragenter", v), document.addEventListener("dragleave", m), document.addEventListener("dragover", p), document.addEventListener("drop", f);
14
+ }), E(() => {
15
+ document.removeEventListener("dragenter", v), document.removeEventListener("dragover", p), document.removeEventListener("dragleave", m), document.removeEventListener("drop", f);
16
16
  });
17
- function d(e) {
18
- var t;
19
- return ((t = e.dataTransfer) == null ? void 0 : t.types.includes("text/html")) ?? !1;
17
+ function u(e) {
18
+ var n;
19
+ return ((n = e.dataTransfer) == null ? void 0 : n.types.includes("text/html")) ?? !1;
20
20
  }
21
- async function c(e) {
22
- if (e.preventDefault(), r.value = !1, o = 0, !d(e) && e.dataTransfer) {
23
- const t = e.dataTransfer.getData("text").replace(/^blob:/, "");
24
- if (t)
25
- l("input", t, null, "drop");
21
+ async function f(e) {
22
+ if (e.preventDefault(), a.value = !1, i = 0, !u(e) && e.dataTransfer) {
23
+ const n = e.dataTransfer.getData("text").replace(/^blob:/, "");
24
+ if (n)
25
+ c("input", n, null, "drop");
26
26
  else if (e.dataTransfer.files.length > 0) {
27
- const a = e.dataTransfer.files[0], n = new FileReader();
28
- n.onload = async (s) => {
29
- s.target && typeof s.target.result == "string" && l("input", s.target.result, null, "drop");
30
- }, n.readAsText(a);
27
+ const o = e.dataTransfer.files[0];
28
+ if (!o) return;
29
+ const s = new FileReader();
30
+ s.onload = async (r) => {
31
+ r.target && typeof r.target.result == "string" && c("input", r.target.result, null, "drop");
32
+ }, s.readAsText(o);
31
33
  }
32
34
  }
33
35
  }
34
- function u(e) {
36
+ function p(e) {
35
37
  e.preventDefault();
36
38
  }
37
- function f(e) {
38
- e.preventDefault(), o--, o === 0 && (r.value = !1);
39
- }
40
39
  function m(e) {
41
- if (e.preventDefault(), o++, !d(e)) {
40
+ e.preventDefault(), i--, i === 0 && (a.value = !1);
41
+ }
42
+ function v(e) {
43
+ var n, o, s;
44
+ if (e.preventDefault(), i++, !u(e)) {
42
45
  if (e.dataTransfer) {
43
- const t = e.dataTransfer.items;
44
- for (let a = 0; a < t.length; a++) {
45
- const n = t[a];
46
- if (n.kind === "string" || n.type.includes("json") || n.type.includes("yml") || n.type.includes("yaml")) {
47
- r.value = !0;
46
+ const r = e.dataTransfer.items;
47
+ for (let l = 0; l < r.length; l++) {
48
+ const t = r[l];
49
+ if ((t == null ? void 0 : t.kind) === "string" || (n = t == null ? void 0 : t.type) != null && n.includes("json") || (o = t == null ? void 0 : t.type) != null && o.includes("yml") || (s = t == null ? void 0 : t.type) != null && s.includes("yaml")) {
50
+ a.value = !0;
48
51
  return;
49
52
  }
50
53
  }
51
54
  }
52
- r.value = !1;
55
+ a.value = !1;
53
56
  }
54
57
  }
55
- return (e, t) => (p(), D(E, {
58
+ return (e, n) => (g(), T(_, {
56
59
  enterActiveClass: "transition-opacity duration-200",
57
60
  enterFromClass: "opacity-0",
58
61
  leaveActiveClass: "transition-opacity duration-200",
59
62
  leaveToClass: "opacity-0"
60
63
  }, {
61
- default: T(() => [
62
- r.value ? (p(), _("div", A, [
63
- i("div", w, [
64
- i("div", null, [
65
- L(C(k), {
64
+ default: L(() => [
65
+ a.value ? (g(), C("div", B, [
66
+ d("div", F, [
67
+ d("div", null, [
68
+ b(k(w), {
66
69
  icon: "Download",
67
70
  size: "xl",
68
71
  thickness: "2"
69
72
  })
70
73
  ]),
71
- t[0] || (t[0] = i("div", { class: "text-center text-c-1 m-4" }, " Drop your OpenAPI document here ", -1))
74
+ n[0] || (n[0] = d("div", { class: "text-center text-c-1 m-4" }, " Drop your OpenAPI document here ", -1))
72
75
  ])
73
- ])) : b("", !0)
76
+ ])) : A("", !0)
74
77
  ]),
75
78
  _: 1
76
79
  }));
77
80
  }
78
81
  });
79
82
  export {
80
- V as default
83
+ z as default
81
84
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as H, ref as W, computed as c, watch as _, onMounted as K, onUnmounted as G, openBlock as l, createBlock as J, unref as i, withCtx as Q, createElementBlock as a, createCommentVNode as m, createElementVNode as e, normalizeClass as X, Fragment as g, createVNode as d, toDisplayString as Y, createTextVNode as M } from "vue";
1
+ import { defineComponent as H, ref as W, computed as c, watch as g, onMounted as K, onUnmounted as G, openBlock as l, createBlock as J, unref as i, withCtx as Q, createElementBlock as a, createCommentVNode as u, createElementVNode as e, normalizeClass as X, Fragment as b, createVNode as d, toDisplayString as Y, createTextVNode as M } from "vue";
2
2
  import Z from "../CommandPalette/WatchModeToggle.vue.js";
3
3
  import ee from "./ImportNowButton.vue.js";
4
4
  import te from "./IntegrationLogo.vue.js";
@@ -37,7 +37,7 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
37
37
  },
38
38
  emits: ["importFinished"],
39
39
  setup(T, { emit: P }) {
40
- const s = T, D = P, { activeWorkspace: u } = re(), { workspaceMutators: V, events: j } = fe(), { prefetchResult: n, prefetchUrl: b, resetPrefetchResult: S } = ne(), r = ie(), f = W(!0);
40
+ const s = T, D = P, { activeWorkspace: p } = re(), { workspaceMutators: V, events: j } = fe(), { prefetchResult: n, prefetchUrl: w, resetPrefetchResult: S } = ne(), r = ie(), v = W(!0);
41
41
  j.hotKeys.on(() => r.hide());
42
42
  const z = c(() => {
43
43
  try {
@@ -50,9 +50,9 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
50
50
  }), N = c(() => {
51
51
  var o, t;
52
52
  return (t = (o = z.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
53
- }), w = c(
53
+ }), k = c(
54
54
  () => U(n.content || s.source || "")
55
- ), { darkLightMode: O } = ue(), { currentRoute: $ } = pe(), v = c(() => {
55
+ ), { darkLightMode: O } = ue(), { currentRoute: $ } = pe(), h = c(() => {
56
56
  try {
57
57
  const o = $.value.query, t = O.value === "dark" ? o.dark_logo : o.light_logo;
58
58
  if (t) return decodeURIComponent(t);
@@ -60,51 +60,52 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
60
60
  }
61
61
  return null;
62
62
  });
63
- _(
63
+ g(
64
64
  () => s.source,
65
65
  async (o) => {
66
- var t;
66
+ var t, m;
67
67
  if (S(), C(o)) {
68
68
  if (s.eventType && ["paste", "drop"].includes(s.eventType)) {
69
- const { error: p } = await b(
69
+ const { error: f } = await w(
70
70
  o,
71
- (t = u.value) == null ? void 0 : t.proxyUrl
71
+ (t = p.value) == null ? void 0 : t.proxyUrl
72
72
  );
73
- p ? r.hide() : r.show();
73
+ f ? r.hide() : r.show();
74
74
  return;
75
75
  }
76
- b(o, u.value.proxyUrl), r.show();
76
+ w(o, (m = p.value) == null ? void 0 : m.proxyUrl), r.show();
77
77
  return;
78
78
  }
79
79
  o && A(o) && U(o) ? r.show() : r.hide();
80
80
  }
81
81
  );
82
- const E = c(() => !!s.source && C(s.source)), F = c(() => !!s.source && A(s.source)), h = c(() => n.url && ae(n.url)), x = (o) => {
82
+ const E = c(() => !!s.source && C(s.source)), F = c(() => !!s.source && A(s.source)), x = c(() => n.url && ae(n.url)), y = (o) => {
83
83
  document.body.classList.remove("has-no-import-url"), (E.value || F.value) && r.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
84
84
  }, R = () => {
85
85
  document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
86
86
  };
87
- _(
87
+ g(
88
88
  () => r.open,
89
89
  (o) => {
90
- o ? x() : R();
90
+ o ? y() : R();
91
91
  }
92
- ), _(
92
+ ), g(
93
93
  () => s.source,
94
94
  () => {
95
- x();
95
+ y();
96
96
  }
97
97
  ), K(() => {
98
- x();
98
+ y();
99
99
  }), G(() => {
100
100
  document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
101
101
  });
102
- const k = c(
103
- () => u.value && h.value && s.integration && `<style>${me(s.integration)}</style>`
102
+ const I = c(
103
+ () => p.value && x.value && s.integration && `<style>${me(s.integration)}</style>`
104
104
  );
105
105
  function q() {
106
- h.value && s.integration && V.edit(
107
- u.value.uid,
106
+ var o;
107
+ x.value && s.integration && V.edit(
108
+ ((o = p.value) == null ? void 0 : o.uid) ?? "",
108
109
  "themeId",
109
110
  s.integration
110
111
  ), D("importFinished");
@@ -114,12 +115,12 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
114
115
  state: i(r)
115
116
  }, {
116
117
  default: Q(() => {
117
- var y, p, I, L;
118
+ var m, _, f, L;
118
119
  return [
119
- k.value ? (l(), a("div", {
120
+ I.value ? (l(), a("div", {
120
121
  key: 0,
121
- innerHTML: k.value
122
- }, null, 8, ve)) : m("", !0),
122
+ innerHTML: I.value
123
+ }, null, 8, ve)) : u("", !0),
123
124
  e("div", he, [
124
125
  t[6] || (t[6] = e("div", { class: "section-flare" }, [
125
126
  e("div", { class: "section-flare-item" }),
@@ -134,30 +135,30 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
134
135
  e("div", {
135
136
  class: X(["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": i(n).state === "loading" }])
136
137
  }, [
137
- i(n).error && i(n).state === "idle" && !w.value ? (l(), a(g, { key: 0 }, [
138
+ i(n).error && i(n).state === "idle" && !k.value ? (l(), a(b, { key: 0 }, [
138
139
  t[1] || (t[1] = e("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
139
140
  d(oe, {
140
- url: ((y = i(n)) == null ? void 0 : y.input) || s.source
141
+ url: ((m = i(n)) == null ? void 0 : m.input) || s.source
141
142
  }, null, 8, ["url"])
142
- ], 64)) : (l(), a(g, { key: 1 }, [
143
- h.value ? (l(), a("div", xe, [
143
+ ], 64)) : (l(), a(b, { key: 1 }, [
144
+ x.value ? (l(), a("div", xe, [
144
145
  e("div", ye, [
145
146
  d(te, { integration: o.integration }, null, 8, ["integration"])
146
147
  ])
147
- ])) : v.value ? (l(), a("img", {
148
+ ])) : h.value ? (l(), a("img", {
148
149
  key: 1,
149
150
  alt: "Logo",
150
151
  class: "w-full object-contain mb-2",
151
- src: v.value
152
- }, null, 8, _e)) : m("", !0),
153
- v.value ? m("", !0) : (l(), a("div", ge, Y(N.value || "Untitled Collection"), 1)),
152
+ src: h.value
153
+ }, null, 8, _e)) : u("", !0),
154
+ h.value ? u("", !0) : (l(), a("div", ge, Y(N.value || "Untitled Collection"), 1)),
154
155
  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)),
155
- w.value ? (l(), a(g, { key: 3 }, [
156
+ k.value ? (l(), a(b, { key: 3 }, [
156
157
  e("div", be, [
157
158
  d(ee, {
158
- source: ((p = i(n)) == null ? void 0 : p.url) ?? ((I = i(n)) == null ? void 0 : I.content) ?? o.source,
159
+ source: ((_ = i(n)) == null ? void 0 : _.url) ?? ((f = i(n)) == null ? void 0 : f.content) ?? o.source,
159
160
  variant: "button",
160
- watchMode: f.value,
161
+ watchMode: v.value,
161
162
  onImportFinished: q
162
163
  }, null, 8, ["source", "watchMode"])
163
164
  ]),
@@ -170,14 +171,14 @@ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center p
170
171
  (L = i(n)) != null && L.url ? (l(), a("div", Ie, [
171
172
  e("div", Le, [
172
173
  d(Z, {
173
- modelValue: f.value,
174
- "onUpdate:modelValue": t[0] || (t[0] = (B) => f.value = B),
174
+ modelValue: v.value,
175
+ "onUpdate:modelValue": t[0] || (t[0] = (B) => v.value = B),
175
176
  disableToolTip: !0
176
177
  }, null, 8, ["modelValue"])
177
178
  ]),
178
179
  t[3] || (t[3] = e("div", { class: "pt-0 text-center text-balance font-medium text-xs text-c-3" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
179
- ])) : m("", !0)
180
- ], 64)) : m("", !0)
180
+ ])) : u("", !0)
181
+ ], 64)) : u("", !0)
181
182
  ], 64))
182
183
  ], 2),
183
184
  e("div", Me, [
@@ -1,11 +1,11 @@
1
- import { defineComponent as v, openBlock as s, createElementBlock as C, Fragment as x, createBlock as a, unref as p, withCtx as m, createTextVNode as c, createCommentVNode as b } from "vue";
2
- import { isUrl as g } from "./utils/isUrl.js";
3
- import { useActiveEntities as B } from "../../store/active-entities.js";
4
- import { ScalarButton as l } from "@scalar/components";
5
- import { useToasts as F } from "@scalar/use-toasts";
6
- import { useRouter as I } from "vue-router";
7
- import { useWorkspace as U } from "../../store/store.js";
8
- const R = /* @__PURE__ */ v({
1
+ import { defineComponent as b, openBlock as n, createElementBlock as g, Fragment as B, createBlock as c, unref as l, withCtx as f, createTextVNode as d, createCommentVNode as F } from "vue";
2
+ import { isUrl as I } from "./utils/isUrl.js";
3
+ import { useActiveEntities as U } from "../../store/active-entities.js";
4
+ import { ScalarButton as y } from "@scalar/components";
5
+ import { useToasts as q } from "@scalar/use-toasts";
6
+ import { useRouter as M } from "vue-router";
7
+ import { useWorkspace as T } from "../../store/store.js";
8
+ const _ = /* @__PURE__ */ b({
9
9
  __name: "ImportNowButton",
10
10
  props: {
11
11
  source: {},
@@ -13,73 +13,75 @@ const R = /* @__PURE__ */ v({
13
13
  watchMode: { type: Boolean }
14
14
  },
15
15
  emits: ["importFinished"],
16
- setup(f, { emit: d }) {
17
- const o = f, y = d, k = I(), { activeWorkspace: r } = B(), { importSpecFromUrl: w, importSpecFile: h } = U(), { toast: i } = F();
18
- async function n() {
16
+ setup(k, { emit: w }) {
17
+ const r = k, h = w, v = M(), { activeWorkspace: s } = U(), { importSpecFromUrl: C, importSpecFile: x } = T(), { toast: u } = q();
18
+ async function a() {
19
+ var t, e, m;
19
20
  try {
20
- if (o.source) {
21
- if (g(o.source)) {
22
- const [t, e] = await w(
23
- o.source,
24
- r.value.uid,
21
+ if (r.source) {
22
+ if (I(r.source)) {
23
+ const [o, i] = await C(
24
+ r.source,
25
+ ((t = s.value) == null ? void 0 : t.uid) ?? "",
25
26
  {
26
- proxyUrl: r.value.proxyUrl,
27
- watchMode: o.watchMode
27
+ proxyUrl: (e = s.value) == null ? void 0 : e.proxyUrl,
28
+ watchMode: r.watchMode
28
29
  }
29
30
  );
30
- t || u(e);
31
+ o || p(i);
31
32
  } else {
32
- const t = await h(
33
- o.source,
34
- r.value.uid
33
+ const o = await x(
34
+ r.source,
35
+ ((m = s.value) == null ? void 0 : m.uid) ?? ""
35
36
  );
36
- u(t);
37
+ p(o);
37
38
  }
38
- i("Import successful", "info"), y("importFinished");
39
+ u("Import successful", "info"), h("importFinished");
39
40
  }
40
- } catch (t) {
41
- console.error("[importCollection]", t);
42
- const e = (t == null ? void 0 : t.message) || "Unknown error";
43
- i(`Import failed: ${e}`, "error");
41
+ } catch (o) {
42
+ console.error("[importCollection]", o);
43
+ const i = (o == null ? void 0 : o.message) || "Unknown error";
44
+ u(`Import failed: ${i}`, "error");
44
45
  }
45
46
  }
46
- function u(t) {
47
- t && k.push({
47
+ function p(t) {
48
+ var e;
49
+ t && v.push({
48
50
  name: "request",
49
51
  params: {
50
- workspace: r.value.uid,
52
+ workspace: (e = s.value) == null ? void 0 : e.uid,
51
53
  request: t == null ? void 0 : t.requests[0]
52
54
  }
53
55
  });
54
56
  }
55
- return (t, e) => t.source ? (s(), C(x, { key: 0 }, [
56
- t.variant === "button" ? (s(), a(p(l), {
57
+ return (t, e) => t.source ? (n(), g(B, { key: 0 }, [
58
+ t.variant === "button" ? (n(), c(l(y), {
57
59
  key: 0,
58
60
  class: "py-2.5 px-6 rounded-lg font-bold h-fit mt-3 w-full",
59
61
  size: "md",
60
62
  type: "button",
61
- onClick: n
63
+ onClick: a
62
64
  }, {
63
- default: m(() => e[0] || (e[0] = [
64
- c(" Import Collection ")
65
+ default: f(() => e[0] || (e[0] = [
66
+ d(" Import Collection ")
65
67
  ])),
66
68
  _: 1
67
- })) : (s(), a(p(l), {
69
+ })) : (n(), c(l(y), {
68
70
  key: 1,
69
71
  class: "text-[21px] py-2.5 px-6 rounded-lg font-bold h-fit",
70
72
  size: "md",
71
73
  type: "button",
72
74
  variant: "ghost",
73
- onClick: n
75
+ onClick: a
74
76
  }, {
75
- default: m(() => e[1] || (e[1] = [
76
- c(" Try it in the browser ")
77
+ default: f(() => e[1] || (e[1] = [
78
+ d(" Try it in the browser ")
77
79
  ])),
78
80
  _: 1
79
81
  }))
80
- ], 64)) : b("", !0);
82
+ ], 64)) : F("", !0);
81
83
  }
82
84
  });
83
85
  export {
84
- R as default
86
+ _ as default
85
87
  };