@scalar/api-client 2.15.0 → 2.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/dist/hooks/useResponseBody.js +6 -6
  3. package/dist/libs/errors.d.ts +1 -0
  4. package/dist/libs/errors.d.ts.map +1 -1
  5. package/dist/libs/errors.js +1 -0
  6. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  7. package/dist/libs/send-request/create-request-operation.js +41 -35
  8. package/dist/style.css +1 -1
  9. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +28 -38
  10. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +84 -45
  12. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -11
  13. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  15. package/dist/v2/blocks/operation-block/components/Header.vue2.js +28 -35
  16. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +10 -0
  17. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -0
  18. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +22 -0
  19. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +31 -0
  20. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -0
  21. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +31 -0
  22. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +3 -9
  23. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +56 -0
  25. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +10 -3
  26. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
  27. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +46 -0
  28. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +45 -0
  29. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -0
  30. package/dist/v2/blocks/operation-block/helpers/build-request.js +66 -0
  31. package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +9 -0
  32. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts +16 -0
  33. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.d.ts.map +1 -0
  34. package/dist/v2/blocks/operation-block/helpers/get-cookie-header-keys.js +4 -0
  35. package/dist/v2/blocks/operation-block/helpers/get-delimiter.js +17 -0
  36. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +9 -3
  37. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-block/helpers/get-example.js +21 -0
  39. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +53 -0
  40. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -0
  41. package/dist/v2/blocks/operation-block/helpers/send-request.js +120 -0
  42. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts +1 -1
  43. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  45. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  46. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +89 -110
  47. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts +2 -2
  48. package/dist/v2/blocks/operation-code-sample/helpers/find-client.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts +8 -13
  50. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.d.ts.map +1 -1
  51. package/dist/v2/blocks/operation-code-sample/helpers/generate-client-options.js +22 -28
  52. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +19 -8
  53. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  54. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +30 -24
  55. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts +12 -0
  56. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.d.ts.map +1 -0
  57. package/dist/v2/blocks/operation-code-sample/helpers/get-clients.js +20 -0
  58. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts +10 -0
  59. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.d.ts.map +1 -0
  60. package/dist/v2/blocks/operation-code-sample/helpers/get-custom-code-samples.js +4 -0
  61. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +14 -12
  62. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  63. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +191 -169
  64. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  65. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +10 -10
  66. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts +2 -1
  67. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  68. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +15 -19
  69. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +2 -2
  70. package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -1
  71. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  72. package/dist/v2/blocks/operation-code-sample/types.d.ts +16 -0
  73. package/dist/v2/blocks/operation-code-sample/types.d.ts.map +1 -1
  74. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +15 -10
  75. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  76. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  77. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +158 -125
  78. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  80. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +59 -50
  81. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts +8 -0
  82. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -0
  83. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +127 -0
  84. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue2.js +4 -0
  85. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  86. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +24 -23
  87. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +1 -0
  88. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  89. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +148 -149
  90. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts +1 -0
  91. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  92. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js +1 -1
  93. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue2.js +28 -27
  94. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +3 -2
  95. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +1 -1
  96. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +13 -3
  97. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +4 -4
  98. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  99. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +3 -3
  100. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +41 -45
  101. package/dist/v2/blocks/response-block/components/Headers.vue.d.ts.map +1 -1
  102. package/dist/v2/blocks/response-block/components/Headers.vue.js +27 -27
  103. package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js +1 -1
  104. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts +18 -0
  105. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.d.ts.map +1 -0
  106. package/dist/v2/blocks/response-block/helpers/parse-set-cookie.js +12 -0
  107. package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -2
  108. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +0 -2
  109. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  111. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +97 -87
  112. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +19 -0
  113. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -0
  114. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +24 -0
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +3 -2
  116. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +59 -56
  118. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  120. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  122. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +26 -24
  123. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -1
  124. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +44 -43
  126. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +4 -0
  127. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +1 -0
  128. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +7 -0
  129. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +4 -4
  130. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  131. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +2 -2
  132. package/dist/v2/components/code-input/CodeInput.vue.d.ts +7 -6
  133. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  134. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  135. package/dist/v2/components/code-input/CodeInput.vue2.js +61 -59
  136. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +2 -2
  137. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  138. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +44 -44
  139. package/dist/v2/components/resize/index.d.ts +0 -1
  140. package/dist/v2/components/resize/index.d.ts.map +1 -1
  141. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -5
  142. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  143. package/dist/v2/components/sidebar/Sidebar.vue.js +49 -47
  144. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +1 -1
  145. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  146. package/dist/v2/features/app/App.vue.d.ts +3 -0
  147. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  148. package/dist/v2/features/app/App.vue.js +128 -139
  149. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +3 -3
  150. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  151. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  152. package/dist/v2/features/app/components/AppSidebar.vue2.js +137 -105
  153. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +1 -1
  154. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  155. package/dist/v2/features/app/components/{ItemDecorator.vue.d.ts → SidebarItemMenu.vue.d.ts} +1 -1
  156. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -0
  157. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +129 -0
  158. package/dist/v2/features/app/components/SidebarItemMenu.vue2.js +4 -0
  159. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +1 -1
  160. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  161. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
  162. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  163. package/dist/v2/features/app/helpers/create-api-client-app.js +8 -8
  164. package/dist/v2/features/app/helpers/routes.d.ts +32 -6
  165. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  166. package/dist/v2/features/app/helpers/routes.js +25 -16
  167. package/dist/v2/{hooks/use-sidebar-state.d.ts → features/app/hooks/use-app-sidebar.d.ts} +10 -11
  168. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +1 -0
  169. package/dist/v2/{hooks/use-sidebar-state.js → features/app/hooks/use-app-sidebar.js} +19 -19
  170. package/dist/v2/features/app/hooks/use-document-watcher.d.ts.map +1 -0
  171. package/dist/v2/{hooks → features/app/hooks}/use-sync-path.d.ts +2 -2
  172. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +1 -0
  173. package/dist/v2/features/app/hooks/use-sync-path.js +52 -0
  174. package/dist/v2/{hooks → features/app/hooks}/use-tabs.d.ts +2 -2
  175. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +1 -0
  176. package/dist/v2/{hooks → features/app/hooks}/use-tabs.js +1 -1
  177. package/dist/v2/{hooks/use-workspace-client-events.d.ts → features/app/hooks/use-workspace-client-app-events.d.ts} +5 -5
  178. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -0
  179. package/dist/v2/{hooks/use-workspace-client-events.js → features/app/hooks/use-workspace-client-app-events.js} +48 -45
  180. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +1 -0
  181. package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.js +1 -1
  182. package/dist/v2/features/collection/DocumentCollection.vue.js +92 -2
  183. package/dist/v2/features/collection/DocumentCollection.vue2.js +2 -91
  184. package/dist/v2/features/collection/WorkspaceCollection.vue.js +42 -2
  185. package/dist/v2/features/collection/WorkspaceCollection.vue2.js +2 -41
  186. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  187. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  188. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -12
  189. package/dist/v2/features/collection/components/Cookies.vue.js +30 -1
  190. package/dist/v2/features/collection/components/Cookies.vue2.js +1 -29
  191. package/dist/v2/features/collection/components/Environment.vue.js +32 -1
  192. package/dist/v2/features/collection/components/Environment.vue2.js +1 -31
  193. package/dist/v2/features/collection/components/Overview.vue2.js +5 -4
  194. package/dist/v2/features/collection/components/Servers.vue.js +142 -2
  195. package/dist/v2/features/collection/components/Servers.vue2.js +2 -141
  196. package/dist/v2/features/collection/components/Settings.vue.js +58 -2
  197. package/dist/v2/features/collection/components/Settings.vue2.js +2 -57
  198. package/dist/v2/features/modal/Modal.vue.d.ts +23 -1
  199. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  200. package/dist/v2/features/modal/Modal.vue.js +1 -1
  201. package/dist/v2/features/modal/Modal.vue2.js +118 -31
  202. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +18 -32
  203. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  204. package/dist/v2/features/modal/helpers/create-api-client-modal.js +46 -26
  205. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts +55 -0
  206. package/dist/v2/features/modal/helpers/resolve-route-parameters.d.ts.map +1 -0
  207. package/dist/v2/features/modal/helpers/resolve-route-parameters.js +29 -0
  208. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts +42 -0
  209. package/dist/v2/features/modal/hooks/use-modal-sidebar.d.ts.map +1 -0
  210. package/dist/v2/features/modal/hooks/use-modal-sidebar.js +93 -0
  211. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +18 -0
  212. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -0
  213. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +30 -0
  214. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  215. package/dist/v2/features/operation/Operation.vue.js +59 -28
  216. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +17 -0
  217. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +1 -0
  218. package/dist/v2/features/operation/helpers/get-operation-header.js +12 -0
  219. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
  220. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
  221. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +7 -0
  222. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -0
  223. package/dist/v2/features/operation/helpers/get-selected-security.js +19 -0
  224. package/dist/v2/features/operation/index.d.ts +0 -1
  225. package/dist/v2/features/operation/index.d.ts.map +1 -1
  226. package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +1 -1
  227. package/dist/v2/features/search/components/SearchModal.vue.js +3 -3
  228. package/dist/v2/features/search/components/SearchModal.vue2.js +45 -44
  229. package/dist/v2/helpers/generate-location-id.d.ts +19 -0
  230. package/dist/v2/helpers/generate-location-id.d.ts.map +1 -0
  231. package/dist/v2/helpers/generate-location-id.js +10 -0
  232. package/dist/v2/helpers/get-active-environment.d.ts +5 -0
  233. package/dist/v2/helpers/get-active-environment.d.ts.map +1 -0
  234. package/dist/v2/helpers/get-active-environment.js +22 -0
  235. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  236. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  237. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  238. package/dist/v2/helpers/plugins.d.ts +59 -0
  239. package/dist/v2/helpers/plugins.d.ts.map +1 -0
  240. package/dist/v2/helpers/plugins.js +11 -0
  241. package/dist/v2/hooks/use-scroll-lock.d.ts +28 -0
  242. package/dist/v2/hooks/use-scroll-lock.d.ts.map +1 -0
  243. package/dist/v2/hooks/use-scroll-lock.js +21 -0
  244. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +2 -0
  245. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  246. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +1 -1
  247. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts +0 -1
  248. package/dist/views/Request/RequestSection/RequestAuth/index.d.ts.map +1 -1
  249. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  250. package/package.json +20 -20
  251. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts +0 -7
  252. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.d.ts.map +0 -1
  253. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/get-example-value.js +0 -28
  254. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts +0 -6
  255. package/dist/v2/blocks/request-block/helpers/get-parameter-example.d.ts.map +0 -1
  256. package/dist/v2/blocks/request-block/helpers/get-parameter-example.js +0 -12
  257. package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +0 -1
  258. package/dist/v2/features/app/components/ItemDecorator.vue.js +0 -138
  259. package/dist/v2/features/app/components/ItemDecorator.vue2.js +0 -4
  260. package/dist/v2/hooks/use-document-watcher.d.ts.map +0 -1
  261. package/dist/v2/hooks/use-sidebar-state.d.ts.map +0 -1
  262. package/dist/v2/hooks/use-sync-path.d.ts.map +0 -1
  263. package/dist/v2/hooks/use-sync-path.js +0 -51
  264. package/dist/v2/hooks/use-tabs.d.ts.map +0 -1
  265. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +0 -1
  266. package/dist/v2/hooks/use-workspace-selector.d.ts.map +0 -1
  267. package/dist/v2/plugins.d.ts +0 -44
  268. package/dist/v2/plugins.d.ts.map +0 -1
  269. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.d.ts +0 -0
  270. /package/dist/v2/{hooks → features/app/hooks}/use-document-watcher.js +0 -0
  271. /package/dist/v2/{hooks → features/app/hooks}/use-workspace-selector.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,171 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.17.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#7562](https://github.com/scalar/scalar/pull/7562): feat(components): remove headless ui from dropdown component
