@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,50 +1,43 @@
1
- import { defineComponent as b, computed as p, createElementBlock as v, openBlock as h, createVNode as a, createElementVNode as V, withCtx as c, unref as f } from "vue";
2
- import { ScalarButton as w } from "@scalar/components";
3
- import { LibraryIcon as I } from "@scalar/icons/library";
4
- import g from "../../components/Form/LabelInput.vue.js";
5
- import k from "../../components/IconSelector.vue.js";
6
- import { useActiveEntities as B } from "../../store/active-entities.js";
7
- import { useWorkspace as E } from "../../store/store.js";
8
- const N = ["aria-label"], U = { class: "group relative ml-1.25" }, S = /* @__PURE__ */ b({
1
+ import { defineComponent as p, computed as n, createElementBlock as f, openBlock as v, createVNode as o, createElementVNode as x, withCtx as c, unref as u } from "vue";
2
+ import { ScalarButton as _ } from "@scalar/components";
3
+ import { LibraryIcon as b } from "@scalar/icons/library";
4
+ import h from "../../components/Form/LabelInput.vue.js";
5
+ import C from "../../components/IconSelector.vue.js";
6
+ import { useActiveEntities as V } from "../../store/active-entities.js";
7
+ import { useWorkspace as w } from "../../store/store.js";
8
+ const I = ["aria-label"], g = { class: "group relative ml-1.25" }, y = /* @__PURE__ */ p({
9
9
  __name: "CollectionInfoForm",
10
- setup(L) {
11
- const { activeCollection: e } = B(), { collectionMutators: l } = E(), n = p(
12
- () => {
13
- var t;
14
- return ((t = e == null ? void 0 : e.value) == null ? void 0 : t["x-scalar-icon"]) || "interface-content-folder";
15
- }
16
- ), x = (t) => {
17
- var r, o;
18
- (r = e == null ? void 0 : e.value) != null && r.uid && l.edit((o = e == null ? void 0 : e.value) == null ? void 0 : o.uid, "x-scalar-icon", t);
19
- }, _ = (t) => {
10
+ setup(k) {
11
+ const { activeCollection: e } = V(), { collectionMutators: l } = w(), a = n(
12
+ () => e?.value?.["x-scalar-icon"] || "interface-content-folder"
13
+ ), s = (t) => {
14
+ e?.value?.uid && l.edit(e?.value?.uid, "x-scalar-icon", t);
15
+ }, d = (t) => {
20
16
  e.value && l.edit(e.value.uid, "info.title", t);
21
- }, u = p(() => {
22
- var t, r, o, s, i, d, m;
23
- return {
24
- icon: (t = e == null ? void 0 : e.value) == null ? void 0 : t["x-scalar-icon"],
25
- title: (o = (r = e == null ? void 0 : e.value) == null ? void 0 : r.info) == null ? void 0 : o.title,
26
- description: (i = (s = e == null ? void 0 : e.value) == null ? void 0 : s.info) == null ? void 0 : i.description,
27
- version: (m = (d = e == null ? void 0 : e.value) == null ? void 0 : d.info) == null ? void 0 : m.version
28
- };
29
- });
30
- return (t, r) => (h(), v("div", {
31
- "aria-label": `Collection: ${u.value.title}`,
17
+ }, r = n(() => ({
18
+ icon: e?.value?.["x-scalar-icon"],
19
+ title: e?.value?.info?.title,
20
+ description: e?.value?.info?.description,
21
+ version: e?.value?.info?.version
22
+ }));
23
+ return (t, i) => (v(), f("div", {
24
+ "aria-label": `Collection: ${r.value.title}`,
32
25
  class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:mx-auto md:max-w-[720px]"
33
26
  }, [
34
- a(k, {
35
- modelValue: n.value,
27
+ o(C, {
28
+ modelValue: a.value,
36
29
  placement: "bottom-start",
37
- "onUpdate:modelValue": r[0] || (r[0] = (o) => x(o))
30
+ "onUpdate:modelValue": i[0] || (i[0] = (m) => s(m))
38
31
  }, {
39
32
  default: c(() => [
40
- a(f(w), {
33
+ o(u(_), {
41
34
  class: "hover:bg-b-2 aspect-square h-7 w-7 cursor-pointer rounded border border-transparent p-0 hover:border-inherit",
42
35
  variant: "ghost"
43
36
  }, {
44
37
  default: c(() => [
45
- a(f(I), {
38
+ o(u(b), {
46
39
  class: "text-c-2 size-5",
47
- src: n.value,
40
+ src: a.value,
48
41
  "stroke-width": "2"
49
42
  }, null, 8, ["src"])
50
43
  ]),
@@ -53,18 +46,18 @@ const N = ["aria-label"], U = { class: "group relative ml-1.25" }, S = /* @__PUR
53
46
  ]),
54
47
  _: 1
55
48
  }, 8, ["modelValue"]),
56
- V("div", U, [
57
- a(g, {
49
+ x("div", g, [
50
+ o(h, {
58
51
  class: "text-xl font-bold",
59
52
  inputId: "collectionName",
60
53
  placeholder: "Untitled Collection",
61
- value: u.value.title,
62
- onUpdateValue: _
54
+ value: r.value.title,
55
+ onUpdateValue: d
63
56
  }, null, 8, ["value"])
64
57
  ])
65
- ], 8, N));
58
+ ], 8, I));
66
59
  }
67
60
  });
68
61
  export {
69
- S as default
62
+ y as default
70
63
  };
@@ -1,142 +1,133 @@
1
- import { defineComponent as b, computed as k, createElementBlock as m, openBlock as r, createVNode as x, createElementVNode as l, normalizeClass as d, createCommentVNode as _, unref as o, toDisplayString as v, Fragment as g, renderList as C, createBlock as N, withCtx as S } from "vue";
2
- import { LibraryIcon as B } from "@scalar/icons/library";
3
- import { useRouter as E, RouterLink as z } from "vue-router";
4
- import { PathId as s } from "../../routes.js";
5
- import I from "./CollectionInfoForm.vue.js";
6
- import { useActiveEntities as L } from "../../store/active-entities.js";
7
- const R = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" }, V = {
1
+ import { defineComponent as x, computed as v, createElementBlock as s, openBlock as o, createVNode as m, createElementVNode as i, normalizeClass as a, createCommentVNode as h, unref as t, toDisplayString as d, Fragment as y, renderList as w, createBlock as b, withCtx as k } from "vue";
2
+ import { LibraryIcon as _ } from "@scalar/icons/library";
3
+ import { useRouter as g, RouterLink as C } from "vue-router";
4
+ import { PathId as n } from "../../routes.js";
5
+ import N from "./CollectionInfoForm.vue.js";
6
+ import { useActiveEntities as S } from "../../store/active-entities.js";
7
+ const B = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" }, E = {
8
8
  key: 0,
9
9
  class: "flex max-w-40 items-center"
10
- }, A = { class: "text-c-1 mr-[6.25px] hidden overflow-hidden px-2 font-medium text-ellipsis whitespace-nowrap md:block" }, G = /* @__PURE__ */ b({
10
+ }, z = { class: "text-c-1 mr-[6.25px] hidden overflow-hidden px-2 font-medium text-ellipsis whitespace-nowrap md:block" }, P = /* @__PURE__ */ x({
11
11
  __name: "CollectionNavigation",
12
12
  props: {
13
13
  isSticky: { type: Boolean }
14
14
  },
15
- setup(F) {
16
- const { currentRoute: p } = E(), { activeCollection: e } = L(), h = k(() => {
17
- var t, a, i, n;
18
- return [
19
- {
20
- displayName: "Overview",
21
- // icon: 'Collection',
22
- to: {
23
- name: "collection.overview",
24
- params: {
25
- [s.Collection]: (t = e.value) == null ? void 0 : t.uid
26
- }
15
+ setup(I) {
16
+ const { currentRoute: c } = g(), { activeCollection: e } = S(), p = v(() => [
17
+ {
18
+ displayName: "Overview",
19
+ // icon: 'Collection',
20
+ to: {
21
+ name: "collection.overview",
22
+ params: {
23
+ [n.Collection]: e.value?.uid
27
24
  }
28
- },
29
- {
30
- displayName: "Servers",
31
- // icon: 'Server',
32
- to: {
33
- name: "collection.servers",
34
- params: {
35
- [s.Collection]: (a = e.value) == null ? void 0 : a.uid
36
- }
37
- }
38
- },
39
- {
40
- displayName: "Authentication",
41
- // icon: 'Lock',
42
- to: {
43
- name: "collection.authentication",
44
- params: {
45
- [s.Collection]: (i = e.value) == null ? void 0 : i.uid
46
- }
25
+ }
26
+ },
27
+ {
28
+ displayName: "Servers",
29
+ // icon: 'Server',
30
+ to: {
31
+ name: "collection.servers",
32
+ params: {
33
+ [n.Collection]: e.value?.uid
47
34
  }
48
- },
49
- {
50
- displayName: "Environment",
51
- // icon: 'Brackets',
52
- to: {
53
- name: "collection.environment",
54
- params: {
55
- [s.Collection]: (n = e.value) == null ? void 0 : n.uid
56
- }
35
+ }
36
+ },
37
+ {
38
+ displayName: "Authentication",
39
+ // icon: 'Lock',
40
+ to: {
41
+ name: "collection.authentication",
42
+ params: {
43
+ [n.Collection]: e.value?.uid
57
44
  }
58
- },
59
- // {
60
- // displayName: 'Cookies',
61
- // // icon: 'Cookie',
62
- // to: {
63
- // name: 'collection.cookies',
64
- // params: {
65
- // [PathId.Collection]: activeCollection.value?.uid,
66
- // },
67
- // },
68
- // },
69
- // {
70
- // displayName: 'Scripts',
71
- // // icon: 'CodeFolder',
72
- // to: {
73
- // name: 'collection.scripts',
74
- // params: {
75
- // [PathId.Collection]: activeCollection.value?.uid,
76
- // },
77
- // },
78
- // },
79
- // {
80
- // displayName: 'Sync',
81
- // // icon: 'Download',
82
- // to: {
83
- // name: 'collection.sync',
84
- // },
85
- // },
86
- {
87
- displayName: "Settings",
88
- // icon: 'Settings',
89
- to: {
90
- name: "collection.settings"
45
+ }
46
+ },
47
+ {
48
+ displayName: "Environment",
49
+ // icon: 'Brackets',
50
+ to: {
51
+ name: "collection.environment",
52
+ params: {
53
+ [n.Collection]: e.value?.uid
91
54
  }
92
55
  }
93
- ];
94
- });
95
- return (t, a) => {
96
- var i, n, u;
97
- return r(), m("div", R, [
98
- x(I),
99
- l("div", {
100
- class: d([
101
- "items-center text-sm font-medium",
102
- t.isSticky ? "h-fit border-b md:grid md:grid-cols-[1fr_720px_1fr] md:px-4" : "flex md:mx-auto md:max-w-[720px]"
103
- ])
56
+ },
57
+ // {
58
+ // displayName: 'Cookies',
59
+ // // icon: 'Cookie',
60
+ // to: {
61
+ // name: 'collection.cookies',
62
+ // params: {
63
+ // [PathId.Collection]: activeCollection.value?.uid,
64
+ // },
65
+ // },
66
+ // },
67
+ // {
68
+ // displayName: 'Scripts',
69
+ // // icon: 'CodeFolder',
70
+ // to: {
71
+ // name: 'collection.scripts',
72
+ // params: {
73
+ // [PathId.Collection]: activeCollection.value?.uid,
74
+ // },
75
+ // },
76
+ // },
77
+ // {
78
+ // displayName: 'Sync',
79
+ // // icon: 'Download',
80
+ // to: {
81
+ // name: 'collection.sync',
82
+ // },
83
+ // },
84
+ {
85
+ displayName: "Settings",
86
+ // icon: 'Settings',
87
+ to: {
88
+ name: "collection.settings"
89
+ }
90
+ }
91
+ ]);
92
+ return (r, L) => (o(), s("div", B, [
93
+ m(N),
94
+ i("div", {
95
+ class: a([
96
+ "items-center text-sm font-medium",
97
+ r.isSticky ? "h-fit border-b md:grid md:grid-cols-[1fr_720px_1fr] md:px-4" : "flex md:mx-auto md:max-w-[720px]"
98
+ ])
99
+ }, [
100
+ r.isSticky ? (o(), s("div", E, [
101
+ m(t(_), {
102
+ class: "text-c-2 hidden size-3.5 md:block",
103
+ src: t(e)?.["x-scalar-icon"] || "interface-content-folder",
104
+ "stroke-width": "2"
105
+ }, null, 8, ["src"]),
106
+ i("span", z, d(t(e)?.info?.title), 1)
107
+ ])) : h("", !0),
108
+ i("div", {
109
+ class: a(["flex w-full max-w-[720px] gap-2 pl-1.5 md:ml-1.5 md:pl-0", !r.isSticky && "border-b"])
104
110
  }, [
105
- t.isSticky ? (r(), m("div", V, [
106
- x(o(B), {
107
- class: "text-c-2 hidden size-3.5 md:block",
108
- src: ((i = o(e)) == null ? void 0 : i["x-scalar-icon"]) || "interface-content-folder",
109
- "stroke-width": "2"
110
- }, null, 8, ["src"]),
111
- l("span", A, v((u = (n = o(e)) == null ? void 0 : n.info) == null ? void 0 : u.title), 1)
112
- ])) : _("", !0),
113
- l("div", {
114
- class: d(["flex w-full max-w-[720px] gap-2 pl-1.5 md:ml-1.5 md:pl-0", !t.isSticky && "border-b"])
115
- }, [
116
- (r(!0), m(g, null, C(h.value, ({ to: c, displayName: y }, w) => (r(), N(o(z), {
117
- key: w,
118
- class: "-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline",
119
- to: c
120
- }, {
121
- default: S(() => {
122
- var f;
123
- return [
124
- l("span", {
125
- class: d([
126
- "flex-center h-full w-full border-b",
127
- typeof c.name == "string" && typeof o(p).name == "string" && ((f = o(p).name) != null && f.startsWith(c.name)) ? "text-c-1 border-c-1" : "text-c-2 hover:text-c-1 border-transparent"
128
- ])
129
- }, v(y), 3)
130
- ];
131
- }),
132
- _: 2
133
- }, 1032, ["to"]))), 128))
134
- ], 2)
111
+ (o(!0), s(y, null, w(p.value, ({ to: l, displayName: u }, f) => (o(), b(t(C), {
112
+ key: f,
113
+ class: "-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline",
114
+ to: l
115
+ }, {
116
+ default: k(() => [
117
+ i("span", {
118
+ class: a([
119
+ "flex-center h-full w-full border-b",
120
+ typeof l.name == "string" && typeof t(c).name == "string" && t(c).name?.startsWith(l.name) ? "text-c-1 border-c-1" : "text-c-2 hover:text-c-1 border-transparent"
121
+ ])
122
+ }, d(u), 3)
123
+ ]),
124
+ _: 2
125
+ }, 1032, ["to"]))), 128))
135
126
  ], 2)
136
- ]);
137
- };
127
+ ], 2)
128
+ ]));
138
129
  }
139
130
  });
140
131
  export {
141
- G as default
132
+ P as default
142
133
  };
@@ -1,37 +1,34 @@
1
- import { defineComponent as u, createBlock as c, openBlock as l, withCtx as v, createCommentVNode as d, unref as e } from "vue";
2
- import f from "../../components/ViewLayout/ViewLayoutSection.vue.js";
3
- import { useActiveEntities as _ } from "../../store/active-entities.js";
4
- import k from "./components/MarkdownInput.vue.js";
5
- import { useWorkspace as V } from "../../store/store.js";
6
- const M = /* @__PURE__ */ u({
1
+ import { defineComponent as m, createBlock as r, openBlock as a, withCtx as p, createCommentVNode as u, unref as e } from "vue";
2
+ import v from "../../components/ViewLayout/ViewLayoutSection.vue.js";
3
+ import { useActiveEntities as d } from "../../store/active-entities.js";
4
+ import f from "./components/MarkdownInput.vue.js";
5
+ import { useWorkspace as _ } from "../../store/store.js";
6
+ const h = /* @__PURE__ */ m({
7
7
  __name: "CollectionOverview",
8
- setup(C) {
8
+ setup(k) {
9
9
  const {
10
10
  activeCollection: o,
11
11
  activeEnvironment: t,
12
- activeEnvVariables: s,
12
+ activeEnvVariables: c,
13
13
  activeWorkspace: n
14
- } = _(), { collectionMutators: m } = V(), p = (i) => {
15
- o.value && m.edit(o.value.uid, "info.description", i);
14
+ } = d(), { collectionMutators: l } = _(), s = (i) => {
15
+ o.value && l.edit(o.value.uid, "info.description", i);
16
16
  };
17
- return (i, w) => (l(), c(f, null, {
18
- default: v(() => {
19
- var r, a;
20
- return [
21
- e(t) && e(n) ? (l(), c(k, {
22
- key: 0,
23
- envVariables: e(s),
24
- environment: e(t),
25
- modelValue: ((a = (r = e(o)) == null ? void 0 : r.info) == null ? void 0 : a.description) ?? "",
26
- workspace: e(n),
27
- "onUpdate:modelValue": p
28
- }, null, 8, ["envVariables", "environment", "modelValue", "workspace"])) : d("", !0)
29
- ];
30
- }),
17
+ return (i, V) => (a(), r(v, null, {
18
+ default: p(() => [
19
+ e(t) && e(n) ? (a(), r(f, {
20
+ key: 0,
21
+ envVariables: e(c),
22
+ environment: e(t),
23
+ modelValue: e(o)?.info?.description ?? "",
24
+ workspace: e(n),
25
+ "onUpdate:modelValue": s
26
+ }, null, 8, ["envVariables", "environment", "modelValue", "workspace"])) : u("", !0)
27
+ ]),
31
28
  _: 1
32
29
  }));
33
30
  }
34
31
  });
35
32
  export {
36
- M as default
33
+ h as default
37
34
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as h, computed as v, watch as k, useTemplateRef as x, createElementBlock as c, openBlock as i, normalizeClass as E, createCommentVNode as p, Fragment as S, createVNode as y, createBlock as C } from "vue";
1
+ import { defineComponent as h, computed as c, watch as k, useTemplateRef as x, createElementBlock as v, openBlock as s, normalizeClass as C, createCommentVNode as n, Fragment as E, createVNode as S, createBlock as y } from "vue";
2
2
  import { REGEX as g } from "@scalar/oas-utils/helpers";
3
3
  import { emitCustomEvent as u } from "@scalar/workspace-store/events";
4
4
  import w from "../../components/Form/Form.vue.js";
@@ -11,8 +11,8 @@ const $ = /* @__PURE__ */ h({
11
11
  collectionId: { default: "" },
12
12
  serverUid: { default: "" }
13
13
  },
14
- setup(n) {
15
- const l = n, { activeWorkspaceCollections: d } = B(), { servers: f, serverMutators: s } = R(), m = [
14
+ setup(p) {
15
+ const l = p, { activeWorkspaceCollections: d } = B(), { servers: f, serverMutators: o } = R(), m = [
16
16
  {
17
17
  label: "URL",
18
18
  key: "url",
@@ -25,28 +25,25 @@ const $ = /* @__PURE__ */ h({
25
25
  placeholder: "Production",
26
26
  type: "text"
27
27
  }
28
- ], t = v(() => {
28
+ ], r = c(() => {
29
29
  const e = d.value.find(
30
- (r) => r.uid === l.collectionId
30
+ (t) => t.uid === l.collectionId
31
31
  );
32
- return f[e && typeof l.serverUid == "string" && l.serverUid === "default" ? e.servers[0] ?? "" : (e == null ? void 0 : e.servers.find((r) => r === l.serverUid)) ?? ""];
33
- }), b = v(() => {
34
- var e, r;
35
- return (e = t.value) != null && e.url ? ((r = t.value.url.match(g.PATH)) == null ? void 0 : r.map((a) => a.slice(1, -1))) ?? [] : [];
36
- });
32
+ return f[e && typeof l.serverUid == "string" && l.serverUid === "default" ? e.servers[0] ?? "" : e?.servers.find((t) => t === l.serverUid) ?? ""];
33
+ }), b = c(() => r.value?.url ? r.value.url.match(g.PATH)?.map((e) => e.slice(1, -1)) ?? [] : []);
37
34
  k(
38
35
  b,
39
36
  (e) => {
40
- if (!t.value)
37
+ if (!r.value)
41
38
  return;
42
- const r = t.value.variables ? { ...t.value.variables } : {};
43
- Object.keys(r).forEach((a) => {
44
- e.includes(a) || delete r[a];
39
+ const t = r.value.variables ? { ...r.value.variables } : {};
40
+ Object.keys(t).forEach((a) => {
41
+ e.includes(a) || delete t[a];
45
42
  }), e.forEach((a) => {
46
- r[a] || (r[a] = { default: "" });
47
- }), s.edit(t.value.uid, "variables", r), u(o.value, "store-update-selected-server-properties", {
43
+ t[a] || (t[a] = { default: "" });
44
+ }), o.edit(r.value.uid, "variables", t), u(i.value, "store-update-selected-server-properties", {
48
45
  key: "variables",
49
- value: r,
46
+ value: t,
50
47
  options: {
51
48
  disableOldStoreUpdate: !0
52
49
  }
@@ -54,46 +51,43 @@ const $ = /* @__PURE__ */ h({
54
51
  },
55
52
  { immediate: !0 }
56
53
  );
57
- const U = (e, r) => {
58
- !d.value || !t.value || (s.edit(t.value.uid, e, r), (e === "url" || e === "description") && u(o.value, "store-update-selected-server-properties", {
54
+ const U = (e, t) => {
55
+ !d.value || !r.value || (o.edit(r.value.uid, e, t), (e === "url" || e === "description") && u(i.value, "store-update-selected-server-properties", {
59
56
  key: e,
60
- value: r,
57
+ value: t,
61
58
  options: {
62
59
  disableOldStoreUpdate: !0
63
60
  }
64
61
  }));
65
- }, _ = (e, r) => {
66
- if (!t.value)
62
+ }, _ = (e, t) => {
63
+ if (!r.value)
67
64
  return;
68
- const a = t.value.variables || {};
69
- a[e] = { ...a[e], default: r }, s.edit(t.value.uid, "variables", a), u(o.value, "store-update-selected-server-properties", {
65
+ const a = r.value.variables || {};
66
+ a[e] = { ...a[e], default: t }, o.edit(r.value.uid, "variables", a), u(i.value, "store-update-selected-server-properties", {
70
67
  key: "variables",
71
68
  value: a,
72
69
  options: {
73
70
  disableOldStoreUpdate: !0
74
71
  }
75
72
  });
76
- }, o = x("wrapper-ref");
77
- return (e, r) => {
78
- var a;
79
- return i(), c("div", {
80
- ref: "wrapper-ref",
81
- class: E(["divide-0.5 flex w-full flex-col divide-y rounded-b-lg text-sm", ((a = t.value) == null ? void 0 : a.variables) && "bg-b-1"])
82
- }, [
83
- t.value ? (i(), c(S, { key: 0 }, [
84
- y(w, {
85
- data: t.value,
86
- onUpdate: U,
87
- options: m
88
- }, null, 8, ["data"]),
89
- t.value.variables ? (i(), C(O, {
90
- key: 0,
91
- variables: t.value.variables,
92
- "onUpdate:variable": _
93
- }, null, 8, ["variables"])) : p("", !0)
94
- ], 64)) : p("", !0)
95
- ], 2);
96
- };
73
+ }, i = x("wrapper-ref");
74
+ return (e, t) => (s(), v("div", {
75
+ ref: "wrapper-ref",
76
+ class: C(["divide-0.5 flex w-full flex-col divide-y rounded-b-lg text-sm", r.value?.variables && "bg-b-1"])
77
+ }, [
78
+ r.value ? (s(), v(E, { key: 0 }, [
79
+ S(w, {
80
+ data: r.value,
81
+ onUpdate: U,
82
+ options: m
83
+ }, null, 8, ["data"]),
84
+ r.value.variables ? (s(), y(O, {
85
+ key: 0,
86
+ variables: r.value.variables,
87
+ "onUpdate:variable": _
88
+ }, null, 8, ["variables"])) : n("", !0)
89
+ ], 64)) : n("", !0)
90
+ ], 2));
97
91
  }
98
92
  });
99
93
  export {