@scalar/api-client 2.18.4 → 2.19.0

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 (223) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/components/AddressBar/AddressBar.vue2.js +5 -5
  3. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +6 -6
  4. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  5. package/dist/components/ImportCollection/DropEventListener.vue.js +26 -28
  6. package/dist/components/ImportCollection/utils/get-openapi-version.d.ts.map +1 -1
  7. package/dist/components/ImportCollection/utils/import-collection.d.ts +1 -1
  8. package/dist/components/ImportCollection/utils/import-collection.d.ts.map +1 -1
  9. package/dist/components/Search/useSearch.d.ts.map +1 -1
  10. package/dist/components/Search/useSearch.js +16 -16
  11. package/dist/components/Server/index.d.ts +1 -1
  12. package/dist/components/Server/index.d.ts.map +1 -1
  13. package/dist/components/Server/index.js +6 -6
  14. package/dist/components/SideNav/SideNav.vue.js +3 -3
  15. package/dist/components/Sidebar/index.d.ts +1 -2
  16. package/dist/components/Sidebar/index.d.ts.map +1 -1
  17. package/dist/components/index.d.ts +2 -2
  18. package/dist/components/index.d.ts.map +1 -1
  19. package/dist/hooks/index.d.ts +2 -2
  20. package/dist/hooks/index.d.ts.map +1 -1
  21. package/dist/hooks/useResponseBody.d.ts +1 -1
  22. package/dist/hooks/useResponseBody.d.ts.map +1 -1
  23. package/dist/hooks/useResponseBody.js +4 -4
  24. package/dist/hooks/useSidebar.d.ts +1 -1
  25. package/dist/hooks/useSidebar.d.ts.map +1 -1
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/layouts/App/ApiClientApp.vue.js +5 -5
  29. package/dist/layouts/App/MainLayout.vue.js +4 -4
  30. package/dist/layouts/App/create-api-client-app.d.ts +12 -12
  31. package/dist/layouts/App/index.d.ts +1 -1
  32. package/dist/layouts/App/index.d.ts.map +1 -1
  33. package/dist/layouts/Web/ApiClientWeb.vue.js +6 -6
  34. package/dist/layouts/Web/create-api-client-web.d.ts +12 -12
  35. package/dist/layouts/Web/index.d.ts +1 -1
  36. package/dist/layouts/Web/index.d.ts.map +1 -1
  37. package/dist/libs/create-client.d.ts +12 -12
  38. package/dist/libs/get-request-uid-by-path-method.d.ts +1 -1
  39. package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -1
  40. package/dist/libs/hot-keys.d.ts +2 -2
  41. package/dist/libs/hot-keys.d.ts.map +1 -1
  42. package/dist/libs/importers/curl.d.ts.map +1 -1
  43. package/dist/libs/index.d.ts +14 -15
  44. package/dist/libs/index.d.ts.map +1 -1
  45. package/dist/libs/index.js +33 -33
  46. package/dist/libs/parse-curl.js +4 -4
  47. package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
  48. package/dist/libs/send-request/create-fetch-body.d.ts.map +1 -1
  49. package/dist/libs/send-request/create-fetch-body.js +1 -1
  50. package/dist/libs/send-request/create-fetch-headers.d.ts.map +1 -1
  51. package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -1
  52. package/dist/libs/send-request/create-fetch-query-params.js +2 -1
  53. package/dist/libs/send-request/index.d.ts +1 -1
  54. package/dist/libs/send-request/index.d.ts.map +1 -1
  55. package/dist/libs/send-request/index.js +4 -4
  56. package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
  57. package/dist/libs/send-request/set-request-cookies.js +4 -4
  58. package/dist/store/active-entities.d.ts +1 -1
  59. package/dist/store/collections.d.ts +1 -1
  60. package/dist/store/collections.d.ts.map +1 -1
  61. package/dist/store/collections.js +4 -4
  62. package/dist/store/environment.d.ts +1 -1
  63. package/dist/store/environment.d.ts.map +1 -1
  64. package/dist/store/environment.js +4 -4
  65. package/dist/store/import-spec.d.ts +2 -2
  66. package/dist/store/import-spec.d.ts.map +1 -1
  67. package/dist/store/index.d.ts +1 -1
  68. package/dist/store/index.d.ts.map +1 -1
  69. package/dist/store/request-example.d.ts +1 -1
  70. package/dist/store/request-example.d.ts.map +1 -1
  71. package/dist/store/request-example.js +6 -6
  72. package/dist/store/requests.d.ts +1 -1
  73. package/dist/store/requests.d.ts.map +1 -1
  74. package/dist/store/requests.js +8 -8
  75. package/dist/store/security-schemes.d.ts +1 -1
  76. package/dist/store/security-schemes.d.ts.map +1 -1
  77. package/dist/store/security-schemes.js +4 -4
  78. package/dist/store/servers.d.ts +1 -1
  79. package/dist/store/servers.d.ts.map +1 -1
  80. package/dist/store/servers.js +4 -4
  81. package/dist/store/store.d.ts +12 -12
  82. package/dist/store/tags.d.ts +1 -1
  83. package/dist/store/tags.d.ts.map +1 -1
  84. package/dist/store/tags.js +5 -5
  85. package/dist/store/workspace.d.ts +13 -13
  86. package/dist/store/workspace.d.ts.map +1 -1
  87. package/dist/store/workspace.js +7 -7
  88. package/dist/style.css +1 -1
  89. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +4 -5
  90. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  91. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +17 -16
  92. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +3 -3
  93. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -1
  94. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +22 -22
  95. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  96. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +14 -13
  97. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  98. package/dist/v2/blocks/operation-block/helpers/build-request.js +43 -41
  99. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +14 -0
  100. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +1 -0
  101. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +14 -0
  102. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +25 -0
  103. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +1 -0
  104. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +17 -0
  105. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +10 -0
  106. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  107. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  108. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +29 -25
  109. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +6 -1
  110. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  111. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +27 -23
  112. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +10 -1
  113. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  114. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +48 -39
  115. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  116. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +49 -46
  117. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts +1 -1
  118. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts.map +1 -1
  119. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.js +1 -1
  120. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +6 -2
  121. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  122. package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
  123. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +200 -115
  124. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +4 -4
  125. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  126. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +21 -17
  127. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +16 -10
  128. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  129. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +32 -45
  130. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +16 -13
  131. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  132. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +4 -4
  133. package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +32 -33
  134. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +33 -18
  135. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  136. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +106 -106
  137. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +10 -5
  138. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
  139. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +60 -31
  140. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +41 -0
  141. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -0
  142. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +25 -0
  143. package/dist/v2/blocks/request-block/helpers/group-by.d.ts +1 -1
  144. package/dist/v2/blocks/request-block/helpers/group-by.d.ts.map +1 -1
  145. package/dist/v2/blocks/request-block/helpers/group-by.js +6 -3
  146. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts +13 -0
  147. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts.map +1 -0
  148. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +7 -0
  149. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  150. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  151. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +61 -63
  152. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -2
  153. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  154. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +2 -2
  155. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +2 -2
  156. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -2
  157. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  158. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -2
  159. package/dist/v2/components/code-input/CodeInput.vue.d.ts +2 -0
  160. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  161. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  162. package/dist/v2/components/code-input/CodeInput.vue2.js +57 -51
  163. package/dist/v2/features/app/App.vue.js +6 -6
  164. package/dist/v2/features/app/app-events.d.ts +5 -9
  165. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  166. package/dist/v2/features/app/app-events.js +146 -120
  167. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  168. package/dist/v2/features/app/app-state.js +69 -71
  169. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  170. package/dist/v2/features/app/components/AppSidebar.vue2.js +5 -5
  171. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  172. package/dist/v2/features/modal/Modal.vue.js +1 -1
  173. package/dist/v2/features/modal/Modal.vue2.js +21 -22
  174. package/dist/v2/features/modal/index.d.ts +1 -1
  175. package/dist/v2/features/modal/index.d.ts.map +1 -1
  176. package/dist/v2/features/modal/index.js +4 -4
  177. package/dist/v2/features/modal/modal-events.d.ts +13 -0
  178. package/dist/v2/features/modal/modal-events.d.ts.map +1 -0
  179. package/dist/v2/features/modal/modal-events.js +31 -0
  180. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  181. package/dist/v2/features/operation/Operation.vue.js +30 -43
  182. package/dist/v2/workspace-events.d.ts +25 -0
  183. package/dist/v2/workspace-events.d.ts.map +1 -0
  184. package/dist/v2/workspace-events.js +202 -0
  185. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
  186. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +1 -1
  187. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
  188. package/dist/views/Cookies/Cookies.vue2.js +3 -3
  189. package/dist/views/Environment/handle-drag.d.ts +1 -1
  190. package/dist/views/Environment/handle-drag.d.ts.map +1 -1
  191. package/dist/views/Request/RequestRoot.vue2.js +9 -9
  192. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +4 -4
  193. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +4 -4
  194. package/dist/views/Request/RequestSection/RequestSection.vue2.js +5 -5
  195. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -1
  196. package/dist/views/Request/RequestSidebar.vue2.js +6 -6
  197. package/dist/views/Request/RequestSidebarItem.vue2.js +6 -6
  198. package/dist/views/Request/RequestSubpageHeader.vue2.js +4 -4
  199. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  200. package/dist/views/Request/ResponseSection/index.d.ts +1 -1
  201. package/dist/views/Request/ResponseSection/index.d.ts.map +1 -1
  202. package/dist/views/Request/ResponseSection/index.js +4 -4
  203. package/dist/views/Request/consts/index.d.ts +2 -3
  204. package/dist/views/Request/consts/index.d.ts.map +1 -1
  205. package/dist/views/Request/consts/new-auth-options.d.ts +1 -1
  206. package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
  207. package/dist/views/Request/handle-drag.d.ts +1 -1
  208. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  209. package/dist/views/Request/hooks/useOpenApiWatcher.d.ts.map +1 -1
  210. package/dist/views/Request/hooks/useOpenApiWatcher.js +14 -14
  211. package/dist/views/Request/libs/auth.d.ts +1 -1
  212. package/dist/views/Request/libs/auth.d.ts.map +1 -1
  213. package/dist/views/Request/libs/index.d.ts +3 -3
  214. package/dist/views/Request/libs/index.d.ts.map +1 -1
  215. package/dist/views/Request/libs/oauth2.js +1 -1
  216. package/dist/views/Request/libs/watch-mode.js +6 -6
  217. package/dist/views/Request/types/index.d.ts +1 -1
  218. package/dist/views/Request/types/index.d.ts.map +1 -1
  219. package/package.json +13 -13
  220. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +0 -18
  221. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +0 -1
  222. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +0 -39
  223. package/dist/v2/features/operation/helpers/get-operation-header.js +0 -12
