@scalar/api-client 2.5.32 → 2.5.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue2.js +120 -128
  4. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  5. package/dist/components/AddressBar/AddressBarHistory.vue2.js +57 -63
  6. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  7. package/dist/components/CodeInput/CodeInput.vue2.js +143 -150
  8. package/dist/components/CodeInput/codeVariableWidget.js +70 -75
  9. package/dist/components/CommandPalette/CommandActionInput.vue.js +17 -19
  10. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -27
  11. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +53 -55
  12. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +129 -133
  13. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +84 -98
  15. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +64 -74
  16. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -11
  17. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  18. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +164 -183
  19. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  20. package/dist/components/DataTable/DataTableInput.vue.js +4 -4
  21. package/dist/components/DataTable/DataTableInput.vue2.js +31 -31
  22. package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -2
  23. package/dist/components/EmptyState.vue.js +1 -1
  24. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +75 -84
  25. package/dist/components/Form/LabelInput.vue.js +1 -1
  26. package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
  27. package/dist/components/HttpMethod/HttpMethod.vue2.js +11 -11
  28. package/dist/components/ImportCollection/DropEventListener.vue.js +42 -44
  29. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -23
  30. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +141 -149
  31. package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +1 -1
  32. package/dist/components/ImportCollection/ImportNowButton.vue.js +22 -23
  33. package/dist/components/ImportCollection/IntegrationLogo.vue.js +12 -13
  34. package/dist/components/ImportCollection/PasteEventListener.vue.js +11 -12
  35. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +69 -76
  36. package/dist/components/ImportCollection/utils/get-openapi-version.js +8 -8
  37. package/dist/components/ImportCollection/utils/import-collection.js +14 -14
  38. package/dist/components/OpenApiClientButton.vue.js +1 -1
  39. package/dist/components/OpenApiClientButton.vue2.js +10 -10
  40. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  41. package/dist/components/ScalarAsciiArt.vue2.js +19 -22
  42. package/dist/components/Search/useSearch.js +51 -61
  43. package/dist/components/SectionFilter.vue.js +1 -1
  44. package/dist/components/SectionFilter.vue2.js +26 -29
  45. package/dist/components/Server/ServerDropdown.vue.js +70 -96
  46. package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
  47. package/dist/components/Server/ServerDropdownItem.vue2.js +57 -67
  48. package/dist/components/Server/ServerSelector.vue.js +44 -55
  49. package/dist/components/Server/ServerVariablesForm.vue.js +36 -42
  50. package/dist/components/Server/ServerVariablesSelect.vue.js +6 -6
  51. package/dist/components/SideNav/DownloadAppButton.vue.js +1 -1
  52. package/dist/components/SideNav/SideNav.vue.js +68 -74
  53. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
  54. package/dist/components/Sidebar/Sidebar.vue.js +1 -1
  55. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  56. package/dist/components/TopNav/TopNav.vue.js +107 -122
  57. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  58. package/dist/hooks/useFileDialog.js +12 -12
  59. package/dist/hooks/useResponseBody.js +14 -16
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +2 -2
  62. package/dist/layouts/App/ApiClientApp.vue.js +50 -56
  63. package/dist/layouts/App/ApiClientApp.vue3.js +1 -1
  64. package/dist/layouts/App/create-api-client-app.js +19 -20
  65. package/dist/layouts/App/index.js +1 -1
  66. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  67. package/dist/layouts/Modal/ApiClientModal.vue2.js +18 -21
  68. package/dist/layouts/Web/ApiClientWeb.vue.js +45 -51
  69. package/dist/layouts/Web/ApiClientWeb.vue3.js +1 -1
  70. package/dist/layouts/Web/create-api-client-web.js +19 -20
  71. package/dist/layouts/Web/index.js +1 -1
  72. package/dist/libs/create-client.js +102 -109
  73. package/dist/libs/env-helpers.js +3 -3
  74. package/dist/libs/event-bus.js +15 -15
  75. package/dist/libs/extractAttachmentFilename.js +5 -6
  76. package/dist/libs/find-request.js +9 -10
  77. package/dist/libs/get-request-uid-by-path-method.js +12 -12
  78. package/dist/libs/getOpenApiDocumentDetails.js +7 -7
  79. package/dist/libs/importers/curl.js +3 -3
  80. package/dist/libs/normalize-headers.js +9 -10
  81. package/dist/libs/postman.js +15 -17
  82. package/dist/libs/send-request/build-request-security.js +9 -10
  83. package/dist/libs/send-request/create-fetch-body.js +11 -12
  84. package/dist/libs/send-request/create-fetch-query-params.js +13 -13
  85. package/dist/libs/send-request/create-request-operation.js +83 -84
  86. package/dist/libs/send-request/decode-buffer.d.ts.map +1 -1
  87. package/dist/libs/send-request/set-request-cookies.js +12 -12
  88. package/dist/libs/string-template.js +21 -21
  89. package/dist/libs/validate-parameters.js +5 -8
  90. package/dist/plugins/plugin-manager.js +11 -17
  91. package/dist/store/active-entities.js +90 -117
  92. package/dist/store/collections.js +41 -42
  93. package/dist/store/import-spec.js +25 -26
  94. package/dist/store/request-example.js +20 -24
  95. package/dist/store/requests.js +63 -81
  96. package/dist/store/router-params.js +7 -7
  97. package/dist/store/security-schemes.js +35 -36
  98. package/dist/store/store.js +2 -2
  99. package/dist/store/tags.js +20 -21
  100. package/dist/style.css +1 -1
  101. package/dist/views/Collection/Collection.vue2.js +21 -22
  102. package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
  103. package/dist/views/Collection/CollectionAuthentication.vue2.js +43 -47
  104. package/dist/views/Collection/CollectionEnvironment.vue.js +1 -1
  105. package/dist/views/Collection/CollectionEnvironment.vue2.js +196 -207
  106. package/dist/views/Collection/CollectionInfoForm.vue.js +1 -1
  107. package/dist/views/Collection/CollectionInfoForm.vue2.js +34 -41
  108. package/dist/views/Collection/CollectionNavigation.vue.js +116 -125
  109. package/dist/views/Collection/CollectionOverview.vue2.js +22 -25
  110. package/dist/views/Collection/CollectionServerForm.vue.js +39 -45
  111. package/dist/views/Collection/CollectionServers.vue2.js +88 -98
  112. package/dist/views/Collection/CollectionSettings.vue.js +1 -1
  113. package/dist/views/Collection/CollectionSettings.vue2.js +101 -108
  114. package/dist/views/Collection/components/EnvironmentForm.vue.js +1 -1
  115. package/dist/views/Collection/components/EnvironmentForm.vue2.js +141 -145
  116. package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
  117. package/dist/views/Collection/components/MarkdownInput.vue2.js +1 -2
  118. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -15
  119. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +15 -16
  120. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +61 -64
  121. package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +9 -10
  122. package/dist/views/Cookies/CookieModal.vue.js +1 -1
  123. package/dist/views/Cookies/Cookies.vue2.js +90 -93
  124. package/dist/views/Environment/Environment.vue2.js +267 -295
  125. package/dist/views/Environment/EnvironmentModal.vue.js +63 -70
  126. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -42
  127. package/dist/views/Request/Request.vue.js +1 -1
  128. package/dist/views/Request/Request.vue2.js +60 -67
  129. package/dist/views/Request/RequestRoot.vue.js +1 -1
  130. package/dist/views/Request/RequestRoot.vue2.js +78 -89
  131. package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +37 -44
  132. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +44 -45
  133. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -127
  134. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  135. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +120 -139
  136. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  137. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +97 -97
  138. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  139. package/dist/views/Request/RequestSection/RequestBody.vue2.js +287 -310
  140. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +1 -1
  141. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +86 -94
  142. package/dist/views/Request/RequestSection/RequestParams.vue.js +37 -38
  143. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +36 -38
  144. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  145. package/dist/views/Request/RequestSection/RequestSection.vue2.js +28 -31
  146. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  147. package/dist/views/Request/RequestSection/RequestTable.vue2.js +49 -52
  148. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
  149. package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +16 -16
  150. package/dist/views/Request/RequestSection/helpers/getting-started.js +7 -11
  151. package/dist/views/Request/RequestSection/helpers/update-scheme.js +7 -8
  152. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  153. package/dist/views/Request/RequestSidebar.vue2.js +199 -211
  154. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  155. package/dist/views/Request/RequestSidebarItem.vue2.js +332 -349
  156. package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
  157. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +210 -240
  158. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  159. package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +38 -41
  160. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
  161. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +58 -64
  162. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +1 -2
  163. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
  164. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
  165. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +20 -23
  166. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +1 -1
  167. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  168. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +29 -30
  169. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +38 -41
  170. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
  171. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +28 -29
  172. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  173. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +128 -140
  174. package/dist/views/Request/components/WorkspaceDropdown.vue.js +116 -124
  175. package/dist/views/Request/consts/mediaTypes.js +2 -3
  176. package/dist/views/Request/handle-drag.js +24 -28
  177. package/dist/views/Request/hooks/useOpenApiWatcher.js +26 -33
  178. package/dist/views/Request/libs/auth.js +37 -43
  179. package/dist/views/Request/libs/oauth2.js +30 -32
  180. package/dist/views/Request/libs/watch-mode.js +100 -103
  181. package/dist/views/Settings/SettingsGeneral.vue.js +206 -236
  182. package/package.json +22 -22
  183. package/dist/components/AddressBar/AddressBar.vue3.js +0 -4
  184. package/dist/components/AddressBar/AddressBarHistory.vue3.js +0 -4
  185. package/dist/components/CodeInput/CodeInput.vue3.js +0 -4
  186. package/dist/components/CodeInput/CodeInput.vue4.js +0 -4
  187. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue3.js +0 -4
  188. package/dist/components/CommandPalette/TheCommandPalette.vue3.js +0 -4
  189. package/dist/components/DataTable/DataTableInput.vue3.js +0 -4
  190. package/dist/components/EmptyState.vue3.js +0 -4
  191. package/dist/components/Form/LabelInput.vue3.js +0 -4
  192. package/dist/components/HttpMethod/HttpMethod.vue3.js +0 -4
  193. package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
  194. package/dist/components/OpenApiClientButton.vue3.js +0 -4
  195. package/dist/components/ScalarAsciiArt.vue3.js +0 -4
  196. package/dist/components/SectionFilter.vue3.js +0 -4
  197. package/dist/components/Server/ServerDropdownItem.vue3.js +0 -4
  198. package/dist/components/SideNav/DownloadAppButton.vue3.js +0 -4
  199. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue3.js +0 -4
  200. package/dist/components/Sidebar/Sidebar.vue3.js +0 -4
  201. package/dist/components/Sidebar/SidebarListElement.vue3.js +0 -4
  202. package/dist/components/Sidebar/SidebarListElement.vue4.js +0 -4
  203. package/dist/components/TopNav/TopNavItem.vue3.js +0 -4
  204. package/dist/layouts/App/ApiClientApp.vue2.js +0 -4
  205. package/dist/layouts/Modal/ApiClientModal.vue3.js +0 -4
  206. package/dist/layouts/Web/ApiClientWeb.vue2.js +0 -4
  207. package/dist/style.css.js +0 -4
  208. package/dist/views/Collection/CollectionAuthentication.vue3.js +0 -4
  209. package/dist/views/Collection/CollectionEnvironment.vue3.js +0 -4
  210. package/dist/views/Collection/CollectionInfoForm.vue3.js +0 -4
  211. package/dist/views/Collection/CollectionSettings.vue3.js +0 -4
  212. package/dist/views/Collection/components/EnvironmentForm.vue3.js +0 -4
  213. package/dist/views/Collection/components/MarkdownInput.vue3.js +0 -4
  214. package/dist/views/Cookies/CookieModal.vue3.js +0 -4
  215. package/dist/views/Request/Request.vue3.js +0 -4
  216. package/dist/views/Request/RequestRoot.vue3.js +0 -4
  217. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue3.js +0 -4
  218. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue3.js +0 -4
  219. package/dist/views/Request/RequestSection/RequestBody.vue3.js +0 -4
  220. package/dist/views/Request/RequestSection/RequestCodeExample.vue3.js +0 -4
  221. package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -4
  222. package/dist/views/Request/RequestSection/RequestTable.vue3.js +0 -4
  223. package/dist/views/Request/RequestSection/RequestTableTooltip.vue3.js +0 -4
  224. package/dist/views/Request/RequestSidebar.vue3.js +0 -4
  225. package/dist/views/Request/RequestSidebarItem.vue3.js +0 -4
  226. package/dist/views/Request/RequestSidebarItem.vue4.js +0 -4
  227. package/dist/views/Request/RequestSidebarItemMenu.vue3.js +0 -4
  228. package/dist/views/Request/RequestSubpageHeader.vue3.js +0 -4
  229. package/dist/views/Request/ResponseSection/ResponseBody.vue3.js +0 -4
  230. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue3.js +0 -4
  231. package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue3.js +0 -4
  232. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue2.js +0 -4
  233. package/dist/views/Request/ResponseSection/ResponseEmpty.vue3.js +0 -4
  234. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue3.js +0 -4
  235. package/dist/views/Request/ResponseSection/ResponseSection.vue3.js +0 -4
