@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,120 +1,109 @@
1
- import { defineComponent as K, ref as m, computed as X, onMounted as Y, onBeforeUnmount as Z, watch as ee, createElementBlock as te, openBlock as p, normalizeClass as B, unref as r, createBlock as T, createCommentVNode as P, createElementVNode as D, isRef as oe, createVNode as re } from "vue";
2
- import { isDefined as se } from "@scalar/oas-utils/helpers";
3
- import { safeJSON as ae } from "@scalar/object-utils/parse";
4
- import { useToasts as ne } from "@scalar/use-toasts";
5
- import { RouterView as le } from "vue-router";
6
- import ue from "../../components/Sidebar/SidebarToggle.vue.js";
7
- import { useAnalytics as ce } from "../../hooks/useAnalytics.js";
8
- import { useClientConfig as ie } from "../../hooks/useClientConfig.js";
9
- import { useSidebar as me } from "../../hooks/useSidebar.js";
10
- import { validateParameters as fe } from "../../libs/validate-parameters.js";
11
- import { useActiveEntities as de } from "../../store/active-entities.js";
12
- import { useOpenApiWatcher as pe } from "./hooks/useOpenApiWatcher.js";
13
- import ve from "./RequestSidebar.vue.js";
14
- import { usePluginManager as Re } from "../../plugins/hooks/usePluginManager.js";
15
- import { createRequestOperation as Se } from "../../libs/send-request/create-request-operation.js";
16
- import { ERRORS as qe } from "../../libs/errors.js";
17
- import { useWorkspace as ye } from "../../store/store.js";
18
- import { useLayout as xe } from "../../hooks/useLayout.js";
19
- const be = { class: "flex h-full" }, he = { class: "flex h-full flex-1 flex-col" }, We = /* @__PURE__ */ K({
1
+ import { defineComponent as L, ref as c, computed as $, onMounted as H, onBeforeUnmount as Q, watch as F, createElementBlock as G, openBlock as m, normalizeClass as C, unref as r, createBlock as N, createCommentVNode as U, createElementVNode as _, isRef as K, createVNode as X } from "vue";
2
+ import { isDefined as Y } from "@scalar/oas-utils/helpers";
3
+ import { safeJSON as Z } from "@scalar/object-utils/parse";
4
+ import { useToasts as ee } from "@scalar/use-toasts";
5
+ import { RouterView as te } from "vue-router";
6
+ import oe from "../../components/Sidebar/SidebarToggle.vue.js";
7
+ import { useAnalytics as re } from "../../hooks/useAnalytics.js";
8
+ import { useClientConfig as se } from "../../hooks/useClientConfig.js";
9
+ import { useSidebar as ae } from "../../hooks/useSidebar.js";
10
+ import { validateParameters as ne } from "../../libs/validate-parameters.js";
11
+ import { useActiveEntities as le } from "../../store/active-entities.js";
12
+ import { useOpenApiWatcher as ue } from "./hooks/useOpenApiWatcher.js";
13
+ import ce from "./RequestSidebar.vue.js";
14
+ import { usePluginManager as ie } from "../../plugins/hooks/usePluginManager.js";
15
+ import { createRequestOperation as me } from "../../libs/send-request/create-request-operation.js";
16
+ import { ERRORS as fe } from "../../libs/errors.js";
17
+ import { useWorkspace as de } from "../../store/store.js";
18
+ import { useLayout as pe } from "../../hooks/useLayout.js";
19
+ const ve = { class: "flex h-full" }, Re = { class: "flex h-full flex-1 flex-col" }, Pe = /* @__PURE__ */ L({
20
20
  __name: "RequestRoot",
21
21
  emits: ["newTab"],
22
- setup(ge) {
23
- const M = ye(), { toast: v } = ne(), { layout: R } = xe(), z = ie(), { isSidebarOpen: a } = me(), f = ce(), {
24
- activeCollection: l,
25
- activeExample: u,
26
- activeEnvironment: S,
27
- activeRequest: c,
28
- activeWorkspace: q,
29
- activeServer: I
30
- } = de(), { cookies: J, requestHistory: W, showSidebar: y, securitySchemes: j, events: s } = M, L = Re(), $ = m(), x = m(), d = m(/* @__PURE__ */ new Set()), b = m(null), h = X(
31
- () => {
32
- var e, t, o;
33
- return ((e = l.value) != null && e.useCollectionSecurity ? (t = l.value) == null ? void 0 : t.selectedSecuritySchemeUids : (o = c.value) == null ? void 0 : o.selectedSecuritySchemeUids) ?? [];
34
- }
35
- ), g = async () => {
36
- var _, w, O, V, i, A;
37
- if (!c.value || !u.value || !l.value)
22
+ setup(Se) {
23
+ const w = de(), { toast: f } = ee(), { layout: d } = pe(), O = se(), { isSidebarOpen: a } = ae(), V = re(), {
24
+ activeCollection: n,
25
+ activeExample: l,
26
+ activeEnvironment: p,
27
+ activeRequest: u,
28
+ activeWorkspace: v,
29
+ activeServer: A
30
+ } = le(), { cookies: B, requestHistory: T, showSidebar: R, securitySchemes: P, events: s } = w, D = ie(), M = c(), S = c(), i = c(/* @__PURE__ */ new Set()), q = c(null), y = $(
31
+ () => (n.value?.useCollectionSecurity ? n.value?.selectedSecuritySchemeUids : u.value?.selectedSecuritySchemeUids) ?? []
32
+ ), x = async () => {
33
+ if (!u.value || !l.value || !n.value)
38
34
  return;
39
- d.value = fe(u.value);
40
- const e = typeof S.value == "object" ? S.value.value : "{}", t = ae.parse(e);
35
+ i.value = ne(l.value);
36
+ const e = typeof p.value == "object" ? p.value.value : "{}", t = Z.parse(e);
41
37
  t.error && console.error("INVALID ENVIRONMENT!");
42
- const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, n = ((_ = q.value) == null ? void 0 : _.cookies.map((G) => J[G]).filter(se)) ?? [], F = ((O = (w = l.value) == null ? void 0 : w.info) == null ? void 0 : O.title) === "Drafts" ? void 0 : I.value, [E, C] = Se({
43
- request: c.value,
44
- example: u.value,
45
- selectedSecuritySchemeUids: h.value,
46
- proxyUrl: ((V = q.value) == null ? void 0 : V.proxyUrl) ?? "",
38
+ const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, J = v.value?.cookies.map((j) => B[j]).filter(Y) ?? [], W = n.value?.info?.title === "Drafts" ? void 0 : A.value, [h, g] = me({
39
+ request: u.value,
40
+ example: l.value,
41
+ selectedSecuritySchemeUids: y.value,
42
+ proxyUrl: v.value?.proxyUrl ?? "",
47
43
  environment: o,
48
- globalCookies: n,
44
+ globalCookies: J,
49
45
  status: s.requestStatus,
50
- securitySchemes: j,
51
- server: F,
52
- pluginManager: L
46
+ securitySchemes: P,
47
+ server: W,
48
+ pluginManager: D
53
49
  });
54
- if ((A = (i = z.value) == null ? void 0 : i.onRequestSent) == null || A.call(i, c.value.path ?? ""), E) {
55
- v(E.message, "error");
50
+ if (O.value?.onRequestSent?.(u.value.path ?? ""), h) {
51
+ f(h.message, "error");
56
52
  return;
57
53
  }
58
- x.value = C.controller;
59
- const [N, U] = await C.sendRequest();
60
- b.value = U, N ? v(N.message, "error") : W.push(Q(U));
61
- }, H = async () => {
62
- var e;
63
- return (e = x.value) == null ? void 0 : e.abort(qe.REQUEST_ABORTED);
64
- };
65
- function k() {
66
- f == null || f.capture("client-send-request");
54
+ S.value = g.controller;
55
+ const [k, E] = await g.sendRequest();
56
+ q.value = E, k ? f(k.message, "error") : T.push(I(E));
57
+ }, z = async () => S.value?.abort(fe.REQUEST_ABORTED);
58
+ function b() {
59
+ V?.capture("client-send-request");
67
60
  }
68
- Y(() => {
69
- s.executeRequest.on(g), s.executeRequest.on(k), s.cancelRequest.on(H);
70
- }), pe(), Z(() => {
71
- s.executeRequest.off(g), s.executeRequest.off(k);
72
- }), ee(
73
- () => {
74
- var e;
75
- return (e = u.value) == null ? void 0 : e.parameters;
76
- },
61
+ H(() => {
62
+ s.executeRequest.on(x), s.executeRequest.on(b), s.cancelRequest.on(z);
63
+ }), ue(), Q(() => {
64
+ s.executeRequest.off(x), s.executeRequest.off(b);
65
+ }), F(
66
+ () => l.value?.parameters,
77
67
  () => {
78
- d.value.clear();
68
+ i.value.clear();
79
69
  },
80
70
  { deep: !0 }
81
71
  );
82
- const Q = (e) => {
83
- var t;
72
+ const I = (e) => {
84
73
  try {
85
74
  return structuredClone(e);
86
75
  } catch {
87
- const n = { ...e };
88
- return (t = e.response) != null && t.data && (e.response.data instanceof Blob || e.response.data instanceof ArrayBuffer ? n.response.data = e.response.data : n.response.data = JSON.parse(JSON.stringify(e.response.data))), n;
76
+ const o = { ...e };
77
+ return e.response?.data && (e.response.data instanceof Blob || e.response.data instanceof ArrayBuffer ? o.response.data = e.response.data : o.response.data = JSON.parse(JSON.stringify(e.response.data))), o;
89
78
  }
90
79
  };
91
- return (e, t) => (p(), te("div", {
80
+ return (e, t) => (m(), G("div", {
92
81
  ref_key: "element",
93
- ref: $,
94
- class: B(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
95
- "!mr-0 !mb-0 !border-0": r(R) === "modal"
82
+ ref: M,
83
+ class: C(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0", {
84
+ "!mr-0 !mb-0 !border-0": r(d) === "modal"
96
85
  }])
97
86
  }, [
98
- r(y) ? (p(), T(ue, {
87
+ r(R) ? (m(), N(oe, {
99
88
  key: 0,
100
89
  modelValue: r(a),
101
- "onUpdate:modelValue": t[0] || (t[0] = (o) => oe(a) ? a.value = o : null),
102
- class: B(["absolute top-2 left-3 z-50", [
90
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => K(a) ? a.value = o : null),
91
+ class: C(["absolute top-2 left-3 z-50", [
103
92
  { hidden: r(a) },
104
93
  { "xl:!flex": !r(a) },
105
- { "!flex": r(R) === "modal" }
94
+ { "!flex": r(d) === "modal" }
106
95
  ]])
107
- }, null, 8, ["modelValue", "class"])) : P("", !0),
108
- D("div", be, [
109
- r(y) ? (p(), T(ve, {
96
+ }, null, 8, ["modelValue", "class"])) : U("", !0),
97
+ _("div", ve, [
98
+ r(R) ? (m(), N(ce, {
110
99
  key: 0,
111
100
  onNewTab: t[1] || (t[1] = (o) => e.$emit("newTab", o))
112
- })) : P("", !0),
113
- D("div", he, [
114
- re(r(le), {
115
- invalidParams: d.value,
116
- requestResult: b.value,
117
- selectedSecuritySchemeUids: h.value
101
+ })) : U("", !0),
102
+ _("div", Re, [
103
+ X(r(te), {
104
+ invalidParams: i.value,
105
+ requestResult: q.value,
106
+ selectedSecuritySchemeUids: y.value
118
107
  }, null, 8, ["invalidParams", "requestResult", "selectedSecuritySchemeUids"])
119
108
  ])
120
109
  ])
@@ -122,5 +111,5 @@ const be = { class: "flex h-full" }, he = { class: "flex h-full flex-1 flex-col"
122
111
  }
123
112
  });
124
113
  export {
125
- We as default
114
+ Pe as default
126
115
  };
@@ -1,60 +1,53 @@
1
- import { defineComponent as b, createBlock as _, openBlock as y, unref as s, withCtx as n, createElementVNode as r, toDisplayString as i, createVNode as m, createTextVNode as u } from "vue";
2
- import { ScalarModal as S, ScalarButton as d } from "@scalar/components";
3
- import { useWorkspace as g } from "../../../../store/store.js";
4
- const k = { class: "text-c-2 mb-4 text-sm leading-normal" }, C = { class: "flex justify-between gap-2" }, B = /* @__PURE__ */ b({
1
+ import { defineComponent as h, createBlock as x, openBlock as b, unref as o, withCtx as s, createElementVNode as c, toDisplayString as a, createVNode as r, createTextVNode as i } from "vue";
2
+ import { ScalarModal as _, ScalarButton as m } from "@scalar/components";
3
+ import { useWorkspace as y } from "../../../../store/store.js";
4
+ const S = { class: "text-c-2 mb-4 text-sm leading-normal" }, g = { class: "flex justify-between gap-2" }, v = /* @__PURE__ */ h({
5
5
  __name: "DeleteRequestAuthModal",
6
6
  props: {
7
7
  state: {},
8
8
  scheme: {}
9
9
  },
10
10
  emits: ["close", "delete"],
11
- setup(p, { emit: f }) {
12
- const l = p, c = f, { securitySchemeMutators: h } = g(), x = () => {
13
- var e;
14
- (e = l.scheme) != null && e.id && h.delete(l.scheme.id), c("delete");
11
+ setup(u, { emit: d }) {
12
+ const n = u, l = d, { securitySchemeMutators: p } = y(), f = () => {
13
+ n.scheme?.id && p.delete(n.scheme.id), l("delete");
15
14
  };
16
- return (e, t) => (y(), _(s(S), {
15
+ return (t, e) => (b(), x(o(_), {
17
16
  size: "xxs",
18
- state: e.state,
17
+ state: t.state,
19
18
  title: "Delete Security Scheme"
20
19
  }, {
21
- default: n(() => {
22
- var a;
23
- return [
24
- r("p", k, " This cannot be undone. You're about to delete the " + i((a = e.scheme) == null ? void 0 : a.label) + " security scheme from the collection. ", 1),
25
- r("div", C, [
26
- m(s(d), {
27
- class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
28
- type: "button",
29
- variant: "outlined",
30
- onClick: t[0] || (t[0] = (o) => c("close"))
31
- }, {
32
- default: n(() => t[1] || (t[1] = [
33
- u(" Cancel ")
34
- ])),
35
- _: 1,
36
- __: [1]
37
- }),
38
- m(s(d), {
39
- class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
40
- type: "submit",
41
- onClick: x
42
- }, {
43
- default: n(() => {
44
- var o;
45
- return [
46
- u(" Delete " + i((o = e.scheme) == null ? void 0 : o.label), 1)
47
- ];
48
- }),
49
- _: 1
50
- })
51
- ])
52
- ];
53
- }),
20
+ default: s(() => [
21
+ c("p", S, " This cannot be undone. You're about to delete the " + a(t.scheme?.label) + " security scheme from the collection. ", 1),
22
+ c("div", g, [
23
+ r(o(m), {
24
+ class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
25
+ type: "button",
26
+ variant: "outlined",
27
+ onClick: e[0] || (e[0] = (k) => l("close"))
28
+ }, {
29
+ default: s(() => e[1] || (e[1] = [
30
+ i(" Cancel ")
31
+ ])),
32
+ _: 1,
33
+ __: [1]
34
+ }),
35
+ r(o(m), {
36
+ class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
37
+ type: "submit",
38
+ onClick: f
39
+ }, {
40
+ default: s(() => [
41
+ i(" Delete " + a(t.scheme?.label), 1)
42
+ ]),
43
+ _: 1
44
+ })
45
+ ])
46
+ ]),
54
47
  _: 1
55
48
  }, 8, ["state"]));
56
49
  }
57
50
  });
58
51
  export {
59
- B as default
52
+ v as default
60
53
  };
@@ -1,14 +1,14 @@
1
- import { defineComponent as P, createElementBlock as V, openBlock as d, Fragment as U, createBlock as k, createCommentVNode as w, createVNode as a, unref as r, withCtx as o, mergeProps as m, createTextVNode as u, createElementVNode as v, renderSlot as A } from "vue";
2
- import { useLoadingState as B, ScalarButton as z } from "@scalar/components";
3
- import { pkceOptions as L } from "@scalar/oas-utils/entities/spec";
4
- import { useToasts as R } from "@scalar/use-toasts";
5
- import { useWorkspace as F } from "../../../../store/store.js";
6
- import { updateScheme as I } from "../helpers/update-scheme.js";
7
- import N from "./OAuthScopesInput.vue.js";
1
+ import { defineComponent as T, createElementBlock as V, openBlock as d, Fragment as U, createBlock as k, createCommentVNode as w, createVNode as r, unref as a, withCtx as o, mergeProps as m, createTextVNode as u, createElementVNode as $, renderSlot as P } from "vue";
2
+ import { useLoadingState as A, ScalarButton as v } from "@scalar/components";
3
+ import { pkceOptions as B } from "@scalar/oas-utils/entities/spec";
4
+ import { useToasts as L } from "@scalar/use-toasts";
5
+ import { useWorkspace as R } from "../../../../store/store.js";
6
+ import { updateScheme as F } from "../helpers/update-scheme.js";
7
+ import I from "./OAuthScopesInput.vue.js";
8
8
  import p from "./RequestAuthDataTableInput.vue.js";
9
9
  import i from "../../../../components/DataTable/DataTableRow.vue.js";
10
- import { authorizeOauth2 as O } from "../../libs/oauth2.js";
11
- const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class: "flex h-8 w-full items-center justify-end border-t" }, G = /* @__PURE__ */ P({
10
+ import { authorizeOauth2 as N } from "../../libs/oauth2.js";
11
+ const O = { class: "flex h-8 items-center justify-end border-t" }, j = { class: "flex h-8 w-full items-center justify-end border-t" }, q = /* @__PURE__ */ T({
12
12
  __name: "OAuth2",
13
13
  props: {
14
14
  collection: {},
@@ -21,22 +21,21 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
21
21
  workspace: {}
22
22
  },
23
23
  emits: ["authorized"],
24
- setup(s, { emit: S }) {
25
- const b = S, y = B(), { toast: g } = R(), C = F(), n = (l, e) => I(s.scheme.uid, l, e, C, s.persistAuth), T = async () => {
26
- var t, $;
27
- if (y.isLoading || !((t = s.collection) != null && t.uid))
24
+ setup(s, { emit: z }) {
25
+ const S = z, y = A(), { toast: g } = L(), b = R(), n = (l, e) => F(s.scheme.uid, l, e, b, s.persistAuth), C = async () => {
26
+ if (y.isLoading || !s.collection?.uid)
28
27
  return;
29
28
  if (!s.server) {
30
29
  g("No server selected", "error");
31
30
  return;
32
31
  }
33
32
  y.startLoading();
34
- const [l, e] = await O(
33
+ const [l, e] = await N(
35
34
  s.flow,
36
35
  s.server,
37
- ($ = s.workspace) == null ? void 0 : $.proxyUrl
36
+ s.workspace?.proxyUrl
38
37
  ).finally(() => y.stopLoading());
39
- e ? (n(`flows.${s.flow.type}.token`, e), b("authorized")) : (console.error(l), g((l == null ? void 0 : l.message) ?? "Failed to authorize", "error"));
38
+ e ? (n(`flows.${s.flow.type}.token`, e), S("authorized")) : (console.error(l), g(l?.message ?? "Failed to authorize", "error"));
40
39
  }, f = {
41
40
  environment: s.environment,
42
41
  envVariables: s.envVariables,
@@ -44,9 +43,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
44
43
  };
45
44
  return (l, e) => (d(), V(U, null, [
46
45
  l.flow.token ? (d(), V(U, { key: 0 }, [
47
- a(r(i), null, {
46
+ r(a(i), null, {
48
47
  default: o(() => [
49
- a(p, m(f, {
48
+ r(p, m(f, {
50
49
  class: "border-r-transparent",
51
50
  modelValue: l.flow.token,
52
51
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
@@ -62,12 +61,12 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
62
61
  ]),
63
62
  _: 1
64
63
  }),
65
- a(r(i), { class: "min-w-full" }, {
64
+ r(a(i), { class: "min-w-full" }, {
66
65
  default: o(() => [
67
- v("div", j, [
68
- a(r(z), {
66
+ $("div", O, [
67
+ r(a(v), {
69
68
  class: "mr-1 p-0 px-2 py-0.5",
70
- loading: r(y),
69
+ loading: a(y),
71
70
  size: "sm",
72
71
  variant: "outlined",
73
72
  onClick: e[1] || (e[1] = (t) => n(`flows.${l.flow.type}.token`, ""))
@@ -78,13 +77,13 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
78
77
  _: 1,
79
78
  __: [11]
80
79
  }, 8, ["loading"]),
81
- A(l.$slots, "oauth-actions")
80
+ P(l.$slots, "oauth-actions")
82
81
  ])
83
82
  ]),
84
83
  _: 3
85
84
  })
86
85
  ], 64)) : (d(), V(U, { key: 1 }, [
87
- a(r(i), null, {
86
+ r(a(i), null, {
88
87
  default: o(() => [
89
88
  "authorizationUrl" in l.flow ? (d(), k(p, m({ key: 0 }, f, {
90
89
  containerClass: "border-r-0",
@@ -112,9 +111,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
112
111
  ]),
113
112
  _: 1
114
113
  }),
115
- "x-scalar-redirect-uri" in l.flow ? (d(), k(r(i), { key: 0 }, {
114
+ "x-scalar-redirect-uri" in l.flow ? (d(), k(a(i), { key: 0 }, {
116
115
  default: o(() => [
117
- a(p, m(f, {
116
+ r(p, m(f, {
118
117
  modelValue: l.flow["x-scalar-redirect-uri"],
119
118
  placeholder: "https://galaxy.scalar.com/callback",
120
119
  "onUpdate:modelValue": e[4] || (e[4] = (t) => n(`flows.${l.flow.type}.x-scalar-redirect-uri`, t))
@@ -129,9 +128,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
129
128
  _: 1
130
129
  })) : w("", !0),
131
130
  l.flow.type === "password" ? (d(), V(U, { key: 1 }, [
132
- a(r(i), null, {
131
+ r(a(i), null, {
133
132
  default: o(() => [
134
- a(p, m(f, {
133
+ r(p, m(f, {
135
134
  class: "text-c-2",
136
135
  modelValue: l.flow.username,
137
136
  placeholder: "janedoe",
@@ -146,9 +145,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
146
145
  ]),
147
146
  _: 1
148
147
  }),
149
- a(r(i), null, {
148
+ r(a(i), null, {
150
149
  default: o(() => [
151
- a(p, m(f, {
150
+ r(p, m(f, {
152
151
  modelValue: l.flow.password,
153
152
  placeholder: "********",
154
153
  type: "password",
@@ -164,9 +163,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
164
163
  _: 1
165
164
  })
166
165
  ], 64)) : w("", !0),
167
- a(r(i), null, {
166
+ r(a(i), null, {
168
167
  default: o(() => [
169
- a(p, m(f, {
168
+ r(p, m(f, {
170
169
  modelValue: l.flow["x-scalar-client-id"],
171
170
  placeholder: "12345",
172
171
  "onUpdate:modelValue": e[7] || (e[7] = (t) => n(`flows.${l.flow.type}.x-scalar-client-id`, t))
@@ -180,9 +179,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
180
179
  ]),
181
180
  _: 1
182
181
  }),
183
- "clientSecret" in l.flow ? (d(), k(r(i), { key: 2 }, {
182
+ "clientSecret" in l.flow ? (d(), k(a(i), { key: 2 }, {
184
183
  default: o(() => [
185
- a(p, m(f, {
184
+ r(p, m(f, {
186
185
  modelValue: l.flow.clientSecret,
187
186
  placeholder: "XYZ123",
188
187
  type: "password",
@@ -197,10 +196,10 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
197
196
  ]),
198
197
  _: 1
199
198
  })) : w("", !0),
200
- "x-usePkce" in l.flow ? (d(), k(r(i), { key: 3 }, {
199
+ "x-usePkce" in l.flow ? (d(), k(a(i), { key: 3 }, {
201
200
  default: o(() => [
202
- a(p, m(f, {
203
- enum: r(L),
201
+ r(p, m(f, {
202
+ enum: a(B),
204
203
  modelValue: l.flow["x-usePkce"],
205
204
  readOnly: "",
206
205
  "onUpdate:modelValue": e[9] || (e[9] = (t) => n(
@@ -217,9 +216,9 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
217
216
  ]),
218
217
  _: 1
219
218
  })) : w("", !0),
220
- Object.keys(l.flow.scopes ?? {}).length ? (d(), k(r(i), { key: 4 }, {
219
+ Object.keys(l.flow.scopes ?? {}).length ? (d(), k(a(i), { key: 4 }, {
221
220
  default: o(() => [
222
- a(N, {
221
+ r(I, {
223
222
  flow: l.flow,
224
223
  updateScheme: n
225
224
  }, null, 8, ["flow"])
@@ -227,18 +226,18 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
227
226
  _: 1
228
227
  })) : w("", !0)
229
228
  ], 64)),
230
- l.flow.token ? w("", !0) : (d(), k(r(i), {
229
+ l.flow.token ? w("", !0) : (d(), k(a(i), {
231
230
  key: 2,
232
231
  class: "min-w-full"
233
232
  }, {
234
233
  default: o(() => [
235
- v("div", E, [
236
- a(r(z), {
234
+ $("div", j, [
235
+ r(a(v), {
237
236
  class: "mr-0.75 p-0 px-2 py-0.5",
238
- loading: r(y),
237
+ loading: a(y),
239
238
  size: "sm",
240
239
  variant: "outlined",
241
- onClick: T
240
+ onClick: C
242
241
  }, {
243
242
  default: o(() => e[20] || (e[20] = [
244
243
  u(" Authorize ")
@@ -254,5 +253,5 @@ const j = { class: "flex h-8 items-center justify-end border-t" }, E = { class:
254
253
  }
255
254
  });
256
255
  export {
257
- G as default
256
+ q as default
258
257
  };