@scalar/api-client 2.39.4 → 2.41.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 (337) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
  4. package/dist/components/AddressBar/AddressBarHistory.vue.js.map +1 -1
  5. package/dist/components/AddressBar/AddressBarHistory.vue.script.js +2 -2
  6. package/dist/components/AddressBar/AddressBarHistory.vue.script.js.map +1 -1
  7. package/dist/hooks/useClientConfig.d.ts +12 -0
  8. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  9. package/dist/hooks/useClientConfig.js +14 -1
  10. package/dist/hooks/useClientConfig.js.map +1 -1
  11. package/dist/libs/index.d.ts +0 -1
  12. package/dist/libs/index.d.ts.map +1 -1
  13. package/dist/libs/index.js +1 -2
  14. package/dist/style.css +207 -248
  15. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +14 -10
  16. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  18. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +57 -35
  19. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  20. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -5
  21. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  22. package/dist/v2/blocks/operation-block/helpers/send-request.js +18 -33
  23. package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
  24. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -1
  25. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +1 -1
  26. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js.map +1 -1
  27. package/dist/v2/blocks/operation-block/index.d.ts +0 -3
  28. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  29. package/dist/v2/blocks/operation-block/index.js +1 -4
  30. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +1 -1
  31. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  32. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  33. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
  34. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +3 -1
  35. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
  36. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +4 -2
  37. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  38. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +3 -2
  39. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js.map +1 -1
  40. package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +1 -1
  41. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +1 -1
  42. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
  43. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.js.map +1 -1
  44. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +7 -2
  45. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  46. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +4 -3
  47. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js.map +1 -1
  48. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  49. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +2 -3
  50. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js.map +1 -1
  51. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts +3 -1
  52. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  53. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +5 -8
  54. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js.map +1 -1
  55. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +1 -1
  56. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
  57. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.js.map +1 -1
  58. package/dist/v2/blocks/operation-code-sample/index.d.ts +0 -1
  59. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  60. package/dist/v2/blocks/operation-code-sample/index.js +2 -3
  61. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +7 -9
  62. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  63. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  64. package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
  65. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +49 -42
  66. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  67. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  68. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  69. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  70. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +2 -3
  71. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  72. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  73. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js.map +1 -1
  74. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js +1 -0
  75. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.script.js.map +1 -1
  76. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  77. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  78. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +1 -1
  79. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
  80. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +1 -1
  81. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts +1 -1
  82. package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts.map +1 -1
  83. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +2 -1
  84. package/dist/v2/blocks/request-block/helpers/is-param-disabled.js.map +1 -1
  85. package/dist/v2/blocks/response-block/helpers/get-content-length.d.ts.map +1 -1
  86. package/dist/v2/blocks/response-block/helpers/get-content-length.js +2 -2
  87. package/dist/v2/blocks/response-block/helpers/get-content-length.js.map +1 -1
  88. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  89. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  90. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
  91. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +76 -25
  92. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
  93. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  94. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  95. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  96. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +2 -2
  97. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  98. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -1
  99. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  100. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js.map +1 -1
  101. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js +1 -1
  102. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  103. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +1 -1
  104. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  105. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  106. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +8 -4
  107. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  108. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -1
  109. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  110. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js.map +1 -1
  111. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.script.js.map +1 -1
  112. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +1 -1
  113. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  114. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  115. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  116. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +1 -1
  117. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  118. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +1 -1
  119. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  120. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +6 -2
  122. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  123. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +0 -3
  124. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  125. package/dist/v2/blocks/scalar-auth-selector-block/index.js +1 -3
  126. package/dist/v2/components/code-input/CodeInput.vue.d.ts +8 -6
  127. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  128. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  129. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  130. package/dist/v2/components/code-input/CodeInput.vue.script.js +11 -9
  131. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  132. package/dist/v2/constants.js +1 -1
  133. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  134. package/dist/v2/features/app/App.vue.js.map +1 -1
  135. package/dist/v2/features/app/App.vue.script.js +1 -5
  136. package/dist/v2/features/app/App.vue.script.js.map +1 -1
  137. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  138. package/dist/v2/features/app/app-events.js +1 -1
  139. package/dist/v2/features/app/app-events.js.map +1 -1
  140. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  141. package/dist/v2/features/app/app-state.js +2 -2
  142. package/dist/v2/features/app/app-state.js.map +1 -1
  143. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  144. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  145. package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
  146. package/dist/v2/features/app/components/AppSidebar.vue.script.js +1 -1
  147. package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
  148. package/dist/v2/features/app/helpers/routes.d.ts +0 -3
  149. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  150. package/dist/v2/features/app/helpers/routes.js +1 -1
  151. package/dist/v2/features/app/helpers/routes.js.map +1 -1
  152. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  153. package/dist/v2/features/collection/DocumentCollection.vue.js.map +1 -1
  154. package/dist/v2/features/collection/DocumentCollection.vue.script.js +30 -52
  155. package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
  156. package/dist/v2/features/collection/OperationCollection.vue.script.js +0 -1
  157. package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
  158. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +0 -1
  159. package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
  160. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  161. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  162. package/dist/v2/features/collection/components/Authentication.vue.js.map +1 -1
  163. package/dist/v2/features/collection/components/Authentication.vue.script.js +6 -8
  164. package/dist/v2/features/collection/components/Authentication.vue.script.js.map +1 -1
  165. package/dist/v2/features/collection/components/Cookies.vue.script.js +0 -1
  166. package/dist/v2/features/collection/components/Cookies.vue.script.js.map +1 -1
  167. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +0 -1
  168. package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +1 -1
  169. package/dist/v2/features/collection/components/Environment.vue.script.js +0 -1
  170. package/dist/v2/features/collection/components/Environment.vue.script.js.map +1 -1
  171. package/dist/v2/features/collection/components/Overview.vue.script.js +0 -1
  172. package/dist/v2/features/collection/components/Overview.vue.script.js.map +1 -1
  173. package/dist/v2/features/collection/components/Servers.vue.script.js +0 -1
  174. package/dist/v2/features/collection/components/Servers.vue.script.js.map +1 -1
  175. package/dist/v2/features/collection/components/Settings.vue.js.map +1 -1
  176. package/dist/v2/features/collection/components/Settings.vue.script.js +2 -3
  177. package/dist/v2/features/collection/components/Settings.vue.script.js.map +1 -1
  178. package/dist/v2/features/editor/hooks/use-three-way-merge-editor.js +1 -1
  179. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
  180. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
  181. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +1 -1
  182. package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
  183. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  184. package/dist/v2/features/modal/Modal.vue.js.map +1 -1
  185. package/dist/v2/features/modal/Modal.vue.script.js +4 -9
  186. package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
  187. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  188. package/dist/v2/features/modal/helpers/create-api-client-modal.js +1 -17
  189. package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
  190. package/dist/v2/features/modal/helpers/map-hidden-clients-config.js +1 -1
  191. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  192. package/dist/v2/features/operation/Operation.vue.js.map +1 -1
  193. package/dist/v2/features/operation/Operation.vue.script.js +51 -84
  194. package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
  195. package/dist/v2/features/operation/index.d.ts +0 -4
  196. package/dist/v2/features/operation/index.d.ts.map +1 -1
  197. package/dist/v2/features/operation/index.js +1 -5
  198. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  199. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js.map +1 -1
  200. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js +11 -1
  201. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.script.js.map +1 -1
  202. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  203. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  204. package/dist/views/Request/RequestSection/RequestTable.vue.js.map +1 -1
  205. package/dist/views/Request/RequestSection/RequestTable.vue.script.js +1 -1
  206. package/dist/views/Request/RequestSection/RequestTable.vue.script.js.map +1 -1
  207. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.script.js +1 -1
  208. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  209. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js.map +1 -1
  210. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js +2 -2
  211. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.script.js.map +1 -1
  212. package/dist/views/Request/libs/oauth2.js +1 -1
  213. package/dist/views/Request/libs/oauth2.js.map +1 -1
  214. package/package.json +24 -30
  215. package/dist/libs/formatters.d.ts +0 -12
  216. package/dist/libs/formatters.d.ts.map +0 -1
  217. package/dist/libs/formatters.js +0 -36
  218. package/dist/libs/formatters.js.map +0 -1
  219. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts +0 -6
  220. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.d.ts.map +0 -1
  221. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js +0 -58
  222. package/dist/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.js.map +0 -1
  223. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts +0 -12
  224. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +0 -1
  225. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +0 -65
  226. package/dist/v2/blocks/operation-block/helpers/build-request-body.js.map +0 -1
  227. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +0 -31
  228. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +0 -1
  229. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +0 -55
  230. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js.map +0 -1
  231. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts +0 -27
  232. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +0 -1
  233. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +0 -159
  234. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js.map +0 -1
  235. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +0 -25
  236. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +0 -1
  237. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +0 -53
  238. package/dist/v2/blocks/operation-block/helpers/build-request-security.js.map +0 -1
  239. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +0 -46
  240. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +0 -1
  241. package/dist/v2/blocks/operation-block/helpers/build-request.js +0 -102
  242. package/dist/v2/blocks/operation-block/helpers/build-request.js.map +0 -1
  243. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +0 -4
  244. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +0 -1
  245. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +0 -41
  246. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js.map +0 -1
  247. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +0 -14
  248. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +0 -1
  249. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +0 -20
  250. package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js.map +0 -1
  251. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts +0 -8
  252. package/dist/v2/blocks/operation-block/helpers/get-delimiter.d.ts.map +0 -1
  253. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +0 -9
  254. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +0 -1
  255. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +0 -17
  256. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js.map +0 -1
  257. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +0 -10
  258. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +0 -1
  259. package/dist/v2/blocks/operation-block/helpers/get-example.js +0 -41
  260. package/dist/v2/blocks/operation-block/helpers/get-example.js.map +0 -1
  261. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +0 -26
  262. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +0 -1
  263. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +0 -32
  264. package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js.map +0 -1
  265. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +0 -10
  266. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +0 -1
  267. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +0 -15
  268. package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js.map +0 -1
  269. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +0 -3
  270. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +0 -1
  271. package/dist/v2/blocks/operation-block/helpers/get-server-url.js +0 -18
  272. package/dist/v2/blocks/operation-block/helpers/get-server-url.js.map +0 -1
  273. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts +0 -96
  274. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.d.ts.map +0 -1
  275. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js +0 -160
  276. package/dist/v2/blocks/operation-block/helpers/serialize-parameter.js.map +0 -1
  277. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts +0 -40
  278. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +0 -1
  279. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +0 -437
  280. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js.map +0 -1
  281. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts +0 -6
  282. package/dist/v2/blocks/request-block/helpers/get-request-body-example.d.ts.map +0 -1
  283. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js +0 -25
  284. package/dist/v2/blocks/request-block/helpers/get-request-body-example.js.map +0 -1
  285. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +0 -141
  286. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js.map +0 -1
  287. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts +0 -4
  288. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.d.ts.map +0 -1
  289. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js +0 -10
  290. package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-auth-optional.js.map +0 -1
  291. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +0 -9
  292. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +0 -1
  293. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +0 -27
  294. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js.map +0 -1
  295. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +0 -25
  296. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +0 -1
  297. package/dist/v2/components/callout/Callout.vue.js +0 -9
  298. package/dist/v2/components/callout/Callout.vue.js.map +0 -1
  299. package/dist/v2/components/callout/Callout.vue.script.js +0 -35
  300. package/dist/v2/components/callout/Callout.vue.script.js.map +0 -1
  301. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts +0 -18
  302. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts.map +0 -1
  303. package/dist/v2/features/modal/helpers/restore-workspace-state.js +0 -51
  304. package/dist/v2/features/modal/helpers/restore-workspace-state.js.map +0 -1
  305. package/dist/v2/features/operation/helpers/combine-params.d.ts +0 -4
  306. package/dist/v2/features/operation/helpers/combine-params.d.ts.map +0 -1
  307. package/dist/v2/features/operation/helpers/combine-params.js +0 -20
  308. package/dist/v2/features/operation/helpers/combine-params.js.map +0 -1
  309. package/dist/v2/features/operation/helpers/get-operation-header.d.ts +0 -17
  310. package/dist/v2/features/operation/helpers/get-operation-header.d.ts.map +0 -1
  311. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +0 -12
  312. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +0 -1
  313. package/dist/v2/features/operation/helpers/get-security-requirements.js +0 -17
  314. package/dist/v2/features/operation/helpers/get-security-requirements.js.map +0 -1
  315. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +0 -15
  316. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +0 -1
  317. package/dist/v2/features/operation/helpers/get-selected-security.js +0 -41
  318. package/dist/v2/features/operation/helpers/get-selected-security.js.map +0 -1
  319. package/dist/v2/features/operation/helpers/get-selected-server.d.ts +0 -13
  320. package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +0 -1
  321. package/dist/v2/features/operation/helpers/get-selected-server.js +0 -21
  322. package/dist/v2/features/operation/helpers/get-selected-server.js.map +0 -1
  323. package/dist/v2/helpers/get-active-environment.d.ts +0 -5
  324. package/dist/v2/helpers/get-active-environment.d.ts.map +0 -1
  325. package/dist/v2/helpers/get-active-environment.js +0 -19
  326. package/dist/v2/helpers/get-active-environment.js.map +0 -1
  327. package/dist/v2/helpers/get-active-proxy-url.d.ts +0 -18
  328. package/dist/v2/helpers/get-active-proxy-url.d.ts.map +0 -1
  329. package/dist/v2/helpers/get-active-proxy-url.js +0 -26
  330. package/dist/v2/helpers/get-active-proxy-url.js.map +0 -1
  331. package/dist/v2/helpers/get-servers.d.ts +0 -23
  332. package/dist/v2/helpers/get-servers.d.ts.map +0 -1
  333. package/dist/v2/helpers/get-servers.js +0 -106
  334. package/dist/v2/helpers/get-servers.js.map +0 -1
  335. package/dist/v2/helpers/index.d.ts +0 -3
  336. package/dist/v2/helpers/index.d.ts.map +0 -1
  337. package/dist/v2/helpers/index.js +0 -3
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.39.4",
21
+ "version": "2.41.0",
22
22
  "engines": {
23
23
  "node": ">=22"
24
24
  },
