@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,11 +1,11 @@
1
- import { defineComponent as y, ref as m, computed as h, watch as w, createBlock as u, openBlock as v, unref as s, withCtx as a, createVNode as r, createElementVNode as p, createTextVNode as I, normalizeClass as E, toDisplayString as N } from "vue";
2
- import { ScalarModal as T, ScalarListbox as $, ScalarButton as x, ScalarIcon as z } from "@scalar/components";
3
- import { useToasts as B } from "@scalar/use-toasts";
4
- import D from "../../components/CommandPalette/CommandActionForm.vue.js";
5
- import P from "../../components/CommandPalette/CommandActionInput.vue.js";
6
- import U from "./EnvironmentColors.vue.js";
7
- import { useWorkspace as W } from "../../store/store.js";
8
- const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ y({
1
+ import { defineComponent as k, ref as m, computed as y, watch as h, createBlock as u, openBlock as v, unref as i, withCtx as o, createVNode as s, createElementVNode as p, createTextVNode as w, normalizeClass as I, toDisplayString as E } from "vue";
2
+ import { ScalarModal as N, ScalarListbox as T, ScalarButton as C, ScalarIcon as $ } from "@scalar/components";
3
+ import { useToasts as z } from "@scalar/use-toasts";
4
+ import B from "../../components/CommandPalette/CommandActionForm.vue.js";
5
+ import D from "../../components/CommandPalette/CommandActionInput.vue.js";
6
+ import P from "./EnvironmentColors.vue.js";
7
+ import { useWorkspace as U } from "../../store/store.js";
8
+ const W = { class: "flex items-start gap-2" }, J = /* @__PURE__ */ k({
9
9
  __name: "EnvironmentModal",
10
10
  props: {
11
11
  state: {},
@@ -13,92 +13,85 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ y({
13
13
  collectionId: {}
14
14
  },
15
15
  emits: ["cancel", "submit"],
16
- setup(g, { emit: F }) {
17
- const n = g, f = F, { events: S } = W(), i = m(""), c = m("#FFFFFF"), d = h(() => [
18
- ...n.activeWorkspaceCollections.filter((t) => {
19
- var e;
20
- return ((e = t.info) == null ? void 0 : e.title) !== "Drafts";
21
- }).map((t) => {
22
- var e;
23
- return {
24
- id: t.uid,
25
- label: ((e = t.info) == null ? void 0 : e.title) ?? "Untitled Collection"
26
- };
27
- })
28
- ]), l = m(
29
- d.value.find((t) => t.id === n.collectionId)
30
- ), { toast: b } = B(), _ = (t) => {
31
- c.value = t;
16
+ setup(x, { emit: g }) {
17
+ const a = x, f = g, { events: F } = U(), n = m(""), r = m("#FFFFFF"), c = y(() => [
18
+ ...a.activeWorkspaceCollections.filter((t) => t.info?.title !== "Drafts").map((t) => ({
19
+ id: t.uid,
20
+ label: t.info?.title ?? "Untitled Collection"
21
+ }))
22
+ ]), e = m(
23
+ c.value.find((t) => t.id === a.collectionId)
24
+ ), { toast: b } = z(), S = (t) => {
25
+ r.value = t;
32
26
  };
33
- w(
34
- () => n.state.open,
27
+ h(
28
+ () => a.state.open,
35
29
  (t) => {
36
- t && (i.value = "", c.value = "#FFFFFF", n.collectionId ? l.value = d.value.find(
37
- (e) => e.id === n.collectionId
38
- ) : l.value = void 0);
30
+ t && (n.value = "", r.value = "#FFFFFF", a.collectionId ? e.value = c.value.find(
31
+ (l) => l.id === a.collectionId
32
+ ) : e.value = void 0);
39
33
  }
40
34
  );
41
- const V = () => {
42
- var t, e, o, C;
43
- if (!i.value.trim()) {
35
+ const _ = () => {
36
+ if (!n.value.trim()) {
44
37
  b("Please enter a name before adding an environment.", "error");
45
38
  return;
46
39
  }
47
- if (!((t = l.value) != null && t.id)) {
40
+ if (!e.value?.id) {
48
41
  b("Please select a collection before adding an environment.", "error");
49
42
  return;
50
43
  }
51
44
  f("submit", {
52
- name: i.value,
53
- color: c.value,
54
- type: ((e = l.value) == null ? void 0 : e.id) === "global" ? "global" : "collection",
55
- collectionId: ((o = l.value) == null ? void 0 : o.id) !== "global" ? (C = l.value) == null ? void 0 : C.id : void 0
45
+ name: n.value,
46
+ color: r.value,
47
+ type: e.value?.id === "global" ? "global" : "collection",
48
+ collectionId: e.value?.id !== "global" ? e.value?.id : void 0
56
49
  });
57
- }, k = () => {
58
- n.state.hide(), S.commandPalette.emit({ commandName: "Create Collection" });
50
+ }, V = () => {
51
+ a.state.hide(), F.commandPalette.emit({ commandName: "Create Collection" });
59
52
  };
60
- return (t, e) => (v(), u(s(T), {
53
+ return (t, l) => (v(), u(i(N), {
61
54
  bodyClass: "border-t-0 rounded-t-lg",
62
55
  size: "xs",
63
56
  state: t.state
64
57
  }, {
65
- default: a(() => [
66
- r(D, {
67
- disabled: !l.value || !i.value.trim(),
68
- onCancel: e[2] || (e[2] = (o) => f("cancel")),
69
- onSubmit: V
58
+ default: o(() => [
59
+ s(B, {
60
+ disabled: !e.value || !n.value.trim(),
61
+ onCancel: l[2] || (l[2] = (d) => f("cancel")),
62
+ onSubmit: _
70
63
  }, {
71
- options: a(() => [
72
- r(s($), {
73
- modelValue: l.value,
74
- "onUpdate:modelValue": e[1] || (e[1] = (o) => l.value = o),
75
- options: d.value,
64
+ options: o(() => [
65
+ s(i(T), {
66
+ modelValue: e.value,
67
+ "onUpdate:modelValue": l[1] || (l[1] = (d) => e.value = d),
68
+ options: c.value,
76
69
  placeholder: "Select Type"
77
70
  }, {
78
- default: a(() => [
79
- d.value.length > 0 ? (v(), u(s(x), {
71
+ default: o(() => [
72
+ c.value.length > 0 ? (v(), u(i(C), {
80
73
  key: 0,
81
74
  class: "hover:bg-b-2 max-h-8 w-fit justify-between gap-1 p-2 text-xs",
82
75
  variant: "outlined"
83
76
  }, {
84
- default: a(() => [
77
+ default: o(() => [
85
78
  p("span", {
86
- class: E(l.value ? "text-c-1" : "text-c-3")
87
- }, N(l.value ? l.value.label : "Select Collection"), 3),
88
- r(s(z), {
79
+ class: I(e.value ? "text-c-1" : "text-c-3")
80
+ }, E(e.value ? e.value.label : "Select Collection"), 3),
81
+ s(i($), {
89
82
  class: "text-c-3",
90
83
  icon: "ChevronDown",
91
84
  size: "xs"
92
85
  })
93
86
  ]),
94
87
  _: 1
95
- })) : (v(), u(s(x), {
88
+ })) : (v(), u(i(C), {
96
89
  key: 1,
97
90
  class: "hover:bg-b-2 max-h-8 justify-between gap-1 p-2 text-xs",
98
91
  variant: "outlined",
99
- onClick: k
92
+ onClick: V
100
93
  }, {
101
- default: a(() => e[3] || (e[3] = [
94
+ default: o(() => l[3] || (l[3] = [
102
95
  p("span", { class: "text-c-1" }, "Create Collection", -1)
103
96
  ])),
104
97
  _: 1,
@@ -108,20 +101,20 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ y({
108
101
  _: 1
109
102
  }, 8, ["modelValue", "options"])
110
103
  ]),
111
- submit: a(() => e[4] || (e[4] = [
112
- I(" Add Environment ")
104
+ submit: o(() => l[4] || (l[4] = [
105
+ w(" Add Environment ")
113
106
  ])),
114
- default: a(() => [
115
- p("div", j, [
116
- r(U, {
117
- activeColor: c.value,
107
+ default: o(() => [
108
+ p("div", W, [
109
+ s(P, {
110
+ activeColor: r.value,
118
111
  class: "peer",
119
112
  selector: "",
120
- onSelect: _
113
+ onSelect: S
121
114
  }, null, 8, ["activeColor"]),
122
- r(P, {
123
- modelValue: i.value,
124
- "onUpdate:modelValue": e[0] || (e[0] = (o) => i.value = o),
115
+ s(D, {
116
+ modelValue: n.value,
117
+ "onUpdate:modelValue": l[0] || (l[0] = (d) => n.value = d),
125
118
  class: "-mt-[.5px] !p-0 peer-has-[.color-selector]:hidden",
126
119
  placeholder: "Environment name"
127
120
  }, null, 8, ["modelValue"])
@@ -135,5 +128,5 @@ const j = { class: "flex items-start gap-2" }, K = /* @__PURE__ */ y({
135
128
  }
136
129
  });
137
130
  export {
138
- K as default
131
+ J as default
139
132
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as B, ref as v, computed as w, onMounted as R, createBlock as h, createCommentVNode as y, openBlock as r, unref as s, withCtx as k, createElementVNode as c, normalizeStyle as x, createElementBlock as u, Fragment as D, renderList as T, normalizeClass as j, createTextVNode as g, toDisplayString as V, createVNode as q } from "vue";
1
+ import { defineComponent as B, ref as v, computed as w, onMounted as R, createBlock as h, createCommentVNode as y, openBlock as n, unref as l, withCtx as k, createElementVNode as c, normalizeStyle as x, createElementBlock as u, Fragment as D, renderList as T, normalizeClass as j, createTextVNode as g, toDisplayString as V, createVNode as q } from "vue";
2
2
  import { ScalarTeleport as F, ScalarButton as G } from "@scalar/components";
3
3
  import { ScalarIconGlobe as K, ScalarIconPlus as O } from "@scalar/icons";
4
4
  import { onClickOutside as L } from "@vueuse/core";
@@ -21,15 +21,14 @@ const H = {
21
21
  },
22
22
  emits: ["select"],
23
23
  setup(S, { expose: E, emit: z }) {
24
- const a = S, I = z, d = v(!0), p = v(null), l = v(0), f = Q(), { activeCollection: m } = $(), N = () => {
25
- var n;
24
+ const s = S, I = z, d = v(!0), p = v(null), r = v(0), f = Q(), { activeCollection: m } = $(), N = () => {
26
25
  if (!f)
27
26
  return;
28
- const { currentRoute: e, push: o } = f, t = e.value.params.workspace;
29
- !m.value || ((n = m.value.info) == null ? void 0 : n.title) === "Drafts" ? o({
27
+ const { currentRoute: t, push: o } = f, e = t.value.params.workspace;
28
+ !m.value || m.value.info?.title === "Drafts" ? o({
30
29
  name: "environment.default",
31
30
  params: {
32
- [_.Workspace]: t
31
+ [_.Workspace]: e
33
32
  }
34
33
  }) : o({
35
34
  name: "collection.environment",
@@ -37,46 +36,43 @@ const H = {
37
36
  [_.Collection]: m.value.uid
38
37
  }
39
38
  }), d.value = !1;
40
- }, P = new M(C(a.envVariables), {
39
+ }, P = new M(C(s.envVariables), {
41
40
  keys: ["key", "value"]
42
41
  }), i = w(() => {
43
- const e = a.query;
44
- if (!e)
45
- return C(a.envVariables).slice(-4).filter(({ key: t, value: n }) => t !== "" || n !== "");
46
- const o = P.search(e, { limit: 10 });
47
- return o.length > 0 ? o.map((t) => t.item).filter(({ key: t, value: n }) => t !== "" || n !== "") : [];
48
- }), b = (e) => {
49
- I("select", e);
42
+ const t = s.query;
43
+ if (!t)
44
+ return C(s.envVariables).slice(-4).filter(({ key: e, value: a }) => e !== "" || a !== "");
45
+ const o = P.search(t, { limit: 10 });
46
+ return o.length > 0 ? o.map((e) => e.item).filter(({ key: e, value: a }) => e !== "" || a !== "") : [];
47
+ }), b = (t) => {
48
+ I("select", t);
50
49
  };
51
50
  E({
52
- handleArrowKey: (e) => {
53
- const o = e === "up" ? -1 : 1, t = i.value.length;
54
- t !== 0 && (l.value = (l.value + o + t) % t);
51
+ handleArrowKey: (t) => {
52
+ const o = t === "up" ? -1 : 1, e = i.value.length;
53
+ e !== 0 && (r.value = (r.value + o + e) % e);
55
54
  },
56
55
  handleSelect: () => {
57
- if (l.value >= 0) {
58
- const e = i.value[l.value];
59
- e && b(e.key);
56
+ if (r.value >= 0) {
57
+ const t = i.value[r.value];
58
+ t && b(t.key);
60
59
  }
61
60
  }
62
61
  }), R(() => {
63
- l.value = 0;
64
- });
65
- const A = w(() => {
66
- var e, o;
67
- return {
68
- left: (((e = a.dropdownPosition) == null ? void 0 : e.left) ?? 0) + "px",
69
- // Add a 5px offset from the editor
70
- top: (((o = a.dropdownPosition) == null ? void 0 : o.top) ?? 0) + 5 + "px"
71
- };
62
+ r.value = 0;
72
63
  });
64
+ const A = w(() => ({
65
+ left: (s.dropdownPosition?.left ?? 0) + "px",
66
+ // Add a 5px offset from the editor
67
+ top: (s.dropdownPosition?.top ?? 0) + 5 + "px"
68
+ }));
73
69
  return L(
74
70
  p,
75
71
  () => {
76
72
  d.value = !1;
77
73
  },
78
74
  { ignore: [p] }
79
- ), (e, o) => d.value ? (r(), h(s(F), {
75
+ ), (t, o) => d.value ? (n(), h(l(F), {
80
76
  key: 0,
81
77
  class: "scalar-client"
82
78
  }, {
@@ -87,36 +83,36 @@ const H = {
87
83
  class: "custom-scroll fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75",
88
84
  style: x(A.value)
89
85
  }, [
90
- i.value.length ? (r(), u("ul", H, [
91
- (r(!0), u(D, null, T(i.value, (t, n) => (r(), u("li", {
92
- key: t.key,
93
- class: j(["font-code text-xxs hover:bg-b-2 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2": n === l.value }]),
94
- onClick: (ee) => b(t.key)
86
+ i.value.length ? (n(), u("ul", H, [
87
+ (n(!0), u(D, null, T(i.value, (e, a) => (n(), u("li", {
88
+ key: e.key,
89
+ class: j(["font-code text-xxs hover:bg-b-2 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2": a === r.value }]),
90
+ onClick: (ee) => b(e.key)
95
91
  }, [
96
92
  c("div", U, [
97
- t.source === "collection" && e.environment.name !== "No Environment" ? (r(), u("span", {
93
+ e.source === "collection" && t.environment.name !== "No Environment" ? (n(), u("span", {
98
94
  key: 0,
99
95
  class: "h-2.25 w-2.25 min-w-2.25 rounded-full",
100
96
  style: x({
101
- backgroundColor: s(W)(e.environment)
97
+ backgroundColor: l(W)(t.environment)
102
98
  })
103
- }, null, 4)) : (r(), h(s(K), {
99
+ }, null, 4)) : (n(), h(l(K), {
104
100
  key: 1,
105
101
  class: "-ml-0.25 size-2.5",
106
102
  icon: "Globe"
107
103
  })),
108
- g(" " + V(t.key), 1)
104
+ g(" " + V(e.key), 1)
109
105
  ]),
110
- c("span", X, V(t.value), 1)
106
+ c("span", X, V(e.value), 1)
111
107
  ], 10, J))), 128))
112
- ])) : s(f) ? (r(), h(s(G), {
108
+ ])) : l(f) ? (n(), h(l(G), {
113
109
  key: 1,
114
110
  class: "font-code text-xxs bg-b-inherit hover:bg-b-2 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150",
115
111
  variant: "outlined",
116
112
  onClick: N
117
113
  }, {
118
114
  default: k(() => [
119
- q(s(O), { class: "size-3" }),
115
+ q(l(O), { class: "size-3" }),
120
116
  o[0] || (o[0] = g(" Add Variable "))
121
117
  ]),
122
118
  _: 1,
@@ -1,5 +1,5 @@
1
1
  import o from "./Request.vue2.js";
2
- import "./Request.vue3.js";
2
+ /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0100effe"]]);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { defineComponent as E, computed as U, createElementBlock as f, createBlock as u, unref as e, openBlock as s, normalizeClass as k, createElementVNode as P, createVNode as c, isRef as W, withCtx as y, createCommentVNode as H } from "vue";
2
- import S from "../../components/EmptyState.vue.js";
1
+ import { defineComponent as E, computed as U, createElementBlock as v, createBlock as m, unref as e, openBlock as r, normalizeClass as f, createElementVNode as P, createVNode as n, isRef as W, withCtx as k, createCommentVNode as H } from "vue";
2
+ import y from "../../components/EmptyState.vue.js";
3
3
  import N from "../../components/ViewLayout/ViewLayout.vue.js";
4
4
  import g from "../../components/ViewLayout/ViewLayoutContent.vue.js";
5
5
  import { useSidebar as B } from "../../hooks/useSidebar.js";
@@ -8,7 +8,7 @@ import { useActiveEntities as L } from "../../store/active-entities.js";
8
8
  import z from "./RequestSection/RequestSection.vue.js";
9
9
  import A from "./RequestSubpageHeader.vue.js";
10
10
  import D from "./ResponseSection/ResponseSection.vue.js";
11
- import { useWorkspace as b } from "../../store/store.js";
11
+ import { useWorkspace as S } from "../../store/store.js";
12
12
  import { useLayout as M } from "../../hooks/useLayout.js";
13
13
  const O = { class: "flex h-full" }, T = {
14
14
  key: 0,
@@ -22,89 +22,82 @@ const O = { class: "flex h-full" }, T = {
22
22
  },
23
23
  emits: ["newTab"],
24
24
  setup($) {
25
- const { events: R } = b(), { isSidebarOpen: a } = B(), q = b(), { layout: h } = M(), {
26
- activeCollection: r,
27
- activeExample: m,
28
- activeRequest: l,
29
- activeWorkspace: i,
30
- activeServer: p,
31
- activeEnvVariables: d,
32
- activeEnvironment: v,
33
- activeWorkspaceRequests: x
34
- } = L(), { modalState: C, requestHistory: V } = q, w = U(
35
- () => [...V].reverse().find((t) => {
36
- var o;
37
- return t.request.uid === ((o = m.value) == null ? void 0 : o.uid);
38
- })
25
+ const { events: b } = S(), { isSidebarOpen: s } = B(), R = S(), { layout: q } = M(), {
26
+ activeCollection: t,
27
+ activeExample: c,
28
+ activeRequest: a,
29
+ activeWorkspace: l,
30
+ activeServer: u,
31
+ activeEnvVariables: p,
32
+ activeEnvironment: d,
33
+ activeWorkspaceRequests: h
34
+ } = L(), { modalState: x, requestHistory: C } = R, V = U(
35
+ () => [...C].reverse().find((o) => o.request.uid === c.value?.uid)
39
36
  );
40
- function _(t) {
41
- var o;
42
- R.commandPalette.emit({
37
+ function w(o) {
38
+ b.commandPalette.emit({
43
39
  commandName: "Import from cURL",
44
40
  metaData: {
45
- parsedCurl: I(t),
46
- collectionUid: (o = r.value) == null ? void 0 : o.uid
41
+ parsedCurl: I(o),
42
+ collectionUid: t.value?.uid
47
43
  }
48
44
  });
49
45
  }
50
- return (t, o) => e(r) && e(i) ? (s(), f("div", {
46
+ return (o, i) => e(t) && e(l) ? (r(), v("div", {
51
47
  key: 0,
52
- class: k(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
53
- "!mr-0 !mb-0 !border-0": e(h) === "modal"
48
+ class: f(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
49
+ "!mr-0 !mb-0 !border-0": e(q) === "modal"
54
50
  }])
55
51
  }, [
56
52
  P("div", O, [
57
- e(l) ? (s(), f("div", T, [
58
- c(A, {
59
- modelValue: e(a),
60
- "onUpdate:modelValue": o[0] || (o[0] = (n) => W(a) ? a.value = n : null),
61
- collection: e(r),
62
- envVariables: e(d),
63
- environment: e(v),
64
- operation: e(l),
65
- server: e(p),
66
- workspace: e(i),
67
- onHideModal: o[1] || (o[1] = () => e(C).hide()),
68
- onImportCurl: _
53
+ e(a) ? (r(), v("div", T, [
54
+ n(A, {
55
+ modelValue: e(s),
56
+ "onUpdate:modelValue": i[0] || (i[0] = (_) => W(s) ? s.value = _ : null),
57
+ collection: e(t),
58
+ envVariables: e(p),
59
+ environment: e(d),
60
+ operation: e(a),
61
+ server: e(u),
62
+ workspace: e(l),
63
+ onHideModal: i[1] || (i[1] = () => e(x).hide()),
64
+ onImportCurl: w
69
65
  }, null, 8, ["modelValue", "collection", "envVariables", "environment", "operation", "server", "workspace"]),
70
- c(N, null, {
71
- default: y(() => [
72
- e(m) ? (s(), u(g, {
66
+ n(N, null, {
67
+ default: k(() => [
68
+ e(c) ? (r(), m(g, {
73
69
  key: 0,
74
- class: k(["flex-1", [e(a) ? "sidebar-active-hide-layout" : ""]])
70
+ class: f(["flex-1", [e(s) ? "sidebar-active-hide-layout" : ""]])
75
71
  }, {
76
- default: y(() => {
77
- var n;
78
- return [
79
- c(z, {
80
- collection: e(r),
81
- envVariables: e(d),
82
- environment: e(v),
83
- example: e(m),
84
- invalidParams: t.invalidParams,
85
- operation: e(l),
86
- selectedSecuritySchemeUids: t.selectedSecuritySchemeUids,
87
- server: e(p),
88
- workspace: e(i)
89
- }, null, 8, ["collection", "envVariables", "environment", "example", "invalidParams", "operation", "selectedSecuritySchemeUids", "server", "workspace"]),
90
- c(D, {
91
- collection: e(r),
92
- operation: e(l),
93
- workspace: e(i),
94
- requestResult: t.requestResult,
95
- numWorkspaceRequests: e(x).length,
96
- response: (n = w.value) == null ? void 0 : n.response
97
- }, null, 8, ["collection", "operation", "workspace", "requestResult", "numWorkspaceRequests", "response"])
98
- ];
99
- }),
72
+ default: k(() => [
73
+ n(z, {
74
+ collection: e(t),
75
+ envVariables: e(p),
76
+ environment: e(d),
77
+ example: e(c),
78
+ invalidParams: o.invalidParams,
79
+ operation: e(a),
80
+ selectedSecuritySchemeUids: o.selectedSecuritySchemeUids,
81
+ server: e(u),
82
+ workspace: e(l)
83
+ }, null, 8, ["collection", "envVariables", "environment", "example", "invalidParams", "operation", "selectedSecuritySchemeUids", "server", "workspace"]),
84
+ n(D, {
85
+ collection: e(t),
86
+ operation: e(a),
87
+ workspace: e(l),
88
+ requestResult: o.requestResult,
89
+ numWorkspaceRequests: e(h).length,
90
+ response: V.value?.response
91
+ }, null, 8, ["collection", "operation", "workspace", "requestResult", "numWorkspaceRequests", "response"])
92
+ ]),
100
93
  _: 1
101
94
  }, 8, ["class"])) : H("", !0)
102
95
  ]),
103
96
  _: 1
104
97
  })
105
- ])) : (s(), u(S, { key: 1 }))
98
+ ])) : (r(), m(y, { key: 1 }))
106
99
  ])
107
- ], 2)) : (s(), u(S, { key: 1 }));
100
+ ], 2)) : (r(), m(y, { key: 1 }));
108
101
  }
109
102
  });
110
103
  export {
@@ -1,5 +1,5 @@
1
1
  import o from "./RequestRoot.vue2.js";
2
- import "./RequestRoot.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-c648cff4"]]);
5
5
  export {