@scalar/api-client 2.15.0 → 2.17.1

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 (271) hide show
  1. package/CHANGELOG.md +166 -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 +84 -45
  12. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -11
  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 +2 -2
  15. package/dist/v2/blocks/operation-block/components/Header.vue2.js +28 -35
  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 +158 -125
  78. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  80. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +59 -50
  81. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
  82. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
  83. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
  84. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
  85. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  86. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
  87. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +1 -0
  88. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  89. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +148 -149
  90. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
  91. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  92. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
  93. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
  94. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
  95. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
  96. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +13 -3
  97. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
  98. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  99. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
  100. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
  101. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  102. package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
  103. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
  104. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
  105. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
  106. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
  107. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
  108. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +0 -2
  109. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  111. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +97 -87
  112. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
  113. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
  114. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
  116. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +59 -56
  118. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  120. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  122. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +26 -24
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
  124. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +44 -43
  126. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
  127. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
  128. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
  129. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
  130. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  131. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
  132. package/dist/v2/components/code-input/CodeInput.vue.d.ts +7 -6
  133. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  134. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  135. package/dist/v2/components/code-input/CodeInput.vue2.js +61 -59
  136. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
  137. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  138. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
  139. package/dist/v2/components/resize/index.d.ts +0 -1
  140. package/dist/v2/components/resize/index.d.ts.map +1 -1
  141. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -5
  142. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  143. package/dist/v2/components/sidebar/Sidebar.vue.js +49 -47
  144. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
  145. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  146. package/dist/v2/features/app/App.vue.d.ts +3 -0
  147. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  148. package/dist/v2/features/app/App.vue.js +128 -139
  149. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
  150. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  151. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  152. package/dist/v2/features/app/components/AppSidebar.vue2.js +137 -105
  153. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
  154. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  155. package/dist/v2/features/app/components/{ItemDecorator.vue.d.ts → SidebarItemMenu.vue.d.ts} +1 -1
  156. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -0
  157. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +129 -0
  158. package/dist/v2/features/app/components/SidebarItemMenu.vue2.js +4 -0
  159. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
  160. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  161. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  162. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  163. package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
  164. package/dist/v2/features/app/helpers/routes.d.ts +32 -6
  165. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  166. package/dist/v2/features/app/helpers/routes.js +25 -16
  167. package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
  168. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
  169. package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
  170. package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
  171. package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
  172. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
  173. package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
  174. package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
  175. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
  176. package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
  177. package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
  178. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
  179. package/dist/v2/{hooks/use-workspace-client-events.js → features/app/hooks/use-workspace-client-app-events.js} +48 -45
  180. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
  181. package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
  182. package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
  183. package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
  184. package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
  185. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
  186. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  187. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  188. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
  189. package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
  190. package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
  191. package/dist/v2/features/collection/components/Environment.vue.js +32 -1
  192. package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
  193. package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
  194. package/dist/v2/features/collection/components/Servers.vue.js +142 -2
  195. package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
  196. package/dist/v2/features/collection/components/Settings.vue.js +58 -2
  197. package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
  198. package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
  199. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  200. package/dist/v2/features/modal/Modal.vue.js +1 -1
  201. package/dist/v2/features/modal/Modal.vue2.js +118 -31
  202. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
  203. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  204. package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
  205. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
  206. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
  207. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
  208. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
  209. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
  210. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
  211. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
  212. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
  213. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
  214. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  215. package/dist/v2/features/operation/Operation.vue.js +59 -28
  216. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
  217. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
  218. package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
  219. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
  220. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
  221. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
  222. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
  223. package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
  224. package/dist/v2/features/operation/index.d.ts +0 -1
  225. package/dist/v2/features/operation/index.d.ts.map +1 -1
  226. package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
  227. package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
  228. package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
  229. package/dist/v2/helpers/generate-location-id.d.ts +19 -0
  230. package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
  231. package/dist/v2/helpers/generate-location-id.js +10 -0
  232. package/dist/v2/helpers/get-active-environment.d.ts +5 -0
  233. package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
  234. package/dist/v2/helpers/get-active-environment.js +22 -0
  235. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  236. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  237. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  238. package/dist/v2/helpers/plugins.d.ts +59 -0
  239. package/dist/v2/helpers/plugins.d.ts.map +1 -0
  240. package/dist/v2/helpers/plugins.js +11 -0
  241. package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
  242. package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
  243. package/dist/v2/hooks/use-scroll-lock.js +21 -0
  244. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
  245. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  246. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
  247. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
  248. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
  249. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  250. package/package.json +20 -20
  251. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
  252. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
  253. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
  254. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
  255. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
  256. package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
  257. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +0 -1
  258. package/dist/v2/features/app/components/ItemDecorator.vue.js +0 -138
  259. package/dist/v2/features/app/components/ItemDecorator.vue2.js +0 -4
  260. package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
  261. package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
  262. package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
  263. package/dist/v2/hooks/use-sync-path.js +0 -51
  264. package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
  265. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
  266. package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
  267. package/dist/v2/plugins.d.ts +0 -44
  268. package/dist/v2/plugins.d.ts.map +0 -1
  269. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
  270. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
  271. /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