8
+
9
+ #### Updated Dependencies
10
+
11
+ - **@scalar/components@0.16.12**
12
+ - [#7562](https://github.com/scalar/scalar/pull/7562): feat(components): remove headless ui from dropdown component
13
+
14
+ - **@scalar/sidebar@0.7.2**
15
+ - [#7562](https://github.com/scalar/scalar/pull/7562): feat(components): remove headless ui from dropdown component
16
+
17
+ - **@scalar/use-codemirror@0.13.6**
18
+
19
+ ## 2.17.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [#7565](https://github.com/scalar/scalar/pull/7565): feat: support markdown on parameter tooltip
24
+
25
+ ### Patch Changes
26
+
27
+ - [#7580](https://github.com/scalar/scalar/pull/7580): feat: added default auth on client v2
28
+ - [#7578](https://github.com/scalar/scalar/pull/7578): fix: ensure get schema examples are cached via options
29
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
30
+ - [#7567](https://github.com/scalar/scalar/pull/7567): feat: add code samples to client v2
31
+
32
+ #### Updated Dependencies
33
+
34
+ - **@scalar/workspace-store@0.24.1**
35
+ - [#7580](https://github.com/scalar/scalar/pull/7580): feat: added default auth on client v2
36
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
37
+ - [#7567](https://github.com/scalar/scalar/pull/7567): feat: add code samples to client v2
38
+ - [#7568](https://github.com/scalar/scalar/pull/7568): fix: object merge replacing arrays
39
+
40
+ - **@scalar/components@0.16.11**
41
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
42
+
43
+ - **@scalar/helpers@0.2.4**
44
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
45
+ - [#7567](https://github.com/scalar/scalar/pull/7567): feat: add code samples to client v2
46
+
47
+ - **@scalar/icons@0.5.2**
48
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
49
+
50
+ - **@scalar/import@0.4.41**
51
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
52
+
53
+ - **@scalar/json-magic@0.8.8**
54
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
55
+
56
+ - **@scalar/oas-utils@0.6.11**
57
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
58
+
59
+ - **@scalar/object-utils@1.2.18**
60
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
61
+
62
+ - **@scalar/openapi-parser@0.23.9**
63
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
64
+
65
+ - **@scalar/sidebar@0.7.1**
66
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
67
+ - [#7576](https://github.com/scalar/scalar/pull/7576): fix: remove cjs file from index export
68
+
69
+ - **@scalar/use-codemirror@0.13.5**
70
+ - [#7581](https://github.com/scalar/scalar/pull/7581): fix: npm publish job
71
+
72
+ - **@scalar/snippetz@0.6.1**
73
+ - [#7567](https://github.com/scalar/scalar/pull/7567): feat: add code samples to client v2
74
+
75
+ - **@scalar/types@0.5.4**
76
+ - [#7567](https://github.com/scalar/scalar/pull/7567): feat: add code samples to client v2
77
+
78
+ - **@scalar/postman-to-openapi@0.3.52**
79
+
80
+ ## 2.16.0
81
+
82
+ ### Minor Changes
83
+
84
+ - [#7564](https://github.com/scalar/scalar/pull/7564): feat: restore cursor position after path/method update
85
+ - [#7528](https://github.com/scalar/scalar/pull/7528): feat: empty sidebar folders state
86
+ - [#7561](https://github.com/scalar/scalar/pull/7561): feat: add accept header by default on the operation paramters
87
+ - [#7549](https://github.com/scalar/scalar/pull/7549): feat: send request animation
88
+ - [#7572](https://github.com/scalar/scalar/pull/7572): feat: clear request and response state when switching operations or examples
89
+
90
+ ### Patch Changes
91
+
92
+ - [#7573](https://github.com/scalar/scalar/pull/7573): fix: ensure paths always start with a leading slash
93
+ - [#7563](https://github.com/scalar/scalar/pull/7563): fix: propagate client plugins to operation view
94
+ - [#7535](https://github.com/scalar/scalar/pull/7535): fix: display the parameter description on the tooltip
95
+
96
+ #### Updated Dependencies
97
+
98
+ - **@scalar/workspace-store@0.24.0**
99
+ - [#7564](https://github.com/scalar/scalar/pull/7564): feat: restore cursor position after path/method update
100
+ - [#7530](https://github.com/scalar/scalar/pull/7530): fix: handle operation level servers when adding a new operation
101
+ - [#7559](https://github.com/scalar/scalar/pull/7559): feat: set the content-type header when switching body content-type
102
+ - [#7549](https://github.com/scalar/scalar/pull/7549): feat: send request animation
103
+ - [#7575](https://github.com/scalar/scalar/pull/7575): feat: add support for object examples + hide body when empty
104
+
105
+ - **@scalar/sidebar@0.7.0**
106
+ - [#7528](https://github.com/scalar/scalar/pull/7528): feat: empty sidebar folders state
107
+
108
+ - **@scalar/icons@0.5.1**
109
+ - [#7542](https://github.com/scalar/scalar/pull/7542): fix: move `generate-icons` script outside of src folder
110
+
111
+ No need to include it in published packages
112
+
113
+ - [#7542](https://github.com/scalar/scalar/pull/7542): fix: use named instead of star exports
114
+
115
+ - **@scalar/helpers@0.2.3**
116
+ - [#7575](https://github.com/scalar/scalar/pull/7575): feat: add support for object examples + hide body when empty
117
+
118
+ - **@scalar/components@0.16.10**
119
+ - [#7531](https://github.com/scalar/scalar/pull/7531): feat(components): add discrete sidebar group buttons
120
+
121
+ - **@scalar/oas-utils@0.6.10**
122
+
123
+ - **@scalar/import@0.4.40**
124
+
125
+ - **@scalar/json-magic@0.8.7**
126
+
127
+ - **@scalar/object-utils@1.2.17**
128
+
129
+ - **@scalar/postman-to-openapi@0.3.51**
130
+
131
+ - **@scalar/use-codemirror@0.13.4**
132
+
133
+ - **@scalar/openapi-parser@0.23.8**
134
+
135
+ ## 2.15.1
136
+
137
+ ### Patch Changes
138
+
139
+ - [#7510](https://github.com/scalar/scalar/pull/7510) [`099237a`](https://github.com/scalar/scalar/commit/099237ad9cba4d29dcc5e742e39c3e42429a5817) Thanks [@DemonHa](https://github.com/DemonHa)! - fix: make sure the tabs does not get out of bound
140
+
141
+ - [#7532](https://github.com/scalar/scalar/pull/7532) [`2658415`](https://github.com/scalar/scalar/commit/2658415511787dd4554f6d6b47342bdf76d2cca8) Thanks [@DemonHa](https://github.com/DemonHa)! - fix: get the correct document using the navigation document name
142
+
143
+ - [#7534](https://github.com/scalar/scalar/pull/7534) [`2f3a5bf`](https://github.com/scalar/scalar/commit/2f3a5bf26a16bf0733a9eb8bf0f47e2db161414f) Thanks [@DemonHa](https://github.com/DemonHa)! - chore: remove dynamic imports
144
+
145
+ - [#7502](https://github.com/scalar/scalar/pull/7502) [`a06c824`](https://github.com/scalar/scalar/commit/a06c824653af58839d897e9495f7489d6b5d12b9) Thanks [@Smyrcu](https://github.com/Smyrcu)! - fix(api-client): URL encode path parameters
146
+
147
+ - Updated dependencies [[`099237a`](https://github.com/scalar/scalar/commit/099237ad9cba4d29dcc5e742e39c3e42429a5817), [`bb52d9a`](https://github.com/scalar/scalar/commit/bb52d9a21e53628270bab93c0f03b5731c9c97c6), [`bb52d9a`](https://github.com/scalar/scalar/commit/bb52d9a21e53628270bab93c0f03b5731c9c97c6)]:
148
+ - @scalar/workspace-store@0.23.1
149
+ - @scalar/types@0.5.3
150
+ - @scalar/snippetz@0.6.0
151
+ - @scalar/components@0.16.9
152
+ - @scalar/oas-utils@0.6.9
153
+ - @scalar/sidebar@0.6.1
154
+ - @scalar/openapi-parser@0.23.7
155
+ - @scalar/analytics-client@1.0.1
156
+ - @scalar/draggable@0.3.0
157
+ - @scalar/helpers@0.2.2
158
+ - @scalar/icons@0.5.0
159
+ - @scalar/import@0.4.39
160
+ - @scalar/json-magic@0.8.6
161
+ - @scalar/object-utils@1.2.16
162
+ - @scalar/openapi-types@0.5.3
163
+ - @scalar/postman-to-openapi@0.3.50
164
+ - @scalar/themes@0.13.26
165
+ - @scalar/use-codemirror@0.13.3
166
+ - @scalar/use-hooks@0.3.3
167
+ - @scalar/use-toasts@0.9.1
168
+
3
169
  ## 2.15.0
4
170
 
5
171
  ### Minor Changes
@@ -2,18 +2,18 @@ import { extractFilename as f } from "../libs/extractAttachmentFilename.js";
2
2
  import { computed as n, isRef as c } from "vue";
3
3
  import v from "whatwg-mimetype";
4
4
  function R(t) {
5
- const i = (a) => a instanceof Blob, e = n(() => c(t.data) ? t.data.value : t.data), u = n(() => c(t.headers) ? t.headers.value : t.headers), o = n(() => {
6
- const a = u.value.find((r) => r.name.toLowerCase() === "content-type")?.value ?? "";
5
+ const i = (a) => a instanceof Blob, e = n(() => c(t.data) ? t.data.value : t.data), u = n(() => c(t.headers) ? t.headers.value : t.headers), r = n(() => {
6
+ const a = u.value.find((o) => o.name.toLowerCase() === "content-type")?.value ?? "";
7
7
  return new v(a);
8
8
  }), l = n(() => {
9
- const a = u.value.find((r) => r.name.toLowerCase() === "content-disposition")?.value ?? "";
9
+ const a = u.value.find((o) => o.name.toLowerCase() === "content-disposition")?.value ?? "";
10
10
  return f(a);
11
- }), s = n(() => i(e.value) ? URL.createObjectURL(e.value) : typeof e.value == "string" ? URL.createObjectURL(new Blob([e.value], { type: o.value.toString() })) : e.value instanceof Object && Object.keys(e.value).length ? URL.createObjectURL(
11
+ }), s = n(() => i(e.value) ? URL.createObjectURL(e.value) : typeof e.value == "string" ? URL.createObjectURL(new Blob([e.value], { type: r.value.toString() })) : e.value instanceof Object && Object.keys(e.value).length ? URL.createObjectURL(
12
12
  new Blob([JSON.stringify(e.value)], {
13
- type: o.value.toString()
13
+ type: r.value.toString()
14
14
  })
15
15
  ) : "");
16
- return { mimeType: o, attachmentFilename: l, dataUrl: s };
16
+ return { mimeType: r, attachmentFilename: l, dataUrl: s };
17
17
  }
18
18
  export {
19
19
  R as useResponseBody
@@ -1,5 +1,6 @@
1
1
  /** Centralized list of all error messages */
2
2
  export declare const ERRORS: {
3
+ readonly BUILDING_REQUEST_FAILED: "An error occurred while building the request";
3
4
  readonly DEFAULT: "An unknown error has occurred.";
4
5
  readonly INVALID_URL: "The URL seems to be invalid. Try adding a valid URL.";
5
6
  readonly INVALID_HEADER: "There is an invalid header present, please double check your params.";
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/libs/errors.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,eAAO,MAAM,MAAM;;;;;;;;;CAST,CAAA;AAEV,qDAAqD;AACrD,eAAO,MAAM,cAAc,GAAI,GAAG,OAAO,EAAE,iBAAgB,MAAuB,KAAG,KAcpF,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,YAAY,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;AAE9E,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,WAiBjD,CAAA"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/libs/errors.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,eAAO,MAAM,MAAM;;;;;;;;;;CAUT,CAAA;AAEV,qDAAqD;AACrD,eAAO,MAAM,cAAc,GAAI,GAAG,OAAO,EAAE,iBAAgB,MAAuB,KAAG,KAcpF,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,YAAY,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;AAE9E,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,WAiBjD,CAAA"}
@@ -1,4 +1,5 @@
1
1
  const r = {
2
+ BUILDING_REQUEST_FAILED: "An error occurred while building the request",
2
3
  DEFAULT: "An unknown error has occurred.",
3
4
  INVALID_URL: "The URL seems to be invalid. Try adding a valid URL.",
4
5
  INVALID_HEADER: "There is an invalid header present, please double check your params.",
@@ -1 +1 @@
1
- {"version":3,"file":"create-request-operation.d.ts","sourceRoot":"","sources":["../../../src/libs/send-request/create-request-operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AAIxC,OAAO,EAAU,KAAK,aAAa,EAAkB,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAQhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAI9C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;AAEtD,uGAAuG;AACvG,KAAK,mBAAmB,GAAG,aAAa,CAAC;IACvC,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;AAEtD,0BAA0B;AAC1B,eAAO,MAAM,sBAAsB,GAAI,yIAWpC;IACD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,OAAO,EAAE,SAAS,CAAA;IAClB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/C,0BAA0B,CAAC,EAAE,SAAS,CAAC,4BAA4B,CAAC,CAAA;IACpE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,MAAM,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAA;IAChC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B,KAAG,aAAa,CAAC;IAChB,UAAU,EAAE,eAAe,CAAA;IAC3B,WAAW,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC/C,OAAO,EAAE,OAAO,CAAA;CACjB,CAmPA,CAAA"}
1
+ {"version":3,"file":"create-request-operation.d.ts","sourceRoot":"","sources":["../../../src/libs/send-request/create-request-operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AAIxC,OAAO,EAAU,KAAK,aAAa,EAAkB,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAQhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAI9C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;AAEtD,uGAAuG;AACvG,KAAK,mBAAmB,GAAG,aAAa,CAAC;IACvC,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,OAAO,EAAE,cAAc,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;AAEtD,0BAA0B;AAC1B,eAAO,MAAM,sBAAsB,GAAI,yIAWpC;IACD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,OAAO,EAAE,SAAS,CAAA;IAClB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/C,0BAA0B,CAAC,EAAE,SAAS,CAAC,4BAA4B,CAAC,CAAA;IACpE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,MAAM,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAA;IAChC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B,KAAG,aAAa,CAAC;IAChB,UAAU,EAAE,eAAe,CAAA;IAC3B,WAAW,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC/C,OAAO,EAAE,OAAO,CAAA;CACjB,CAqPA,CAAA"}
@@ -2,35 +2,41 @@ import { isDefined as N } from "@scalar/helpers/array/is-defined";
2
2
  import { httpStatusCodes as Y } from "@scalar/helpers/http/http-status-codes";
3
3
  import { mergeUrls as G } from "@scalar/helpers/url/merge-urls";
4
4
  import { shouldUseProxy as H, redirectToProxy as J } from "@scalar/oas-utils/helpers";
5
- import { isElectron as P } from "../electron.js";
6
- import { ERRORS as w, normalizeError as b } from "../errors.js";
5
+ import { isElectron as U } from "../electron.js";
6
+ import { ERRORS as b, normalizeError as w } from "../errors.js";
7
7
  import { normalizeHeaders as Z } from "../normalize-headers.js";
8
8
  import { createFetchBody as $ } from "./create-fetch-body.js";
9
9
  import { createFetchHeaders as M } from "./create-fetch-headers.js";
10
10
  import { createFetchQueryParams as ee } from "./create-fetch-query-params.js";
11
11
  import { decodeBuffer as te } from "./decode-buffer.js";
12
12
  import { setRequestCookies as oe, getCookieHeader as re } from "./set-request-cookies.js";
13
- import { replaceTemplateVariables as c } from "../string-template.js";
13
+ import { replaceTemplateVariables as d } from "../string-template.js";
14
14
  import { buildRequestSecurity as se } from "./build-request-security.js";
15
15
  const Ce = ({
16
- environment: U,
16
+ environment: P,
17
17
  example: s,
18
18
  globalCookies: q,
19
19
  proxyUrl: h,
20
20
  request: a,
21
21
  securitySchemes: v,
22
22
  selectedSecuritySchemeUids: D = [],
23
- server: k,
24
- status: d,
23
+ server: R,
24
+ status: u,
25
25
  pluginManager: l
26
26
  }) => {
27
27
  try {
28
- const o = U ?? {}, R = new AbortController(), C = s.parameters.path.reduce((t, e) => (e.enabled && (t[e.key] = c(e.value, o)), t), {}), _ = c(k?.url ?? "", o), f = c(c(a.path, o), C);
28
+ const o = P ?? {}, k = new AbortController(), C = s.parameters.path.reduce((t, e) => {
29
+ if (e.enabled) {
30
+ const i = d(e.value, o);
31
+ t[e.key] = encodeURIComponent(i);
32
+ }
33
+ return t;
34
+ }, {}), _ = d(R?.url ?? "", o), f = d(d(a.path, o), C);
29
35
  let r = _ || f;
30
36
  if (!r)
31
- throw w.URL_EMPTY;
32
- Object.entries(k?.variables ?? {}).forEach(([t, e]) => {
33
- r = c(r, {
37
+ throw b.URL_EMPTY;
38
+ Object.entries(R?.variables ?? {}).forEach(([t, e]) => {
39
+ r = d(r, {
34
40
  [t]: C[t] || e.default
35
41
  });
36
42
  });
@@ -41,12 +47,12 @@ const Ce = ({
41
47
  serverUrl: r,
42
48
  proxyUrl: h
43
49
  }), O = D.flat().map((t) => v[t]).filter(N), p = se(O, o), n = { ...Object.entries(p.headers).reduce(
44
- (t, [e, m]) => (t[e.toLowerCase()] = m, t),
50
+ (t, [e, i]) => (t[e.toLowerCase()] = i, t),
45
51
  {}
46
- ), ...B }, A = [...z, ...p.cookies], W = new URLSearchParams([...L, ...p.urlParams]);
47
- P() && n["user-agent"] && (n["X-Scalar-User-Agent"] = n["user-agent"]), r = G(r, f, W);
48
- const y = c(re(A, n.Cookie), o);
49
- y && (P() || H(h, r) ? (console.warn(
52
+ ), ...B }, A = [...z, ...p.cookies], I = new URLSearchParams([...L, ...p.urlParams]);
53
+ U() && n["user-agent"] && (n["X-Scalar-User-Agent"] = n["user-agent"]), r = G(r, f, I);
54
+ const y = d(re(A, n.Cookie), o);
55
+ y && (U() || H(h, r) ? (console.warn(
50
56
  "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."
51
57
  ), n["X-Scalar-Cookie"] = y) : (console.warn(
52
58
  `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:
@@ -55,7 +61,7 @@ const Ce = ({
55
61
  - The connection must be made over HTTPS.
56
62
  `
57
63
  ), n.Cookie = y));
58
- const x = J(h, r), S = new Request(x, {
64
+ const W = J(h, r), S = new Request(W, {
59
65
  method: a.method.toUpperCase(),
60
66
  body: F ?? null,
61
67
  headers: n
@@ -65,37 +71,37 @@ const Ce = ({
65
71
  {
66
72
  request: S,
67
73
  sendRequest: async () => {
68
- if (d?.emit("start"), l)
74
+ if (u?.emit("start"), l)
69
75
  try {
70
76
  await l.executeHook("onBeforeRequest", { request: S });
71
77
  } catch (e) {
72
- const m = new Error(w.ON_BEFORE_REQUEST_FAILED, { cause: e });
73
- return d?.emit("abort"), [b(m), null];
78
+ const i = new Error(b.ON_BEFORE_REQUEST_FAILED, { cause: e });
79
+ return u?.emit("abort"), [w(i), null];
74
80
  }
75
81
  const t = Date.now();
76
82
  try {
77
83
  const e = await fetch(S, {
78
- signal: R.signal
79
- }), m = e.headers.get("content-type")?.startsWith("text/event-stream");
80
- d?.emit("stop");
81
- const I = Date.now() - t, Q = e.clone(), g = Z(e.headers, H(h, r)), X = e.headers.get("content-type") ?? "text/plain;charset=UTF-8", T = await Q.arrayBuffer(), j = te(T, X), i = e.clone(), V = i.statusText || Y[i.status]?.name || "", K = [204, 205, 304].includes(i.status), u = new Response(K ? null : i.body, {
82
- status: i.status,
83
- statusText: V,
84
- headers: i.headers
84
+ signal: k.signal
85
+ }), i = e.headers.get("content-type")?.startsWith("text/event-stream");
86
+ u?.emit("stop");
87
+ const x = Date.now() - t, Q = e.clone(), g = Z(e.headers, H(h, r)), V = e.headers.get("content-type") ?? "text/plain;charset=UTF-8", T = await Q.arrayBuffer(), X = te(T, V), c = e.clone(), j = c.statusText || Y[c.status]?.name || "", K = [204, 205, 304].includes(c.status), m = new Response(K ? null : c.body, {
88
+ status: c.status,
89
+ statusText: j,
90
+ headers: c.headers
85
91
  });
86
- l && await l.executeHook("onResponseReceived", { response: u, operation: a });
87
- const E = "getSetCookie" in u.headers && typeof u.headers.getSetCookie == "function" ? u.headers.getSetCookie() : [];
88
- return m && e.body ? [
92
+ l && await l.executeHook("onResponseReceived", { response: m, operation: a });
93
+ const E = "getSetCookie" in m.headers && typeof m.headers.getSetCookie == "function" ? m.headers.getSetCookie() : [];
94
+ return i && e.body ? [
89
95
  null,
90
96
  {
91
97
  timestamp: Date.now(),
92
98
  request: s,
93
99
  response: {
94
- ...u,
100
+ ...m,
95
101
  headers: g,
96
102
  cookieHeaderKeys: E,
97
103
  reader: e.body?.getReader(),
98
- duration: I,
104
+ duration: x,
99
105
  method: a.method,
100
106
  path: f
101
107
  }
@@ -109,7 +115,7 @@ const Ce = ({
109
115
  ...e,
110
116
  headers: g,
111
117
  cookieHeaderKeys: E,
112
- data: j,
118
+ data: X,
113
119
  size: T.byteLength,
114
120
  duration: Date.now() - t,
115
121
  method: a.method,
@@ -119,14 +125,14 @@ const Ce = ({
119
125
  }
120
126
  ];
121
127
  } catch (e) {
122
- return d?.emit("abort"), [b(e, w.REQUEST_FAILED), null];
128
+ return u?.emit("abort"), [w(e, b.REQUEST_FAILED), null];
123
129
  }
124
130
  },
125
- controller: R
131
+ controller: k
126
132
  }
127
133
  ];
128
134
  } catch (o) {
129
- return console.error(o), d?.emit("abort"), [b(o), null];
135
+ return console.error(o), u?.emit("abort"), [w(o), null];
130
136
  }
131
137
  };
132
138
  export {