@scalar/api-client 2.5.31 → 2.5.33

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 (235) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue2.js +120 -128
  4. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  5. package/dist/components/AddressBar/AddressBarHistory.vue2.js +57 -63
  6. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  7. package/dist/components/CodeInput/CodeInput.vue2.js +143 -150
  8. package/dist/components/CodeInput/codeVariableWidget.js +70 -75
  9. package/dist/components/CommandPalette/CommandActionInput.vue.js +17 -19
  10. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -27
  11. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +53 -55
  12. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +129 -133
  13. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +84 -98
  15. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +64 -74
  16. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -11
  17. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  18. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +164 -183
  19. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  20. package/dist/components/DataTable/DataTableInput.vue.js +4 -4
  21. package/dist/components/DataTable/DataTableInput.vue2.js +31 -31
  22. package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -2
  23. package/dist/components/EmptyState.vue.js +1 -1
  24. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +75 -84
  25. package/dist/components/Form/LabelInput.vue.js +1 -1
  26. package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
  27. package/dist/components/HttpMethod/HttpMethod.vue2.js +11 -11
  28. package/dist/components/ImportCollection/DropEventListener.vue.js +42 -44
  29. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -23
  30. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +141 -149
  31. package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +1 -1
  32. package/dist/components/ImportCollection/ImportNowButton.vue.js +22 -23
  33. package/dist/components/ImportCollection/IntegrationLogo.vue.js +12 -13
  34. package/dist/components/ImportCollection/PasteEventListener.vue.js +11 -12
  35. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +69 -76
  36. package/dist/components/ImportCollection/utils/get-openapi-version.js +8 -8
  37. package/dist/components/ImportCollection/utils/import-collection.js +14 -14
  38. package/dist/components/OpenApiClientButton.vue.js +1 -1
  39. package/dist/components/OpenApiClientButton.vue2.js +10 -10
  40. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  41. package/dist/components/ScalarAsciiArt.vue2.js +19 -22
  42. package/dist/components/Search/useSearch.js +51 -61
  43. package/dist/components/SectionFilter.vue.js +1 -1
  44. package/dist/components/SectionFilter.vue2.js +26 -29
  45. package/dist/components/Server/ServerDropdown.vue.js +70 -96
  46. package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
  47. package/dist/components/Server/ServerDropdownItem.vue2.js +57 -67
  48. package/dist/components/Server/ServerSelector.vue.js +44 -55
  49. package/dist/components/Server/ServerVariablesForm.vue.js +36 -42
  50. package/dist/components/Server/ServerVariablesSelect.vue.js +6 -6
  51. package/dist/components/SideNav/DownloadAppButton.vue.js +1 -1
  52. package/dist/components/SideNav/SideNav.vue.js +68 -74
  53. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
  54. package/dist/components/Sidebar/Sidebar.vue.js +1 -1
  55. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  56. package/dist/components/TopNav/TopNav.vue.js +107 -122
  57. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  58. package/dist/hooks/useFileDialog.js +12 -12
  59. package/dist/hooks/useResponseBody.js +14 -16
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +2 -2
  62. package/dist/layouts/App/ApiClientApp.vue.js +50 -56
  63. package/dist/layouts/App/ApiClientApp.vue3.js +1 -1
  64. package/dist/layouts/App/create-api-client-app.js +19 -20
  65. package/dist/layouts/App/index.js +1 -1
  66. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  67. package/dist/layouts/Modal/ApiClientModal.vue2.js +18 -21
  68. package/dist/layouts/Web/ApiClientWeb.vue.js +45 -51
  69. package/dist/layouts/Web/ApiClientWeb.vue3.js +1 -1
  70. package/dist/layouts/Web/create-api-client-web.js +19 -20
  71. package/dist/layouts/Web/index.js +1 -1
  72. package/dist/libs/create-client.js +102 -109
  73. package/dist/libs/env-helpers.js +3 -3
  74. package/dist/libs/event-bus.js +15 -15
  75. package/dist/libs/extractAttachmentFilename.js +5 -6
  76. package/dist/libs/find-request.js +9 -10
  77. package/dist/libs/get-request-uid-by-path-method.js +12 -12
  78. package/dist/libs/getOpenApiDocumentDetails.js +7 -7
  79. package/dist/libs/importers/curl.js +3 -3
  80. package/dist/libs/normalize-headers.js +9 -10
  81. package/dist/libs/postman.js +15 -17
  82. package/dist/libs/send-request/build-request-security.js +9 -10
  83. package/dist/libs/send-request/create-fetch-body.js +11 -12
  84. package/dist/libs/send-request/create-fetch-query-params.js +13 -13
  85. package/dist/libs/send-request/create-request-operation.js +83 -84
  86. package/dist/libs/send-request/decode-buffer.d.ts.map +1 -1
  87. package/dist/libs/send-request/set-request-cookies.js +12 -12
  88. package/dist/libs/string-template.js +21 -21
  89. package/dist/libs/validate-parameters.js +5 -8
  90. package/dist/plugins/plugin-manager.js +11 -17
  91. package/dist/store/active-entities.js +90 -117
  92. package/dist/store/collections.js +41 -42
  93. package/dist/store/import-spec.js +25 -26
  94. package/dist/store/request-example.js +20 -24
  95. package/dist/store/requests.js +63 -81
  96. package/dist/store/router-params.js +7 -7
  97. package/dist/store/security-schemes.js +35 -36
  98. package/dist/store/store.js +2 -2
  99. package/dist/store/tags.js +20 -21
  100. package/dist/style.css +1 -1
  101. package/dist/views/Collection/Collection.vue2.js +21 -22
  102. package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
  103. package/dist/views/Collection/CollectionAuthentication.vue2.js +43 -47
  104. package/dist/views/Collection/CollectionEnvironment.vue.js +1 -1
  105. package/dist/views/Collection/CollectionEnvironment.vue2.js +196 -207
  106. package/dist/views/Collection/CollectionInfoForm.vue.js +1 -1
  107. package/dist/views/Collection/CollectionInfoForm.vue2.js +34 -41
  108. package/dist/views/Collection/CollectionNavigation.vue.js +116 -125
  109. package/dist/views/Collection/CollectionOverview.vue2.js +22 -25
  110. package/dist/views/Collection/CollectionServerForm.vue.js +39 -45
  111. package/dist/views/Collection/CollectionServers.vue2.js +88 -98
  112. package/dist/views/Collection/CollectionSettings.vue.js +1 -1
  113. package/dist/views/Collection/CollectionSettings.vue2.js +101 -108
  114. package/dist/views/Collection/components/EnvironmentForm.vue.js +1 -1
  115. package/dist/views/Collection/components/EnvironmentForm.vue2.js +141 -145
  116. package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
  117. package/dist/views/Collection/components/MarkdownInput.vue2.js +1 -2
  118. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -15
  119. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +15 -16
  120. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +61 -64
  121. package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +9 -10
  122. package/dist/views/Cookies/CookieModal.vue.js +1 -1
  123. package/dist/views/Cookies/Cookies.vue2.js +90 -93
  124. package/dist/views/Environment/Environment.vue2.js +267 -295
  125. package/dist/views/Environment/EnvironmentModal.vue.js +63 -70
  126. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -42
  127. package/dist/views/Request/Request.vue.js +1 -1
  128. package/dist/views/Request/Request.vue2.js +60 -67
  129. package/dist/views/Request/RequestRoot.vue.js +1 -1
  130. package/dist/views/Request/RequestRoot.vue2.js +78 -89
  131. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +37 -44
  132. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +44 -45
  133. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -127
  134. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  135. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +120 -139
  136. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  137. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +97 -97
  138. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  139. package/dist/views/Request/RequestSection/RequestBody.vue2.js +287 -310
  140. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +1 -1
  141. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +86 -94
  142. package/dist/views/Request/RequestSection/RequestParams.vue.js +37 -38
  143. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +36 -38
  144. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  145. package/dist/views/Request/RequestSection/RequestSection.vue2.js +28 -31
  146. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  147. package/dist/views/Request/RequestSection/RequestTable.vue2.js +49 -52
  148. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
  149. package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +16 -16
  150. package/dist/views/Request/RequestSection/helpers/getting-started.js +7 -11
  151. package/dist/views/Request/RequestSection/helpers/update-scheme.js +7 -8
  152. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  153. package/dist/views/Request/RequestSidebar.vue2.js +199 -211
  154. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  155. package/dist/views/Request/RequestSidebarItem.vue2.js +332 -349
  156. package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
  157. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +210 -240
  158. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  159. package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +38 -41
  160. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
  161. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +58 -64
  162. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +1 -2
  163. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
  164. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
  165. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +20 -23
  166. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +1 -1
  167. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  168. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +29 -30
  169. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +38 -41
  170. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
  171. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +28 -29
  172. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  173. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +128 -140
  174. package/dist/views/Request/components/WorkspaceDropdown.vue.js +116 -124
  175. package/dist/views/Request/consts/mediaTypes.js +2 -3
  176. package/dist/views/Request/handle-drag.js +24 -28
  177. package/dist/views/Request/hooks/useOpenApiWatcher.js +26 -33
  178. package/dist/views/Request/libs/auth.js +37 -43
  179. package/dist/views/Request/libs/oauth2.js +30 -32
  180. package/dist/views/Request/libs/watch-mode.js +100 -103
  181. package/dist/views/Settings/SettingsGeneral.vue.js +206 -236
  182. package/package.json +22 -22
  183. package/dist/components/AddressBar/AddressBar.vue3.js +0 -4
  184. package/dist/components/AddressBar/AddressBarHistory.vue3.js +0 -4
  185. package/dist/components/CodeInput/CodeInput.vue3.js +0 -4
  186. package/dist/components/CodeInput/CodeInput.vue4.js +0 -4
  187. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue3.js +0 -4
  188. package/dist/components/CommandPalette/TheCommandPalette.vue3.js +0 -4
  189. package/dist/components/DataTable/DataTableInput.vue3.js +0 -4
  190. package/dist/components/EmptyState.vue3.js +0 -4
  191. package/dist/components/Form/LabelInput.vue3.js +0 -4
  192. package/dist/components/HttpMethod/HttpMethod.vue3.js +0 -4
  193. package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
  194. package/dist/components/OpenApiClientButton.vue3.js +0 -4
  195. package/dist/components/ScalarAsciiArt.vue3.js +0 -4
  196. package/dist/components/SectionFilter.vue3.js +0 -4
  197. package/dist/components/Server/ServerDropdownItem.vue3.js +0 -4
  198. package/dist/components/SideNav/DownloadAppButton.vue3.js +0 -4
  199. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue3.js +0 -4
  200. package/dist/components/Sidebar/Sidebar.vue3.js +0 -4
  201. package/dist/components/Sidebar/SidebarListElement.vue3.js +0 -4
  202. package/dist/components/Sidebar/SidebarListElement.vue4.js +0 -4
  203. package/dist/components/TopNav/TopNavItem.vue3.js +0 -4
  204. package/dist/layouts/App/ApiClientApp.vue2.js +0 -4
  205. package/dist/layouts/Modal/ApiClientModal.vue3.js +0 -4
  206. package/dist/layouts/Web/ApiClientWeb.vue2.js +0 -4
  207. package/dist/style.css.js +0 -4
  208. package/dist/views/Collection/CollectionAuthentication.vue3.js +0 -4
  209. package/dist/views/Collection/CollectionEnvironment.vue3.js +0 -4
  210. package/dist/views/Collection/CollectionInfoForm.vue3.js +0 -4
  211. package/dist/views/Collection/CollectionSettings.vue3.js +0 -4
  212. package/dist/views/Collection/components/EnvironmentForm.vue3.js +0 -4
  213. package/dist/views/Collection/components/MarkdownInput.vue3.js +0 -4
  214. package/dist/views/Cookies/CookieModal.vue3.js +0 -4
  215. package/dist/views/Request/Request.vue3.js +0 -4
  216. package/dist/views/Request/RequestRoot.vue3.js +0 -4
  217. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue3.js +0 -4
  218. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue3.js +0 -4
  219. package/dist/views/Request/RequestSection/RequestBody.vue3.js +0 -4
  220. package/dist/views/Request/RequestSection/RequestCodeExample.vue3.js +0 -4
  221. package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -4
  222. package/dist/views/Request/RequestSection/RequestTable.vue3.js +0 -4
  223. package/dist/views/Request/RequestSection/RequestTableTooltip.vue3.js +0 -4
  224. package/dist/views/Request/RequestSidebar.vue3.js +0 -4
  225. package/dist/views/Request/RequestSidebarItem.vue3.js +0 -4
  226. package/dist/views/Request/RequestSidebarItem.vue4.js +0 -4
  227. package/dist/views/Request/RequestSidebarItemMenu.vue3.js +0 -4
  228. package/dist/views/Request/RequestSubpageHeader.vue3.js +0 -4
  229. package/dist/views/Request/ResponseSection/ResponseBody.vue3.js +0 -4
  230. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue3.js +0 -4
  231. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue3.js +0 -4
  232. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue2.js +0 -4
  233. package/dist/views/Request/ResponseSection/ResponseEmpty.vue3.js +0 -4
  234. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue3.js +0 -4
  235. package/dist/views/Request/ResponseSection/ResponseSection.vue3.js +0 -4