@@ -1,18 +1,19 @@
1
- import { defineComponent as V, useId as T, computed as B, ref as C, useTemplateRef as w, onMounted as I, onBeforeUnmount as M, createElementBlock as k, openBlock as p, unref as s, createElementVNode as o, normalizeClass as A, createVNode as r, createCommentVNode as S, normalizeStyle as N, createBlock as q, createTextVNode as c, toDisplayString as i, withCtx as D } from "vue";
2
- import { ScalarWrappingText as F, ScalarButton as H, ScalarIcon as L } from "@scalar/components";
3
- import { REQUEST_METHODS as O } from "@scalar/helpers/http/http-info";
4
- import { ScalarIconWarningCircle as P } from "@scalar/icons";
5
- import W from "./AddressBarHistory.vue.js";
6
- import K from "../../../../components/HttpMethod/HttpMethod.vue.js";
7
- import Q from "../../../components/server/ServerDropdown.vue.js";
8
- import j from "../../../components/code-input/CodeInput.vue.js";
9
- const G = ["id"], J = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, X = { class: "z-context-plus flex gap-1" }, Y = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, Z = {
1
+ import { defineComponent as I, useId as L, computed as w, ref as S, useTemplateRef as U, onMounted as M, onBeforeUnmount as N, createElementBlock as z, openBlock as h, unref as n, createElementVNode as s, normalizeClass as D, createVNode as a, createCommentVNode as E, normalizeStyle as F, createBlock as H, createTextVNode as p, toDisplayString as m, withCtx as W } from "vue";
2
+ import { ScalarWrappingText as O, ScalarButton as P, ScalarIcon as K } from "@scalar/components";
3
+ import { REQUEST_METHODS as Q } from "@scalar/helpers/http/http-info";
4
+ import { ScalarIconWarningCircle as j } from "@scalar/icons";
5
+ import { useLoadingAnimation as G } from "../hooks/use-loading-animation.js";
6
+ import J from "./AddressBarHistory.vue.js";
7
+ import X from "../../../../components/HttpMethod/HttpMethod.vue.js";
8
+ import Y from "../../../components/server/ServerDropdown.vue.js";
9
+ import Z from "../../../components/code-input/CodeInput.vue.js";
10
+ const _ = ["id"], ee = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, te = { class: "z-context-plus flex gap-1" }, oe = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, se = {
10
11
  key: 0,
11
12
  class: "z-context absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6"
12
- }, _ = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, ee = { class: "min-w-0 flex-1" }, te = {
13
+ }, ne = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, le = { class: "min-w-0 flex-1" }, re = {
13
14
  "aria-hidden": "true",
14
15
  class: "inline-flex items-center gap-1"
15
- }, le = { class: "sr-only" }, me = /* @__PURE__ */ V({
16
+ }, ae = { class: "sr-only" }, be = /* @__PURE__ */ I({
16
17
  __name: "AddressBar",
17
18
  props: {
18
19
  path: {},
@@ -21,76 +22,84 @@ const G = ["id"], J = { class: "pointer-events-none absolute top-0 left-0 block
21
22
  servers: {},
22
23
  history: {},
23
24
  layout: {},
24
- percentage: { default: 100 },
25
25
  eventBus: {},
26
26
  environment: {}
27
27
  },
28
28
  emits: ["execute", "update:servers"],
29
- setup(l, { expose: U, emit: E }) {
30
- const u = E, m = T(), R = B(() => ({
31
- backgroundColor: `color-mix(in srgb, transparent 90%, ${O[l.method].colorVar})`,
32
- transform: `translate3d(-${l.percentage}%,0,0)`
33
- })), d = C(null), a = C(null), h = B(() => a.value || d.value), b = (e, t, n) => l.eventBus.emit(
34
- "operation:update:pathMethod",
35
- {
36
- meta: { method: l.method, path: l.path },
37
- payload: { method: e, path: t },
38
- callback: (v) => {
39
- v === "success" || v === "no-change" ? (a.value = null, d.value = null) : v === "conflict" && (e !== l.method && (a.value = e), t !== l.path && (d.value = t));
40
- }
41
- },
42
- n
43
- ), z = (e) => b(e, d.value ?? l.path), $ = (e) => b(a.value ?? l.method, e, {
44
- debounceKey: `operation:update:pathMethod-${l.path}-${l.method}`
45
- }), g = w("sendButtonRef"), f = w("addressBarRef"), x = () => g.value?.$el?.focus(), y = (e) => {
46
- f.value?.isFocused && l.layout !== "desktop" || (f.value?.focus(!0), e?.event.preventDefault());
29
+ setup(o, { expose: R, emit: $ }) {
30
+ const f = $, v = L(), { percentage: b, startLoading: g, stopLoading: c } = G(), V = w(() => ({
31
+ backgroundColor: `color-mix(in srgb, transparent 90%, ${Q[o.method].colorVar})`,
32
+ transform: `translate3d(-${b.value}%,0,0)`
33
+ })), d = S(null), r = S(null), x = w(() => r.value || d.value), B = (e, t, l) => {
34
+ const A = i.value?.cursorPosition();
35
+ o.eventBus.emit(
36
+ "operation:update:pathMethod",
37
+ {
38
+ meta: { method: o.method, path: o.path },
39
+ payload: { method: e, path: t },
40
+ callback: (u) => {
41
+ (u === "success" || u === "no-change") && (r.value = null, d.value = null), u === "success" ? o.eventBus.emit("ui:focus:address-bar", { position: A }) : u === "conflict" && (e !== o.method && (r.value = e), t !== o.path && (d.value = t));
42
+ }
43
+ },
44
+ l
45
+ );
46
+ }, q = (e) => B(e, d.value ?? o.path), T = (e) => {
47
+ const t = e.startsWith("/") ? e : `/${e}`;
48
+ B(r.value ?? o.method, t, {
49
+ debounceKey: `operation:update:pathMethod-${o.path}-${o.method}`
50
+ });
51
+ }, y = U("sendButtonRef"), i = U("addressBarRef"), C = () => y.value?.$el?.focus(), k = (e) => {
52
+ if (i.value?.isFocused && o.layout !== "desktop")
53
+ return;
54
+ const t = e && "position" in e ? e.position : "end";
55
+ i.value?.focus(t), e && "event" in e && e.event.preventDefault();
47
56
  };
48
- return I(() => {
49
- l.eventBus.on("ui:focus:address-bar", y), l.eventBus.on("ui:focus:send-button", x);
50
- }), M(() => {
51
- l.eventBus.off("ui:focus:address-bar", y), l.eventBus.off("ui:focus:send-button", x);
52
- }), U({
53
- methodConflict: a,
57
+ return M(() => {
58
+ o.eventBus.on("ui:focus:address-bar", k), o.eventBus.on("ui:focus:send-button", C), o.eventBus.on("hooks:on:request:sent", g), o.eventBus.on("hooks:on:request:complete", c);
59
+ }), N(() => {
60
+ o.eventBus.off("ui:focus:address-bar", k), o.eventBus.off("ui:focus:send-button", C), o.eventBus.off("hooks:on:request:sent", g), o.eventBus.off("hooks:on:request:complete", c), c();
61
+ }), R({
62
+ methodConflict: r,
54
63
  pathConflict: d
55
- }), (e, t) => (p(), k("div", {
56
- id: s(m),
64
+ }), (e, t) => (h(), z("div", {
65
+ id: n(v),
57
66
  class: "scalar-address-bar order-last flex h-(--scalar-address-bar-height) w-full [--scalar-address-bar-height:32px] lg:order-none lg:w-auto"
58
67
  }, [
59
- o("div", {
60
- class: A(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
61
- "outline-c-danger outline": h.value
68
+ s("div", {
69
+ class: D(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
70
+ "outline-c-danger outline": x.value
62
71
  }])
63
72
  }, [
64
- o("div", J, [
65
- o("div", {
73
+ s("div", ee, [
74
+ s("div", {
66
75
  class: "absolute top-0 left-0 z-[1002] h-full w-full",
67
- style: N(R.value)
76
+ style: F(V.value)
68
77
  }, null, 4)
69
78
  ]),
70
- o("div", X, [
71
- r(s(K), {
79
+ s("div", te, [
80
+ a(n(X), {
72
81
  isEditable: e.layout !== "modal",
73
82
  isSquare: "",
74
- method: a.value ?? e.method,
83
+ method: r.value ?? e.method,
75
84
  teleport: "",
76
- onChange: z
85
+ onChange: q
77
86
  }, null, 8, ["isEditable", "method"])
78
87
  ]),
79
- o("div", Y, [
80
- e.servers.length ? (p(), q(s(Q), {
88
+ s("div", oe, [
89
+ e.servers.length ? (h(), H(n(Y), {
81
90
  key: 0,
82
91
  layout: e.layout,
83
92
  server: e.server,
84
93
  servers: e.servers,
85
- target: s(m),
86
- "onUpdate:selectedServer": t[0] || (t[0] = (n) => e.eventBus.emit("server:update:selected", n)),
87
- "onUpdate:servers": t[1] || (t[1] = (n) => u("update:servers")),
88
- "onUpdate:variable": t[2] || (t[2] = (n) => e.eventBus.emit("server:update:variables", n))
89
- }, null, 8, ["layout", "server", "servers", "target"])) : S("", !0),
90
- t[6] || (t[6] = o("div", { class: "fade-left" }, null, -1)),
91
- r(s(j), {
94
+ target: n(v),
95
+ "onUpdate:selectedServer": t[0] || (t[0] = (l) => e.eventBus.emit("server:update:selected", l)),
96
+ "onUpdate:servers": t[1] || (t[1] = (l) => f("update:servers")),
97
+ "onUpdate:variable": t[2] || (t[2] = (l) => e.eventBus.emit("server:update:variables", l))
98
+ }, null, 8, ["layout", "server", "servers", "target"])) : E("", !0),
99
+ t[6] || (t[6] = s("div", { class: "fade-left" }, null, -1)),
100
+ a(n(Z), {
92
101
  ref_key: "addressBarRef",
93
- ref: f,
102
+ ref: i,
94
103
  alwaysEmitChange: "",
95
104
  "aria-label": "Path",
96
105
  class: "min-w-fit outline-none",
@@ -101,62 +110,63 @@ const G = ["id"], J = { class: "pointer-events-none absolute top-0 left-0 block
101
110
  emitOnBlur: !1,
102
111
  environment: e.environment,
103
112
  importCurl: "",
113
+ layout: e.layout,
104
114
  modelValue: e.path,
105
115
  placeholder: e.server ? "" : "Enter a URL or cURL command",
106
116
  server: "",
107
- onCurl: t[3] || (t[3] = (n) => e.eventBus.emit("ui:open:command-palette", {
117
+ onCurl: t[3] || (t[3] = (l) => e.eventBus.emit("ui:open:command-palette", {
108
118
  action: "import-curl-command",
109
119
  payload: {
110
- curl: n
120
+ curl: l
111
121
  }
112
122
  })),
113
- onSubmit: t[4] || (t[4] = (n) => u("execute")),
114
- "onUpdate:modelValue": $
115
- }, null, 8, ["disabled", "environment", "modelValue", "placeholder"]),
116
- t[7] || (t[7] = o("div", { class: "fade-right" }, null, -1))
123
+ onSubmit: t[4] || (t[4] = (l) => f("execute")),
124
+ "onUpdate:modelValue": T
125
+ }, null, 8, ["disabled", "environment", "layout", "modelValue", "placeholder"]),
126
+ t[7] || (t[7] = s("div", { class: "fade-right" }, null, -1))
117
127
  ]),
118
- r(W, {
128
+ a(J, {
119
129
  history: e.history,
120
- target: s(m)
130
+ target: n(v)
121
131
  }, null, 8, ["history", "target"]),
122
- h.value ? (p(), k("div", Z, [
123
- o("div", _, [
124
- r(s(P), { size: "sm" }),
125
- o("div", ee, [
126
- t[8] || (t[8] = c(" A ", -1)),
127
- o("em", null, i(a.value?.toUpperCase() ?? e.method.toUpperCase()), 1),
128
- t[9] || (t[9] = c(" request to ", -1)),
129
- r(s(F), {
132
+ x.value ? (h(), z("div", se, [
133
+ s("div", ne, [
134
+ a(n(j), { size: "sm" }),
135
+ s("div", le, [
136
+ t[8] || (t[8] = p(" A ", -1)),
137
+ s("em", null, m(r.value?.toUpperCase() ?? e.method.toUpperCase()), 1),
138
+ t[9] || (t[9] = p(" request to ", -1)),
139
+ a(n(O), {
130
140
  text: d.value ?? e.path
131
141
  }, null, 8, ["text"]),
132
- t[10] || (t[10] = c(" already exists in this document ", -1))
142
+ t[10] || (t[10] = p(" already exists in this document ", -1))
133
143
  ])
134
144
  ])
135
- ])) : S("", !0),
136
- r(s(H), {
145
+ ])) : E("", !0),
146
+ a(n(P), {
137
147
  ref_key: "sendButtonRef",
138
- ref: g,
148
+ ref: y,
139
149
  class: "z-context-plus relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold",
140
- disabled: e.percentage < 100,
141
- onClick: t[5] || (t[5] = (n) => u("execute"))
150
+ disabled: n(b) < 100,
151
+ onClick: t[5] || (t[5] = (l) => f("execute"))
142
152
  }, {
143
- default: D(() => [
144
- o("span", te, [
145
- r(s(L), {
153
+ default: W(() => [
154
+ s("span", re, [
155
+ a(n(K), {
146
156
  class: "relative shrink-0 fill-current",
147
157
  icon: "Play",
148
158
  size: "xs"
149
159
  }),
150
- t[11] || (t[11] = o("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
160
+ t[11] || (t[11] = s("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
151
161
  ]),
152
- o("span", le, " Send " + i(e.method) + " request to " + i(e.server?.url ?? "") + i(e.path), 1)
162
+ s("span", ae, " Send " + m(e.method) + " request to " + m(e.server?.url ?? "") + m(e.path), 1)
153
163
  ]),
154
164
  _: 1
155
165
  }, 8, ["disabled"])
156
166
  ], 2)
157
- ], 8, G));
167
+ ], 8, _));
158
168
  }
159
169
  });
160
170
  export {
161
- me as default
171
+ be as default
162
172
  };
@@ -0,0 +1,19 @@
1
+ import type { Ref } from 'vue';
2
+ /**
3
+ * Manages the loading animation for the address bar.
4
+ *
5
+ * The animation has two phases:
6
+ * 1. While requesting: Animates asymptotically toward 85% to indicate ongoing work
7
+ * 2. After request completes: Animates linearly to 100% over 400ms for smooth completion
8
+ *
9
+ * This creates a natural feel where the bar does not instantly jump to 100%,
10
+ * making the loading experience more predictable and less jarring.
11
+ *
12
+ * @returns An object with methods to control the loading animation and the current percentage
13
+ */
14
+ export declare const useLoadingAnimation: () => {
15
+ startLoading: () => void;
16
+ stopLoading: () => void;
17
+ percentage: Ref<number>;
18
+ };
19
+ //# sourceMappingURL=use-loading-animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-loading-animation.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAe9B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,QAAO;IACrC,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAwExB,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { ref as n } from "vue";
2
+ const l = 20, s = 100, I = 0, i = 15, r = 60, c = 400, A = c / l, M = () => {
3
+ const e = n(s), o = n(0), t = n(!1), a = n(), u = () => {
4
+ clearInterval(a.value), a.value = void 0, e.value = s, t.value = !1;
5
+ }, v = () => {
6
+ t.value ? e.value -= (e.value - i) / r : e.value -= o.value / A, e.value <= I && u();
7
+ };
8
+ return {
9
+ startLoading: () => {
10
+ if (a.value) {
11
+ t.value = !0;
12
+ return;
13
+ }
14
+ t.value = !0, a.value = setInterval(v, l);
15
+ },
16
+ stopLoading: () => {
17
+ o.value = e.value, t.value = !1;
18
+ },
19
+ percentage: e
20
+ };
21
+ };
22
+ export {
23
+ M as useLoadingAnimation
24
+ };
@@ -12,10 +12,11 @@ type __VLS_Props = {
12
12
  /** Creates a static disclosure that cannot be collapsed */
13
13
  isStatic?: boolean;
14
14
  meta: AuthMeta;
15
- security: OpenApiDocument['security'];
15
+ proxyUrl: string;
16
+ securityRequirements: OpenApiDocument['security'];
16
17
  securitySchemes: NonNullable<OpenApiDocument['components']>['securitySchemes'];
17
18
  selectedSecurity: OpenApiDocument['x-scalar-selected-security'];
18
- server: ServerObject | undefined;
19
+ server: ServerObject | null;
19
20
  title: string;
20
21
  };
21
22
  declare const _default: import("vue").DefineComponent<__VLS_Props, {
@@ -1 +1 @@
1
- {"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"AAiTA,OAAO,EAML,KAAK,IAAI,EAEV,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAIrE,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gEAAgE,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACrC,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAA;IAC9E,gBAAgB,EAAE,eAAe,CAAC,4BAA4B,CAAC,CAAA;IAC/D,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;;cA8BqC,IAAI;cAAQ,MAAM;;;;;AA+bzD,wBAOG"}
1
+ {"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"AAiTA,OAAO,EAML,KAAK,IAAI,EAEV,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gEAAgE,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjD,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAA;IAC9E,gBAAgB,EAAE,eAAe,CAAC,4BAA4B,CAAC,CAAA;IAC/D,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;;cA+BqC,IAAI;cAAQ,MAAM;;;;;AA6bzD,wBAOG"}
@@ -1,12 +1,13 @@
1
- import { defineComponent as $, useId as M, ref as f, computed as S, createBlock as b, openBlock as r, unref as n, withCtx as c, createVNode as m, createCommentVNode as x, createElementBlock as p, Fragment as g, createElementVNode as u, createTextVNode as k, toDisplayString as y, withModifiers as N, normalizeClass as T } from "vue";
2
- import { useModal as q, ScalarComboboxMultiselect as j, ScalarButton as E, ScalarListboxCheckbox as z, ScalarIconButton as U } from "@scalar/components";
1
+ import { defineComponent as U, useId as $, ref as f, computed as S, createBlock as b, openBlock as r, unref as a, withCtx as c, createVNode as m, createCommentVNode as x, createElementBlock as h, Fragment as g, createElementVNode as u, createTextVNode as k, toDisplayString as v, withModifiers as q, normalizeClass as M } from "vue";
2
+ import { useModal as N, ScalarComboboxMultiselect as T, ScalarButton as z, ScalarListboxCheckbox as j, ScalarIconButton as E } from "@scalar/components";
3
3
  import { ScalarIconCaretDown as L, ScalarIconTrash as F } from "@scalar/icons";
4
4
  import { getResolvedRef as P } from "@scalar/workspace-store/helpers/get-resolved-ref";
5
5
  import G from "./DeleteRequestAuthModal.vue.js";
6
- import { getSecuritySchemeOptions as H, formatComplexScheme as J, formatScheme as K } from "../helpers/security-scheme.js";
7
- import Q from "./RequestAuthDataTable.vue.js";
8
- import W from "../../../components/layout/CollapsibleSection.vue.js";
9
- const X = ["id"], Y = { class: "min-w-0 flex-1 truncate" }, oe = /* @__PURE__ */ $({
6
+ import { isAuthOptional as H } from "../helpers/is-auth-optional.js";
7
+ import { getSecuritySchemeOptions as J, formatComplexScheme as K, formatScheme as Q } from "../helpers/security-scheme.js";
8
+ import W from "./RequestAuthDataTable.vue.js";
9
+ import X from "../../../components/layout/CollapsibleSection.vue.js";
10
+ const Y = ["id"], Z = { class: "min-w-0 flex-1 truncate" }, re = /* @__PURE__ */ U({
10
11
  __name: "AuthSelector",
11
12
  props: {
12
13
  environment: {},
@@ -14,69 +15,70 @@ const X = ["id"], Y = { class: "min-w-0 flex-1 truncate" }, oe = /* @__PURE__ */
14
15
  isReadOnly: { type: Boolean, default: !1 },
15
16
  isStatic: { type: Boolean, default: !1 },
16
17
  meta: {},
17
- security: {},
18
+ proxyUrl: {},
19
+ securityRequirements: {},
18
20
  securitySchemes: {},
19
21
  selectedSecurity: {},
20
22
  server: {},
21
23
  title: {}
22
24
  },
23
- setup(a, { expose: I }) {
24
- const C = M(), O = f(null), B = f(!1), d = q(), o = f(null), h = S(() => {
25
- if (!a.security?.length)
25
+ setup(n, { expose: I }) {
26
+ const C = $(), O = f(null), B = f(!1), d = N(), o = f(null), p = S(() => {
27
+ if (!n.securityRequirements?.length)
26
28
  return null;
27
- const e = a.security.some(
28
- (l) => Object.keys(l).length > 1
29
- ), s = a.security.some(
30
- (l) => Object.keys(l).length === 0
31
- ) && !e;
29
+ const e = H(n.securityRequirements);
32
30
  return {
33
- icon: s ? "Unlock" : "Lock",
34
- text: s ? "Optional" : "Required"
31
+ icon: e ? "Unlock" : "Lock",
32
+ text: e ? "Optional" : "Required"
35
33
  };
36
34
  }), R = S(
37
- () => H(a.security ?? [], a.securitySchemes ?? {}, a.isReadOnly)
35
+ () => J(
36
+ n.securityRequirements ?? [],
37
+ n.securitySchemes ?? {},
38
+ n.isReadOnly
39
+ )
38
40
  ), i = S(() => {
39
- const e = a.selectedSecurity?.selectedSchemes;
41
+ const e = n.selectedSecurity?.selectedSchemes;
40
42
  return e?.length ? e.flatMap((t) => {
41
43
  const s = Object.keys(t);
42
44
  if (s.length === 0)
43
45
  return [];
44
46
  if (s.length > 1)
45
- return J(t);
47
+ return K(t);
46
48
  const l = s[0];
47
49
  if (!l)
48
50
  return [];
49
- const v = P(a.securitySchemes?.[l]);
50
- return v ? K({
51
+ const y = P(n.securitySchemes?.[l]);
52
+ return y ? Q({
51
53
  name: l,
52
- type: v.type,
54
+ type: y.type,
53
55
  value: t
54
56
  }) : [];
55
57
  }) : [];
56
58
  }), w = (e) => {
57
59
  B.value && e.stopPropagation(), O.value?.$el.click();
58
- }, V = (e) => {
60
+ }, A = (e) => {
59
61
  const t = e.filter((l) => l.payload === void 0).map((l) => l.value), s = e.filter((l) => l.payload !== void 0).map((l) => ({
60
62
  name: l.label,
61
63
  scheme: l.payload
62
64
  }));
63
- a.eventBus.emit("auth:update:selected-security-schemes", {
65
+ n.eventBus.emit("auth:update:selected-security-schemes", {
64
66
  selectedRequirements: t,
65
67
  newSchemes: s,
66
- meta: a.meta
68
+ meta: n.meta
67
69
  });
68
70
  }, D = (e) => {
69
71
  o.value = { label: e.label, payload: e.value }, d.show();
70
- }, A = () => {
71
- o.value && (a.eventBus.emit("auth:delete:security-scheme", {
72
+ }, V = () => {
73
+ o.value && (n.eventBus.emit("auth:delete:security-scheme", {
72
74
  names: Object.keys(o.value.payload)
73
75
  }), o.value = null, d.hide());
74
76
  };
75
77
  return I({
76
- authIndicator: h,
78
+ authIndicator: p,
77
79
  selectedSchemeOptions: i,
78
80
  schemeOptions: R
79
- }), (e, t) => (r(), b(n(W), {
81
+ }), (e, t) => (r(), b(a(X), {
80
82
  class: "group/params relative",
81
83
  isStatic: e.isStatic,
82
84
  itemCount: i.value.length,
@@ -84,20 +86,20 @@ const X = ["id"], Y = { class: "min-w-0 flex-1 truncate" }, oe = /* @__PURE__ */
84
86
  }, {
85
87
  title: c(() => [
86
88
  u("div", {
87
- id: n(C),
89
+ id: a(C),
88
90
  class: "inline-flex items-center gap-0.5 leading-[20px]"
89
91
  }, [
90
- u("span", null, y(e.title), 1),
91
- h.value ? (r(), p("span", {
92
+ u("span", null, v(e.title), 1),
93
+ p.value ? (r(), h("span", {
92
94
  key: 0,
93
- class: T(["text-c-3 hover:bg-b-3 hover:text-c-1 -mr-1 cursor-pointer rounded px-1 py-0.5 text-xs leading-[normal]", { "text-c-1": h.value.text === "Required" }]),
95
+ class: M(["text-c-3 hover:bg-b-3 hover:text-c-1 -mr-1 cursor-pointer rounded px-1 py-0.5 text-xs leading-[normal]", { "text-c-1": p.value.text === "Required" }]),
94
96
  "data-testid": "auth-indicator",
95
97
  onClick: w
96
- }, y(h.value.text), 3)) : x("", !0)
97
- ], 8, X)
98
+ }, v(p.value.text), 3)) : x("", !0)
99
+ ], 8, Y)
98
100
  ]),
99
101
  actions: c(() => [
100
- m(n(j), {
102
+ m(a(T), {
101
103
  class: "w-72 text-xs",
102
104
  modelValue: i.value,
103
105
  multiple: "",
@@ -105,43 +107,43 @@ const X = ["id"], Y = { class: "min-w-0 flex-1 truncate" }, oe = /* @__PURE__ */
105
107
  placement: "bottom-end",
106
108
  teleport: "",
107
109
  onDelete: D,
108
- "onUpdate:modelValue": V
110
+ "onUpdate:modelValue": A
109
111
  }, {
110
112
  option: c(({ option: s, selected: l }) => [
111
- m(n(z), {
113
+ m(a(j), {
112
114
  multiselect: "",
113
115
  selected: l
114
116
  }, null, 8, ["selected"]),
115
- u("div", Y, y(s.label), 1),
116
- s.isDeletable ?? !e.isReadOnly ? (r(), b(n(U), {
117
+ u("div", Z, v(s.label), 1),
118
+ s.isDeletable ?? !e.isReadOnly ? (r(), b(a(E), {
117
119
  key: 0,
118
120
  class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
119
- icon: n(F),
121
+ icon: a(F),
120
122
  label: `Delete ${s.label}`,
121
123
  size: "xs",
122
- onClick: N((v) => D(s), ["stop"])
124
+ onClick: q((y) => D(s), ["stop"])
123
125
  }, null, 8, ["icon", "label", "onClick"])) : x("", !0)
124
126
  ]),
125
127
  default: c(() => [
126
- m(n(E), {
128
+ m(a(z), {
127
129
  ref_key: "comboboxButtonRef",
128
130
  ref: O,
129
- "aria-describedby": n(C),
131
+ "aria-describedby": a(C),
130
132
  class: "group/combobox-button hover:text-c-1 text-c-2 flex h-fit w-full items-center gap-1 px-0.75 py-0.25 text-base font-normal",
131
133
  variant: "ghost"
132
134
  }, {
133
135
  default: c(() => [
134
- i.value.length === 1 ? (r(), p(g, { key: 0 }, [
136
+ i.value.length === 1 ? (r(), h(g, { key: 0 }, [
135
137
  t[2] || (t[2] = u("span", { class: "sr-only" }, "Selected Auth Type:", -1)),
136
- k(" " + y(i.value[0]?.label), 1)
137
- ], 64)) : i.value.length > 1 ? (r(), p(g, { key: 1 }, [
138
+ k(" " + v(i.value[0]?.label), 1)
139
+ ], 64)) : i.value.length > 1 ? (r(), h(g, { key: 1 }, [
138
140
  t[3] || (t[3] = k(" Multiple ", -1)),
139
141
  t[4] || (t[4] = u("span", { class: "sr-only" }, "Auth Types Selected", -1))
140
- ], 64)) : (r(), p(g, { key: 2 }, [
142
+ ], 64)) : (r(), h(g, { key: 2 }, [
141
143
  t[5] || (t[5] = u("span", { class: "sr-only" }, "Select", -1)),
142
144
  t[6] || (t[6] = k(" Auth Type ", -1))
143
145
  ], 64)),
144
- m(n(L), {
146
+ m(a(L), {
145
147
  class: "size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180",
146
148
  weight: "bold"
147
149
  })
@@ -153,23 +155,24 @@ const X = ["id"], Y = { class: "min-w-0 flex-1 truncate" }, oe = /* @__PURE__ */
153
155
  }, 8, ["modelValue", "options"])
154
156
  ]),
155
157
  default: c(() => [
156
- m(Q, {
158
+ m(W, {
157
159
  activeAuthIndex: e.selectedSecurity?.selectedIndex ?? 0,
158
160
  environment: e.environment,
159
161
  eventBus: e.eventBus,
160
162
  isStatic: e.isStatic,
161
163
  meta: e.meta,
164
+ proxyUrl: e.proxyUrl,
162
165
  securitySchemes: e.securitySchemes,
163
166
  selectedSchemeOptions: i.value,
164
167
  server: e.server
165
- }, null, 8, ["activeAuthIndex", "environment", "eventBus", "isStatic", "meta", "securitySchemes", "selectedSchemeOptions", "server"]),
168
+ }, null, 8, ["activeAuthIndex", "environment", "eventBus", "isStatic", "meta", "proxyUrl", "securitySchemes", "selectedSchemeOptions", "server"]),
166
169
  o.value ? (r(), b(G, {
167
170
  key: 0,
168
171
  label: o.value.label,
169
172
  scheme: o.value,
170
- state: n(d),
171
- onClose: t[0] || (t[0] = (s) => n(d).hide()),
172
- onDelete: A
173
+ state: a(d),
174
+ onClose: t[0] || (t[0] = (s) => a(d).hide()),
175
+ onDelete: V
173
176
  }, null, 8, ["label", "scheme", "state"])) : x("", !0)
174
177
  ]),
175
178
  _: 1
@@ -177,5 +180,5 @@ const X = ["id"], Y = { class: "min-w-0 flex-1 truncate" }, oe = /* @__PURE__ */
177
180
  }
178
181
  });
179
182
  export {
180
- oe as default
183
+ re as default
181
184
  };
@@ -5,7 +5,7 @@ type __VLS_Props = {
5
5
  flows: OAuthFlowsObject;
6
6
  type: keyof OAuthFlowsObject;
7
7
  selectedScopes: string[];
8
- server: ServerObject | undefined;
8
+ server: ServerObject | null;
9
9
  proxyUrl: string;
10
10
  };
11
11
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -1 +1 @@
1
- {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AA2PA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,KAAK,EAEV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,KAAK,EAAE,gBAAgB,CAAA;IACvB,IAAI,EAAE,MAAM,gBAAgB,CAAA;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwhBJ,wBAOG"}
1
+ {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AA2PA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,KAAK,EAEV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,KAAK,EAAE,gBAAgB,CAAA;IACvB,IAAI,EAAE,MAAM,gBAAgB,CAAA;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwhBJ,wBAOG"}
@@ -12,10 +12,12 @@ type __VLS_Props = {
12
12
  selectedSchemeOptions: SecuritySchemeOption[];
13
13
  /** Index of the currently active authentication tab */
14
14
  activeAuthIndex: number;
15
+ /** Proxy URL */
16
+ proxyUrl: string;
15
17
  /** OpenAPI security scheme definitions */
16
18
  securitySchemes: ComponentsObject['securitySchemes'];
17
19
  /** Current server configuration */
18
- server: ServerObject | undefined;
20
+ server: ServerObject | null;
19
21
  /** Event bus for authentication updates */
20
22
  eventBus: WorkspaceEventBus;
21
23
  /** Metadata for authentication context */
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAoJA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AAwOF,wBAOG"}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAuJA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AA0OF,wBAOG"}