@@ -271,11 +271,6 @@
271
271
  "types": "./dist/v2/features/settings/index.d.ts",
272
272
  "default": "./dist/v2/features/settings/index.js"
273
273
  },
274
- "./v2/helpers": {
275
- "import": "./dist/v2/helpers/index.js",
276
- "types": "./dist/v2/helpers/index.d.ts",
277
- "default": "./dist/v2/helpers/index.js"
278
- },
279
274
  "./views/Components/CodeSnippet": {
280
275
  "import": "./dist/views/Components/CodeSnippet/index.js",
281
276
  "types": "./dist/views/Components/CodeSnippet/index.d.ts",
@@ -325,10 +320,10 @@
325
320
  "@headlessui/tailwindcss": "^0.2.2",
326
321
  "@headlessui/vue": "1.7.23",
327
322
  "@scalar/typebox": "^0.1.3",
328
- "@types/har-format": "^1.2.15",
323
+ "@types/har-format": "^1.2.16",
329
324
  "@vueuse/core": "13.9.0",
330
325
  "@vueuse/integrations": "13.9.0",
331
- "focus-trap": "^7",
326
+ "focus-trap": "^7.8.0",
332
327
  "fuse.js": "^7.1.0",
333
328
  "js-base64": "^3.7.8",
334
329
  "microdiff": "^1.5.0",
@@ -336,35 +331,34 @@
336
331
  "monaco-yaml": "5.2.3",
337
332
  "nanoid": "^5.1.6",
338
333
  "posthog-js": "1.363.2",
339
- "pretty-bytes": "^7.1.0",
340
334
  "pretty-ms": "^9.3.0",
341
335
  "radix-vue": "^1.9.17",
342
- "shell-quote": "^1.8.1",
336
+ "shell-quote": "^1.8.3",
343
337
  "type-fest": "^5.3.1",
344
338
  "vite-plugin-monaco-editor": "^1.1.0",
345
- "vue": "^3.5.26",
339
+ "vue": "^3.5.30",
346
340
  "vue-router": "4.6.2",
347
341
  "whatwg-mimetype": "4.0.0",
348
342
  "yaml": "^2.8.0",
349
343
  "zod": "^4.3.5",
350
- "@scalar/components": "0.21.2",
351
- "@scalar/helpers": "0.4.2",
344
+ "@scalar/components": "0.21.3",
352
345
  "@scalar/draggable": "0.4.1",
353
- "@scalar/icons": "0.7.1",
354
- "@scalar/import": "0.5.3",
355
- "@scalar/json-magic": "0.12.4",
356
- "@scalar/oas-utils": "0.10.14",
357
- "@scalar/object-utils": "1.3.3",
358
- "@scalar/openapi-types": "0.6.1",
359
- "@scalar/postman-to-openapi": "0.6.0",
360
- "@scalar/sidebar": "0.8.16",
361
- "@scalar/snippetz": "0.7.7",
362
- "@scalar/types": "0.7.5",
363
- "@scalar/themes": "0.15.1",
364
- "@scalar/use-codemirror": "0.14.10",
365
- "@scalar/use-hooks": "0.4.1",
346
+ "@scalar/helpers": "0.4.3",
347
+ "@scalar/icons": "0.7.2",
348
+ "@scalar/import": "0.5.4",
349
+ "@scalar/oas-utils": "0.10.16",
350
+ "@scalar/json-magic": "0.12.5",
351
+ "@scalar/object-utils": "1.3.4",
352
+ "@scalar/openapi-types": "0.7.0",
353
+ "@scalar/postman-to-openapi": "0.6.1",
354
+ "@scalar/sidebar": "0.8.18",
355
+ "@scalar/snippetz": "0.7.8",
356
+ "@scalar/themes": "0.15.2",
357
+ "@scalar/types": "0.7.6",
358
+ "@scalar/use-codemirror": "0.14.11",
359
+ "@scalar/use-hooks": "0.4.2",
366
360
  "@scalar/use-toasts": "0.10.1",
367
- "@scalar/workspace-store": "0.42.0"
361
+ "@scalar/workspace-store": "0.43.1"
368
362
  },