@@ -1,5 +1,5 @@
1
1
  import o from "./RequestCodeExample.vue2.js";
2
- import "./RequestCodeExample.vue3.js";
2
+ /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
4
  const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-73c4a2cf"]]);
5
5
  export {
@@ -1,12 +1,12 @@
1
- import { defineComponent as H, computed as c, ref as U, createElementBlock as j, openBlock as y, createVNode as s, withCtx as i, createElementVNode as x, createBlock as C, unref as u, toDisplayString as D, createTextVNode as N } from "vue";
2
- import { ScalarCodeBlock as T, ScalarCombobox as W, ScalarButton as z, ScalarIcon as I } from "@scalar/components";
3
- import { snippetz as O } from "@scalar/snippetz";
4
- import R from "../../../components/DataTable/DataTable.vue.js";
5
- import q from "../../../components/DataTable/DataTableRow.vue.js";
6
- import M from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
- import P from "../../Components/CodeSnippet/CodeSnippet.vue.js";
8
- import { useWorkspace as A } from "../../../store/store.js";
9
- const F = { class: "w-full" }, G = { class: "flex flex-1" }, J = { class: "bg-b-1 flex items-center justify-center overflow-hidden border-t" }, le = /* @__PURE__ */ H({
1
+ import { defineComponent as $, computed as a, ref as E, createElementBlock as B, openBlock as y, createVNode as i, withCtx as c, createElementVNode as x, createBlock as K, unref as u, toDisplayString as V, createTextVNode as H } from "vue";
2
+ import { ScalarCodeBlock as U, ScalarCombobox as j, ScalarButton as D, ScalarIcon as N } from "@scalar/components";
3
+ import { snippetz as T } from "@scalar/snippetz";
4
+ import W from "../../../components/DataTable/DataTable.vue.js";
5
+ import z from "../../../components/DataTable/DataTableRow.vue.js";
6
+ import I from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
+ import O from "../../Components/CodeSnippet/CodeSnippet.vue.js";
8
+ import { useWorkspace as R } from "../../../store/store.js";
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: {
12
12
  collection: {},
@@ -16,60 +16,56 @@ const F = { class: "w-full" }, G = { class: "flex flex-1" }, J = { class: "bg-b-
16
16
  workspace: {},
17
17
  environment: {}
18
18
  },
19
- setup(o) {
20
- var K, b, h, S;
21
- const { securitySchemes: k, workspaceMutators: w } = A(), f = c(() => {
22
- var e, t, l;
23
- return m.value.targetKey === "custom" && ((e = d.value) == null ? void 0 : e.some(
24
- (n) => n.lang === m.value.clientKey
25
- )) ? m.value : {
26
- targetKey: ((t = o.workspace.selectedHttpClient) == null ? void 0 : t.targetKey) ?? "js",
27
- clientKey: ((l = o.workspace.selectedHttpClient) == null ? void 0 : l.clientKey) ?? "fetch"
28
- };
29
- }), d = c(
30
- () => o.operation["x-codeSamples"] || o.operation["x-code-samples"] || o.operation["x-custom-examples"]
31
- ), m = U(
32
- (K = d.value) != null && K.length ? {
19
+ setup(n) {
20
+ const { securitySchemes: b, workspaceMutators: h } = R(), f = a(() => m.value.targetKey === "custom" && d.value?.some(
21
+ (t) => t.lang === m.value.clientKey
22
+ ) ? m.value : {
23
+ targetKey: n.workspace.selectedHttpClient?.targetKey ?? "js",
24
+ clientKey: n.workspace.selectedHttpClient?.clientKey ?? "fetch"
25
+ }), d = a(
26
+ () => n.operation["x-codeSamples"] || n.operation["x-code-samples"] || n.operation["x-custom-examples"]
27
+ ), m = E(
28
+ d.value?.length ? {
33
29
  targetKey: "custom",
34
- clientKey: (b = d.value[0]) == null ? void 0 : b.lang
30
+ clientKey: d.value[0]?.lang
35
31
  } : {
36
- targetKey: ((h = o.workspace.selectedHttpClient) == null ? void 0 : h.targetKey) ?? "js",
37
- clientKey: ((S = o.workspace.selectedHttpClient) == null ? void 0 : S.clientKey) ?? "fetch"
32
+ targetKey: n.workspace.selectedHttpClient?.targetKey ?? "js",
33
+ clientKey: n.workspace.selectedHttpClient?.clientKey ?? "fetch"
38
34
  }
39
- ), $ = c(() => (o.operation.selectedSecuritySchemeUids || o.collection.selectedSecuritySchemeUids || []).flat().map((t) => k[t]).filter((t) => !!t)), v = c(() => {
40
- const e = {}, t = O().clients().map((n) => ({
41
- label: n.title,
42
- options: n.clients.map((p) => (e[`${n.key},${p.client}`] = p.title, {
43
- id: `${n.key},${p.client}`,
35
+ ), S = a(() => (n.operation.selectedSecuritySchemeUids || n.collection.selectedSecuritySchemeUids || []).flat().map((t) => b[t]).filter((t) => !!t)), v = a(() => {
36
+ const e = {}, t = T().clients().map((l) => ({
37
+ label: l.title,
38
+ options: l.clients.map((p) => (e[`${l.key},${p.client}`] = p.title, {
39
+ id: `${l.key},${p.client}`,
44
40
  label: p.title
45
41
  }))
46
- })), l = (o.operation["x-codeSamples"] || o.operation["x-code-samples"] || o.operation["x-custom-examples"] || []).map((n) => ({
47
- id: `custom,${n.lang}`,
48
- label: n.label || n.lang
49
- })), a = l.length > 0 ? [
42
+ })), o = (n.operation["x-codeSamples"] || n.operation["x-code-samples"] || n.operation["x-custom-examples"] || []).map((l) => ({
43
+ id: `custom,${l.lang}`,
44
+ label: l.label || l.lang
45
+ })), r = o.length > 0 ? [
50
46
  {
51
47
  id: "customExamples",
52
48
  label: "Code Examples",
53
- options: l.map((n) => ({
54
- id: n.id,
55
- label: n.label ?? n.id
49
+ options: o.map((l) => ({
50
+ id: l.id,
51
+ label: l.label ?? l.id
56
52
  }))
57
53
  },
58
54
  ...t
59
55
  ] : t;
60
- return l.forEach((n) => {
61
- e[n.id] = n.label ?? n.id;
56
+ return o.forEach((l) => {
57
+ e[l.id] = l.label ?? l.id;
62
58
  }), {
63
- options: a,
59
+ options: r,
64
60
  dict: e
65
61
  };
66
- }), r = c(() => {
62
+ }), s = a(() => {
67
63
  const e = f.value;
68
64
  if (e.targetKey === "custom") {
69
- const l = `custom,${e.clientKey}`;
65
+ const o = `custom,${e.clientKey}`;
70
66
  return {
71
- id: l,
72
- label: v.value.dict[l] ?? "Unknown"
67
+ id: o,
68
+ label: v.value.dict[o] ?? "Unknown"
73
69
  };
74
70
  }
75
71
  const t = `${e.targetKey},${e.clientKey}`;
@@ -77,60 +73,56 @@ const F = { class: "w-full" }, G = { class: "flex flex-1" }, J = { class: "bg-b-
77
73
  id: t,
78
74
  label: v.value.dict[t] ?? "Unknown"
79
75
  };
80
- }), E = c(
76
+ }), C = a(
81
77
  () => f.value.targetKey
82
- ), B = c(
78
+ ), k = a(
83
79
  () => f.value.clientKey
84
- ), V = (e) => {
80
+ ), w = (e) => {
85
81
  if (!e)
86
82
  return;
87
- const { id: t } = e, [l, a] = t.split(",");
88
- !l || !a || (m.value = {
89
- targetKey: l,
90
- clientKey: a
91
- }, l !== "custom" && w.edit(o.workspace.uid, "selectedHttpClient", {
92
- targetKey: l,
93
- clientKey: a
83
+ const { id: t } = e, [o, r] = t.split(",");
84
+ !o || !r || (m.value = {
85
+ targetKey: o,
86
+ clientKey: r
87
+ }, o !== "custom" && h.edit(n.workspace.uid, "selectedHttpClient", {
88
+ targetKey: o,
89
+ clientKey: r
94
90
  }));
95
- }, g = c(() => {
96
- var l;
97
- if (!r.value.id.startsWith("custom,"))
91
+ }, g = a(() => {
92
+ if (!s.value.id.startsWith("custom,"))
98
93
  return;
99
- const e = r.value.id.split(",")[1], t = (l = d.value) == null ? void 0 : l.find((a) => a.lang === e);
100
- return t == null ? void 0 : t.source;
94
+ const e = s.value.id.split(",")[1];
95
+ return d.value?.find((o) => o.lang === e)?.source;
101
96
  });
102
- return (e, t) => (y(), j("div", F, [
103
- s(M, {
97
+ return (e, t) => (y(), B("div", q, [
98
+ i(I, {
104
99
  class: "group/preview w-full border-b-0",
105
100
  defaultOpen: !1
106
101
  }, {
107
- title: i(() => t[0] || (t[0] = [
108
- N("Code Snippet")
102
+ title: c(() => t[0] || (t[0] = [
103
+ H("Code Snippet")
109
104
  ])),
110
- actions: i(() => [
111
- x("div", G, [
112
- s(u(W), {
113
- modelValue: r.value,
105
+ actions: c(() => [
106
+ x("div", M, [
107
+ i(u(j), {
108
+ modelValue: s.value,
114
109
  options: v.value.options,
115
110
  placement: "bottom-end",
116
- "onUpdate:modelValue": V
111
+ "onUpdate:modelValue": w
117
112
  }, {
118
- default: i(() => [
119
- s(u(z), {
113
+ default: c(() => [
114
+ i(u(D), {
120
115
  class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-1.25 py-0.75 font-normal",
121
116
  fullWidth: "",
122
117
  variant: "ghost"
123
118
  }, {
124
- default: i(() => {
125
- var l;
126
- return [
127
- x("span", null, D((l = r.value) == null ? void 0 : l.label), 1),
128
- s(u(I), {
129
- icon: "ChevronDown",
130
- size: "md"
131
- })
132
- ];
133
- }),
119
+ default: c(() => [
120
+ x("span", null, V(s.value?.label), 1),
121
+ i(u(N), {
122
+ icon: "ChevronDown",
123
+ size: "md"
124
+ })
125
+ ]),
134
126
  _: 1
135
127
  })
136
128
  ]),
@@ -138,27 +130,27 @@ const F = { class: "w-full" }, G = { class: "flex flex-1" }, J = { class: "bg-b-
138
130
  }, 8, ["modelValue", "options"])
139
131
  ])
140
132
  ]),
141
- default: i(() => [
142
- s(R, {
133
+ default: c(() => [
134
+ i(W, {
143
135
  columns: [""],
144
136
  presentational: ""
145
137
  }, {
146
- default: i(() => [
147
- s(q, null, {
148
- default: i(() => [
149
- x("div", J, [
150
- g.value ? (y(), C(u(T), {
138
+ default: c(() => [
139
+ i(z, null, {
140
+ default: c(() => [
141
+ x("div", P, [
142
+ g.value ? (y(), K(u(U), {
151
143
  key: 0,
152
144
  content: g.value,
153
- lang: r.value.id.split(",")[1] ?? "plaintext"
154
- }, null, 8, ["content", "lang"])) : (y(), C(u(P), {
145
+ lang: s.value.id.split(",")[1] ?? "plaintext"
146
+ }, null, 8, ["content", "lang"])) : (y(), K(u(O), {
155
147
  key: 1,
156
- client: B.value,
148
+ client: k.value,
157
149
  example: e.example,
158
150
  operation: e.operation,
159
- securitySchemes: $.value,
151
+ securitySchemes: S.value,
160
152
  server: e.server,
161
- target: E.value,
153
+ target: C.value,
162
154
  environment: e.environment
163
155
  }, null, 8, ["client", "example", "operation", "securitySchemes", "server", "target", "environment"]))
164
156
  ])
@@ -175,5 +167,5 @@ const F = { class: "w-full" }, G = { class: "flex flex-1" }, J = { class: "bg-b-
175
167
  }
176
168
  });
177
169
  export {
178
- le as default
170
+ Z as default
179
171
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as S, computed as m, onMounted as N, nextTick as p, ref as A, watch as B, createBlock as d, openBlock as v, withCtx as i, createElementVNode as f, createCommentVNode as k, createVNode as g, normalizeClass as M, unref as P, withModifiers as W, createTextVNode as R, toDisplayString as w } from "vue";
2
- import { ScalarTooltip as z, ScalarButton as D } from "@scalar/components";
3
- import { requestExampleParametersSchema as V } from "@scalar/oas-utils/entities/spec";
4
- import x from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
5
- import C from "./RequestTable.vue.js";
6
- import { useWorkspace as G } from "../../../store/store.js";
7
- const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, j = { class: "sr-only" }, I = /* @__PURE__ */ S({
1
+ import { defineComponent as O, computed as m, onMounted as S, nextTick as p, ref as N, watch as A, createBlock as d, openBlock as v, withCtx as i, createElementVNode as f, createCommentVNode as h, createVNode as k, normalizeClass as B, unref as g, withModifiers as M, createTextVNode as P, toDisplayString as R } from "vue";
2
+ import { ScalarTooltip as W, ScalarButton as z } from "@scalar/components";
3
+ import { requestExampleParametersSchema as w } from "@scalar/oas-utils/entities/spec";
4
+ import D from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
5
+ import V from "./RequestTable.vue.js";
6
+ import { useWorkspace as x } from "../../../store/store.js";
7
+ const G = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, U = { class: "sr-only" }, Z = /* @__PURE__ */ O({
8
8
  __name: "RequestParams",
9
9
  props: {
10
10
  example: {},
@@ -18,16 +18,16 @@ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
18
18
  invalidParams: {}
19
19
  },
20
20
  setup(t) {
21
- const { requestExampleMutators: s } = G(), n = m(() => t.example.parameters[t.paramKey] ?? []);
22
- N(() => {
21
+ const { requestExampleMutators: s } = x(), n = m(() => t.example.parameters[t.paramKey] ?? []);
22
+ S(() => {
23
23
  p(() => {
24
24
  y();
25
25
  });
26
26
  });
27
27
  const o = () => {
28
- const e = V.parse({ enabled: !1 }), a = [...n.value, e];
28
+ const e = w.parse({ enabled: !1 }), a = [...n.value, e];
29
29
  s.edit(t.example.uid, `parameters.${t.paramKey}`, a);
30
- }, u = A(null), K = (e, a, r) => {
30
+ }, u = N(null), C = (e, a, r) => {
31
31
  const c = n.value;
32
32
  if (c.length > e) {
33
33
  const l = [...c];
@@ -39,27 +39,26 @@ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
39
39
  l
40
40
  );
41
41
  } else {
42
- const l = [V.parse({ [a]: r })];
42
+ const l = [w.parse({ [a]: r })];
43
43
  s.edit(t.example.uid, `parameters.${t.paramKey}`, l), p(() => {
44
- var h;
45
44
  if (!u.value)
46
45
  return;
47
- (h = u.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || h.focus();
46
+ u.value.querySelectorAll("input")[a === "key" ? 0 : 1]?.focus();
48
47
  });
49
48
  }
50
49
  e === c.length - 1 && o();
51
- }, $ = (e, a) => s.edit(
50
+ }, K = (e, a) => s.edit(
52
51
  t.example.uid,
53
52
  `parameters.${t.paramKey}.${e}.enabled`,
54
53
  a
55
- ), q = () => {
54
+ ), $ = () => {
56
55
  const e = n.value.filter((a) => a.required);
57
56
  s.edit(
58
57
  t.example.uid,
59
58
  `parameters.${t.paramKey}`,
60
59
  e
61
60
  ), p(() => o());
62
- }, E = (e) => {
61
+ }, q = (e) => {
63
62
  const a = n.value;
64
63
  if (a.length > e) {
65
64
  const r = [...a];
@@ -78,10 +77,10 @@ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
78
77
  e && e.key !== "" && e.value !== "" && o();
79
78
  }
80
79
  }
81
- const T = m(
80
+ const E = m(
82
81
  () => n.value.filter((e) => e.key || e.value).length
83
- ), O = m(() => n.value.length > 1);
84
- B(
82
+ ), T = m(() => n.value.length > 1);
83
+ A(
85
84
  () => t.example,
86
85
  (e, a) => {
87
86
  e !== a && y();
@@ -89,37 +88,37 @@ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
89
88
  { immediate: !0 }
90
89
  );
91
90
  const b = m(() => (t.readOnlyEntries ?? []).length > 0);
92
- return (e, a) => (v(), d(x, {
91
+ return (e, a) => (v(), d(D, {
93
92
  class: "group/params",
94
- itemCount: T.value
93
+ itemCount: E.value
95
94
  }, {
96
95
  title: i(() => [
97
- R(w(e.title), 1)
96
+ P(R(e.title), 1)
98
97
  ]),
99
98
  actions: i(() => [
100
- f("div", U, [
101
- O.value ? (v(), d(P(z), {
99
+ f("div", G, [
100
+ T.value ? (v(), d(g(W), {
102
101
  key: 0,
103
102
  content: "Clear optional parameters",
104
103
  placement: "left"
105
104
  }, {
106
105
  default: i(() => [
107
- g(P(D), {
106
+ k(g(z), {
108
107
  class: "pr-0.75 pl-1 transition-none",
109
108
  size: "sm",
110
109
  variant: "ghost",
111
- onClick: W(q, ["stop"])
110
+ onClick: M($, ["stop"])
112
111
  }, {
113
112
  default: i(() => [
114
- a[0] || (a[0] = R(" Clear ")),
115
- f("span", j, "All " + w(e.title), 1)
113
+ a[0] || (a[0] = P(" Clear ")),
114
+ f("span", U, "All " + R(e.title), 1)
116
115
  ]),
117
116
  _: 1,
118
117
  __: [0]
119
118
  })
120
119
  ]),
121
120
  _: 1
122
- })) : k("", !0)
121
+ })) : h("", !0)
123
122
  ])
124
123
  ]),
125
124
  default: i(() => [
@@ -127,9 +126,9 @@ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
127
126
  ref_key: "tableWrapperRef",
128
127
  ref: u
129
128
  }, [
130
- b.value ? (v(), d(C, {
129
+ b.value ? (v(), d(V, {
131
130
  key: 0,
132
- class: M(["flex-1", { "bg-c-3/5": b.value }]),
131
+ class: B(["flex-1", { "bg-c-3/5": b.value }]),
133
132
  columns: ["32px", "", ""],
134
133
  envVariables: e.envVariables,
135
134
  environment: e.environment,
@@ -139,8 +138,8 @@ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
139
138
  items: e.readOnlyEntries,
140
139
  label: e.label,
141
140
  workspace: e.workspace
142
- }, null, 8, ["class", "envVariables", "environment", "invalidParams", "items", "label", "workspace"])) : k("", !0),
143
- g(C, {
141
+ }, null, 8, ["class", "envVariables", "environment", "invalidParams", "items", "label", "workspace"])) : h("", !0),
142
+ k(V, {
144
143
  class: "flex-1",
145
144
  columns: ["32px", "", ""],
146
145
  envVariables: e.envVariables,
@@ -149,9 +148,9 @@ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
149
148
  items: n.value,
150
149
  label: e.label,
151
150
  workspace: e.workspace,
152
- onToggleRow: $,
153
- onUpdateRow: K,
154
- onDeleteRow: E
151
+ onToggleRow: K,
152
+ onUpdateRow: C,
153
+ onDeleteRow: q
155
154
  }, null, 8, ["envVariables", "environment", "invalidParams", "items", "label", "workspace"])
156
155
  ], 512)
157
156
  ]),
@@ -160,5 +159,5 @@ const U = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
160
159
  }
161
160
  });
162
161
  export {
163
- I as default
162
+ Z as default
164
163
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as R, computed as $, watch as K, createBlock as d, openBlock as h, withCtx as f, createCommentVNode as b, createTextVNode as x, toDisplayString as V } from "vue";
2
- import { REGEX as C } from "@scalar/oas-utils/helpers";
3
- import q from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
4
- import E from "./RequestTable.vue.js";
5
- import { useWorkspace as M } from "../../../store/store.js";
6
- const A = /* @__PURE__ */ R({
1
+ import { defineComponent as k, computed as w, watch as R, createBlock as p, openBlock as u, withCtx as d, createCommentVNode as $, createTextVNode as K, toDisplayString as b } from "vue";
2
+ import { REGEX as x } from "@scalar/oas-utils/helpers";
3
+ import V from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
4
+ import C from "./RequestTable.vue.js";
5
+ import { useWorkspace as q } from "../../../store/store.js";
6
+ const B = /* @__PURE__ */ k({
7
7
  __name: "RequestPathParams",
8
8
  props: {
9
9
  example: {},
@@ -16,83 +16,81 @@ const A = /* @__PURE__ */ R({
16
16
  invalidParams: {}
17
17
  },
18
18
  setup(a) {
19
- const { requestMutators: u, requestExampleMutators: l } = M(), s = $(
19
+ const { requestMutators: c, requestExampleMutators: s } = q(), m = w(
20
20
  () => a.example.parameters[a.paramKey].map((e) => ({
21
21
  ...e,
22
22
  enum: e.enum
23
23
  }))
24
- ), v = (e, r, n) => {
25
- var m, t;
26
- const i = a.example.parameters[a.paramKey], o = (m = i[e]) == null ? void 0 : m.key;
24
+ ), h = (e, r, n) => {
25
+ const i = a.example.parameters[a.paramKey], o = i[e]?.key;
27
26
  if (o) {
28
27
  if (r === "key") {
29
- if ((t = i[e]) != null && t.required)
28
+ if (i[e]?.required)
30
29
  return;
31
30
  if (n) {
32
- const c = encodeURIComponent(o), p = encodeURIComponent(n), k = new RegExp(`(?<=/):${c}(?=[/?#]|$)`, "g"), w = a.operation.path.replace(k, `:${p}`);
33
- u.edit(a.operation.uid, "path", w);
31
+ const t = encodeURIComponent(o), l = encodeURIComponent(n), P = new RegExp(`(?<=/):${t}(?=[/?#]|$)`, "g"), g = a.operation.path.replace(P, `:${l}`);
32
+ c.edit(a.operation.uid, "path", g);
34
33
  } else {
35
34
  i.splice(e, 1);
36
- const c = new RegExp(`/:${encodeURIComponent(o)}(?=[/?#]|$)`, "g"), p = a.operation.path.replace(c, "");
37
- u.edit(a.operation.uid, "path", p);
35
+ const t = new RegExp(`/:${encodeURIComponent(o)}(?=[/?#]|$)`, "g"), l = a.operation.path.replace(t, "");
36
+ c.edit(a.operation.uid, "path", l);
38
37
  }
39
38
  }
40
- l.edit(
39
+ s.edit(
41
40
  a.example.uid,
42
41
  `parameters.${a.paramKey}.${e}.${r}`,
43
42
  n
44
43
  );
45
44
  }
46
- }, y = (e) => {
47
- const r = s.value;
45
+ }, f = (e) => {
46
+ const r = m.value;
48
47
  if (r.length > e) {
49
48
  const n = [...r];
50
- n.splice(e, 1), l.edit(
49
+ n.splice(e, 1), s.edit(
51
50
  a.example.uid,
52
51
  `parameters.${a.paramKey}`,
53
52
  n
54
53
  );
55
54
  }
56
- }, P = (e) => {
57
- var m;
58
- const r = ((m = e.match(C.PATH)) == null ? void 0 : m.map((t) => t.slice(1, -1))) || [], n = a.example.parameters[a.paramKey], i = new Map(n.map((t) => [t.key, t])), o = r.map(
55
+ }, v = (e) => {
56
+ const r = e.match(x.PATH)?.map((t) => t.slice(1, -1)) || [], n = a.example.parameters[a.paramKey], i = new Map(n.map((t) => [t.key, t])), o = r.map(
59
57
  (t) => i.get(t) || { key: t, value: "", enabled: !0 }
60
58
  );
61
59
  n.forEach((t) => {
62
60
  !r.includes(t.key) && (t.value || t.required) && o.push(t);
63
- }), n.splice(0, n.length, ...o), l.edit(a.example.uid, `parameters.${a.paramKey}`, n);
64
- }, g = (e) => {
65
- e && P(e);
61
+ }), n.splice(0, n.length, ...o), s.edit(a.example.uid, `parameters.${a.paramKey}`, n);
62
+ }, y = (e) => {
63
+ e && v(e);
66
64
  };
67
- return K(
65
+ return R(
68
66
  () => a.operation.path,
69
67
  (e) => {
70
- e && g(e);
68
+ e && y(e);
71
69
  }
72
- ), (e, r) => (h(), d(q, {
73
- itemCount: s.value.length
70
+ ), (e, r) => (u(), p(V, {
71
+ itemCount: m.value.length
74
72
  }, {
75
- title: f(() => [
76
- x(V(e.title), 1)
73
+ title: d(() => [
74
+ K(b(e.title), 1)
77
75
  ]),
78
- default: f(() => [
79
- s.value.length ? (h(), d(E, {
76
+ default: d(() => [
77
+ m.value.length ? (u(), p(C, {
80
78
  key: 0,
81
79
  class: "flex-1",
82
80
  columns: ["32px", "", ""],
83
81
  envVariables: e.envVariables,
84
82
  environment: e.environment,
85
83
  invalidParams: e.invalidParams,
86
- items: s.value,
84
+ items: m.value,
87
85
  workspace: e.workspace,
88
- onUpdateRow: v,
89
- onDeleteRow: y
90
- }, null, 8, ["envVariables", "environment", "invalidParams", "items", "workspace"])) : b("", !0)
86
+ onUpdateRow: h,
87
+ onDeleteRow: f
88
+ }, null, 8, ["envVariables", "environment", "invalidParams", "items", "workspace"])) : $("", !0)
91
89
  ]),
92
90
  _: 1
93
91
  }, 8, ["itemCount"]));
94
92
  }
95
93
  });
96
94
  export {
97
- A as default
95
+ B as default
98
96
  };
@@ -1,5 +1,5 @@
1
1
  import o from "./RequestSection.vue2.js";
2
- import "./RequestSection.vue3.js";
2
+ /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
4
  const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fbbc9b8b"]]);
5
5
  export {