@scalar/api-client 2.1.18 → 2.1.20

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 (213) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts +5 -1
  3. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  4. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  5. package/dist/components/AddressBar/AddressBar.vue2.js +70 -69
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
  7. package/dist/components/AddressBar/AddressBarHistory.vue2.js +8 -8
  8. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  9. package/dist/components/AddressBar/AddressBarServer.vue.js +29 -29
  10. package/dist/components/CodeInput/CodeInput.vue.d.ts +6 -2
  11. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  12. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  13. package/dist/components/CodeInput/CodeInput.vue2.js +57 -49
  14. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +1 -1
  15. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  16. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +1 -1
  18. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts +1 -1
  19. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -45
  21. package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts +1 -1
  22. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +1 -1
  23. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +13 -7
  24. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  25. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  26. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +87 -89
  27. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  28. package/dist/components/ContextBar.vue.js +2 -2
  29. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts +19 -3
  30. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  31. package/dist/components/DataTable/DataTableCheckbox.vue.js +27 -14
  32. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  33. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +8 -8
  34. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  35. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  36. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +29 -32
  37. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts +39 -0
  38. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +1 -0
  39. package/dist/components/ImportCurl/ImportCurlModal.vue.js +7 -0
  40. package/dist/components/ImportCurl/ImportCurlModal.vue2.js +88 -0
  41. package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
  42. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  43. package/dist/components/SideNav/SideNav.vue.js +1 -1
  44. package/dist/components/SideNav/SideNav.vue2.js +37 -26
  45. package/dist/components/SideNav/SideNavLink.vue.d.ts +2 -2
  46. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  47. package/dist/components/SideNav/SideNavLink.vue.js +10 -11
  48. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +1 -1
  49. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  50. package/dist/components/Sidebar/Sidebar.vue.js +1 -1
  51. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  52. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  53. package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
  54. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +24 -3
  55. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  56. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  57. package/dist/components/Sidebar/SidebarListElement.vue2.js +26 -22
  58. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +4 -0
  59. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  60. package/dist/components/Sidebar/SidebarListElementActions.vue.js +35 -32
  61. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  62. package/dist/components/TopNav/TopNav.vue.js +3 -3
  63. package/dist/components/TopNav/TopNav.vue2.js +41 -40
  64. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  65. package/dist/components/ViewLayout/ViewLayout.vue.js +7 -7
  66. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  67. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  68. package/dist/components/ViewLayout/ViewLayoutContent.vue.d.ts.map +1 -1
  69. package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
  70. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  71. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +11 -11
  72. package/dist/constants.d.ts +4 -0
  73. package/dist/constants.d.ts.map +1 -1
  74. package/dist/constants.js +2 -1
  75. package/dist/hooks/useDarkModeState.d.ts +4 -3
  76. package/dist/hooks/useDarkModeState.d.ts.map +1 -1
  77. package/dist/hooks/useDarkModeState.js +36 -21
  78. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  79. package/dist/layouts/App/ApiClientApp.vue.js +40 -44
  80. package/dist/layouts/App/create-api-client-app.d.ts +46 -36
  81. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  82. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  83. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  84. package/dist/layouts/Modal/ApiClientModal.vue2.js +17 -17
  85. package/dist/layouts/Modal/create-api-client-modal.d.ts +92 -72
  86. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  87. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  88. package/dist/layouts/Web/ApiClientWeb.vue.js +30 -34
  89. package/dist/layouts/Web/create-api-client-web.d.ts +46 -36
  90. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  91. package/dist/libs/create-client.d.ts +46 -36
  92. package/dist/libs/create-client.d.ts.map +1 -1
  93. package/dist/libs/event-bus.d.ts +41 -0
  94. package/dist/libs/event-bus.d.ts.map +1 -0
  95. package/dist/libs/event-bus.js +32 -0
  96. package/dist/libs/{event-busses/hot-keys-bus.d.ts → hot-keys.d.ts} +6 -7
  97. package/dist/libs/hot-keys.d.ts.map +1 -0
  98. package/dist/libs/hot-keys.js +45 -0
  99. package/dist/libs/importers/curl.d.ts +3 -0
  100. package/dist/libs/importers/curl.d.ts.map +1 -0
  101. package/dist/libs/importers/curl.js +61 -0
  102. package/dist/libs/importers/index.d.ts +2 -0
  103. package/dist/libs/importers/index.d.ts.map +1 -0
  104. package/dist/libs/importers/index.js +4 -0
  105. package/dist/libs/index.d.ts +4 -1
  106. package/dist/libs/index.d.ts.map +1 -1
  107. package/dist/libs/index.js +31 -31
  108. package/dist/libs/parse-curl.d.ts +12 -0
  109. package/dist/libs/parse-curl.d.ts.map +1 -0
  110. package/dist/libs/parse-curl.js +70 -0
  111. package/dist/libs/send-request.d.ts +4 -1
  112. package/dist/libs/send-request.d.ts.map +1 -1
  113. package/dist/libs/send-request.js +103 -103
  114. package/dist/router.d.ts +2 -1
  115. package/dist/router.d.ts.map +1 -1
  116. package/dist/router.js +33 -24
  117. package/dist/store/collections.d.ts +4 -4
  118. package/dist/store/cookies.d.ts +4 -4
  119. package/dist/store/environment.d.ts +4 -4
  120. package/dist/store/events.d.ts +29 -0
  121. package/dist/store/events.d.ts.map +1 -0
  122. package/dist/store/events.js +31 -0
  123. package/dist/store/request-example.d.ts +4 -4
  124. package/dist/store/requests.d.ts +4 -4
  125. package/dist/store/router-params.d.ts +1 -0
  126. package/dist/store/router-params.d.ts.map +1 -1
  127. package/dist/store/router-params.js +2 -1
  128. package/dist/store/security-schemes.d.ts +4 -4
  129. package/dist/store/servers.d.ts +4 -4
  130. package/dist/store/store.d.ts +92 -72
  131. package/dist/store/store.d.ts.map +1 -1
  132. package/dist/store/store.js +138 -129
  133. package/dist/store/tags.d.ts +4 -4
  134. package/dist/store/workspace.d.ts +4 -4
  135. package/dist/style.css +1 -1
  136. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  137. package/dist/views/Cookies/Cookies.vue2.js +18 -18
  138. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  139. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +9 -9
  140. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  141. package/dist/views/Request/Request.vue.js +1 -1
  142. package/dist/views/Request/Request.vue2.js +148 -98
  143. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  144. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  145. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +1 -1
  146. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  147. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +4 -4
  148. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  149. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  150. package/dist/views/Request/RequestSidebar.vue2.js +101 -102
  151. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  152. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  153. package/dist/views/Request/RequestSidebarItem.vue2.js +73 -73
  154. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  155. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  156. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +33 -34
  157. package/dist/views/Request/RequestSubpageHeader.vue.d.ts +2 -0
  158. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  159. package/dist/views/Request/RequestSubpageHeader.vue.js +4 -4
  160. package/dist/views/Request/RequestSubpageHeader.vue2.js +17 -15
  161. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts +16 -0
  162. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts.map +1 -0
  163. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +31 -0
  164. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +5 -0
  165. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  166. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  167. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -33
  168. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  169. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +3 -3
  170. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +18 -19
  171. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  172. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +20 -20
  173. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  174. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +68 -56
  175. package/dist/views/Request/components/WorkspaceDropdown.vue.js +29 -30
  176. package/dist/views/Settings/Settings.vue.d.ts +4 -0
  177. package/dist/views/Settings/Settings.vue.d.ts.map +1 -0
  178. package/dist/views/Settings/Settings.vue.js +4 -0
  179. package/dist/views/Settings/Settings.vue2.js +59 -0
  180. package/dist/{components/DarkModeToggle/DarkModeIconToggle.vue.d.ts → views/Settings/SettingsGeneral.vue.d.ts} +1 -1
  181. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -0
  182. package/dist/views/Settings/SettingsGeneral.vue.js +124 -0
  183. package/dist/views/Settings/SettingsGeneral.vue2.js +4 -0
  184. package/dist/views/Settings/SettingsGeneralMode.vue.d.ts +3 -0
  185. package/dist/views/Settings/SettingsGeneralMode.vue.d.ts.map +1 -0
  186. package/dist/views/Settings/SettingsGeneralMode.vue.js +78 -0
  187. package/dist/views/Settings/SettingsGeneralMode.vue2.js +4 -0
  188. package/package.json +59 -35
  189. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +0 -1
  190. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +0 -31
  191. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue2.js +0 -4
  192. package/dist/components/DarkModeToggle/index.d.ts +0 -2
  193. package/dist/components/DarkModeToggle/index.d.ts.map +0 -1
  194. package/dist/components/DarkModeToggle/index.js +0 -4
  195. package/dist/components/ScreenReader.vue.js +0 -7
  196. package/dist/components/ScreenReader.vue2.js +0 -18
  197. package/dist/libs/event-busses/cancel-request-bus.d.ts +0 -2
  198. package/dist/libs/event-busses/cancel-request-bus.d.ts.map +0 -1
  199. package/dist/libs/event-busses/cancel-request-bus.js +0 -5
  200. package/dist/libs/event-busses/command-palette-bus.d.ts +0 -14
  201. package/dist/libs/event-busses/command-palette-bus.d.ts.map +0 -1
  202. package/dist/libs/event-busses/command-palette-bus.js +0 -5
  203. package/dist/libs/event-busses/execute-request-bus.d.ts +0 -2
  204. package/dist/libs/event-busses/execute-request-bus.d.ts.map +0 -1
  205. package/dist/libs/event-busses/execute-request-bus.js +0 -5
  206. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +0 -1
  207. package/dist/libs/event-busses/hot-keys-bus.js +0 -47
  208. package/dist/libs/event-busses/index.d.ts +0 -6
  209. package/dist/libs/event-busses/index.d.ts.map +0 -1
  210. package/dist/libs/event-busses/index.js +0 -15
  211. package/dist/libs/event-busses/request-status-bus.d.ts +0 -5
  212. package/dist/libs/event-busses/request-status-bus.d.ts.map +0 -1
  213. package/dist/libs/event-busses/request-status-bus.js +0 -5