369
363
  "devDependencies": {
370
364
  "@tailwindcss/vite": "^4.2.0",
@@ -373,14 +367,14 @@
373
367
  "@vitejs/plugin-vue": "^6.0.3",
374
368
  "@vue/test-utils": "2.4.6",
375
369
  "fake-indexeddb": "6.2.3",
376
- "fastify": "^5.3.3",
370
+ "fastify": "^5.8.1",
377
371
  "jsdom": "27.4.0",
378
372
  "tailwindcss": "^4.1.18",
379
373
  "vite": "8.0.0",
380
374
  "vite-svg-loader": "5.1.1",
381
375
  "vitest": "4.1.0",
382
- "@scalar/galaxy": "0.6.1",
383
- "@scalar/pre-post-request-scripts": "0.3.16"
376
+ "@scalar/galaxy": "0.6.2",
377
+ "@scalar/pre-post-request-scripts": "0.3.18"
384
378
  },
385
379
  "scripts": {
386
380
  "build": "vite build && vue-tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
@@ -1,12 +0,0 @@
1
- /**
2
- * Formats bytes to a more readable format
3
- *
4
- * @see https://stackoverflow.com/a/18650828/1624255
5
- */
6
- export declare const formatBytes: (bytes: number, decimals?: number) => string;
7
- /**
8
- * Formats milliseconds to seconds and appends an "s" if more than one second
9
- * else returns ms appended to the number
10
- */
11
- export declare const formatMs: (ms: number, decimals?: number) => string;
12
- //# sourceMappingURL=formatters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/libs/formatters.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,iBAAY,WAWtD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,IAAI,MAAM,EAAE,iBAAY,KAAG,MAKnD,CAAA"}
@@ -1,36 +0,0 @@
1
- //#region src/libs/formatters.ts
2
- /**
3
- * Formats bytes to a more readable format
4
- *
5
- * @see https://stackoverflow.com/a/18650828/1624255
6
- */
7
- var formatBytes = (bytes, decimals = 2) => {
8
- if (!+bytes) return "0 Bytes";
9
- const k = 1024;
10
- const dm = decimals < 0 ? 0 : decimals;
11
- const sizes = [
12
- "B",
13
- "KiB",
14
- "MiB",
15
- "GiB",
16
- "TiB",
17
- "PiB",
18
- "EiB",
19
- "ZiB",
20
- "YiB"
21
- ];
22
- const i = Math.floor(Math.log(bytes) / Math.log(k));
23
- return `${Number.parseFloat((bytes / Math.pow(k, i)).toFixed(dm))}${sizes[i]}`;
24
- };
25
- /**
26
- * Formats milliseconds to seconds and appends an "s" if more than one second
27
- * else returns ms appended to the number
28
- */
29
- var formatMs = (ms, decimals = 2) => {
30
- if (ms > 1e3) return (ms / 1e3).toFixed(decimals) + "s";
31
- return ms + "ms";
32
- };
33
- //#endregion
34
- export { formatBytes, formatMs };
35
-
36
- //# sourceMappingURL=formatters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters.js","names":[],"sources":["../../src/libs/formatters.ts"],"sourcesContent":["/**\n * Formats bytes to a more readable format\n *\n * @see https://stackoverflow.com/a/18650828/1624255\n */\nexport const formatBytes = (bytes: number, decimals = 2) => {\n if (!+bytes) {\n return '0 Bytes'\n }\n\n const k = 1024\n const dm = decimals < 0 ? 0 : decimals\n const sizes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n const i = Math.floor(Math.log(bytes) / Math.log(k))\n\n return `${Number.parseFloat((bytes / Math.pow(k, i)).toFixed(dm))}${sizes[i]}`\n}\n\n/**\n * Formats milliseconds to seconds and appends an \"s\" if more than one second\n * else returns ms appended to the number\n */\nexport const formatMs = (ms: number, decimals = 2): string => {\n if (ms > 1000) {\n return (ms / 1000).toFixed(decimals) + 's'\n }\n return ms + 'ms'\n}\n"],"mappings":";;;;;;AAKA,IAAa,eAAe,OAAe,WAAW,MAAM;AAC1D,KAAI,CAAC,CAAC,MACJ,QAAO;CAGT,MAAM,IAAI;CACV,MAAM,KAAK,WAAW,IAAI,IAAI;CAC9B,MAAM,QAAQ;EAAC;EAAK;EAAO;EAAO;EAAO;EAAO;EAAO;EAAO;EAAO;EAAM;CAC3E,MAAM,IAAI,KAAK,MAAM,KAAK,IAAI,MAAM,GAAG,KAAK,IAAI,EAAE,CAAC;AAEnD,QAAO,GAAG,OAAO,YAAY,QAAQ,KAAK,IAAI,GAAG,EAAE,EAAE,QAAQ,GAAG,CAAC,GAAG,MAAM;;;;;;AAO5E,IAAa,YAAY,IAAY,WAAW,MAAc;AAC5D,KAAI,KAAK,IACP,SAAQ,KAAK,KAAM,QAAQ,SAAS,GAAG;AAEzC,QAAO,KAAK"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Decodes reserved character percent-encodings only for query keys marked with
3
- * OpenAPI's `allowReserved: true`.
4
- */
5
- export declare const applyAllowReservedToUrl: (url: string, allowReservedQueryParameters: Set<string>) => string;
6
- //# sourceMappingURL=apply-allow-reserved-to-url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-allow-reserved-to-url.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.ts"],"names":[],"mappings":"AAsCA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,KAAK,MAAM,EAAE,8BAA8B,GAAG,CAAC,MAAM,CAAC,KAAG,MAwChG,CAAA"}
@@ -1,58 +0,0 @@
1
- //#region src/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.ts
2
- /**
3
- * Reserved characters we can safely decode in query values when OpenAPI
4
- * `allowReserved` is enabled.
5
- *
6
- * We intentionally keep percent-encodings for characters that can break query
7
- * parsing (`#`, `&`, `=`, `?`, `[`, `]`) or change x-www-form-urlencoded
8
- * semantics (`+`).
9
- *
10
- * @see https://spec.openapis.org/oas/v3.1.0.html#fixed-fields-10
11
- */
12
- var DECODABLE_RESERVED_CHARACTERS_BY_PERCENT_ENCODING = {
13
- "21": "!",
14
- "24": "$",
15
- "27": "'",
16
- "28": "(",
17
- "29": ")",
18
- "2A": "*",
19
- "2C": ",",
20
- "2F": "/",
21
- "3A": ":",
22
- "3B": ";",
23
- "40": "@"
24
- };
25
- var decodeReservedCharacters = (value) => value.replace(/%([0-9A-Fa-f]{2})/g, (match, code) => DECODABLE_RESERVED_CHARACTERS_BY_PERCENT_ENCODING[code.toUpperCase()] ?? match);
26
- var decodeQueryKey = (key) => {
27
- try {
28
- return decodeURIComponent(key.replaceAll("+", "%20"));
29
- } catch {
30
- return key;
31
- }
32
- };
33
- /**
34
- * Decodes reserved character percent-encodings only for query keys marked with
35
- * OpenAPI's `allowReserved: true`.
36
- */
37
- var applyAllowReservedToUrl = (url, allowReservedQueryParameters) => {
38
- if (allowReservedQueryParameters.size === 0) return url;
39
- const queryStart = url.indexOf("?");
40
- if (queryStart === -1) return url;
41
- const hashStart = url.indexOf("#", queryStart);
42
- const urlPrefix = url.slice(0, queryStart + 1);
43
- const query = hashStart === -1 ? url.slice(queryStart + 1) : url.slice(queryStart + 1, hashStart);
44
- const hash = hashStart === -1 ? "" : url.slice(hashStart);
45
- if (!query) return url;
46
- return `${urlPrefix}${query.split("&").map((segment) => {
47
- if (!segment) return segment;
48
- const equalsIndex = segment.indexOf("=");
49
- const rawKey = equalsIndex === -1 ? segment : segment.slice(0, equalsIndex);
50
- const key = decodeQueryKey(rawKey);
51
- if (!allowReservedQueryParameters.has(key) || equalsIndex === -1) return segment;
52
- return `${rawKey}=${decodeReservedCharacters(segment.slice(equalsIndex + 1))}`;
53
- }).join("&")}${hash}`;
54
- };
55
- //#endregion
56
- export { applyAllowReservedToUrl };
57
-
58
- //# sourceMappingURL=apply-allow-reserved-to-url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apply-allow-reserved-to-url.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/apply-allow-reserved-to-url.ts"],"sourcesContent":["/**\n * Reserved characters we can safely decode in query values when OpenAPI\n * `allowReserved` is enabled.\n *\n * We intentionally keep percent-encodings for characters that can break query\n * parsing (`#`, `&`, `=`, `?`, `[`, `]`) or change x-www-form-urlencoded\n * semantics (`+`).\n *\n * @see https://spec.openapis.org/oas/v3.1.0.html#fixed-fields-10\n */\nconst DECODABLE_RESERVED_CHARACTERS_BY_PERCENT_ENCODING: Record<string, string> = {\n '21': '!',\n '24': '$',\n '27': \"'\",\n '28': '(',\n '29': ')',\n '2A': '*',\n '2C': ',',\n '2F': '/',\n '3A': ':',\n '3B': ';',\n '40': '@',\n}\n\nconst decodeReservedCharacters = (value: string): string =>\n value.replace(\n /%([0-9A-Fa-f]{2})/g,\n (match, code: string) => DECODABLE_RESERVED_CHARACTERS_BY_PERCENT_ENCODING[code.toUpperCase()] ?? match,\n )\n\nconst decodeQueryKey = (key: string): string => {\n try {\n return decodeURIComponent(key.replaceAll('+', '%20'))\n } catch {\n return key\n }\n}\n\n/**\n * Decodes reserved character percent-encodings only for query keys marked with\n * OpenAPI's `allowReserved: true`.\n */\nexport const applyAllowReservedToUrl = (url: string, allowReservedQueryParameters: Set<string>): string => {\n if (allowReservedQueryParameters.size === 0) {\n return url\n }\n\n const queryStart = url.indexOf('?')\n if (queryStart === -1) {\n return url\n }\n\n const hashStart = url.indexOf('#', queryStart)\n const urlPrefix = url.slice(0, queryStart + 1)\n const query = hashStart === -1 ? url.slice(queryStart + 1) : url.slice(queryStart + 1, hashStart)\n const hash = hashStart === -1 ? '' : url.slice(hashStart)\n\n if (!query) {\n return url\n }\n\n const decodedQuery = query\n .split('&')\n .map((segment) => {\n if (!segment) {\n return segment\n }\n\n const equalsIndex = segment.indexOf('=')\n const rawKey = equalsIndex === -1 ? segment : segment.slice(0, equalsIndex)\n const key = decodeQueryKey(rawKey)\n\n if (!allowReservedQueryParameters.has(key) || equalsIndex === -1) {\n return segment\n }\n\n const rawValue = segment.slice(equalsIndex + 1)\n return `${rawKey}=${decodeReservedCharacters(rawValue)}`\n })\n .join('&')\n\n return `${urlPrefix}${decodedQuery}${hash}`\n}\n"],"mappings":";;;;;;;;;;;AAUA,IAAM,oDAA4E;CAChF,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACP;AAED,IAAM,4BAA4B,UAChC,MAAM,QACJ,uBACC,OAAO,SAAiB,kDAAkD,KAAK,aAAa,KAAK,MACnG;AAEH,IAAM,kBAAkB,QAAwB;AAC9C,KAAI;AACF,SAAO,mBAAmB,IAAI,WAAW,KAAK,MAAM,CAAC;SAC/C;AACN,SAAO;;;;;;;AAQX,IAAa,2BAA2B,KAAa,iCAAsD;AACzG,KAAI,6BAA6B,SAAS,EACxC,QAAO;CAGT,MAAM,aAAa,IAAI,QAAQ,IAAI;AACnC,KAAI,eAAe,GACjB,QAAO;CAGT,MAAM,YAAY,IAAI,QAAQ,KAAK,WAAW;CAC9C,MAAM,YAAY,IAAI,MAAM,GAAG,aAAa,EAAE;CAC9C,MAAM,QAAQ,cAAc,KAAK,IAAI,MAAM,aAAa,EAAE,GAAG,IAAI,MAAM,aAAa,GAAG,UAAU;CACjG,MAAM,OAAO,cAAc,KAAK,KAAK,IAAI,MAAM,UAAU;AAEzD,KAAI,CAAC,MACH,QAAO;AAuBT,QAAO,GAAG,YApBW,MAClB,MAAM,IAAI,CACV,KAAK,YAAY;AAChB,MAAI,CAAC,QACH,QAAO;EAGT,MAAM,cAAc,QAAQ,QAAQ,IAAI;EACxC,MAAM,SAAS,gBAAgB,KAAK,UAAU,QAAQ,MAAM,GAAG,YAAY;EAC3E,MAAM,MAAM,eAAe,OAAO;AAElC,MAAI,CAAC,6BAA6B,IAAI,IAAI,IAAI,gBAAgB,GAC5D,QAAO;AAIT,SAAO,GAAG,OAAO,GAAG,yBADH,QAAQ,MAAM,cAAc,EAAE,CACO;GACtD,CACD,KAAK,IAAI,GAEyB"}
@@ -1,12 +0,0 @@
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,
10
- /** Selected anyOf/oneOf request-body variants keyed by schema path */
11
- requestBodyCompositionSelection?: Record<string, number>) => BodyInit | null;
12
- //# sourceMappingURL=build-request-body.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-request-body.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-body.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAyBjG;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,iBAAiB,GAAG,SAAS;AAC1C,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qCAAqC;AACrC,mBAAsB;AACtB,sEAAsE;AACtE,kCAAkC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACvD,QAAQ,GAAG,IAyGb,CAAA"}
@@ -1,65 +0,0 @@
1
- import { getSelectedBodyContentType } from "./get-selected-body-content-type.js";
2
- import { getExampleFromBody } from "../../request-block/helpers/get-request-body-example.js";
3
- import { replaceEnvVariables } from "@scalar/helpers/regex/replace-variables";
4
- import { unpackProxyObject } from "@scalar/workspace-store/helpers/unpack-proxy";
5
- //#region src/v2/blocks/operation-block/helpers/build-request-body.ts
6
- var getMultipartEncodingContentType = (requestBody, bodyContentType, fieldName, replacedFieldName) => requestBody.content[bodyContentType]?.encoding?.[fieldName]?.contentType ?? requestBody.content[bodyContentType]?.encoding?.[replacedFieldName]?.contentType;
7
- var serializeMultipartValue = (value, env) => {
8
- if (typeof value === "string") return replaceEnvVariables(value, env);
9
- return replaceEnvVariables(typeof value === "object" && value !== null ? JSON.stringify(unpackProxyObject(value)) : String(value), env);
10
- };
11
- /**
12
- * Create the fetch request body
13
- */
14
- var buildRequestBody = (requestBody, env = {}, exampleKey = "default", requestBodyCompositionSelection) => {
15
- if (!requestBody) return null;
16
- /** Selected content type for the body from the dropdown, stored as x-scalar-selected-content-type */
17
- const bodyContentType = getSelectedBodyContentType(requestBody, exampleKey);
18
- if (!bodyContentType) return null;
19
- /** An example value or generated example from the schema */
20
- const example = getExampleFromBody(requestBody, bodyContentType, exampleKey, requestBodyCompositionSelection);
21
- if (!example) return null;
22
- if ((bodyContentType === "multipart/form-data" || bodyContentType === "application/x-www-form-urlencoded") && Array.isArray(example.value)) {
23
- const exampleValue = example.value.filter((item) => !item.isDisabled);
24
- const form = bodyContentType === "multipart/form-data" ? new FormData() : new URLSearchParams();
25
- exampleValue.forEach(({ name, value }) => {
26
- if (!name) return;
27
- const replacedName = replaceEnvVariables(name, env);
28
- const partContentType = form instanceof FormData ? getMultipartEncodingContentType(requestBody, bodyContentType, name, replacedName) : void 0;
29
- if (value instanceof File && form instanceof FormData) {
30
- /**
31
- * We need to unwrap the proxies to get the file name due to the
32
- * "this" context in the proxy causing an illegal invocation error
33
- */
34
- const unwrappedValue = unpackProxyObject(value);
35
- const encodedValue = partContentType && partContentType !== unwrappedValue.type ? new File([unwrappedValue], unwrappedValue.name, {
36
- type: partContentType,
37
- lastModified: unwrappedValue.lastModified
38
- }) : unwrappedValue;
39
- form.append(replacedName, encodedValue, encodedValue.name);
40
- } else if (value !== void 0 && value !== null) {
41
- const serializedValue = serializeMultipartValue(value, env);
42
- if (form instanceof FormData && partContentType) form.append(replacedName, new Blob([serializedValue], { type: partContentType }));
43
- else form.append(replacedName, serializedValue);
44
- }
45
- });
46
- return form;
47
- }
48
- if (bodyContentType === "application/x-www-form-urlencoded" && example.value !== null && typeof example.value === "object" && !Array.isArray(example.value)) {
49
- const form = new URLSearchParams();
50
- for (const [key, value] of Object.entries(example.value)) if (key && value !== void 0 && value !== null) {
51
- const replacedKey = replaceEnvVariables(key, env);
52
- const stringValue = typeof value === "string" ? value : String(value);
53
- form.append(replacedKey, replaceEnvVariables(stringValue, env));
54
- }
55
- return form;
56
- }
57
- const exampleValue = example.value !== null && typeof example.value === "object" ? unpackProxyObject(example.value) : example.value;
58
- if (exampleValue instanceof File) return exampleValue;
59
- if (typeof exampleValue === "object") return replaceEnvVariables(JSON.stringify(exampleValue), env);
60
- return typeof exampleValue === "string" ? replaceEnvVariables(exampleValue, env) : exampleValue;
61
- };
62
- //#endregion
63
- export { buildRequestBody };
64
-
65
- //# sourceMappingURL=build-request-body.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-request-body.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-body.ts"],"sourcesContent":["import { replaceEnvVariables } from '@scalar/helpers/regex/replace-variables'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/request-body'\n\nimport { getSelectedBodyContentType } from '@/v2/blocks/operation-block/helpers/get-selected-body-content-type'\nimport { getExampleFromBody } from '@/v2/blocks/request-block/helpers/get-request-body-example'\n\nconst getMultipartEncodingContentType = (\n requestBody: RequestBodyObject,\n bodyContentType: string,\n fieldName: string,\n replacedFieldName: string,\n) =>\n requestBody.content[bodyContentType]?.encoding?.[fieldName]?.contentType ??\n requestBody.content[bodyContentType]?.encoding?.[replacedFieldName]?.contentType\n\nconst serializeMultipartValue = (value: unknown, env: Record<string, string>) => {\n if (typeof value === 'string') {\n return replaceEnvVariables(value, env)\n }\n\n const serializedValue =\n typeof value === 'object' && value !== null ? JSON.stringify(unpackProxyObject(value)) : String(value)\n\n return replaceEnvVariables(serializedValue, env)\n}\n\n/**\n * Create the fetch request body\n */\nexport const buildRequestBody = (\n requestBody: RequestBodyObject | undefined,\n /** Environment variables flattened into a key-value object */\n env: Record<string, string> = {},\n /** The key of the current example */\n exampleKey = 'default',\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>,\n): BodyInit | null => {\n if (!requestBody) {\n return null\n }\n\n /** Selected content type for the body from the dropdown, stored as x-scalar-selected-content-type */\n const bodyContentType = getSelectedBodyContentType(requestBody, exampleKey)\n if (!bodyContentType) {\n return null\n }\n\n /** An example value or generated example from the schema */\n const example = getExampleFromBody(requestBody, bodyContentType, exampleKey, requestBodyCompositionSelection)\n if (!example) {\n return null\n }\n\n // Form data - array format (from UI editor)\n if (\n (bodyContentType === 'multipart/form-data' || bodyContentType === 'application/x-www-form-urlencoded') &&\n Array.isArray(example.value)\n ) {\n const exampleValue = example.value.filter((item) => !item.isDisabled) as { name: string; value: unknown }[]\n const form = bodyContentType === 'multipart/form-data' ? new FormData() : new URLSearchParams()\n\n // Loop over all entries and add them to the form\n exampleValue.forEach(({ name, value }) => {\n if (!name) {\n return\n }\n const replacedName = replaceEnvVariables(name, env)\n const partContentType =\n form instanceof FormData\n ? getMultipartEncodingContentType(requestBody, bodyContentType, name, replacedName)\n : undefined\n\n // Handle file uploads\n if (value instanceof File && form instanceof FormData) {\n /**\n * We need to unwrap the proxies to get the file name due to the\n * \"this\" context in the proxy causing an illegal invocation error\n */\n const unwrappedValue = unpackProxyObject(value)\n const encodedValue =\n partContentType && partContentType !== unwrappedValue.type\n ? new File([unwrappedValue], unwrappedValue.name, {\n type: partContentType,\n lastModified: unwrappedValue.lastModified,\n })\n : unwrappedValue\n\n form.append(replacedName, encodedValue, encodedValue.name)\n }\n // Text and structured inputs\n else if (value !== undefined && value !== null) {\n const serializedValue = serializeMultipartValue(value, env)\n\n if (form instanceof FormData && partContentType) {\n form.append(replacedName, new Blob([serializedValue], { type: partContentType }))\n } else {\n form.append(replacedName, serializedValue)\n }\n }\n })\n\n return form\n }\n\n // Form data - object format (from schema examples)\n // When the example value is a plain object and content type is form-urlencoded,\n // convert to URLSearchParams instead of JSON stringifying\n if (\n bodyContentType === 'application/x-www-form-urlencoded' &&\n example.value !== null &&\n typeof example.value === 'object' &&\n !Array.isArray(example.value)\n ) {\n const form = new URLSearchParams()\n\n // Convert object properties to form fields\n for (const [key, value] of Object.entries(example.value)) {\n if (key && value !== undefined && value !== null) {\n const replacedKey = replaceEnvVariables(key, env)\n const stringValue = typeof value === 'string' ? value : String(value)\n form.append(replacedKey, replaceEnvVariables(stringValue, env))\n }\n }\n\n return form\n }\n\n const exampleValue =\n example.value !== null && typeof example.value === 'object' ? unpackProxyObject(example.value) : example.value\n\n if (exampleValue instanceof File) {\n return exampleValue\n }\n\n // Ensure we stringify the example value if it is an object\n if (typeof exampleValue === 'object') {\n return replaceEnvVariables(JSON.stringify(exampleValue), env)\n }\n\n // Return binary or string values\n return typeof exampleValue === 'string' ? replaceEnvVariables(exampleValue, env) : exampleValue\n}\n"],"mappings":";;;;;AAOA,IAAM,mCACJ,aACA,iBACA,WACA,sBAEA,YAAY,QAAQ,kBAAkB,WAAW,YAAY,eAC7D,YAAY,QAAQ,kBAAkB,WAAW,oBAAoB;AAEvE,IAAM,2BAA2B,OAAgB,QAAgC;AAC/E,KAAI,OAAO,UAAU,SACnB,QAAO,oBAAoB,OAAO,IAAI;AAMxC,QAAO,oBAFL,OAAO,UAAU,YAAY,UAAU,OAAO,KAAK,UAAU,kBAAkB,MAAM,CAAC,GAAG,OAAO,MAAM,EAE5D,IAAI;;;;;AAMlD,IAAa,oBACX,aAEA,MAA8B,EAAE,EAEhC,aAAa,WAEb,oCACoB;AACpB,KAAI,CAAC,YACH,QAAO;;CAIT,MAAM,kBAAkB,2BAA2B,aAAa,WAAW;AAC3E,KAAI,CAAC,gBACH,QAAO;;CAIT,MAAM,UAAU,mBAAmB,aAAa,iBAAiB,YAAY,gCAAgC;AAC7G,KAAI,CAAC,QACH,QAAO;AAIT,MACG,oBAAoB,yBAAyB,oBAAoB,wCAClE,MAAM,QAAQ,QAAQ,MAAM,EAC5B;EACA,MAAM,eAAe,QAAQ,MAAM,QAAQ,SAAS,CAAC,KAAK,WAAW;EACrE,MAAM,OAAO,oBAAoB,wBAAwB,IAAI,UAAU,GAAG,IAAI,iBAAiB;AAG/F,eAAa,SAAS,EAAE,MAAM,YAAY;AACxC,OAAI,CAAC,KACH;GAEF,MAAM,eAAe,oBAAoB,MAAM,IAAI;GACnD,MAAM,kBACJ,gBAAgB,WACZ,gCAAgC,aAAa,iBAAiB,MAAM,aAAa,GACjF,KAAA;AAGN,OAAI,iBAAiB,QAAQ,gBAAgB,UAAU;;;;;IAKrD,MAAM,iBAAiB,kBAAkB,MAAM;IAC/C,MAAM,eACJ,mBAAmB,oBAAoB,eAAe,OAClD,IAAI,KAAK,CAAC,eAAe,EAAE,eAAe,MAAM;KAC9C,MAAM;KACN,cAAc,eAAe;KAC9B,CAAC,GACF;AAEN,SAAK,OAAO,cAAc,cAAc,aAAa,KAAK;cAGnD,UAAU,KAAA,KAAa,UAAU,MAAM;IAC9C,MAAM,kBAAkB,wBAAwB,OAAO,IAAI;AAE3D,QAAI,gBAAgB,YAAY,gBAC9B,MAAK,OAAO,cAAc,IAAI,KAAK,CAAC,gBAAgB,EAAE,EAAE,MAAM,iBAAiB,CAAC,CAAC;QAEjF,MAAK,OAAO,cAAc,gBAAgB;;IAG9C;AAEF,SAAO;;AAMT,KACE,oBAAoB,uCACpB,QAAQ,UAAU,QAClB,OAAO,QAAQ,UAAU,YACzB,CAAC,MAAM,QAAQ,QAAQ,MAAM,EAC7B;EACA,MAAM,OAAO,IAAI,iBAAiB;AAGlC,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,MAAM,CACtD,KAAI,OAAO,UAAU,KAAA,KAAa,UAAU,MAAM;GAChD,MAAM,cAAc,oBAAoB,KAAK,IAAI;GACjD,MAAM,cAAc,OAAO,UAAU,WAAW,QAAQ,OAAO,MAAM;AACrE,QAAK,OAAO,aAAa,oBAAoB,aAAa,IAAI,CAAC;;AAInE,SAAO;;CAGT,MAAM,eACJ,QAAQ,UAAU,QAAQ,OAAO,QAAQ,UAAU,WAAW,kBAAkB,QAAQ,MAAM,GAAG,QAAQ;AAE3G,KAAI,wBAAwB,KAC1B,QAAO;AAIT,KAAI,OAAO,iBAAiB,SAC1B,QAAO,oBAAoB,KAAK,UAAU,aAAa,EAAE,IAAI;AAI/D,QAAO,OAAO,iBAAiB,WAAW,oBAAoB,cAAc,IAAI,GAAG"}
@@ -1,31 +0,0 @@
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, originalCookieHeader, url, useCustomCookieHeader, disabledGlobalCookies, }: {
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
- /** Cookie header that previously exists from the spec OR from the user */
17
- originalCookieHeader: string | undefined | null;
18
- /** The url of the request used to filter global cookies by domain */
19
- url: string;
20
- /**
21
- * If we are running in Electron or using the proxy, we need to add a custom header
22
- * that's then forwarded as a `Cookie` header.
23
- */
24
- useCustomCookieHeader: boolean;
25
- /** The disabled global cookies for the current example */
26
- disabledGlobalCookies: Record<string, boolean>;
27
- }) => null | {
28
- name: string;
29
- value: string;
30
- };
31
- //# sourceMappingURL=build-request-cookie-header.d.ts.map
@@ -1 +0,0 @@
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,gHAQtC;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,0EAA0E;IAC1E,oBAAoB,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;IAC/C,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAA;IACX;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAA;IAC9B,0DAA0D;IAC1D,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/C,KAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CA4BvC,CAAA"}
@@ -1,55 +0,0 @@
1
- import { filterGlobalCookie } from "./filter-global-cookies.js";
2
- import { replaceEnvVariables } from "@scalar/helpers/regex/replace-variables";
3
- import { xScalarCookieSchema } from "@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies";
4
- import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
5
- //#region src/v2/blocks/operation-block/helpers/build-request-cookie-header.ts
6
- var CUSTOM_COOKIE_HEADER_WARNING = "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.";
7
- var COOKIE_HEADER_WARNING = `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:
8
-
9
- - The browser URL must be on the same domain as the server URL.
10
- - The connection must be made over HTTPS.
11
- `;
12
- /**
13
- * Generate a cookie header from the cookie params
14
- */
15
- var getCookieHeader = (cookieParams, originalCookieHeader) => {
16
- const cookieHeader = cookieParams.map((c) => `${c.name}=${c.value}`).join("; ");
17
- if (originalCookieHeader && cookieHeader) return `${originalCookieHeader}; ${cookieHeader}`;
18
- return originalCookieHeader || cookieHeader || "";
19
- };
20
- /**
21
- * Build out the cookies header taking in global, param and security scheme cookies
22
- */
23
- var buildRequestCookieHeader = ({ paramCookies, globalCookies, env, originalCookieHeader, url, useCustomCookieHeader, disabledGlobalCookies }) => {
24
- /** Generate the cookie header */
25
- const cookieHeader = getCookieHeader([...globalCookies.filter((cookie) => filterGlobalCookie({
26
- cookie,
27
- url,
28
- disabledGlobalCookies
29
- })).map((cookie) => {
30
- return coerceValue(xScalarCookieSchema, {
31
- ...cookie,
32
- name: replaceEnvVariables(cookie.name, env),
33
- value: replaceEnvVariables(cookie.value, env)
34
- });
35
- }), ...paramCookies], originalCookieHeader ?? void 0);
36
- if (cookieHeader) {
37
- if (useCustomCookieHeader) {
38
- console.warn(CUSTOM_COOKIE_HEADER_WARNING);
39
- return {
40
- name: "X-Scalar-Cookie",
41
- value: cookieHeader
42
- };
43
- }
44
- console.warn(COOKIE_HEADER_WARNING);
45
- return {
46
- name: "Cookie",
47
- value: cookieHeader
48
- };
49
- }
50
- return null;
51
- };
52
- //#endregion
53
- export { buildRequestCookieHeader };
54
-
55
- //# sourceMappingURL=build-request-cookie-header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-request-cookie-header.js","names":[],"sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-cookie-header.ts"],"sourcesContent":["import { replaceEnvVariables } from '@scalar/helpers/regex/replace-variables'\nimport {\n type XScalarCookie,\n xScalarCookieSchema,\n} from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\n\nimport { filterGlobalCookie } from '@/v2/blocks/operation-block/helpers/filter-global-cookies'\n\nconst CUSTOM_COOKIE_HEADER_WARNING =\n \"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.\"\nconst COOKIE_HEADER_WARNING = `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:\n\n - The browser URL must be on the same domain as the server URL.\n - The connection must be made over HTTPS.\n `\n\n/**\n * Generate a cookie header from the cookie params\n */\nexport const getCookieHeader = (cookieParams: XScalarCookie[], originalCookieHeader: string | undefined): string => {\n // Generate the cookie header from the cookie params\n const cookieHeader = cookieParams.map((c) => `${c.name}=${c.value}`).join('; ')\n\n // Merge with the original cookie header\n if (originalCookieHeader && cookieHeader) {\n return `${originalCookieHeader}; ${cookieHeader}`\n }\n\n // Return whichever one exists, or empty string if both are empty\n return originalCookieHeader || cookieHeader || ''\n}\n\n/**\n * Build out the cookies header taking in global, param and security scheme cookies\n */\nexport const buildRequestCookieHeader = ({\n paramCookies,\n globalCookies,\n env,\n originalCookieHeader,\n url,\n useCustomCookieHeader,\n disabledGlobalCookies,\n}: {\n /** Parsed/replaced cookies from the parameters and security schemes */\n paramCookies: XScalarCookie[]\n /** Raw global cookies from the workspace/document */\n globalCookies: XScalarCookie[]\n /** Environment variables flattened into a key-value object */\n env: Record<string, string>\n /** Cookie header that previously exists from the spec OR from the user */\n originalCookieHeader: string | undefined | null\n /** The url of the request used to filter global cookies by domain */\n url: string\n /**\n * If we are running in Electron or using the proxy, we need to add a custom header\n * that's then forwarded as a `Cookie` header.\n */\n useCustomCookieHeader: boolean\n /** The disabled global cookies for the current example */\n disabledGlobalCookies: Record<string, boolean>\n}): null | { name: string; value: string } => {\n /** Filter the global cookies by domain + parse */\n const filteredGlobalCookies = globalCookies\n .filter((cookie) => filterGlobalCookie({ cookie, url, disabledGlobalCookies }))\n .map((cookie) => {\n return coerceValue(xScalarCookieSchema, {\n ...cookie,\n name: replaceEnvVariables(cookie.name, env),\n value: replaceEnvVariables(cookie.value, env),\n })\n })\n\n /** Generate the cookie header */\n const cookieHeader = getCookieHeader([...filteredGlobalCookies, ...paramCookies], originalCookieHeader ?? undefined)\n\n if (cookieHeader) {\n // Add a custom header for the proxy (that's then forwarded as `Cookie`)\n if (useCustomCookieHeader) {\n console.warn(CUSTOM_COOKIE_HEADER_WARNING)\n return { name: 'X-Scalar-Cookie', value: cookieHeader }\n }\n\n // or stick to the original header (which might be removed by the browser)\n console.warn(COOKIE_HEADER_WARNING)\n return { name: 'Cookie', value: cookieHeader }\n }\n\n return null\n}\n"],"mappings":";;;;;AASA,IAAM,+BACJ;AACF,IAAM,wBAAwB;;;;;;;;AAS9B,IAAa,mBAAmB,cAA+B,yBAAqD;CAElH,MAAM,eAAe,aAAa,KAAK,MAAM,GAAG,EAAE,KAAK,GAAG,EAAE,QAAQ,CAAC,KAAK,KAAK;AAG/E,KAAI,wBAAwB,aAC1B,QAAO,GAAG,qBAAqB,IAAI;AAIrC,QAAO,wBAAwB,gBAAgB;;;;;AAMjD,IAAa,4BAA4B,EACvC,cACA,eACA,KACA,sBACA,KACA,uBACA,4BAmB4C;;CAa5C,MAAM,eAAe,gBAAgB,CAAC,GAXR,cAC3B,QAAQ,WAAW,mBAAmB;EAAE;EAAQ;EAAK;EAAuB,CAAC,CAAC,CAC9E,KAAK,WAAW;AACf,SAAO,YAAY,qBAAqB;GACtC,GAAG;GACH,MAAM,oBAAoB,OAAO,MAAM,IAAI;GAC3C,OAAO,oBAAoB,OAAO,OAAO,IAAI;GAC9C,CAAC;GACF,EAG4D,GAAG,aAAa,EAAE,wBAAwB,KAAA,EAAU;AAEpH,KAAI,cAAc;AAEhB,MAAI,uBAAuB;AACzB,WAAQ,KAAK,6BAA6B;AAC1C,UAAO;IAAE,MAAM;IAAmB,OAAO;IAAc;;AAIzD,UAAQ,KAAK,sBAAsB;AACnC,SAAO;GAAE,MAAM;GAAU,OAAO;GAAc;;AAGhD,QAAO"}
@@ -1,27 +0,0 @@
1
- import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
2
- import type { ParameterObject, ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
- /**
4
- * Converts the parameters into a set of headers, cookies and url params while
5
- * replacing environment variables and extracting example values. Also builds up a record of the path
6
- * parameters which can then be used to replace variables in the path.
7
- * Also handles both content based and schema based parameters.
8
- *
9
- * @param parameters - Unfiltered parameters
10
- * @param env - Environment variables flattened into a key-value object
11
- * @param exampleKey - The key of the current example
12
- * @returns A set of headers, cookies and url params
13
- */
14
- export declare const buildRequestParameters: (
15
- /** All parameters */
16
- parameters?: ReferenceType<ParameterObject>[],
17
- /** Environment variables flattened into a key-value object */
18
- env?: Record<string, string>,
19
- /** The key of the current example */
20
- exampleKey?: string) => {
21
- cookies: XScalarCookie[];
22
- headers: Record<string, string>;
23
- pathVariables: Record<string, string>;
24
- allowReservedQueryParameters: Set<string>;
25
- urlParams: URLSearchParams;
26
- };
27
- //# sourceMappingURL=build-request-parameters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-request-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-parameters.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,qEAAqE,CAAA;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAoBlH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB;AACjC,qBAAqB;AACrB,aAAY,aAAa,CAAC,eAAe,CAAC,EAAO;AACjD,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qCAAqC;AACrC,aAAY,MAAkB,KAC7B;IACD,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,4BAA4B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzC,SAAS,EAAE,eAAe,CAAA;CAwF3B,CAAA"}