@scalar/api-client 2.5.32 → 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 +20 -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,115 +1,104 @@
1
- import { defineComponent as $, ref as B, computed as A, useTemplateRef as G, createElementBlock as H, openBlock as X, Fragment as J, createElementVNode as s, createVNode as d, withCtx as n, toDisplayString as f, unref as v, normalizeClass as K } from "vue";
2
- import { ScalarListbox as Q, ScalarButton as Y, ScalarIcon as Z } from "@scalar/components";
3
- import { REGEX as _ } from "@scalar/oas-utils/helpers";
4
- import { emitCustomEvent as ee } from "@scalar/workspace-store/events";
5
- import { useRouter as te } from "vue-router";
6
- import ae from "./CommandActionForm.vue.js";
7
- import re from "../HttpMethod/HttpMethod.vue.js";
8
- import { useActiveEntities as se } from "../../store/active-entities.js";
9
- import { PathId as C } from "../../routes.js";
10
- import { useWorkspace as le } from "../../store/store.js";
11
- const oe = { class: "flex h-9 flex-row items-center gap-2 rounded border p-[3px] text-sm" }, ie = { class: "flex h-full" }, ue = { class: "scroll-timeline-x whitespace-nowrap" }, de = { class: "flex" }, we = /* @__PURE__ */ $({
1
+ import { defineComponent as I, ref as D, computed as B, useTemplateRef as O, createElementBlock as V, openBlock as W, Fragment as L, createElementVNode as r, createVNode as o, withCtx as i, toDisplayString as m, unref as c, normalizeClass as M } from "vue";
2
+ import { ScalarListbox as P, ScalarButton as j, ScalarIcon as z } from "@scalar/components";
3
+ import { REGEX as F } from "@scalar/oas-utils/helpers";
4
+ import { emitCustomEvent as N } from "@scalar/workspace-store/events";
5
+ import { useRouter as T } from "vue-router";
6
+ import $ from "./CommandActionForm.vue.js";
7
+ import A from "../HttpMethod/HttpMethod.vue.js";
8
+ import { useActiveEntities as G } from "../../store/active-entities.js";
9
+ import { PathId as p } from "../../routes.js";
10
+ import { useWorkspace as H } from "../../store/store.js";
11
+ const X = { class: "flex h-9 flex-row items-center gap-2 rounded border p-[3px] text-sm" }, J = { class: "flex h-full" }, K = { class: "scroll-timeline-x whitespace-nowrap" }, Q = { class: "flex" }, ie = /* @__PURE__ */ I({
12
12
  __name: "CommandPaletteImportCurl",
13
13
  props: {
14
14
  metaData: {}
15
15
  },
16
16
  emits: ["close", "back"],
17
- setup(a, { emit: O }) {
18
- const V = O, W = le(), { activeWorkspaceCollections: h, activeCollection: L, activeWorkspace: D } = se(), { requestMutators: M, serverMutators: P, servers: j } = W, c = B(""), z = te(), p = A(
19
- () => h.value.map((t) => {
20
- var e;
21
- return {
22
- id: t.uid,
23
- label: ((e = t.info) == null ? void 0 : e.title) ?? "Unititled Collection"
24
- };
25
- })
26
- ), l = B(
27
- a.metaData.collectionUid ? p.value.find(
28
- (t) => t.id === a.metaData.collectionUid
29
- ) : p.value.find(
30
- (t) => {
31
- var e;
32
- return t.id === ((e = L.value) == null ? void 0 : e.uid);
33
- }
17
+ setup(e, { emit: x }) {
18
+ const w = x, b = H(), { activeWorkspaceCollections: f, activeCollection: S, activeWorkspace: v } = G(), { requestMutators: k, serverMutators: q, servers: R } = b, d = D(""), U = T(), n = B(
19
+ () => f.value.map((t) => ({
20
+ id: t.uid,
21
+ label: t.info?.title ?? "Unititled Collection"
22
+ }))
23
+ ), l = D(
24
+ e.metaData.collectionUid ? n.value.find(
25
+ (t) => t.id === e.metaData.collectionUid
26
+ ) : n.value.find(
27
+ (t) => t.id === S.value?.uid
34
28
  )
35
29
  );
36
- function F({ collectionUid: t }) {
37
- var i, u, w, b, S, k, q, R, U, g, E;
38
- if (!a.metaData.parsedCurl)
30
+ function g({ collectionUid: t }) {
31
+ if (!e.metaData.parsedCurl)
39
32
  return;
40
- const e = h.value.find(
41
- (m) => m.uid === t
33
+ const a = f.value.find(
34
+ (u) => u.uid === t
42
35
  );
43
- if (!e)
36
+ if (!a)
44
37
  return;
45
- const r = ((i = e == null ? void 0 : e.info) == null ? void 0 : i.title) === "Drafts";
46
- if (!r && a.metaData.parsedCurl.servers) {
47
- const m = Object.values(j).find(
48
- (T) => {
49
- var y, I;
50
- return T.url === ((I = (y = a.metaData.parsedCurl) == null ? void 0 : y.servers) == null ? void 0 : I[0]);
51
- }
38
+ const s = a?.info?.title === "Drafts";
39
+ if (!s && e.metaData.parsedCurl.servers) {
40
+ const u = Object.values(R).find(
41
+ (y) => y.url === e.metaData.parsedCurl?.servers?.[0]
52
42
  );
53
- m ? c.value = m.uid : (c.value = P.add(
54
- { url: a.metaData.parsedCurl.servers[0] ?? "/" },
55
- e.uid
56
- ).uid, ee((u = N.value) == null ? void 0 : u.$el, "scalar-add-server", {
57
- server: { url: a.metaData.parsedCurl.servers[0] ?? "/" },
43
+ u ? d.value = u.uid : (d.value = q.add(
44
+ { url: e.metaData.parsedCurl.servers[0] ?? "/" },
45
+ a.uid
46
+ ).uid, N(E.value?.$el, "scalar-add-server", {
47
+ server: { url: e.metaData.parsedCurl.servers[0] ?? "/" },
58
48
  options: {
59
49
  disableOldStoreUpdate: !0
60
50
  }
61
51
  }));
62
52
  }
63
- const o = M.add(
53
+ const h = k.add(
64
54
  {
65
- summary: r ? (b = (w = a.metaData.parsedCurl) == null ? void 0 : w.url) == null ? void 0 : b.replace(_.PROTOCOL, "") : (S = a.metaData.parsedCurl) == null ? void 0 : S.path,
66
- path: r ? (k = a.metaData.parsedCurl) == null ? void 0 : k.url : (q = a.metaData.parsedCurl) == null ? void 0 : q.path,
67
- method: (R = a.metaData.parsedCurl) == null ? void 0 : R.method,
68
- parameters: (U = a.metaData.parsedCurl) == null ? void 0 : U.parameters,
69
- selectedServerUid: r ? void 0 : c.value,
70
- requestBody: (g = a.metaData.parsedCurl) == null ? void 0 : g.requestBody
55
+ summary: s ? e.metaData.parsedCurl?.url?.replace(F.PROTOCOL, "") : e.metaData.parsedCurl?.path,
56
+ path: s ? e.metaData.parsedCurl?.url : e.metaData.parsedCurl?.path,
57
+ method: e.metaData.parsedCurl?.method,
58
+ parameters: e.metaData.parsedCurl?.parameters,
59
+ selectedServerUid: s ? void 0 : d.value,
60
+ requestBody: e.metaData.parsedCurl?.requestBody
71
61
  },
72
- e.uid
62
+ a.uid
73
63
  );
74
- o && ((E = D.value) != null && E.uid) && z.push({
64
+ h && v.value?.uid && U.push({
75
65
  name: "request",
76
66
  params: {
77
- [C.Workspace]: D.value.uid,
78
- [C.Collection]: e.uid,
79
- [C.Request]: o.uid
67
+ [p.Workspace]: v.value.uid,
68
+ [p.Collection]: a.uid,
69
+ [p.Request]: h.uid
80
70
  }
81
- }), V("close");
71
+ }), w("close");
82
72
  }
83
- const x = () => {
84
- var t;
85
- F({
86
- collectionUid: ((t = l.value) == null ? void 0 : t.id) ?? ""
73
+ const C = () => {
74
+ g({
75
+ collectionUid: l.value?.id ?? ""
87
76
  });
88
- }, N = G("wrapper-ref");
89
- return (t, e) => (X(), H(J, null, [
90
- e[1] || (e[1] = s("div", { class: "text-c-2 flex-center py-1.5 text-sm" }, "Import cURL", -1)),
91
- d(ae, {
77
+ }, E = O("wrapper-ref");
78
+ return (t, a) => (W(), V(L, null, [
79
+ a[1] || (a[1] = r("div", { class: "text-c-2 flex-center py-1.5 text-sm" }, "Import cURL", -1)),
80
+ o($, {
92
81
  ref: "wrapper-ref",
93
82
  class: "mt-1.5 min-h-fit",
94
- onSubmit: x
83
+ onSubmit: C
95
84
  }, {
96
- options: n(() => [
97
- s("div", de, [
98
- d(v(Q), {
85
+ options: i(() => [
86
+ r("div", Q, [
87
+ o(c(P), {
99
88
  modelValue: l.value,
100
- "onUpdate:modelValue": e[0] || (e[0] = (r) => l.value = r),
101
- options: p.value
89
+ "onUpdate:modelValue": a[0] || (a[0] = (s) => l.value = s),
90
+ options: n.value
102
91
  }, {
103
- default: n(() => [
104
- d(v(Y), {
92
+ default: i(() => [
93
+ o(c(j), {
105
94
  class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
106
95
  variant: "outlined"
107
96
  }, {
108
- default: n(() => [
109
- s("span", {
110
- class: K(["whitespace-nowrap", l.value ? "text-c-1" : "text-c-3"])
111
- }, f(l.value ? l.value.label : "Select Collection"), 3),
112
- d(v(Z), {
97
+ default: i(() => [
98
+ r("span", {
99
+ class: M(["whitespace-nowrap", l.value ? "text-c-1" : "text-c-3"])
100
+ }, m(l.value ? l.value.label : "Select Collection"), 3),
101
+ o(c(z), {
113
102
  class: "text-c-3",
114
103
  icon: "ChevronDown",
115
104
  size: "md"
@@ -122,29 +111,26 @@ const oe = { class: "flex h-9 flex-row items-center gap-2 rounded border p-[3px]
122
111
  }, 8, ["modelValue", "options"])
123
112
  ])
124
113
  ]),
125
- submit: n(() => [
126
- s("span", { onClick: x }, "Import Request")
114
+ submit: i(() => [
115
+ r("span", { onClick: C }, "Import Request")
116
+ ]),
117
+ default: i(() => [
118
+ r("div", X, [
119
+ r("div", J, [
120
+ o(A, {
121
+ isEditable: !1,
122
+ isSquare: "",
123
+ method: t.metaData.parsedCurl?.method || "get"
124
+ }, null, 8, ["method"])
125
+ ]),
126
+ r("span", K, m(t.metaData.parsedCurl?.servers?.[0] || "") + m(t.metaData.parsedCurl?.path || ""), 1)
127
+ ])
127
128
  ]),
128
- default: n(() => {
129
- var r, o, i, u;
130
- return [
131
- s("div", oe, [
132
- s("div", ie, [
133
- d(re, {
134
- isEditable: !1,
135
- isSquare: "",
136
- method: ((r = t.metaData.parsedCurl) == null ? void 0 : r.method) || "get"
137
- }, null, 8, ["method"])
138
- ]),
139
- s("span", ue, f(((i = (o = t.metaData.parsedCurl) == null ? void 0 : o.servers) == null ? void 0 : i[0]) || "") + f(((u = t.metaData.parsedCurl) == null ? void 0 : u.path) || ""), 1)
140
- ])
141
- ];
142
- }),
143
129
  _: 1
144
130
  }, 512)
145
131
  ], 64));
146
132
  }
147
133
  });
148
134
  export {
149
- we as default
135
+ ie as default
150
136
  };
@@ -1,110 +1,100 @@
1
- import { defineComponent as h, ref as f, computed as B, useTemplateRef as E, createBlock as u, openBlock as m, withCtx as r, createVNode as d, createTextVNode as M, unref as s, createElementVNode as b, normalizeClass as R, toDisplayString as $ } from "vue";
2
- import { ScalarListbox as j, ScalarButton as C, ScalarIcon as z } from "@scalar/components";
3
- import { useToasts as I } from "@scalar/use-toasts";
4
- import { emitCustomEvent as L } from "@scalar/workspace-store/events";
5
- import { useRouter as O } from "vue-router";
6
- import { useActiveEntities as W } from "../../store/active-entities.js";
7
- import A from "./CommandActionForm.vue.js";
8
- import q from "./CommandActionInput.vue.js";
9
- import { PathId as x } from "../../routes.js";
10
- import { useWorkspace as F } from "../../store/store.js";
11
- const oe = /* @__PURE__ */ h({
1
+ import { defineComponent as T, ref as v, computed as h, useTemplateRef as B, createBlock as u, openBlock as m, withCtx as l, createVNode as d, createTextVNode as E, unref as s, createElementVNode as f, normalizeClass as M, toDisplayString as R } from "vue";
2
+ import { ScalarListbox as $, ScalarButton as b, ScalarIcon as j } from "@scalar/components";
3
+ import { useToasts as z } from "@scalar/use-toasts";
4
+ import { emitCustomEvent as I } from "@scalar/workspace-store/events";
5
+ import { useRouter as L } from "vue-router";
6
+ import { useActiveEntities as O } from "../../store/active-entities.js";
7
+ import W from "./CommandActionForm.vue.js";
8
+ import A from "./CommandActionInput.vue.js";
9
+ import { PathId as C } from "../../routes.js";
10
+ import { useWorkspace as q } from "../../store/store.js";
11
+ const te = /* @__PURE__ */ T({
12
12
  __name: "CommandPaletteServer",
13
13
  props: {
14
14
  metaData: {}
15
15
  },
16
16
  emits: ["close", "back"],
17
- setup(S, { emit: k }) {
18
- const n = S, c = k, w = O(), { toast: p } = I(), { activeCollection: V, activeWorkspaceCollections: g } = W(), {
19
- collectionMutators: D,
20
- serverMutators: U,
21
- events: _,
22
- collections: y
23
- } = F(), l = f(""), i = B(
24
- () => g.value.flatMap(
25
- (t) => {
26
- var e, o;
27
- return ((e = t.info) == null ? void 0 : e.title) === "Drafts" ? [] : {
28
- id: t.uid,
29
- label: ((o = t.info) == null ? void 0 : o.title) ?? "Unititled Collection"
30
- };
17
+ setup(x, { emit: S }) {
18
+ const n = x, c = S, k = L(), { toast: p } = z(), { activeCollection: w, activeWorkspaceCollections: V } = O(), {
19
+ collectionMutators: g,
20
+ serverMutators: D,
21
+ events: U,
22
+ collections: _
23
+ } = q(), a = v(""), i = h(
24
+ () => V.value.flatMap(
25
+ (e) => e.info?.title === "Drafts" ? [] : {
26
+ id: e.uid,
27
+ label: e.info?.title ?? "Unititled Collection"
31
28
  }
32
29
  )
33
- ), a = f(
30
+ ), o = v(
34
31
  n.metaData ? i.value.find(
35
- (t) => {
36
- var e, o;
37
- return t.id === ((e = n.metaData) == null ? void 0 : e.itemUid) || t.id === ((o = n.metaData) == null ? void 0 : o.parentUid);
38
- }
32
+ (e) => e.id === n.metaData?.itemUid || e.id === n.metaData?.parentUid
39
33
  ) : i.value.find(
40
- (t) => {
41
- var e;
42
- return t.id === ((e = V.value) == null ? void 0 : e.uid);
43
- }
34
+ (e) => e.id === w.value?.uid
44
35
  )
45
- ), P = () => {
46
- var o, v;
47
- if (!l.value.trim()) {
36
+ ), y = () => {
37
+ if (!a.value.trim()) {
48
38
  p("Please enter a valid url before creating a server.", "error");
49
39
  return;
50
40
  }
51
- const t = y[((o = a.value) == null ? void 0 : o.id) ?? ""];
52
- if (!t) {
41
+ const e = _[o.value?.id ?? ""];
42
+ if (!e) {
53
43
  p("Please select a collection before creating a server.", "error");
54
44
  return;
55
45
  }
56
- const e = U.add({ url: l.value }, t.uid);
57
- D.edit(t.uid, "selectedServerUid", e.uid), L((v = T.value) == null ? void 0 : v.$el, "scalar-add-server", {
58
- server: { url: l.value },
46
+ const t = D.add({ url: a.value }, e.uid);
47
+ g.edit(e.uid, "selectedServerUid", t.uid), I(N.value?.$el, "scalar-add-server", {
48
+ server: { url: a.value },
59
49
  options: {
60
50
  disableOldStoreUpdate: !0
61
51
  }
62
- }), w.push({
52
+ }), k.push({
63
53
  name: "collection.servers.edit",
64
54
  params: {
65
- [x.Collection]: t.uid,
66
- [x.Servers]: e.uid
55
+ [C.Collection]: e.uid,
56
+ [C.Servers]: t.uid
67
57
  }
68
58
  }), c("close");
69
- }, N = () => {
70
- _.commandPalette.emit({ commandName: "Create Collection" });
71
- }, T = E("wrapper-ref");
72
- return (t, e) => (m(), u(A, {
59
+ }, P = () => {
60
+ U.commandPalette.emit({ commandName: "Create Collection" });
61
+ }, N = B("wrapper-ref");
62
+ return (e, t) => (m(), u(W, {
73
63
  ref: "wrapper-ref",
74
- disabled: !l.value.trim() || !a.value,
75
- onSubmit: P
64
+ disabled: !a.value.trim() || !o.value,
65
+ onSubmit: y
76
66
  }, {
77
- options: r(() => [
78
- d(s(j), {
79
- modelValue: a.value,
80
- "onUpdate:modelValue": e[2] || (e[2] = (o) => a.value = o),
67
+ options: l(() => [
68
+ d(s($), {
69
+ modelValue: o.value,
70
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => o.value = r),
81
71
  options: i.value
82
72
  }, {
83
- default: r(() => [
84
- i.value.length > 0 ? (m(), u(s(C), {
73
+ default: l(() => [
74
+ i.value.length > 0 ? (m(), u(s(b), {
85
75
  key: 0,
86
76
  class: "hover:bg-b-2 max-h-8 w-fit justify-between gap-1 p-2 text-xs",
87
77
  variant: "outlined"
88
78
  }, {
89
- default: r(() => [
90
- b("span", {
91
- class: R(a.value ? "text-c-1" : "text-c-3")
92
- }, $(a.value ? a.value.label : "Select Collection"), 3),
93
- d(s(z), {
79
+ default: l(() => [
80
+ f("span", {
81
+ class: M(o.value ? "text-c-1" : "text-c-3")
82
+ }, R(o.value ? o.value.label : "Select Collection"), 3),
83
+ d(s(j), {
94
84
  class: "text-c-3",
95
85
  icon: "ChevronDown",
96
86
  size: "md"
97
87
  })
98
88
  ]),
99
89
  _: 1
100
- })) : (m(), u(s(C), {
90
+ })) : (m(), u(s(b), {
101
91
  key: 1,
102
92
  class: "hover:bg-b-2 max-h-8 w-fit justify-between gap-1 p-2 text-xs",
103
93
  variant: "outlined",
104
- onClick: N
94
+ onClick: P
105
95
  }, {
106
- default: r(() => e[3] || (e[3] = [
107
- b("span", { class: "text-c-1" }, "Create Collection", -1)
96
+ default: l(() => t[3] || (t[3] = [
97
+ f("span", { class: "text-c-1" }, "Create Collection", -1)
108
98
  ])),
109
99
  _: 1,
110
100
  __: [3]
@@ -113,16 +103,16 @@ const oe = /* @__PURE__ */ h({
113
103
  _: 1
114
104
  }, 8, ["modelValue", "options"])
115
105
  ]),
116
- submit: r(() => e[4] || (e[4] = [
117
- M(" Create Server ")
106
+ submit: l(() => t[4] || (t[4] = [
107
+ E(" Create Server ")
118
108
  ])),
119
- default: r(() => [
120
- d(q, {
121
- modelValue: l.value,
122
- "onUpdate:modelValue": e[0] || (e[0] = (o) => l.value = o),
109
+ default: l(() => [
110
+ d(A, {
111
+ modelValue: a.value,
112
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => a.value = r),
123
113
  label: "Server URL",
124
114
  placeholder: "https://void.scalar.com",
125
- onOnDelete: e[1] || (e[1] = (o) => c("back", o))
115
+ onOnDelete: t[1] || (t[1] = (r) => c("back", r))
126
116
  }, null, 8, ["modelValue"])
127
117
  ]),
128
118
  _: 1
@@ -130,5 +120,5 @@ const oe = /* @__PURE__ */ h({
130
120
  }
131
121
  });
132
122
  export {
133
- oe as default
123
+ te as default
134
124
  };
@@ -10,19 +10,13 @@ const O = /* @__PURE__ */ g({
10
10
  emits: ["close", "back"],
11
11
  setup(U, { emit: d }) {
12
12
  const r = d, { activeWorkspaceCollections: c, activeCollection: p } = y(), { tagMutators: f } = P(), { toast: v } = D(), u = x(
13
- () => c.value.map((o) => {
14
- var e;
15
- return {
16
- id: o.uid,
17
- label: ((e = o.info) == null ? void 0 : e.title) ?? ""
18
- };
19
- })
13
+ () => c.value.map((o) => ({
14
+ id: o.uid,
15
+ label: o.info?.title ?? ""
16
+ }))
20
17
  ), a = m(""), t = m(
21
18
  u.value.find(
22
- (o) => {
23
- var e;
24
- return o.id === ((e = p.value) == null ? void 0 : e.uid);
25
- }
19
+ (o) => o.id === p.value?.uid
26
20
  )
27
21
  ), b = () => {
28
22
  if (!a.value) {
@@ -1,6 +1,6 @@
1
1
  import o from "./TheCommandPalette.vue2.js";
2
2
  import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
3
- import "./TheCommandPalette.vue3.js";
3
+ /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
5
  const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f2bbd082"]]);
6
6
  export {