@@ -1,192 +1,192 @@
1
- import { ERRORS as T, normalizeError as L } from "./errors.js";
1
+ import { ERRORS as L, normalizeError as P } from "./errors.js";
2
2
  import { normalizeHeaders as M } from "./normalize-headers.js";
3
- import { replaceTemplateVariables as u } from "./string-template.js";
4
- import { isRelativePath as E, shouldUseProxy as B, canMethodHaveBody as z } from "@scalar/oas-utils/helpers";
5
- import k from "js-cookie";
3
+ import { replaceTemplateVariables as f } from "./string-template.js";
4
+ import { canMethodHaveBody as z, isRelativePath as E, shouldUseProxy as B } from "@scalar/oas-utils/helpers";
5
+ import R from "js-cookie";
6
6
  import H from "whatwg-mimetype";
7
- import { requestStatusBus as S } from "./event-busses/request-status-bus.js";
8
- import { textMediaTypes as q } from "../views/Request/consts/mediaTypes.js";
9
- function K(r, n) {
7
+ import { textMediaTypes as K } from "../views/Request/consts/mediaTypes.js";
8
+ function _(r, n) {
10
9
  const o = new H(n);
11
- if (q.includes(o.essence)) {
12
- const c = new TextDecoder(o.parameters.get("charset")).decode(r);
13
- return o.subtype === "json" ? JSON.parse(c) : c;
10
+ if (K.includes(o.essence)) {
11
+ const d = new TextDecoder(o.parameters.get("charset")).decode(r);
12
+ return o.subtype === "json" ? JSON.parse(d) : d;
14
13
  }
15
14
  return new Blob([r], { type: o.essence });
16
15
  }
17
- function _(r, n) {
16
+ function q(r, n) {
18
17
  const o = {};
19
- return r.parameters.headers.forEach((t) => {
20
- const c = t.key.trim().toLowerCase();
21
- t.enabled && (c !== "content-type" || t.value !== "multipart/form-data") && (o[c] = u(t.value, n));
18
+ return r.parameters.headers.forEach((e) => {
19
+ const d = e.key.trim().toLowerCase();
20
+ e.enabled && (d !== "content-type" || e.value !== "multipart/form-data") && (o[d] = f(e.value, n));
22
21
  }), o;
23
22
  }
24
23
  function j(r, n) {
25
24
  const o = new URLSearchParams();
26
- return r.parameters.query.forEach((t) => {
27
- t.enabled && t.value && o.append(t.key, u(t.value, n));
25
+ return r.parameters.query.forEach((e) => {
26
+ e.enabled && e.value && o.append(e.key, f(e.value, n));
28
27
  }), o;
29
28
  }
30
29
  function N({
31
30
  example: r,
32
31
  env: n,
33
32
  globalCookies: o,
34
- domain: t,
35
- proxy: c
33
+ domain: e,
34
+ proxy: d
36
35
  }) {
37
- let d;
36
+ let h;
38
37
  try {
39
- d = new URL(c || t).host;
38
+ h = new URL(d || e).host;
40
39
  } catch {
41
- typeof window < "u" && (d = window.location.host);
40
+ typeof window < "u" && (h = window.location.host);
42
41
  }
43
- const l = {
42
+ const i = {
44
43
  // Must point all cookies to the proxy and let it sort them out
45
- domain: d,
44
+ domain: h,
46
45
  // Means that the browser sends the cookie with both cross-site and same-site requests.
47
46
  sameSite: "None",
48
47
  // The Secure attribute must also be set when setting SameSite=None.
49
48
  secure: !0
50
- }, f = k.get();
51
- return Object.keys(f).forEach((e) => k.remove(e)), r.parameters.cookies.forEach((e) => {
52
- e.enabled && k.set(e.key, u(e.value, n));
53
- }), o.forEach((e) => {
54
- var i;
55
- const { name: R, value: v, ...m } = e;
56
- (m.domain === t || ((i = m.domain) == null ? void 0 : i.startsWith(".")) && t.endsWith(m.domain ?? "")) && k.set(R, v, {
49
+ }, l = R.get();
50
+ return Object.keys(l).forEach((a) => R.remove(a)), r.parameters.cookies.forEach((a) => {
51
+ a.enabled && R.set(a.key, f(a.value, n));
52
+ }), o.forEach((a) => {
53
+ var u;
54
+ const { name: s, value: g, ...p } = a;
55
+ (p.domain === e || ((u = p.domain) == null ? void 0 : u.startsWith(".")) && e.endsWith(p.domain ?? "")) && R.set(s, g, {
57
56
  /** Override the domain with the proxy value */
58
- domain: d,
57
+ domain: h,
59
58
  // TODO: path cookies probably don't worth with the proxy
60
- path: m.path,
61
- expires: m.expires ? new Date(m.expires) : void 0,
62
- httpOnly: m.httpOnly,
63
- secure: m.secure
59
+ path: p.path,
60
+ expires: p.expires ? new Date(p.expires) : void 0,
61
+ httpOnly: p.httpOnly,
62
+ secure: p.secure
64
63
  });
65
64
  }), {
66
- cookieParams: l
65
+ cookieParams: i
67
66
  };
68
67
  }
69
68
  function Q(r, n, o) {
70
- var t, c, d;
69
+ var e, d, h;
71
70
  if (!z(r))
72
71
  return { body: void 0, contentType: void 0 };
73
72
  if (n.body.activeBody === "formData" && n.body.formData) {
74
- const l = n.body.formData.encoding === "form-data" ? "multipart/form-data" : "application/x-www-form-urlencoded", f = n.body.formData.encoding === "form-data" ? new FormData() : new URLSearchParams();
75
- return n.body.formData.value.forEach((e) => {
76
- !e.enabled || !e.key || (e.file && f instanceof FormData ? f.append(e.key, e.file, e.file.name) : e.value !== void 0 && f.append(e.key, u(e.value, o)));
77
- }), { body: f, contentType: l };
73
+ const i = n.body.formData.encoding === "form-data" ? "multipart/form-data" : "application/x-www-form-urlencoded", l = n.body.formData.encoding === "form-data" ? new FormData() : new URLSearchParams();
74
+ return n.body.formData.value.forEach((a) => {
75
+ !a.enabled || !a.key || (a.file && l instanceof FormData ? l.append(a.key, a.file, a.file.name) : a.value !== void 0 && l.append(a.key, f(a.value, o)));
76
+ }), { body: l, contentType: i };
78
77
  }
79
78
  return n.body.activeBody === "raw" ? {
80
- body: u(((t = n.body.raw) == null ? void 0 : t.value) ?? "", o),
81
- contentType: (c = n.body.raw) == null ? void 0 : c.encoding
79
+ body: f(((e = n.body.raw) == null ? void 0 : e.value) ?? "", o),
80
+ contentType: (d = n.body.raw) == null ? void 0 : d.encoding
82
81
  } : n.body.activeBody === "binary" ? {
83
82
  body: n.body.binary,
84
- contentType: (d = n.body.binary) == null ? void 0 : d.type
83
+ contentType: (h = n.body.binary) == null ? void 0 : h.type
85
84
  } : {
86
85
  body: void 0,
87
86
  contentType: void 0
88
87
  };
89
88
  }
90
- const te = ({
89
+ const x = ({
91
90
  request: r,
92
91
  auth: n,
93
92
  example: o,
94
- server: t,
95
- securitySchemes: c,
96
- proxy: d,
93
+ server: e,
94
+ securitySchemes: d,
95
+ proxy: h,
96
+ status: i,
97
97
  environment: l,
98
- globalCookies: f
98
+ globalCookies: a
99
99
  }) => {
100
100
  try {
101
- const e = l ?? {}, R = new AbortController(), v = o.parameters.path.reduce((p, a) => (a.enabled && (p[a.key] = u(a.value, e)), p), {}), m = u((t == null ? void 0 : t.url) ?? "", e), y = u(r.path, v);
102
- let i = m || y;
103
- if (!i) throw T.URL_EMPTY;
104
- const P = j(o, e), w = _(o, e), { body: C } = Q(r.method, o, e), { cookieParams: V } = N({
101
+ const s = l ?? {}, g = new AbortController(), p = o.parameters.path.reduce((w, t) => (t.enabled && (w[t.key] = f(t.value, s)), w), {}), D = f((e == null ? void 0 : e.url) ?? "", s), u = f(r.path, p);
102
+ let m = D || u;
103
+ if (!m) throw L.URL_EMPTY;
104
+ const T = j(o, s), b = q(o, s), { body: C } = Q(r.method, o, s);
105
+ return N({
105
106
  example: o,
106
- env: e,
107
- globalCookies: f,
108
- domain: i,
109
- proxy: d
110
- });
111
- return r.selectedSecuritySchemeUids.forEach((p) => {
112
- const a = n[p], h = c[p];
113
- if (!(!a || !h)) {
114
- if (h.type === "apiKey" && a.type === "apiKey") {
115
- const s = u(a.value, e);
116
- h.in === "header" && (w[a.name] = s), h.in === "query" && P.append(a.name, s), h.in === "cookie" && k.set(a.name, s);
107
+ env: s,
108
+ globalCookies: a,
109
+ domain: m,
110
+ proxy: h
111
+ }), r.selectedSecuritySchemeUids.forEach((w) => {
112
+ const t = n[w], y = d[w];
113
+ if (!(!t || !y)) {
114
+ if (y.type === "apiKey" && t.type === "apiKey") {
115
+ const c = f(t.value, s);
116
+ y.in === "header" && (b[t.name] = c), y.in === "query" && T.append(t.name, c), y.in === "cookie" && R.set(t.name, c);
117
117
  }
118
- if (h.type === "http" && a.type === "http")
119
- if (h.scheme === "basic") {
120
- const s = u(a.username, e), U = u(a.password, e), D = `${s}:${U}`;
121
- w.Authorization = `Basic ${btoa(D)}`;
118
+ if (y.type === "http" && t.type === "http")
119
+ if (y.scheme === "basic") {
120
+ const c = f(t.username, s), S = f(t.password, s), U = `${c}:${S}`;
121
+ b.Authorization = `Basic ${btoa(U)}`;
122
122
  } else {
123
- const s = u(a.token, e);
124
- w.Authorization = `Bearer ${s}`;
123
+ const c = f(t.token, s);
124
+ b.Authorization = `Bearer ${c}`;
125
125
  }
126
- h.type === "oauth2" && a.type.includes("oauth") && "token" in a && (a.token || console.error("OAuth token was not created"), w.Authorization = `Bearer ${a.token}`);
126
+ y.type === "oauth2" && t.type.includes("oauth") && "token" in t && (t.token || console.error("OAuth token was not created"), b.Authorization = `Bearer ${t.token}`);
127
127
  }
128
128
  }), [
129
129
  null,
130
130
  {
131
131
  sendRequest: async () => {
132
- S.emit("start");
133
- const p = Date.now();
132
+ i == null || i.emit("start");
133
+ const w = Date.now();
134
134
  try {
135
- if (i && (!E(i) || typeof window < "u")) {
136
- const O = E(i) ? window.location.origin + i : i, b = new URL(O), $ = new URL(y, b.origin), g = new URL(b);
137
- t != null && t.url && (b.pathname === "/" ? g.pathname = y : g.pathname = b.pathname + y), g.search = new URLSearchParams([
138
- ...b.searchParams,
135
+ if (m && (!E(m) || typeof window < "u")) {
136
+ const O = E(m) ? window.location.origin + m : m, k = new URL(O), $ = new URL(u, k.origin), v = new URL(k);
137
+ e != null && e.url && (k.pathname === "/" ? v.pathname = u : v.pathname = k.pathname + u), v.search = new URLSearchParams([
138
+ ...k.searchParams,
139
139
  ...$.searchParams,
140
- ...P
141
- ]).toString(), i = g.toString();
140
+ ...T
141
+ ]).toString(), m = v.toString();
142
142
  }
143
- const a = new URLSearchParams([["scalar_url", i.toString()]]), h = B(d, i) ? `${d}?${a.toString()}` : i, s = await fetch(h, {
144
- signal: R.signal,
143
+ const t = new URLSearchParams([["scalar_url", m.toString()]]), y = B(h, m) ? `${h}?${t.toString()}` : m, c = await fetch(y, {
144
+ signal: g.signal,
145
145
  method: r.method.toUpperCase(),
146
146
  body: C,
147
- headers: w
147
+ headers: b
148
148
  });
149
- S.emit("stop");
150
- const U = M(
151
- s.headers,
152
- B(d, i)
153
- ), D = s.headers.get("content-type") ?? "text/plain;charset=UTF-8", A = K(
154
- await s.arrayBuffer(),
155
- D
156
- ), F = "getSetCookie" in s.headers && typeof s.headers.getSetCookie == "function" ? s.headers.getSetCookie() : [];
149
+ i == null || i.emit("stop");
150
+ const S = M(
151
+ c.headers,
152
+ B(h, m)
153
+ ), U = c.headers.get("content-type") ?? "text/plain;charset=UTF-8", A = _(
154
+ await c.arrayBuffer(),
155
+ U
156
+ ), F = "getSetCookie" in c.headers && typeof c.headers.getSetCookie == "function" ? c.headers.getSetCookie() : [];
157
157
  return [
158
158
  null,
159
159
  {
160
160
  timestamp: Date.now(),
161
161
  request: o,
162
162
  response: {
163
- ...s,
164
- headers: U,
163
+ ...c,
164
+ headers: S,
165
165
  cookieHeaderKeys: F,
166
166
  data: A,
167
- duration: Date.now() - p,
167
+ duration: Date.now() - w,
168
168
  method: r.method,
169
- status: s.status,
170
- path: y
169
+ status: c.status,
170
+ path: u
171
171
  }
172
172
  }
173
173
  ];
174
- } catch (a) {
175
- return S.emit("abort"), [L(a, T.REQUEST_FAILED), null];
174
+ } catch (t) {
175
+ return i == null || i.emit("abort"), [P(t, L.REQUEST_FAILED), null];
176
176
  }
177
177
  },
178
- controller: R
178
+ controller: g
179
179
  }
180
180
  ];
181
- } catch (e) {
182
- return S.emit("abort"), [L(e), null];
181
+ } catch (s) {
182
+ return i == null || i.emit("abort"), [P(s), null];
183
183
  }
184
184
  };
185
185
  export {
186
186
  Q as createFetchBody,
187
- _ as createFetchHeaders,
187
+ q as createFetchHeaders,
188
188
  j as createFetchQueryParams,
189
- te as createRequestOperation,
190
- K as decodeBuffer,
189
+ x as createRequestOperation,
190
+ _ as decodeBuffer,
191
191
  N as setRequestCookies
192
192
  };
package/dist/router.d.ts CHANGED
@@ -7,7 +7,8 @@ export declare enum PathId {
7
7
  Schema = "schema",
8
8
  Environment = "environment",
9
9
  Servers = "servers",
10
- Workspace = "workspace"
10
+ Workspace = "workspace",
11
+ Settings = "settings"
11
12
  }
12
13
  /** Routes required by the API client modal */
13
14
  export declare const modalRoutes: ({
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAM7B,MAAM,YAAY,CAAA;AAEnB,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAwBD,8CAA8C;AAC9C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;IAaI,CAAA;AA2E5B,oCAAoC;AACpC,eAAO,MAAM,MAAM,6BAGjB,CAAA;AAEF,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,mCAI5B,CAAA;AAEJ,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,mCAI1B,CAAA;AAKJ,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,EAAE,EAAE,uBAAuB,QAGxD;AAED,+DAA+D;AAC/D,wBAAgB,0BAA0B,WAGzC;AAED,gGAAgG;AAChG,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,QAmBtC"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAM7B,MAAM,YAAY,CAAA;AAEnB,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;CACtB;AAwBD,8CAA8C;AAC9C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;IAaI,CAAA;AAoF5B,oCAAoC;AACpC,eAAO,MAAM,MAAM,6BAGjB,CAAA;AAEF,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,mCAI5B,CAAA;AAEJ,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,mCAI1B,CAAA;AAKJ,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,EAAE,EAAE,uBAAuB,QAGxD;AAED,+DAA+D;AAC/D,wBAAgB,0BAA0B,WAGzC;AAED,gGAAgG;AAChG,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,QAmBtC"}
package/dist/router.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createRouter as a, createWebHistory as l, createWebHashHistory as i, createMemoryHistory as m } from "vue-router";
2
- var f = /* @__PURE__ */ ((e) => (e.Request = "request", e.Examples = "examples", e.Cookies = "cookies", e.Collection = "collection", e.Schema = "schema", e.Environment = "environment", e.Servers = "servers", e.Workspace = "workspace", e))(f || {});
3
- const p = [
2
+ var f = /* @__PURE__ */ ((e) => (e.Request = "request", e.Examples = "examples", e.Cookies = "cookies", e.Collection = "collection", e.Schema = "schema", e.Environment = "environment", e.Servers = "servers", e.Workspace = "workspace", e.Settings = "settings", e))(f || {});
3
+ const n = [
4
4
  {
5
5
  path: "",
6
6
  redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/request/default`
@@ -30,9 +30,9 @@ const p = [
30
30
  },
31
31
  {
32
32
  path: "/workspace/:workspace",
33
- children: p
33
+ children: n
34
34
  }
35
- ], u = [
35
+ ], p = [
36
36
  {
37
37
  path: "/",
38
38
  redirect: c
@@ -44,7 +44,7 @@ const p = [
44
44
  {
45
45
  path: "/workspace/:workspace",
46
46
  children: [
47
- ...p,
47
+ ...n,
48
48
  // {
49
49
  // path: 'collection',
50
50
  // redirect: (to) =>
@@ -99,44 +99,53 @@ const p = [
99
99
  name: "servers",
100
100
  path: "servers/:servers",
101
101
  component: () => import("./views/Servers/Servers.vue.js")
102
+ },
103
+ {
104
+ path: "settings",
105
+ redirect: (e) => `${e.fullPath.replace(/\/$/, "")}/general`
106
+ },
107
+ {
108
+ name: "settings",
109
+ path: "settings/:settings",
110
+ component: () => import("./views/Settings/Settings.vue.js")
102
111
  }
103
112
  ]
104
113
  }
105
- ], r = a({
114
+ ], t = a({
106
115
  history: l(),
107
- routes: u
108
- }), d = () => a({
116
+ routes: p
117
+ }), k = () => a({
109
118
  history: i(),
110
- routes: u
111
- }), v = () => a({
119
+ routes: p
120
+ }), d = () => a({
112
121
  history: m(),
113
122
  routes: h
114
- }), n = "activeWorkspace";
115
- function $(e) {
116
- const t = e.params.workspace;
117
- t && localStorage.setItem(n, `${t}`);
123
+ }), u = "activeWorkspace";
124
+ function v(e) {
125
+ const r = e.params.workspace;
126
+ r && localStorage.setItem(u, `${r}`);
118
127
  }
119
128
  function c() {
120
- return `/workspace/${localStorage.getItem(n) ?? "default"}/request/default`;
129
+ return `/workspace/${localStorage.getItem(u) ?? "default"}/request/default`;
121
130
  }
122
- function w(e, t) {
131
+ function w(e, r) {
123
132
  var o, s;
124
- r.currentRoute.value && // If the item is missing then we know the UID is no longer in use and redirect to the default
125
- !t && ((o = r.currentRoute.value) != null && o.params[e]) && ((s = r.currentRoute.value) == null ? void 0 : s.params[e]) !== "default" && // We only redirect if the key is missing for the matching route
126
- r.currentRoute.value.path.includes(e) && r.push({
133
+ t.currentRoute.value && // If the item is missing then we know the UID is no longer in use and redirect to the default
134
+ !r && ((o = t.currentRoute.value) != null && o.params[e]) && ((s = t.currentRoute.value) == null ? void 0 : s.params[e]) !== "default" && // We only redirect if the key is missing for the matching route
135
+ t.currentRoute.value.path.includes(e) && t.push({
127
136
  params: {
128
- ...r.currentRoute.value.params,
137
+ ...t.currentRoute.value.params,
129
138
  [e]: "default"
130
139
  }
131
140
  });
132
141
  }
133
142
  export {
134
143
  f as PathId,
135
- v as createModalRouter,
136
- d as createWebHashRouter,
144
+ d as createModalRouter,
145
+ k as createWebHashRouter,
137
146
  w as fallbackMissingParams,
138
147
  h as modalRoutes,
139
148
  c as redirectToDefaultWorkspace,
140
- r as router,
141
- $ as saveWorkspace
149
+ t as router,
150
+ v as saveWorkspace
142
151
  };
@@ -197,7 +197,7 @@ export declare function createStoreCollections(useLocalStorage: boolean): {
197
197
  components?: Record<string, unknown> | undefined;
198
198
  webhooks?: Record<string, unknown> | undefined;
199
199
  }) => void;
200
- edit: <P extends "type" | "children" | "tags" | "requests" | "servers" | "securitySchemes" | "components" | "openapi" | "info" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" | `children.${number}` | `tags.${number}` | `requests.${number}` | `servers.${number}` | `securitySchemes.${number}` | `components.${string}` | "info.summary" | "info.title" | "info.description" | "info.termsOfService" | "info.contact" | "info.license" | "info.version" | "info.contact.name" | "info.contact.url" | "info.contact.email" | "info.license.name" | "info.license.url" | "info.license.identifier" | `security.${number}` | `security.${number}.${string}` | "externalDocs.description" | "externalDocs.url" | `webhooks.${string}` | `auth.${string}`>(uid: string, path: P, value: P extends "type" | "children" | "tags" | "requests" | "servers" | "securitySchemes" | "components" | "openapi" | "info" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" ? {
200
+ edit: <P extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | `servers.${number}` | `tags.${number}` | `security.${number}` | `security.${number}.${string}` | "externalDocs.url" | "externalDocs.description" | "x-scalar-icon" | `children.${number}` | "info.summary" | "info.title" | "info.description" | "info.termsOfService" | "info.contact" | "info.license" | "info.version" | "info.contact.url" | "info.contact.name" | "info.contact.email" | "info.license.url" | "info.license.name" | "info.license.identifier" | `auth.${string}` | `securitySchemes.${number}` | `requests.${number}` | `components.${string}` | `webhooks.${string}`>(uid: string, path: P, value: P extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | "x-scalar-icon" ? {
201
201
  type: "collection";
202
202
  uid: string;
203
203
  children: string[];
@@ -260,7 +260,7 @@ export declare function createStoreCollections(useLocalStorage: boolean): {
260
260
  } | undefined;
261
261
  components?: Record<string, unknown> | undefined;
262
262
  webhooks?: Record<string, unknown> | undefined;
263
- }[P] : P extends `${infer K}.${infer R}` ? K extends "type" | "children" | "tags" | "requests" | "servers" | "securitySchemes" | "components" | "openapi" | "info" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" ? R extends import("@scalar/object-utils/nested").Path<{
263
+ }[P] : P extends `${infer K}.${infer R}` ? K extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | "x-scalar-icon" ? R extends import("@scalar/object-utils/nested").Path<{
264
264
  type: "collection";
265
265
  uid: string;
266
266
  children: string[];
@@ -387,7 +387,7 @@ export declare function createStoreCollections(useLocalStorage: boolean): {
387
387
  components?: Record<string, unknown> | undefined;
388
388
  webhooks?: Record<string, unknown> | undefined;
389
389
  }[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) => void;
390
- untrackedEdit: <P extends "type" | "children" | "tags" | "requests" | "servers" | "securitySchemes" | "components" | "openapi" | "info" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" | `children.${number}` | `tags.${number}` | `requests.${number}` | `servers.${number}` | `securitySchemes.${number}` | `components.${string}` | "info.summary" | "info.title" | "info.description" | "info.termsOfService" | "info.contact" | "info.license" | "info.version" | "info.contact.name" | "info.contact.url" | "info.contact.email" | "info.license.name" | "info.license.url" | "info.license.identifier" | `security.${number}` | `security.${number}.${string}` | "externalDocs.description" | "externalDocs.url" | `webhooks.${string}` | `auth.${string}`>(uid: string, path: P, value: P extends "type" | "children" | "tags" | "requests" | "servers" | "securitySchemes" | "components" | "openapi" | "info" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" ? {
390
+ untrackedEdit: <P extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | `servers.${number}` | `tags.${number}` | `security.${number}` | `security.${number}.${string}` | "externalDocs.url" | "externalDocs.description" | "x-scalar-icon" | `children.${number}` | "info.summary" | "info.title" | "info.description" | "info.termsOfService" | "info.contact" | "info.license" | "info.version" | "info.contact.url" | "info.contact.name" | "info.contact.email" | "info.license.url" | "info.license.name" | "info.license.identifier" | `auth.${string}` | `securitySchemes.${number}` | `requests.${number}` | `components.${string}` | `webhooks.${string}`>(uid: string, path: P, value: P extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | "x-scalar-icon" ? {
391
391
  type: "collection";
392
392
  uid: string;
393
393
  children: string[];
@@ -450,7 +450,7 @@ export declare function createStoreCollections(useLocalStorage: boolean): {
450
450
  } | undefined;
451
451
  components?: Record<string, unknown> | undefined;
452
452
  webhooks?: Record<string, unknown> | undefined;
453
- }[P] : P extends `${infer K}.${infer R}` ? K extends "type" | "children" | "tags" | "requests" | "servers" | "securitySchemes" | "components" | "openapi" | "info" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "uid" | "selectedServerUid" | "x-scalar-icon" | "auth" ? R extends import("@scalar/object-utils/nested").Path<{
453
+ }[P] : P extends `${infer K}.${infer R}` ? K extends "type" | "children" | "info" | "servers" | "uid" | "auth" | "securitySchemes" | "tags" | "requests" | "components" | "openapi" | "security" | "externalDocs" | "webhooks" | "jsonSchemaDialect" | "selectedServerUid" | "x-scalar-icon" ? R extends import("@scalar/object-utils/nested").Path<{
454
454
  type: "collection";
455
455
  uid: string;
456
456
  children: string[];
@@ -41,7 +41,7 @@ export declare function createStoreCookies(useLocalStorage: boolean): {
41
41
  partitioned?: boolean | undefined;
42
42
  secure?: boolean | undefined;
43
43
  }) => void;
44
- edit: <P extends "path" | "name" | "value" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure">(uid: string, path: P, value: P extends "path" | "name" | "value" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? {
44
+ edit: <P extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure">(uid: string, path: P, value: P extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? {
45
45
  value: string;
46
46
  uid: string;
47
47
  name: string;
@@ -53,7 +53,7 @@ export declare function createStoreCookies(useLocalStorage: boolean): {
53
53
  maxAge?: number | undefined;
54
54
  partitioned?: boolean | undefined;
55
55
  secure?: boolean | undefined;
56
- }[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "name" | "value" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? R extends import("@scalar/object-utils/nested").Path<{
56
+ }[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? R extends import("@scalar/object-utils/nested").Path<{
57
57
  value: string;
58
58
  uid: string;
59
59
  name: string;
@@ -78,7 +78,7 @@ export declare function createStoreCookies(useLocalStorage: boolean): {
78
78
  partitioned?: boolean | undefined;
79
79
  secure?: boolean | undefined;
80
80
  }[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) => void;
81
- untrackedEdit: <P extends "path" | "name" | "value" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure">(uid: string, path: P, value: P extends "path" | "name" | "value" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? {
81
+ untrackedEdit: <P extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure">(uid: string, path: P, value: P extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? {
82
82
  value: string;
83
83
  uid: string;
84
84
  name: string;
@@ -90,7 +90,7 @@ export declare function createStoreCookies(useLocalStorage: boolean): {
90
90
  maxAge?: number | undefined;
91
91
  partitioned?: boolean | undefined;
92
92
  secure?: boolean | undefined;
93
- }[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "name" | "value" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? R extends import("@scalar/object-utils/nested").Path<{
93
+ }[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "value" | "name" | "uid" | "domain" | "sameSite" | "expires" | "httpOnly" | "maxAge" | "partitioned" | "secure" ? R extends import("@scalar/object-utils/nested").Path<{
94
94
  value: string;
95
95
  uid: string;
96
96
  name: string;
@@ -24,13 +24,13 @@ export declare function createStoreEnvironments(useLocalStorage: boolean): {
24
24
  color: string;
25
25
  isDefault?: boolean | undefined;
26
26
  }) => void;
27
- edit: <P extends "name" | "value" | "uid" | "color" | "isDefault">(uid: string, path: P, value: P extends "name" | "value" | "uid" | "color" | "isDefault" ? {
27
+ edit: <P extends "color" | "value" | "name" | "uid" | "isDefault">(uid: string, path: P, value: P extends "color" | "value" | "name" | "uid" | "isDefault" ? {
28
28
  value: string;
29
29
  uid: string;
30
30
  name: string;
31
31
  color: string;
32
32
  isDefault?: boolean | undefined;
33
- }[P] : P extends `${infer K}.${infer R}` ? K extends "name" | "value" | "uid" | "color" | "isDefault" ? R extends import("@scalar/object-utils/nested").Path<{
33
+ }[P] : P extends `${infer K}.${infer R}` ? K extends "color" | "value" | "name" | "uid" | "isDefault" ? R extends import("@scalar/object-utils/nested").Path<{
34
34
  value: string;
35
35
  uid: string;
36
36
  name: string;
@@ -43,13 +43,13 @@ export declare function createStoreEnvironments(useLocalStorage: boolean): {
43
43
  color: string;
44
44
  isDefault?: boolean | undefined;
45
45
  }[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) => void;
46
- untrackedEdit: <P extends "name" | "value" | "uid" | "color" | "isDefault">(uid: string, path: P, value: P extends "name" | "value" | "uid" | "color" | "isDefault" ? {
46
+ untrackedEdit: <P extends "color" | "value" | "name" | "uid" | "isDefault">(uid: string, path: P, value: P extends "color" | "value" | "name" | "uid" | "isDefault" ? {
47
47
  value: string;
48
48
  uid: string;
49
49
  name: string;
50
50
  color: string;
51
51
  isDefault?: boolean | undefined;
52
- }[P] : P extends `${infer K}.${infer R}` ? K extends "name" | "value" | "uid" | "color" | "isDefault" ? R extends import("@scalar/object-utils/nested").Path<{
52
+ }[P] : P extends `${infer K}.${infer R}` ? K extends "color" | "value" | "name" | "uid" | "isDefault" ? R extends import("@scalar/object-utils/nested").Path<{
53
53
  value: string;
54
54
  uid: string;
55
55
  name: string;
@@ -0,0 +1,29 @@
1
+ import type { CommandPaletteEvent } from '../components/CommandPalette/TheCommandPalette.vue.js';
2
+ import type { RequestStatus } from '../libs/send-request.js';
3
+ /** Create the store for the api client events */
4
+ export declare function createStoreEvents(): {
5
+ /**
6
+ * Event bus to execute requests, usually triggered by the send button in the address bar
7
+ * OR the keyboard shortcut
8
+ */
9
+ executeRequest: import("../libs/event-bus.js").EventBus<any>;
10
+ /**
11
+ * Event bus to cancel requests, usually triggered by response loading overlay
12
+ */
13
+ cancelRequest: import("../libs/event-bus.js").EventBus<any>;
14
+ /**
15
+ * Event bus to keep track of when a request is started, stopped, or aborted
16
+ */
17
+ requestStatus: import("../libs/event-bus.js").EventBus<RequestStatus>;
18
+ /**
19
+ * Event bus for controlling the Command Palette
20
+ *
21
+ * @param commandName - the command name you wish to execute, leave empty for the full palette
22
+ */
23
+ commandPalette: import("../libs/event-bus.js").EventBus<CommandPaletteEvent>;
24
+ /**
25
+ * Event bus for handling hot keys
26
+ */
27
+ hotKeys: import("../libs/event-bus.js").EventBus<Partial<Record<"closeModal" | "navigateSearchResultsDown" | "selectSearchResult" | "navigateSearchResultsUp" | "openCommandPalette" | "openCommandPaletteRequest" | "toggleSidebar" | "addTopNav" | "closeTopNav" | "navigateTopNavLeft" | "navigateTopNavRight" | "focusAddressBar" | "jumpToTab" | "jumpToLastTab" | "focusRequestSearch", KeyboardEvent>>>;
28
+ };
29
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/store/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAA;AAG5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,iDAAiD;AACjD,wBAAgB,iBAAiB;IAE7B;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;;OAIG;;IAEH;;OAEG;;EAGN"}
@@ -0,0 +1,31 @@
1
+ import { createEventBus as e } from "../libs/event-bus.js";
2
+ function r() {
3
+ return {
4
+ /**
5
+ * Event bus to execute requests, usually triggered by the send button in the address bar
6
+ * OR the keyboard shortcut
7
+ */
8
+ executeRequest: e(),
9
+ /**
10
+ * Event bus to cancel requests, usually triggered by response loading overlay
11
+ */
12
+ cancelRequest: e(),
13
+ /**
14
+ * Event bus to keep track of when a request is started, stopped, or aborted
15
+ */
16
+ requestStatus: e(),
17
+ /**
18
+ * Event bus for controlling the Command Palette
19
+ *
20
+ * @param commandName - the command name you wish to execute, leave empty for the full palette
21
+ */
22
+ commandPalette: e(),
23
+ /**
24
+ * Event bus for handling hot keys
25
+ */
26
+ hotKeys: e()
27
+ };
28
+ }
29
+ export {
30
+ r as createStoreEvents
31
+ };