@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,13 +1,13 @@
1
- import { defineComponent as $, ref as f, computed as b, watch as E, onMounted as D, createBlock as V, openBlock as d, withCtx as u, createVNode as v, createElementBlock as O, createTextVNode as K, Fragment as j, renderList as F, normalizeClass as A, createSlots as J, unref as g, createCommentVNode as L, withModifiers as q, nextTick as p } from "vue";
2
- import { ScalarButton as G } from "@scalar/components";
3
- import { ScalarIconWarning as H, ScalarIconTrash as P } from "@scalar/icons";
4
- import T from "../../../components/CodeInput/CodeInput.vue.js";
5
- import Q from "../../../components/DataTable/DataTable.vue.js";
6
- import U from "../../../components/DataTable/DataTableCell.vue.js";
7
- import z from "../../../components/DataTable/DataTableHeader.vue.js";
8
- import M from "../../../components/DataTable/DataTableRow.vue.js";
9
- import { useWorkspace as X } from "../../../store/store.js";
10
- const re = /* @__PURE__ */ $({
1
+ import { defineComponent as W, ref as m, computed as h, watch as R, onMounted as $, createBlock as b, openBlock as f, withCtx as i, createVNode as c, createElementBlock as D, createTextVNode as E, Fragment as O, renderList as j, normalizeClass as F, createSlots as A, unref as V, createCommentVNode as J, withModifiers as L, nextTick as g } from "vue";
2
+ import { ScalarButton as q } from "@scalar/components";
3
+ import { ScalarIconWarning as G, ScalarIconTrash as H } from "@scalar/icons";
4
+ import K from "../../../components/CodeInput/CodeInput.vue.js";
5
+ import P from "../../../components/DataTable/DataTable.vue.js";
6
+ import T from "../../../components/DataTable/DataTableCell.vue.js";
7
+ import U from "../../../components/DataTable/DataTableHeader.vue.js";
8
+ import z from "../../../components/DataTable/DataTableRow.vue.js";
9
+ import { useWorkspace as Q } from "../../../store/store.js";
10
+ const oe = /* @__PURE__ */ W({
11
11
  __name: "EnvironmentForm",
12
12
  props: {
13
13
  collection: {},
@@ -15,181 +15,177 @@ const re = /* @__PURE__ */ $({
15
15
  workspace: {},
16
16
  envVariables: {}
17
17
  },
18
- setup(o) {
19
- const { collectionMutators: y } = X(), r = f([]), k = f(/* @__PURE__ */ new Set()), w = f(/* @__PURE__ */ new Map()), c = f(!1), x = b(() => {
20
- var e;
21
- if (!((e = o.environment) != null && e.value))
18
+ setup(l) {
19
+ const { collectionMutators: d } = Q(), o = m([]), y = m(/* @__PURE__ */ new Set()), k = m(/* @__PURE__ */ new Map()), u = m(!1), M = h(() => {
20
+ if (!l.environment?.value)
22
21
  return [{ key: "", value: "" }];
23
22
  try {
24
- const n = JSON.parse(o.environment.value), l = Object.entries(n).map(([t, a]) => ({
23
+ const e = JSON.parse(l.environment.value), a = Object.entries(e).map(([t, n]) => ({
25
24
  key: t,
26
- value: String(a)
25
+ value: String(n)
27
26
  }));
28
- return l.length === 0 ? [{ key: "", value: "" }] : l;
27
+ return a.length === 0 ? [{ key: "", value: "" }] : a;
29
28
  } catch {
30
29
  return [{ key: "", value: "" }];
31
30
  }
32
- }), N = b(() => {
33
- const e = r.value[r.value.length - 1];
34
- return e ? e.key || e.value ? [...r.value, { key: "", value: "" }] : r.value : [{ key: "", value: "" }];
35
- }), C = b(() => {
31
+ }), x = h(() => {
32
+ const e = o.value[o.value.length - 1];
33
+ return e ? e.key || e.value ? [...o.value, { key: "", value: "" }] : o.value : [{ key: "", value: "" }];
34
+ }), p = h(() => {
36
35
  const e = /* @__PURE__ */ new Map();
37
- return r.value.forEach((n, l) => {
38
- if (n.key) {
39
- const t = e.get(n.key) || [];
40
- t.push(l), e.set(n.key, t);
36
+ return o.value.forEach((a, t) => {
37
+ if (a.key) {
38
+ const n = e.get(a.key) || [];
39
+ n.push(t), e.set(a.key, n);
41
40
  }
42
- }), w.value.forEach((n, l) => {
43
- if (n) {
44
- const t = e.get(n) || [];
45
- t.push(l), e.set(n, t);
41
+ }), k.value.forEach((a, t) => {
42
+ if (a) {
43
+ const n = e.get(a) || [];
44
+ n.push(t), e.set(a, n);
46
45
  }
47
- }), Array.from(e.values()).filter((n) => n.length > 1).flat();
46
+ }), Array.from(e.values()).filter((a) => a.length > 1).flat();
48
47
  });
49
- E(
50
- x,
48
+ R(
49
+ M,
51
50
  (e) => {
52
- r.value = [...e], k.value = new Set(e.map((n) => n.key).filter(Boolean));
51
+ o.value = [...e], y.value = new Set(e.map((a) => a.key).filter(Boolean));
53
52
  },
54
53
  { immediate: !0 }
55
54
  );
56
- const S = async (e, n, l) => {
57
- var t;
58
- if (!c.value) {
59
- if (n === "key") {
60
- w.value.set(e, l);
61
- const a = new Set(k.value), s = r.value[e];
62
- if (s && a.delete(s.key), a.has(l))
55
+ const C = async (e, a, t) => {
56
+ if (!u.value) {
57
+ if (a === "key") {
58
+ k.value.set(e, t);
59
+ const n = new Set(y.value), r = o.value[e];
60
+ if (r && n.delete(r.key), n.has(t))
63
61
  return;
64
62
  }
65
- c.value = !0;
63
+ u.value = !0;
66
64
  try {
67
- const a = [...r.value], s = a[e];
68
- if (!s)
65
+ const n = [...o.value], r = n[e];
66
+ if (!r)
69
67
  return;
70
- a[e] = {
71
- key: n === "key" ? l : s.key,
72
- value: n === "value" ? l : s.value
73
- }, !a[e].key && !a[e].value && e !== a.length - 1 && a.splice(e, 1);
74
- const m = a.reduce(
75
- (i, { key: I, value: R }) => ((I || R) && (i[I] = R), i),
68
+ n[e] = {
69
+ key: a === "key" ? t : r.key,
70
+ value: a === "value" ? t : r.value
71
+ }, !n[e].key && !n[e].value && e !== n.length - 1 && n.splice(e, 1);
72
+ const v = n.reduce(
73
+ (s, { key: B, value: I }) => ((B || I) && (s[B] = I), s),
76
74
  {}
77
75
  );
78
- if (o.collection) {
79
- const i = {
80
- ...o.collection["x-scalar-environments"],
81
- [o.environment.name]: {
82
- ...(t = o.collection["x-scalar-environments"]) == null ? void 0 : t[o.environment.name],
83
- variables: m
76
+ if (l.collection) {
77
+ const s = {
78
+ ...l.collection["x-scalar-environments"],
79
+ [l.environment.name]: {
80
+ ...l.collection["x-scalar-environments"]?.[l.environment.name],
81
+ variables: v
84
82
  }
85
83
  };
86
- await y.edit(
87
- o.collection.uid,
84
+ await d.edit(
85
+ l.collection.uid,
88
86
  "x-scalar-environments",
89
- i
87
+ s
90
88
  );
91
89
  }
92
- if (e === r.value.length - 1) {
93
- const i = a[a.length - 1];
94
- i && (i.key || i.value) && await h();
90
+ if (e === o.value.length - 1) {
91
+ const s = n[n.length - 1];
92
+ s && (s.key || s.value) && await w();
95
93
  }
96
- await p(), r.value = a, n === "key" && (k.value = new Set(
97
- a.map((i) => i.key).filter(Boolean)
98
- ), w.value.delete(e));
94
+ await g(), o.value = n, a === "key" && (y.value = new Set(
95
+ n.map((s) => s.key).filter(Boolean)
96
+ ), k.value.delete(e));
99
97
  } finally {
100
- c.value = !1;
98
+ u.value = !1;
101
99
  }
102
100
  }
103
- }, h = async () => {
104
- var e;
105
- if (!c.value) {
106
- c.value = !0;
101
+ }, w = async () => {
102
+ if (!u.value) {
103
+ u.value = !0;
107
104
  try {
108
- const n = [...r.value, { key: "", value: "" }], l = n.reduce(
109
- (t, { key: a, value: s }) => ((a || s) && (t[a] = s), t),
105
+ const e = [...o.value, { key: "", value: "" }], a = e.reduce(
106
+ (t, { key: n, value: r }) => ((n || r) && (t[n] = r), t),
110
107
  {}
111
108
  );
112
- if (o.collection) {
109
+ if (l.collection) {
113
110
  const t = {
114
- ...o.collection["x-scalar-environments"],
115
- [o.environment.name]: {
116
- ...(e = o.collection["x-scalar-environments"]) == null ? void 0 : e[o.environment.name],
117
- variables: l
111
+ ...l.collection["x-scalar-environments"],
112
+ [l.environment.name]: {
113
+ ...l.collection["x-scalar-environments"]?.[l.environment.name],
114
+ variables: a
118
115
  }
119
116
  };
120
- await y.edit(
121
- o.collection.uid,
117
+ await d.edit(
118
+ l.collection.uid,
122
119
  "x-scalar-environments",
123
120
  t
124
121
  );
125
122
  }
126
- await p(), r.value = n;
123
+ await g(), o.value = e;
127
124
  } finally {
128
- c.value = !1;
125
+ u.value = !1;
129
126
  }
130
127
  }
131
- }, W = async (e) => {
132
- var n;
133
- if (!c.value) {
134
- c.value = !0;
128
+ }, N = async (e) => {
129
+ if (!u.value) {
130
+ u.value = !0;
135
131
  try {
136
- const l = [...r.value];
137
- l.splice(e, 1);
138
- const t = l.reduce(
139
- (a, { key: s, value: m }) => ((s || m) && (a[s] = m), a),
132
+ const a = [...o.value];
133
+ a.splice(e, 1);
134
+ const t = a.reduce(
135
+ (n, { key: r, value: v }) => ((r || v) && (n[r] = v), n),
140
136
  {}
141
137
  );
142
- if (o.collection) {
143
- const a = {
144
- ...o.collection["x-scalar-environments"],
145
- [o.environment.name]: {
146
- ...(n = o.collection["x-scalar-environments"]) == null ? void 0 : n[o.environment.name],
138
+ if (l.collection) {
139
+ const n = {
140
+ ...l.collection["x-scalar-environments"],
141
+ [l.environment.name]: {
142
+ ...l.collection["x-scalar-environments"]?.[l.environment.name],
147
143
  variables: t
148
144
  }
149
145
  };
150
- await y.edit(
151
- o.collection.uid,
146
+ await d.edit(
147
+ l.collection.uid,
152
148
  "x-scalar-environments",
153
- a
149
+ n
154
150
  );
155
151
  }
156
- await p(), r.value = l;
152
+ await g(), o.value = a;
157
153
  } finally {
158
- c.value = !1;
154
+ u.value = !1;
159
155
  }
160
156
  }
161
- }, B = async () => {
162
- if (r.value.length === 0)
163
- await h();
164
- else if (r.value.length >= 1) {
165
- const e = r.value[r.value.length - 1];
166
- e && (e.key || e.value) && await h();
157
+ }, S = async () => {
158
+ if (o.value.length === 0)
159
+ await w();
160
+ else if (o.value.length >= 1) {
161
+ const e = o.value[o.value.length - 1];
162
+ e && (e.key || e.value) && await w();
167
163
  }
168
164
  };
169
- return D(() => {
170
- B();
171
- }), E(
172
- () => r.value,
165
+ return $(() => {
166
+ S();
167
+ }), R(
168
+ () => o.value,
173
169
  () => {
174
- B();
170
+ S();
175
171
  }
176
- ), (e, n) => (d(), V(Q, {
172
+ ), (e, a) => (f(), b(P, {
177
173
  class: "group/table flex-1",
178
174
  columns: ["", ""]
179
175
  }, {
180
- default: u(() => [
181
- v(M, { class: "sr-only !block" }, {
182
- default: u(() => [
183
- v(z, null, {
184
- default: u(() => n[0] || (n[0] = [
185
- K("Key")
176
+ default: i(() => [
177
+ c(z, { class: "sr-only !block" }, {
178
+ default: i(() => [
179
+ c(U, null, {
180
+ default: i(() => a[0] || (a[0] = [
181
+ E("Key")
186
182
  ])),
187
183
  _: 1,
188
184
  __: [0]
189
185
  }),
190
- v(z, null, {
191
- default: u(() => n[1] || (n[1] = [
192
- K("Value")
186
+ c(U, null, {
187
+ default: i(() => a[1] || (a[1] = [
188
+ E("Value")
193
189
  ])),
194
190
  _: 1,
195
191
  __: [1]
@@ -197,31 +193,31 @@ const re = /* @__PURE__ */ $({
197
193
  ]),
198
194
  _: 1
199
195
  }),
200
- (d(!0), O(j, null, F(N.value, (l, t) => (d(), V(M, {
201
- key: t,
202
- class: A({
203
- error: C.value.includes(t)
196
+ (f(!0), D(O, null, j(x.value, (t, n) => (f(), b(z, {
197
+ key: n,
198
+ class: F({
199
+ error: p.value.includes(n)
204
200
  })
205
201
  }, {
206
- default: u(() => [
207
- v(U, null, {
208
- default: u(() => [
209
- v(T, {
202
+ default: i(() => [
203
+ c(T, null, {
204
+ default: i(() => [
205
+ c(K, {
210
206
  disableCloseBrackets: "",
211
207
  disableEnter: "",
212
208
  disableTabIndent: "",
213
209
  lineWrapping: "",
214
210
  environment: e.environment,
215
211
  envVariables: e.envVariables,
216
- modelValue: l.key,
212
+ modelValue: t.key,
217
213
  placeholder: "Key",
218
214
  workspace: e.workspace,
219
- "onUpdate:modelValue": (a) => S(t, "key", a)
220
- }, J({ _: 2 }, [
221
- C.value.includes(t) ? {
215
+ "onUpdate:modelValue": (r) => C(n, "key", r)
216
+ }, A({ _: 2 }, [
217
+ p.value.includes(n) ? {
222
218
  name: "icon",
223
- fn: u(() => [
224
- v(g(H), { class: "text-red mr-0.75 size-3.5 brightness-[.9]" })
219
+ fn: i(() => [
220
+ c(V(G), { class: "text-red mr-0.75 size-3.5 brightness-[.9]" })
225
221
  ]),
226
222
  key: "0"
227
223
  } : void 0
@@ -229,9 +225,9 @@ const re = /* @__PURE__ */ $({
229
225
  ]),
230
226
  _: 2
231
227
  }, 1024),
232
- v(U, null, {
233
- default: u(() => [
234
- v(T, {
228
+ c(T, null, {
229
+ default: i(() => [
230
+ c(K, {
235
231
  class: "pr-6 group-hover:pr-10 group-has-[.cm-focused]:pr-10",
236
232
  disableCloseBrackets: "",
237
233
  disableEnter: "",
@@ -239,24 +235,24 @@ const re = /* @__PURE__ */ $({
239
235
  lineWrapping: "",
240
236
  environment: e.environment,
241
237
  envVariables: e.envVariables,
242
- modelValue: l.value,
238
+ modelValue: t.value,
243
239
  placeholder: "Value",
244
240
  workspace: e.workspace,
245
- "onUpdate:modelValue": (a) => S(t, "value", a)
241
+ "onUpdate:modelValue": (r) => C(n, "value", r)
246
242
  }, {
247
- icon: u(() => [
248
- l.key || l.value ? (d(), V(g(G), {
243
+ icon: i(() => [
244
+ t.key || t.value ? (f(), b(V(q), {
249
245
  key: 0,
250
246
  class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context hidden h-fit rounded p-1 group-hover:flex group-has-[.cm-focused]:flex",
251
247
  size: "sm",
252
248
  variant: "ghost",
253
- onClick: q((a) => W(t), ["stop"])
249
+ onClick: L((r) => N(n), ["stop"])
254
250
  }, {
255
- default: u(() => [
256
- v(g(P), { class: "size-3.5" })
251
+ default: i(() => [
252
+ c(V(H), { class: "size-3.5" })
257
253
  ]),
258
254
  _: 2
259
- }, 1032, ["onClick"])) : L("", !0)
255
+ }, 1032, ["onClick"])) : J("", !0)
260
256
  ]),
261
257
  _: 2
262
258
  }, 1032, ["environment", "envVariables", "modelValue", "workspace", "onUpdate:modelValue"])
@@ -272,5 +268,5 @@ const re = /* @__PURE__ */ $({
272
268
  }
273
269
  });
274
270
  export {
275
- re as default
271
+ oe as default
276
272
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./MarkdownInput.vue2.js";
2
- import "./MarkdownInput.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-5997a667"]]);
5
5
  export {
@@ -17,8 +17,7 @@ const B = { class: "flex h-full w-full flex-col gap-2 pt-8" }, C = { class: "fle
17
17
  const g = k, t = p("preview"), m = p(null);
18
18
  w(t, (l) => {
19
19
  l === "edit" && x(() => {
20
- var e;
21
- (e = m.value) == null || e.focus();
20
+ m.value?.focus();
22
21
  });
23
22
  });
24
23
  const V = () => {
@@ -1,4 +1,4 @@
1
- import { defineComponent as c, computed as a, createElementBlock as s, createBlock as m, createCommentVNode as d, openBlock as o, toDisplayString as f, unref as p } from "vue";
1
+ import { defineComponent as c, computed as a, createElementBlock as s, createBlock as m, createCommentVNode as f, openBlock as o, toDisplayString as d, unref as p } from "vue";
2
2
  import { ScalarCodeBlock as v } from "@scalar/components";
3
3
  import { isDefined as y } from "@scalar/oas-utils/helpers";
4
4
  import { encode as g } from "js-base64";
@@ -7,7 +7,7 @@ import { getSnippet as k } from "./helpers/get-snippet.js";
7
7
  const S = {
8
8
  key: 0,
9
9
  class: "text-c-3 flex min-h-16 items-center justify-center px-4 text-sm"
10
- }, N = /* @__PURE__ */ c({
10
+ }, q = /* @__PURE__ */ c({
11
11
  __name: "CodeSnippet",
12
12
  props: {
13
13
  target: {},
@@ -19,32 +19,32 @@ const S = {
19
19
  environment: {}
20
20
  },
21
21
  setup(t) {
22
- const i = a(
23
- () => t.securitySchemes.flatMap((e) => e.type === "apiKey" ? e.value : (e == null ? void 0 : e.type) === "http" ? [
22
+ const l = a(
23
+ () => t.securitySchemes.flatMap((e) => e.type === "apiKey" ? e.value : e?.type === "http" ? [
24
24
  e.token,
25
25
  e.password,
26
26
  g(`${e.username}:${e.password}`)
27
- ] : e.type === "oauth2" ? Object.values(e.flows).map((r) => r == null ? void 0 : r.token).filter(y) : [])
28
- ), n = a(() => {
27
+ ] : e.type === "oauth2" ? Object.values(e.flows).map((n) => n?.token).filter(y) : [])
28
+ ), r = a(() => {
29
29
  const e = x({
30
30
  operation: t.operation,
31
31
  example: t.example,
32
32
  server: t.server,
33
33
  securitySchemes: t.securitySchemes,
34
34
  environment: t.environment
35
- }), [r, u] = k(t.target, t.client, e);
36
- return { error: r, payload: u };
37
- }), l = a(() => t.target === "shell" && t.client === "curl" ? "curl" : t.target ?? "plaintext");
38
- return (e, r) => n.value.error ? (o(), s("div", S, f(n.value.error.message), 1)) : n.value.payload ? (o(), m(p(v), {
35
+ }), [n, u] = k(t.target, t.client, e);
36
+ return { error: n, payload: u };
37
+ }), i = a(() => t.target === "shell" && t.client === "curl" ? "curl" : t.target ?? "plaintext");
38
+ return (e, n) => r.value.error ? (o(), s("div", S, d(r.value.error.message), 1)) : r.value.payload ? (o(), m(p(v), {
39
39
  key: 1,
40
40
  class: "w-full",
41
- content: n.value.payload,
42
- hideCredentials: i.value,
43
- lang: l.value,
41
+ content: r.value.payload,
42
+ hideCredentials: l.value,
43
+ lang: i.value,
44
44
  lineNumbers: ""
45
- }, null, 8, ["content", "hideCredentials", "lang"])) : d("", !0);
45
+ }, null, 8, ["content", "hideCredentials", "lang"])) : f("", !0);
46
46
  }
47
47
  });
48
48
  export {
49
- N as default
49
+ q as default
50
50
  };
@@ -1,17 +1,16 @@
1
- import { mergeUrls as w } from "@scalar/oas-utils/helpers";
2
- const D = ({
3
- baseUrl: f = "",
4
- method: u,
1
+ import { mergeUrls as g } from "@scalar/oas-utils/helpers";
2
+ const v = ({
3
+ baseUrl: l = "",
4
+ method: s,
5
5
  body: a,
6
- path: d,
6
+ path: c,
7
7
  cookies: p,
8
8
  headers: n,
9
9
  query: m
10
10
  }) => {
11
- var l, s, c;
12
- const g = w(f, d, void 0, !0), r = {
13
- method: u.toUpperCase(),
14
- url: g.toString(),
11
+ const f = g(l, c, void 0, !0), r = {
12
+ method: s.toUpperCase(),
13
+ url: f.toString(),
15
14
  httpVersion: "HTTP/1.1",
16
15
  headers: [],
17
16
  queryString: [],
@@ -30,20 +29,20 @@ const D = ({
30
29
  value: t
31
30
  }))), a)
32
31
  try {
33
- const e = (l = n.find((t) => t.key.toLowerCase() === "content-type")) == null ? void 0 : l.value;
32
+ const e = n.find((t) => t.key.toLowerCase() === "content-type")?.value;
34
33
  if (a.activeBody === "formData" && a.formData) {
35
34
  const t = [];
36
- a.formData.value.forEach(({ key: o, value: h, file: i, enabled: v }) => {
37
- v && (i ? t.push({
35
+ a.formData.value.forEach(({ key: o, value: u, file: i, enabled: d }) => {
36
+ d && (i ? t.push({
38
37
  name: o || "blob",
39
38
  value: "BINARY",
40
39
  fileName: i.name,
41
40
  contentType: i.type || "application/octet-stream"
42
41
  }) : t.push({
43
42
  name: o,
44
- value: h
43
+ value: u
45
44
  }));
46
- }), ((s = a.formData) == null ? void 0 : s.encoding) === "urlencoded" ? r.postData = {
45
+ }), a.formData?.encoding === "urlencoded" ? r.postData = {
47
46
  mimeType: e || "application/x-www-form-urlencoded",
48
47
  params: t
49
48
  } : r.postData = {
@@ -52,12 +51,12 @@ const D = ({
52
51
  };
53
52
  } else a.activeBody === "raw" && a.raw && (r.postData = {
54
53
  mimeType: e || "application/json",
55
- text: ((c = a.raw) == null ? void 0 : c.value) ?? ""
54
+ text: a.raw?.value ?? ""
56
55
  });
57
56
  } catch {
58
57
  }
59
58
  return r;
60
59
  };
61
60
  export {
62
- D as convertToHarRequest
61
+ v as convertToHarRequest
63
62
  };