@scalar/api-client 2.14.1 → 2.17.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 (293) hide show
  1. package/CHANGELOG.md +176 -0
  2. package/dist/hooks/useResponseBody.js +6 -6
  3. package/dist/libs/errors.d.ts +1 -0
  4. package/dist/libs/errors.d.ts.map +1 -1
  5. package/dist/libs/errors.js +1 -0
  6. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  7. package/dist/libs/send-request/create-request-operation.js +41 -35
  8. package/dist/style.css +1 -1
  9. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +28 -38
  10. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +81 -65
  12. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -23
  13. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
  15. package/dist/v2/blocks/operation-block/components/Header.vue2.js +29 -38
  16. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +10 -0
  17. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -0
  18. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +22 -0
  19. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +31 -0
  20. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -0
  21. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +31 -0
  22. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +3 -9
  23. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +56 -0
  25. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +10 -3
  26. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
  27. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +46 -0
  28. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +45 -0
  29. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -0
  30. package/dist/v2/blocks/operation-block/helpers/build-request.js +66 -0
  31. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +9 -0
  32. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts +16 -0
  33. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts.map +1 -0
  34. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +4 -0
  35. package/dist/v2/blocks/operation-block/helpers/get-delimiter.js +17 -0
  36. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +9 -3
  37. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-block/helpers/get-example.js +21 -0
  39. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +53 -0
  40. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -0
  41. package/dist/v2/blocks/operation-block/helpers/send-request.js +120 -0
  42. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts +1 -1
  43. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  45. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  46. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +89 -110
  47. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +2 -2
  48. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +8 -13
  50. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -1
  51. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +22 -28
  52. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +19 -8
  53. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  54. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +30 -24
  55. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +12 -0
  56. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts.map +1 -0
  57. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +20 -0
  58. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts +10 -0
  59. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts.map +1 -0
  60. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +4 -0
  61. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +14 -12
  62. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  63. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +191 -169
  64. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  65. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +10 -10
  66. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +2 -1
  67. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  68. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +15 -19
  69. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +2 -2
  70. package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
  71. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  72. package/dist/v2/blocks/operation-code-sample/types.d.ts +16 -0
  73. package/dist/v2/blocks/operation-code-sample/types.d.ts.map +1 -1
  74. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +15 -10
  75. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  76. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  77. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +202 -160
  78. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +2 -0
  79. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  80. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  81. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +60 -51
  82. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
  83. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
  84. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
  85. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
  86. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +2 -2
  87. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  88. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
  89. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -4
  90. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  91. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  92. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +3 -2
  93. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  94. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +146 -147
  95. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
  96. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  97. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
  98. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
  99. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +1 -1
  100. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
  101. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +21 -15
  102. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
  103. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
  104. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +13 -3
  105. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
  106. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  107. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
  108. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
  109. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
  111. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
  112. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
  113. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
  114. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
  115. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
  116. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +4 -15
  117. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  118. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  119. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +117 -71
  120. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
  121. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
  122. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
  124. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +59 -56
  126. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  127. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  128. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -1
  129. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  130. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +26 -24
  131. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
  132. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  133. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +44 -43
  134. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
  135. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
  136. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
  137. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
  138. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  139. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
  140. package/dist/v2/components/code-input/CodeInput.vue.d.ts +16 -6
  141. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  142. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  143. package/dist/v2/components/code-input/CodeInput.vue2.js +81 -65
  144. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
  145. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  146. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
  147. package/dist/v2/components/resize/index.d.ts +0 -1
  148. package/dist/v2/components/resize/index.d.ts.map +1 -1
  149. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +9 -5
  150. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  151. package/dist/v2/components/sidebar/Sidebar.vue.js +51 -46
  152. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
  153. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  154. package/dist/v2/features/app/App.vue.d.ts +3 -0
  155. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  156. package/dist/v2/features/app/App.vue.js +130 -143
  157. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
  158. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  159. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  160. package/dist/v2/features/app/components/AppSidebar.vue2.js +216 -106
  161. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
  162. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  163. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts +22 -0
  164. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +1 -0
  165. package/dist/v2/features/app/components/ItemDecorator.vue.js +138 -0
  166. package/dist/v2/features/app/components/ItemDecorator.vue2.js +4 -0
  167. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
  168. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  169. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  170. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  171. package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
  172. package/dist/v2/features/app/helpers/routes.d.ts +32 -6
  173. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  174. package/dist/v2/features/app/helpers/routes.js +25 -16
  175. package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
  176. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
  177. package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
  178. package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
  179. package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
  180. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
  181. package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
  182. package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
  183. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
  184. package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
  185. package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
  186. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
  187. package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +156 -0
  188. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
  189. package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
  190. package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
  191. package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
  192. package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
  193. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
  194. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  195. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  196. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
  197. package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
  198. package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
  199. package/dist/v2/features/collection/components/Environment.vue.js +32 -1
  200. package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
  201. package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
  202. package/dist/v2/features/collection/components/Servers.vue.js +142 -2
  203. package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
  204. package/dist/v2/features/collection/components/Settings.vue.js +58 -2
  205. package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
  206. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +8 -0
  207. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  208. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +76 -68
  209. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +8 -0
  210. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
  211. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +83 -75
  212. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +4 -0
  213. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
  214. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +32 -34
  215. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +16 -0
  216. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  217. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +24 -21
  218. package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
  219. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  220. package/dist/v2/features/modal/Modal.vue.js +1 -1
  221. package/dist/v2/features/modal/Modal.vue2.js +118 -31
  222. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
  223. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  224. package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
  225. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
  226. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
  227. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
  228. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
  229. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
  230. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
  231. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
  232. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
  233. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
  234. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  235. package/dist/v2/features/operation/Operation.vue.js +59 -28
  236. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
  237. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
  238. package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
  239. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
  240. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
  241. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
  242. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
  243. package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
  244. package/dist/v2/features/operation/index.d.ts +0 -1
  245. package/dist/v2/features/operation/index.d.ts.map +1 -1
  246. package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
  247. package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
  248. package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
  249. package/dist/v2/features/settings/DocumentSettings.vue.js +2 -2
  250. package/dist/v2/features/settings/DocumentSettings.vue2.js +1 -1
  251. package/dist/v2/helpers/generate-location-id.d.ts +19 -0
  252. package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
  253. package/dist/v2/helpers/generate-location-id.js +10 -0
  254. package/dist/v2/helpers/get-active-environment.d.ts +5 -0
  255. package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
  256. package/dist/v2/helpers/get-active-environment.js +22 -0
  257. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  258. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  259. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  260. package/dist/v2/helpers/plugins.d.ts +59 -0
  261. package/dist/v2/helpers/plugins.d.ts.map +1 -0
  262. package/dist/v2/helpers/plugins.js +11 -0
  263. package/dist/v2/helpers/storage.d.ts.map +1 -1
  264. package/dist/v2/helpers/storage.js +5 -5
  265. package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
  266. package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
  267. package/dist/v2/hooks/use-scroll-lock.js +21 -0
  268. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
  269. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  270. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
  271. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
  272. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
  273. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  274. package/package.json +19 -19
  275. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
  276. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
  277. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
  278. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
  279. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
  280. package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
  281. package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
  282. package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
  283. package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
  284. package/dist/v2/hooks/use-sync-path.js +0 -51
  285. package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
  286. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
  287. package/dist/v2/hooks/use-workspace-client-events.js +0 -112
  288. package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
  289. package/dist/v2/plugins.d.ts +0 -44
  290. package/dist/v2/plugins.d.ts.map +0 -1
  291. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
  292. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
  293. /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