@@ -1,117 +1,108 @@
1
- import { defineComponent as D, computed as E, watch as g, onMounted as L, createBlock as d, openBlock as c, unref as n, withCtx as s, createVNode as l, createElementVNode as p, toDisplayString as w, createElementBlock as M, createCommentVNode as V, Fragment as W, renderList as j, withModifiers as _, createTextVNode as k } from "vue";
2
- import { ScalarDropdown as T, ScalarButton as $, ScalarDropdownItem as f, ScalarListboxCheckbox as S, ScalarDropdownDivider as z, ScalarIcon as A } from "@scalar/components";
3
- import { useRouter as F } from "vue-router";
4
- import { PathId as O } from "../../routes.js";
5
- import { useActiveEntities as P } from "../../store/active-entities.js";
6
- import { useWorkspace as R } from "../../store/store.js";
7
- import { useLayout as q } from "../../hooks/useLayout.js";
8
- const G = { class: "m-0 flex items-center gap-1.5 font-medium whitespace-nowrap" }, H = { class: "flex h-4 w-4 items-center justify-center" }, te = /* @__PURE__ */ D({
1
+ import { defineComponent as B, computed as E, watch as h, onMounted as D, createBlock as v, openBlock as s, unref as n, withCtx as r, createVNode as l, createElementVNode as d, toDisplayString as g, createElementBlock as L, createCommentVNode as M, Fragment as V, renderList as W, withModifiers as w, createTextVNode as _ } from "vue";
2
+ import { ScalarDropdown as j, ScalarButton as T, ScalarDropdownItem as p, ScalarListboxCheckbox as k, ScalarDropdownDivider as $, ScalarIcon as z } from "@scalar/components";
3
+ import { useRouter as A } from "vue-router";
4
+ import { PathId as F } from "../../routes.js";
5
+ import { useActiveEntities as O } from "../../store/active-entities.js";
6
+ import { useWorkspace as P } from "../../store/store.js";
7
+ import { useLayout as R } from "../../hooks/useLayout.js";
8
+ const q = { class: "m-0 flex items-center gap-1.5 font-medium whitespace-nowrap" }, G = { class: "flex h-4 w-4 items-center justify-center" }, ee = /* @__PURE__ */ B({
9
9
  __name: "EnvironmentSelector",
10
- setup(J) {
11
- const { activeCollection: a, activeWorkspace: r, activeEnvironment: u } = P(), { collectionMutators: C } = R(), { layout: y } = q(), I = F(), m = (e) => {
12
- a.value && r.value && (C.edit(
13
- a.value.uid,
10
+ setup(H) {
11
+ const { activeCollection: o, activeWorkspace: i, activeEnvironment: c } = O(), { collectionMutators: S } = P(), { layout: C } = R(), y = A(), m = (t) => {
12
+ o.value && i.value && (S.edit(
13
+ o.value.uid,
14
14
  "x-scalar-active-environment",
15
- e
16
- ), r.value.activeEnvironmentId = e);
17
- }, N = () => {
18
- var e;
19
- return I.push({
20
- name: "environment.default",
21
- params: {
22
- [O.Workspace]: (e = r.value) == null ? void 0 : e.uid
23
- }
24
- });
25
- }, b = E(() => {
26
- const { value: e } = u, { value: t } = a;
27
- return (e == null ? void 0 : e.name) || (t == null ? void 0 : t["x-scalar-active-environment"]) || "No Environment";
28
- }), v = E(() => {
29
- const { value: e } = a, t = e == null ? void 0 : e["x-scalar-environments"];
30
- return t ? Object.entries(t).map(([o, i]) => ({
31
- ...i,
32
- uid: o,
33
- name: o
15
+ t
16
+ ), i.value.activeEnvironmentId = t);
17
+ }, I = () => y.push({
18
+ name: "environment.default",
19
+ params: {
20
+ [F.Workspace]: i.value?.uid
21
+ }
22
+ }), N = E(() => {
23
+ const { value: t } = c, { value: e } = o;
24
+ return t?.name || e?.["x-scalar-active-environment"] || "No Environment";
25
+ }), u = E(() => {
26
+ const { value: t } = o, e = t?.["x-scalar-environments"];
27
+ return e ? Object.entries(e).map(([a, x]) => ({
28
+ ...x,
29
+ uid: a,
30
+ name: a
34
31
  })) : [];
35
- }), B = () => {
36
- const e = v.value;
37
- if (e.length > 0) {
38
- const t = e[e.length - 1];
39
- t != null && t.uid && m(t.uid);
32
+ }), b = () => {
33
+ const t = u.value;
34
+ if (t.length > 0) {
35
+ const e = t[t.length - 1];
36
+ e?.uid && m(e.uid);
40
37
  }
41
38
  };
42
- g(v, (e, t) => {
43
- e.length > t.length && B();
39
+ h(u, (t, e) => {
40
+ t.length > e.length && b();
44
41
  });
45
- const x = (e) => {
46
- const t = e["x-scalar-active-environment"];
47
- t && a.value && r.value ? (a.value["x-scalar-active-environment"] = t, r.value.activeEnvironmentId = t) : r.value && (r.value.activeEnvironmentId = "");
42
+ const f = (t) => {
43
+ const e = t["x-scalar-active-environment"];
44
+ e && o.value && i.value ? (o.value["x-scalar-active-environment"] = e, i.value.activeEnvironmentId = e) : i.value && (i.value.activeEnvironmentId = "");
48
45
  };
49
- return g(
50
- a,
51
- (e) => e && x(e)
52
- ), L(() => {
53
- a.value && x(a.value);
54
- }), (e, t) => (c(), d(n(T), { teleport: "" }, {
55
- items: s(() => [
56
- (c(!0), M(W, null, j(v.value, (o) => (c(), d(n(f), {
57
- key: o.uid,
46
+ return h(
47
+ o,
48
+ (t) => t && f(t)
49
+ ), D(() => {
50
+ o.value && f(o.value);
51
+ }), (t, e) => (s(), v(n(j), { teleport: "" }, {
52
+ items: r(() => [
53
+ (s(!0), L(V, null, W(u.value, (a) => (s(), v(n(p), {
54
+ key: a.uid,
58
55
  class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
59
- onClick: _((i) => m(o.uid), ["stop"])
56
+ onClick: w((x) => m(a.uid), ["stop"])
60
57
  }, {
61
- default: s(() => {
62
- var i;
63
- return [
64
- l(n(S), {
65
- selected: ((i = n(a)) == null ? void 0 : i["x-scalar-active-environment"]) === o.uid
66
- }, null, 8, ["selected"]),
67
- k(" " + w(o.name), 1)
68
- ];
69
- }),
58
+ default: r(() => [
59
+ l(n(k), {
60
+ selected: n(o)?.["x-scalar-active-environment"] === a.uid
61
+ }, null, 8, ["selected"]),
62
+ _(" " + g(a.name), 1)
63
+ ]),
70
64
  _: 2
71
65
  }, 1032, ["onClick"]))), 128)),
72
- l(n(f), {
66
+ l(n(p), {
73
67
  class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
74
- onClick: t[0] || (t[0] = _((o) => m(""), ["stop"]))
68
+ onClick: e[0] || (e[0] = w((a) => m(""), ["stop"]))
75
69
  }, {
76
- default: s(() => {
77
- var o, i, h;
78
- return [
79
- l(n(S), {
80
- selected: ((o = n(u)) == null ? void 0 : o.uid) === "" && ((i = n(a)) == null ? void 0 : i["x-scalar-active-environment"]) === "" || ((h = n(u)) == null ? void 0 : h.name) === "No Environment"
81
- }, null, 8, ["selected"]),
82
- t[1] || (t[1] = k(" No Environment "))
83
- ];
84
- }),
70
+ default: r(() => [
71
+ l(n(k), {
72
+ selected: n(c)?.uid === "" && n(o)?.["x-scalar-active-environment"] === "" || n(c)?.name === "No Environment"
73
+ }, null, 8, ["selected"]),
74
+ e[1] || (e[1] = _(" No Environment "))
75
+ ]),
85
76
  _: 1,
86
77
  __: [1]
87
78
  }),
88
- l(n(z)),
89
- n(y) !== "modal" ? (c(), d(n(f), {
79
+ l(n($)),
80
+ n(C) !== "modal" ? (s(), v(n(p), {
90
81
  key: 0,
91
82
  class: "flex items-center gap-1.5",
92
- onClick: N
83
+ onClick: I
93
84
  }, {
94
- default: s(() => [
95
- p("div", H, [
96
- l(n(A), {
85
+ default: r(() => [
86
+ d("div", G, [
87
+ l(n(z), {
97
88
  icon: "Brackets",
98
89
  size: "sm"
99
90
  })
100
91
  ]),
101
- t[2] || (t[2] = p("span", { class: "leading-none" }, "Manage Environments", -1))
92
+ e[2] || (e[2] = d("span", { class: "leading-none" }, "Manage Environments", -1))
102
93
  ]),
103
94
  _: 1,
104
95
  __: [2]
105
- })) : V("", !0)
96
+ })) : M("", !0)
106
97
  ]),
107
- default: s(() => [
108
- l(n($), {
98
+ default: r(() => [
99
+ l(n(T), {
109
100
  class: "text-c-1 hover:bg-b-2 line-clamp-1 h-auto w-fit justify-start px-1.5 py-1.5 font-normal",
110
101
  fullWidth: "",
111
102
  variant: "ghost"
112
103
  }, {
113
- default: s(() => [
114
- p("h2", G, w(b.value), 1)
104
+ default: r(() => [
105
+ d("h2", q, g(N.value), 1)
115
106
  ]),
116
107
  _: 1
117
108
  })
@@ -121,5 +112,5 @@ const G = { class: "m-0 flex items-center gap-1.5 font-medium whitespace-nowrap"
121
112
  }
122
113
  });
123
114
  export {
124
- te as default
115
+ ee as default
125
116
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./LabelInput.vue2.js";
2
- import "./LabelInput.vue3.js";
2
+ /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fced736a"]]);
5
5
  export {
@@ -1,5 +1,5 @@
1
1
  import t from "./HttpMethod.vue2.js";
2
- import "./HttpMethod.vue3.js";
2
+ /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-076b14a1"]]);
5
5
  export {
@@ -1,4 +1,4 @@
1
- import { defineComponent as g, computed as o, createBlock as y, createElementBlock as C, openBlock as c, unref as t, withCtx as q, createElementVNode as s, normalizeClass as l, toDisplayString as p } from "vue";
1
+ import { defineComponent as g, computed as a, createBlock as y, createElementBlock as C, openBlock as p, unref as t, withCtx as q, createElementVNode as s, normalizeClass as l, toDisplayString as c } from "vue";
2
2
  import { cva as k, ScalarListbox as w, cx as m } from "@scalar/components";
3
3
  import { getHttpMethodInfo as f, REQUEST_METHODS as x } from "@scalar/helpers/http/http-info";
4
4
  const H = /* @__PURE__ */ g({
@@ -10,13 +10,13 @@ const H = /* @__PURE__ */ g({
10
10
  },
11
11
  emits: ["change"],
12
12
  setup(b, { emit: h }) {
13
- const r = b, v = h, a = o(() => f(r.method)), n = Object.entries(x).map(([e]) => ({
13
+ const r = b, v = h, o = a(() => f(r.method)), n = Object.entries(x).map(([e]) => ({
14
14
  id: e,
15
15
  label: e.toUpperCase(),
16
16
  color: f(e).colorClass
17
- })), i = o({
17
+ })), i = a({
18
18
  get: () => n.find(({ id: e }) => e === r.method),
19
- set: (e) => (e == null ? void 0 : e.id) && v("change", e.id)
19
+ set: (e) => e?.id && v("change", e.id)
20
20
  }), d = k({
21
21
  base: "text-center font-code text-3xs justify-center items-center flex",
22
22
  variants: {
@@ -29,8 +29,8 @@ const H = /* @__PURE__ */ g({
29
29
  false: "cursor-auto"
30
30
  }
31
31
  }
32
- }), E = o(() => a.value.short);
33
- return (e, u) => e.isEditable ? (c(), y(t(w), {
32
+ }), E = a(() => o.value.short);
33
+ return (e, u) => e.isEditable ? (p(), y(t(w), {
34
34
  key: 0,
35
35
  modelValue: i.value,
36
36
  "onUpdate:modelValue": u[0] || (u[0] = (S) => i.value = S),
@@ -42,19 +42,19 @@ const H = /* @__PURE__ */ g({
42
42
  class: l(["h-full", { "pointer-events-none": !e.isEditable }])
43
43
  }, [
44
44
  s("button", {
45
- class: l(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), a.value.colorClass)]),
45
+ class: l(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.colorClass)]),
46
46
  type: "button"
47
47
  }, [
48
- s("span", null, p(E.value), 1)
48
+ s("span", null, c(E.value), 1)
49
49
  ], 2)
50
50
  ], 2)
51
51
  ]),
52
52
  _: 1
53
- }, 8, ["modelValue", "options"])) : (c(), C("div", {
53
+ }, 8, ["modelValue", "options"])) : (p(), C("div", {
54
54
  key: 1,
55
- class: l(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), a.value.colorClass)]),
55
+ class: l(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.colorClass)]),
56
56
  type: "button"
57
- }, p(a.value.short), 3));
57
+ }, c(o.value.short), 3));
58
58
  }
59
59
  });
60
60
  export {
@@ -1,53 +1,51 @@
1
- import { defineComponent as x, ref as h, onMounted as D, onBeforeUnmount as E, createBlock as T, openBlock as g, Transition as _, withCtx as L, createElementBlock as C, createCommentVNode as b, createElementVNode as d, createVNode as k, unref as A } from "vue";
2
- import { ScalarIcon as w } from "@scalar/components";
3
- const B = {
1
+ import { defineComponent as g, ref as y, onMounted as x, onBeforeUnmount as h, createBlock as D, openBlock as p, Transition as E, withCtx as T, createElementBlock as _, createCommentVNode as L, createElementVNode as s, createVNode as C, unref as b } from "vue";
2
+ import { ScalarIcon as k } from "@scalar/components";
3
+ const A = {
4
4
  key: 0,
5
5
  class: "bg-b-2 fixed right-1/2 bottom-1/2 z-50 h-64 w-64 translate-x-1/2 translate-y-1/2 rounded-xl border transition-opacity duration-200 md:right-10 md:bottom-10 md:translate-x-0 md:translate-y-0"
6
- }, F = { class: "flex h-full flex-col items-center justify-center" }, z = /* @__PURE__ */ x({
6
+ }, w = { class: "flex h-full flex-col items-center justify-center" }, V = /* @__PURE__ */ g({
7
7
  __name: "DropEventListener",
8
8
  emits: ["input"],
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);
9
+ setup(B, { emit: v }) {
10
+ const l = v, a = 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);
16
16
  });
17
- function u(e) {
18
- var n;
19
- return ((n = e.dataTransfer) == null ? void 0 : n.types.includes("text/html")) ?? !1;
17
+ function d(e) {
18
+ return e.dataTransfer?.types.includes("text/html") ?? !1;
20
19
  }
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");
20
+ async function c(e) {
21
+ if (e.preventDefault(), a.value = !1, o = 0, !d(e) && e.dataTransfer) {
22
+ const t = e.dataTransfer.getData("text").replace(/^blob:/, "");
23
+ if (t)
24
+ l("input", t, null, "drop");
26
25
  else if (e.dataTransfer.files.length > 0) {
27
- const o = e.dataTransfer.files[0];
28
- if (!o)
26
+ const r = e.dataTransfer.files[0];
27
+ if (!r)
29
28
  return;
30
- const s = new FileReader();
31
- s.onload = async (r) => {
32
- r.target && typeof r.target.result == "string" && c("input", r.target.result, null, "drop");
33
- }, s.readAsText(o);
29
+ const n = new FileReader();
30
+ n.onload = async (i) => {
31
+ i.target && typeof i.target.result == "string" && l("input", i.target.result, null, "drop");
32
+ }, n.readAsText(r);
34
33
  }
35
34
  }
36
35
  }
37
- function p(e) {
36
+ function u(e) {
38
37
  e.preventDefault();
39
38
  }
40
- function m(e) {
41
- e.preventDefault(), i--, i === 0 && (a.value = !1);
39
+ function f(e) {
40
+ e.preventDefault(), o--, o === 0 && (a.value = !1);
42
41
  }
43
- function v(e) {
44
- var n, o, s;
45
- if (e.preventDefault(), i++, !u(e)) {
42
+ function m(e) {
43
+ if (e.preventDefault(), o++, !d(e)) {
46
44
  if (e.dataTransfer) {
47
- const r = e.dataTransfer.items;
48
- for (let l = 0; l < r.length; l++) {
49
- const t = r[l];
50
- 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")) {
45
+ const t = e.dataTransfer.items;
46
+ for (let r = 0; r < t.length; r++) {
47
+ const n = t[r];
48
+ if (n?.kind === "string" || n?.type?.includes("json") || n?.type?.includes("yml") || n?.type?.includes("yaml")) {
51
49
  a.value = !0;
52
50
  return;
53
51
  }
@@ -56,30 +54,30 @@ const B = {
56
54
  a.value = !1;
57
55
  }
58
56
  }
59
- return (e, n) => (g(), T(_, {
57
+ return (e, t) => (p(), D(E, {
60
58
  enterActiveClass: "transition-opacity duration-200",
61
59
  enterFromClass: "opacity-0",
62
60
  leaveActiveClass: "transition-opacity duration-200",
63
61
  leaveToClass: "opacity-0"
64
62
  }, {
65
- default: L(() => [
66
- a.value ? (g(), C("div", B, [
67
- d("div", F, [
68
- d("div", null, [
69
- k(A(w), {
63
+ default: T(() => [
64
+ a.value ? (p(), _("div", A, [
65
+ s("div", w, [
66
+ s("div", null, [
67
+ C(b(k), {
70
68
  icon: "Download",
71
69
  size: "xl",
72
70
  thickness: "2"
73
71
  })
74
72
  ]),
75
- n[0] || (n[0] = d("div", { class: "text-c-1 m-4 text-center" }, " Drop your OpenAPI document here ", -1))
73
+ t[0] || (t[0] = s("div", { class: "text-c-1 m-4 text-center" }, " Drop your OpenAPI document here ", -1))
76
74
  ])
77
- ])) : b("", !0)
75
+ ])) : L("", !0)
78
76
  ]),
79
77
  _: 1
80
78
  }));
81
79
  }
82
80
  });
83
81
  export {
84
- z as default
82
+ V as default
85
83
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as I, ref as l, createElementBlock as k, openBlock as y, Fragment as w, createVNode as r, renderSlot as g, nextTick as h } from "vue";
1
+ import { defineComponent as I, ref as u, createElementBlock as k, openBlock as y, Fragment as w, createVNode as r, renderSlot as g, nextTick as h } from "vue";
2
2
  import { useToasts as C } from "@scalar/use-toasts";
3
3
  import { useRouter as T } from "vue-router";
4
4
  import { workspaceStoreIsEmpty as $ } from "./utils/workspace-store-is-empty.js";
5
5
  import { useActiveEntities as q } from "../../store/active-entities.js";
6
6
  import E from "./DropEventListener.vue.js";
7
7
  import F from "./ImportCollectionModal.vue.js";
8
- import "./ImportCollectionModal.vue2.js";
8
+ /* empty css */
9
9
  import W from "./PasteEventListener.vue.js";
10
10
  import x from "./UrlQueryParameterChecker.vue.js";
11
11
  import { importCollection as B } from "./utils/import-collection.js";
@@ -13,62 +13,61 @@ import { useWorkspace as M } from "../../store/store.js";
13
13
  const J = /* @__PURE__ */ I({
14
14
  __name: "ImportCollectionListener",
15
15
  setup(N) {
16
- const m = M(), n = l(null), s = l(null), a = l(null);
17
- async function p() {
18
- n.value = null, s.value = null, a.value = null, await h();
16
+ const c = M(), n = u(null), s = u(null), i = u(null);
17
+ async function m() {
18
+ n.value = null, s.value = null, i.value = null, await h();
19
19
  }
20
- async function i(e, t = null, o) {
21
- if (await p(), $(m)) {
20
+ async function a(e, t = null, o) {
21
+ if (await m(), $(c)) {
22
22
  if (console.info("Workspace store is empty, directly importing:", e), await d(e))
23
23
  return;
24
24
  console.warn("Failed to import the collection from:", e);
25
25
  }
26
- n.value = e, s.value = t, a.value = o;
26
+ n.value = e, s.value = t, i.value = o;
27
27
  }
28
- const f = T(), { activeWorkspace: c } = q(), { toast: u } = C();
28
+ const f = T(), { activeWorkspace: p } = q(), { toast: l } = C();
29
29
  async function d(e) {
30
30
  return e ? new Promise((t) => {
31
31
  B({
32
- store: m,
33
- workspace: c.value,
32
+ store: c,
33
+ workspace: p.value,
34
34
  source: e,
35
35
  // Use watch mode by default.
36
36
  watchMode: !0,
37
37
  onSuccess(o) {
38
38
  if (o) {
39
- _(o), u("Import successful", "info"), t(!0);
39
+ _(o), l("Import successful", "info"), t(!0);
40
40
  return;
41
41
  }
42
- u("Import failed: No collection was created", "error"), t(!1);
42
+ l("Import failed: No collection was created", "error"), t(!1);
43
43
  },
44
44
  onError(o) {
45
45
  console.error("[importCollection]", o);
46
- const v = (o == null ? void 0 : o.message) || "Unknown error";
47
- u(`Import failed: ${v}`, "error"), t(!1);
46
+ const v = o?.message || "Unknown error";
47
+ l(`Import failed: ${v}`, "error"), t(!1);
48
48
  }
49
49
  });
50
50
  }) : !1;
51
51
  }
52
52
  function _(e) {
53
- var t;
54
53
  e && f.push({
55
54
  name: "request",
56
55
  params: {
57
- workspace: (t = c.value) == null ? void 0 : t.uid,
58
- request: e == null ? void 0 : e.requests[0]
56
+ workspace: p.value?.uid,
57
+ request: e?.requests[0]
59
58
  }
60
59
  });
61
60
  }
62
61
  return (e, t) => (y(), k(w, null, [
63
62
  r(F, {
64
- eventType: a.value,
63
+ eventType: i.value,
65
64
  integration: s.value,
66
65
  source: n.value,
67
- onImportFinished: p
66
+ onImportFinished: m
68
67
  }, null, 8, ["eventType", "integration", "source"]),
69
- r(W, { onInput: i }),
70
- r(E, { onInput: i }),
71
- r(x, { onInput: i }),
68
+ r(W, { onInput: a }),
69
+ r(E, { onInput: a }),
70
+ r(x, { onInput: a }),
72
71
  g(e.$slots, "default")
73
72
  ], 64));
74
73
  }