@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,13 +1,15 @@
1
1
  import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods';
2
- import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
2
+ import { type AvailableClients } from '@scalar/types/snippetz';
3
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
3
4
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
4
5
  import type { AuthMeta } from '@scalar/workspace-store/mutators';
5
6
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
7
+ import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
6
8
  import type { OpenApiDocument, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
7
9
  import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
8
10
  import type { ClientLayout } from '../../../hooks/index.js';
9
11
  import { type History } from '../../../v2/blocks/scalar-address-bar-block/index.js';
10
- import type { ClientPlugin } from '../../../v2/plugins';
12
+ import { type ClientPlugin } from '../../../v2/helpers/plugins.js';
11
13
  /**
12
14
  * OperationBlock
13
15
  *
@@ -22,38 +24,30 @@ import type { ClientPlugin } from '../../../v2/plugins';
22
24
  * draft overrides for the UI when present.
23
25
  */
24
26
  declare const _default: import("vue").DefineComponent<{
27
+ /** Event bus */
25
28
  eventBus: WorkspaceEventBus;
26
29
  /** Application version */
27
30
  appVersion: string;
31
+ /** Workspace/document cookies */
32
+ globalCookies: XScalarCookie[];
28
33
  /** Current request path */
29
34
  path: string;
30
35
  /** Current request method */
31
36
  method: HttpMethodType;
37
+ /** HTTP clients */
38
+ httpClients: AvailableClients;
32
39
  /** Client layout */
33
40
  layout: ClientLayout;
34
41
  /** Currently selected server */
35
42
  server: ServerObject | null;
43
+ /** Currently selected client */
44
+ selectedClient: WorkspaceStore["workspace"]["x-scalar-default-client"];
36
45
  /** Server list available for operation/document */
37
46
  servers: ServerObject[];
38
47
  /** List of request history */
39
48
  history: History[];
40
- /**
41
- * When the request is sent from the modal, this indicates the progress percentage
42
- * of the request being sent.
43
- *
44
- * The amount remaining to load from 100 -> 0
45
- */
46
- requestLoadingPercentage?: number;
47
- /** Preprocessed response */
48
- response?: ResponseInstance;
49
- /** Original request instance */
50
- request?: Request;
51
49
  /** Total number of performed requests */
52
50
  totalPerformedRequests: number;
53
- /** Sidebar open state */
54
- isSidebarOpen?: boolean;
55
- /** Controls sidebar visibility */
56
- showSidebar?: boolean;
57
51
  /** Hides the client button on the header */
58
52
  hideClientButton?: boolean;
59
53
  /** Client integration */
@@ -67,52 +61,46 @@ declare const _default: import("vue").DefineComponent<{
67
61
  /** Currently selected example key for the current operation */
68
62
  exampleKey: string;
69
63
  /** Meta information for the auth update */
70
- authMeta?: AuthMeta;
64
+ authMeta: AuthMeta;
71
65
  /** Document defined security schemes */
72
66
  securitySchemes: NonNullable<OpenApiDocument["components"]>["securitySchemes"];
73
67
  /** Currently selected security for the current operation */
74
68
  selectedSecurity: OpenApiDocument["x-scalar-selected-security"];
75
69
  /** Required security for the operation/document */
76
- security: OpenApiDocument["security"];
70
+ securityRequirements: OpenApiDocument["security"];
77
71
  /** Client plugins */
78
- plugins?: ClientPlugin[];
72
+ plugins: ClientPlugin[];
79
73
  /** For environment variables in the inputs */
80
74
  environment: XScalarEnvironment;
75
+ /** The proxy URL for sending requests */
76
+ proxyUrl: string;
81
77
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
82
78
  "update:servers": () => any;
83
79
  }, string, import("vue").PublicProps, Readonly<{
80
+ /** Event bus */
84
81
  eventBus: WorkspaceEventBus;
85
82
  /** Application version */
86
83
  appVersion: string;
84
+ /** Workspace/document cookies */
85
+ globalCookies: XScalarCookie[];
87
86
  /** Current request path */
88
87
  path: string;
89
88
  /** Current request method */
90
89
  method: HttpMethodType;
90
+ /** HTTP clients */
91
+ httpClients: AvailableClients;
91
92
  /** Client layout */
92
93
  layout: ClientLayout;
93
94
  /** Currently selected server */
94
95
  server: ServerObject | null;
96
+ /** Currently selected client */
97
+ selectedClient: WorkspaceStore["workspace"]["x-scalar-default-client"];
95
98
  /** Server list available for operation/document */
96
99
  servers: ServerObject[];
97
100
  /** List of request history */
98
101
  history: History[];
99
- /**
100
- * When the request is sent from the modal, this indicates the progress percentage
101
- * of the request being sent.
102
- *
103
- * The amount remaining to load from 100 -> 0
104
- */
105
- requestLoadingPercentage?: number;
106
- /** Preprocessed response */
107
- response?: ResponseInstance;
108
- /** Original request instance */
109
- request?: Request;
110
102
  /** Total number of performed requests */
111
103
  totalPerformedRequests: number;
112
- /** Sidebar open state */
113
- isSidebarOpen?: boolean;
114
- /** Controls sidebar visibility */
115
- showSidebar?: boolean;
116
104
  /** Hides the client button on the header */
117
105
  hideClientButton?: boolean;
118
106
  /** Client integration */
@@ -126,17 +114,19 @@ declare const _default: import("vue").DefineComponent<{
126
114
  /** Currently selected example key for the current operation */
127
115
  exampleKey: string;
128
116
  /** Meta information for the auth update */
129
- authMeta?: AuthMeta;
117
+ authMeta: AuthMeta;
130
118
  /** Document defined security schemes */
131
119
  securitySchemes: NonNullable<OpenApiDocument["components"]>["securitySchemes"];
132
120
  /** Currently selected security for the current operation */
133
121
  selectedSecurity: OpenApiDocument["x-scalar-selected-security"];
134
122
  /** Required security for the operation/document */
135
- security: OpenApiDocument["security"];
123
+ securityRequirements: OpenApiDocument["security"];
136
124
  /** Client plugins */
137
- plugins?: ClientPlugin[];
125
+ plugins: ClientPlugin[];
138
126
  /** For environment variables in the inputs */
139
127
  environment: XScalarEnvironment;
128
+ /** The proxy URL for sending requests */
129
+ proxyUrl: string;
140
130
  }> & Readonly<{
141
131
  "onUpdate:servers"?: (() => any) | undefined;
142
132
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"AA4QA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAK5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAQ3C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAA;AACnE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD;;;;;;;;;;;;GAYG;;IAGD,gBAAgB;cACN,iBAAiB;IAC3B,0BAA0B;gBACd,MAAM;IAClB,iCAAiC;mBAClB,aAAa,EAAE;IAC9B,2BAA2B;UACrB,MAAM;IACZ,6BAA6B;YACrB,cAAc;IACtB,mBAAmB;iBACN,gBAAgB;IAC7B,oBAAoB;YACZ,YAAY;IACpB,gCAAgC;YACxB,YAAY,GAAG,IAAI;IAC3B,gCAAgC;oBAChB,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC;IACtE,mDAAmD;aAC1C,YAAY,EAAE;IACvB,8BAA8B;aACrB,OAAO,EAAE;IAClB,yCAAyC;4BACjB,MAAM;IAC9B,4CAA4C;uBACzB,OAAO;IAC1B,0BAA0B;kBACZ,MAAM,GAAG,IAAI;IAC3B,mEAAmE;kBACrD,MAAM;IACpB,oBAAoB;aACX,SAAS,GAAG,eAAe;IACpC,uBAAuB;eACZ,eAAe;IAC1B,+DAA+D;gBACnD,MAAM;IAClB,2CAA2C;cACjC,QAAQ;IAClB,wCAAwC;qBACvB,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAC9E,4DAA4D;sBAC1C,eAAe,CAAC,4BAA4B,CAAC;IAC/D,mDAAmD;0BAC7B,eAAe,CAAC,UAAU,CAAC;IACjD,qBAAqB;aACZ,YAAY,EAAE;IACvB,8CAA8C;iBACjC,kBAAkB;IAC/B,yCAAyC;cAC/B,MAAM;;;;IAjDhB,gBAAgB;cACN,iBAAiB;IAC3B,0BAA0B;gBACd,MAAM;IAClB,iCAAiC;mBAClB,aAAa,EAAE;IAC9B,2BAA2B;UACrB,MAAM;IACZ,6BAA6B;YACrB,cAAc;IACtB,mBAAmB;iBACN,gBAAgB;IAC7B,oBAAoB;YACZ,YAAY;IACpB,gCAAgC;YACxB,YAAY,GAAG,IAAI;IAC3B,gCAAgC;oBAChB,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC;IACtE,mDAAmD;aAC1C,YAAY,EAAE;IACvB,8BAA8B;aACrB,OAAO,EAAE;IAClB,yCAAyC;4BACjB,MAAM;IAC9B,4CAA4C;uBACzB,OAAO;IAC1B,0BAA0B;kBACZ,MAAM,GAAG,IAAI;IAC3B,mEAAmE;kBACrD,MAAM;IACpB,oBAAoB;aACX,SAAS,GAAG,eAAe;IACpC,uBAAuB;eACZ,eAAe;IAC1B,+DAA+D;gBACnD,MAAM;IAClB,2CAA2C;cACjC,QAAQ;IAClB,wCAAwC;qBACvB,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAC9E,4DAA4D;sBAC1C,eAAe,CAAC,4BAA4B,CAAC;IAC/D,mDAAmD;0BAC7B,eAAe,CAAC,UAAU,CAAC;IACjD,qBAAqB;aACZ,YAAY,EAAE;IACvB,8CAA8C;iBACjC,kBAAkB;IAC/B,yCAAyC;cAC/B,MAAM;;;;AAnDlB,wBA4WC"}
@@ -1,29 +1,33 @@
1
- import { defineComponent as l, createElementBlock as p, openBlock as m, createElementVNode as d, createVNode as t, withCtx as i, unref as n } from "vue";
2
- import h from "../../../components/ViewLayout/ViewLayout.vue.js";
3
- import y from "../../../components/ViewLayout/ViewLayoutContent.vue.js";
4
- import { createStoreEvents as v } from "../../../store/events.js";
5
- import f from "./components/Header.vue.js";
6
- import B from "../request-block/RequestBlock.vue.js";
7
- import c from "../response-block/ResponseBlock.vue.js";
8
- const g = { class: "bg-b-1 flex h-full flex-col" }, S = { class: "lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-1" }, q = {
1
+ import { defineComponent as B, computed as q, ref as i, onMounted as g, onBeforeUnmount as R, watch as C, createElementBlock as S, openBlock as U, createElementVNode as k, createVNode as o, withCtx as h, unref as a } from "vue";
2
+ import { AVAILABLE_CLIENTS as E } from "@scalar/types/snippetz";
3
+ import { useToasts as b } from "@scalar/use-toasts";
4
+ import V from "../../../components/ViewLayout/ViewLayout.vue.js";
5
+ import K from "../../../components/ViewLayout/ViewLayoutContent.vue.js";
6
+ import { ERRORS as O } from "../../../libs/errors.js";
7
+ import { createStoreEvents as w } from "../../../store/events.js";
8
+ import { buildRequest as P } from "./helpers/build-request.js";
9
+ import { sendRequest as M } from "./helpers/send-request.js";
10
+ import A from "./components/Header.vue.js";
11
+ import { generateClientOptions as L } from "../operation-code-sample/helpers/generate-client-options.js";
12
+ import T from "../request-block/RequestBlock.vue.js";
13
+ import N from "../response-block/ResponseBlock.vue.js";
14
+ const I = { class: "bg-b-1 flex h-full flex-col" }, $ = { class: "lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0" }, j = {
9
15
  name: "OperationBlock"
10
- }, E = /* @__PURE__ */ l({
11
- ...q,
16
+ }, ee = /* @__PURE__ */ B({
17
+ ...j,
12
18
  props: {
13
19
  eventBus: {},
14
20
  appVersion: {},
21
+ globalCookies: { default: () => [] },
15
22
  path: {},
16
23
  method: {},
24
+ httpClients: { default: () => E },
17
25
  layout: {},
18
26
  server: {},
27
+ selectedClient: {},
19
28
  servers: {},
20
29
  history: {},
21
- requestLoadingPercentage: {},
22
- response: {},
23
- request: {},
24
30
  totalPerformedRequests: {},
25
- isSidebarOpen: { type: Boolean },
26
- showSidebar: { type: Boolean },
27
31
  hideClientButton: { type: Boolean },
28
32
  integration: {},
29
33
  documentUrl: {},
@@ -33,43 +37,75 @@ const g = { class: "bg-b-1 flex h-full flex-col" }, S = { class: "lg:min-h-heade
33
37
  authMeta: {},
34
38
  securitySchemes: {},
35
39
  selectedSecurity: {},
36
- security: {},
37
- plugins: {},
38
- environment: {}
40
+ securityRequirements: {},
41
+ plugins: { default: () => [] },
42
+ environment: {},
43
+ proxyUrl: {}
39
44
  },
40
45
  emits: ["update:servers"],
41
- setup(r, { emit: a }) {
42
- const u = a, o = () => r.eventBus.emit("operation:send:request", {
43
- meta: { path: r.path, method: r.method, exampleKey: r.exampleKey }
44
- });
45
- return (e, s) => (m(), p("div", g, [
46
- d("div", S, [
47
- t(f, {
46
+ setup(t, { emit: y }) {
47
+ const p = y, f = q(() => L(t.httpClients)), { toast: m } = b(), d = i(null), s = i(null), l = i(null), c = () => d.value?.abort(O.REQUEST_ABORTED), r = async () => {
48
+ const [e, n] = P({
49
+ environment: t.environment,
50
+ exampleKey: t.exampleKey,
51
+ globalCookies: t.globalCookies,
52
+ method: t.method,
53
+ operation: t.operation,
54
+ path: t.path,
55
+ securitySchemes: t.securitySchemes,
56
+ selectedSecurity: t.selectedSecurity?.selectedSchemes ?? [],
57
+ server: t.server,
58
+ proxyUrl: t.proxyUrl
59
+ });
60
+ if (e) {
61
+ m(e.message, "error");
62
+ return;
63
+ }
64
+ d.value = n.controller, t.eventBus.emit("hooks:on:request:sent");
65
+ const [u, v] = await M({
66
+ isUsingProxy: n.isUsingProxy,
67
+ operation: t.operation,
68
+ plugins: t.plugins,
69
+ request: n.request
70
+ });
71
+ if (t.eventBus.emit("hooks:on:request:complete"), u) {
72
+ m(u.message, "error");
73
+ return;
74
+ }
75
+ s.value = v.response, l.value = v.request;
76
+ };
77
+ return g(() => {
78
+ t.eventBus.on("operation:send:request:hotkey", r), t.eventBus.on("operation:cancel:request", c);
79
+ }), R(() => {
80
+ t.eventBus.off("operation:send:request:hotkey", r), t.eventBus.off("operation:cancel:request", c);
81
+ }), C([() => t.path, () => t.method, () => t.exampleKey], () => {
82
+ s.value = null, l.value = null;
83
+ }), (e, n) => (U(), S("div", I, [
84
+ k("div", $, [
85
+ o(A, {
48
86
  documentUrl: e.documentUrl,
49
87
  environment: e.environment,
50
88
  eventBus: e.eventBus,
51
89
  hideClientButton: e.hideClientButton,
52
90
  history: e.history,
53
91
  integration: e.integration,
54
- isSidebarOpen: e.isSidebarOpen,
55
92
  layout: e.layout,
56
93
  method: e.method,
57
94
  path: e.path,
58
- percentage: e.requestLoadingPercentage,
59
95
  server: e.server,
60
96
  servers: e.servers,
61
- showSidebar: e.showSidebar,
62
97
  source: e.source,
63
- onExecute: o,
64
- "onUpdate:servers": s[0] || (s[0] = (b) => u("update:servers"))
65
- }, null, 8, ["documentUrl", "environment", "eventBus", "hideClientButton", "history", "integration", "isSidebarOpen", "layout", "method", "path", "percentage", "server", "servers", "showSidebar", "source"])
98
+ onExecute: r,
99
+ "onUpdate:servers": n[0] || (n[0] = (u) => p("update:servers"))
100
+ }, null, 8, ["documentUrl", "environment", "eventBus", "hideClientButton", "history", "integration", "layout", "method", "path", "server", "servers", "source"])
66
101
  ]),
67
- t(h, null, {
68
- default: i(() => [
69
- t(y, { class: "flex flex-1" }, {
70
- default: i(() => [
71
- t(n(B), {
102
+ o(V, { class: "border-t" }, {
103
+ default: h(() => [
104
+ o(K, { class: "flex-1" }, {
105
+ default: h(() => [
106
+ o(a(T), {
72
107
  authMeta: e.authMeta,
108
+ clientOptions: f.value,
73
109
  environment: e.environment,
74
110
  eventBus: e.eventBus,
75
111
  exampleKey: e.exampleKey,
@@ -78,20 +114,23 @@ const g = { class: "bg-b-1 flex h-full flex-col" }, S = { class: "lg:min-h-heade
78
114
  operation: e.operation,
79
115
  path: e.path,
80
116
  plugins: e.plugins,
81
- security: e.security,
117
+ proxyUrl: e.proxyUrl,
118
+ securityRequirements: e.securityRequirements,
82
119
  securitySchemes: e.securitySchemes,
83
- selectedSecurity: e.selectedSecurity
84
- }, null, 8, ["authMeta", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "plugins", "security", "securitySchemes", "selectedSecurity"]),
85
- t(n(c), {
120
+ selectedClient: e.selectedClient,
121
+ selectedSecurity: e.selectedSecurity,
122
+ server: e.server
123
+ }, null, 8, ["authMeta", "clientOptions", "environment", "eventBus", "exampleKey", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "server"]),
124
+ o(a(N), {
86
125
  appVersion: e.appVersion,
87
126
  eventBus: e.eventBus,
88
- events: n(v)(),
127
+ events: a(w)(),
89
128
  layout: e.layout,
90
129
  plugins: e.plugins,
91
- request: e.request,
92
- response: e.response,
130
+ request: l.value,
131
+ response: s.value,
93
132
  totalPerformedRequests: e.totalPerformedRequests,
94
- onSendRequest: o
133
+ onSendRequest: r
95
134
  }, null, 8, ["appVersion", "eventBus", "events", "layout", "plugins", "request", "response", "totalPerformedRequests"])
96
135
  ]),
97
136
  _: 1
@@ -103,5 +142,5 @@ const g = { class: "bg-b-1 flex h-full flex-col" }, S = { class: "lg:min-h-heade
103
142
  }
104
143
  });
105
144
  export {
106
- E as default
145
+ ee as default
107
146
  };
@@ -11,10 +11,6 @@ type __VLS_Props = {
11
11
  method: HttpMethod;
12
12
  /** Client layout */
13
13
  layout: ClientLayout;
14
- /** Sidebar open state */
15
- isSidebarOpen?: boolean;
16
- /** Controls sidebar visibility */
17
- showSidebar?: boolean;
18
14
  /** Hides the client button on the header */
19
15
  hideClientButton?: boolean;
20
16
  /** Client integration */
@@ -29,15 +25,9 @@ type __VLS_Props = {
29
25
  servers: ServerObject[];
30
26
  /** List of request history */
31
27
  history: History[];
32
- /**
33
- * When the request is sent from the modal, this indicates the progress percentage
34
- * of the request being sent.
35
- *
36
- * The amount remaining to load from 100 -> 0
37
- */
38
- requestLoadingPercentage?: number;
39
28
  /** Event bus */
40
29
  eventBus: WorkspaceEventBus;
30
+ /** Environment variables */
41
31
  environment: XScalarEnvironment;
42
32
  };
43
33
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"names":[],"mappings":"AAiJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAE/E,KAAK,WAAW,GAAG;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,yBAAyB;IACzB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,CAAA;IACpC,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;AAgOF,wBAOG"}
1
+ {"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"names":[],"mappings":"AAmIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAE/E,KAAK,WAAW,GAAG;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,CAAA;IACpC,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,4BAA4B;IAC5B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;AAyNF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Header.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d30bcf30"]]);
4
+ const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d73c7e3d"]]);
5
5
  export {
6
- f as default
6
+ d as default
7
7
  };
@@ -1,15 +1,13 @@
1
- import { defineComponent as p, createElementBlock as r, openBlock as o, createElementVNode as n, createVNode as a, createCommentVNode as s, normalizeClass as v, unref as l, createBlock as g } from "vue";
2
- import { ScalarIcon as d } from "@scalar/components";
1
+ import { defineComponent as d, createElementBlock as l, openBlock as n, createElementVNode as o, createVNode as i, unref as r, createBlock as v, createCommentVNode as u } from "vue";
2
+ import { ScalarIcon as a } from "@scalar/components";
3
3
  import f from "../../scalar-address-bar-block/components/AddressBar.vue.js";
4
- import y from "../../../../components/OpenApiClientButton.vue.js";
5
- const b = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center border-b p-2 pt-2 lg:p-1 lg:pt-1" }, h = { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, B = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-1 lg:mb-0 lg:flex-1 lg:px-2.5" }, S = /* @__PURE__ */ p({
4
+ import g from "../../../../components/OpenApiClientButton.vue.js";
5
+ const y = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" }, b = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-1 lg:mb-0 lg:flex-1 lg:px-2.5" }, w = /* @__PURE__ */ d({
6
6
  __name: "Header",
7
7
  props: {
8
8
  path: {},
9
9
  method: {},
10
10
  layout: {},
11
- isSidebarOpen: { type: Boolean },
12
- showSidebar: { type: Boolean, default: !0 },
13
11
  hideClientButton: { type: Boolean, default: !1 },
14
12
  integration: {},
15
13
  documentUrl: {},
@@ -17,72 +15,67 @@ const b = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
17
15
  server: {},
18
16
  servers: {},
19
17
  history: {},
20
- requestLoadingPercentage: {},
21
18
  eventBus: {},
22
19
  environment: {}
23
20
  },
24
21
  emits: ["execute", "update:servers"],
25
- setup(C, { emit: m }) {
26
- const u = m;
27
- return (e, t) => (o(), r("div", b, [
28
- n("div", h, [
29
- e.showSidebar ? (o(), r("div", {
30
- key: 0,
31
- class: v(["size-8", { hidden: e.layout === "modal" && !e.isSidebarOpen }])
32
- }, null, 2)) : s("", !0)
33
- ]),
34
- a(l(f), {
22
+ setup(B, { emit: p }) {
23
+ const m = p;
24
+ return (e, t) => (n(), l("div", y, [
25
+ t[6] || (t[6] = o("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [
26
+ o("div", { class: "size-8" })
27
+ ], -1)),
28
+ i(r(f), {
35
29
  environment: e.environment,
36
30
  eventBus: e.eventBus,
37
31
  history: e.history,
38
32
  layout: e.layout,
39
33
  method: e.method,
40
34
  path: e.path,
41
- percentage: e.requestLoadingPercentage,
42
35
  server: e.server,
43
36
  servers: e.servers,
44
- onExecute: t[0] || (t[0] = (i) => u("execute")),
45
- "onUpdate:servers": t[1] || (t[1] = (i) => u("update:servers"))
46
- }, null, 8, ["environment", "eventBus", "history", "layout", "method", "path", "percentage", "server", "servers"]),
47
- n("div", B, [
48
- e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (o(), g(l(y), {
37
+ onExecute: t[0] || (t[0] = (s) => m("execute")),
38
+ "onUpdate:servers": t[1] || (t[1] = (s) => m("update:servers"))
39
+ }, null, 8, ["environment", "eventBus", "history", "layout", "method", "path", "server", "servers"]),
40
+ o("div", b, [
41
+ e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (n(), v(r(g), {
49
42
  key: 0,
50
43
  buttonSource: "modal",
51
44
  class: "!w-fit lg:-mr-1",
52
45
  integration: e.integration ?? null,
53
46
  source: e.source ?? "api-reference",
54
47
  url: e.documentUrl
55
- }, null, 8, ["integration", "source", "url"])) : s("", !0),
56
- e.layout === "modal" && e.source !== "gitbook" ? (o(), r("button", {
48
+ }, null, 8, ["integration", "source", "url"])) : u("", !0),
49
+ e.layout === "modal" && e.source !== "gitbook" ? (n(), l("button", {
57
50
  key: 1,
58
51
  class: "app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2",
59
52
  type: "button",
60
- onClick: t[2] || (t[2] = (i) => e.eventBus.emit("hide:modal"))
53
+ onClick: t[2] || (t[2] = (s) => e.eventBus.emit("ui:close:client-modal"))
61
54
  }, [
62
- a(l(d), {
55
+ i(r(a), {
63
56
  icon: "Close",
64
57
  size: "lg",
65
58
  thickness: "2"
66
59
  }),
67
- t[4] || (t[4] = n("span", { class: "sr-only" }, "Close Client", -1))
68
- ])) : s("", !0),
69
- e.layout === "modal" && e.source === "gitbook" ? (o(), r("button", {
60
+ t[4] || (t[4] = o("span", { class: "sr-only" }, "Close Client", -1))
61
+ ])) : u("", !0),
62
+ e.layout === "modal" && e.source === "gitbook" ? (n(), l("button", {
70
63
  key: 2,
71
64
  class: "text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2",
72
65
  type: "button",
73
- onClick: t[3] || (t[3] = (i) => e.eventBus.emit("hide:modal"))
66
+ onClick: t[3] || (t[3] = (s) => e.eventBus.emit("ui:close:client-modal"))
74
67
  }, [
75
- a(l(d), {
68
+ i(r(a), {
76
69
  icon: "Close",
77
70
  size: "md",
78
71
  thickness: "1.75"
79
72
  }),
80
- t[5] || (t[5] = n("span", { class: "sr-only" }, "Close Client", -1))
81
- ])) : s("", !0)
73
+ t[5] || (t[5] = o("span", { class: "sr-only" }, "Close Client", -1))
74
+ ])) : u("", !0)
82
75
  ])
83
76
  ]));
84
77
  }
85
78
  });
86
79
  export {
87
- S as default
80
+ w as default
88
81
  };
@@ -0,0 +1,10 @@
1
+ import type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/request-body';
2
+ /**
3
+ * Create the fetch request body
4
+ */
5
+ export declare const buildRequestBody: (requestBody: RequestBodyObject | undefined,
6
+ /** Environment variables flattened into a key-value object */
7
+ env?: Record<string, string>,
8
+ /** The key of the current example */
9
+ exampleKey?: string) => BodyInit | null;
10
+ //# sourceMappingURL=build-request-body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-request-body.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-body.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAIjG;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,iBAAiB,GAAG,SAAS;AAC1C,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qCAAqC;AACrC,mBAAsB,KACrB,QAAQ,GAAG,IAmDb,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { replaceEnvVariables as i } from "@scalar/helpers/regex/replace-variables";
2
+ import { getExampleFromBody as c } from "../../request-block/helpers/get-request-body-example.js";
3
+ const u = (r, e = {}, l = "default") => {
4
+ if (!r)
5
+ return null;
6
+ const a = r?.["x-scalar-selected-content-type"]?.[l] ?? Object.keys(r?.content ?? {})[0] ?? "application/json", t = c(r, a, l);
7
+ if (!t)
8
+ return null;
9
+ if ((a === "multipart/form-data" || a === "application/x-www-form-urlencoded") && Array.isArray(t.value)) {
10
+ const n = a === "multipart/form-data" ? new FormData() : new URLSearchParams();
11
+ return t.value.forEach(({ name: f, value: o }) => {
12
+ if (!f)
13
+ return;
14
+ const p = i(f, e);
15
+ o instanceof File && n instanceof FormData ? n.append(p, o) : typeof o == "string" && n.append(p, i(o, e));
16
+ }), n;
17
+ }
18
+ return typeof t.value == "object" ? i(JSON.stringify(t.value), e) : typeof t.value == "string" ? i(t.value, e) : t.value;
19
+ };
20
+ export {
21
+ u as buildRequestBody
22
+ };
@@ -0,0 +1,31 @@
1
+ import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
2
+ /**
3
+ * Generate a cookie header from the cookie params
4
+ */
5
+ export declare const getCookieHeader: (cookieParams: XScalarCookie[], originalCookieHeader: string | undefined) => string;
6
+ /**
7
+ * Build out the cookies header taking in global, param and security scheme cookies
8
+ */
9
+ export declare const buildRequestCookieHeader: ({ paramCookies, globalCookies, env, path, originalCookieHeader, url, useCustomCookieHeader, }: {
10
+ /** Parsed/replaced cookies from the parameters and security schemes */
11
+ paramCookies: XScalarCookie[];
12
+ /** Raw global cookies from the workspace/document */
13
+ globalCookies: XScalarCookie[];
14
+ /** Environment variables flattened into a key-value object */
15
+ env: Record<string, string>;
16
+ /** The path of the request used to filter global cookies by path */
17
+ path: string;
18
+ /** Cookie header that previously exists from the spec OR from the user */
19
+ originalCookieHeader: string | undefined;
20
+ /** The url of the request used to filter global cookies by domain */
21
+ url: string;
22
+ /**
23
+ * If we are running in Electron or using the proxy, we need to add a custom header
24
+ * that's then forwarded as a `Cookie` header.
25
+ */
26
+ useCustomCookieHeader: boolean;
27
+ }) => null | {
28
+ name: string;
29
+ value: string;
30
+ };
31
+ //# sourceMappingURL=build-request-cookie-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-request-cookie-header.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-cookie-header.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,qEAAqE,CAAA;AAa5E;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,aAAa,EAAE,EAAE,sBAAsB,MAAM,GAAG,SAAS,KAAG,MAWzG,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,+FAQtC;IACD,uEAAuE;IACvE,YAAY,EAAE,aAAa,EAAE,CAAA;IAC7B,qDAAqD;IACrD,aAAa,EAAE,aAAa,EAAE,CAAA;IAC9B,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAA;CAC/B,KAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAoCvC,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { replaceEnvVariables as n } from "@scalar/helpers/regex/replace-variables";
2
+ import { xScalarCookieSchema as l } from "@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies";
3
+ import { coerceValue as d } from "@scalar/workspace-store/schemas/typebox-coerce";
4
+ import { matchesDomain as f } from "../../../../libs/send-request/set-request-cookies.js";
5
+ const c = "We're using a `X-Scalar-Cookie` custom header to the request. The proxy will forward this as a `Cookie` header. We do this to avoid the browser omitting the `Cookie` header for cross-origin requests for security reasons.", b = `We're trying to add a Cookie header, but browsers often omit them for cross-origin requests for various security reasons. If it's not working, that's probably why. Here are the requirements for it to work:
6
+
7
+ - The browser URL must be on the same domain as the server URL.
8
+ - The connection must be made over HTTPS.
9
+ `, p = (a, o) => {
10
+ const r = a.map((t) => `${t.name}=${t.value}`).join("; ");
11
+ return o && r ? `${o}; ${r}` : o || r || "";
12
+ }, R = ({
13
+ paramCookies: a,
14
+ globalCookies: o,
15
+ env: r,
16
+ path: t,
17
+ originalCookieHeader: i,
18
+ url: m,
19
+ useCustomCookieHeader: u
20
+ }) => {
21
+ const h = o.flatMap((e) => e.isDisabled || !e.name || e.domain && !f(m, e.domain) || e.path && !t.startsWith(e.path) ? [] : d(l, {
22
+ ...e,
23
+ name: n(e.name, r),
24
+ value: n(e.value, r)
25
+ })), s = p([...h, ...a], i);
26
+ return s ? u ? (console.warn(c), { name: "X-Scalar-Cookie", value: s }) : (console.warn(b), { name: "Cookie", value: s }) : null;
27
+ };
28
+ export {
29
+ R as buildRequestCookieHeader,
30
+ p as getCookieHeader
31
+ };