@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,111 +1,101 @@
1
- import { defineComponent as w, ref as C, computed as A, useTemplateRef as M, createElementBlock as v, openBlock as a, createElementVNode as c, createVNode as n, createStaticVNode as N, Fragment as D, renderList as I, createBlock as m, createCommentVNode as $, unref as t, toDisplayString as j, withCtx as f } from "vue";
2
- import { useModal as z, ScalarMarkdown as B, ScalarButton as p, ScalarIcon as E, ScalarModal as U } from "@scalar/components";
3
- import { ScalarIconTrash as V } from "@scalar/icons";
4
- import { emitCustomEvent as T } from "@scalar/workspace-store/events";
5
- import L from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
6
- import { useActiveEntities as P } from "../../store/active-entities.js";
7
- import R from "./CollectionServerForm.vue.js";
8
- import { useWorkspace as F } from "../../store/store.js";
9
- const O = {
1
+ import { defineComponent as y, ref as w, computed as C, useTemplateRef as A, createElementBlock as u, openBlock as o, createElementVNode as n, createVNode as a, createStaticVNode as M, Fragment as N, renderList as D, createBlock as f, createCommentVNode as I, unref as e, toDisplayString as $, withCtx as v } from "vue";
2
+ import { useModal as j, ScalarMarkdown as z, ScalarButton as m, ScalarIcon as B, ScalarModal as E } from "@scalar/components";
3
+ import { ScalarIconTrash as U } from "@scalar/icons";
4
+ import { emitCustomEvent as V } from "@scalar/workspace-store/events";
5
+ import T from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
6
+ import { useActiveEntities as L } from "../../store/active-entities.js";
7
+ import P from "./CollectionServerForm.vue.js";
8
+ import { useWorkspace as R } from "../../store/store.js";
9
+ const F = {
10
10
  ref: "wrapper-ref",
11
11
  class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8"
12
- }, W = { class: "flex flex-col gap-4" }, Y = { class: "rounded-lg border" }, q = { class: "bg-b-2 flex items-start justify-between rounded-t-lg py-1 pr-1 pl-3 text-sm" }, G = {
12
+ }, O = { class: "flex flex-col gap-4" }, W = { class: "rounded-lg border" }, Y = { class: "bg-b-2 flex items-start justify-between rounded-t-lg py-1 pr-1 pl-3 text-sm" }, q = {
13
13
  key: 1,
14
14
  class: "self-center"
15
- }, H = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, oe = /* @__PURE__ */ w({
15
+ }, G = { class: "text-c-3 flex h-full items-center justify-center rounded-lg border p-4" }, le = /* @__PURE__ */ y({
16
16
  __name: "CollectionServers",
17
- setup(J) {
18
- const { activeCollection: s } = P(), { servers: d, events: x, serverMutators: h } = F(), u = z(), l = C(null), _ = A(() => {
19
- var r;
20
- return !d || !((r = s.value) != null && r.servers) ? [] : Object.values(d).filter(
21
- (e) => {
22
- var i;
23
- return (i = s.value) == null ? void 0 : i.servers.includes(e.uid);
24
- }
25
- );
26
- }), S = () => x.commandPalette.emit({
17
+ setup(H) {
18
+ const { activeCollection: t } = L(), { servers: i, events: p, serverMutators: x } = R(), c = j(), r = w(null), h = C(() => !i || !t.value?.servers ? [] : Object.values(i).filter(
19
+ (d) => t.value?.servers.includes(d.uid)
20
+ )), _ = () => p.commandPalette.emit({
27
21
  commandName: "Add Server"
28
- }), g = () => {
29
- var r, e;
30
- !((r = s.value) != null && r.uid) || !l.value || (h.delete(l.value, s.value.uid), T(k.value, "scalar-delete-server", {
31
- url: ((e = d[l.value]) == null ? void 0 : e.url) ?? ""
32
- }), u.hide());
33
- }, b = (r) => {
34
- l.value = r, u.show();
35
- }, k = M("wrapper-ref");
36
- return (r, e) => {
37
- var i;
38
- return a(), v("div", O, [
39
- c("div", W, [
40
- e[2] || (e[2] = N('<div class="flex items-start justify-between gap-2"><div class="flex flex-col gap-2"><div class="flex h-8 items-center"><h3 class="font-bold">Servers</h3></div><p class="text-sm"> Add different base URLs for your API. You can use <code class="font-code text-c-2">{variables}</code> for dynamic parts. </p></div></div>', 1)),
41
- (a(!0), v(D, null, I(_.value, (o, y) => (a(), v("div", {
42
- key: o.uid
43
- }, [
44
- c("div", Y, [
45
- c("div", q, [
46
- o.description ? (a(), m(t(B), {
47
- key: 0,
48
- class: "self-center",
49
- value: o.description
50
- }, null, 8, ["value"])) : (a(), v("span", G, "Server " + j(y + 1), 1)),
51
- n(t(p), {
52
- class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
53
- variant: "ghost",
54
- onClick: (K) => b(o.uid)
55
- }, {
56
- default: f(() => [
57
- n(t(V), { class: "size-3.5" })
58
- ]),
59
- _: 2
60
- }, 1032, ["onClick"])
61
- ]),
62
- t(s) ? (a(), m(R, {
22
+ }), S = () => {
23
+ !t.value?.uid || !r.value || (x.delete(r.value, t.value.uid), V(b.value, "scalar-delete-server", {
24
+ url: i[r.value]?.url ?? ""
25
+ }), c.hide());
26
+ }, g = (d) => {
27
+ r.value = d, c.show();
28
+ }, b = A("wrapper-ref");
29
+ return (d, s) => (o(), u("div", F, [
30
+ n("div", O, [
31
+ s[2] || (s[2] = M('<div class="flex items-start justify-between gap-2"><div class="flex flex-col gap-2"><div class="flex h-8 items-center"><h3 class="font-bold">Servers</h3></div><p class="text-sm"> Add different base URLs for your API. You can use <code class="font-code text-c-2">{variables}</code> for dynamic parts. </p></div></div>', 1)),
32
+ (o(!0), u(N, null, D(h.value, (l, k) => (o(), u("div", {
33
+ key: l.uid
34
+ }, [
35
+ n("div", W, [
36
+ n("div", Y, [
37
+ l.description ? (o(), f(e(z), {
63
38
  key: 0,
64
- collectionId: t(s).uid,
65
- serverUid: o.uid
66
- }, null, 8, ["collectionId", "serverUid"])) : $("", !0)
67
- ])
68
- ]))), 128)),
69
- c("div", H, [
70
- n(t(p), {
71
- class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
72
- size: "sm",
73
- variant: "ghost",
74
- onClick: S
75
- }, {
76
- default: f(() => [
77
- n(t(E), {
78
- class: "inline-flex",
79
- icon: "Add",
80
- size: "sm",
81
- thickness: "1.5"
82
- }),
83
- e[1] || (e[1] = c("span", null, "Add Server", -1))
84
- ]),
85
- _: 1,
86
- __: [1]
87
- })
39
+ class: "self-center",
40
+ value: l.description
41
+ }, null, 8, ["value"])) : (o(), u("span", q, "Server " + $(k + 1), 1)),
42
+ a(e(m), {
43
+ class: "hover:bg-b-3 hover:text-c-1 h-fit p-1.25",
44
+ variant: "ghost",
45
+ onClick: (J) => g(l.uid)
46
+ }, {
47
+ default: v(() => [
48
+ a(e(U), { class: "size-3.5" })
49
+ ]),
50
+ _: 2
51
+ }, 1032, ["onClick"])
52
+ ]),
53
+ e(t) ? (o(), f(P, {
54
+ key: 0,
55
+ collectionId: e(t).uid,
56
+ serverUid: l.uid
57
+ }, null, 8, ["collectionId", "serverUid"])) : I("", !0)
88
58
  ])
59
+ ]))), 128)),
60
+ n("div", G, [
61
+ a(e(m), {
62
+ class: "hover:bg-b-2 hover:text-c-1 flex items-center gap-2",
63
+ size: "sm",
64
+ variant: "ghost",
65
+ onClick: _
66
+ }, {
67
+ default: v(() => [
68
+ a(e(B), {
69
+ class: "inline-flex",
70
+ icon: "Add",
71
+ size: "sm",
72
+ thickness: "1.5"
73
+ }),
74
+ s[1] || (s[1] = n("span", null, "Add Server", -1))
75
+ ]),
76
+ _: 1,
77
+ __: [1]
78
+ })
79
+ ])
80
+ ]),
81
+ a(e(E), {
82
+ size: "xxs",
83
+ state: e(c),
84
+ title: `Delete ${r.value ? e(i)[r.value]?.url : "Server"}`
85
+ }, {
86
+ default: v(() => [
87
+ a(T, {
88
+ variableName: "Server",
89
+ warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
90
+ onClose: s[0] || (s[0] = (l) => e(c).hide()),
91
+ onDelete: S
92
+ })
89
93
  ]),
90
- n(t(U), {
91
- size: "xxs",
92
- state: t(u),
93
- title: `Delete ${l.value ? (i = t(d)[l.value]) == null ? void 0 : i.url : "Server"}`
94
- }, {
95
- default: f(() => [
96
- n(L, {
97
- variableName: "Server",
98
- warningMessage: "Are you sure you want to delete this server? This action cannot be undone.",
99
- onClose: e[0] || (e[0] = (o) => t(u).hide()),
100
- onDelete: g
101
- })
102
- ]),
103
- _: 1
104
- }, 8, ["state", "title"])
105
- ], 512);
106
- };
94
+ _: 1
95
+ }, 8, ["state", "title"])
96
+ ], 512));
107
97
  }
108
98
  });
109
99
  export {
110
- oe as default
100
+ le as default
111
101
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./CollectionSettings.vue2.js";
2
- import "./CollectionSettings.vue3.js";
2
+ /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5170f3be"]]);
5
5
  export {
@@ -1,126 +1,119 @@
1
- import { defineComponent as D, createElementBlock as d, openBlock as c, Fragment as u, createElementVNode as t, createVNode as s, unref as l, createTextVNode as b, toDisplayString as N, withCtx as w } from "vue";
2
- import { useModal as S, ScalarToggle as W, ScalarIcon as _, ScalarButton as T, ScalarModal as V } from "@scalar/components";
3
- import { useRouter as A } from "vue-router";
4
- import B from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
5
- import { useActiveEntities as E } from "../../store/active-entities.js";
6
- import { PathId as k } from "../../routes.js";
7
- import { useWorkspace as I } from "../../store/store.js";
8
- const $ = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, L = { class: "flex flex-col gap-2" }, O = { class: "bg-b-2 rounded-lg border text-sm" }, P = { class: "bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3" }, R = { class: "text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap" }, j = { class: "flex items-center" }, z = ["href"], F = { class: "flex flex-col gap-4" }, Z = { class: "flex items-center justify-between rounded-lg border p-3 text-sm" }, te = /* @__PURE__ */ D({
1
+ import { defineComponent as _, createElementBlock as r, openBlock as d, Fragment as c, createElementVNode as e, createVNode as n, unref as l, createTextVNode as m, toDisplayString as k, withCtx as f } from "vue";
2
+ import { useModal as C, ScalarToggle as y, ScalarIcon as p, ScalarButton as M, ScalarModal as U } from "@scalar/components";
3
+ import { useRouter as D } from "vue-router";
4
+ import N from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
5
+ import { useActiveEntities as S } from "../../store/active-entities.js";
6
+ import { PathId as v } from "../../routes.js";
7
+ import { useWorkspace as W } from "../../store/store.js";
8
+ const T = { class: "flex h-full w-full flex-col gap-12 px-1.5 pt-8" }, V = { class: "flex flex-col gap-2" }, A = { class: "bg-b-2 rounded-lg border text-sm" }, B = { class: "bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3" }, E = { class: "text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap" }, I = { class: "flex items-center" }, $ = ["href"], L = { class: "flex flex-col gap-4" }, O = { class: "flex items-center justify-between rounded-lg border p-3 text-sm" }, H = /* @__PURE__ */ _({
9
9
  __name: "CollectionSettings",
10
- setup(q) {
11
- const { activeCollection: o, activeWorkspace: a, activeWorkspaceCollections: C } = E(), { collectionMutators: m } = I(), { replace: y } = A(), i = S();
12
- function M() {
13
- var n, e;
14
- o.value && (n = o.value) != null && n.documentUrl && m.edit(
10
+ setup(P) {
11
+ const { activeCollection: o, activeWorkspace: i, activeWorkspaceCollections: x } = S(), { collectionMutators: u } = W(), { replace: g } = D(), s = C();
12
+ function h() {
13
+ o.value && o.value?.documentUrl && u.edit(
15
14
  o.value.uid,
16
15
  "watchMode",
17
- !((e = o.value) != null && e.watchMode)
16
+ !o.value?.watchMode
18
17
  );
19
18
  }
20
- function U() {
21
- if (!o.value || !a.value)
19
+ function b() {
20
+ if (!o.value || !i.value)
22
21
  return;
23
- m.delete(o.value, a.value);
24
- const n = C.value[0];
25
- n && y({
22
+ u.delete(o.value, i.value);
23
+ const a = x.value[0];
24
+ a && g({
26
25
  name: "collection",
27
26
  params: {
28
- [k.Workspace]: a.value.uid,
29
- [k.Collection]: n.uid
27
+ [v.Workspace]: i.value.uid,
28
+ [v.Collection]: a.uid
30
29
  }
31
- }), i.hide();
30
+ }), s.hide();
32
31
  }
33
- return (n, e) => {
34
- var f, p, v, x, g;
35
- return c(), d(u, null, [
36
- t("div", $, [
37
- t("div", L, [
38
- e[5] || (e[5] = t("div", { class: "flex h-8 items-center" }, [
39
- t("h3", { class: "font-bold" }, "Features")
40
- ], -1)),
41
- t("div", O, [
42
- t("div", P, [
43
- e[2] || (e[2] = t("div", null, [
44
- t("h4", null, "Watch Mode"),
45
- t("p", { class: "text-c-2 mt-1" }, " When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")
46
- ], -1)),
47
- s(l(W), {
48
- class: "w-4",
49
- disabled: !((f = l(o)) != null && f.documentUrl),
50
- modelValue: ((p = l(o)) == null ? void 0 : p.watchMode) ?? !1,
51
- "onUpdate:modelValue": M
52
- }, null, 8, ["disabled", "modelValue"])
53
- ]),
54
- t("div", R, [
55
- t("div", j, [
56
- (v = l(o)) != null && v.documentUrl ? (c(), d(u, { key: 0 }, [
57
- e[3] || (e[3] = t("span", { class: "bg-b-2 sticky left-0 pr-2 pl-3" }, "Source", -1)),
58
- t("a", {
59
- class: "text-c-2 group rounded pr-3 no-underline hover:underline",
60
- href: l(o).documentUrl,
61
- target: "_blank"
62
- }, [
63
- b(N(l(o).documentUrl) + " ", 1),
64
- s(l(_), {
65
- class: "ml-1 hidden w-2.5 group-hover:inline",
66
- icon: "ExternalLink"
67
- })
68
- ], 8, z)
69
- ], 64)) : (c(), d(u, { key: 1 }, [
70
- s(l(_), {
71
- class: "text-c-2 mr-2 ml-3 w-4",
72
- icon: "NotAllowed",
73
- size: "sm"
74
- }),
75
- e[4] || (e[4] = t("span", { class: "text-c-2 pr-3" }, " No URL configured. Try importing an OpenAPI document from an URL. ", -1))
76
- ], 64))
77
- ])
78
- ])
79
- ])
80
- ]),
81
- t("div", F, [
82
- e[8] || (e[8] = t("h3", { class: "font-bold" }, "Danger Zone", -1)),
83
- t("div", Z, [
84
- e[7] || (e[7] = t("div", null, [
85
- t("h4", null, "Delete Collection"),
86
- t("p", { class: "text-c-2 mt-1" }, " Be careful, my friend. Once deleted, there is no way to recover the collection. ")
32
+ return (a, t) => (d(), r(c, null, [
33
+ e("div", T, [
34
+ e("div", V, [
35
+ t[5] || (t[5] = e("div", { class: "flex h-8 items-center" }, [
36
+ e("h3", { class: "font-bold" }, "Features")
37
+ ], -1)),
38
+ e("div", A, [
39
+ e("div", B, [
40
+ t[2] || (t[2] = e("div", null, [
41
+ e("h4", null, "Watch Mode"),
42
+ e("p", { class: "text-c-2 mt-1" }, " When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")
87
43
  ], -1)),
88
- s(l(T), {
89
- class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
90
- variant: "danger",
91
- onClick: e[0] || (e[0] = (r) => l(i).show())
92
- }, {
93
- default: w(() => e[6] || (e[6] = [
94
- b(" Delete Collection ")
95
- ])),
96
- _: 1,
97
- __: [6]
98
- })
44
+ n(l(y), {
45
+ class: "w-4",
46
+ disabled: !l(o)?.documentUrl,
47
+ modelValue: l(o)?.watchMode ?? !1,
48
+ "onUpdate:modelValue": h
49
+ }, null, 8, ["disabled", "modelValue"])
50
+ ]),
51
+ e("div", E, [
52
+ e("div", I, [
53
+ l(o)?.documentUrl ? (d(), r(c, { key: 0 }, [
54
+ t[3] || (t[3] = e("span", { class: "bg-b-2 sticky left-0 pr-2 pl-3" }, "Source", -1)),
55
+ e("a", {
56
+ class: "text-c-2 group rounded pr-3 no-underline hover:underline",
57
+ href: l(o).documentUrl,
58
+ target: "_blank"
59
+ }, [
60
+ m(k(l(o).documentUrl) + " ", 1),
61
+ n(l(p), {
62
+ class: "ml-1 hidden w-2.5 group-hover:inline",
63
+ icon: "ExternalLink"
64
+ })
65
+ ], 8, $)
66
+ ], 64)) : (d(), r(c, { key: 1 }, [
67
+ n(l(p), {
68
+ class: "text-c-2 mr-2 ml-3 w-4",
69
+ icon: "NotAllowed",
70
+ size: "sm"
71
+ }),
72
+ t[4] || (t[4] = e("span", { class: "text-c-2 pr-3" }, " No URL configured. Try importing an OpenAPI document from an URL. ", -1))
73
+ ], 64))
74
+ ])
99
75
  ])
100
76
  ])
101
77
  ]),
102
- s(l(V), {
103
- size: "xxs",
104
- state: l(i),
105
- title: `Delete ${(g = (x = l(o)) == null ? void 0 : x.info) == null ? void 0 : g.title}`
106
- }, {
107
- default: w(() => {
108
- var r, h;
109
- return [
110
- s(B, {
111
- variableName: ((h = (r = l(o)) == null ? void 0 : r.info) == null ? void 0 : h.title) ?? "",
112
- warningMessage: "This action cannot be undone.",
113
- onClose: e[1] || (e[1] = (G) => l(i).hide()),
114
- onDelete: U
115
- }, null, 8, ["variableName"])
116
- ];
117
- }),
118
- _: 1
119
- }, 8, ["state", "title"])
120
- ], 64);
121
- };
78
+ e("div", L, [
79
+ t[8] || (t[8] = e("h3", { class: "font-bold" }, "Danger Zone", -1)),
80
+ e("div", O, [
81
+ t[7] || (t[7] = e("div", null, [
82
+ e("h4", null, "Delete Collection"),
83
+ e("p", { class: "text-c-2 mt-1" }, " Be careful, my friend. Once deleted, there is no way to recover the collection. ")
84
+ ], -1)),
85
+ n(l(M), {
86
+ class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
87
+ variant: "danger",
88
+ onClick: t[0] || (t[0] = (w) => l(s).show())
89
+ }, {
90
+ default: f(() => t[6] || (t[6] = [
91
+ m(" Delete Collection ")
92
+ ])),
93
+ _: 1,
94
+ __: [6]
95
+ })
96
+ ])
97
+ ])
98
+ ]),
99
+ n(l(U), {
100
+ size: "xxs",
101
+ state: l(s),
102
+ title: `Delete ${l(o)?.info?.title}`
103
+ }, {
104
+ default: f(() => [
105
+ n(N, {
106
+ variableName: l(o)?.info?.title ?? "",
107
+ warningMessage: "This action cannot be undone.",
108
+ onClose: t[1] || (t[1] = (w) => l(s).hide()),
109
+ onDelete: b
110
+ }, null, 8, ["variableName"])
111
+ ]),
112
+ _: 1
113
+ }, 8, ["state", "title"])
114
+ ], 64));
122
115
  }
123
116
  });
124
117
  export {
125
- te as default
118
+ H as default
126
119
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./EnvironmentForm.vue2.js";
2
- import "./EnvironmentForm.vue3.js";
2
+ /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
4
  const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-83bfcc8a"]]);
5
5
  export {