@scalar/api-client 2.15.0 → 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 (264) hide show
  1. package/CHANGELOG.md +150 -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 +2 -2
  152. package/dist/v2/features/app/components/AppSidebar.vue2.js +103 -80
  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/WebTopNav.vue.d.ts +1 -1
  156. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  157. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  158. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  159. package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
  160. package/dist/v2/features/app/helpers/routes.d.ts +32 -6
  161. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  162. package/dist/v2/features/app/helpers/routes.js +25 -16
  163. package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
  164. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
  165. package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
  166. package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
  167. package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
  168. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
  169. package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
  170. package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
  171. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
  172. package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
  173. package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
  174. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
  175. package/dist/v2/{hooks/use-workspace-client-events.js → features/app/hooks/use-workspace-client-app-events.js} +48 -45
  176. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
  177. package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
  178. package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
  179. package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
  180. package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
  181. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
  182. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  183. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  184. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
  185. package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
  186. package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
  187. package/dist/v2/features/collection/components/Environment.vue.js +32 -1
  188. package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
  189. package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
  190. package/dist/v2/features/collection/components/Servers.vue.js +142 -2
  191. package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
  192. package/dist/v2/features/collection/components/Settings.vue.js +58 -2
  193. package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
  194. package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
  195. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  196. package/dist/v2/features/modal/Modal.vue.js +1 -1
  197. package/dist/v2/features/modal/Modal.vue2.js +118 -31
  198. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
  199. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  200. package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
  201. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
  202. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
  203. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
  204. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
  205. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
  206. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
  207. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
  208. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
  209. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
  210. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  211. package/dist/v2/features/operation/Operation.vue.js +59 -28
  212. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
  213. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
  214. package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
  215. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
  216. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
  217. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
  218. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
  219. package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
  220. package/dist/v2/features/operation/index.d.ts +0 -1
  221. package/dist/v2/features/operation/index.d.ts.map +1 -1
  222. package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
  223. package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
  224. package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
  225. package/dist/v2/helpers/generate-location-id.d.ts +19 -0
  226. package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
  227. package/dist/v2/helpers/generate-location-id.js +10 -0
  228. package/dist/v2/helpers/get-active-environment.d.ts +5 -0
  229. package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
  230. package/dist/v2/helpers/get-active-environment.js +22 -0
  231. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  232. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  233. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  234. package/dist/v2/helpers/plugins.d.ts +59 -0
  235. package/dist/v2/helpers/plugins.d.ts.map +1 -0
  236. package/dist/v2/helpers/plugins.js +11 -0
  237. package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
  238. package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
  239. package/dist/v2/hooks/use-scroll-lock.js +21 -0
  240. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
  241. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  242. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
  243. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
  244. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
  245. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  246. package/package.json +18 -18
  247. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
  248. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
  249. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
  250. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
  251. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
  252. package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
  253. package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
  254. package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
  255. package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
  256. package/dist/v2/hooks/use-sync-path.js +0 -51
  257. package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
  258. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
  259. package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
  260. package/dist/v2/plugins.d.ts +0 -44
  261. package/dist/v2/plugins.d.ts.map +0 -1
  262. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
  263. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
  264. /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
@@ -1,25 +1,25 @@
1
- import { isDefined as h } from "@scalar/helpers/array/is-defined";
1
+ import { isDefined as l } from "@scalar/helpers/array/is-defined";
2
2
  import { sortByOrder as w } from "@scalar/helpers/array/sort-by-order";
3
3
  import { createSidebarState as b, generateReverseIndex as k } from "@scalar/sidebar";
4
4
  import { getParentEntry as o } from "@scalar/workspace-store/navigation";
5
- import { computed as x, toValue as c, watch as f } from "vue";
5
+ import { computed as h, toValue as x, watch as f } from "vue";
6
6
  import { useRouter as O } from "vue-router";