@@ -1,13 +1,15 @@
1
- import { defineComponent as v, computed as r, onMounted as y, createBlock as h, createElementBlock as f, openBlock as s, unref as u, createElementVNode as p } from "vue";
2
- import { getResolvedRef as S } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
- import { useRouter as B } from "vue-router";
4
- import { getSecurityRequirements as k } from "./helpers/get-security-requirements.js";
5
- import R from "../../blocks/operation-block/OperationBlock.vue.js";
6
- const g = {
1
+ import { defineComponent as h, computed as a, onMounted as p, watch as y, createBlock as f, createElementBlock as k, openBlock as s, unref as n, createElementVNode as S } from "vue";
2
+ import { getResolvedRef as g } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
+ import { useRouter as w } from "vue-router";
4
+ import { getOperationHeader as B } from "./helpers/get-operation-header.js";
5
+ import { getSecurityRequirements as C } from "./helpers/get-security-requirements.js";
6
+ import { getSelectedSecurity as R } from "./helpers/get-selected-security.js";
7
+ import x from "../../blocks/operation-block/OperationBlock.vue.js";
8
+ const N = {
7
9
  key: 1,
8
10
  class: "flex h-full w-full items-center justify-center"
9
- }, N = {}, q = /* @__PURE__ */ v({
10
- ...N,
11
+ }, q = {}, O = /* @__PURE__ */ h({
12
+ ...q,
11
13
  __name: "Operation",
12
14
  props: {
13
15
  documentSlug: {},
@@ -19,53 +21,82 @@ const g = {
19
21
  exampleName: {},
20
22
  environment: {},
21
23
  workspaceStore: {},
22
- activeWorkspace: {}
24
+ activeWorkspace: {},
25
+ plugins: {}
23
26
  },
24
27
  setup(e) {
25
- const n = r(
26
- () => e.path && e.method ? S(e.document?.paths?.[e.path]?.[e.method]) : void 0
27
- ), a = r(
28
- () => k(e.document, n.value)
29
- ), m = r(
28
+ const o = a(
29
+ () => e.path && e.method ? g(e.document?.paths?.[e.path]?.[e.method]) ?? null : null
30
+ ), u = a(() => [
31
+ ...e.workspaceStore.workspace?.["x-scalar-cookies"] ?? [],
32
+ ...e.document?.["x-scalar-cookies"] ?? []
33
+ ]), m = a(
30
34
  () => e.document?.servers?.find(
31
35
  ({ url: t }) => t === e.document?.["x-scalar-selected-server"]
32
36
  ) ?? null
33
37
  );
34
- y(() => {
38
+ p(() => {
35
39
  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 });
36
- });
37
- const c = r(() => e.document?.["x-scalar-set-operation-security"] ? n.value?.["x-scalar-selected-security"] : e.document?.["x-scalar-selected-security"]), l = r(() => e.document?.["x-scalar-set-operation-security"] ? {
40
+ }), y(
41
+ o,
42
+ (t) => {
43
+ t && e.path && e.method && !B({
44
+ operation: t,
45
+ name: "Accept",
46
+ type: "header"
47
+ }) && e.eventBus.emit("operation:add:parameter", {
48
+ type: "header",
49
+ meta: { method: e.method, path: e.path, exampleKey: e.exampleName ?? "default" },
50
+ payload: {
51
+ key: "Accept",
52
+ value: "*/*",
53
+ isDisabled: !1
54
+ }
55
+ });
56
+ },
57
+ { immediate: !0 }
58
+ );
59
+ const l = a(
60
+ () => C(e.document, o.value)
61
+ ), c = a(
62
+ () => R(e.document, o.value, l.value)
63
+ ), i = a(() => e.document?.["x-scalar-set-operation-security"] ? {
38
64
  type: "operation",
39
65
  path: e.path ?? "",
40
66
  method: e.method ?? "get"
41
67
  } : {
42
68
  type: "document"
43
- }), i = "2.14.1", d = B();
44
- return (t, o) => t.path && t.method && t.exampleName && n.value ? (s(), h(u(R), {
69
+ }), d = "2.17.0", v = w();
70
+ return (t, r) => t.path && t.method && t.exampleName && o.value ? (s(), f(n(x), {
45
71
  key: 0,
46
- appVersion: u(i),
47
- authMeta: l.value,
72
+ appVersion: n(d),
73
+ authMeta: i.value,
74
+ documentUrl: t.document?.["x-scalar-original-source-url"],
48
75
  environment: t.environment,
49
76
  eventBus: t.eventBus,
50
77
  exampleKey: t.exampleName,
78
+ globalCookies: u.value,
51
79
  history: [],
80
+ httpClients: t.workspaceStore.config["x-scalar-reference-config"]?.httpClients,
52
81
  layout: t.layout,
53
82
  method: t.method,
54
- operation: n.value,
83
+ operation: o.value,
55
84
  path: t.path,
56
- plugins: [],
57
- security: a.value,
85
+ plugins: t.plugins,
86
+ proxyUrl: t.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
87
+ securityRequirements: l.value,
58
88
  securitySchemes: t.document?.components?.securitySchemes ?? {},
89
+ selectedClient: t.workspaceStore.workspace["x-scalar-default-client"],
59
90
  selectedSecurity: c.value,
60
91
  server: m.value,
61
92
  servers: t.document?.servers ?? [],
62
93
  totalPerformedRequests: 0,
63
- "onUpdate:servers": o[0] || (o[0] = (x) => u(d).push({ name: "document.servers" }))
64
- }, null, 8, ["appVersion", "authMeta", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "security", "securitySchemes", "selectedSecurity", "server", "servers"])) : (s(), f("div", g, [...o[1] || (o[1] = [
65
- p("span", { class: "text-c-3" }, "Select an operation to view details", -1)
94
+ "onUpdate:servers": r[0] || (r[0] = (U) => n(v).push({ name: "document.servers" }))
95
+ }, null, 8, ["appVersion", "authMeta", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "httpClients", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "server", "servers"])) : (s(), k("div", N, [...r[1] || (r[1] = [
96
+ S("span", { class: "text-c-3" }, "Select an operation to view details", -1)
66
97
  ])]));
67
98
  }
68
99
  });
69
100
  export {
70
- q as default
101
+ O as default
71
102
  };
@@ -0,0 +1,17 @@
1
+ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
2
+ import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/parameter';
3
+ /**
4
+ * Retrieves a parameter from an operation's parameters by name and type ('in').
5
+ * This is typically used to find a particular header, query, path, or cookie parameter.
6
+ *
7
+ * @param operation - The operation object containing the parameters array.
8
+ * @param name - The name of the parameter to search for (case-insensitive).
9
+ * @param type - The parameter location (e.g., 'header', 'query', 'path', 'cookie').
10
+ * @returns The found parameter object, or null if not found.
11
+ */
12
+ export declare const getOperationHeader: ({ operation, name, type, }: {
13
+ operation: OperationObject;
14
+ name: string;
15
+ type: ParameterObject["in"];
16
+ }) => import("@scalar/workspace-store/schemas/v3.1/strict/reference").ReferenceType<ParameterObject> | null;
17
+ //# sourceMappingURL=get-operation-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-operation-header.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-operation-header.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,4BAIhC;IACD,SAAS,EAAE,eAAe,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;CAC5B,0GAOA,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
+ const m = ({
3
+ operation: r,
4
+ name: o,
5
+ type: t
6
+ }) => r.parameters?.find((a) => {
7
+ const e = n(a);
8
+ return e.in === t && e.name.toLowerCase() === o.toLowerCase();
9
+ }) ?? null;
10
+ export {
11
+ m as getOperationHeader
12
+ };
@@ -8,5 +8,5 @@ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/stric
8
8
  *
9
9
  * Otherwise we generally go operation -> document security.
10
10
  */
11
- export declare const getSecurityRequirements: (document: OpenApiDocument | null, operation?: OperationObject) => import("@scalar/workspace-store/schemas/v3.1/strict/security-requirement").SecurityRequirementObject[];
11
+ export declare const getSecurityRequirements: (document: OpenApiDocument | null, operation: OperationObject | null) => Partial<Record<string, string[]>>[];
12
12
  //# sourceMappingURL=get-security-requirements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-security-requirements.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,eAAe,GAAG,IAAI,EAAE,YAAY,eAAe,2GAYpG,CAAA"}
1
+ {"version":3,"file":"get-security-requirements.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-security-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,eAAe,GAAG,IAAI,EAAE,WAAW,eAAe,GAAG,IAAI,wCAY1G,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { OpenApiDocument, OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ /** Get the selected security for an operation or document, with defaults to the requirements */
3
+ export declare const getSelectedSecurity: (document: OpenApiDocument | null, operation: OperationObject | null, securityRequirements: NonNullable<OpenApiDocument["security"]>) => {
4
+ selectedIndex: number;
5
+ selectedSchemes: import("@scalar/workspace-store/schemas/v3.1/strict/security-requirement").SecurityRequirementObject[];
6
+ };
7
+ //# sourceMappingURL=get-selected-security.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAIpH,gGAAgG;AAChG,eAAO,MAAM,mBAAmB,GAC9B,UAAU,eAAe,GAAG,IAAI,EAChC,WAAW,eAAe,GAAG,IAAI,EACjC,sBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;;;CA6B/D,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { isAuthOptional as r } from "../../../blocks/scalar-auth-selector-block/helpers/is-auth-optional.js";
2
+ const a = (e, t, s) => {
3
+ const c = s[0];
4
+ if (e?.["x-scalar-set-operation-security"]) {
5
+ if (t?.["x-scalar-selected-security"])
6
+ return t?.["x-scalar-selected-security"];
7
+ } else if (e?.["x-scalar-selected-security"])
8
+ return e?.["x-scalar-selected-security"];
9
+ return r(s) || !c ? {
10
+ selectedIndex: -1,
11
+ selectedSchemes: []
12
+ } : {
13
+ selectedIndex: 0,
14
+ selectedSchemes: [c]
15
+ };
16
+ };
17
+ export {
18
+ a as getSelectedSecurity
19
+ };
@@ -1,3 +1,2 @@
1
- /** biome-ignore-all lint/performance/noBarrelFile: It's an entry point for this feature */
2
1
  export { default as Operation } from './Operation.vue.js';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/index.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAE3F,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/components/SearchModal.vue"],"names":[],"mappings":"AAiJA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAQxE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AA2OF,wBAMG"}
1
+ {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/search/components/SearchModal.vue"],"names":[],"mappings":"AAkJA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAQxE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AAoPF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchModal.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cc152ff7"]]);
3
+ import a from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-0c30b37a"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1,95 +1,96 @@
1
- import { defineComponent as g, ref as $, watch as x, computed as I, createBlock as b, openBlock as d, unref as n, withCtx as c, createElementVNode as r, createVNode as w, withKeys as m, withModifiers as u, isRef as k, createElementBlock as B, Fragment as V, renderList as C, createTextVNode as N, toDisplayString as M } from "vue";
2
- import { ScalarModal as q, ScalarSearchInput as D, ScalarSearchResultList as E } from "@scalar/components";
3
- import { nanoid as K } from "nanoid";
1
+ import { defineComponent as $, ref as g, watch as I, computed as k, createBlock as w, openBlock as c, unref as l, withKeys as d, withModifiers as i, withCtx as m, createElementVNode as s, createVNode as b, isRef as x, createElementBlock as B, Fragment as V, renderList as C, createTextVNode as N, toDisplayString as K } from "vue";
2
+ import { ScalarModal as M, ScalarSearchInput as q, ScalarSearchResultList as D } from "@scalar/components";
3
+ import { nanoid as E } from "nanoid";
4
4
  import { useSearchIndex as L } from "../hooks/use-search-index.js";
5
5
  import F from "./SearchResult.vue.js";
6
6
  const P = {
7
7
  class: "mb-0 flex flex-col",
8
8
  role: "search"
9
- }, G = /* @__PURE__ */ g({
9
+ }, G = /* @__PURE__ */ $({
10
10
  __name: "SearchModal",
11
11
  props: {
12
12
  modalState: {},
13
13
  documents: {},
14
14
  eventBus: {}
15
15
  },
16
- setup(i) {
17
- const v = K(), p = `${v}-search-result`, f = `${v}-search-instructions`, { query: o, results: s } = L(() => i.documents), l = $(void 0);
18
- x(
19
- () => i.modalState.open,
16
+ setup(u) {
17
+ const v = E(), p = `${v}-search-result`, f = `${v}-search-instructions`, { query: r, results: o } = L(() => u.documents), a = g(void 0);
18
+ I(
19
+ () => u.modalState.open,
20
20
  (t) => {
21
- t && (o.value = "");
21
+ t && (r.value = "");
22
22
  }
23
23
  );
24
24
  const S = (t) => {
25
- const e = t === "up" ? -1 : 1, a = s.value.length;
26
- typeof l.value == "number" ? l.value = (l.value + e + a) % a : l.value = e === -1 ? a - 1 : 0;
25
+ const e = t === "up" ? -1 : 1, n = o.value.length;
26
+ typeof a.value == "number" ? a.value = (a.value + e + n) % n : a.value = e === -1 ? n - 1 : 0;
27
27
  };
28
28
  function h(t) {
29
- if (typeof t != "number" || !s.value[t])
29
+ if (typeof t != "number" || !o.value[t])
30
30
  return;
31
- const e = s.value[t];
32
- i.modalState.hide(), i.eventBus.emit("scroll-to:nav-item", { id: e.item.id });
31
+ const e = o.value[t];
32
+ u.modalState.hide(), u.eventBus.emit("scroll-to:nav-item", { id: e.item.id });
33
33
  }
34
- const R = I(() => {
35
- const t = s.value[l.value ?? -1];
34
+ const R = k(() => {
35
+ const t = o.value[a.value ?? -1];
36
36
  return t ? `search-result-${t.item.id}` : void 0;
37
37
  });
38
- return (t, e) => (d(), b(n(q), {
38
+ return (t, e) => (c(), w(l(M), {
39
39
  "aria-label": "Reference Search",
40
40
  state: t.modalState,
41
- variant: "search"
41
+ variant: "search",
42
+ onKeydown: e[5] || (e[5] = d(i((n) => t.modalState.hide(), ["stop"]), ["esc"]))
42
43
  }, {
43
- default: c(() => [
44
- r("div", P, [
45
- w(n(D), {
46
- modelValue: n(o),
47
- "onUpdate:modelValue": e[0] || (e[0] = (a) => k(o) ? o.value = a : null),
44
+ default: m(() => [
45
+ s("div", P, [
46
+ b(l(q), {
47
+ modelValue: l(r),
48
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => x(r) ? r.value = n : null),
48
49
  "aria-activedescendant": R.value,
49
50
  "aria-autocomplete": "list",
50
51
  "aria-controls": p,
51
52
  "aria-describedby": f,
52
53
  role: "combobox",
53
- onBlur: e[1] || (e[1] = (a) => l.value = void 0),
54
+ onBlur: e[1] || (e[1] = (n) => a.value = void 0),
54
55
  onKeydown: [
55
- e[2] || (e[2] = m(u((a) => S("down"), ["stop", "prevent"]), ["down"])),
56
- e[3] || (e[3] = m(u(() => h(l.value), ["stop", "prevent"]), ["enter"])),
57
- e[4] || (e[4] = m(u((a) => S("up"), ["stop", "prevent"]), ["up"]))
56
+ e[2] || (e[2] = d(i((n) => S("down"), ["stop", "prevent"]), ["down"])),
57
+ e[3] || (e[3] = d(i(() => h(a.value), ["stop", "prevent"]), ["enter"])),
58
+ e[4] || (e[4] = d(i((n) => S("up"), ["stop", "prevent"]), ["up"]))
58
59
  ]
59
60
  }, null, 8, ["modelValue", "aria-activedescendant"])
60
61
  ]),
61
- w(n(E), {
62
+ b(l(D), {
62
63
  id: p,
63
64
  "aria-label": "Reference Search Results",
64
65
  class: "custom-scroll p-1 pt-0",
65
- noResults: !n(s).length
66
+ noResults: !l(o).length
66
67
  }, {
67
- query: c(() => [
68
- N(M(n(o)), 1)
68
+ query: m(() => [
69
+ N(K(l(r)), 1)
69
70
  ]),
70
- default: c(() => [
71
- (d(!0), B(V, null, C(n(s), (a, y) => (d(), b(F, {
72
- id: `search-result-${a.item.id}`,
73
- key: a.refIndex,
74
- isSelected: l.value === y,
75
- result: a,
76
- onClick: u(() => h(y), ["prevent"])
71
+ default: m(() => [
72
+ (c(!0), B(V, null, C(l(o), (n, y) => (c(), w(F, {
73
+ id: `search-result-${n.item.id}`,
74
+ key: n.refIndex,
75
+ isSelected: a.value === y,
76
+ result: n,
77
+ onClick: i(() => h(y), ["prevent"])
77
78
  }, null, 8, ["id", "isSelected", "result", "onClick"]))), 128))
78
79
  ]),
79
80
  _: 1
80
81
  }, 8, ["noResults"]),
81
- r("div", {
82
+ s("div", {
82
83
  id: f,
83
84
  class: "ref-search-meta"
84
- }, [...e[5] || (e[5] = [
85
- r("span", {
85
+ }, [...e[6] || (e[6] = [
86
+ s("span", {
86
87
  "aria-hidden": "true",
87
88
  class: "contents"
88
89
  }, [
89
- r("span", null, "↑↓ Navigate"),
90
- r("span", null, "⏎ Select")
90
+ s("span", null, "↑↓ Navigate"),
91
+ s("span", null, "⏎ Select")
91
92
  ], -1),
92
- r("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)
93
+ s("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)
93
94
  ])])
94
95
  ]),
95
96
  _: 1
@@ -1,7 +1,7 @@
1
1
  import t from "./DocumentSettings.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-07248003"]]);
4
+ const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-cda64f02"]]);
5
5
  export {
6
- p as default
6
+ c as default
7
7
  };
@@ -71,8 +71,8 @@ const U = { class: "flex flex-col gap-12" }, C = { class: "flex flex-col gap-2"
71
71
  ], -1)),
72
72
  n(o(y), {
73
73
  class: "custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap shadow-none focus:outline-none",
74
- variant: "danger",
75
74
  disabled: l.isDraftDocument,
75
+ variant: "danger",
76
76
  onClick: b
77
77
  }, {
78
78
  default: m(() => [...t[6] || (t[6] = [
@@ -0,0 +1,19 @@
1
+ import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
+ /**
3
+ * Generates a unique string ID for an API location, based on the document, path, method, and example.
4
+ * Filters out undefined values and serializes the composite array into a stable string.
5
+ *
6
+ * @param params - An object containing document, path, method, and optional example name.
7
+ * @returns A stringified array representing the unique location identifier.
8
+ *
9
+ * Example:
10
+ * generateLocationId({ document: 'mydoc', path: '/users', method: 'get', example: 'default' })
11
+ * // => '["mydoc","/users","get","default"]'
12
+ */
13
+ export declare const generateLocationId: ({ document, path, method, example, }: {
14
+ document: string;
15
+ path?: string;
16
+ method?: HttpMethod;
17
+ example?: string;
18
+ }) => string;
19
+ //# sourceMappingURL=generate-location-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-location-id.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/generate-location-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,sCAKhC;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,WAEA,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { isDefined as n } from "@scalar/helpers/array/is-defined";
2
+ const f = ({
3
+ document: e,
4
+ path: r,
5
+ method: t,
6
+ example: i
7
+ }) => JSON.stringify([e, r, t, i].filter(n));
8
+ export {
9
+ f as generateLocationId
10
+ };
@@ -0,0 +1,5 @@
1
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
+ import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
3
+ import { type XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
4
+ export declare const getActiveEnvironment: (workspace: WorkspaceStore | null, document: WorkspaceDocument | null) => XScalarEnvironment;
5
+ //# sourceMappingURL=get-active-environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-active-environment.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-active-environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,2EAA2E,CAAA;AAGlF,eAAO,MAAM,oBAAoB,GAC/B,WAAW,cAAc,GAAG,IAAI,EAChC,UAAU,iBAAiB,GAAG,IAAI,KACjC,kBAsBF,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { xScalarEnvironmentSchema as r } from "@scalar/workspace-store/schemas/extensions/document/x-scalar-environments";
2
+ import { coerceValue as a } from "@scalar/workspace-store/schemas/typebox-coerce";
3
+ const s = (e, o) => {
4
+ if (e === null)
5
+ return a(r, {});
6
+ const n = e.workspace["x-scalar-active-environment"];
7
+ if (!n)
8
+ return a(r, {});
9
+ const t = e.workspace["x-scalar-environments"]?.[n] ?? {
10
+ variables: []
11
+ }, i = o?.["x-scalar-environments"]?.[n] ?? {
12
+ variables: []
13
+ };
14
+ return a(r, {
15
+ ...t,
16
+ ...i,
17
+ variables: [...t.variables, ...i.variables]
18
+ });
19
+ };
20
+ export {
21
+ s as getActiveEnvironment
22
+ };
@@ -1,6 +1,6 @@
1
1
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
2
  import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace';
3
- import type { UseSidebarStateReturn } from '../../v2/hooks/use-sidebar-state.js';
3
+ import type { UseAppSidebarReturn } from '../../v2/features/app/hooks/use-app-sidebar.js';
4
4
  /**
5
5
  * Returns display details for a tab in the API client UI.
6
6
  * Determines the title and icon to use based on workspace, document, path, and method.
@@ -35,7 +35,7 @@ export declare const getTabDetails: ({ workspace, document, path, method, getEnt
35
35
  document?: string;
36
36
  path?: string;
37
37
  method?: HttpMethod;
38
- getEntryByLocation: UseSidebarStateReturn["getEntryByLocation"];
38
+ getEntryByLocation: UseAppSidebarReturn["getEntryByLocation"];
39
39
  }) => {
40
40
  title: string;
41
41
  icon?: Tab["icon"];
@@ -1 +1 @@
1
- {"version":3,"file":"get-tab-details.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-tab-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAE/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,GAAI,4DAM3B;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,kBAAkB,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAA;CAChE,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAoCtC,CAAA"}
1
+ {"version":3,"file":"get-tab-details.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-tab-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,GAAI,4DAM3B;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,kBAAkB,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAA;CAC9D,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAoCtC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
2
2
  const r = {
3
- Enter: { event: "operation:send:request", modifiers: ["default"] },
3
+ Enter: { event: "operation:send:request:hotkey", modifiers: ["default"] },
4
4
  b: { event: "ui:toggle:sidebar", modifiers: ["default"] },
5
5
  p: { event: "ui:open:command-palette", modifiers: ["shiftKey"] },
6
6
  l: { event: "ui:focus:address-bar", modifiers: ["default"] }
@@ -0,0 +1,59 @@
1
+ import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
2
+ import type { Component } from 'vue';
3
+ /** A type representing the hooks that a client plugin can define */
4
+ export type ClientPluginHooks = {
5
+ beforeRequest: (payload: Request) => Request | Promise<Request>;
6
+ responseReceived: (payload: {
7
+ response: Response;
8
+ request: Request;
9
+ operation: OperationObject;
10
+ }) => void | Promise<void>;
11
+ };
12
+ /** A type representing the components that a client plugin can define */
13
+ export type ClientPluginComponents = {
14
+ request: Component;
15
+ response: Component;
16
+ };
17
+ /**
18
+ * ClientPlugin is used to extend the API Client with custom hooks and UI components.
19
+ *
20
+ * Example usage:
21
+ *
22
+ * const myPlugin: ClientPlugin = {
23
+ * hooks: {
24
+ * beforeRequest: (request) => {
25
+ * // Modify the request before it is sent
26
+ * request.headers.set('X-Custom-Header', 'foo');
27
+ * return request;
28
+ * },
29
+ * responseReceived: async (response, operation) => {
30
+ * // Handle post-response logic
31
+ * const data = await response.json();
32
+ * console.log('Received:', data, 'for operation:', operation.operationId);
33
+ * }
34
+ * },
35
+ * components: {
36
+ * request: MyRequestComponent, // Custom Vue component for rendering the request section
37
+ * response: MyResponseComponent // Custom Vue component for rendering the response section
38
+ * }
39
+ * }
40
+ */
41
+ export type ClientPlugin = {
42
+ hooks?: Partial<ClientPluginHooks>;
43
+ components?: Partial<ClientPluginComponents>;
44
+ };
45
+ /**
46
+ * Maps hook names to their expected payload types.
47
+ * This ensures type safety when executing hooks with their corresponding payloads.
48
+ * Derived from the ClientPlugin hooks definition.
49
+ */
50
+ type HookPayloadMap = {
51
+ [K in keyof ClientPluginHooks]: Parameters<ClientPluginHooks[K]>[0];
52
+ };
53
+ /**
54
+ * Execute any hook with type-safe payload handling.
55
+ * The payload type is inferred from the hook name to ensure correct usage.
56
+ */
57
+ export declare const executeHook: <K extends keyof HookPayloadMap>(payload: HookPayloadMap[K], hookName: K, plugins: ClientPlugin[]) => Promise<HookPayloadMap[K]>;
58
+ export {};
59
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,gBAAgB,EAAE,CAAC,OAAO,EAAE;QAC1B,QAAQ,EAAE,QAAQ,CAAA;QAClB,OAAO,EAAE,OAAO,CAAA;QAChB,SAAS,EAAE,eAAe,CAAA;KAC3B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B,CAAA;AAED,yEAAyE;AACzE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,KAAK,cAAc,GAAG;KACnB,CAAC,IAAI,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,SAAS,MAAM,cAAc,EAC9D,SAAS,cAAc,CAAC,CAAC,CAAC,EAC1B,UAAU,CAAC,EACX,SAAS,YAAY,EAAE,KACtB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAY3B,CAAA"}
@@ -0,0 +1,11 @@
1
+ const i = async (a, e, n) => {
2
+ let o = a;
3
+ for (const c of n) {
4
+ const t = c.hooks?.[e];
5
+ t && (o = await t(o) ?? o);
6
+ }
7
+ return o;
8
+ };
9
+ export {
10
+ i as executeHook
11
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/storage.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;oCACoB,MAAM,KAAG,IAAI;IAIpC;;OAEG;gCACc,MAAM,GAAG,IAAI;CAGtB,CAAA"}
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/storage.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;OAEG;oCACoB,MAAM,KAAG,IAAI;IAQpC;;OAEG;gCACc,MAAM,GAAG,IAAI;CAGtB,CAAA"}
@@ -1,15 +1,15 @@
1
- import { safeLocalStorage as t } from "@scalar/helpers/object/local-storage";
2
- const e = "scalar.currentPath", o = {
1
+ import { safeLocalStorage as e } from "@scalar/helpers/object/local-storage";
2
+ const r = "scalar.currentPath", o = {
3
3
  /**
4
4
  * We keep the currently active path so we can reload it if needed
5
5
  */
6
- setCurrentPath: (r) => {
7
- t().setItem(e, r);
6
+ setCurrentPath: (t) => {
7
+ t !== "/" && e().setItem(r, t);
8
8
  },
9
9
  /**
10
10
  * Retrieve the last active path
11
11
  */
12
- getLastPath: () => t().getItem(e)
12
+ getLastPath: () => e().getItem(r)
13
13
  };
14
14
  export {
15
15
  o as workspaceStorage