@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,34 +1,34 @@
1
- import { defineComponent as H, ref as W, computed as a, watch as _, onMounted as K, onUnmounted as G, createBlock as J, openBlock as l, unref as i, withCtx as Q, createElementBlock as d, createCommentVNode as f, createElementVNode as e, normalizeClass as X, Fragment as b, createVNode as m, toDisplayString as Y, createTextVNode as M } from "vue";
2
- import { useModal as Z, ScalarModal as ee, ScalarIcon as te } from "@scalar/components";
3
- import { isLocalUrl as oe } from "@scalar/oas-utils/helpers";
4
- import { normalize as se } from "@scalar/openapi-parser";
5
- import { getThemeStyles as ne, themeIds as re } from "@scalar/themes";
6
- import { useColorMode as ie } from "@scalar/use-hooks/useColorMode";
7
- import { useRouter as le } from "vue-router";
8
- import ce from "../CommandPalette/WatchModeToggle.vue.js";
9
- import { useUrlPrefetcher as ae } from "./hooks/useUrlPrefetcher.js";
10
- import de from "./ImportNowButton.vue.js";
11
- import me from "./IntegrationLogo.vue.js";
12
- import ue from "./PrefetchError.vue.js";
13
- import { getOpenApiVersion as T } from "./utils/get-openapi-version.js";
14
- import { isDocument as U } from "./utils/is-document.js";
15
- import { isUrl as A } from "./utils/is-url.js";
16
- import fe from "./WorkspaceSelector.vue.js";
17
- import { useActiveEntities as pe } from "../../store/active-entities.js";
18
- import { useWorkspace as ve } from "../../store/store.js";
19
- const he = ["innerHTML"], xe = { class: "relative flex h-screen flex-col justify-center overflow-hidden px-6 md:px-0" }, ye = {
1
+ import { defineComponent as F, ref as R, computed as c, watch as y, onMounted as q, onUnmounted as B, createBlock as H, openBlock as l, unref as i, withCtx as W, createElementBlock as a, createCommentVNode as u, createElementVNode as e, normalizeClass as K, Fragment as g, createVNode as d, toDisplayString as G, createTextVNode as k } from "vue";
2
+ import { useModal as J, ScalarModal as Q, ScalarIcon as X } from "@scalar/components";
3
+ import { isLocalUrl as Y } from "@scalar/oas-utils/helpers";
4
+ import { normalize as Z } from "@scalar/openapi-parser";
5
+ import { getThemeStyles as ee, themeIds as te } from "@scalar/themes";
6
+ import { useColorMode as oe } from "@scalar/use-hooks/useColorMode";
7
+ import { useRouter as se } from "vue-router";
8
+ import ne from "../CommandPalette/WatchModeToggle.vue.js";
9
+ import { useUrlPrefetcher as re } from "./hooks/useUrlPrefetcher.js";
10
+ import ie from "./ImportNowButton.vue.js";
11
+ import le from "./IntegrationLogo.vue.js";
12
+ import ce from "./PrefetchError.vue.js";
13
+ import { getOpenApiVersion as I } from "./utils/get-openapi-version.js";
14
+ import { isDocument as L } from "./utils/is-document.js";
15
+ import { isUrl as M } from "./utils/is-url.js";
16
+ import ae from "./WorkspaceSelector.vue.js";
17
+ import { useActiveEntities as de } from "../../store/active-entities.js";
18
+ import { useWorkspace as me } from "../../store/store.js";
19
+ const ue = ["innerHTML"], fe = { class: "relative flex h-screen flex-col justify-center overflow-hidden px-6 md:px-0" }, pe = {
20
20
  key: 0,
21
21
  class: "mb-2 flex items-center justify-center p-1"
22
- }, ge = { class: "size-10 rounded-xl" }, _e = ["src"], be = {
22
+ }, ve = { class: "size-10 rounded-xl" }, he = ["src"], xe = {
23
23
  key: 2,
24
24
  class: "text-md mb-2 line-clamp-1 text-center font-bold"
25
- }, we = { class: "z-10 inline-flex w-full flex-col items-center gap-2" }, ke = { class: "flex justify-center" }, Ie = { class: "text-c-3 inline-flex items-center px-4 py-1 text-xs font-medium" }, Le = {
25
+ }, ye = { class: "z-10 inline-flex w-full flex-col items-center gap-2" }, ge = { class: "flex justify-center" }, _e = { class: "text-c-3 inline-flex items-center px-4 py-1 text-xs font-medium" }, be = {
26
26
  key: 0,
27
27
  class: "mt-5 overflow-hidden border-t pt-4 text-sm"
28
- }, Me = { class: "flex items-center justify-center" }, Te = { class: "flex flex-col items-center justify-center pb-8" }, Ue = { class: "flex flex-col items-center text-center" }, Ae = { class: "mb-2 flex h-10 w-10 items-center justify-center rounded-[10px] border" }, Ce = {
28
+ }, we = { class: "flex items-center justify-center" }, ke = { class: "flex flex-col items-center justify-center pb-8" }, Ie = { class: "flex flex-col items-center text-center" }, Le = { class: "mb-2 flex h-10 w-10 items-center justify-center rounded-[10px] border" }, Me = {
29
29
  href: "https://scalar.com/download",
30
30
  target: "_blank"
31
- }, Je = /* @__PURE__ */ H({
31
+ }, He = /* @__PURE__ */ F({
32
32
  __name: "ImportCollectionModal",
33
33
  props: {
34
34
  source: {},
@@ -36,181 +36,173 @@ const he = ["innerHTML"], xe = { class: "relative flex h-screen flex-col justify
36
36
  eventType: {}
37
37
  },
38
38
  emits: ["importFinished"],
39
- setup(C, { emit: P }) {
40
- const s = C, V = P, { activeWorkspace: p } = pe(), { workspaceMutators: j, events: D } = ve(), { prefetchResult: n, prefetchUrl: w, resetPrefetchResult: S } = ae(), r = Z(), h = W(!0);
41
- D.hotKeys.on(() => r.hide());
42
- const z = a(() => {
39
+ setup(T, { emit: U }) {
40
+ const s = T, A = U, { activeWorkspace: f } = de(), { workspaceMutators: C, events: P } = me(), { prefetchResult: n, prefetchUrl: _, resetPrefetchResult: V } = re(), r = J(), p = R(!0);
41
+ P.hotKeys.on(() => r.hide());
42
+ const j = c(() => {
43
43
  try {
44
- return se(
44
+ return Z(
45
45
  n.content || s.source || ""
46
46
  );
47
47
  } catch {
48
48
  return;
49
49
  }
50
- }), N = a(() => {
51
- var o, t;
52
- return (t = (o = z.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
53
- }), k = a(
54
- () => T(n.content || s.source || "")
55
- ), { darkLightMode: O } = ie(), { currentRoute: $ } = le(), x = a(() => {
50
+ }), D = c(() => j.value?.info?.title), b = c(
51
+ () => I(n.content || s.source || "")
52
+ ), { darkLightMode: S } = oe(), { currentRoute: z } = se(), v = c(() => {
56
53
  try {
57
- const o = $.value.query, t = O.value === "dark" ? o.dark_logo : o.light_logo;
54
+ const o = z.value.query, t = S.value === "dark" ? o.dark_logo : o.light_logo;
58
55
  if (t)
59
56
  return decodeURIComponent(t);
60
57
  } catch {
61
58
  }
62
59
  return null;
63
60
  });
64
- _(
61
+ y(
65
62
  () => s.source,
66
63
  async (o) => {
67
- var t, c;
68
- if (S(), A(o)) {
64
+ if (V(), M(o)) {
69
65
  if (s.eventType && ["paste", "drop"].includes(s.eventType)) {
70
- const { error: v } = await w(
66
+ const { error: m } = await _(
71
67
  o,
72
- (t = p.value) == null ? void 0 : t.proxyUrl
68
+ f.value?.proxyUrl
73
69
  );
74
- v ? r.hide() : r.show();
70
+ m ? r.hide() : r.show();
75
71
  return;
76
72
  }
77
- w(o, (c = p.value) == null ? void 0 : c.proxyUrl), r.show();
73
+ _(o, f.value?.proxyUrl), r.show();
78
74
  return;
79
75
  }
80
- o && U(o) && T(o) ? r.show() : r.hide();
76
+ o && L(o) && I(o) ? r.show() : r.hide();
81
77
  }
82
78
  );
83
- const E = a(() => !!s.source && A(s.source)), F = a(() => !!s.source && U(s.source)), y = a(() => n.url && oe(n.url)), g = (o) => {
84
- 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");
85
- }, R = () => {
79
+ const N = c(() => !!s.source && M(s.source)), O = c(() => !!s.source && L(s.source)), h = c(() => n.url && Y(n.url)), x = (o) => {
80
+ document.body.classList.remove("has-no-import-url"), (N.value || O.value) && r.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
81
+ }, $ = () => {
86
82
  document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
87
83
  };
88
- _(
84
+ y(
89
85
  () => r.open,
90
86
  (o) => {
91
- o ? g() : R();
87
+ o ? x() : $();
92
88
  }
93
- ), _(
89
+ ), y(
94
90
  () => s.source,
95
91
  () => {
96
- g();
92
+ x();
97
93
  }
98
- ), K(() => {
99
- g();
100
- }), G(() => {
94
+ ), q(() => {
95
+ x();
96
+ }), B(() => {
101
97
  document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
102
98
  });
103
- const I = a(
104
- () => p.value && y.value && s.integration && `<style>${ne(s.integration)}</style>`
99
+ const w = c(
100
+ () => f.value && h.value && s.integration && `<style>${ee(s.integration)}</style>`
105
101
  );
106
- function q() {
107
- var c;
108
- const o = (u) => re.includes(u), t = s.integration && o(s.integration) ? s.integration : "default";
109
- y.value && j.edit(
110
- (c = p.value) == null ? void 0 : c.uid,
102
+ function E() {
103
+ const o = (m) => te.includes(m), t = s.integration && o(s.integration) ? s.integration : "default";
104
+ h.value && C.edit(
105
+ f.value?.uid,
111
106
  "themeId",
112
107
  t
113
- ), V("importFinished");
108
+ ), A("importFinished");
114
109
  }
115
- return (o, t) => (l(), J(i(ee), {
110
+ return (o, t) => (l(), H(i(Q), {
116
111
  size: "full",
117
112
  state: i(r)
118
113
  }, {
119
- default: Q(() => {
120
- var c, u, v, L;
121
- return [
122
- I.value ? (l(), d("div", {
123
- key: 0,
124
- innerHTML: I.value
125
- }, null, 8, he)) : f("", !0),
126
- e("div", xe, [
127
- t[6] || (t[6] = e("div", { class: "section-flare" }, [
128
- e("div", { class: "section-flare-item" }),
129
- e("div", { class: "section-flare-item" }),
130
- e("div", { class: "section-flare-item" }),
131
- e("div", { class: "section-flare-item" }),
132
- e("div", { class: "section-flare-item" }),
133
- e("div", { class: "section-flare-item" }),
134
- e("div", { class: "section-flare-item" }),
135
- e("div", { class: "section-flare-item" })
136
- ], -1)),
137
- e("div", {
138
- class: X(["m-auto flex w-full max-w-[380px] flex-col items-center rounded-xl border px-8 py-8 transition-opacity", { "opacity-0": i(n).state === "loading" }])
139
- }, [
140
- i(n).error && i(n).state === "idle" && !k.value ? (l(), d(b, { key: 0 }, [
141
- t[1] || (t[1] = e("div", { class: "text-md mb-2 line-clamp-1 text-center font-bold" }, " No OpenAPI document found ", -1)),
142
- m(ue, {
143
- url: ((c = i(n)) == null ? void 0 : c.input) || s.source
144
- }, null, 8, ["url"])
145
- ], 64)) : (l(), d(b, { key: 1 }, [
146
- y.value ? (l(), d("div", ye, [
147
- e("div", ge, [
148
- m(me, { integration: o.integration }, null, 8, ["integration"])
114
+ default: W(() => [
115
+ w.value ? (l(), a("div", {
116
+ key: 0,
117
+ innerHTML: w.value
118
+ }, null, 8, ue)) : u("", !0),
119
+ e("div", fe, [
120
+ t[6] || (t[6] = e("div", { class: "section-flare" }, [
121
+ e("div", { class: "section-flare-item" }),
122
+ e("div", { class: "section-flare-item" }),
123
+ e("div", { class: "section-flare-item" }),
124
+ e("div", { class: "section-flare-item" }),
125
+ e("div", { class: "section-flare-item" }),
126
+ e("div", { class: "section-flare-item" }),
127
+ e("div", { class: "section-flare-item" }),
128
+ e("div", { class: "section-flare-item" })
129
+ ], -1)),
130
+ e("div", {
131
+ class: K(["m-auto flex w-full max-w-[380px] flex-col items-center rounded-xl border px-8 py-8 transition-opacity", { "opacity-0": i(n).state === "loading" }])
132
+ }, [
133
+ i(n).error && i(n).state === "idle" && !b.value ? (l(), a(g, { key: 0 }, [
134
+ t[1] || (t[1] = e("div", { class: "text-md mb-2 line-clamp-1 text-center font-bold" }, " No OpenAPI document found ", -1)),
135
+ d(ce, {
136
+ url: i(n)?.input || s.source
137
+ }, null, 8, ["url"])
138
+ ], 64)) : (l(), a(g, { key: 1 }, [
139
+ h.value ? (l(), a("div", pe, [
140
+ e("div", ve, [
141
+ d(le, { integration: o.integration }, null, 8, ["integration"])
142
+ ])
143
+ ])) : v.value ? (l(), a("img", {
144
+ key: 1,
145
+ alt: "Logo",
146
+ class: "mb-2 w-full object-contain",
147
+ src: v.value
148
+ }, null, 8, he)) : u("", !0),
149
+ v.value ? u("", !0) : (l(), a("div", xe, G(D.value || "Untitled Collection"), 1)),
150
+ t[4] || (t[4] = e("div", { class: "text-c-1 text-center text-sm font-medium text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
151
+ b.value ? (l(), a(g, { key: 3 }, [
152
+ e("div", ye, [
153
+ d(ie, {
154
+ source: i(n)?.url ?? i(n)?.content ?? o.source,
155
+ variant: "button",
156
+ watchMode: p.value,
157
+ onImportFinished: E
158
+ }, null, 8, ["source", "watchMode"])
159
+ ]),
160
+ e("div", ge, [
161
+ e("div", _e, [
162
+ t[2] || (t[2] = k(" Import to: ")),
163
+ d(ae)
149
164
  ])
150
- ])) : x.value ? (l(), d("img", {
151
- key: 1,
152
- alt: "Logo",
153
- class: "mb-2 w-full object-contain",
154
- src: x.value
155
- }, null, 8, _e)) : f("", !0),
156
- x.value ? f("", !0) : (l(), d("div", be, Y(N.value || "Untitled Collection"), 1)),
157
- t[4] || (t[4] = e("div", { class: "text-c-1 text-center text-sm font-medium text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
158
- k.value ? (l(), d(b, { key: 3 }, [
165
+ ]),
166
+ i(n)?.url ? (l(), a("div", be, [
159
167
  e("div", we, [
160
- m(de, {
161
- source: ((u = i(n)) == null ? void 0 : u.url) ?? ((v = i(n)) == null ? void 0 : v.content) ?? o.source,
162
- variant: "button",
163
- watchMode: h.value,
164
- onImportFinished: q
165
- }, null, 8, ["source", "watchMode"])
166
- ]),
167
- e("div", ke, [
168
- e("div", Ie, [
169
- t[2] || (t[2] = M(" Import to: ")),
170
- m(fe)
171
- ])
168
+ d(ne, {
169
+ modelValue: p.value,
170
+ "onUpdate:modelValue": t[0] || (t[0] = (m) => p.value = m),
171
+ disableToolTip: !0
172
+ }, null, 8, ["modelValue"])
172
173
  ]),
173
- (L = i(n)) != null && L.url ? (l(), d("div", Le, [
174
- e("div", Me, [
175
- m(ce, {
176
- modelValue: h.value,
177
- "onUpdate:modelValue": t[0] || (t[0] = (B) => h.value = B),
178
- disableToolTip: !0
179
- }, null, 8, ["modelValue"])
180
- ]),
181
- t[3] || (t[3] = e("div", { class: "text-c-3 pt-0 text-center text-xs font-medium text-balance" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
182
- ])) : f("", !0)
183
- ], 64)) : f("", !0)
184
- ], 64))
185
- ], 2),
186
- e("div", Te, [
187
- e("div", Ue, [
188
- e("div", Ae, [
189
- e("a", Ce, [
190
- m(i(te), {
191
- icon: "Logo",
192
- size: "xl"
193
- })
194
- ])
195
- ]),
196
- t[5] || (t[5] = e("span", { class: "text-c-2 text-sm leading-snug font-medium" }, [
197
- e("a", {
198
- class: "hover:text-c-1 mb-1 inline-block underline-offset-2",
199
- href: "https://scalar.com/download",
200
- target: "_blank"
201
- }, " Download Desktop App "),
202
- e("br"),
203
- M(" free · open-source · offline first ")
204
- ], -1))
205
- ])
174
+ t[3] || (t[3] = e("div", { class: "text-c-3 pt-0 text-center text-xs font-medium text-balance" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
175
+ ])) : u("", !0)
176
+ ], 64)) : u("", !0)
177
+ ], 64))
178
+ ], 2),
179
+ e("div", ke, [
180
+ e("div", Ie, [
181
+ e("div", Le, [
182
+ e("a", Me, [
183
+ d(i(X), {
184
+ icon: "Logo",
185
+ size: "xl"
186
+ })
187
+ ])
188
+ ]),
189
+ t[5] || (t[5] = e("span", { class: "text-c-2 text-sm leading-snug font-medium" }, [
190
+ e("a", {
191
+ class: "hover:text-c-1 mb-1 inline-block underline-offset-2",
192
+ href: "https://scalar.com/download",
193
+ target: "_blank"
194
+ }, " Download Desktop App "),
195
+ e("br"),
196
+ k(" free · open-source · offline first ")
197
+ ], -1))
206
198
  ])
207
199
  ])
208
- ];
209
- }),
200
+ ])
201
+ ]),
210
202
  _: 1
211
203
  }, 8, ["state"]));
212
204
  }
213
205
  });
214
206
  export {
215
- Je as default
207
+ He as default
216
208
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./ImportCollectionModal.vue.js";
2
- import "./ImportCollectionModal.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as y, createElementBlock as C, createCommentVNode as h, openBlock as o, Fragment as v, createBlock as u, unref as a, withCtx as m, createTextVNode as p } from "vue";
2
- import { ScalarButton as c } from "@scalar/components";
1
+ import { defineComponent as y, createElementBlock as C, createCommentVNode as h, openBlock as o, Fragment as v, createBlock as u, unref as a, withCtx as m, createTextVNode as c } from "vue";
2
+ import { ScalarButton as p } from "@scalar/components";
3
3
  import { useToasts as b } from "@scalar/use-toasts";
4
4
  import { useRouter as g } from "vue-router";
5
5
  import { useActiveEntities as x } from "../../store/active-entities.js";
@@ -13,48 +13,47 @@ const z = /* @__PURE__ */ y({
13
13
  watchMode: { type: Boolean, default: !0 }
14
14
  },
15
15
  emits: ["importFinished"],
16
- setup(r, { emit: f }) {
17
- const d = f, l = g(), k = I(), { activeWorkspace: s } = x(), { toast: n } = b();
16
+ setup(r, { emit: l }) {
17
+ const f = l, d = g(), k = I(), { activeWorkspace: n } = x(), { toast: s } = b();
18
18
  async function i() {
19
19
  B({
20
20
  store: k,
21
- workspace: s.value,
21
+ workspace: n.value,
22
22
  source: r.source,
23
23
  watchMode: r.watchMode,
24
- onSuccess(t) {
25
- t && (w(t), n("Import successful", "info"), d("importFinished"));
24
+ onSuccess(e) {
25
+ e && (w(e), s("Import successful", "info"), f("importFinished"));
26
26
  },
27
- onError(t) {
28
- console.error("[importCollection]", t);
29
- const e = (t == null ? void 0 : t.message) || "Unknown error";
30
- n(`Import failed: ${e}`, "error");
27
+ onError(e) {
28
+ console.error("[importCollection]", e);
29
+ const t = e?.message || "Unknown error";
30
+ s(`Import failed: ${t}`, "error");
31
31
  }
32
32
  });
33
33
  }
34
- function w(t) {
35
- var e;
36
- t && l.push({
34
+ function w(e) {
35
+ e && d.push({
37
36
  name: "request",
38
37
  params: {
39
- workspace: (e = s.value) == null ? void 0 : e.uid,
40
- request: t == null ? void 0 : t.requests[0]
38
+ workspace: n.value?.uid,
39
+ request: e?.requests[0]
41
40
  }
42
41
  });
43
42
  }
44
- return (t, e) => t.source ? (o(), C(v, { key: 0 }, [
45
- t.variant === "button" ? (o(), u(a(c), {
43
+ return (e, t) => e.source ? (o(), C(v, { key: 0 }, [
44
+ e.variant === "button" ? (o(), u(a(p), {
46
45
  key: 0,
47
46
  class: "mt-3 h-fit w-full rounded-lg px-6 py-2.5 font-bold",
48
47
  size: "md",
49
48
  type: "button",
50
49
  onClick: i
51
50
  }, {
52
- default: m(() => e[0] || (e[0] = [
53
- p(" Import Collection ")
51
+ default: m(() => t[0] || (t[0] = [
52
+ c(" Import Collection ")
54
53
  ])),
55
54
  _: 1,
56
55
  __: [0]
57
- })) : (o(), u(a(c), {
56
+ })) : (o(), u(a(p), {
58
57
  key: 1,
59
58
  class: "h-fit rounded-lg px-6 py-2.5 text-[21px] font-bold",
60
59
  size: "md",
@@ -62,8 +61,8 @@ const z = /* @__PURE__ */ y({
62
61
  variant: "ghost",
63
62
  onClick: i
64
63
  }, {
65
- default: m(() => e[1] || (e[1] = [
66
- p(" Try it in the browser ")
64
+ default: m(() => t[1] || (t[1] = [
65
+ c(" Try it in the browser ")
67
66
  ])),
68
67
  _: 1,
69
68
  __: [1]
@@ -1,12 +1,12 @@
1
- import { defineComponent as i, computed as l, createBlock as p, openBlock as u, unref as f } from "vue";
2
- import { ScalarIcon as g } from "@scalar/components";
3
- const I = /* @__PURE__ */ i({
1
+ import { defineComponent as c, computed as i, createBlock as l, openBlock as p, unref as u } from "vue";
2
+ import { ScalarIcon as f } from "@scalar/components";
3
+ const m = /* @__PURE__ */ c({
4
4
  __name: "IntegrationLogo",
5
5
  props: {
6
6
  integration: {}
7
7
  },
8
- setup(n) {
9
- const a = n, r = [
8
+ setup(e) {
9
+ const n = e, a = [
10
10
  "adonisjs",
11
11
  "dotnet",
12
12
  "elysiajs",
@@ -25,20 +25,19 @@ const I = /* @__PURE__ */ i({
25
25
  "react",
26
26
  "rust",
27
27
  "svelte"
28
- ], s = l(() => {
29
- var e;
30
- const o = "Openapi", t = (e = a.integration) == null ? void 0 : e.toLocaleLowerCase();
28
+ ], r = i(() => {
29
+ const o = "Openapi", t = n.integration?.toLocaleLowerCase();
31
30
  if (!t)
32
31
  return o;
33
- const c = t.charAt(0).toUpperCase() + t.slice(1);
34
- return r.includes(t) ? c : o;
32
+ const s = t.charAt(0).toUpperCase() + t.slice(1);
33
+ return a.includes(t) ? s : o;
35
34
  });
36
- return (o, t) => (u(), p(f(g), {
35
+ return (o, t) => (p(), l(u(f), {
37
36
  class: "h-full w-full rounded-lg",
38
- logo: s.value
37
+ logo: r.value
39
38
  }, null, 8, ["logo"]));
40
39
  }
41
40
  });
42
41
  export {
43
- I as default
42
+ m as default
44
43
  };
@@ -1,25 +1,24 @@
1
- import { defineComponent as c, onMounted as m, onBeforeUnmount as u } from "vue";
2
- const l = /* @__PURE__ */ c({
1
+ import { defineComponent as r, onMounted as c, onBeforeUnmount as m } from "vue";
2
+ const p = /* @__PURE__ */ r({
3
3
  __name: "PasteEventListener",
4
4
  emits: ["input"],
5
- setup(d, { emit: s }) {
6
- const i = s;
7
- m(() => {
5
+ setup(u, { emit: o }) {
6
+ const s = o;
7
+ c(() => {
8
8
  document.addEventListener("paste", n);
9
- }), u(() => {
9
+ }), m(() => {
10
10
  document.removeEventListener("paste", n);
11
11
  });
12
12
  async function n(e) {
13
- var a;
14
- const t = e.target, r = !!((a = document.activeElement) != null && a.classList.contains("cm-content"));
15
- if (!(t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable || r)) && e.clipboardData) {
16
- const o = e.clipboardData.getData("text");
17
- o && i("input", o, null, "paste");
13
+ const t = e.target, i = !!document.activeElement?.classList.contains("cm-content");
14
+ if (!(t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable || i)) && e.clipboardData) {
15
+ const a = e.clipboardData.getData("text");
16
+ a && s("input", a, null, "paste");
18
17
  }
19
18
  }
20
19
  return (e, t) => null;
21
20
  }
22
21
  });
23
22
  export {
24
- l as default
23
+ p as default
25
24
  };