7
- const W = ({
7
+ const A = ({
8
8
  workspaceStore: d,
9
9
  documentSlug: y,
10
10
  path: E,
11
- method: S,
12
- exampleName: g
11
+ method: g,
12
+ exampleName: S
13
13
  }) => {
14
- const m = O(), u = x(() => {
15
- const e = c(d);
14
+ const m = O(), c = h(() => {
15
+ const e = x(d);
16
16
  if (!e)
17
17
  return [];
18
18
  const t = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
19
- return w(Object.keys(e.workspace.documents), t, (r) => r).map((r) => e.workspace.documents[r]?.["x-scalar-navigation"]).filter(h);
20
- }), n = b(u);
19
+ return w(Object.keys(e.workspace.documents), t, (r) => r).map((r) => e.workspace.documents[r]?.["x-scalar-navigation"]).filter(l);
20
+ }), n = b(c);
21
21
  f(
22
- () => c(d),
22
+ () => x(d),
23
23
  () => {
24
24
  n.reset();
25
25
  },
@@ -32,9 +32,9 @@ const W = ({
32
32
  path: t,
33
33
  method: r,
34
34
  example: a
35
- }) => JSON.stringify([e, t, r, a].filter(h)), i = x(
35
+ }) => JSON.stringify([e, t, r, a].filter(l)), u = h(
36
36
  () => k({
37
- items: u.value,
37
+ items: c.value,
38
38
  nestedKey: "children",
39
39
  filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
40
40
  getId: (e) => {
@@ -47,9 +47,9 @@ const W = ({
47
47
  });
48
48
  }
49
49
  })
50
- ), l = (e) => {
51
- const t = i.value.get(p(e));
52
- return t || i.value.get(
50
+ ), i = (e) => {
51
+ const t = u.value.get(p(e));
52
+ return t || u.value.get(
53
53
  p({
54
54
  document: e.document,
55
55
  path: e.path,
@@ -106,13 +106,13 @@ const W = ({
106
106
  n.setExpanded(e, !n.isExpanded(e));
107
107
  };
108
108
  return f(
109
- [() => c(d), y, E, S, g],
109
+ [d, y, E, g, S],
110
110
  ([e, t, r, a, I]) => {
111
111
  if (!t) {
112
112
  n.setSelected(null);
113
113
  return;
114
114
  }
115
- const s = l({
115
+ const s = i({
116
116
  document: t,
117
117
  path: r,
118
118
  method: a,
@@ -126,9 +126,9 @@ const W = ({
126
126
  ), {
127
127
  handleSelectItem: v,
128
128
  state: n,
129
- getEntryByLocation: l
129
+ getEntryByLocation: i
130
130
  };
131
131
  };
132
132
  export {
133
- W as useSidebarState
133
+ A as useAppSidebar
134
134
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-document-watcher.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/hooks/use-document-watcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAA6C,MAAM,KAAK,CAAA;AA6FtF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,kBAAkB,GAAI,0CAIhC;IACD,YAAY,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAClD,KAAK,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,KAAG,IA6FH,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
- import { type UseWorkspaceSelectorReturn } from '../../v2/hooks/use-workspace-selector.js';
3
- import type { UseTabsReturn } from './use-tabs.js';
2
+ import type { UseTabsReturn } from '../../../../v2/features/app/hooks/use-tabs.js';
3
+ import { type UseWorkspaceSelectorReturn } from '../../../../v2/features/app/hooks/use-workspace-selector.js';
4
4
  export declare const useSyncPath: ({ workspaceSelectorState, tabsState, eventBus, }: {
5
5
  workspaceSelectorState: UseWorkspaceSelectorReturn;
6
6
  tabsState: UseTabsReturn;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-sync-path.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/hooks/use-sync-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAIvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAqB,KAAK,0BAA0B,EAAE,MAAM,gDAAgD,CAAA;AAGnH,eAAO,MAAM,WAAW,GAAI,kDAIzB;IACD,sBAAsB,EAAE,0BAA0B,CAAA;IAClD,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;;CAqJA,CAAA"}
@@ -0,0 +1,52 @@
1
+ import { ref as w, watch as d } from "vue";
2
+ import { useRoute as v, useRouter as x } from "vue-router";
3
+ import { DEFAULT_WORKSPACE as g } from "./use-workspace-selector.js";
4
+ import { workspaceStorage as k } from "../../../helpers/storage.js";
5
+ const F = ({
6
+ workspaceSelectorState: e,
7
+ tabsState: u,
8
+ eventBus: l
9
+ }) => {
10
+ const c = v(), f = x(), o = w(!1), b = () => {
11
+ const a = e.store.value;
12
+ if (!a)
13
+ return;
14
+ const t = a.workspace["x-scalar-tabs"], r = a.workspace["x-scalar-active-tab"] ?? 0;
15
+ t?.[r] && (t[r] = u.createTabFromCurrentRoute());
16
+ }, m = async (a) => {
17
+ const t = e.store.value;
18
+ if (!t)
19
+ return;
20
+ const r = t.workspace["x-scalar-tabs"] ?? [], n = t.workspace["x-scalar-active-tab"] ?? 0, s = r[n];
21
+ s && s.path !== c.path && await a?.({ tabPath: s.path });
22
+ }, h = async (a) => {
23
+ e.store.value = null, o.value = !0;
24
+ const t = await e.loadWorkspace(a);
25
+ if (t.success) {
26
+ const { workspace: n } = t, s = n.workspace["x-scalar-active-tab"] ?? 0, i = n.workspace["x-scalar-tabs"], p = i?.[s];
27
+ p && await f.replace(p.path), i && s >= i.length && l.emit("tabs:update:tabs", {
28
+ "x-scalar-active-tab": 0
29
+ }), i || l.emit("tabs:update:tabs", {
30
+ "x-scalar-tabs": [u.createTabFromCurrentRoute()],
31
+ "x-scalar-active-tab": 0
32
+ }), o.value = !1;
33
+ return;
34
+ }
35
+ const r = await e.createWorkspace(g);
36
+ if (o.value = !1, !r)
37
+ return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
38
+ };
39
+ return d(
40
+ [() => c.path],
41
+ async () => {
42
+ const a = c.params.workspaceSlug;
43
+ if (typeof a == "string" && k.setCurrentPath(c.path), typeof a == "string" && a !== e.activeWorkspace.value?.id)
44
+ return await h(a);
45
+ await m(b), o.value = !1;
46
+ },
47
+ { immediate: !0 }
48
+ ), { isLoading: o };
49
+ };
50
+ export {
51
+ F as useSyncPath
52
+ };
@@ -3,7 +3,7 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
3
3
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
4
4
  import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace';
5
5
  import { type MaybeRefOrGetter, type Ref } from 'vue';
6
- import type { UseSidebarStateReturn } from '../../v2/hooks/use-sidebar-state.js';
6
+ import type { UseAppSidebarReturn } from '../../../../v2/features/app/hooks/use-app-sidebar.js';
7
7
  export type UseTabsReturn = {
8
8
  tabs: Ref<Tab[]>;
9
9
  activeTabIndex: Ref<number>;
@@ -18,7 +18,7 @@ type UseTabsParams = {
18
18
  documentSlug: MaybeRefOrGetter<string | undefined>;
19
19
  path: MaybeRefOrGetter<string | undefined>;
20
20
  method: MaybeRefOrGetter<HttpMethod | undefined>;
21
- getEntryByLocation: UseSidebarStateReturn['getEntryByLocation'];
21
+ getEntryByLocation: UseAppSidebarReturn['getEntryByLocation'];
22
22
  };
23
23
  /**
24
24
  * Composable for managing desktop tabs functionality.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-tabs.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/hooks/use-tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAC/E,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAA0B,MAAM,KAAK,CAAA;AAG7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAOlF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAA;IAChB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACvB,yBAAyB,EAAE,MAAM,GAAG,CAAA;CACrC,CAAA;AAED,KAAK,aAAa,GAAG;IACnB,cAAc,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC1C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,aAAa,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACnD,YAAY,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAClD,IAAI,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC1C,MAAM,EAAE,gBAAgB,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAChD,kBAAkB,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAA;CAC9D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,oFAOrB,aAAa,KAAG,aA4DlB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { ref as f, computed as n, toValue as t } from "vue";
2
2
  import { useRoute as h } from "vue-router";
3
- import { getTabDetails as v } from "../helpers/get-tab-details.js";
3
+ import { getTabDetails as v } from "../../../helpers/get-tab-details.js";
4
4
  const x = "x-scalar-tabs", y = "x-scalar-active-tab", C = ({
5
5
  workspaceStore: o,
6
6
  getEntryByLocation: s,
@@ -2,17 +2,17 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
2
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
3
  import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
4
4
  import { type ComputedRef, type Ref } from 'vue';
5
- import type { UseCommandPaletteStateReturn } from '../../v2/features/command-palette/hooks/use-command-palette-state.js';
6
- import type { UseSidebarStateReturn } from '../../v2/hooks/use-sidebar-state.js';
5
+ import type { UseAppSidebarReturn } from '../../../../v2/features/app/hooks/use-app-sidebar.js';
6
+ import type { UseCommandPaletteStateReturn } from '../../../../v2/features/command-palette/hooks/use-command-palette-state.js';
7
7
  /**
8
8
  * Top level state mutation handling for the workspace store in the client
9
9
  */
10
- export declare const useWorkspaceClientEvents: ({ eventBus, document, workspaceStore, isSidebarOpen, commandPaletteState, sidebarState, }: {
10
+ export declare const useWorkspaceClientAppEvents: ({ eventBus, document, workspaceStore, isSidebarOpen, commandPaletteState, sidebarState, }: {
11
11
  eventBus: WorkspaceEventBus;
12
12
  document: ComputedRef<WorkspaceDocument | null>;
13
13
  workspaceStore: Ref<WorkspaceStore | null>;
14
14
  isSidebarOpen: Ref<boolean>;
15
15
  commandPaletteState: UseCommandPaletteStateReturn;
16
- sidebarState: UseSidebarStateReturn;
16
+ sidebarState: UseAppSidebarReturn;
17
17
  }) => void;
18
- //# sourceMappingURL=use-workspace-client-events.d.ts.map
18
+ //# sourceMappingURL=use-workspace-client-app-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-workspace-client-app-events.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/hooks/use-workspace-client-app-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAwC,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAoD7G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,GAAG,EAAW,MAAM,KAAK,CAAA;AAGzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+DAA+D,CAAA;AAEjH;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,2FAOzC;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,cAAc,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC1C,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,mBAAmB,EAAE,4BAA4B,CAAA;IACjD,YAAY,EAAE,mBAAmB,CAAA;CAClC,SAwWA,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { mergeObjects as x } from "@scalar/workspace-store/helpers/merge-object";
2
- import { updateActiveProxy as g, updateColorMode as T, updateTheme as y, updateDocumentIcon as R, toggleSecurity as w, updateWatchMode as O, createEmptyDocument as N, deleteDocument as C, upsertEnvironment as E, upsertEnvironmentVariable as q, upsertCookie as P, deleteCookie as I, deleteSecurityScheme as M, updateSelectedAuthTab as k, updateSecurityScheme as A, updateSelectedScopes as D, updateSelectedSecuritySchemes as F, addServer as U, updateServer as V, deleteServer as K, updateServerVariables as L, updateSelectedServer as W, createOperation as j, updateOperationPathMethod as z, updateOperationSummary as G, deleteOperation as H, deleteOperationExample as J, addOperationParameter as Q, updateOperationParameter as S, deleteOperationParameter as X, deleteAllOperationParameters as Y, updateOperationRequestBodyContentType as Z, updateOperationRequestBodyExample as _, addOperationRequestBodyFormRow as $, updateOperationRequestBodyFormRow as B, deleteOperationRequestBodyFormRow as ee, createTag as ae, deleteTag as te, addTab as oe, closeTab as re, closeOtherTabs as ne, focusTab as le, focusLastTab as ie, navigatePreviousTab as ue, navigateNextTab as me, updateTabs as pe } from "@scalar/workspace-store/mutators";
2
+ import { updateActiveProxy as g, updateColorMode as y, updateTheme as T, updateSelectedClient as w, updateDocumentIcon as R, toggleSecurity as O, updateWatchMode as N, createEmptyDocument as C, deleteDocument as E, upsertEnvironment as q, upsertEnvironmentVariable as P, upsertCookie as I, deleteCookie as k, deleteSecurityScheme as A, updateSelectedAuthTab as M, updateSecurityScheme as D, updateSelectedScopes as F, updateSelectedSecuritySchemes as U, addServer as V, updateServer as K, deleteServer as L, updateServerVariables as W, updateSelectedServer as j, createOperation as z, updateOperationPathMethod as G, updateOperationSummary as H, deleteOperation as J, deleteOperationExample as Q, addOperationParameter as S, updateOperationParameter as X, deleteOperationParameter as Y, deleteAllOperationParameters as Z, updateOperationRequestBodyContentType as _, updateOperationRequestBodyExample as $, addOperationRequestBodyFormRow as B, updateOperationRequestBodyFormRow as ee, deleteOperationRequestBodyFormRow as ae, createTag as te, deleteTag as oe, addTab as re, closeTab as ne, closeOtherTabs as le, focusTab as ie, focusLastTab as ue, navigatePreviousTab as ce, navigateNextTab as pe, updateTabs as me } from "@scalar/workspace-store/mutators";
3
3
  import { toValue as f } from "vue";
4
- import { useRouter as ce, useRoute as de } from "vue-router";
5
- const fe = ({
4
+ import { useRouter as de, useRoute as se } from "vue-router";
5
+ const xe = ({
6
6
  eventBus: a,
7
7
  document: t,
8
8
  workspaceStore: o,
@@ -10,7 +10,7 @@ const fe = ({
10
10
  commandPaletteState: s,
11
11
  sidebarState: v
12
12
  }) => {
13
- const m = ce(), i = de(), p = (e, r) => {
13
+ const c = de(), i = se(), p = (e, r) => {
14
14
  const n = f(o);
15
15
  return n ? r === "document" ? e.value : n.workspace : null;
16
16
  }, l = async () => {
@@ -18,11 +18,11 @@ const fe = ({
18
18
  if (!e)
19
19
  return;
20
20
  const r = e.workspace["x-scalar-active-tab"] ?? 0, n = e.workspace["x-scalar-tabs"]?.[r];
21
- n && await m.replace(n.path);
21
+ n && await c.replace(n.path);
22
22
  }, u = (e) => {
23
23
  e && o.value?.buildSidebar(e);
24
- }, c = (e) => {
25
- const r = t.value?.["x-scalar-navigation"]?.id;
24
+ }, m = (e) => {
25
+ const r = t.value?.["x-scalar-navigation"]?.name;
26
26
  if (!r)
27
27
  return;
28
28
  const n = v.getEntryByLocation({
@@ -43,61 +43,64 @@ const fe = ({
43
43
  (e) => g(o.value?.workspace ?? null, e)
44
44
  ), a.on(
45
45
  "workspace:update:color-mode",
46
- (e) => T(o.value?.workspace ?? null, e)
47
- ), a.on("workspace:update:theme", (e) => y(o.value?.workspace ?? null, e)), a.on("document:update:icon", (e) => R(t.value, e)), a.on("document:update:info", (e) => t.value && x(t.value.info, e)), a.on("document:toggle:security", () => w(t.value)), a.on("document:update:watch-mode", (e) => O(t.value, e)), a.on("document:create:empty-document", (e) => N(o.value, e)), a.on("document:delete:document", async (e) => {
48
- C(o.value, e), i.params.documentSlug === e.name && await m.push({
46
+ (e) => y(o.value?.workspace ?? null, e)
47
+ ), a.on("workspace:update:theme", (e) => T(o.value?.workspace ?? null, e)), a.on(
48
+ "workspace:update:selected-client",
49
+ (e) => w(o.value?.workspace, e)
50
+ ), a.on("document:update:icon", (e) => R(t.value, e)), a.on("document:update:info", (e) => t.value && x(t.value.info, e)), a.on("document:toggle:security", () => O(t.value)), a.on("document:update:watch-mode", (e) => N(t.value, e)), a.on("document:create:empty-document", (e) => C(o.value, e)), a.on("document:delete:document", async (e) => {
51
+ E(o.value, e), i.params.documentSlug === e.name && await c.push({
49
52
  name: "workspace.environment"
50
53
  });
51
54
  }), a.on("environment:upsert:environment", (e) => {
52
- o.value && E(t.value, o.value.workspace, e);
55
+ o.value && q(t.value, o.value.workspace, e);
53
56
  }), a.on(
54
57
  "environment:delete:environment",
55
58
  ({ environmentName: e, collectionType: r }) => delete p(t, r)?.["x-scalar-environments"]?.[e]
56
59
  ), a.on("environment:upsert:environment-variable", (e) => {
57
60
  const r = p(t, e.collectionType);
58
- q(r, e);
61
+ P(r, e);
59
62
  }), a.on(
60
63
  "environment:delete:environment-variable",
61
64
  ({ environmentName: e, index: r, collectionType: n }) => p(t, n)?.["x-scalar-environments"]?.[e]?.variables?.splice(r, 1)
62
65
  ), a.on("cookie:upsert:cookie", (e) => {
63
66
  const r = p(t, e.collectionType);
64
- P(r, e);
67
+ I(r, e);
65
68
  }), a.on("cookie:delete:cookie", (e) => {
66
69
  const r = p(t, e.collectionType);
67
- I(r, e);
68
- }), a.on("auth:delete:security-scheme", (e) => M(t.value, e)), a.on("auth:update:active-index", (e) => k(t.value, e)), a.on("auth:update:security-scheme", (e) => A(t.value, e)), a.on("auth:update:selected-scopes", (e) => D(t.value, e)), a.on(
70
+ k(r, e);
71
+ }), a.on("auth:delete:security-scheme", (e) => A(t.value, e)), a.on("auth:update:active-index", (e) => M(t.value, e)), a.on("auth:update:security-scheme", (e) => D(t.value, e)), a.on("auth:update:selected-scopes", (e) => F(t.value, e)), a.on(
69
72
  "auth:update:selected-security-schemes",
70
- async (e) => await F(t.value, e)
71
- ), a.on("server:add:server", () => U(t.value)), a.on("server:update:server", (e) => V(t.value, e)), a.on("server:delete:server", (e) => K(t.value, e)), a.on("server:update:variables", (e) => L(t.value, e)), a.on("server:update:selected", (e) => W(t.value, e)), a.on("operation:create:operation", (e) => j(o.value, e)), a.on(
73
+ async (e) => await U(t.value, e)
74
+ ), a.on("server:add:server", () => V(t.value)), a.on("server:update:server", (e) => K(t.value, e)), a.on("server:delete:server", (e) => L(t.value, e)), a.on("server:update:variables", (e) => W(t.value, e)), a.on("server:update:selected", (e) => j(t.value, e)), a.on("operation:create:operation", (e) => z(o.value, e)), a.on(
72
75
  "operation:update:pathMethod",
73
- (e) => z(t.value, o.value, e, async (r) => {
74
- r === "success" && (await m.replace({
76
+ (e) => G(t.value, o.value, e, async (r) => {
77
+ r === "success" && (await c.replace({
75
78
  name: "example",
76
79
  params: {
77
80
  method: e.payload.method,
78
81
  pathEncoded: encodeURIComponent(e.payload.path),
79
82
  exampleName: i.params.exampleName
80
83
  }
81
- }), u(t.value?.["x-scalar-navigation"]?.id)), e.callback(r);
84
+ }), u(t.value?.["x-scalar-navigation"]?.name)), e.callback(r);
82
85
  })
83
- ), a.on("operation:update:summary", (e) => G(t.value, e)), a.on("operation:delete:operation", (e) => {
84
- H(o.value, e), u(e.documentName), h({
86
+ ), a.on("operation:update:summary", (e) => H(t.value, e)), a.on("operation:delete:operation", async (e) => {
87
+ J(o.value, e), u(e.documentName), h({
85
88
  documentName: e.documentName,
86
89
  path: e.meta.path,
87
90
  method: e.meta.method
88
- }) && m.replace({
91
+ }) && await c.replace({
89
92
  name: "document.overview",
90
93
  params: {
91
94
  documentSlug: e.documentName
92
95
  }
93
96
  });
94
- }), a.on("operation:delete:example", (e) => {
95
- J(o.value, e), u(e.documentName), h({
97
+ }), a.on("operation:delete:example", async (e) => {
98
+ Q(o.value, e), u(e.documentName), h({
96
99
  documentName: e.documentName,
97
100
  path: e.meta.path,
98
101
  method: e.meta.method,
99
102
  exampleName: e.meta.exampleKey
100
- }) && m.replace({
103
+ }) && await c.replace({
101
104
  name: "example",
102
105
  params: {
103
106
  pathEncoded: encodeURIComponent(e.meta.path),
@@ -107,47 +110,47 @@ const fe = ({
107
110
  }
108
111
  });
109
112
  }), a.on("operation:add:parameter", (e) => {
110
- Q(t.value, e), c(e.meta);
113
+ S(t.value, e), m(e.meta);
111
114
  }), a.on("operation:update:parameter", (e) => {
112
- S(t.value, e), c(e.meta);
113
- }), a.on("operation:delete:parameter", (e) => X(t.value, e)), a.on("operation:delete-all:parameters", (e) => Y(t.value, e)), a.on(
115
+ X(t.value, e), m(e.meta);
116
+ }), a.on("operation:delete:parameter", (e) => Y(t.value, e)), a.on("operation:delete-all:parameters", (e) => Z(t.value, e)), a.on(
114
117
  "operation:update:requestBody:contentType",
115
- (e) => Z(t.value, e)
118
+ (e) => _(t.value, e)
116
119
  ), a.on("operation:update:requestBody:value", (e) => {
117
- _(t.value, e), c(e.meta);
120
+ $(t.value, e), m(e.meta);
118
121
  }), a.on("operation:add:requestBody:formRow", (e) => {
119
- $(t.value, e), c(e.meta);
122
+ B(t.value, e), m(e.meta);
120
123
  }), a.on(
121
124
  "operation:update:requestBody:formRow",
122
- (e) => B(t.value, e)
125
+ (e) => ee(t.value, e)
123
126
  ), a.on(
124
127
  "operation:delete:requestBody:formRow",
125
- (e) => ee(t.value, e)
128
+ (e) => ae(t.value, e)
126
129
  ), a.on("tag:create:tag", (e) => {
127
- ae(o.value, e), u(e.documentName);
128
- }), a.on("tag:delete:tag", (e) => {
129
130
  te(o.value, e), u(e.documentName);
131
+ }), a.on("tag:delete:tag", (e) => {
132
+ oe(o.value, e), u(e.documentName);
130
133
  }), a.on("ui:toggle:sidebar", () => d.value = !d.value), a.on(
131
134
  "ui:open:command-palette",
132
135
  (e) => {
133
136
  e ? s.open(e.action, e.payload) : s.open();
134
137
  }
135
138
  ), a.on("tabs:add:tab", async (e) => {
136
- oe(o.value?.workspace ?? null, e), await l();
137
- }), a.on("tabs:close:tab", async (e) => {
138
139
  re(o.value?.workspace ?? null, e), await l();
139
- }), a.on("tabs:close:other-tabs", (e) => ne(o.value?.workspace ?? null, e)), a.on("tabs:focus:tab", async (e) => {
140
- le(o.value?.workspace ?? null, e), await l();
141
- }), a.on("tabs:focus:tab-last", async (e) => {
140
+ }), a.on("tabs:close:tab", async (e) => {
141
+ ne(o.value?.workspace ?? null, e), await l();
142
+ }), a.on("tabs:close:other-tabs", (e) => le(o.value?.workspace ?? null, e)), a.on("tabs:focus:tab", async (e) => {
142
143
  ie(o.value?.workspace ?? null, e), await l();
143
- }), a.on("tabs:navigate:previous", async (e) => {
144
+ }), a.on("tabs:focus:tab-last", async (e) => {
144
145
  ue(o.value?.workspace ?? null, e), await l();
146
+ }), a.on("tabs:navigate:previous", async (e) => {
147
+ ce(o.value?.workspace ?? null, e), await l();
145
148
  }), a.on("tabs:navigate:next", async (e) => {
146
- me(o.value?.workspace ?? null, e), await l();
147
- }), a.on("tabs:update:tabs", async (e) => {
148
149
  pe(o.value?.workspace ?? null, e), await l();
150
+ }), a.on("tabs:update:tabs", async (e) => {
151
+ me(o.value?.workspace ?? null, e), await l();
149
152
  });
150
153
  };
151
154
  export {
152
- fe as useWorkspaceClientEvents
155
+ xe as useWorkspaceClientAppEvents
153
156
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-workspace-selector.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/hooks/use-workspace-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAK1F,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,KAAK,CAAA;AAOnC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAG/B,CAAA;AA0BD,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,eAAe,EAAE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,CAAA;IACtC,UAAU,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7C,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAA;IAC5E,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,cAAc,CAAA;KAAE,GAAG;QAAE,OAAO,EAAE,KAAK,CAAA;KAAE,CAAC,CAAA;CAC1G,CAAA;AAED,eAAO,MAAM,oBAAoB,QAAO,0BA8HvC,CAAA"}
@@ -4,7 +4,7 @@ import { createWorkspaceStorePersistence as v } from "@scalar/workspace-store/pe
4
4
  import { persistencePlugin as D } from "@scalar/workspace-store/plugins/client";
5
5
  import { ref as i } from "vue";
6
6
  import { useRouter as g } from "vue-router";
7
- import { slugify as y } from "../helpers/slugify.js";
7
+ import { slugify as y } from "../../../helpers/slugify.js";
8
8
  const S = 1e3, R = {
9
9
  name: "Default Workspace",
10
10
  id: "default"
@@ -1,4 +1,94 @@
1
- import f from "./DocumentCollection.vue2.js";
1
+ import { defineComponent as f, computed as d, createElementBlock as r, openBlock as n, createElementVNode as e, createVNode as o, withCtx as c, unref as m, createBlock as x, resolveDynamicComponent as v, mergeProps as _ } from "vue";
2
+ import { ScalarButton as h } from "@scalar/components";
3
+ import { LibraryIcon as b } from "@scalar/icons/library";
4
+ import { RouterView as y } from "vue-router";
5
+ import w from "../../../components/IconSelector.vue.js";
6
+ import g from "./components/LabelInput.vue.js";
7
+ import k from "./components/Tabs.vue.js";
8
+ const V = { class: "custom-scroll h-full" }, B = {
9
+ key: 0,
10
+ class: "w-full md:mx-auto md:max-w-[720px]"
11
+ }, C = ["aria-label"], D = { class: "flex flex-row items-center gap-2" }, N = { class: "group relative ml-1.25" }, I = { class: "px-1.5 py-8" }, S = {
12
+ key: 1,
13
+ class: "flex w-full flex-1 items-center justify-center"
14
+ }, U = {
15
+ name: "DocumentCollection"
16
+ }, P = /* @__PURE__ */ f({
17
+ ...U,
18
+ props: {
19
+ documentSlug: {},
20
+ document: {},
21
+ eventBus: {},
22
+ layout: {},
23
+ path: {},
24
+ method: {},
25
+ exampleName: {},
26
+ environment: {},
27
+ workspaceStore: {},
28
+ activeWorkspace: {},
29
+ plugins: {}
30
+ },
31
+ setup(p) {
32
+ const s = p, u = d(() => s.document?.info?.title || "Untitled Document"), i = d(
33
+ () => s.document?.["x-scalar-icon"] || "interface-content-folder"
34
+ );
35
+ return (a, t) => (n(), r("div", V, [
36
+ a.document ? (n(), r("div", B, [
37
+ e("div", {
38
+ "aria-label": `title: ${u.value}`,
39
+ class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:mx-auto md:max-w-[720px]"
40
+ }, [
41
+ e("div", D, [
42
+ o(w, {
43
+ modelValue: i.value,
44
+ placement: "bottom-start",
45
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => a.eventBus.emit("document:update:icon", l))
46
+ }, {
47
+ default: c(() => [
48
+ o(m(h), {
49
+ class: "hover:bg-b-2 aspect-square h-7 w-7 cursor-pointer rounded border border-transparent p-0 hover:border-inherit",
50
+ variant: "ghost"
51
+ }, {
52
+ default: c(() => [
53
+ o(m(b), {
54
+ class: "text-c-2 size-5",
55
+ src: i.value,
56
+ "stroke-width": "2"
57
+ }, null, 8, ["src"])
58
+ ]),
59
+ _: 1
60
+ })
61
+ ]),
62
+ _: 1
63
+ }, 8, ["modelValue"])
64
+ ]),
65
+ e("div", N, [
66
+ o(g, {
67
+ class: "text-xl font-bold",
68
+ inputId: "documentName",
69
+ modelValue: u.value,
70
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => a.eventBus.emit("document:update:info", { title: l }))
71
+ }, null, 8, ["modelValue"])
72
+ ])
73
+ ], 8, C),
74
+ o(k, { type: "document" }),
75
+ e("div", I, [
76
+ o(m(y), null, {
77
+ default: c(({ Component: l }) => [
78
+ (n(), x(v(l), _(s, { collectionType: "document" }), null, 16))
79
+ ]),
80
+ _: 1
81
+ })
82
+ ])
83
+ ])) : (n(), r("div", S, [...t[2] || (t[2] = [
84
+ e("div", { class: "flex h-full flex-col items-center justify-center" }, [
85
+ e("h1", { class: "text-2xl font-bold" }, "Document not found"),
86
+ e("p", { class: "text-gray-500" }, " The document you are looking for does not exist. ")
87
+ ], -1)
88
+ ])]))
89
+ ]));
90
+ }
91
+ });
2
92
  export {
3
- f as default
93
+ P as default
4
94
  };
@@ -1,93 +1,4 @@
1
- import { defineComponent as f, computed as d, createElementBlock as r, openBlock as n, createElementVNode as e, createVNode as o, withCtx as c, unref as m, createBlock as x, resolveDynamicComponent as v, mergeProps as _ } from "vue";
2
- import { ScalarButton as h } from "@scalar/components";
3
- import { LibraryIcon as b } from "@scalar/icons/library";
4
- import { RouterView as y } from "vue-router";
5
- import w from "../../../components/IconSelector.vue.js";
6
- import g from "./components/LabelInput.vue.js";
7
- import k from "./components/Tabs.vue.js";
8
- const V = { class: "custom-scroll h-full" }, B = {
9
- key: 0,
10
- class: "w-full md:mx-auto md:max-w-[720px]"
11
- }, C = ["aria-label"], D = { class: "flex flex-row items-center gap-2" }, N = { class: "group relative ml-1.25" }, I = { class: "px-1.5 py-8" }, S = {
12
- key: 1,
13
- class: "flex w-full flex-1 items-center justify-center"
14
- }, U = {
15
- name: "DocumentCollection"
16
- }, P = /* @__PURE__ */ f({
17
- ...U,
18
- props: {
19
- documentSlug: {},
20
- document: {},
21
- eventBus: {},
22
- layout: {},
23
- path: {},
24
- method: {},
25
- exampleName: {},
26
- environment: {},
27
- workspaceStore: {},
28
- activeWorkspace: {}
29
- },
30
- setup(p) {
31
- const s = p, u = d(() => s.document?.info?.title || "Untitled Document"), i = d(
32
- () => s.document?.["x-scalar-icon"] || "interface-content-folder"
33
- );
34
- return (a, t) => (n(), r("div", V, [
35
- a.document ? (n(), r("div", B, [
36
- e("div", {
37
- "aria-label": `title: ${u.value}`,
38
- class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:mx-auto md:max-w-[720px]"
39
- }, [
40
- e("div", D, [
41
- o(w, {
42
- modelValue: i.value,
43
- placement: "bottom-start",
44
- "onUpdate:modelValue": t[0] || (t[0] = (l) => a.eventBus.emit("document:update:icon", l))
45
- }, {
46
- default: c(() => [
47
- o(m(h), {
48
- class: "hover:bg-b-2 aspect-square h-7 w-7 cursor-pointer rounded border border-transparent p-0 hover:border-inherit",
49
- variant: "ghost"
50
- }, {
51
- default: c(() => [
52
- o(m(b), {
53
- class: "text-c-2 size-5",
54
- src: i.value,
55
- "stroke-width": "2"
56
- }, null, 8, ["src"])
57
- ]),
58
- _: 1
59
- })
60
- ]),
61
- _: 1
62
- }, 8, ["modelValue"])
63
- ]),
64
- e("div", N, [
65
- o(g, {
66
- class: "text-xl font-bold",
67
- inputId: "documentName",
68
- modelValue: u.value,
69
- "onUpdate:modelValue": t[1] || (t[1] = (l) => a.eventBus.emit("document:update:info", { title: l }))
70
- }, null, 8, ["modelValue"])
71
- ])
72
- ], 8, C),
73
- o(k, { type: "document" }),
74
- e("div", I, [
75
- o(m(y), null, {
76
- default: c(({ Component: l }) => [
77
- (n(), x(v(l), _(s, { collectionType: "document" }), null, 16))
78
- ]),
79
- _: 1
80
- })
81
- ])
82
- ])) : (n(), r("div", S, [...t[2] || (t[2] = [
83
- e("div", { class: "flex h-full flex-col items-center justify-center" }, [
84
- e("h1", { class: "text-2xl font-bold" }, "Document not found"),
85
- e("p", { class: "text-gray-500" }, " The document you are looking for does not exist. ")
86
- ], -1)
87
- ])]))
88
- ]));
89
- }
90
- });
1
+ import f from "./DocumentCollection.vue.js";
91
2
  export {
92
- P as default
3
+ f as default
93
4
  };