@@ -1,14 +1,13 @@
1
- import { defineComponent as h, computed as n, onMounted as v, watch as y, createBlock as f, createElementBlock as x, openBlock as c, unref as u, createElementVNode as S } from "vue";
1
+ import { defineComponent as h, computed as a, onMounted as v, createBlock as y, createElementBlock as f, openBlock as c, unref as u, createElementVNode as S } from "vue";
2
2
  import { getResolvedRef as l } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { combineParams as k } from "./helpers/combine-params.js";
4
- import { getOperationHeader as g } from "./helpers/get-operation-header.js";
5
- import { getSelectedServer as B } from "./helpers/get-selected-server.js";
6
- import C from "../../blocks/operation-block/OperationBlock.vue.js";
7
- const w = {
3
+ import { combineParams as x } from "./helpers/combine-params.js";
4
+ import { getSelectedServer as k } from "./helpers/get-selected-server.js";
5
+ import g from "../../blocks/operation-block/OperationBlock.vue.js";
6
+ const B = {
8
7
  key: 1,
9
8
  class: "flex h-full w-full items-center justify-center"
10
- }, N = {}, V = /* @__PURE__ */ h({
11
- ...N,
9
+ }, C = {}, M = /* @__PURE__ */ h({
10
+ ...C,
12
11
  __name: "Operation",
13
12
  props: {
14
13
  documentSlug: {},
@@ -26,53 +25,41 @@ const w = {
26
25
  hideClientButton: { type: Boolean }
27
26
  },
28
27
  setup(e) {
29
- const o = n(() => {
28
+ const o = a(() => {
30
29
  if (!e.path || !e.method)
31
30
  return null;
32
31
  const t = l(e.document?.paths?.[e.path]?.[e.method]);
33
32
  if (!t)
34
33
  return null;
35
- const a = l(e.document?.paths?.[e.path]);
36
- if (!a)
34
+ const n = l(e.document?.paths?.[e.path]);
35
+ if (!n)
37
36
  return t;
38
- const r = k(a.parameters, t.parameters);
37
+ const r = x(n.parameters, t.parameters);
39
38
  return { ...t, parameters: r };
40
- }), i = n(() => [
41
- ...e.workspaceStore.workspace?.["x-scalar-cookies"] ?? [],
42
- ...e.document?.["x-scalar-cookies"] ?? []
43
- ]), m = n(() => B(e.document));
39
+ }), i = a(() => [
40
+ ...(e.workspaceStore.workspace?.["x-scalar-cookies"] ?? []).map((t) => ({
41
+ ...t,
42
+ location: "workspace"
43
+ })),
44
+ ...(e.document?.["x-scalar-cookies"] ?? []).map((t) => ({
45
+ ...t,
46
+ location: "document"
47
+ }))
48
+ ]), s = a(() => k(e.document));
44
49
  v(() => {
45
50
  typeof e.document?.["x-scalar-selected-server"] > "u" && e.document?.servers?.[0]?.url && e.eventBus.emit("server:update:selected", { url: e.document.servers[0].url });
46
- }), y(
47
- o,
48
- (t) => {
49
- t && e.path && e.method && !g({
50
- operation: t,
51
- name: "Accept",
52
- type: "header"
53
- }) && e.eventBus.emit("operation:add:parameter", {
54
- type: "header",
55
- meta: { method: e.method, path: e.path, exampleKey: e.exampleName ?? "default" },
56
- payload: {
57
- name: "Accept",
58
- value: "*/*",
59
- isDisabled: !1
60
- }
61
- });
62
- },
63
- { immediate: !0 }
64
- );
65
- const s = n(() => e.document?.["x-scalar-set-operation-security"] ? {
51
+ });
52
+ const m = a(() => e.document?.["x-scalar-set-operation-security"] ? {
66
53
  type: "operation",
67
54
  path: e.path ?? "",
68
55
  method: e.method ?? "get"
69
56
  } : {
70
57
  type: "document"
71
- }), d = "2.18.4";
72
- return (t, a) => e.path && e.method && e.exampleName && o.value ? (c(), f(u(C), {
58
+ }), d = "2.19.0";
59
+ return (t, n) => e.path && e.method && e.exampleName && o.value ? (c(), y(u(g), {
73
60
  key: 0,
74
61
  appVersion: u(d),
75
- authMeta: s.value,
62
+ authMeta: m.value,
76
63
  documentSecurity: e.document?.security ?? [],
77
64
  documentSelectedSecurity: e.document?.["x-scalar-selected-security"],
78
65
  documentUrl: e.document?.["x-scalar-original-source-url"],
@@ -91,16 +78,16 @@ const w = {
91
78
  proxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
92
79
  securitySchemes: e.securitySchemes,
93
80
  selectedClient: e.workspaceStore.workspace["x-scalar-default-client"],
94
- server: m.value,
81
+ server: s.value,
95
82
  servers: e.document?.servers ?? [],
96
83
  setOperationSecurity: e.document?.["x-scalar-set-operation-security"] ?? !1,
97
84
  totalPerformedRequests: 0,
98
- "onUpdate:servers": a[0] || (a[0] = (r) => e.eventBus.emit("ui:route:page", { name: "document.servers" }))
99
- }, null, 8, ["appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "httpClients", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (c(), x("div", w, [...a[1] || (a[1] = [
85
+ "onUpdate:servers": n[0] || (n[0] = (r) => e.eventBus.emit("ui:route:page", { name: "document.servers" }))
86
+ }, null, 8, ["appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "httpClients", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (c(), f("div", B, [...n[1] || (n[1] = [
100
87
  S("span", { class: "text-c-3" }, "Select an operation to view details", -1)
101
88
  ])]));
102
89
  }
103
90
  });
104
91
  export {
105
- V as default
92
+ M as default
106
93
  };
@@ -0,0 +1,25 @@
1
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
+ import type { ApiReferenceEvents, WorkspaceEventBus } from '@scalar/workspace-store/events';
3
+ import { type Ref } from 'vue';
4
+ type Hook<T extends keyof ApiReferenceEvents> = Partial<{
5
+ onBeforeExecute: (payload: ApiReferenceEvents[T]) => void | Promise<void> | ApiReferenceEvents[T] | Promise<ApiReferenceEvents[T]>;
6
+ onAfterExecute: (payload: ApiReferenceEvents[T]) => void | Promise<void>;
7
+ }>;
8
+ type Hooks = {
9
+ [key in keyof ApiReferenceEvents]?: Hook<key>;
10
+ };
11
+ /**
12
+ * Initializes all Workspace Event Handlers by subscribing eventBus listeners
13
+ * to each relevant mutator operation. Hooks are used for before/after execution.
14
+ *
15
+ * @param eventBus The WorkspaceEventBus to subscribe to
16
+ * @param store The WorkspaceStore instance
17
+ * @param hooks Object containing optional before/after hooks for each event
18
+ */
19
+ export declare function initializeWorkspaceEventHandlers({ eventBus, store, hooks, }: {
20
+ eventBus: WorkspaceEventBus;
21
+ store: Ref<WorkspaceStore | null>;
22
+ hooks: Hooks;
23
+ }): void;
24
+ export {};
25
+ //# sourceMappingURL=workspace-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;CAC9C,CAAA;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,QAkPA"}
@@ -0,0 +1,202 @@
1
+ import { generateClientMutators as i } from "@scalar/workspace-store/mutators";
2
+ import { computed as c } from "vue";
3
+ const r = (a, p, t) => async (o) => {
4
+ const n = await t[a]?.onBeforeExecute?.(o) ?? o;
5
+ return await p(n), await t[a]?.onAfterExecute?.(n), n;
6
+ };
7
+ function l({
8
+ eventBus: a,
9
+ store: p,
10
+ hooks: t
11
+ }) {
12
+ const o = c(() => i(p.value)), n = ({ collectionType: e }) => e === "document" ? o.value.active() : o.value.workspace();
13
+ a.on(
14
+ "workspace:update:active-proxy",
15
+ (e) => r("workspace:update:active-proxy", o.value.workspace().workspace.updateActiveProxy, t)(e)
16
+ ), a.on(
17
+ "workspace:update:color-mode",
18
+ (e) => r("workspace:update:color-mode", o.value.workspace().workspace.updateColorMode, t)(e)
19
+ ), a.on(
20
+ "workspace:update:theme",
21
+ (e) => r("workspace:update:theme", o.value.workspace().workspace.updateTheme, t)(e)
22
+ ), a.on(
23
+ "workspace:update:selected-client",
24
+ (e) => r(
25
+ "workspace:update:selected-client",
26
+ o.value.workspace().workspace.updateSelectedClient,
27
+ t
28
+ )(e)
29
+ ), a.on(
30
+ "document:update:icon",
31
+ (e) => r("document:update:icon", o.value.active().document.updateDocumentIcon, t)(e)
32
+ ), a.on(
33
+ "document:update:info",
34
+ (e) => r("document:update:info", o.value.active().document.updateDocumentInfo, t)(e)
35
+ ), a.on(
36
+ "document:toggle:security",
37
+ (e) => r("document:toggle:security", o.value.active().document.toggleSecurity, t)(e)
38
+ ), a.on(
39
+ "document:update:watch-mode",
40
+ (e) => r("document:update:watch-mode", o.value.active().document.updateWatchMode, t)(e)
41
+ ), a.on(
42
+ "document:create:empty-document",
43
+ (e) => r("document:create:empty-document", o.value.active().document.createEmptyDocument, t)(e)
44
+ ), a.on(
45
+ "document:delete:document",
46
+ (e) => r("document:delete:document", o.value.active().document.deleteDocument, t)(e)
47
+ ), a.on(
48
+ "environment:upsert:environment",
49
+ (e) => r("environment:upsert:environment", n(e).environment.upsertEnvironment, t)(e)
50
+ ), a.on(
51
+ "environment:delete:environment",
52
+ (e) => r("environment:delete:environment", n(e).environment.deleteEnvironment, t)(e)
53
+ ), a.on(
54
+ "environment:upsert:environment-variable",
55
+ (e) => r(
56
+ "environment:upsert:environment-variable",
57
+ n(e).environment.upsertEnvironmentVariable,
58
+ t
59
+ )(e)
60
+ ), a.on(
61
+ "environment:delete:environment-variable",
62
+ (e) => r(
63
+ "environment:delete:environment-variable",
64
+ n(e).environment.deleteEnvironmentVariable,
65
+ t
66
+ )(e)
67
+ ), a.on("cookie:upsert:cookie", async (e) => {
68
+ await r("cookie:upsert:cookie", n(e).cookie.upsertCookie, t)(e);
69
+ }), a.on("cookie:delete:cookie", async (e) => {
70
+ await r("cookie:delete:cookie", n(e).cookie.deleteCookie, t)(e);
71
+ }), a.on(
72
+ "auth:delete:security-scheme",
73
+ (e) => r("auth:delete:security-scheme", o.value.active().auth.deleteSecurityScheme, t)(e)
74
+ ), a.on(
75
+ "auth:update:active-index",
76
+ (e) => r("auth:update:active-index", o.value.active().auth.updateSelectedAuthTab, t)(e)
77
+ ), a.on(
78
+ "auth:update:security-scheme",
79
+ (e) => r("auth:update:security-scheme", o.value.active().auth.updateSecurityScheme, t)(e)
80
+ ), a.on(
81
+ "auth:update:selected-scopes",
82
+ (e) => r("auth:update:selected-scopes", o.value.active().auth.updateSelectedScopes, t)(e)
83
+ ), a.on(
84
+ "auth:update:selected-security-schemes",
85
+ (e) => r(
86
+ "auth:update:selected-security-schemes",
87
+ o.value.active().auth.updateSelectedSecuritySchemes,
88
+ t
89
+ )(e)
90
+ ), a.on(
91
+ "server:add:server",
92
+ (e) => r("server:add:server", o.value.active().server.addServer, t)(e)
93
+ ), a.on(
94
+ "server:update:server",
95
+ (e) => r("server:update:server", o.value.active().server.updateServer, t)(e)
96
+ ), a.on(
97
+ "server:delete:server",
98
+ (e) => r("server:delete:server", o.value.active().server.deleteServer, t)(e)
99
+ ), a.on(
100
+ "server:update:variables",
101
+ (e) => r("server:update:variables", o.value.active().server.updateServerVariables, t)(e)
102
+ ), a.on(
103
+ "server:update:selected",
104
+ (e) => r("server:update:selected", o.value.active().server.updateSelectedServer, t)(e)
105
+ ), a.on(
106
+ "operation:create:operation",
107
+ (e) => r("operation:create:operation", o.value.active().operation.createOperation, t)(e)
108
+ ), a.on(
109
+ "operation:update:pathMethod",
110
+ (e) => r(
111
+ "operation:update:pathMethod",
112
+ o.value.active().operation.updateOperationPathMethod,
113
+ t
114
+ )(e)
115
+ ), a.on(
116
+ "operation:update:summary",
117
+ (e) => r("operation:update:summary", o.value.active().operation.updateOperationSummary, t)(e)
118
+ ), a.on(
119
+ "operation:delete:operation",
120
+ (e) => r("operation:delete:operation", o.value.active().operation.deleteOperation, t)(e)
121
+ ), a.on(
122
+ "operation:delete:example",
123
+ (e) => r("operation:delete:example", o.value.active().operation.deleteOperationExample, t)(e)
124
+ ), a.on(
125
+ "operation:add:parameter",
126
+ (e) => r("operation:add:parameter", o.value.active().operation.addOperationParameter, t)(e)
127
+ ), a.on(
128
+ "operation:update:parameter",
129
+ (e) => r("operation:update:parameter", o.value.active().operation.updateOperationParameter, t)(e)
130
+ ), a.on(
131
+ "operation:update:extra-parameters",
132
+ (e) => r(
133
+ "operation:update:extra-parameters",
134
+ o.value.active().operation.updateOperationExtraParameters,
135
+ t
136
+ )(e)
137
+ ), a.on(
138
+ "operation:delete:parameter",
139
+ (e) => r("operation:delete:parameter", o.value.active().operation.deleteOperationParameter, t)(e)
140
+ ), a.on(
141
+ "operation:delete-all:parameters",
142
+ (e) => r(
143
+ "operation:delete-all:parameters",
144
+ o.value.active().operation.deleteAllOperationParameters,
145
+ t
146
+ )(e)
147
+ ), a.on(
148
+ "operation:update:requestBody:contentType",
149
+ (e) => r(
150
+ "operation:update:requestBody:contentType",
151
+ o.value.active().operation.updateOperationRequestBodyContentType,
152
+ t
153
+ )(e)
154
+ ), a.on(
155
+ "operation:update:requestBody:value",
156
+ (e) => r(
157
+ "operation:update:requestBody:value",
158
+ o.value.active().operation.updateOperationRequestBodyExample,
159
+ t
160
+ )(e)
161
+ ), a.on(
162
+ "operation:update:requestBody:formValue",
163
+ (e) => r(
164
+ "operation:update:requestBody:formValue",
165
+ o.value.active().operation.updateOperationRequestBodyFormValue,
166
+ t
167
+ )(e)
168
+ ), a.on(
169
+ "tag:create:tag",
170
+ (e) => r("tag:create:tag", o.value.active().tag.createTag, t)(e)
171
+ ), a.on(
172
+ "tag:delete:tag",
173
+ (e) => r("tag:delete:tag", o.value.active().tag.deleteTag, t)(e)
174
+ ), a.on(
175
+ "tabs:add:tab",
176
+ (e) => r("tabs:add:tab", o.value.workspace().tabs.addTab, t)(e)
177
+ ), a.on(
178
+ "tabs:close:tab",
179
+ (e) => r("tabs:close:tab", o.value.workspace().tabs.closeTab, t)(e)
180
+ ), a.on(
181
+ "tabs:close:other-tabs",
182
+ (e) => r("tabs:close:other-tabs", o.value.workspace().tabs.closeOtherTabs, t)(e)
183
+ ), a.on(
184
+ "tabs:focus:tab",
185
+ (e) => r("tabs:focus:tab", o.value.workspace().tabs.focusTab, t)(e)
186
+ ), a.on(
187
+ "tabs:focus:tab-last",
188
+ (e) => r("tabs:focus:tab-last", o.value.workspace().tabs.focusLastTab, t)(e)
189
+ ), a.on(
190
+ "tabs:navigate:previous",
191
+ (e) => r("tabs:navigate:previous", o.value.workspace().tabs.navigatePreviousTab, t)(e)
192
+ ), a.on(
193
+ "tabs:navigate:next",
194
+ (e) => r("tabs:navigate:next", o.value.workspace().tabs.navigateNextTab, t)(e)
195
+ ), a.on(
196
+ "tabs:update:tabs",
197
+ (e) => r("tabs:update:tabs", o.value.workspace().tabs.updateTabs, t)(e)
198
+ );
199
+ }
200
+ export {
201
+ l as initializeWorkspaceEventHandlers
202
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/convert-to-har-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAA;AAEjE,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACzC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC1D,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,2DAQjC,KAAK,KAAG,UAoGV,CAAA"}
1
+ {"version":3,"file":"convert-to-har-request.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/convert-to-har-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhF,OAAO,KAAK,EAAiB,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEjE,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IACzC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;IAC3D,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC1D,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,2DAQjC,KAAK,KAAG,UAoGV,CAAA"}
@@ -1,6 +1,6 @@
1
- import type { ErrorResponse } from '../../../../libs/errors.js';
2
1
  import { type ClientId, type TargetId } from '@scalar/snippetz';
3
2
  import type { Request as HarRequest } from 'har-format';
3
+ import type { ErrorResponse } from '../../../../libs/errors.js';
4
4
  /**
5
5
  * Returns a code example for given operation
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"get-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/get-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAY,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAKvD;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,QAAQ,EAC3C,QAAQ,CAAC,GAAG,YAAY,EACxB,QAAQ,QAAQ,CAAC,CAAC,CAAC,EACnB,YAAY,UAAU,KACrB,aAAa,CAAC,MAAM,CA0CtB,CAAA"}
1
+ {"version":3,"file":"get-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/views/Components/CodeSnippet/helpers/get-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAY,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAKlD;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,QAAQ,EAC3C,QAAQ,CAAC,GAAG,YAAY,EACxB,QAAQ,QAAQ,CAAC,CAAC,CAAC,EACnB,YAAY,UAAU,KACrB,aAAa,CAAC,MAAM,CA0CtB,CAAA"}
@@ -12,13 +12,13 @@ import z from "../../components/ViewLayout/ViewLayoutSection.vue.js";
12
12
  import { PathId as x } from "../../routes.js";
13
13
  import G from "./CookieForm.vue.js";
14
14
  import J from "./CookieModal.vue.js";
15
- import { useActiveEntities as Q } from "../../store/active-entities.js";
16
- import { useWorkspace as X } from "../../store/store.js";
15
+ import { useWorkspace as Q } from "../../store/store.js";
16
+ import { useActiveEntities as X } from "../../store/active-entities.js";
17
17
  import Y from "../../components/Sidebar/Sidebar.vue.js";
18
18
  const Z = { class: "flex-1" }, ee = { class: "relative mb-[.5px] last:mb-0" }, _e = /* @__PURE__ */ B({
19
19
  __name: "Cookies",
20
20
  setup(oe) {
21
- const { cookies: m, cookieMutators: p, events: k, workspaceMutators: v } = X(), { activeWorkspace: n, activeCookieId: M } = Q(), r = R(), C = W(), d = H(), g = (t) => {
21
+ const { cookies: m, cookieMutators: p, events: k, workspaceMutators: v } = Q(), { activeWorkspace: n, activeCookieId: M } = X(), r = R(), C = W(), d = H(), g = (t) => {
22
22
  const o = I.parse({
23
23
  name: t.name,
24
24
  value: t.value,
@@ -1,6 +1,6 @@
1
- import type { ActiveEntitiesStore } from '../../store/active-entities.js';
2
1
  import type { DraggingItem, HoveredItem } from '@scalar/draggable';
3
2
  import type { Collection } from '@scalar/oas-utils/entities/spec';
3
+ import type { ActiveEntitiesStore } from '../../store/active-entities.js';
4
4
  type CollectionMutator = {
5
5
  edit: (uid: Collection['uid'], path: 'x-scalar-environments', value: Collection['x-scalar-environments']) => void;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"handle-drag.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/handle-drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,UAAU,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAA;CAClH,CAAA;AAED,sCAAsC;AACtC,wBAAgB,6BAA6B,CAC3C,0BAA0B,EAAE,mBAAmB,CAAC,4BAA4B,CAAC,EAC7E,iBAAiB,EAAE,iBAAiB;kCAGC,YAAY,eAAe,WAAW;gCAiDxC,YAAY,eAAe,WAAW;EAQ1E"}
1
+ {"version":3,"file":"handle-drag.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/handle-drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAElE,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,UAAU,CAAC,uBAAuB,CAAC,KAAK,IAAI,CAAA;CAClH,CAAA;AAED,sCAAsC;AACtC,wBAAgB,6BAA6B,CAC3C,0BAA0B,EAAE,mBAAmB,CAAC,4BAA4B,CAAC,EAC7E,iBAAiB,EAAE,iBAAiB;kCAGC,YAAY,eAAe,WAAW;gCAiDxC,YAAY,eAAe,WAAW;EAQ1E"}
@@ -11,16 +11,16 @@ import { validateParameters as le } from "../../libs/validate-parameters.js";
11
11
  import { useActiveEntities as ue } from "../../store/active-entities.js";
12
12
  import { useOpenApiWatcher as ie } from "./hooks/useOpenApiWatcher.js";
13
13
  import ce from "./RequestSidebar.vue.js";
14
- import { usePluginManager as me } from "../../plugins/hooks/usePluginManager.js";
15
- import { createRequestOperation as fe } from "../../libs/send-request/create-request-operation.js";
16
- import { ERRORS as de } from "../../libs/errors.js";
17
- import { useWorkspace as pe } from "../../store/store.js";
18
- import { useLayout as ve } from "../../hooks/useLayout.js";
14
+ import { useWorkspace as me } from "../../store/store.js";
15
+ import { useLayout as fe } from "../../hooks/useLayout.js";
16
+ import { usePluginManager as de } from "../../plugins/hooks/usePluginManager.js";
17
+ import { createRequestOperation as pe } from "../../libs/send-request/create-request-operation.js";
18
+ import { ERRORS as ve } from "../../libs/errors.js";
19
19
  const Re = { class: "flex h-full" }, Se = { class: "flex h-full flex-1 flex-col" }, De = /* @__PURE__ */ H({
20
20
  __name: "RequestRoot",
21
21
  emits: ["newTab"],
22
22
  setup(qe) {
23
- const w = pe(), { toast: u } = te(), { layout: d } = ve(), B = ae(), { isSidebarOpen: s } = ne(), A = se(), {
23
+ const w = me(), { toast: u } = te(), { layout: d } = fe(), B = ae(), { isSidebarOpen: s } = ne(), A = se(), {
24
24
  activeCollection: n,
25
25
  activeExample: i,
26
26
  activeEnvironment: p,
@@ -34,7 +34,7 @@ const Re = { class: "flex h-full" }, Se = { class: "flex h-full flex-1 flex-col"
34
34
  securitySchemes: M,
35
35
  modalState: z,
36
36
  events: o
37
- } = w, I = me(), J = m(), S = m(), q = N(
37
+ } = w, I = de(), J = m(), S = m(), q = N(
38
38
  () => le(i.value ?? null)
39
39
  ), y = m(null), x = N(
40
40
  () => (n.value?.useCollectionSecurity ? n.value?.selectedSecuritySchemeUids : l.value?.selectedSecuritySchemeUids) ?? []
@@ -47,7 +47,7 @@ const Re = { class: "flex h-full" }, Se = { class: "flex h-full flex-1 flex-col"
47
47
  }
48
48
  const e = typeof p.value == "object" ? p.value.value : "{}", t = ee.parse(e);
49
49
  t.error && console.error("INVALID ENVIRONMENT!");
50
- const a = t.error || typeof t.data != "object" ? {} : t.data ?? {}, j = v.value?.cookies.map(($) => P[$]).filter(Z) ?? [], L = n.value?.info?.title === "Drafts" ? void 0 : T.value, [g, k] = fe({
50
+ const a = t.error || typeof t.data != "object" ? {} : t.data ?? {}, j = v.value?.cookies.map(($) => P[$]).filter(Z) ?? [], L = n.value?.info?.title === "Drafts" ? void 0 : T.value, [g, k] = pe({
51
51
  request: l.value,
52
52
  example: i.value,
53
53
  selectedSecuritySchemeUids: x.value,
@@ -66,7 +66,7 @@ const Re = { class: "flex h-full" }, Se = { class: "flex h-full flex-1 flex-col"
66
66
  S.value = k.controller;
67
67
  const [E, C] = await k.sendRequest();
68
68
  y.value = C, E ? u(E.message, "error") : D.push(W(C));
69
- }, c = async () => S.value?.abort(de.REQUEST_ABORTED);
69
+ }, c = async () => S.value?.abort(ve.REQUEST_ABORTED);
70
70
  function b() {
71
71
  A?.capture("client-send-request");
72
72
  }
@@ -3,8 +3,8 @@ import { useModal as M } from "@scalar/components";
3
3
  import { isDefined as N } from "@scalar/helpers/array/is-defined";
4
4
  import D from "./DeleteRequestAuthModal.vue.js";
5
5
  import E from "./RequestAuthTab.vue.js";
6
- import U from "../../../../components/DataTable/DataTable.vue.js";
7
- import { useWorkspace as j } from "../../../../store/store.js";
6
+ import { useWorkspace as U } from "../../../../store/store.js";
7
+ import j from "../../../../components/DataTable/DataTable.vue.js";
8
8
  const q = ["onClick"], F = { class: "relative z-10 font-medium whitespace-nowrap" }, I = {
9
9
  key: 0,
10
10
  class: "absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"
@@ -22,7 +22,7 @@ const q = ["onClick"], F = { class: "relative z-10 font-medium whitespace-nowrap
22
22
  },
23
23
  emits: ["authorized", "activeSchemes"],
24
24
  setup(e, { emit: S }) {
25
- const m = S, { securitySchemes: k } = j(), d = M(), g = h(
25
+ const m = S, { securitySchemes: k } = U(), d = M(), g = h(
26
26
  null
27
27
  ), o = h(0), i = v(() => {
28
28
  if (!e.selectedSchemeOptions || e.selectedSchemeOptions.length === 0)
@@ -71,7 +71,7 @@ const q = ["onClick"], F = { class: "relative z-10 font-medium whitespace-nowrap
71
71
  o.value === c ? (n(), l("div", I)) : b("", !0)
72
72
  ], 2))), 128))
73
73
  ], 2)) : b("", !0),
74
- w.value ? (n(), C(u(U), {
74
+ w.value ? (n(), C(u(j), {
75
75
  key: 1,
76
76
  class: a(["flex-1", e.layout === "reference" && "bg-b-1 rounded-b-lg border border-t-0"]),
77
77
  columns: [""],
@@ -4,8 +4,8 @@ import { snippetz as T } from "@scalar/snippetz";
4
4
  import z from "../../../components/DataTable/DataTable.vue.js";
5
5
  import I from "../../../components/DataTable/DataTableRow.vue.js";
6
6
  import O from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
- import R from "../../Components/CodeSnippet/CodeSnippet.vue.js";
8
- import { useWorkspace as W } from "../../../store/store.js";
7
+ import { useWorkspace as R } from "../../../store/store.js";
8
+ import W from "../../Components/CodeSnippet/CodeSnippet.vue.js";
9
9
  const q = { class: "w-full" }, M = { class: "flex flex-1" }, P = { class: "bg-b-1 flex items-center justify-center overflow-hidden border-t" }, Z = /* @__PURE__ */ $({
10
10
  __name: "RequestCodeExample",
11
11
  props: {
@@ -17,7 +17,7 @@ const q = { class: "w-full" }, M = { class: "flex flex-1" }, P = { class: "bg-b-
17
17
  environment: {}
18
18
  },
19
19
  setup(e) {
20
- const { securitySchemes: b, workspaceMutators: S } = W(), p = a(() => m.value.targetKey === "custom" && d.value?.some(
20
+ const { securitySchemes: b, workspaceMutators: S } = R(), p = a(() => m.value.targetKey === "custom" && d.value?.some(
21
21
  (t) => t.lang === m.value.clientKey
22
22
  ) ? m.value : {
23
23
  targetKey: e.workspace.selectedHttpClient?.targetKey ?? "js",
@@ -142,7 +142,7 @@ const q = { class: "w-full" }, M = { class: "flex flex-1" }, P = { class: "bg-b-
142
142
  key: 0,
143
143
  content: g.value,
144
144
  lang: s.value.id.split(",")[1] ?? "plaintext"
145
- }, null, 8, ["content", "lang"])) : (y(), K(u(R), {
145
+ }, null, 8, ["content", "lang"])) : (y(), K(u(W), {
146
146
  key: 1,
147
147
  client: k.value,
148
148
  example: e.example,
@@ -9,9 +9,9 @@ import x from "./RequestParams.vue.js";
9
9
  import z from "./RequestPathParams.vue.js";
10
10
  import G from "./RequestAuth/RequestAuth.vue.js";
11
11
  import X from "./RequestCodeExample.vue.js";
12
- import { usePluginManager as J } from "../../../plugins/hooks/usePluginManager.js";
13
- import { useWorkspace as Y } from "../../../store/store.js";
14
- import { useLayout as Z } from "../../../hooks/useLayout.js";
12
+ import { useWorkspace as J } from "../../../store/store.js";
13
+ import { useLayout as Y } from "../../../hooks/useLayout.js";
14
+ import { usePluginManager as Z } from "../../../plugins/hooks/usePluginManager.js";
15
15
  const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, ee = ["for"], ae = ["id", "placeholder", "value"], te = {
16
16
  key: 2,
17
17
  class: "text-c-1 flex h-8 items-center"
@@ -37,7 +37,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
37
37
  "Query",
38
38
  "Body"
39
39
  // 'Scripts',
40
- ], { requestMutators: w, cookies: O, securitySchemes: P } = Y(), { layout: u } = Z(), V = v(() => {
40
+ ], { requestMutators: w, cookies: O, securitySchemes: P } = J(), { layout: u } = Y(), V = v(() => {
41
41
  const t = /* @__PURE__ */ new Set(["All", ...R]);
42
42
  return e.example.parameters.path.length || t.delete("Path Parameters"), p(e.operation.method ?? "get") || t.delete("Body"), y.value && t.delete("Auth"), [...t];
43
43
  }), o = v(
@@ -70,7 +70,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
70
70
  },
71
71
  enabled: !0
72
72
  }))
73
- ), H = () => e.operation.summary ? e.operation.summary : e.operation.path.replace(C.PROTOCOL, "") ? e.operation.path.replace(C.PROTOCOL, "") : "Request Name", A = q(), N = J().getViewComponents("request.section"), I = (t, r) => w.edit(e.operation.uid, t, r);
73
+ ), H = () => e.operation.summary ? e.operation.summary : e.operation.path.replace(C.PROTOCOL, "") ? e.operation.path.replace(C.PROTOCOL, "") : "Request Name", A = q(), N = Z().getViewComponents("request.section"), I = (t, r) => w.edit(e.operation.uid, t, r);
74
74
  return g(
75
75
  () => y.value,
76
76
  (t) => {
@@ -1 +1 @@
1
- {"version":3,"file":"update-scheme.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/helpers/update-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,6CAA6C;AAC7C,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEvH,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,EAC1F,KAAK,CAAC,EACN,MAAM,CAAC,EACP,OAAO,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAChD,6CAA6C,cAAc,EAC3D,qBAAmB,SAqBpB,CAAA"}
1
+ {"version":3,"file":"update-scheme.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/helpers/update-scheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,6CAA6C;AAC7C,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEvH,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,EAC1F,KAAK,CAAC,EACN,MAAM,CAAC,EACP,OAAO,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAChD,6CAA6C,cAAc,EAC3D,qBAAmB,SAqBpB,CAAA"}
@@ -19,9 +19,9 @@ import { dragHandlerFactory as Fe } from "./handle-drag.js";
19
19
  import We from "./RequestSidebarItemMenu.vue.js";
20
20
  import { isGettingStarted as Ae } from "./RequestSection/helpers/getting-started.js";
21
21
  import He from "./RequestSidebarItem.vue.js";
22
- import Ke from "../../components/Sidebar/Sidebar.vue.js";
23
- import Ue from "./components/WorkspaceDropdown.vue.js";
24
- import { useWorkspace as Ge } from "../../store/store.js";
22
+ import { useWorkspace as Ke } from "../../store/store.js";
23
+ import Ue from "../../components/Sidebar/Sidebar.vue.js";
24
+ import Ge from "./components/WorkspaceDropdown.vue.js";
25
25
  const je = { class: "bg-b-1 sticky top-0 z-20 flex h-12 items-center px-3" }, Je = {
26
26
  key: 1,
27
27
  class: "text-c-3"
@@ -44,7 +44,7 @@ const je = { class: "bg-b-1 sticky top-0 z-20 flex h-12 items-center px-3" }, Je
44
44
  isSidebarOpen: T,
45
45
  setCollapsedSidebarFolder: Q,
46
46
  toggleSidebarOpen: X
47
- } = Oe(), { layout: l } = Ne(), P = Ge(), {
47
+ } = Oe(), { layout: l } = Ne(), P = Ke(), {
48
48
  activeCollection: _,
49
49
  activeWorkspaceCollections: c,
50
50
  activeRequest: Y,
@@ -155,7 +155,7 @@ const je = { class: "bg-b-1 sticky top-0 z-20 flex h-12 items-center px-3" }, Je
155
155
  !p.value && s.relatedTarget !== B.value && (f.value = !1);
156
156
  }
157
157
  return (s, e) => (a(), v($, null, [
158
- ke(h(t(Ke), {
158
+ ke(h(t(Ue), {
159
159
  class: b([t(T) ? "sidebar-active-width" : ""])
160
160
  }, Re({
161
161
  content: d(() => [
@@ -163,7 +163,7 @@ const je = { class: "bg-b-1 sticky top-0 z-20 flex h-12 items-center px-3" }, Je
163
163
  n("div", {
164
164
  class: b(["size-8", { "xl:hidden": t(l) !== "modal" }])
165
165
  }, null, 2),
166
- t(l) !== "modal" ? (a(), u(t(Ue), { key: 0 })) : m("", !0),
166
+ t(l) !== "modal" ? (a(), u(t(Ge), { key: 0 })) : m("", !0),
167
167
  t(l) !== "modal" ? (a(), v("span", Je, " / ")) : m("", !0),
168
168
  t(l) !== "modal" ? (a(), u(_e, { key: 2 })) : m("", !0),
169
169
  n("button", {
@@ -7,9 +7,9 @@ import { useLayout as be } from "../../hooks/useLayout.js";
7
7
  import { useSidebar as ye } from "../../hooks/useSidebar.js";
8
8
  import { PathId as R } from "../../routes.js";
9
9
  import { useActiveEntities as he } from "../../store/active-entities.js";
10
- import xe from "../../components/HttpMethod/HttpMethod.vue.js";
11
- import { getModifiers as ke } from "../../libs/hot-keys.js";
12
- import { useWorkspace as we } from "../../store/store.js";
10
+ import { useWorkspace as xe } from "../../store/store.js";
11
+ import ke from "../../components/HttpMethod/HttpMethod.vue.js";
12
+ import { getModifiers as we } from "../../libs/hot-keys.js";
13
13
  const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex flex-row items-center gap-1" }, De = { class: "relative" }, Ie = { class: "flex items-start" }, Ce = { class: "flex flex-1 flex-row justify-between font-medium" }, Re = { class: "line-clamp-1 w-full text-left break-all" }, Te = { class: "relative flex h-fit justify-end" }, Me = {
14
14
  class: "flex items-center justify-center",
15
15
  type: "button"
@@ -41,7 +41,7 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
41
41
  requestMutators: $,
42
42
  requestExampleMutators: O,
43
43
  events: P
44
- } = we(), y = ge(), { collapsedSidebarFolders: w, toggleSidebarFolder: V } = ye(), { layout: d } = be(), i = v(() => {
44
+ } = xe(), y = ge(), { collapsedSidebarFolders: w, toggleSidebarFolder: V } = ye(), { layout: d } = be(), i = v(() => {
45
45
  const n = q[t.uid], e = U[t.uid], r = T[t.uid], a = M[t.uid];
46
46
  return n ? {
47
47
  title: n.info?.title || "Untitled Collection",
@@ -130,7 +130,7 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
130
130
  const { draggingItem: r } = z.value;
131
131
  return !q[r?.id] && i.value.entity.type === "collection" ? (n = 1, e = 0) : i.value.entity.type === "tag" && (n = 0.8, e = 0.2), { ceiling: n, floor: e };
132
132
  }), ae = (n, e) => !(d === "modal" || M[e.id] || q[n.id]), oe = (n, e) => {
133
- n && (ke(["default"]).some((s) => n[s]) ? Z("newTab", e.title || "", e.entity.uid) : e.to && y.push(e.to), pe(() => P.focusAddressBar.emit()));
133
+ n && (we(["default"]).some((s) => n[s]) ? Z("newTab", e.title || "", e.entity.uid) : e.to && y.push(e.to), pe(() => P.focusAddressBar.emit()));
134
134
  };
135
135
  function S(n) {
136
136
  const e = t.parentUids[0] ? q[t.parentUids[0]]?.uid || "" : n, r = t.parentUids[0] && U[n]?.name ? { tags: [U[n].name] } : {}, a = $.add(
@@ -227,7 +227,7 @@ const qe = { class: "line-clamp-1 w-full pl-2 break-all" }, Ue = { class: "flex
227
227
  o("span", Ie, [
228
228
  e[13] || (e[13] = B("   ", -1)),
229
229
  e[14] || (e[14] = o("span", { class: "sr-only" }, "HTTP Method:", -1)),
230
- i.value.method ? (u(), f(l(xe), {
230
+ i.value.method ? (u(), f(l(ke), {
231
231
  key: 0,
232
232
  class: "font-bold",
233
233
  method: i.value.method