@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,14 +1,19 @@
1
- import { defineComponent as g, useId as B, computed as y, useTemplateRef as v, onMounted as x, onBeforeUnmount as w, createElementBlock as k, openBlock as b, unref as l, createElementVNode as r, createVNode as a, normalizeStyle as S, createBlock as C, createCommentVNode as R, withCtx as E, toDisplayString as u } from "vue";
2
- import { ScalarButton as U, ScalarIcon as V } from "@scalar/components";
3
- import { REQUEST_METHODS as $ } from "@scalar/helpers/http/http-info";
4
- import z from "./AddressBarHistory.vue.js";
5
- import I from "../../../../components/HttpMethod/HttpMethod.vue.js";
6
- import T from "../../../components/server/ServerDropdown.vue.js";
7
- import A from "../../../components/code-input/CodeInput.vue.js";
8
- const D = ["id"], F = { class: "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]" }, H = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, M = { class: "z-context-plus flex gap-1" }, N = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, q = {
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 = {
11
+ key: 0,
12
+ class: "z-context absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6"
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 = {
9
14
  "aria-hidden": "true",
10
15
  class: "inline-flex items-center gap-1"
11
- }, L = { class: "sr-only" }, W = /* @__PURE__ */ g({
16
+ }, ae = { class: "sr-only" }, be = /* @__PURE__ */ I({
12
17
  __name: "AddressBar",
13
18
  props: {
14
19
  path: {},
@@ -17,110 +22,151 @@ const D = ["id"], F = { class: "address-bar-bg-states text-xxs group relative or
17
22
  servers: {},
18
23
  history: {},
19
24
  layout: {},
20
- percentage: { default: 100 },
21
25
  eventBus: {},
22
26
  environment: {}
23
27
  },
24
- emits: ["execute", "update:path", "update:method", "update:servers"],
25
- setup(o, { emit: c }) {
26
- const n = c, d = B(), h = y(() => ({
27
- backgroundColor: `color-mix(in srgb, transparent 90%, ${$[o.method].colorVar})`,
28
- transform: `translate3d(-${o.percentage}%,0,0)`
29
- })), m = v("sendButtonRef"), i = v("addressBarRef"), f = () => m.value?.$el?.focus(), p = ({
30
- event: t
31
- }) => {
32
- i.value?.isFocused && o.layout !== "desktop" || (i.value?.focus(), t.preventDefault());
28
+ emits: ["execute", "update:servers"],
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();
33
56
  };
34
- return x(() => {
35
- o.eventBus.on("ui:focus:address-bar", p), o.eventBus.on("ui:focus:send-button", f);
36
- }), w(() => {
37
- o.eventBus.off("ui:focus:address-bar", p), o.eventBus.off("ui:focus:send-button", f);
38
- }), (t, e) => (b(), k("div", {
39
- id: l(d),
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,
63
+ pathConflict: d
64
+ }), (e, t) => (h(), z("div", {
65
+ id: n(v),
40
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"
41
67
  }, [
42
- r("div", F, [
43
- r("div", H, [
44
- r("div", {
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
71
+ }])
72
+ }, [
73
+ s("div", ee, [
74
+ s("div", {
45
75
  class: "absolute top-0 left-0 z-[1002] h-full w-full",
46
- style: S(h.value)
76
+ style: F(V.value)
47
77
  }, null, 4)
48
78
  ]),
49
- r("div", M, [
50
- a(l(I), {
51
- isEditable: t.layout !== "modal",
79
+ s("div", te, [
80
+ a(n(X), {
81
+ isEditable: e.layout !== "modal",
52
82
  isSquare: "",
53
- method: t.method,
83
+ method: r.value ?? e.method,
54
84
  teleport: "",
55
- onChange: e[0] || (e[0] = (s) => n("update:method", { value: s }))
85
+ onChange: q
56
86
  }, null, 8, ["isEditable", "method"])
57
87
  ]),
58
- r("div", N, [
59
- t.servers.length ? (b(), C(l(T), {
88
+ s("div", oe, [
89
+ e.servers.length ? (h(), H(n(Y), {
60
90
  key: 0,
61
- layout: t.layout,
62
- server: t.server,
63
- servers: t.servers,
64
- target: l(d),
65
- "onUpdate:selectedServer": e[1] || (e[1] = (s) => t.eventBus.emit("server:update:selected", s)),
66
- "onUpdate:servers": e[2] || (e[2] = (s) => n("update:servers")),
67
- "onUpdate:variable": e[3] || (e[3] = (s) => t.eventBus.emit("server:update:variables", s))
68
- }, null, 8, ["layout", "server", "servers", "target"])) : R("", !0),
69
- e[8] || (e[8] = r("div", { class: "fade-left" }, null, -1)),
70
- a(l(A), {
91
+ layout: e.layout,
92
+ server: e.server,
93
+ servers: e.servers,
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), {
71
101
  ref_key: "addressBarRef",
72
102
  ref: i,
103
+ alwaysEmitChange: "",
73
104
  "aria-label": "Path",
74
105
  class: "min-w-fit outline-none",
75
106
  disableCloseBrackets: "",
76
- disabled: t.layout === "modal",
107
+ disabled: e.layout === "modal",
77
108
  disableEnter: "",
78
109
  disableTabIndent: "",
79
110
  emitOnBlur: !1,
80
- environment: t.environment,
111
+ environment: e.environment,
81
112
  importCurl: "",
82
- modelValue: t.path,
83
- placeholder: t.server ? "" : "Enter a URL or cURL command",
113
+ layout: e.layout,
114
+ modelValue: e.path,
115
+ placeholder: e.server ? "" : "Enter a URL or cURL command",
84
116
  server: "",
85
- onCurl: e[4] || (e[4] = (s) => t.eventBus.emit("ui:open:command-palette", {
117
+ onCurl: t[3] || (t[3] = (l) => e.eventBus.emit("ui:open:command-palette", {
86
118
  action: "import-curl-command",
87
119
  payload: {
88
- curl: s
120
+ curl: l
89
121
  }
90
122
  })),
91
- onSubmit: e[5] || (e[5] = (s) => n("execute")),
92
- "onUpdate:modelValue": e[6] || (e[6] = (s) => n("update:path", { value: s }))
93
- }, null, 8, ["disabled", "environment", "modelValue", "placeholder"]),
94
- e[9] || (e[9] = r("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))
95
127
  ]),
96
- a(z, {
97
- history: t.history,
98
- target: l(d)
128
+ a(J, {
129
+ history: e.history,
130
+ target: n(v)
99
131
  }, null, 8, ["history", "target"]),
100
- a(l(U), {
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), {
140
+ text: d.value ?? e.path
141
+ }, null, 8, ["text"]),
142
+ t[10] || (t[10] = p(" already exists in this document ", -1))
143
+ ])
144
+ ])
145
+ ])) : E("", !0),
146
+ a(n(P), {
101
147
  ref_key: "sendButtonRef",
102
- ref: m,
148
+ ref: y,
103
149
  class: "z-context-plus relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold",
104
- disabled: t.percentage < 100,
105
- onClick: e[7] || (e[7] = (s) => n("execute"))
150
+ disabled: n(b) < 100,
151
+ onClick: t[5] || (t[5] = (l) => f("execute"))
106
152
  }, {
107
- default: E(() => [
108
- r("span", q, [
109
- a(l(V), {
153
+ default: W(() => [
154
+ s("span", re, [
155
+ a(n(K), {
110
156
  class: "relative shrink-0 fill-current",
111
157
  icon: "Play",
112
158
  size: "xs"
113
159
  }),
114
- e[10] || (e[10] = r("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
160
+ t[11] || (t[11] = s("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
115
161
  ]),
116
- r("span", L, " Send " + u(t.method) + " request to " + u(t.server?.url ?? "") + u(t.path), 1)
162
+ s("span", ae, " Send " + m(e.method) + " request to " + m(e.server?.url ?? "") + m(e.path), 1)
117
163
  ]),
118
164
  _: 1
119
165
  }, 8, ["disabled"])
120
- ])
121
- ], 8, D));
166
+ ], 2)
167
+ ], 8, _));
122
168
  }
123
169
  });
124
170
  export {
125
- W as default
171
+ be as default
126
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"}